The Programmable Interrupt Controller (PIC) can be used to control hardware interrupts / IRQs. A device driver can set an IRQ handler through picReserveIRQ() and free it again with picFreeIRQ().
For more information about IRQs and Interrupts take a look at http://wiki.osdev.org/IRQ
◆ IRQ_ATA1
First ATA device (Hard disk or CD)
Definition at line 76 of file pic.h.
◆ IRQ_ATA2
Second ATA device (Hard disk or CD)
Definition at line 77 of file pic.h.
◆ IRQ_CMOS_CLOCK
The CMOS clock was just updated
Definition at line 73 of file pic.h.
◆ IRQ_COM1
The COM Port 1 received data
Definition at line 69 of file pic.h.
◆ IRQ_COM2
The COM Port 2 received data
Definition at line 68 of file pic.h.
◆ IRQ_FLOPPY
The floppy driver has read some data
Definition at line 71 of file pic.h.
◆ IRQ_FPU
Not used in modern CPUs
Definition at line 75 of file pic.h.
◆ IRQ_KEYBOARD
A key was pressed on the Keyboard
Definition at line 66 of file pic.h.
◆ IRQ_LPT1
The LPT Port 1 received data
Definition at line 72 of file pic.h.
◆ IRQ_LPT2
The LPT Port 2 received data
Definition at line 70 of file pic.h.
◆ IRQ_PIT
◆ IRQ_PS2_MOUSE
The mouse was moved or clicked
Definition at line 74 of file pic.h.
◆ IRQ_SLAVE
The slave PIC received an IRQ
Definition at line 67 of file pic.h.
◆ picFreeIRQ()
void picFreeIRQ |
( |
uint32_t |
irq | ) |
|
Release an IRQ.
Call this function if you do not longer need to listen for this IRQ.
- Parameters
-
irq | The previously requested IRQ |
Definition at line 186 of file pic.c.
◆ picInit()
void picInit |
( |
uint32_t |
interruptOffset | ) |
|
Initializes the programmable interrupt controller.
The PIC is required to handle hardware interrupts / IRQs. There are (theoretically) 16 hardware IRQs which can be mapped to interrupts.
- Parameters
-
interruptOffset | The first interrupt which should handle the IRQs |
Definition at line 103 of file pic.c.
◆ picReserveIRQ()
Assign a callback function to an IRQ.
This function allows a device driver to get notified on an IRQ by executing a callback. The function can then handle the input and return the control back to the user program.
- Parameters
-
irq | The irq which should be assigned |
callback | The function which should be called on the irq |
- Returns
- True, if the interrupt is not taken yet, false otherwise.
Definition at line 151 of file pic.c.
◆ irqBase
Definition at line 45 of file pic.c.
◆ irqTable
Definition at line 47 of file pic.c.