Changeset b58a5772


Ignore:
Timestamp:
Dec 8, 2016, 5:50:39 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
164d036
Parents:
fda7e90
Message:

Removed workarounds the void ptr error (now fixed).
Renamed a few functions for consistency

Location:
src/libcfa/concurrency
Files:
4 edited

Legend:

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

    rfda7e90 rb58a5772  
    7979.text
    8080        .align 2
    81 .globl  coInvokeStub
    82 coInvokeStub:
     81.globl  CtxInvokeStub
     82CtxInvokeStub:
    8383        movq %rbx, %rdi
    8484        jmp *%r12
  • src/libcfa/concurrency/invoke.c

    rfda7e90 rb58a5772  
    1515extern void __suspend__F___1(void);
    1616
    17 void invokeCoroutine(
     17void CtxInvokeCoroutine(
    1818      void (*main)(void *),
    1919      struct coroutine *(*get_coroutine)(void *),
     
    3434
    3535
    36 void startCoroutine(
     36void CtxStart(
    3737      void (*main)(void *),
    3838      struct coroutine *(*get_coroutine)(void *),
     
    7373
    7474      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->dummyReturn = NULL;
    75       ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->rturn = coInvokeStub;
     75      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->rturn = CtxInvokeStub;
    7676      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[0] = this;
    7777      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[1] = invoke;
  • src/libcfa/concurrency/invoke.h

    rfda7e90 rb58a5772  
    4545
    4646      // assembler routines that performs the context switch
    47       extern void coInvokeStub( void );
     47      extern void CtxInvokeStub( void );
    4848      void CtxSwitch( void *from, void *to ) asm ("CtxSwitch");
    4949
  • src/libcfa/concurrency/threads.c

    rfda7e90 rb58a5772  
    4444}
    4545
    46 void ctxSwitchDirect(coroutine* src, coroutine* dst);
     46void corCxtSw(coroutine* src, coroutine* dst);
    4747void create_stack( coStack_t* this, unsigned int storageSize ); // used by all constructors
    4848
    4949extern "C" {
    5050      forall(dtype T | is_coroutine(T))
    51       void invokeCoroutine(T* this);
     51      void CtxInvokeCoroutine(T* this);
    5252
    5353      forall(dtype T | is_coroutine(T))
    54       void startCoroutine(T* this, void (*invoke)(T*));
     54      void CtxStart(T* this, void (*invoke)(T*));
    5555}
    5656
     
    100100                src->name, src, src->last->name, src->last );
    101101
    102         ctxSwitchDirect( src, src->last );
     102        corCxtSw( src, src->last );
    103103}
    104104
     
    108108        coroutine* dst = get_coroutine(cor);
    109109
    110         if( ((intptr_t)dst->stack.base) == 0 ) {
     110        if( dst->stack.base == NULL ) {
    111111                create_stack(&dst->stack, dst->stack.size);
    112                 startCoroutine(cor, invokeCoroutine);
     112                CtxStart(cor, CtxInvokeCoroutine);
    113113        }
    114114
     
    120120                dst->last = src;                                        // set last resumer
    121121        } // if
    122         ctxSwitchDirect( src, dst );                            // always done for performance testing
     122        corCxtSw( src, dst );                           // always done for performance testing
    123123}
    124124
     
    132132}
    133133
    134 void ctxSwitchDirect(coroutine* src, coroutine* dst) {
     134void corCxtSw(coroutine* src, coroutine* dst) {
    135135        // THREAD_GETMEM( This )->disableInterrupts();
    136136
Note: See TracChangeset for help on using the changeset viewer.