Ignore:
Timestamp:
Apr 6, 2020, 4:46:28 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
Children:
e3bc51c
Parents:
71d6bd8 (diff), 057298e (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' into new-ast

File:
1 edited

Legend:

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

    r71d6bd8 r7030dab  
    1010// Created On       : Mon Feb 13 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 29 14:06:40 2018
    13 // Update Count     : 3
     12// Last Modified On : Sat Nov 30 19:25:02 2019
     13// Update Count     : 8
    1414//
    1515
     
    3131}
    3232
    33 void ScheduleThread( thread_desc * );
    34 static 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 }
    43 thread_desc * nextThread(cluster * this);
     33void __schedule_thread( $thread * ) __attribute__((nonnull (1)));
    4434
    4535//Block current thread and release/wake-up the following resources
    46 void BlockInternal(void);
    47 void BlockInternal(__spinlock_t * lock);
    48 void BlockInternal(thread_desc * thrd);
    49 void BlockInternal(__spinlock_t * lock, thread_desc * thrd);
    50 void BlockInternal(__spinlock_t * locks [], unsigned short count);
    51 void BlockInternal(__spinlock_t * locks [], unsigned short count, thread_desc * thrds [], unsigned short thrd_count);
    52 void BlockInternal(__finish_callback_fptr_t callback);
    53 void LeaveThread(__spinlock_t * lock, thread_desc * thrd);
     36void __leave_thread() __attribute__((noreturn));
    5437
    5538//-----------------------------------------------------------------------------
     
    5740void main(processorCtx_t *);
    5841
    59 static inline void wake_fast(processor * this) {
    60         __cfaabi_dbg_print_safe("Kernel : Waking up processor %p\n", this);
    61         post( this->idleLock );
    62 }
     42void * __create_pthread( pthread_t *, void * (*)(void *), void * );
    6343
    64 static inline void wake(processor * this) {
    65         disable_interrupts();
    66         wake_fast(this);
    67         enable_interrupts( __cfaabi_dbg_ctx );
    68 }
     44
    6945
    7046struct event_kernel_t {
     
    8662// Threads
    8763extern "C" {
    88       forall(dtype T | is_thread(T))
    89       void CtxInvokeThread(T * this);
     64      void __cfactx_invoke_thread(void (*main)(void *), void * this);
    9065}
    9166
    92 extern void ThreadCtxSwitch(coroutine_desc * src, coroutine_desc * dst);
    93 
    9467__cfaabi_dbg_debug_do(
    95         extern void __cfaabi_dbg_thread_register  ( thread_desc * thrd );
    96         extern void __cfaabi_dbg_thread_unregister( thread_desc * thrd );
     68        extern void __cfaabi_dbg_thread_register  ( $thread * thrd );
     69        extern void __cfaabi_dbg_thread_unregister( $thread * thrd );
    9770)
    9871
     
    10174#define KERNEL_STORAGE(T,X) static char storage_##X[sizeof(T)]
    10275
    103 static inline uint32_t tls_rand() {
     76static inline uint32_t __tls_rand() {
    10477        kernelTLS.rand_seed ^= kernelTLS.rand_seed << 6;
    10578        kernelTLS.rand_seed ^= kernelTLS.rand_seed >> 21;
     
    11285void unregister( struct cluster & cltr );
    11386
    114 void doregister( struct cluster * cltr, struct thread_desc & thrd );
    115 void unregister( struct cluster * cltr, struct thread_desc & thrd );
     87void doregister( struct cluster * cltr, struct $thread & thrd );
     88void unregister( struct cluster * cltr, struct $thread & thrd );
    11689
    11790void doregister( struct cluster * cltr, struct processor * proc );
Note: See TracChangeset for help on using the changeset viewer.