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

interrupt.h File Reference

Interrupt handler interface. More...

#include <list.h>
#include <register.h>

Go to the source code of this file.

Data Structures

struct  ExceptionHandler
struct  InterruptHandler

Defines

#define INTERRUPT_STACK_SIZE   (16 * 1024)
#define INTERRUPT_STUB_SIZE   16
#define INTERRUPT_VECTOR_EXCEPTIONS   0
#define INTERRUPT_VECTOR_INTERRUPTS   32
#define INTERRUPT_VECTOR_TRAPS   48
#define INTERRUPT_VECTOR_MAXIMUM   99

Typedefs

typedef char InterruptStub [16]
typedef unsigned int InterruptVector
typedef void(* InterruptHandlerFunction )(InterruptVector, Registers *)
typedef unsigned int ExceptionVector
typedef unsigned int ExceptionData
typedef void(* ExceptionHandlerFunction )(ExceptionVector, ExceptionData, Registers *)

Functions

int interrupt_dispatcher_initialize (void)
 Initialize the interrupt dispatcher.

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

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

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

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

void interrupt_wait (void)
 Wait for any interrupts.


Variables

InterruptStub interrupt_stubs []


Detailed Description

Interrupt handler interface.

Provides the interface for interrupt handling.

Bug:
No known bugs.
Author:
Lee Salzman (lsalzman)

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