Commit af8238f6 by malcolm

Switched completely to trapframes

parent 5a66d675
Showing with 13 additions and 17 deletions
...@@ -28,9 +28,9 @@ typedef struct//all regs in proc ...@@ -28,9 +28,9 @@ typedef struct//all regs in proc
uint32_t err; uint32_t err;
//uint32_t eip; uint32_t eip;
//uint16_t cs; uint16_t cs;
//uint16_t cspad; uint16_t cspad;
//uint32_t eflags; //uint32_t eflags;
......
...@@ -43,17 +43,13 @@ void load_error_handlers() ...@@ -43,17 +43,13 @@ void load_error_handlers()
} }
} }
void default_handler(trapframe reg, /*uint32_t interrupt, uint32_t error,*/ struct stack_state stack) void default_handler(trapframe reg)
{ {
uint32_t interrupt = reg.trap; if(reg.trap<32)
uint32_t error = reg.err; reg.eip+=2;
if(interrupt<32) if(handlers[reg.trap]!=NULL)
stack.eip+=2;
//char f[20];
//serial_val(interrupt);
if(handlers[interrupt]!=NULL)
{ {
handlers[interrupt](error); handlers[reg.trap](reg.err);
} }
return; return;
} }
......
...@@ -37,15 +37,15 @@ typedef struct ...@@ -37,15 +37,15 @@ typedef struct
uint32_t edi; uint32_t edi;
}__attribute__((packed));*/ }__attribute__((packed));*/
struct stack_state /*struct stack_state
{ {
uint32_t eip; uint32_t eip;
uint32_t cd; uint32_t cd;
uint32_t eflags; uint32_t eflags;
}__attribute__((packed)); }__attribute__((packed));*/
extern void default_handler(trapframe reg,/*uint32_t interrupt, uint32_t error,*/ struct stack_state stack);
extern void default_handler(trapframe reg);
extern idt_desc* get_ir(uint32_t i); extern idt_desc* get_ir(uint32_t i);
extern int install_ir(uint32_t i, uint16_t flags, uint16_t code_sel, IRQ_HANDLER); extern int install_ir(uint32_t i, uint16_t flags, uint16_t code_sel, IRQ_HANDLER);
extern void install_c_ir(uint32_t interrupt, void (*handler) (uint32_t)); extern void install_c_ir(uint32_t interrupt, void (*handler) (uint32_t));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment