Ignore:
File:
1 edited

Legend:

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

    rac2b598 r2026bb6  
    1010// Created On       : Mon Feb 13 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Nov 30 19:25:02 2019
    13 // Update Count     : 8
     12// Last Modified On : Thu Mar 29 14:06:40 2018
     13// Update Count     : 3
    1414//
    1515
     
    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        disable_interrupts();
     38        ScheduleThread( thrd );
     39        enable_interrupts( __cfaabi_dbg_ctx );
     40}
     41thread_desc * nextThread(cluster * this);
    3442
    3543//Block current thread and release/wake-up the following resources
    36 void __leave_thread() __attribute__((noreturn));
     44void BlockInternal(void);
     45void BlockInternal(__spinlock_t * lock);
     46void BlockInternal(thread_desc * thrd);
     47void BlockInternal(__spinlock_t * lock, thread_desc * thrd);
     48void BlockInternal(__spinlock_t * locks [], unsigned short count);
     49void BlockInternal(__spinlock_t * locks [], unsigned short count, thread_desc * thrds [], unsigned short thrd_count);
     50void BlockInternal(__finish_callback_fptr_t callback);
     51void LeaveThread(__spinlock_t * lock, thread_desc * thrd);
    3752
    3853//-----------------------------------------------------------------------------
    3954// Processor
    4055void main(processorCtx_t *);
    41 
    42 void * __create_pthread( pthread_t *, void * (*)(void *), void * );
    4356
    4457static inline void wake_fast(processor * this) {
     
    7184// Threads
    7285extern "C" {
    73       void __cfactx_invoke_thread(void (*main)(void *), void * this);
     86      forall(dtype T | is_thread(T))
     87      void CtxInvokeThread(T * this);
    7488}
    7589
     90extern void ThreadCtxSwitch(coroutine_desc * src, coroutine_desc * dst);
     91
    7692__cfaabi_dbg_debug_do(
    77         extern void __cfaabi_dbg_thread_register  ( $thread * thrd );
    78         extern void __cfaabi_dbg_thread_unregister( $thread * thrd );
     93        extern void __cfaabi_dbg_thread_register  ( thread_desc * thrd );
     94        extern void __cfaabi_dbg_thread_unregister( thread_desc * thrd );
    7995)
    8096
     
    8399#define KERNEL_STORAGE(T,X) static char storage_##X[sizeof(T)]
    84100
    85 static inline uint32_t __tls_rand() {
    86         kernelTLS.rand_seed ^= kernelTLS.rand_seed << 6;
    87         kernelTLS.rand_seed ^= kernelTLS.rand_seed >> 21;
    88         kernelTLS.rand_seed ^= kernelTLS.rand_seed << 7;
    89         return kernelTLS.rand_seed;
    90 }
    91 
    92101
    93102void doregister( struct cluster & cltr );
    94103void unregister( struct cluster & cltr );
    95104
    96 void doregister( struct cluster * cltr, struct $thread & thrd );
    97 void unregister( struct cluster * cltr, struct $thread & thrd );
     105void doregister( struct cluster * cltr, struct thread_desc & thrd );
     106void unregister( struct cluster * cltr, struct thread_desc & thrd );
    98107
    99108void doregister( struct cluster * cltr, struct processor * proc );
Note: See TracChangeset for help on using the changeset viewer.