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
feat: kprintf now goes into dedicated pseudo-dev rather than flooding the framebuffer
[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 220038ac6d112602ceb17831117ac638f7f0ce3a..33dc87e3a05287e859baebcdd06c1f6b4e337aeb 100644
(file)
--- a/
lunaix-os/hal/ahci/ahci.c
+++ b/
lunaix-os/hal/ahci/ahci.c
@@
-31,7
+31,7
@@
#define HBA_CLB_SIZE 1024
#define HBA_MY_IE (HBA_PxINTR_DHR | HBA_PxINTR_TFE | HBA_PxINTR_OF)
#define HBA_CLB_SIZE 1024
#define HBA_MY_IE (HBA_PxINTR_DHR | HBA_PxINTR_TFE | HBA_PxINTR_OF)
-#define AHCI_DEVCLASS DEVCLASS(DEVIF_PCI, DEVFN_STORAGE, DEV_SATA
, 0
)
+#define AHCI_DEVCLASS DEVCLASS(DEVIF_PCI, DEVFN_STORAGE, DEV_SATA)
// #define DO_HBA_FULL_RESET
// #define DO_HBA_FULL_RESET
@@
-186,12
+186,12
@@
ahci_driver_init(struct device_def* def, struct device* dev)
port_regs[HBA_RPxCMD] |= HBA_PxCMD_ST;
if (!ahci_init_device(port)) {
port_regs[HBA_RPxCMD] |= HBA_PxCMD_ST;
if (!ahci_init_device(port)) {
- kprintf(KERROR "init fail: 0x%x@p%d
\n
", port->regs[HBA_RPxSIG], i);
+ kprintf(KERROR "init fail: 0x%x@p%d", port->regs[HBA_RPxSIG], i);
continue;
}
struct hba_device* hbadev = port->device;
continue;
}
struct hba_device* hbadev = port->device;
- kprintf(KINFO "sata%d: %s, blk_size=%d, blk=0..%d
\n
",
+ kprintf(KINFO "sata%d: %s, blk_size=%d, blk=0..%d",
i,
hbadev->model,
hbadev->block_size,
i,
hbadev->model,
hbadev->block_size,
@@
-200,7
+200,7
@@
ahci_driver_init(struct device_def* def, struct device* dev)
ahci_register_device(hbadev);
}
ahci_register_device(hbadev);
}
-
dev->underlay = ahci_drv
;
+
pci_bind_instance(ahci_dev, ahci_drv)
;
return 0;
}
return 0;
}
@@
-444,10
+444,9
@@
achi_register_ops(struct hba_port* port)
static struct pci_device_def ahcidef = {
.dev_class = AHCI_HBA_CLASS,
static struct pci_device_def ahcidef = {
.dev_class = AHCI_HBA_CLASS,
- .dev_vendor = PCI_ID_ANY,
- .dev_id = PCI_ID_ANY,
- .devdef = { .class = DEVCLASS(DEVIF_PCI, DEVFN_STORAGE, DEV_SATA, 0),
+ .ident_mask = PCI_MATCH_ANY,
+ .devdef = { .class = DEVCLASS(DEVIF_PCI, DEVFN_STORAGE, DEV_SATA),
.name = "Serial ATA Controller",
.name = "Serial ATA Controller",
- .
init_for
= ahci_driver_init }
+ .
bind
= ahci_driver_init }
};
};
-EXPORT_
DEVICE(ahci, &ahcidef.devdef, load_on_demand
);
\ No newline at end of file
+EXPORT_
PCI_DEVICE(ahci, &ahcidef
);
\ No newline at end of file