Ignore:
Timestamp:
Mar 17, 2017, 11:34:15 AM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
b32ada31
Parents:
9f1695b
Message:

Some clean-up of runtime code

File:
1 edited

Legend:

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

    r9f1695b r17af7d1  
    6464
    6565      struct thread_desc* thrd = get_thread( this );
    66       struct coroutine_desc* cor = &thrd->c;
     66      struct coroutine_desc* cor = &thrd->cor;
    6767      cor->state = Active;
    6868
     
    9292        struct FakeStack {
    9393            void *fixedRegisters[3];                    // fixed registers ebx, edi, esi (popped on 1st uSwitch, values unimportant)
    94             uint32_t mxcr;                              // SSE Status and Control bits (control bits are preserved across function calls)
    95             uint16_t fcw;                               // X97 FPU control word (preserved across function calls)
    96             void *rturn;                                // where to go on return from uSwitch
     94            uint32_t mxcr;                        // SSE Status and Control bits (control bits are preserved across function calls)
     95          uint16_t fcw;                         // X97 FPU control word (preserved across function calls)
     96            void *rturn;                          // where to go on return from uSwitch
    9797            void *dummyReturn;                          // fake return compiler would have pushed on call to uInvoke
    9898            void *argument[3];                          // for 16-byte ABI, 16-byte alignment starts here
     
    106106        ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->argument[0] = this;     // argument to invoke
    107107        ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->rturn = invoke;
     108      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->mxcr = 0x1F80; //Vol. 2A 3-520
     109      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fcw = 0x037F;  //Vol. 1 8-7
    108110
    109111#elif defined( __x86_64__ )
    110112
    111113      struct FakeStack {
    112             void *fixedRegisters[5];                    // fixed registers rbx, r12, r13, r14, r15
    113             uint32_t mxcr;                              // SSE Status and Control bits (control bits are preserved across function calls)
    114             uint16_t fcw;                               // X97 FPU control word (preserved across function calls)
    115             void *rturn;                                // where to go on return from uSwitch
    116             void *dummyReturn;                          // NULL return address to provide proper alignment
     114            void *fixedRegisters[5];            // fixed registers rbx, r12, r13, r14, r15
     115            uint32_t mxcr;                      // SSE Status and Control bits (control bits are preserved across function calls)
     116            uint16_t fcw;                       // X97 FPU control word (preserved across function calls)
     117            void *rturn;                        // where to go on return from uSwitch
     118            void *dummyReturn;                  // NULL return address to provide proper alignment
    117119      };
    118120
Note: See TracChangeset for help on using the changeset viewer.