diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-12 01:17:01 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-12 01:17:01 +0200 |
commit | 5897901d6ee40427f76997c82c7fd64789a6ef7f (patch) | |
tree | f941707ec32a49d429ed2350fb78fccf07616238 /x86_64/cswitch.S | |
parent | 1cf67399a9bfa13ab79974e345eb87fa70753da1 (diff) | |
download | gnumach-5897901d6ee40427f76997c82c7fd64789a6ef7f.tar.gz gnumach-5897901d6ee40427f76997c82c7fd64789a6ef7f.tar.bz2 gnumach-5897901d6ee40427f76997c82c7fd64789a6ef7f.zip |
x86_64: fix NCPUS > 1 build of CX() macro
With the kernel gone to -2GB, the base+index addressing needs to use a 64bit
register index.
Diffstat (limited to 'x86_64/cswitch.S')
-rw-r--r-- | x86_64/cswitch.S | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/x86_64/cswitch.S b/x86_64/cswitch.S index 015e884c..1f2e8e9d 100644 --- a/x86_64/cswitch.S +++ b/x86_64/cswitch.S @@ -40,8 +40,8 @@ ENTRY(Load_context) lea KERNEL_STACK_SIZE-IKS_SIZE-IEL_SIZE(%rcx),%rdx /* point to stack top */ CPU_NUMBER(%eax) - movq %rcx,CX(EXT(active_stacks),%eax) /* store stack address */ - movq %rdx,CX(EXT(kernel_stack),%eax) /* store stack top */ + movq %rcx,CX(EXT(active_stacks),%rax) /* store stack address */ + movq %rdx,CX(EXT(kernel_stack),%rax) /* store stack top */ /* XXX complete */ @@ -62,7 +62,7 @@ ENTRY(Load_context) ENTRY(Switch_context) CPU_NUMBER(%eax) - movq CX(EXT(active_stacks),%eax),%rcx /* get old kernel stack */ + movq CX(EXT(active_stacks),%rax),%rcx /* get old kernel stack */ movq %r12,KSS_R12(%rcx) /* save registers */ movq %r13,KSS_R13(%rcx) @@ -85,9 +85,9 @@ ENTRY(Switch_context) /* point to stack top */ CPU_NUMBER(%eax) - movq %rsi,CX(EXT(active_threads),%eax) /* new thread is active */ - movq %rcx,CX(EXT(active_stacks),%eax) /* set current stack */ - movq %rbx,CX(EXT(kernel_stack),%eax) /* set stack top */ + movq %rsi,CX(EXT(active_threads),%rax) /* new thread is active */ + movq %rcx,CX(EXT(active_stacks),%rax) /* set current stack */ + movq %rbx,CX(EXT(kernel_stack),%rax) /* set stack top */ movq KSS_ESP(%rcx),%rsp /* switch stacks */ movq KSS_EBP(%rcx),%rbp /* restore registers */ @@ -120,7 +120,7 @@ ENTRY(Thread_continue) ENTRY(switch_to_shutdown_context) ud2 CPU_NUMBER(%eax) - movq EXT(active_stacks)(,%eax,8),%rcx /* get old kernel stack */ + movq CX(EXT(active_stacks),%rax),%rcx /* get old kernel stack */ movq %r12,KSS_R12(%rcx) /* save registers */ movq %r13,KSS_R13(%rcx) movq %r14,KSS_R14(%rcx) @@ -136,8 +136,8 @@ ud2 movq S_ARG1,%rbx /* get routine to run next */ movq S_ARG2,%rsi /* get its argument */ - CPU_NUMBER(%eax) - movq CX(EXT(int_stack_base),%eax),%rcx /* point to its interrupt stack */ + CPU_NUMBER(%ecx) + movq CX(EXT(int_stack_base),%rcx),%rcx /* point to its interrupt stack */ lea INTSTACK_SIZE(%rcx),%rsp /* switch to it (top) */ movq %rax,%rdi /* push thread */ |