Cleanup docs in assembly routines.
This commit is contained in:
parent
3a21b98358
commit
b39acb2afd
@ -10,6 +10,7 @@
|
||||
# %rdi: oldsp
|
||||
# %rsi: newsp
|
||||
FUNC_BEGIN(switchstack)
|
||||
# Save callee saved registers of old thread
|
||||
pushq %rbp
|
||||
pushq %rdi
|
||||
pushq %rbx
|
||||
@ -18,10 +19,11 @@ FUNC_BEGIN(switchstack)
|
||||
pushq %r14
|
||||
pushq %r15
|
||||
|
||||
# Switch stack
|
||||
# Switch stack from old to new thread
|
||||
movq %rsp, (%rdi)
|
||||
movq %rsi, %rsp
|
||||
|
||||
# Restore callee saved registers of new thread
|
||||
popq %r15
|
||||
popq %r14
|
||||
popq %r13
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
.macro TRAP_NOEC TRAPNUM
|
||||
trap\TRAPNUM:
|
||||
# Push top of the trap frame
|
||||
pushq %rax
|
||||
pushq $\TRAPNUM
|
||||
pushq %rax
|
||||
@ -19,6 +20,7 @@ trap\TRAPNUM:
|
||||
|
||||
.macro TRAP_EC TRAPNUM
|
||||
trap\TRAPNUM:
|
||||
# Push top of the trap frame
|
||||
pushq $\TRAPNUM
|
||||
pushq %rax
|
||||
xorq %rax, %rax
|
||||
@ -160,6 +162,7 @@ TRAP_NOEC 62
|
||||
TRAP_NOEC 63
|
||||
|
||||
trap_common:
|
||||
# Create the rest of the trap frame
|
||||
pushq %rbx
|
||||
pushq %rcx
|
||||
pushq %rdx
|
||||
@ -174,6 +177,8 @@ trap_common:
|
||||
pushq %r13
|
||||
pushq %r14
|
||||
pushq %r15
|
||||
|
||||
# Pass the trap frame as an argument to trap_entry
|
||||
movq %rsp, %rdi
|
||||
call trap_entry
|
||||
.globl trap_return
|
||||
@ -195,7 +200,11 @@ trap_return:
|
||||
popq %rax
|
||||
movw %ax, %ds
|
||||
popq %rax
|
||||
addq $16, %rsp // Skip error code and vector number
|
||||
|
||||
# Skip error code and vector number
|
||||
addq $16, %rsp
|
||||
|
||||
# Return to userspace
|
||||
iretq
|
||||
|
||||
.globl Trap_Pop
|
||||
|
Loading…
Reference in New Issue
Block a user