The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
Loading...
Searching...
No Matches
irq.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
isr.h
"
4
5
/**
6
* IDT vector at which IRQ 0 is mapped.
7
* IRQs 0–15 occupy vectors PIC_REMAP_OFFSET through PIC_REMAP_OFFSET+15.
8
* Must stay above the CPU exception range (0–31) and must match the value
9
* passed to pic_configure() in irq_initialize().
10
*/
11
#define PIC_REMAP_OFFSET 0x20
12
13
/**
14
* IRQ handler function type.
15
* @param regs pointer to the saved register state at the time of the interrupt.
16
*/
17
typedef
void (*
irq_handler_t
)(
struct
registers
*regs);
18
19
/**
20
* initialize the IRQ subsystem.
21
* configures the PIC, registers ISR handlers for the 16 hardware IRQ lines,
22
* and enables hardware interrupts.
23
*/
24
void
irq_initialize
(
void
);
25
26
/**
27
* register a handler function for a specific hardware IRQ line.
28
* @param irq the IRQ number (0–15).
29
* @param handler pointer to the handler function to call when this IRQ fires.
30
*/
31
void
irq_register_handler
(
int
irq,
irq_handler_t
handler);
32
33
/**
34
* true if the IRQ layer has enabled the line (arch_irq_enable). apic_init
35
* uses it to enable the same lines on the I/O APIC.
36
*/
37
bool
irq_line_wanted
(
uint32_t
irq);
irq_register_handler
void irq_register_handler(int irq, irq_handler_t handler)
register a handler function for a specific hardware IRQ line.
Definition
irq.c:108
irq_initialize
void irq_initialize(void)
initialize the IRQ subsystem.
Definition
irq.c:96
irq_handler_t
void(*) irq_handler_t(struct registers *regs)
IRQ handler function type.
Definition
irq.h:17
irq_line_wanted
bool irq_line_wanted(uint32_t irq)
true if the IRQ layer has enabled the line (arch_irq_enable).
Definition
arch_irq_x86.c:110
isr.h
uint32_t
unsigned int uint32_t
Definition
fb.h:17
registers
saved register state pushed onto the stack by ISR stubs.
Definition
isr.h:41
src
arch
x86
cpu
irq.h
Generated by
1.18.0