#include <hal/ahci/ahci.h>
#include <hal/ahci/sata.h>
-#include <lunaix/isrm.h>
+#include <asm-generic/isrm.h>
#include <lunaix/mm/valloc.h>
#include <lunaix/syslog.h>
LOG_MODULE("io_evt")
void
-ahci_hba_isr(const isr_param* param)
+ahci_hba_isr(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 = (struct llist_header*)isrm_get_payload(hstate);
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;
}
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;
goto done;
}
- u32_t slot = 31 - clz(processed);
+ u32_t slot = msbiti - clz(processed);
struct hba_cmd_state* cmdstate = cmdctx->issued[slot];
if (!cmdstate) {