Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

interrupt.h File Reference

Interrupt manager header. More...

#include <const.h>

Go to the source code of this file.

Data Structures

struct  idt_entry
 IDT entry structure. More...

struct  idt_reg
 IDT register structure. More...

struct  irq_context
 Context after an interrupt. More...


Defines

#define TIMER_IRQ   0x00
 Timer IRQ line.

#define KEYBOARD_IRQ   0x01
 Keyboard IRQ line.

#define RS232_1_IRQ   0x04
 Serial COM1 IRQ line.

#define RS232_2_IRQ   0x03
 Serial COM2 IRQ line.

#define FLOPPY_IRQ   0x06
 Floppy IRQ line.

#define IDEP_IRQ   0x0E
 IDE primary channel IRQ line.

#define IDES_IRQ   0x0F
 IDE secondary channel IRQ line.

#define MINIRIGHI_INT   0x80
 Minirighi interrupt (used for the system calls).

#define DOS_INT   0x20
 DOS interrupt (maybe will be used for DOS emulation...).

#define EFLAGS_IF   0x200
 Interrupt enable flag in EFLAGS register.

#define EFLAGS_IOPL3   0x3000
 I/O privilege level 3 (minimum privilege). Everyone can perform I/O operation.

#define EFLAGS_IOPL2   0x2000
 I/O privilege level 2.

#define EFLAGS_IOPL1   0x3000
 I/O privilege level 1.

#define EFLAGS_IOPL0   0x0000
 I/O privilege level 0 (maximum privilege). Only the kernel can perform I/O operation.

#define PORT_8259_M   0x20
 PIC 8259 master.

#define PORT_8259_S   0xA0
 PIC 8259 slave.

#define PORT_INT_MASK_M   0x21
 PIC 8259 master (interrupt mask).

#define PORT_INT_MASK_S   0xA1
 PIC 8259 slave (interrupt mask).

#define EOI   0x20
 PIC 8259 EOI (End Of Interrupt).

#define IDT_DIM   256
 Number of entries in the IDT.


Typedefs

typedef idt_entry idt_entry_t
 IDT entry structure.

typedef idt_reg idt_reg_t
 IDT register structure.

typedef irq_context irq_context_t
 Context after an interrupt.


Functions

void disable_IRQ (uint8_t IRQ)
 Disable an IRQ line.
Parameters:
IRQ  The IRQ line to disable.


void enable_IRQ (uint8_t IRQ)
 Enable an IRQ line.
Parameters:
IRQ  The IRQ line to enable.


void reprogram_PIC ()
 Initialize the Programmable Interrupt Controllers (PICs).
Note:
The AT and PS/2 have 2 interrupt controllers to issue the IRQs, one master and one slaved at IRQ2. This routine initialize the 8259 interrupt controllers, using vector [0x20..0x2F] for [IRQ0..IRQ15] (0x20..0x27 for master and 0x28..0x2F for slave).


void install_IDT ()
 Initialize the IDT (Interrupt Descriptor Table).

void install_irq_handler (uint8_t irq, void *handler)
 Install an IRQ handler routine.
Parameters:
irq  The interrupt number.
handler  A pointer to the handler routine.
Note:
This is valid only for hardware interrupts. You cannot install a software interrupt handler in this way.



Detailed Description

Interrupt manager header.

Author:
Andrea Righi <drizzt@inwind.it>
Date:
Last update: 2003-11-05
Note:
Copyright (©) 2003 Andrea Righi

Definition in file interrupt.h.


Define Documentation

#define DOS_INT   0x20
 

DOS interrupt (maybe will be used for DOS emulation...).

Definition at line 37 of file interrupt.h.

#define EFLAGS_IF   0x200
 

Interrupt enable flag in EFLAGS register.

Definition at line 42 of file interrupt.h.

#define EFLAGS_IOPL0   0x0000
 

I/O privilege level 0 (maximum privilege). Only the kernel can perform I/O operation.

Definition at line 56 of file interrupt.h.

#define EFLAGS_IOPL1   0x3000
 

I/O privilege level 1.

Definition at line 52 of file interrupt.h.

#define EFLAGS_IOPL2   0x2000
 

I/O privilege level 2.

Definition at line 49 of file interrupt.h.

#define EFLAGS_IOPL3   0x3000
 

I/O privilege level 3 (minimum privilege). Everyone can perform I/O operation.

Definition at line 46 of file interrupt.h.

#define EOI   0x20
 

PIC 8259 EOI (End Of Interrupt).

Definition at line 69 of file interrupt.h.

#define FLOPPY_IRQ   0x06
 

Floppy IRQ line.

Definition at line 24 of file interrupt.h.

#define IDEP_IRQ   0x0E
 

IDE primary channel IRQ line.

Definition at line 27 of file interrupt.h.

#define IDES_IRQ   0x0F
 

IDE secondary channel IRQ line.

Definition at line 29 of file interrupt.h.

#define IDT_DIM   256
 

Number of entries in the IDT.

Definition at line 74 of file interrupt.h.

#define KEYBOARD_IRQ   0x01
 

Keyboard IRQ line.

Definition at line 18 of file interrupt.h.

#define MINIRIGHI_INT   0x80
 

Minirighi interrupt (used for the system calls).

Definition at line 35 of file interrupt.h.

#define PORT_8259_M   0x20
 

PIC 8259 master.

Definition at line 61 of file interrupt.h.

#define PORT_8259_S   0xA0
 

PIC 8259 slave.

Definition at line 63 of file interrupt.h.

#define PORT_INT_MASK_M   0x21
 

PIC 8259 master (interrupt mask).

Definition at line 65 of file interrupt.h.

#define PORT_INT_MASK_S   0xA1
 

PIC 8259 slave (interrupt mask).

Definition at line 67 of file interrupt.h.

#define RS232_1_IRQ   0x04
 

Serial COM1 IRQ line.

Definition at line 20 of file interrupt.h.

#define RS232_2_IRQ   0x03
 

Serial COM2 IRQ line.

Definition at line 22 of file interrupt.h.

#define TIMER_IRQ   0x00
 

Timer IRQ line.

Definition at line 16 of file interrupt.h.


Typedef Documentation

typedef struct idt_entry idt_entry_t
 

IDT entry structure.

typedef struct idt_reg idt_reg_t
 

IDT register structure.

typedef struct irq_context irq_context_t
 

Context after an interrupt.


Generated on Fri Feb 20 15:32:19 2004 for Minirighi by doxygen1.2.18