2025-07-17 11:36:45 +00:00
|
|
|
/**
|
|
|
|
|
* @file interrupt_handlers.h
|
|
|
|
|
* @brief Interrupt Handlers
|
|
|
|
|
* @details Functions and structs for the C side of handling interrupts.
|
|
|
|
|
*/
|
2025-06-17 02:40:02 +00:00
|
|
|
#ifndef INTERRUPTHANDLERS_H
|
|
|
|
|
#define INTERRUPTHANDLERS_H
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
2025-07-17 11:36:45 +00:00
|
|
|
/**
|
|
|
|
|
* @brief
|
|
|
|
|
*/
|
2025-06-28 04:14:42 +00:00
|
|
|
extern void (*isr_ptrs[])(void);
|
|
|
|
|
|
2025-07-17 11:36:45 +00:00
|
|
|
/**
|
|
|
|
|
* @brief
|
|
|
|
|
* @details Struct is built "backwards" since it is pushed in this order.
|
|
|
|
|
*/
|
2025-06-17 02:40:02 +00:00
|
|
|
typedef struct StateSnapshot_s {
|
2025-07-17 11:36:45 +00:00
|
|
|
uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax; /**< @brief */
|
|
|
|
|
uint32_t interrupt_id, error_code; /**< @brief */
|
|
|
|
|
uint32_t eip, cs, eflags; /**< @brief */
|
2025-06-17 02:40:02 +00:00
|
|
|
} StateSnapshot_t;
|
|
|
|
|
|
2025-07-17 11:36:45 +00:00
|
|
|
/**
|
|
|
|
|
* @brief
|
|
|
|
|
* @param cpu_state
|
|
|
|
|
*/
|
2025-06-17 02:40:02 +00:00
|
|
|
void generic_isr_handler(StateSnapshot_t* cpu_state);
|
|
|
|
|
|
|
|
|
|
#endif
|