|
ginnOS
The reference: libc, the libraries and the kernel
|
#include "arch/arch_irq.h"#include "apic.h"#include "isr.h"#include "irq.h"#include "kernel/cpu/cpu.h"Macros | |
| #define | DEVICE_VECTOR_FIRST 0x30 |
| message-signalled interrupts on x86 (Intel SDM volume 3, section 11.11). | |
| #define | DEVICE_VECTOR_LAST 0x7F |
| #define | DEVICE_VECTOR_COUNT (DEVICE_VECTOR_LAST - DEVICE_VECTOR_FIRST + 1) |
| #define | MSI_ADDRESS_BASE 0xFEE00000u |
Functions | |
| bool | arch_msi_alloc (device_irq_handler_t handler, void *context, uint64_t *address, uint32_t *data) |
| allocate an interrupt vector for a message-signalled interrupt (PCI MSI or MSI-X) and give the message that the device must write to raise it. | |
| uint64_t | arch_msi_address (uint32_t cpu) |
| the message address that sends a message-signalled interrupt to a core. | |
| void | arch_irq_set_level (uint32_t irq) |
| make an ISA IRQ line level-triggered, for a PCI interrupt line that the firmware routed to it. | |
| #define DEVICE_VECTOR_FIRST 0x30 |
message-signalled interrupts on x86 (Intel SDM volume 3, section 11.11).
a device raises an MSI by a memory write: the address selects the local APIC (0xFEE00000 with the APIC id in bits 12 to 19), and the data is the vector (fixed delivery, edge). each allocation takes one vector from the device range below. the vector handler sends the end of interrupt first, like the IRQ path does, and then calls the device handler.
| #define DEVICE_VECTOR_LAST 0x7F |
| #define DEVICE_VECTOR_COUNT (DEVICE_VECTOR_LAST - DEVICE_VECTOR_FIRST + 1) |
| #define MSI_ADDRESS_BASE 0xFEE00000u |
| bool arch_msi_alloc | ( | device_irq_handler_t | handler, |
| void * | context, | ||
| uint64_t * | address, | ||
| uint32_t * | data ) |
allocate an interrupt vector for a message-signalled interrupt (PCI MSI or MSI-X) and give the message that the device must write to raise it.
| handler | the function to call when the message arrives. |
| context | passed to the handler. |
| address | receives the message address. |
| data | receives the message data. |
the message address that sends a message-signalled interrupt to a core.
the message data (the vector) is the same on each core.
| cpu | the index of the core (cpu_t.index). |
| void arch_irq_set_level | ( | uint32_t | irq | ) |
make an ISA IRQ line level-triggered, for a PCI interrupt line that the firmware routed to it.
does nothing when the line is already level or when the 8259 PICs are in use (the firmware sets their trigger mode).
| irq | the IRQ line (0 to 15). |