Merge branch 'master' into isa/arm64
[lunaix-os.git] / lunaix-os / hal / ahci / io_event.c
index 4e77f98ab25674cc7321e77c15477eb0bd6f34f8..608634d84e5fdbd52151441380a4ea099ee55e5f 100644 (file)
@@ -1,6 +1,6 @@
 #include <hal/ahci/ahci.h>
 #include <hal/ahci/sata.h>
-#include <lunaix/generic/isrm.h>
+#include <asm-generic/isrm.h>
 #include <lunaix/mm/valloc.h>
 #include <lunaix/syslog.h>
 
@@ -28,7 +28,7 @@ proceed:
     if (!hba->base[HBA_RIS])
         return;
 
-    u32_t port_num = 31 - clz(hba->base[HBA_RIS]);
+    u32_t port_num = msbiti - clz(hba->base[HBA_RIS]);
     struct hba_port* port = hba->ports[port_num];
     struct hba_cmd_context* cmdctx = &port->cmdctx;
     u32_t processed = port->regs[HBA_RPxCI] ^ cmdctx->tracked_ci;
@@ -48,7 +48,7 @@ proceed:
         goto done;
     }
 
-    u32_t slot = 31 - clz(processed);
+    u32_t slot = msbiti - clz(processed);
     struct hba_cmd_state* cmdstate = cmdctx->issued[slot];
 
     if (!cmdstate) {