summaryrefslogtreecommitdiffhomepage
path: root/Private
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-27 07:59:48 +0100
committerAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-27 07:59:48 +0100
commit9614c53b82037f77d5b57777560f8a320cb2ac4f (patch)
tree62a2b7ad4e59b808511b1f5d7019b6cd1430cd6c /Private
parentddb6c818256ad817ba8b5e93e7868571739ae49c (diff)
HAL: reworking lots of stuff who needs attention...
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private')
-rw-r--r--Private/HALKit/AMD64/HalInterruptRouting.asm5
-rw-r--r--Private/HALKit/AMD64/HalRoutines.s3
-rw-r--r--Private/HALKit/AMD64/HalSMPCoreManager.asm7
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