Main Page | Data Structures | File List | Globals | Related Pages

interrupt.c File Reference

Provides the implementantion for installing interrupts. More...

#include <interrupt.h>
#include <register.h>
#include <list.h>
#include <vm.h>
#include <scheduler.h>
#include <interrupts.h>
#include <console.h>
#include <x86/gate_init.h>
#include <x86/proc_reg.h>
#include <x86/seg.h>
#include <x86/pic.h>
#include <assert.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <thread.h>

Functions

int interrupt_dispatcher_initialize (void)
 Initialize the interrupt dispatcher.

InterruptHandler * interrupt_handler_create (InterruptVector vector, InterruptHandlerFunction function)
 Create a new interrupt handler.

void interrupt_handler_destroy (InterruptHandler *handler)
 Destroy an interrupt handler.

ExceptionHandler * exception_handler_create (ExceptionVector vector, ExceptionHandlerFunction function)
 Create a new exception handler.

void exception_handler_destroy (ExceptionHandler *handler)
 Destroy an exception handler.

void exception_dispatch (ExceptionVector vector, ExceptionData data, Registers *registers)
void interrupt_dispatch (InterruptVector vector, Registers *registers)
void interrupt_wait (void)
 Wait for any interrupts.


Variables

List interruptHandlers [INTERRUPT_VECTOR_MAXIMUM+1]


Detailed Description

Provides the implementantion for installing interrupts.

Takes care of installing a handling interrupts and exceptions

Author:
Lee Salzman (lsalzman)

Hassaan Moin Khan (hkhan)

Bug:
No known bugs.

Function Documentation

ExceptionHandler* exception_handler_create ExceptionVector  vector,
ExceptionHandlerFunction  handler
 

Create a new exception handler.

Create a new handler for the specified exception vector, with a given handler function.

Parameters:
vector the vector of the exception to wait for
handler the handler for the exception
Returns:
an exception handler on success NULL on failure

void exception_handler_destroy ExceptionHandler *  handler  ) 
 

Destroy an exception handler.

Removes an exception handler and frees any memory it used.

Parameters:
handler the handler to destroy
Returns:
Void

int interrupt_dispatcher_initialize void   ) 
 

Initialize the interrupt dispatcher.

Initialize the IDT with the interrupt stubs and the handler lists.

Returns:
0 on success -1 on failure

InterruptHandler* interrupt_handler_create InterruptVector  vector,
InterruptHandlerFunction  handler
 

Create a new interrupt handler.

Create a new handler for the specified interrupt vector, with a given handler function.

Parameters:
vector the vector of the interrupt to wait for
handler the handler for the interrupt
Returns:
an interrupt handler on success NULL on failure

void interrupt_handler_destroy InterruptHandler *  handler  ) 
 

Destroy an interrupt handler.

Removes an interrupt handler and frees any memory it used.

Parameters:
handler the handler to destroy
Returns:
Void

void interrupt_wait void   ) 
 

Wait for any interrupts.

Halt the kernel until an interrupt occurs.

Returns:
Void


Generated on Fri Apr 9 21:59:16 2004 for 15-410 Project 3 by doxygen 1.3.2