|
ginnOS
The reference: libc, the libraries and the kernel
|
x86 implementation of the arch-neutral IRQ API. More...
#include "arch/arch_irq.h"#include "arch/x86/cpu/irq.h"#include "arch/x86/cpu/isr.h"#include "arch/x86/cpu/pic.h"#include "arch/x86/cpu/apic.h"#include "kernel/cpu/cpu.h"Macros | |
| #define | IRQ_LINE_COUNT 16 |
Functions | |
| int | arch_irq_register (uint32_t irq, irq_handler_fn handler) |
| register a handler for a hardware IRQ line. | |
| void | arch_irq_enable (uint32_t irq) |
| unmask (enable) a hardware IRQ line so it can be delivered. | |
| void | arch_irq_disable (uint32_t irq) |
| mask (disable) a hardware IRQ line. | |
| void | arch_irq_ack (uint32_t irq) |
| acknowledge an IRQ (end-of-interrupt) at the interrupt controller. | |
| bool | arch_irq_set_cpu (uint32_t irq, uint32_t cpu) |
| send the interrupts of an ISA IRQ line to a core. | |
| bool | irq_line_wanted (uint32_t irq) |
| true if the IRQ layer has enabled the line (arch_irq_enable). | |
| bool | arch_frame_is_user (const trap_frame_t *frame) |
| true if the interrupt came while user code ran (CPU time accounting). | |
x86 implementation of the arch-neutral IRQ API.
wraps the existing PIC/IRQ machinery. neutral handlers are kept in a table indexed by IRQ line; a single adapter registered with the x86 IRQ layer recovers the line number from the saved register state and forwards to the neutral handler. this keeps irq.c's dispatch, spurious-IRQ handling, and EOI logic untouched while giving portable drivers a stable interface.
on x86, trap_frame_t is the ISR register dump (struct registers); the cast lives here because this is the only place that legitimately knows the layout.
| #define IRQ_LINE_COUNT 16 |
| int arch_irq_register | ( | uint32_t | irq, |
| irq_handler_fn | handler ) |
register a handler for a hardware IRQ line.
| irq | the IRQ line to handle. |
| handler | the function to call when the line fires. |
| void arch_irq_enable | ( | uint32_t | irq | ) |
unmask (enable) a hardware IRQ line so it can be delivered.
| irq | the IRQ line to enable. |
| void arch_irq_disable | ( | uint32_t | irq | ) |
mask (disable) a hardware IRQ line.
| irq | the IRQ line to disable. |
| void arch_irq_ack | ( | uint32_t | irq | ) |
acknowledge an IRQ (end-of-interrupt) at the interrupt controller.
| irq | the IRQ line to acknowledge. |
send the interrupts of an ISA IRQ line to a core.
the vector does not change, so an interrupt that comes during the change goes to the old core or to the new one, and both handle it.
| irq | the IRQ line (0 to 15). |
| cpu | the index of the core (cpu_t.index). |
true if the IRQ layer has enabled the line (arch_irq_enable).
apic_init uses it to enable the same lines on the I/O APIC.
| bool arch_frame_is_user | ( | const trap_frame_t * | frame | ) |
true if the interrupt came while user code ran (CPU time accounting).
| frame | the frame a handler was given. |