x
This commit is contained in:
parent
7ccc5f5f4f
commit
a7ef9a40c4
1 changed files with 4 additions and 4 deletions
8
swtch.S
8
swtch.S
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
.globl swtch
|
.globl swtch
|
||||||
swtch:
|
swtch:
|
||||||
# Save old callee-save registers
|
# Save old callee-saved registers
|
||||||
push %rbp
|
push %rbp
|
||||||
push %rbx
|
push %rbx
|
||||||
push %r11
|
push %r11
|
||||||
|
@ -18,10 +18,10 @@ swtch:
|
||||||
push %r15
|
push %r15
|
||||||
|
|
||||||
# Switch stacks
|
# Switch stacks
|
||||||
mov %rsp, (%rdi) # first arg is in rdi
|
mov %rsp, (%rdi) # first arg of swtch is in rdi
|
||||||
mov %rsi, %rsp # second arg is in rsi
|
mov %rsi, %rsp # second arg of swtch is in rsi
|
||||||
|
|
||||||
# Load new callee-save registers
|
# Load new callee-saved registers
|
||||||
pop %r15
|
pop %r15
|
||||||
pop %r14
|
pop %r14
|
||||||
pop %r13
|
pop %r13
|
||||||
|
|
Loading…
Reference in a new issue