X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/d1b1c8d9119229dbeed06cd252917e54a1cb77f6..7e13988c1113d38bec17bd79b71757d78d977e76:/lunaix-os/hal/ahci/io_event.c?ds=sidebyside diff --git a/lunaix-os/hal/ahci/io_event.c b/lunaix-os/hal/ahci/io_event.c index 4e77f98..608634d 100644 --- a/lunaix-os/hal/ahci/io_event.c +++ b/lunaix-os/hal/ahci/io_event.c @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include @@ -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) {