int.c File Reference

Interrupt parsing and handling. More...

#include "int.h"
#include "sys.h"
#include "sched.h"
#include "thread.h"
#include "io.h"

Defines

#define INT_TIMER   cp0_cause_ip7_mask
#define INT_KEYBOARD   cp0_cause_ip3_mask

Functions

void interrupt (void)
 Interupt handling function.
void enable_interrupts (void)
 Globally enables interrupts.
void disable_interrupts (void)
 Globally disables interrupts.
void save_and_disable_interrupts ()
 Thread save disable interrupts.
void restore_interrupts ()
 Thread save enable interrupts.


Detailed Description

Interrupt parsing and handling.


Define Documentation

#define INT_KEYBOARD   cp0_cause_ip3_mask

Keyboard interrupt constant

#define INT_TIMER   cp0_cause_ip7_mask

Timer interrupt constant


Function Documentation

void disable_interrupts ( void   )  [inline]

Globally disables interrupts.

Globally disables interrupts on the processor by setting the Interrupt Enable field of the CP0 Status Register to 0.

void enable_interrupts ( void   )  [inline]

Globally enables interrupts.

Globally enables interrupts on the processor by setting the Interrupt Enable field of the CP0 Status Register to 1.

void interrupt ( void   ) 

Interupt handling function.

interrupt() is called from the exception handler - see exc.c. Right now we are sure that the processor is in the exception level so all other interrupts are disabled.

A bit mask which device have to be handled can be found in the Cause register, the IP (interrupt pending) field. Note that more than one bit can be set.

It is up to the device to clear an interrupt request, so the device which asserted the external interrupt signal have to be satisfied. Otherwise the exception interrupt is generated immediately after the interrupts are enabled.

void restore_interrupts (  ) 

Thread save enable interrupts.

Lower interrupt counter of current thread and if it is 0 globally enable interrupts

void save_and_disable_interrupts (  ) 

Thread save disable interrupts.

Raise interrupt counter of current thread


Generated on Wed Nov 15 17:25:43 2006 for Kalisto by  doxygen 1.4.7