Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

PIC Class Reference

The PIC is the programmable interrupt controller. More...

#include <pic.h>

List of all members.

Public Methods

void init ()
void signal_end_of_irq (unsigned char int_num)
void mask_irq (unsigned char int_num)
void unmask_irq (unsigned char int_num)

Static Public Methods

unsigned char int_to_irq (unsigned char irq_num)

Protected Methods

unsigned char read_register (PIC_io_base io_base, PIC_register register_num)
void write_register (PIC_io_base io_base, PIC_register register_num, unsigned char data)

Protected Attributes

unsigned char masks [2]


Detailed Description

The PIC is the programmable interrupt controller.

Much of this code is borrowed from Lee Salzman's POS.


Member Function Documentation

void PIC::init  
 

Remap irqs 0-7 to 0x20-0x27 and 8-15 to 0x28-0x2f, and then set default masks.

unsigned char PIC::int_to_irq unsigned char    irq_num [inline, static]
 

Convert an interrupt number to its original pre-remapped irq number.

void PIC::mask_irq unsigned char    int_num
 

Disable an individual irq (int_num is the remapped int number).

unsigned char PIC::read_register PIC_io_base    io_base,
PIC_register    register_num
[inline, protected]
 

Read a value from a register on the PIC.

void PIC::signal_end_of_irq unsigned char    int_num [inline]
 

Irq handlers must signal to the PIC when the handler is complete. Only hardware interrupt handlers need to do this. Note that this int_num is the remapped interrupt number, not the original irq.

void PIC::unmask_irq unsigned char    int_num
 

Enable an individual irq (int_num is the remapped int number).

void PIC::write_register PIC_io_base    io_base,
PIC_register    register_num,
unsigned char    data
[inline, protected]
 

Write a value to a register on the PIC.


Member Data Documentation

unsigned char PIC::masks[2] [protected]
 

masks showing which irqs are enabled.


The documentation for this class was generated from the following files:

Torsion Operating System, Copyright (C) 2000-2002 Dan Helfman