X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/2236410f4582ab45ae8c384dd6eeeef5d10aab15..1375eb51603466b723ab7dd1ca4194ee5d662f75:/lunaix-os/hal/ahci/io_event.c diff --git a/lunaix-os/hal/ahci/io_event.c b/lunaix-os/hal/ahci/io_event.c index 2ad988a..aec209e 100644 --- a/lunaix-os/hal/ahci/io_event.c +++ b/lunaix-os/hal/ahci/io_event.c @@ -28,7 +28,7 @@ proceed: if (!hba->base[HBA_RIS]) return; - u32_t port_num = 31 - __builtin_clz(hba->base[HBA_RIS]); + u32_t port_num = 31 - 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 - __builtin_clz(processed); + u32_t slot = 31 - clz(processed); struct hba_cmd_state* cmdstate = cmdctx->issued[slot]; if (!cmdstate) { @@ -65,7 +65,7 @@ proceed: blkio_schedule(ioreq->io_ctx); blkio_complete(ioreq); - vfree(cmdstate->cmd_table); + vfree_dma(cmdstate->cmd_table); done: hba_clear_reg(port->regs[HBA_RPxIS]);