The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
irq.h File Reference
#include "isr.h"

Go to the source code of this file.

Macros

#define PIC_REMAP_OFFSET   0x20
 IDT vector at which IRQ 0 is mapped.

Typedefs

typedef void(*) irq_handler_t(struct registers *regs)
 IRQ handler function type.

Functions

void irq_initialize (void)
 initialize the IRQ subsystem.
void irq_register_handler (int irq, irq_handler_t handler)
 register a handler function for a specific hardware IRQ line.
bool irq_line_wanted (uint32_t irq)
 true if the IRQ layer has enabled the line (arch_irq_enable).

Macro Definition Documentation

◆ PIC_REMAP_OFFSET

#define PIC_REMAP_OFFSET   0x20

IDT vector at which IRQ 0 is mapped.

IRQs 0–15 occupy vectors PIC_REMAP_OFFSET through PIC_REMAP_OFFSET+15. Must stay above the CPU exception range (0–31) and must match the value passed to pic_configure() in irq_initialize().

Typedef Documentation

◆ irq_handler_t

typedef void(*) irq_handler_t(struct registers *regs)

IRQ handler function type.

Parameters
regspointer to the saved register state at the time of the interrupt.

Function Documentation

◆ irq_initialize()

void irq_initialize ( void )

initialize the IRQ subsystem.

configures the PIC, registers ISR handlers for the 16 hardware IRQ lines, and enables hardware interrupts.

◆ irq_register_handler()

void irq_register_handler ( int irq,
irq_handler_t handler )

register a handler function for a specific hardware IRQ line.

Parameters
irqthe IRQ number (0–15).
handlerpointer to the handler function to call when this IRQ fires.

◆ irq_line_wanted()

bool irq_line_wanted ( uint32_t irq)

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.