Changeset 63364d8 for libcfa/src/concurrency/CtxSwitch-x86_64.S
- Timestamp:
- May 9, 2019, 4:47:28 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b038fe4
- Parents:
- f019069
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/CtxSwitch-x86_64.S
rf019069 r63364d8 80 80 81 81 //----------------------------------------------------------------------------- 82 // Part of a 2 part context switch routine, use with CtxRet, stores the current context and then makes a function call83 .text84 .align 285 .globl CtxStore86 .type CtxStore, @function87 CtxStore:88 89 // Save volatile registers on the stack.90 91 pushq %r1592 pushq %r1493 pushq %r1394 pushq %r1295 pushq %rbx96 97 // Save old context in the "from" area.98 99 movq %rsp,SP_OFFSET(%rdi)100 movq %rbp,FP_OFFSET(%rdi)101 102 mfence103 104 // Don't load a new context, directly jump to the desired function105 #if defined(PIC)106 call __suspend_callback@plt107 #else108 call __suspend_callback109 #endif110 .size CtxStore, .-CtxStore111 112 //-----------------------------------------------------------------------------113 // Part of a 2 part context switch routine, use with CtxStore, context switches to the desired target without saving the current context114 .text115 .align 2116 .globl CtxRet117 .type CtxRet, @function118 CtxRet:119 // Load new context from the "to" area.120 121 movq SP_OFFSET(%rdi),%rsp122 movq FP_OFFSET(%rdi),%rbp123 124 // Load volatile registers from the stack.125 126 popq %rbx127 popq %r12128 popq %r13129 popq %r14130 popq %r15131 132 // Return to thread.133 134 ret135 .size CtxRet, .-CtxRet136 137 138 //-----------------------------------------------------------------------------139 82 // Stub used to create new stacks which are ready to be context switched to 140 83 .text
Note: See TracChangeset
for help on using the changeset viewer.