#include "vectors.h"
#ifndef __ASM__
-#include <hal/cpu.h>
+#include <lunaix/compiler.h>
+#include <sys/cpu.h>
+
+#define saved_fp(isrm) ((isrm)->registers.ebp)
+#define kernel_context(isrm) (!(((isrm)->execp->cs) & 0b11))
struct exec_param;
u32_t es;
u32_t fs;
u32_t gs;
-} __attribute__((packed));
+} compact;
-typedef struct
+struct pcontext
{
unsigned int depth;
struct regcontext registers;
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;
u32_t eflags;
u32_t esp;
u32_t ss;
-} __attribute__((packed));
-
-#define ISR_PARAM_SIZE sizeof(isr_param)
-
-void
-exception_init();
+} compact;
#endif