Ignore:
Timestamp:
Oct 29, 2019, 4:01:24 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
773db65, 9421f3d8
Parents:
7951100 (diff), 8364209 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 moved

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel_private.hfa

    r7951100 rb067d9b  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // kernel_private.h --
     7// kernel_private.hfa --
    88//
    99// Author           : Thierry Delisle
     
    1616#pragma once
    1717
    18 #include "kernel"
    19 #include "thread"
     18#include "kernel.hfa"
     19#include "thread.hfa"
    2020
    21 #include "alarm.h"
     21#include "alarm.hfa"
    2222
    2323
     
    2626
    2727extern "C" {
    28         void disable_interrupts();
     28        void disable_interrupts() OPTIONAL_THREAD;
    2929        void enable_interrupts_noPoll();
    3030        void enable_interrupts( __cfaabi_dbg_ctx_param );
     
    3434static inline void WakeThread( thread_desc * thrd ) {
    3535        if( !thrd ) return;
     36
     37        verify(thrd->state == Inactive);
    3638
    3739        disable_interrupts();
     
    5456// Processor
    5557void main(processorCtx_t *);
    56 void start(processor * this);
    57 void runThread(processor * this, thread_desc * dst);
    58 void finishRunning(processor * this);
    59 void halt(processor * this);
    60 void wake(processor * this);
    61 void terminate(processor * this);
    62 void spin(processor * this, unsigned int * spin_count);
     58
     59static inline void wake_fast(processor * this) {
     60        __cfaabi_dbg_print_safe("Kernel : Waking up processor %p\n", this);
     61        post( this->idleLock );
     62}
     63
     64static inline void wake(processor * this) {
     65        disable_interrupts();
     66        wake_fast(this);
     67        enable_interrupts( __cfaabi_dbg_ctx );
     68}
    6369
    6470struct event_kernel_t {
     
    6975extern event_kernel_t * event_kernel;
    7076
    71 //extern thread_local coroutine_desc * volatile this_coroutine;
    72 //extern thread_local thread_desc *    volatile this_thread;
    73 //extern thread_local processor *      volatile this_processor;
    74 
    75 // extern volatile thread_local bool preemption_in_progress;
    76 // extern volatile thread_local bool preemption_enabled;
    77 // extern volatile thread_local unsigned short disable_preempt_count;
    78 
    7977struct __cfa_kernel_preemption_state_t {
    8078        bool enabled;
     
    8381};
    8482
    85 extern volatile thread_local __cfa_kernel_preemption_state_t preemption_state;
     83extern volatile thread_local __cfa_kernel_preemption_state_t preemption_state __attribute__ ((tls_model ( "initial-exec" )));
    8684
    8785//-----------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.