git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support to multi-threading and pthread interface (POSIX.1-2008) (#23)
[lunaix-os.git]
/
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 e11016a3b5a1165208e1a78b40fef4465226d819..aec209e56a289c720c9786dfc05949c473c6c204 100644
(file)
--- a/
lunaix-os/hal/ahci/io_event.c
+++ b/
lunaix-os/hal/ahci/io_event.c
@@
-6,16
+6,16
@@
LOG_MODULE("io_evt")
LOG_MODULE("io_evt")
-extern struct llist_header ahcis;
-
void
void
-
__
ahci_hba_isr(const isr_param* param)
+ahci_hba_isr(const isr_param* param)
{
struct ahci_hba* hba;
struct ahci_driver *pos, *n;
{
struct ahci_hba* hba;
struct ahci_driver *pos, *n;
- llist_for_each(pos, n, &ahcis, ahci_drvs)
+ struct llist_header* ahcis = (struct llist_header*)isrm_get_payload(param);
+
+ llist_for_each(pos, n, ahcis, ahci_drvs)
{
{
- if (pos->id ==
param
->vector) {
+ if (pos->id ==
(int)param->execp
->vector) {
hba = &pos->hba;
goto proceed;
}
hba = &pos->hba;
goto proceed;
}
@@
-28,7
+28,7
@@
proceed:
if (!hba->base[HBA_RIS])
return;
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;
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;
}
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) {
struct hba_cmd_state* cmdstate = cmdctx->issued[slot];
if (!cmdstate) {
@@
-65,7
+65,7
@@
proceed:
blkio_schedule(ioreq->io_ctx);
blkio_complete(ioreq);
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]);
done:
hba_clear_reg(port->regs[HBA_RPxIS]);