Ignore:
Timestamp:
May 9, 2019, 4:47:28 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, cleanup-dtors, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
b038fe4
Parents:
f019069
Message:

Removed suspend_then since I believe it cannot be made correct

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/CtxSwitch-x86_64.S

    rf019069 r63364d8  
    8080
    8181//-----------------------------------------------------------------------------
    82 // Part of a 2 part context switch routine, use with CtxRet, stores the current context and then makes a function call
    83         .text
    84         .align 2
    85         .globl CtxStore
    86         .type  CtxStore, @function
    87 CtxStore:
    88 
    89         // Save volatile registers on the stack.
    90 
    91         pushq %r15
    92         pushq %r14
    93         pushq %r13
    94         pushq %r12
    95         pushq %rbx
    96 
    97         // Save old context in the "from" area.
    98 
    99         movq %rsp,SP_OFFSET(%rdi)
    100         movq %rbp,FP_OFFSET(%rdi)
    101 
    102         mfence
    103 
    104         // Don't load a new context, directly jump to the desired function
    105 #if defined(PIC)
    106         call __suspend_callback@plt
    107 #else
    108         call __suspend_callback
    109 #endif
    110         .size  CtxStore, .-CtxStore
    111 
    112 //-----------------------------------------------------------------------------
    113 // Part of a 2 part context switch routine, use with CtxStore, context switches to the desired target without saving the current context
    114         .text
    115         .align 2
    116         .globl CtxRet
    117         .type  CtxRet, @function
    118 CtxRet:
    119         // Load new context from the "to" area.
    120 
    121         movq SP_OFFSET(%rdi),%rsp
    122         movq FP_OFFSET(%rdi),%rbp
    123 
    124         // Load volatile registers from the stack.
    125 
    126         popq %rbx
    127         popq %r12
    128         popq %r13
    129         popq %r14
    130         popq %r15
    131 
    132         // Return to thread.
    133 
    134         ret
    135         .size  CtxRet, .-CtxRet
    136 
    137 
    138 //-----------------------------------------------------------------------------
    13982// Stub used to create new stacks which are ready to be context switched to
    14083        .text
Note: See TracChangeset for help on using the changeset viewer.