- File:
-
- 1 edited
-
libcfa/src/concurrency/kernel_private.hfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel_private.hfa
rb6f2b213 r09f357ec 31 31 } 32 32 33 void __schedule_thread( $thread * ) __attribute__((nonnull (1))); 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); 34 44 35 45 //Block current thread and release/wake-up the following resources 36 void __leave_thread() __attribute__((noreturn)); 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); 37 54 38 55 //----------------------------------------------------------------------------- … … 40 57 void main(processorCtx_t *); 41 58 42 void * __create_pthread( pthread_t *, void * (*)(void *), void * );59 void * create_pthread( pthread_t *, void * (*)(void *), void * ); 43 60 61 static inline void wake_fast(processor * this) { 62 __cfaabi_dbg_print_safe("Kernel : Waking up processor %p\n", this); 63 post( this->idleLock ); 64 } 44 65 66 static inline void wake(processor * this) { 67 disable_interrupts(); 68 wake_fast(this); 69 enable_interrupts( __cfaabi_dbg_ctx ); 70 } 45 71 46 72 struct event_kernel_t { … … 59 85 extern volatile thread_local __cfa_kernel_preemption_state_t preemption_state __attribute__ ((tls_model ( "initial-exec" ))); 60 86 61 extern cluster * mainCluster;62 63 87 //----------------------------------------------------------------------------- 64 88 // Threads 65 89 extern "C" { 66 void __cfactx_invoke_thread(void (*main)(void *), void * this);90 void CtxInvokeThread(void (*main)(void *), void * this); 67 91 } 68 92 93 extern void ThreadCtxSwitch(coroutine_desc * src, coroutine_desc * dst); 94 69 95 __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 ); 72 98 ) 73 74 // KERNEL ONLY unpark with out disabling interrupts75 void __unpark( $thread * thrd __cfaabi_dbg_ctx_param2 );76 77 //-----------------------------------------------------------------------------78 // I/O79 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 );83 99 84 100 //----------------------------------------------------------------------------- … … 86 102 #define KERNEL_STORAGE(T,X) static char storage_##X[sizeof(T)] 87 103 88 static inline uint32_t __tls_rand() {104 static inline uint32_t tls_rand() { 89 105 kernelTLS.rand_seed ^= kernelTLS.rand_seed << 6; 90 106 kernelTLS.rand_seed ^= kernelTLS.rand_seed >> 21; … … 97 113 void unregister( struct cluster & cltr ); 98 114 99 void doregister( struct cluster * cltr, struct $thread& thrd );100 void unregister( struct cluster * cltr, struct $thread& thrd );115 void doregister( struct cluster * cltr, struct thread_desc & thrd ); 116 void unregister( struct cluster * cltr, struct thread_desc & thrd ); 101 117 102 118 void doregister( struct cluster * cltr, struct processor * proc );
Note:
See TracChangeset
for help on using the changeset viewer.