PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
pic.h
Go to the documentation of this file.
1#pragma once
2
3/**
4 * @brief Programmable Interrupt Controller (PIC) definitions and functions.
5 * @defgroup kernel_drivers_pic PIC
6 * @ingroup kernel_drivers
7 *
8 * The PIC is a legacy interrupt controller used in x86 systems to manage hardware interrupts. It has largely been
9 * superseded by the APIC (Advanced Programmable Interrupt Controller) in modern systems, as such we simply disable the
10 * PIC during system initialization.
11 *
12 * @{
13 */
14
15#define PIC1 0x20
16#define PIC2 0xA0
17#define PIC1_COMMAND PIC1
18#define PIC1_DATA (PIC1 + 1)
19#define PIC2_COMMAND PIC2
20#define PIC2_DATA (PIC2 + 1)
21
22#define PIC_EOI 0x20
23
24#define ICW1_ICW4 0x01 ///< Indicates that ICW4 will be present
25#define ICW1_SINGLE 0x02 ///< Single (cascade) mode
26#define ICW1_INTERVAL4 0x04 ///< Call address interval 4 (8)
27#define ICW1_LEVEL 0x08 ///< Level triggered (edge) mode
28#define ICW1_INIT 0x10 ///< Initialization - required!
29
30#define ICW4_8086 0x01 ///< 8086/88 (MCS-80/85) mode
31#define ICW4_AUTO 0x02 ///< Auto (normal) EOI
32#define ICW4_BUF_SLAVE 0x08 ///< Buffered mode/slave
33#define ICW4_BUF_MASTER 0x0C ///< Buffered mode/master
34#define ICW4_SFNM 0x10 ///< Special fully nested (not)
35
36void pic_disable(void);
37
38/** @} */
void pic_disable(void)
Definition pic.c:13