Changes in kernel/arch/amd64/src/context.S [3eebe571:0aee9b4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/context.S
r3eebe571 r0aee9b4 27 27 # 28 28 29 #include <abi/asmtool.h> 29 .text 30 31 .global context_save_arch 32 .global context_restore_arch 33 30 34 #include <arch/context_struct.h> 31 #include <arch/vreg.h>32 33 .text34 35 35 36 ## Save current CPU context … … 38 39 # pointed by the 1st argument. Returns 1 in EAX. 39 40 # 40 FUNCTION_BEGIN(context_save_arch) 41 movq (%rsp), %rdx # the caller's return % rip41 context_save_arch: 42 movq (%rsp), %rdx # the caller's return %eip 42 43 44 # 1st argument passed in %edi 43 45 movq %rdx, CONTEXT_OFFSET_PC(%rdi) 44 46 movq %rsp, CONTEXT_OFFSET_SP(%rdi) … … 50 52 movq %r14, CONTEXT_OFFSET_R14(%rdi) 51 53 movq %r15, CONTEXT_OFFSET_R15(%rdi) 52 53 movq vreg_ptr, %rsi54 movq %fs:VREG_TP(%rsi), %rsi55 movq %rsi, CONTEXT_OFFSET_TP(%rdi)56 54 57 55 xorl %eax, %eax # context_save returns 1 58 56 incl %eax 59 57 ret 60 FUNCTION_END(context_save_arch)61 58 62 59 … … 66 63 # pointed by the 1st argument. Returns 0 in EAX. 67 64 # 68 FUNCTION_BEGIN(context_restore_arch) 65 context_restore_arch: 69 66 movq CONTEXT_OFFSET_R15(%rdi), %r15 70 67 movq CONTEXT_OFFSET_R14(%rdi), %r14 … … 74 71 movq CONTEXT_OFFSET_RBX(%rdi), %rbx 75 72 76 movq CONTEXT_OFFSET_SP(%rdi), %rsp 73 movq CONTEXT_OFFSET_SP(%rdi), %rsp # ctx->sp -> %rsp 77 74 78 movq CONTEXT_OFFSET_PC(%rdi), %rdx 75 movq CONTEXT_OFFSET_PC(%rdi), %rdx 76 79 77 movq %rdx, (%rsp) 80 81 movq CONTEXT_OFFSET_TP(%rdi), %rcx82 movq vreg_ptr, %rsi83 movq %rcx, %fs:VREG_TP(%rsi)84 78 85 79 xorl %eax, %eax # context_restore returns 0 86 80 ret 87 FUNCTION_END(context_restore_arch)88 81
Note:
See TracChangeset
for help on using the changeset viewer.