- File:
-
- 1 edited
-
libcfa/src/concurrency/CtxSwitch-x86_64.S (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/CtxSwitch-x86_64.S
r63364d8 rbf71cfd 39 39 #define SP_OFFSET ( 0 * PTR_BYTE ) 40 40 #define FP_OFFSET ( 1 * PTR_BYTE ) 41 #define PC_OFFSET ( 2 * PTR_BYTE ) 41 42 42 //----------------------------------------------------------------------------- 43 // Regular context switch routine which enables switching from one context to anouther 44 .text 43 .text 45 44 .align 2 46 .globl CtxSwitch 47 .type CtxSwitch, @function 45 .globl CtxSwitch 48 46 CtxSwitch: 47 48 // Save floating & SSE control words on the stack. 49 50 subq $8,%rsp 51 stmxcsr 0(%rsp) // 4 bytes 52 fnstcw 4(%rsp) // 2 bytes 49 53 50 54 // Save volatile registers on the stack. … … 74 78 popq %r15 75 79 80 // Load floating & SSE control words from the stack. 81 82 fldcw 4(%rsp) 83 ldmxcsr 0(%rsp) 84 addq $8,%rsp 85 76 86 // Return to thread. 77 87 78 88 ret 79 .size CtxSwitch, .-CtxSwitch80 89 81 //----------------------------------------------------------------------------- 82 // Stub used to create new stacks which are ready to be context switched to 83 .text 90 .text 84 91 .align 2 85 .globl CtxInvokeStub 86 .type CtxInvokeStub, @function 92 .globl CtxInvokeStub 87 93 CtxInvokeStub: 88 94 movq %rbx, %rdi 89 95 jmp *%r12 90 .size CtxInvokeStub, .-CtxInvokeStub91 96 92 97 // Local Variables: //
Note:
See TracChangeset
for help on using the changeset viewer.