Commit 01253073 by malcolm

Style fixes

parent e833217b
Showing with 23 additions and 23 deletions
...@@ -22,24 +22,24 @@ idt_desc* get_ir (uint32_t i) { ...@@ -22,24 +22,24 @@ idt_desc* get_ir (uint32_t i) {
return &_idt[i]; return &_idt[i];
} }
int install_ir (uint32_t i, uint16_t flags, uint16_t code_sel, IRQ_HANDLER irq) { int install_ir (uint32_t i, uint16_t flags, uint16_t code_sel, IRQ_HANDLER irq) {
if (i>MAX_IDT_INT) if (i>MAX_IDT_INT)
return 0; return 0;
if (!irq) if (!irq)
return 0; return 0;
uint64_t uiBase = (uint64_t)&(*irq); uint64_t uiBase = (uint64_t)&(*irq);
_idt[i].low_base = (uint16_t)(uiBase & 0xffff); _idt[i].low_base = (uint16_t)(uiBase & 0xffff);
_idt[i].high_base = (uint16_t)((uiBase >> 16) & 0xffff); _idt[i].high_base = (uint16_t)((uiBase >> 16) & 0xffff);
_idt[i].reserved = 0; _idt[i].reserved = 0;
_idt[i].flags = (uint8_t)(flags); _idt[i].flags = (uint8_t)(flags);
_idt[i].code_sel = code_sel; _idt[i].code_sel = code_sel;
return 0; return 0;
} }
int idt_init (uint16_t code_sel) { int idt_init (uint16_t code_sel) {
_idtr.limit = sizeof (idt_desc) * MAX_IDT_INT -1; _idtr.limit = sizeof (idt_desc) * MAX_IDT_INT -1;
_idtr.base = (uint32_t)&_idt[0]; _idtr.base = (uint32_t)&_idt[0];
memset ((void*)&_idt[0], 0, sizeof (idt_desc) * MAX_IDT_INT-1); memset ((void*)&_idt[0], 0, sizeof (idt_desc) * MAX_IDT_INT-1);
for (int i=0; i<MAX_IDT_INT; i++) for (int i=0; i<MAX_IDT_INT; i++)
install_ir (i, IDT_PR|IDT_32,code_sel,(IRQ_HANDLER)default_handler); install_ir (i, IDT_PR|IDT_32,code_sel,(IRQ_HANDLER)default_handler);
idt_install (); idt_install ();
return 0; return 0;
} }
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
typedef void (*IRQ_HANDLER)(void); typedef void (*IRQ_HANDLER)(void);
typedef struct { typedef struct {
uint16_t low_base; uint16_t low_base;
uint16_t code_sel; uint16_t code_sel;
uint8_t reserved; uint8_t reserved;
uint8_t flags; uint8_t flags;
uint16_t high_base; uint16_t high_base;
} idt_desc; } idt_desc;
extern idt_desc* get_ir (uint32_t i); extern idt_desc* get_ir (uint32_t i);
......
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