My Kernel v0.1.0
pic.h
Go to the documentation of this file.
1
21#ifndef KERNEL_ARCH_I686_DEVICES_PIC_H
22#define KERNEL_ARCH_I686_DEVICES_PIC_H
23
24#include <stdint.h>
25
26/* Offset vectors
27 *
28 * They are set to 0x20 and 0x28 to not conflict with CPU exceptions
29 * in protected mode.
30 */
31#define PIC_MASTER_VECTOR 0x20
32#define PIC_SLAVE_VECTOR 0x28
33
38typedef enum pic_irq {
44 IRQ_LPT2,
45 IRQ_FLOPPY,
46 IRQ_LPT1,
47 IRQ_CMOS,
48 IRQ_FREE1,
49 IRQ_FREE2,
50 IRQ_FREE3,
51 IRQ_PS2,
52 IRQ_FPU,
53 IRQ_ATA_PRIMARY,
54 IRQ_ATA_SECONDARY
55} pic_irq;
56
58#define PIC_IRQ_COUNT (IRQ_ATA_SECONDARY + 1)
59
64void pic_reset();
65
72void pic_eoi(pic_irq);
73
76
79
80#endif /* KERNEL_ARCH_I686_DEVICES_PIC_H */
void pic_reset()
Reset the PIC.
Definition: pic.c:34
void pic_eoi(pic_irq)
Send an End Of Interrupt command to the PIC.
Definition: pic.c:64
void pic_enable_irq(pic_irq)
Enable the given IRQ.
Definition: pic.c:73
pic_irq
All available PIC irqs, by vector index.
Definition: pic.h:38
void pic_disable_irq(pic_irq)
Disable the given IRQ.
Definition: pic.c:82
@ IRQ_KEYBOARD
Raised by the keyboard.
Definition: pic.h:40
@ IRQ_COM2
Raised by the serial port.
Definition: pic.h:42
@ IRQ_CASCADE
Used to access the second controller.
Definition: pic.h:41
@ IRQ_TIMER
Raised by the PIT.
Definition: pic.h:39
@ IRQ_COM1
Raised by the serial port.
Definition: pic.h:43