Changeset ab936440 in mainline for uspace/lib/c/arch/amd64/src/fibril.S
- Timestamp:
- 2019-02-12T20:42:42Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f31ca47
- Parents:
- 7f7817a9 (diff), 4805495 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Matthieu Riolo <matthieu.riolo@…> (2019-02-12 20:26:18)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2019-02-12 20:42:42)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/amd64/src/fibril.S
r7f7817a9 rab936440 37 37 # pointed by the 1st argument. Returns 0 in RAX. 38 38 # 39 FUNCTION_BEGIN(__ setjmp)39 FUNCTION_BEGIN(__context_save) 40 40 movq (%rsp), %rdx # the caller's return %eip 41 41 42 42 # in %rdi is passed 1st argument 43 movq %rdx, CONTEXT_OFFSET_PC(%rdi)44 movq %rsp, CONTEXT_OFFSET_SP(%rdi)43 movq %rdx, __CONTEXT_OFFSET_PC(%rdi) 44 movq %rsp, __CONTEXT_OFFSET_SP(%rdi) 45 45 46 movq %rbx, CONTEXT_OFFSET_RBX(%rdi)47 movq %rbp, CONTEXT_OFFSET_RBP(%rdi)48 movq %r12, CONTEXT_OFFSET_R12(%rdi)49 movq %r13, CONTEXT_OFFSET_R13(%rdi)50 movq %r14, CONTEXT_OFFSET_R14(%rdi)51 movq %r15, CONTEXT_OFFSET_R15(%rdi)46 movq %rbx, __CONTEXT_OFFSET_RBX(%rdi) 47 movq %rbp, __CONTEXT_OFFSET_RBP(%rdi) 48 movq %r12, __CONTEXT_OFFSET_R12(%rdi) 49 movq %r13, __CONTEXT_OFFSET_R13(%rdi) 50 movq %r14, __CONTEXT_OFFSET_R14(%rdi) 51 movq %r15, __CONTEXT_OFFSET_R15(%rdi) 52 52 53 53 movq %fs:0, %rax 54 movq %rax, CONTEXT_OFFSET_TLS(%rdi)54 movq %rax, __CONTEXT_OFFSET_TLS(%rdi) 55 55 56 xorq %rax, %rax # __ setjmpreturns 056 xorq %rax, %rax # __context_save returns 0 57 57 ret 58 FUNCTION_END(__ setjmp)58 FUNCTION_END(__context_save) 59 59 60 60 ## Restore current CPU context … … 63 63 # pointed by the 1st argument. Returns second argument in RAX. 64 64 # 65 FUNCTION_BEGIN(__ longjmp)66 movq CONTEXT_OFFSET_R15(%rdi), %r1567 movq CONTEXT_OFFSET_R14(%rdi), %r1468 movq CONTEXT_OFFSET_R13(%rdi), %r1369 movq CONTEXT_OFFSET_R12(%rdi), %r1270 movq CONTEXT_OFFSET_RBP(%rdi), %rbp71 movq CONTEXT_OFFSET_RBX(%rdi), %rbx65 FUNCTION_BEGIN(__context_restore) 66 movq __CONTEXT_OFFSET_R15(%rdi), %r15 67 movq __CONTEXT_OFFSET_R14(%rdi), %r14 68 movq __CONTEXT_OFFSET_R13(%rdi), %r13 69 movq __CONTEXT_OFFSET_R12(%rdi), %r12 70 movq __CONTEXT_OFFSET_RBP(%rdi), %rbp 71 movq __CONTEXT_OFFSET_RBX(%rdi), %rbx 72 72 73 movq CONTEXT_OFFSET_SP(%rdi), %rsp # ctx->sp -> %rsp73 movq __CONTEXT_OFFSET_SP(%rdi), %rsp # ctx->sp -> %rsp 74 74 75 movq CONTEXT_OFFSET_PC(%rdi), %rdx75 movq __CONTEXT_OFFSET_PC(%rdi), %rdx 76 76 77 77 movq %rdx,(%rsp) 78 78 79 movq CONTEXT_OFFSET_TLS(%rdi), %rdi79 movq __CONTEXT_OFFSET_TLS(%rdi), %rdi 80 80 movq %rdi, %fs:0 81 81 82 movq %rsi, %rax # __ longjmpreturns second argument82 movq %rsi, %rax # __context_restore returns second argument 83 83 ret 84 FUNCTION_END(__ longjmp)84 FUNCTION_END(__context_restore) 85 85
Note:
See TracChangeset
for help on using the changeset viewer.