summaryrefslogtreecommitdiff
path: root/x86_64
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2023-09-25 00:24:01 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-09-25 10:19:58 +0200
commitbe0abe4c2361f2c7db5a52b0900e298083fefe40 (patch)
treea56307a5e556d89f59ea3fc73841e604a3847dc0 /x86_64
parentbf1cd17a446cb99668d4398473e15b5613086ff5 (diff)
x86_64: Change active_threads to use gs like i386
Message-Id: <20230925002353.466997-1-damien@zamaudio.com>
Diffstat (limited to 'x86_64')
-rw-r--r--x86_64/cswitch.S2
-rw-r--r--x86_64/locore.S7
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 */