From 9614c53b82037f77d5b57777560f8a320cb2ac4f Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 27 Feb 2024 07:59:48 +0100 Subject: HAL: reworking lots of stuff who needs attention... Signed-off-by: Amlal El Mahrouss --- Private/HALKit/AMD64/HalInterruptRouting.asm | 5 ++--- Private/HALKit/AMD64/HalRoutines.s | 3 +-- Private/HALKit/AMD64/HalSMPCoreManager.asm | 7 ++++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Private/HALKit/AMD64/HalInterruptRouting.asm b/Private/HALKit/AMD64/HalInterruptRouting.asm index 33077e68..89f4be0f 100644 --- a/Private/HALKit/AMD64/HalInterruptRouting.asm +++ b/Private/HALKit/AMD64/HalInterruptRouting.asm @@ -17,14 +17,14 @@ %macro IntExp 1 HCoreInterrupt%1: - cli + cld push %1 call ke_handle_irq %endmacro %macro IntNormal 1 HCoreInterrupt%1: - cli + cld push 0 push %1 call ke_handle_irq @@ -42,7 +42,6 @@ ke_handle_irq: sti iretq -__IVT: IntNormal 0 IntNormal 1 IntNormal 2 diff --git a/Private/HALKit/AMD64/HalRoutines.s b/Private/HALKit/AMD64/HalRoutines.s index 80a6b122..bfe6ca29 100644 --- a/Private/HALKit/AMD64/HalRoutines.s +++ b/Private/HALKit/AMD64/HalRoutines.s @@ -32,5 +32,4 @@ rt_wait_for_io: ret rt_get_current_context: - mov %rbp, %rax - ret + retfq diff --git a/Private/HALKit/AMD64/HalSMPCoreManager.asm b/Private/HALKit/AMD64/HalSMPCoreManager.asm index 08f34517..97946098 100644 --- a/Private/HALKit/AMD64/HalSMPCoreManager.asm +++ b/Private/HALKit/AMD64/HalSMPCoreManager.asm @@ -14,7 +14,7 @@ section .text rt_do_context_switch: - mov rcx, r15 + mov r15, rcx mov [r15+0], rax mov [r15+8], rbx @@ -33,6 +33,7 @@ rt_do_context_switch: mov [r15+112], r14 mov [r15+120], r15 - ;; Set APIC address of current core. + pop r15 + pop rax - ret + retfq -- cgit v1.2.3