Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/invoke.c

    r8761006c r0157ca7  
    2828// Called from the kernel when starting a coroutine or task so must switch back to user mode.
    2929
    30 extern void __suspend_internal(void);
    31 extern void __thread_signal_termination(struct thread*);
     30extern void __suspend_no_inline__F___1(void);
     31extern void __signal_termination__F_P7sthread__1(struct thread*);
    3232
    3333void CtxInvokeCoroutine(
     
    4141
    4242      if(cor->state == Primed) {
    43             __suspend_internal();
     43            __suspend_no_inline__F___1();
    4444      }
    4545
     
    5252
    5353      //Final suspend, should never return
    54       __suspend_internal();
    55       abortf("Resumed dead coroutine");
     54      __suspend_no_inline__F___1();
     55      assertf(false, "Resumed dead coroutine");
    5656}
    5757
     
    6161      void *this
    6262) {
    63       __suspend_internal();
     63      // LIB_DEBUG_PRINTF("Invoke Thread : Received %p (main %p, get_t %p)\n", this, main, get_thread);
     64
     65      __suspend_no_inline__F___1();
    6466
    6567      struct thread* thrd = get_thread( this );
     
    7072      main( this );
    7173
    72       __thread_signal_termination(thrd);
     74      __signal_termination__F_P7sthread__1(thrd);
    7375
    7476      //Final suspend, should never return
    75       __suspend_internal();
    76       abortf("Resumed dead thread");
     77      __suspend_no_inline__F___1();
     78      assertf(false, "Resumed dead thread");
    7779}
    7880
     
    109111      struct FakeStack {
    110112            void *fixedRegisters[5];                    // fixed registers rbx, r12, r13, r14, r15
    111             uint32_t mxcr;                                  // SSE Status and Control bits (control bits are preserved across function calls)
    112             uint16_t fcw;                                   // X97 FPU control word (preserved across function calls)
    113             void *rturn;                                      // where to go on return from uSwitch
     113            void *rturn;                                        // where to go on return from uSwitch
    114114            void *dummyReturn;                          // NULL return address to provide proper alignment
    115115      };
     
    122122      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[0] = this;
    123123      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[1] = invoke;
    124       ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->mxcr = 0x1F80; //Vol. 2A 3-520
    125       ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fcw = 0x037F;  //Vol. 1 8-7
    126124#else
    127125      #error Only __i386__ and __x86_64__ is supported for threads in cfa
Note: See TracChangeset for help on using the changeset viewer.