|
ginnOS
The reference: libc, the libraries and the kernel
|
interrupts for PCI devices: MSI-X, MSI, or the legacy INTx line. More...
Go to the source code of this file.
Data Structures | |
| struct | pci_irq_info_t |
| one attached handler, for /proc/interrupts. More... | |
Macros | |
| #define | PCI_IRQ_MAX 16 |
Enumerations | |
| enum | pci_irq_mode_t { PCI_IRQ_NONE , PCI_IRQ_INTX , PCI_IRQ_MSI , PCI_IRQ_MSIX } |
Functions | |
| pci_irq_mode_t | pci_irq_attach (pci_device_t *dev, device_irq_handler_t handler, void *context, const char *name) |
| attach an interrupt handler to a device and enable its interrupt. | |
| bool | pci_irq_info (uint32_t index, pci_irq_info_t *info) |
| the attached handler at an index. | |
| bool | pci_irq_set_cpu (uint32_t index, uint32_t cpu) |
| send the messages of an attached handler to a core. | |
| const char * | pci_irq_mode_name (pci_irq_mode_t mode) |
| a short name for a mode ("MSI-X", "MSI", "INTx", "none"). | |
interrupts for PCI devices: MSI-X, MSI, or the legacy INTx line.
a driver attaches one handler to its device. pci_irq_attach uses the best way the device and the CPU support: MSI-X (entry 0), then MSI (one message), then the interrupt line the firmware routed (INTx, shared, level-triggered). MSI and MSI-X need the local APIC; with the 8259 PICs only INTx is possible.
limits: without an AML interpreter the kernel cannot read the ACPI _PRT, so INTx uses the ISA line from the configuration space (irq_line). this works with the 8259 PICs and on QEMU with the I/O APIC, but on real machines with the I/O APIC a device without MSI can stay without interrupts. drivers must keep a polled path for this case.
| #define PCI_IRQ_MAX 16 |
| enum pci_irq_mode_t |
| pci_irq_mode_t pci_irq_attach | ( | pci_device_t * | dev, |
| device_irq_handler_t | handler, | ||
| void * | context, | ||
| const char * | name ) |
attach an interrupt handler to a device and enable its interrupt.
call it once per device, before the device is told to raise interrupts.
| dev | the device. |
| handler | the function to call; it must clear the cause in the device, and for INTx it must return quickly when its device has nothing to report (the line can be shared). |
| context | passed to the handler. |
| name | a short name for /proc/interrupts. |
| bool pci_irq_info | ( | uint32_t | index, |
| pci_irq_info_t * | info ) |
the attached handler at an index.
send the messages of an attached handler to a core.
an INTx handler does not move here: its line moves with irq_set_cpu().
| index | the index of the handler, as for pci_irq_info(). |
| cpu | the index of the core (cpu_t.index). |
| const char * pci_irq_mode_name | ( | pci_irq_mode_t | mode | ) |
a short name for a mode ("MSI-X", "MSI", "INTx", "none").