Changes in uspace/lib/c/arch/amd64/src/fibril.S [1a5eca4:4dc7a84] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/amd64/src/fibril.S
r1a5eca4 r4dc7a84 27 27 # 28 28 29 #include <abi/asmtool.h> 29 .text 30 31 .global context_save 32 .global context_restore 33 30 34 #include <libarch/fibril_context.h> 31 32 .text33 35 34 36 ## Save current CPU context … … 37 39 # pointed by the 1st argument. Returns 1 in EAX. 38 40 # 39 FUNCTION_BEGIN(context_save) 41 context_save: 40 42 movq (%rsp), %rdx # the caller's return %eip 41 43 … … 51 53 movq %r15, CONTEXT_OFFSET_R15(%rdi) 52 54 55 # save TLS 53 56 movq %fs:0, %rax 54 57 movq %rax, CONTEXT_OFFSET_TLS(%rdi) … … 57 60 incl %eax 58 61 ret 59 FUNCTION_END(context_save)60 62 61 63 ## Restore current CPU context … … 64 66 # pointed by the 1st argument. Returns 0 in EAX. 65 67 # 66 FUNCTION_BEGIN(context_restore) 68 context_restore: 69 67 70 movq CONTEXT_OFFSET_R15(%rdi), %r15 68 71 movq CONTEXT_OFFSET_R14(%rdi), %r14 … … 78 81 movq %rdx,(%rsp) 79 82 80 movq CONTEXT_OFFSET_TLS(%rdi), %rdi 81 movq %rdi, %fs:0 83 # Set thread local storage 84 movq CONTEXT_OFFSET_TLS(%rdi), %rdi # Set arg1 to TLS addr 85 movl $1, %eax # SYS_TLS_SET 86 syscall 82 87 83 88 xorl %eax, %eax # context_restore returns 0 84 89 ret 85 FUNCTION_END(context_restore)86 90
Note:
See TracChangeset
for help on using the changeset viewer.