The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
pic.h
Go to the documentation of this file.
1#pragma once
2
3#include "common/stdint.h"
4
5/**
6 * configure the 8259A PIC.
7 * remaps IRQ lines to the specified IDT vector offsets.
8 * @param offset_master base vector offset for the master PIC (IRQ 0–7).
9 * @param offset_slave base vector offset for the slave PIC (IRQ 8–15).
10 */
11void pic_configure(uint8_t offset_master, uint8_t offset_slave);
12
13/**
14 * send an End-of-Interrupt (EOI) signal to the PIC.
15 * if the IRQ came from the slave PIC, sends EOI to both slave and master.
16 * @param irq the IRQ number (0–15).
17 */
18void pic_send_eoi(int irq);
19
20/**
21 * disable both PICs by masking all IRQ lines.
22 */
23void pic_disable(void);
24
25/**
26 * mask (disable) a specific IRQ line.
27 * @param irq the IRQ number (0–15).
28 */
29void pic_mask(int irq);
30
31/**
32 * unmask (enable) a specific IRQ line.
33 * @param irq the IRQ number (0–15).
34 */
35void pic_unmask(int irq);
36
37/**
38 * read the Interrupt Request Register (IRR) from both PICs.
39 * @return 16-bit value with master in low byte, slave in high byte.
40 */
42
43/**
44 * read the In-Service Register (ISR) from both PICs.
45 * @return 16-bit value with master in low byte, slave in high byte.
46 */
unsigned char uint8_t
Definition fb.h:18
unsigned short uint16_t
Definition stdint.h:13
void pic_mask(int irq)
mask (disable) a specific IRQ line.
Definition pic.c:100
void pic_send_eoi(int irq)
send an End-of-Interrupt (EOI) signal to the PIC.
Definition pic.c:80
void pic_disable(void)
disable both PICs by masking all IRQ lines.
Definition pic.c:92
void pic_configure(uint8_t offset_master, uint8_t offset_slave)
configure the 8259A PIC.
Definition pic.c:45
void pic_unmask(int irq)
unmask (enable) a specific IRQ line.
Definition pic.c:119
uint16_t pic_read_isr(void)
read the In-Service Register (ISR) from both PICs.
Definition pic.c:146
uint16_t pic_read_irr(void)
read the Interrupt Request Register (IRR) from both PICs.
Definition pic.c:138