The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
pic.h File Reference
#include "common/stdint.h"

Go to the source code of this file.

Functions

void pic_configure (uint8_t offset_master, uint8_t offset_slave)
 configure the 8259A PIC.
void pic_send_eoi (int irq)
 send an End-of-Interrupt (EOI) signal to the PIC.
void pic_disable (void)
 disable both PICs by masking all IRQ lines.
void pic_mask (int irq)
 mask (disable) a specific IRQ line.
void pic_unmask (int irq)
 unmask (enable) a specific IRQ line.
uint16_t pic_read_irr (void)
 read the Interrupt Request Register (IRR) from both PICs.
uint16_t pic_read_isr (void)
 read the In-Service Register (ISR) from both PICs.

Function Documentation

◆ pic_configure()

void pic_configure ( uint8_t offset_master,
uint8_t offset_slave )

configure the 8259A PIC.

remaps IRQ lines to the specified IDT vector offsets.

Parameters
offset_masterbase vector offset for the master PIC (IRQ 0–7).
offset_slavebase vector offset for the slave PIC (IRQ 8–15).

◆ pic_send_eoi()

void pic_send_eoi ( int irq)

send an End-of-Interrupt (EOI) signal to the PIC.

if the IRQ came from the slave PIC, sends EOI to both slave and master.

Parameters
irqthe IRQ number (0–15).

◆ pic_disable()

void pic_disable ( void )

disable both PICs by masking all IRQ lines.

◆ pic_mask()

void pic_mask ( int irq)

mask (disable) a specific IRQ line.

Parameters
irqthe IRQ number (0–15).

◆ pic_unmask()

void pic_unmask ( int irq)

unmask (enable) a specific IRQ line.

Parameters
irqthe IRQ number (0–15).

◆ pic_read_irr()

uint16_t pic_read_irr ( void )

read the Interrupt Request Register (IRR) from both PICs.

Returns
16-bit value with master in low byte, slave in high byte.

◆ pic_read_isr()

uint16_t pic_read_isr ( void )

read the In-Service Register (ISR) from both PICs.

Returns
16-bit value with master in low byte, slave in high byte.