summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-07-22 22:17:54 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-07-22 22:17:54 +0200
commit70d880905c37cfde7f4ddfe46c5cab582dd36ab7 (patch)
treed57352f8d5c6d7819ec83ac900c83dcb28c67883 /src
parent13435bfc961fd2abd5f688ce37e94d5f96b0873b (diff)
downloadabaos-70d880905c37cfde7f4ddfe46c5cab582dd36ab7.tar.gz
abaos-70d880905c37cfde7f4ddfe46c5cab582dd36ab7.tar.bz2
added interrupt to PCI descriptors
Diffstat (limited to 'src')
-rw-r--r--src/hardware/pci.c4
-rw-r--r--src/hardware/pci.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/hardware/pci.c b/src/hardware/pci.c
index f544d98..6b622c1 100644
--- a/src/hardware/pci.c
+++ b/src/hardware/pci.c
@@ -20,6 +20,7 @@
#define PCI_CLASS 0x0B
#define PCI_HEADER_TYPE 0x0E
#define PCI_BAR_BASE 0x10
+#define PCI_INTERRUPT 0x3C
void pci_controller_init( pci_controller_t *controller )
{
@@ -134,6 +135,7 @@ void pci_device_descriptor_init( pci_device_descriptor_t *descriptor, pci_contro
descriptor->subclass_id = pci_controller_read( controller, bus, device, function, PCI_SUBCLASS );
descriptor->interface_id = pci_controller_read( controller, bus, device, function, PCI_INTERFACE );
descriptor->revision_id = pci_controller_read( controller, bus, device, function, PCI_REVISION );
+ descriptor->interrupt = pci_controller_read( controller, bus, device, function, PCI_INTERRUPT ) & 0xFF;
}
void pci_base_address_register_init( pci_base_address_register_t *base_address_register, pci_controller_t *controller, uint16_t bus, uint16_t device, uint16_t function, uint16_t bar )
@@ -179,7 +181,7 @@ driver_t *pci_device_get_driver( pci_device_descriptor_t *descriptor, interrupt_
switch( descriptor->device_id ) {
case 0x8139: // RTL8139
driver = (driver_t *)malloc( sizeof( rtl8139_t ) );
- rtl8139_init( (rtl8139_t *)driver, interrupt, context );
+ rtl8139_init( (rtl8139_t *)driver, descriptor, interrupt, context );
break;
}
break;
diff --git a/src/hardware/pci.h b/src/hardware/pci.h
index fcc957e..9bc29bb 100644
--- a/src/hardware/pci.h
+++ b/src/hardware/pci.h
@@ -15,6 +15,7 @@ typedef struct {
uint8_t interface_id;
uint8_t revision_id;
uint32_t port_base;
+ uint8_t interrupt;
} pci_device_descriptor_t;
typedef struct {