X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/59ecf21e36b2332f6adf2a568ef555283d8c119a..0fd474df7001837bde53da0e42e83081827c9641:/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 c843d29..b751cdc 100644 --- a/lunaix-os/hal/ahci/io_event.c +++ b/lunaix-os/hal/ahci/io_event.c @@ -1,21 +1,21 @@ #include #include -#include #include #include LOG_MODULE("io_evt") void -ahci_hba_isr(const isr_param* param) +ahci_hba_isr(irq_t irq, const struct hart_state* hstate) { struct ahci_hba* hba; struct ahci_driver *pos, *n; - struct llist_header* ahcis = (struct llist_header*)isrm_get_payload(param); + struct llist_header* ahcis; + ahcis = irq_payload(irq, struct llist_header); llist_for_each(pos, n, ahcis, ahci_drvs) { - if (pos->id == (int)param->execp->vector) { + if (pos->id == hart_vector_stamp(hstate)) { hba = &pos->hba; goto proceed; } @@ -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 = 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 - __builtin_clz(processed); + u32_t slot = msbiti - clz(processed); struct hba_cmd_state* cmdstate = cmdctx->issued[slot]; if (!cmdstate) {