The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
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
*/
11
void
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
*/
18
void
pic_send_eoi
(
int
irq);
19
20
/**
21
* disable both PICs by masking all IRQ lines.
22
*/
23
void
pic_disable
(
void
);
24
25
/**
26
* mask (disable) a specific IRQ line.
27
* @param irq the IRQ number (0–15).
28
*/
29
void
pic_mask
(
int
irq);
30
31
/**
32
* unmask (enable) a specific IRQ line.
33
* @param irq the IRQ number (0–15).
34
*/
35
void
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
*/
41
uint16_t
pic_read_irr
(
void
);
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
*/
47
uint16_t
pic_read_isr
(
void
);
stdint.h
uint8_t
unsigned char uint8_t
Definition
fb.h:18
uint16_t
unsigned short uint16_t
Definition
stdint.h:13
pic_mask
void pic_mask(int irq)
mask (disable) a specific IRQ line.
Definition
pic.c:100
pic_send_eoi
void pic_send_eoi(int irq)
send an End-of-Interrupt (EOI) signal to the PIC.
Definition
pic.c:80
pic_disable
void pic_disable(void)
disable both PICs by masking all IRQ lines.
Definition
pic.c:92
pic_configure
void pic_configure(uint8_t offset_master, uint8_t offset_slave)
configure the 8259A PIC.
Definition
pic.c:45
pic_unmask
void pic_unmask(int irq)
unmask (enable) a specific IRQ line.
Definition
pic.c:119
pic_read_isr
uint16_t pic_read_isr(void)
read the In-Service Register (ISR) from both PICs.
Definition
pic.c:146
pic_read_irr
uint16_t pic_read_irr(void)
read the Interrupt Request Register (IRR) from both PICs.
Definition
pic.c:138
src
arch
x86
cpu
pic.h
Generated by
1.18.0