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
Decoupling Architectural-specific Code (#35)
[lunaix-os.git]
/
lunaix-os
/
hal
/
ahci
/
ahci.c
diff --git
a/lunaix-os/hal/ahci/ahci.c
b/lunaix-os/hal/ahci/ahci.c
index 3d90845ef795ce8e9f70432a8f0dadea51fc77c3..bd84bf8a6f6cf88eb946bf3f605a7df7e5fba05d 100644
(file)
--- a/
lunaix-os/hal/ahci/ahci.c
+++ b/
lunaix-os/hal/ahci/ahci.c
@@
-19,11
+19,10
@@
#include <klibc/string.h>
#include <lunaix/block.h>
#include <klibc/string.h>
#include <lunaix/block.h>
-#include <lunaix/isrm.h>
+#include <lunaix/
generic/
isrm.h>
#include <lunaix/mm/mmio.h>
#include <lunaix/mm/mmio.h>
-#include <lunaix/mm/pmm.h>
#include <lunaix/mm/valloc.h>
#include <lunaix/mm/valloc.h>
-#include <lunaix/mm/
vmm
.h>
+#include <lunaix/mm/
page
.h>
#include <lunaix/spike.h>
#include <lunaix/syslog.h>
#include <lunaix/spike.h>
#include <lunaix/syslog.h>
@@
-128,16
+127,19
@@
ahci_driver_init(struct ahci_driver_param* param)
__hba_reset_port(port_regs);
#endif
__hba_reset_port(port_regs);
#endif
+ struct leaflet* leaflet;
if (!clbp) {
// 每页最多4个命令队列
if (!clbp) {
// 每页最多4个命令队列
- clb_pa = pmm_alloc_page(KERNEL_PID, PP_FGLOCKED);
- clb_pg_addr = (ptr_t)ioremap(clb_pa, 0x1000);
+ leaflet = alloc_leaflet(0);
+ clb_pa = leaflet_addr(leaflet);
+ clb_pg_addr = vmap(leaflet, KERNEL_DATA);
memset((void*)clb_pg_addr, 0, 0x1000);
}
if (!fisp) {
// 每页最多16个FIS
memset((void*)clb_pg_addr, 0, 0x1000);
}
if (!fisp) {
// 每页最多16个FIS
- fis_pa = pmm_alloc_page(KERNEL_PID, PP_FGLOCKED);
- fis_pg_addr = (ptr_t)ioremap(fis_pa, 0x1000);
+ leaflet = alloc_leaflet(0);
+ fis_pa = leaflet_addr(leaflet);
+ fis_pg_addr = vmap(leaflet, KERNEL_DATA);
memset((void*)fis_pg_addr, 0, 0x1000);
}
memset((void*)fis_pg_addr, 0, 0x1000);
}