mirror of
https://github.com/usatiuk/ficus.git
synced 2025-10-29 00:27:52 +01:00
align interrupt stack
This commit is contained in:
@@ -28,8 +28,11 @@ void gdt_setup() {
|
||||
gdt_tss.unused = 0;
|
||||
gdt_tss.gran = 0;
|
||||
gdt_tss.base_high = (tss_base >> 24) & 0xFFFFFFFFFF;
|
||||
tss_entry.ist1 = (uint64_t) &int_stack[INT_STACK_SIZE - 1];
|
||||
tss_entry.rsp0 = (uint64_t) &rsp_stack[RSP_STACK_SIZE - 1];
|
||||
|
||||
tss_entry.ist1 = ((uintptr_t) int_stack + INT_STACK_SIZE - 1) & (~0xFULL);
|
||||
if ((tss_entry.ist1 & 0xFULL) != 0) _hcf();
|
||||
tss_entry.rsp0 = ((uintptr_t) rsp_stack + RSP_STACK_SIZE - 1) & (~0xFULL);
|
||||
if ((tss_entry.rsp0 & 0xFULL) != 0) _hcf();
|
||||
|
||||
barrier();// The asm function might clobber registers
|
||||
_gdt_setup();
|
||||
|
||||
@@ -38,7 +38,7 @@ void idt_set_descriptor(uint8_t vector, void (*isr)(), uint8_t flags) {
|
||||
|
||||
descriptor->isr_low = (uint64_t) isr & 0xFFFF;
|
||||
descriptor->kernel_cs = GDTSEL(gdt_code);
|
||||
descriptor->ist = 0;
|
||||
descriptor->ist = 1;
|
||||
descriptor->attributes = flags;
|
||||
descriptor->isr_mid = ((uint64_t) isr >> 16) & 0xFFFF;
|
||||
descriptor->isr_high = ((uint64_t) isr >> 32) & 0xFFFFFFFF;
|
||||
|
||||
Reference in New Issue
Block a user