[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] x86_64: Change active_threads to use gs like i386
From: |
Damien Zammit |
Subject: |
[PATCH] x86_64: Change active_threads to use gs like i386 |
Date: |
Mon, 25 Sep 2023 00:24:01 +0000 |
---
x86_64/cswitch.S | 2 +-
x86_64/locore.S | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/x86_64/cswitch.S b/x86_64/cswitch.S
index 1f2e8e9d..29dae62c 100644
--- a/x86_64/cswitch.S
+++ b/x86_64/cswitch.S
@@ -85,7 +85,7 @@ ENTRY(Switch_context)
/* point to stack top */
CPU_NUMBER(%eax)
- movq %rsi,CX(EXT(active_threads),%rax) /* new thread is active
*/
+ movq %rsi,MY(ACTIVE_THREAD) /* new thread is active */
movq %rcx,CX(EXT(active_stacks),%rax) /* set current stack */
movq %rbx,CX(EXT(kernel_stack),%rax) /* set stack top */
diff --git a/x86_64/locore.S b/x86_64/locore.S
index b282da4f..55dc4d27 100644
--- a/x86_64/locore.S
+++ b/x86_64/locore.S
@@ -1186,7 +1186,7 @@ syscall_entry_2:
* Check for MACH or emulated system call
*/
syscall_entry_3:
- movq CX(EXT(active_threads),%rdx),%rdx
+ movq MY(ACTIVE_THREAD),%rdx
/* point to current thread */
movq TH_TASK(%rdx),%rdx /* point to task */
movq TASK_EMUL(%rdx),%rdx /* get emulation vector */
@@ -1373,8 +1373,7 @@ ENTRY(syscall64)
* save only the callee-preserved status according to the C ABI,
* plus RIP and EFLAGS for sysret
*/
- CPU_NUMBER_NO_STACK(%r11)
- movq CX(EXT(active_threads),%r11),%r11 /* point to current thread */
+ movq MY(ACTIVE_THREAD),%r11 /* point to current thread */
movq TH_PCB(%r11),%r11 /* point to pcb */
addq $ PCB_ISS,%r11 /* point to saved state */
@@ -1471,7 +1470,7 @@ _syscall64_check_for_ast:
_syscall64_restore_state:
/* Restore thread state and return to user using sysret. */
cli /* block interrupts when using the user stack in kernel space */
- movq CX(EXT(active_threads),%r11),%r11 /* point to current thread */
+ movq MY(ACTIVE_THREAD),%r11 /* point to current thread */
movq TH_PCB(%r11),%r11 /* point to pcb */
addq $ PCB_ISS,%r11 /* point to saved state */
--
2.40.1
- [PATCH] x86_64: Change active_threads to use gs like i386,
Damien Zammit <=