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