MP3 1.0
This is the Doxygen document for ECE391 MP3.
Loading...
Searching...
No Matches
Functions
i8259.c File Reference

Functions to interact with the 8259 interrupt controller. More...

#include "i8259.h"
#include "lib.h"

Functions

int i8259_init (void)
 Initialize the 8259 PIC. More...
 
int enable_irq (uint32_t irq_num)
 Enable (unmask) the specified IRQ. More...
 
int disable_irq (uint32_t irq_num)
 Disable (mask) the specified IRQ. More...
 
int send_eoi (uint32_t irq_num)
 Send end-of-interrupt signal for the specified IRQ. More...
 

Detailed Description

Functions to interact with the 8259 interrupt controller.

Author
Group 8
Version
1.0
Date
2023-03-09

Function Documentation

◆ disable_irq()

int disable_irq ( uint32_t  irq_num)

Disable (mask) the specified IRQ.

Parameters
irq_numThe IRQ line to be unmasked.
Returns
0 on success.
-1 on failure.

◆ enable_irq()

int enable_irq ( uint32_t  irq_num)

Enable (unmask) the specified IRQ.

Parameters
irq_numthe IRQ line to be masked.
Returns
0 on success.
-1 on failure.

◆ i8259_init()

int i8259_init ( void  )

Initialize the 8259 PIC.

Initialize the 8259 PIC by starting in cascade mode,setting vector offsets, setting how it is wired, turning on 8086/88 mode, and disable all IRQs except IRQ2(slave PIC).

Returns
0 on success.
-1 on failure.
Note
Only the second IRQ (slave PIC) is enabled upon return.

◆ send_eoi()

int send_eoi ( uint32_t  irq_num)

Send end-of-interrupt signal for the specified IRQ.

Parameters
irq_numThe target for the EOI signal.
Returns
0 on success.
-1 on failure.