Still need to document a lot of functions, but I cleaned up and explained a lot of the code via comments.
21 lines
533 B
C
21 lines
533 B
C
/* interrupt_handlers.h
|
|
* Interrupt Handlers
|
|
*
|
|
* Functions and structs for the C side of handling interrupts.
|
|
*/
|
|
#ifndef INTERRUPTHANDLERS_H
|
|
#define INTERRUPTHANDLERS_H
|
|
#include <stdint.h>
|
|
|
|
extern void (*isr_ptrs[])(void);
|
|
|
|
//Struct is built "backwards" since it is pushed in this order.
|
|
typedef struct StateSnapshot_s {
|
|
uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax;
|
|
uint32_t interrupt_id, error_code;
|
|
uint32_t eip, cs, eflags;
|
|
} StateSnapshot_t;
|
|
|
|
void generic_isr_handler(StateSnapshot_t* cpu_state);
|
|
|
|
#endif
|