UnnamedOS
isr.h File Reference
#include <stdint.h>
+ Include dependency graph for isr.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  isr_eflags_t
 The EFLAGS register. More...
 
struct  isr_registers_t
 general purpose registers More...
 
struct  cpu_state_t
 The CPU's state when an interrupt occurs. More...
 

Macros

#define ISR_EXCEPTION(ex)   (0x00 + (ex))
 the interrupt vector for an exception
 
#define ISR_IRQ(irq)    (0x20 + (irq))
 the interrupt vector for an IRQ
 
#define ISR_SYSCALL   0x30
 the interrupt vector for the syscall
 

Typedefs

typedef cpu_state_t *(* isr_handler_t) (cpu_state_t *cpu)
 Handles a specific interrupt. More...
 
typedef uint32_t(* isr_syscall_t) (uint32_t ebx, uint32_t ecx, uint32_t edx, uint32_t esi, uint32_t edi, cpu_state_t **cpu)
 Handles a specific syscall. More...
 

Functions

uint8_t isr_enable_interrupts (uint8_t enable)
 Enables or disables interrupts. More...
 
uint8_t isr_get_interrupts ()
 Returns whether interrupts are enabled or disabled. More...
 
void isr_register_handler (size_t intr, isr_handler_t handler)
 Registers a handler to call whenever a given interrupt is fired. More...
 
void isr_register_syscall (size_t id, void *syscall)
 Registers a syscall handler to call whenever a specified syscall is requested. More...
 
void isr_dump_cpu (cpu_state_t *cpu)
 Dumps a CPU state. More...
 
void isr_init ()
 Initializes syscalls and enables interrupts.