Changes in kernel/arch/amd64/src/context.S [4bf0926e:0aee9b4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/context.S
r4bf0926e 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) … … 51 53 movq %r15, CONTEXT_OFFSET_R15(%rdi) 52 54 53 #ifdef MEMORY_MODEL_large54 movabsq $vreg_ptr, %rsi55 movq (%rsi), %rsi56 #else57 movq vreg_ptr, %rsi58 #endif59 movq %fs:VREG_TP(%rsi), %rsi60 movq %rsi, CONTEXT_OFFSET_TP(%rdi)61 62 55 xorl %eax, %eax # context_save returns 1 63 56 incl %eax 64 57 ret 65 FUNCTION_END(context_save_arch)66 58 67 59 … … 71 63 # pointed by the 1st argument. Returns 0 in EAX. 72 64 # 73 FUNCTION_BEGIN(context_restore_arch) 65 context_restore_arch: 74 66 movq CONTEXT_OFFSET_R15(%rdi), %r15 75 67 movq CONTEXT_OFFSET_R14(%rdi), %r14 … … 79 71 movq CONTEXT_OFFSET_RBX(%rdi), %rbx 80 72 81 movq CONTEXT_OFFSET_SP(%rdi), %rsp 73 movq CONTEXT_OFFSET_SP(%rdi), %rsp # ctx->sp -> %rsp 82 74 83 movq CONTEXT_OFFSET_PC(%rdi), %rdx 75 movq CONTEXT_OFFSET_PC(%rdi), %rdx 76 84 77 movq %rdx, (%rsp) 85 86 movq CONTEXT_OFFSET_TP(%rdi), %rcx87 #ifdef MEMORY_MODEL_large88 movabsq $vreg_ptr, %rsi89 movq (%rsi), %rsi90 #else91 movq vreg_ptr, %rsi92 #endif93 movq %rcx, %fs:VREG_TP(%rsi)94 78 95 79 xorl %eax, %eax # context_restore returns 0 96 80 ret 97 FUNCTION_END(context_restore_arch)98 81
Note:
See TracChangeset
for help on using the changeset viewer.