MentOS  0.8.0
The Mentoring Operating System
Classes | Macros | Typedefs | Functions | Variables
interrupt.c File Reference

Functions which manage the Interrupt Service Routines (ISRs). More...

Classes

struct  irq_struct_t
 Shared interrupt handlers, stored into a double-linked list. More...
 

Macros

#define __DEBUG_HEADER__   "[IRQ ]"
 Change header.
 
#define __DEBUG_LEVEL__   LOGLEVEL_NOTICE
 Set log level.
 

Typedefs

typedef struct irq_struct_t irq_struct_t
 Shared interrupt handlers, stored into a double-linked list.
 

Functions

static irq_struct_t__irq_struct_alloc (void)
 Creates a new irq structure. More...
 
static void __irq_struct_dealloc (irq_struct_t *irq_struct)
 Destroys an irq struct. More...
 
void irq_init (void)
 For each interrupt irq_init sets a default handler which prints the rose IRQ line and stops kernel execution.
 
int irq_install_handler (unsigned i, interrupt_handler_t handler, char *description)
 Installs an ISR to handle an interrupt. More...
 
int irq_uninstall_handler (unsigned i, interrupt_handler_t handler)
 Uninstall an IRQ handler. More...
 
void irq_handler (pt_regs *f)
 Method called by CPU to handle interrupts. More...
 

Variables

static list_head shared_interrupt_handlers [IRQ_NUM]
 For each IRQ, a chain of handlers.
 
static kmem_cache_tirq_cache
 Cache where we will store the data regarding an irq service.
 

Detailed Description

Functions which manage the Interrupt Service Routines (ISRs).

Function Documentation

◆ __irq_struct_alloc()

static irq_struct_t* __irq_struct_alloc ( void  )
inlinestatic

Creates a new irq structure.

Returns
a pointer to the newly created irq structure.

◆ __irq_struct_dealloc()

static void __irq_struct_dealloc ( irq_struct_t irq_struct)
inlinestatic

Destroys an irq struct.

Parameters
irq_structthe structure we need to destroy.