Преглед изворни кода

change(ata): make identify() return a status value

greatbridf пре 2 година
родитељ
комит
f9ba0231e8
2 измењених фајлова са 6 додато и 4 уклоњено
  1. 1 1
      include/kernel/hw/ata.hpp
  2. 5 3
      src/kernel/hw/ata.cpp

+ 1 - 1
include/kernel/hw/ata.hpp

@@ -47,7 +47,7 @@ public:
 
     stat_t status(void) const;
 
-    void identify(void) const;
+    bool identify(void) const;
     int select(bool master);
 
     size_t read_data(char* buf, size_t n) const;

+ 5 - 3
src/kernel/hw/ata.cpp

@@ -28,7 +28,7 @@ hw::ata::stat_t hw::ata::status(void) const
     return hw::ata::stat_t { *stats };
 }
 
-void hw::ata::identify(void) const
+bool hw::ata::identify(void) const
 {
     char buf[512] {};
 
@@ -44,12 +44,14 @@ void hw::ata::identify(void) const
         ;
 
     if (stat.in.err)
-        syscall(0x03);
+        return false;
 
     read_data(buf, 512);
 
     if (!status().in.rdy)
-        syscall(0x03);
+        return false;
+
+    return true;
 }
 
 int hw::ata::select(bool master)