Ignore:
Timestamp:
Mar 2, 2021, 5:28:32 PM (8 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
6083392
Parents:
182256b (diff), 9eb7a53 (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' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    r182256b r266ecf1  
    2828}
    2929
    30 //-----------------------------------------------------------------------------
    31 // Underlying Locks
    3230#ifdef __CFA_WITH_VERIFY__
    3331        extern bool __cfaabi_dbg_in_kernel();
    3432#endif
    3533
    36 struct __bin_sem_t {
    37         pthread_mutex_t         lock;
    38         pthread_cond_t          cond;
    39         int                     val;
    40 };
     34//-----------------------------------------------------------------------------
     35// I/O
     36struct cluster;
     37struct $io_context;
     38struct $io_arbiter;
     39
     40struct io_context_params {
     41        int num_entries;
     42};
     43
     44void  ?{}(io_context_params & this);
    4145
    4246//-----------------------------------------------------------------------------
     
    7882        pthread_t kernel_thread;
    7983
     84        struct {
     85                $io_context * ctx;
     86                bool pending;
     87                bool dirty;
     88        } io;
     89
    8090        // Preemption data
    8191        // Node which is added in the discrete event simulaiton
     
    8696
    8797        // Idle lock (kernel semaphore)
    88         __bin_sem_t idle;
     98        int idle;
    8999
    90100        // Termination synchronisation (user semaphore)
     
    116126
    117127DLISTED_MGD_IMPL_OUT(processor)
    118 
    119 //-----------------------------------------------------------------------------
    120 // I/O
    121 struct __io_data;
    122 
    123 // IO poller user-thread
    124 // Not using the "thread" keyword because we want to control
    125 // more carefully when to start/stop it
    126 struct $io_ctx_thread {
    127         struct __io_data * ring;
    128         single_sem sem;
    129         volatile bool done;
    130         $thread self;
    131 };
    132 
    133 
    134 struct io_context {
    135         $io_ctx_thread thrd;
    136 };
    137 
    138 struct io_context_params {
    139         int num_entries;
    140         int num_ready;
    141         int submit_aff;
    142         bool eager_submits:1;
    143         bool poller_submits:1;
    144         bool poll_submit:1;
    145         bool poll_complete:1;
    146 };
    147 
    148 void  ?{}(io_context_params & this);
    149 
    150 void  ?{}(io_context & this, struct cluster & cl);
    151 void  ?{}(io_context & this, struct cluster & cl, const io_context_params & params);
    152 void ^?{}(io_context & this);
    153 
    154 struct io_cancellation {
    155         __u64 target;
    156 };
    157 
    158 static inline void  ?{}(io_cancellation & this) { this.target = -1u; }
    159 static inline void ^?{}(io_cancellation &) {}
    160 bool cancel(io_cancellation & this);
    161128
    162129//-----------------------------------------------------------------------------
     
    244211
    245212        struct {
    246                 io_context * ctxs;
    247                 unsigned cnt;
     213                $io_arbiter * arbiter;
     214                io_context_params params;
    248215        } io;
    249216
Note: See TracChangeset for help on using the changeset viewer.