X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/b26d3165c52589d1f8de37bf0df27ad96f460f47..6c506d8916fb114675e93d0e2cb20831d4022294:/lunaix-os/arch/i386/includes/sys/interrupts.h diff --git a/lunaix-os/arch/i386/includes/sys/interrupts.h b/lunaix-os/arch/i386/includes/sys/interrupts.h index 003a2cd..540da4c 100644 --- a/lunaix-os/arch/i386/includes/sys/interrupts.h +++ b/lunaix-os/arch/i386/includes/sys/interrupts.h @@ -4,7 +4,8 @@ #include "vectors.h" #ifndef __ASM__ -#include +#include +#include struct exec_param; @@ -21,9 +22,9 @@ struct regcontext u32_t es; u32_t fs; u32_t gs; -} __attribute__((packed)); +} compact; -typedef struct +struct pcontext { unsigned int depth; struct regcontext registers; @@ -32,11 +33,11 @@ typedef struct u32_t esp; volatile struct exec_param* execp; }; -} __attribute__((packed)) isr_param; +} compact; struct exec_param { - isr_param* saved_prev_ctx; + struct pcontext* saved_prev_ctx; u32_t vector; u32_t err_code; u32_t eip; @@ -44,12 +45,10 @@ struct exec_param u32_t eflags; u32_t esp; u32_t ss; -} __attribute__((packed)); +} compact; -#define ISR_PARAM_SIZE sizeof(isr_param) - -void -exception_init(); +#define saved_fp(isrm) ((isrm)->registers.ebp) +#define kernel_context(isrm) (!(((isrm)->execp->cs) & 0b11)) #endif