diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-24 15:08:01 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-24 15:08:01 +0100 |
commit | 7e908dabaaf6c67ef5000406a0bb3a6a29beca01 (patch) | |
tree | b0516cc4771ca3a8e202327d2864804afefe4cfc /src/kernel/dev/pci.c | |
parent | 91c5969cdddf2241418082998e76bdbb836ed03e (diff) | |
download | kogata-7e908dabaaf6c67ef5000406a0bb3a6a29beca01.tar.gz kogata-7e908dabaaf6c67ef5000406a0bb3a6a29beca01.zip |
Add PCI IDE driver (only PIO mode, no DMA yet.)
Diffstat (limited to 'src/kernel/dev/pci.c')
-rw-r--r-- | src/kernel/dev/pci.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kernel/dev/pci.c b/src/kernel/dev/pci.c index cfd2318..147eff5 100644 --- a/src/kernel/dev/pci.c +++ b/src/kernel/dev/pci.c @@ -193,21 +193,21 @@ void pci_setup() { void pci_irq_storage(registers_t *r) { for (int i = 0; i < PCI_MAX_DEVICES; i++) { if (pci_devices[i].irq == PCI_IRQ_STORAGE && pci_devices[i].irq_handler != 0) - pci_devices[i].irq_handler(); + pci_devices[i].irq_handler(i); } } void pci_irq_network(registers_t *r) { for (int i = 0; i < PCI_MAX_DEVICES; i++) { if (pci_devices[i].irq == PCI_IRQ_NETWORK && pci_devices[i].irq_handler != 0) - pci_devices[i].irq_handler(); + pci_devices[i].irq_handler(i); } } void pci_irq_default(registers_t *r) { for (int i = 0; i < PCI_MAX_DEVICES; i++) { if (pci_devices[i].irq == PCI_IRQ_DEFAULT && pci_devices[i].irq_handler != 0) - pci_devices[i].irq_handler(); + pci_devices[i].irq_handler(i); } } @@ -217,8 +217,8 @@ void pci_set_irq(int dev_id, uint8_t irq) { && irq != PCI_IRQ_STORAGE && irq != PCI_IRQ_NETWORK && irq != PCI_IRQ_DISABLE) return; - pci_devices[dev_id].irq = irq; pci_write_config_byte(dev_id, PCI_CONFIG_INTERRUPT_LINE, irq); + pci_devices[dev_id].irq = pci_read_config_byte(dev_id, PCI_CONFIG_INTERRUPT_LINE); } /* vim: set ts=4 sw=4 tw=0 noet :*/ |