10#ifndef KERNEL_ARCH_X86_64_PIC_H
11#define KERNEL_ARCH_X86_64_PIC_H
17#define PIC_MASTER_COMMAND_PORT 0x20
18#define PIC_MASTER_DATA_PORT 0x21
20#define PIC_SLAVE_COMMAND_PORT 0xA0
21#define PIC_SLAVE_DATA_PORT 0xA1
28void pic_remap(uint8_t master_offset, uint8_t slave_offset);
48inline uint8_t pic_read_irr(
void)
50 outb(PIC_MASTER_COMMAND_PORT, 0x0A);
51 return inb(PIC_MASTER_COMMAND_PORT);
54inline uint8_t pic_read_isr(
void)
56 outb(PIC_MASTER_COMMAND_PORT, 0x0B);
57 return inb(PIC_MASTER_COMMAND_PORT);
Provides utilities for IO operations with the hardware.
uint8_t inb(uint16_t port)
Inputs a byte from the specified port.
void outb(uint16_t port, uint8_t value)
Outputs a byte to the specified port.
void pic_send_eoi(uint8_t irq)
Sends an EOI to tell the PIC that the interrupt is over.
void pic_remap(uint8_t master_offset, uint8_t slave_offset)
Initializes the PIC using ICWs and mask all lines.
void pic_set_mask(uint8_t irq)
Masks (Disables) a line.
void pic_clear_mask(uint8_t irq)
Unmasks (Enables) a line.