Ignore:
Timestamp:
Jun 12, 2020, 1:49:17 PM (4 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
Children:
cb196f2
Parents:
b388ee81
Message:

Changed scheduling API to adapt to non-Processors scheduling threads.

File:
1 edited

Legend:

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

    rb388ee81 r9b1dcc2  
    2525// Scheduler
    2626
     27struct __attribute__((aligned(64))) __scheduler_lock_id_t;
     28
    2729extern "C" {
    2830        void disable_interrupts() OPTIONAL_THREAD;
     
    3133}
    3234
    33 void __schedule_thread( $thread * ) __attribute__((nonnull (1)));
     35void __schedule_thread( struct __processor_id_t *, $thread * ) __attribute__((nonnull (2)));
    3436
    3537//Block current thread and release/wake-up the following resources
     
    7375
    7476// KERNEL ONLY unpark with out disabling interrupts
    75 void __unpark( $thread * thrd __cfaabi_dbg_ctx_param2 );
     77void __unpark( struct __processor_id_t *, $thread * thrd __cfaabi_dbg_ctx_param2 );
    7678
    7779//-----------------------------------------------------------------------------
     
    108110// Cells use by the reader writer lock
    109111// while not generic it only relies on a opaque pointer
    110 struct __attribute__((aligned(64))) __processor_id {
    111         processor * volatile handle;
     112struct __attribute__((aligned(64))) __scheduler_lock_id_t {
     113        __processor_id_t * volatile handle;
    112114        volatile bool lock;
    113115};
     
    115117// Lock-Free registering/unregistering of threads
    116118// Register a processor to a given cluster and get its unique id in return
    117 unsigned doregister( struct processor * proc );
     119unsigned doregister( struct __processor_id_t * proc );
    118120
    119121// Unregister a processor from a given cluster using its id, getting back the original pointer
    120 void     unregister( struct processor * proc );
     122void     unregister( struct __processor_id_t * proc );
    121123
    122124//=======================================================================
     
    167169
    168170        // data pointer
    169         __processor_id * data;
     171        __scheduler_lock_id_t * data;
    170172};
    171173
     
    178180// Reader side : acquire when using the ready queue to schedule but not
    179181//  creating/destroying queues
    180 static inline void ready_schedule_lock( struct processor * proc) with(*__scheduler_lock) {
     182static inline void ready_schedule_lock( struct __processor_id_t * proc) with(*__scheduler_lock) {
    181183        unsigned iproc = proc->id;
    182184        /*paranoid*/ verify(data[iproc].handle == proc);
     
    197199}
    198200
    199 static inline void ready_schedule_unlock( struct processor * proc) with(*__scheduler_lock) {
     201static inline void ready_schedule_unlock( struct __processor_id_t * proc) with(*__scheduler_lock) {
    200202        unsigned iproc = proc->id;
    201203        /*paranoid*/ verify(data[iproc].handle == proc);
Note: See TracChangeset for help on using the changeset viewer.