Ignore:
File:
1 edited

Legend:

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

    rb6f2b213 r09f357ec  
    3131}
    3232
    33 void __schedule_thread( $thread * ) __attribute__((nonnull (1)));
     33void ScheduleThread( thread_desc * );
     34static inline void WakeThread( thread_desc * thrd ) {
     35        if( !thrd ) return;
     36
     37        verify(thrd->state == Inactive);
     38
     39        disable_interrupts();
     40        ScheduleThread( thrd );
     41        enable_interrupts( __cfaabi_dbg_ctx );
     42}
     43thread_desc * nextThread(cluster * this);
    3444
    3545//Block current thread and release/wake-up the following resources
    36 void __leave_thread() __attribute__((noreturn));
     46void BlockInternal(void);
     47void BlockInternal(__spinlock_t * lock);
     48void BlockInternal(thread_desc * thrd);
     49void BlockInternal(__spinlock_t * lock, thread_desc * thrd);
     50void BlockInternal(__spinlock_t * locks [], unsigned short count);
     51void BlockInternal(__spinlock_t * locks [], unsigned short count, thread_desc * thrds [], unsigned short thrd_count);
     52void BlockInternal(__finish_callback_fptr_t callback);
     53void LeaveThread(__spinlock_t * lock, thread_desc * thrd);
    3754
    3855//-----------------------------------------------------------------------------
     
    4057void main(processorCtx_t *);
    4158
    42 void * __create_pthread( pthread_t *, void * (*)(void *), void * );
     59void * create_pthread( pthread_t *, void * (*)(void *), void * );
    4360
     61static inline void wake_fast(processor * this) {
     62        __cfaabi_dbg_print_safe("Kernel : Waking up processor %p\n", this);
     63        post( this->idleLock );
     64}
    4465
     66static inline void wake(processor * this) {
     67        disable_interrupts();
     68        wake_fast(this);
     69        enable_interrupts( __cfaabi_dbg_ctx );
     70}
    4571
    4672struct event_kernel_t {
     
    5985extern volatile thread_local __cfa_kernel_preemption_state_t preemption_state __attribute__ ((tls_model ( "initial-exec" )));
    6086
    61 extern cluster * mainCluster;
    62 
    6387//-----------------------------------------------------------------------------
    6488// Threads
    6589extern "C" {
    66       void __cfactx_invoke_thread(void (*main)(void *), void * this);
     90      void CtxInvokeThread(void (*main)(void *), void * this);
    6791}
    6892
     93extern void ThreadCtxSwitch(coroutine_desc * src, coroutine_desc * dst);
     94
    6995__cfaabi_dbg_debug_do(
    70         extern void __cfaabi_dbg_thread_register  ( $thread * thrd );
    71         extern void __cfaabi_dbg_thread_unregister( $thread * thrd );
     96        extern void __cfaabi_dbg_thread_register  ( thread_desc * thrd );
     97        extern void __cfaabi_dbg_thread_unregister( thread_desc * thrd );
    7298)
    73 
    74 // KERNEL ONLY unpark with out disabling interrupts
    75 void __unpark( $thread * thrd __cfaabi_dbg_ctx_param2 );
    76 
    77 //-----------------------------------------------------------------------------
    78 // I/O
    79 void __kernel_io_startup     ( cluster &, int, bool );
    80 void __kernel_io_finish_start( cluster & );
    81 void __kernel_io_prepare_stop( cluster & );
    82 void __kernel_io_shutdown    ( cluster &, bool );
    8399
    84100//-----------------------------------------------------------------------------
     
    86102#define KERNEL_STORAGE(T,X) static char storage_##X[sizeof(T)]
    87103
    88 static inline uint32_t __tls_rand() {
     104static inline uint32_t tls_rand() {
    89105        kernelTLS.rand_seed ^= kernelTLS.rand_seed << 6;
    90106        kernelTLS.rand_seed ^= kernelTLS.rand_seed >> 21;
     
    97113void unregister( struct cluster & cltr );
    98114
    99 void doregister( struct cluster * cltr, struct $thread & thrd );
    100 void unregister( struct cluster * cltr, struct $thread & thrd );
     115void doregister( struct cluster * cltr, struct thread_desc & thrd );
     116void unregister( struct cluster * cltr, struct thread_desc & thrd );
    101117
    102118void doregister( struct cluster * cltr, struct processor * proc );
Note: See TracChangeset for help on using the changeset viewer.