irq: make IRQs dynamically mappable
This commit is contained in:
parent
4b813d7c86
commit
b8b67aadc9
7 changed files with 108 additions and 21 deletions
13
dev/pci.c
13
dev/pci.c
|
|
@ -24,6 +24,19 @@ uint16_t pci_config_read_word(uint8_t bus, uint8_t slot, uint8_t func, uint8_t o
|
|||
return tmp;
|
||||
}
|
||||
|
||||
void pci_config_write_word(uint8_t bus, uint8_t slot, uint8_t func, uint8_t offset, uint16_t data)
|
||||
{
|
||||
uint32_t addr;
|
||||
uint32_t lbus = bus;
|
||||
uint32_t lslot = slot;
|
||||
uint32_t lfunc = func;
|
||||
|
||||
addr = (lbus << 16) | (lslot << 11) | (lfunc << 8) | (offset & 0xfc) | 0x80000000;
|
||||
|
||||
outl(PCIPM_CONFIG_ADDRESS, addr);
|
||||
outl(PCIPM_CONFIG_DATA, data);
|
||||
}
|
||||
|
||||
static void pci_scan_bus(uint8_t bus)
|
||||
{
|
||||
for (uint8_t slot = 0; slot < 32; slot++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue