From d2617e44883fc0195a5df1634e09446317775dfc Mon Sep 17 00:00:00 2001 From: ngiddings Date: Thu, 15 Apr 2021 04:51:23 -0500 Subject: [PATCH] Wrote new ISR for AP entry --- src/x86/interrupts.h | 6 ++++-- src/x86/isr.c | 9 +++++++++ src/x86/isr.h | 3 +++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/x86/interrupts.h b/src/x86/interrupts.h index fa2ffc5..d8ff3b9 100644 --- a/src/x86/interrupts.h +++ b/src/x86/interrupts.h @@ -2,7 +2,7 @@ #include -enum exception_code_t +enum interrupt_code_t { EXCEPTION_DIV_BY_0 = 0, EXCEPTION_DEBUG = 1, @@ -23,7 +23,9 @@ enum exception_code_t EXCEPTION_MACHINE_CHECK = 18, EXCEPTION_SIMD_FLOATING_POINT = 19, EXCEPTION_VIRTUALIZATION = 20, - EXCEPTION_SECURITY = 30 + EXCEPTION_SECURITY = 30, + ISR_AP_START = 127, + ISR_SYSCALL = 128 }; enum isr_type_t diff --git a/src/x86/isr.c b/src/x86/isr.c index d5094bf..0148ec1 100644 --- a/src/x86/isr.c +++ b/src/x86/isr.c @@ -24,6 +24,15 @@ void isr_double_fault(void* frame, unsigned int error) asm("hlt"); } +__attribute__ ((interrupt, naked)) +void isr_ap_start(void* frame) +{ + asm(".code16"); + //... + asm(".code32"); + // do something useful +} + __attribute__ ((interrupt)) void isr_syscall(void* frame) { diff --git a/src/x86/isr.h b/src/x86/isr.h index 0940f61..ab1c80f 100644 --- a/src/x86/isr.h +++ b/src/x86/isr.h @@ -12,5 +12,8 @@ void isr_page_fault(void* frame, unsigned int error); __attribute__ ((interrupt)) void isr_double_fault(void* frame, unsigned int error); +__attribute__ ((interrupt, naked)) +void isr_ap_start(void* frame); + __attribute__ ((interrupt)) void isr_syscall(void* frame); \ No newline at end of file