LumaOS  v0.1.116
An experimental x86-64 OS
Loading...
Searching...
No Matches
pic.h File Reference

Handles the legacy PIC for IRQ interrupts. More...

#include <stdint.h>
#include "io.h"
Include dependency graph for pic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PIC_MASTER_COMMAND_PORT   0x20
#define PIC_MASTER_DATA_PORT   0x21
#define PIC_SLAVE_COMMAND_PORT   0xA0
#define PIC_SLAVE_DATA_PORT   0xA1

Functions

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.
void pic_send_eoi (uint8_t irq)
 Sends an EOI to tell the PIC that the interrupt is over.
uint8_t pic_read_irr (void)
uint8_t pic_read_isr (void)

Detailed Description

Handles the legacy PIC for IRQ interrupts.

Author
Matheus Boscariol
Since
24/11/2026

Definition in file pic.h.

Macro Definition Documentation

◆ PIC_MASTER_COMMAND_PORT

#define PIC_MASTER_COMMAND_PORT   0x20

Definition at line 17 of file pic.h.

◆ PIC_MASTER_DATA_PORT

#define PIC_MASTER_DATA_PORT   0x21

Definition at line 18 of file pic.h.

◆ PIC_SLAVE_COMMAND_PORT

#define PIC_SLAVE_COMMAND_PORT   0xA0

Definition at line 20 of file pic.h.

◆ PIC_SLAVE_DATA_PORT

#define PIC_SLAVE_DATA_PORT   0xA1

Definition at line 21 of file pic.h.

Function Documentation

◆ pic_clear_mask()

void pic_clear_mask ( uint8_t irq)

Unmasks (Enables) a line.

Parameters
irqThe IRQ Number

Definition at line 79 of file pic.c.

Here is the call graph for this function:

◆ pic_read_irr()

uint8_t pic_read_irr ( void )
inline

Definition at line 48 of file pic.h.

◆ pic_read_isr()

uint8_t pic_read_isr ( void )
inline

Definition at line 54 of file pic.h.

◆ pic_remap()

void pic_remap ( uint8_t master_offset,
uint8_t slave_offset )

Initializes the PIC using ICWs and mask all lines.

Parameters
master_offsetVector offset for the master IRQs
slave_offsetVector offset for the slave IRQs

Definition at line 19 of file pic.c.

Here is the call graph for this function:

◆ pic_send_eoi()

void pic_send_eoi ( uint8_t irq)

Sends an EOI to tell the PIC that the interrupt is over.

Parameters
irqThe IRQ Number

Definition at line 103 of file pic.c.

Here is the call graph for this function:

◆ pic_set_mask()

void pic_set_mask ( uint8_t irq)

Masks (Disables) a line.

Parameters
irqThe IRQ number

Definition at line 54 of file pic.c.

Here is the call graph for this function: