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

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

#include <stdint.h>
#include <arch/x86_64/pic.h>
#include <arch/x86_64/io.h>
#include "kernel/log.h"
Include dependency graph for pic.c:

Go to the source code of this file.

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.

Variables

static uint8_t master_mask
static uint8_t slave_mask

Detailed Description

Handles the legacy PIC for IRQ interrupts.

Author
Matheus Boscariol
Since
24/11/2026

Definition in file pic.c.

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_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:

Variable Documentation

◆ master_mask

uint8_t master_mask
static

Definition at line 17 of file pic.c.

◆ slave_mask

uint8_t slave_mask
static

Definition at line 17 of file pic.c.