Ignore:
Timestamp:
Aug 15, 2022, 11:19:28 AM (22 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
d93ea1d
Parents:
41a6a78
Message:

Changed io types to have trailing $ instead of leading

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/io.cfa

    r41a6a78 r8bee858  
    8383        };
    8484
    85         static $io_context * __ioarbiter_allocate( $io_arbiter & this, __u32 idxs[], __u32 want );
    86         static void __ioarbiter_submit( $io_context * , __u32 idxs[], __u32 have, bool lazy );
    87         static void __ioarbiter_flush ( $io_context & );
    88         static inline void __ioarbiter_notify( $io_context & ctx );
     85        static io_context$ * __ioarbiter_allocate( io_arbiter$ & this, __u32 idxs[], __u32 want );
     86        static void __ioarbiter_submit( io_context$ * , __u32 idxs[], __u32 have, bool lazy );
     87        static void __ioarbiter_flush ( io_context$ & );
     88        static inline void __ioarbiter_notify( io_context$ & ctx );
    8989//=============================================================================================
    9090// I/O Polling
    9191//=============================================================================================
    92         static inline unsigned __flush( struct $io_context & );
    93         static inline __u32 __release_sqes( struct $io_context & );
     92        static inline unsigned __flush( struct io_context$ & );
     93        static inline __u32 __release_sqes( struct io_context$ & );
    9494        extern void __kernel_unpark( thread$ * thrd, unpark_hint );
    9595
    96         static void ioring_syscsll( struct $io_context & ctx, unsigned int min_comp, unsigned int flags ) {
     96        static void ioring_syscsll( struct io_context$ & ctx, unsigned int min_comp, unsigned int flags ) {
    9797                __STATS__( true, io.calls.flush++; )
    9898                int ret;
     
    132132        }
    133133
    134         static bool try_acquire( $io_context * ctx ) __attribute__((nonnull(1))) {
     134        static bool try_acquire( io_context$ * ctx ) __attribute__((nonnull(1))) {
    135135                /* paranoid */ verify( ! __preemption_enabled() );
    136136                /* paranoid */ verify( ready_schedule_islocked() );
     
    153153        }
    154154
    155         static bool __cfa_do_drain( $io_context * ctx, cluster * cltr ) __attribute__((nonnull(1, 2))) {
     155        static bool __cfa_do_drain( io_context$ * ctx, cluster * cltr ) __attribute__((nonnull(1, 2))) {
    156156                /* paranoid */ verify( ! __preemption_enabled() );
    157157                /* paranoid */ verify( ready_schedule_islocked() );
     
    213213
    214214                cluster * const cltr = proc->cltr;
    215                 $io_context * const ctx = proc->io.ctx;
     215                io_context$ * const ctx = proc->io.ctx;
    216216                /* paranoid */ verify( cltr );
    217217                /* paranoid */ verify( ctx );
     
    278278                /* paranoid */ verify( proc->io.ctx );
    279279
    280                 $io_context & ctx = *proc->io.ctx;
     280                io_context$ & ctx = *proc->io.ctx;
    281281
    282282                __ioarbiter_flush( ctx );
     
    312312        // Allocation
    313313        // for user's convenience fill the sqes from the indexes
    314         static inline void __fill(struct io_uring_sqe * out_sqes[], __u32 want, __u32 idxs[], struct $io_context * ctx)  {
     314        static inline void __fill(struct io_uring_sqe * out_sqes[], __u32 want, __u32 idxs[], struct io_context$ * ctx)  {
    315315                struct io_uring_sqe * sqes = ctx->sq.sqes;
    316316                for(i; want) {
     
    322322        // Try to directly allocate from the a given context
    323323        // Not thread-safe
    324         static inline bool __alloc(struct $io_context * ctx, __u32 idxs[], __u32 want) {
     324        static inline bool __alloc(struct io_context$ * ctx, __u32 idxs[], __u32 want) {
    325325                __sub_ring_t & sq = ctx->sq;
    326326                const __u32 mask  = *sq.mask;
     
    349349        // for convenience, return both the index and the pointer to the sqe
    350350        // sqe == &sqes[idx]
    351         struct $io_context * cfa_io_allocate(struct io_uring_sqe * sqes[], __u32 idxs[], __u32 want) libcfa_public {
     351        struct io_context$ * cfa_io_allocate(struct io_uring_sqe * sqes[], __u32 idxs[], __u32 want) libcfa_public {
    352352                // __cfadbg_print_safe(io, "Kernel I/O : attempting to allocate %u\n", want);
    353353
    354354                disable_interrupts();
    355355                processor * proc = __cfaabi_tls.this_processor;
    356                 $io_context * ctx = proc->io.ctx;
     356                io_context$ * ctx = proc->io.ctx;
    357357                /* paranoid */ verify( __cfaabi_tls.this_processor );
    358358                /* paranoid */ verify( ctx );
     
    378378                enable_interrupts();
    379379
    380                 $io_arbiter * ioarb = proc->cltr->io.arbiter;
     380                io_arbiter$ * ioarb = proc->cltr->io.arbiter;
    381381                /* paranoid */ verify( ioarb );
    382382
    383383                // __cfadbg_print_safe(io, "Kernel I/O : falling back on arbiter for allocation\n");
    384384
    385                 struct $io_context * ret = __ioarbiter_allocate(*ioarb, idxs, want);
     385                struct io_context$ * ret = __ioarbiter_allocate(*ioarb, idxs, want);
    386386
    387387                // __cfadbg_print_safe(io, "Kernel I/O : slow allocation completed from ring %d\n", ret->fd);
     
    393393        //=============================================================================================
    394394        // submission
    395         static inline void __submit_only( struct $io_context * ctx, __u32 idxs[], __u32 have) {
     395        static inline void __submit_only( struct io_context$ * ctx, __u32 idxs[], __u32 have) {
    396396                // We can proceed to the fast path
    397397                // Get the right objects
     
    414414        }
    415415
    416         static inline void __submit( struct $io_context * ctx, __u32 idxs[], __u32 have, bool lazy) {
     416        static inline void __submit( struct io_context$ * ctx, __u32 idxs[], __u32 have, bool lazy) {
    417417                __sub_ring_t & sq = ctx->sq;
    418418                __submit_only(ctx, idxs, have);
     
    428428        }
    429429
    430         void cfa_io_submit( struct $io_context * inctx, __u32 idxs[], __u32 have, bool lazy ) __attribute__((nonnull (1))) libcfa_public {
     430        void cfa_io_submit( struct io_context$ * inctx, __u32 idxs[], __u32 have, bool lazy ) __attribute__((nonnull (1))) libcfa_public {
    431431                // __cfadbg_print_safe(io, "Kernel I/O : attempting to submit %u (%s)\n", have, lazy ? "lazy" : "eager");
    432432
     
    434434                __STATS__( true, if(!lazy) io.submit.eagr += 1; )
    435435                processor * proc = __cfaabi_tls.this_processor;
    436                 $io_context * ctx = proc->io.ctx;
     436                io_context$ * ctx = proc->io.ctx;
    437437                /* paranoid */ verify( __cfaabi_tls.this_processor );
    438438                /* paranoid */ verify( ctx );
     
    465465        // by io_uring
    466466        // This cannot be done by multiple threads
    467         static __u32 __release_sqes( struct $io_context & ctx ) {
     467        static __u32 __release_sqes( struct io_context$ & ctx ) {
    468468                const __u32 mask = *ctx.sq.mask;
    469469
     
    538538        }
    539539
    540         static $io_context * __ioarbiter_allocate( $io_arbiter & this, __u32 idxs[], __u32 want ) {
     540        static io_context$ * __ioarbiter_allocate( io_arbiter$ & this, __u32 idxs[], __u32 want ) {
    541541                // __cfadbg_print_safe(io, "Kernel I/O : arbiter allocating\n");
    542542
     
    557557        }
    558558
    559         static void __ioarbiter_notify( $io_arbiter & this, $io_context * ctx ) {
     559        static void __ioarbiter_notify( io_arbiter$ & this, io_context$ * ctx ) {
    560560                /* paranoid */ verify( !empty(this.pending.queue) );
    561561
     
    587587        }
    588588
    589         static void __ioarbiter_notify( $io_context & ctx ) {
     589        static void __ioarbiter_notify( io_context$ & ctx ) {
    590590                if(!empty( ctx.arbiter->pending )) {
    591591                        __ioarbiter_notify( *ctx.arbiter, &ctx );
     
    594594
    595595        // Simply append to the pending
    596         static void __ioarbiter_submit( $io_context * ctx, __u32 idxs[], __u32 have, bool lazy ) {
     596        static void __ioarbiter_submit( io_context$ * ctx, __u32 idxs[], __u32 have, bool lazy ) {
    597597                __cfadbg_print_safe(io, "Kernel I/O : submitting %u from the arbiter to context %u\n", have, ctx->fd);
    598598
     
    618618        }
    619619
    620         static void __ioarbiter_flush( $io_context & ctx ) {
     620        static void __ioarbiter_flush( io_context$ & ctx ) {
    621621                if(!empty( ctx.ext_sq )) {
    622622                        __STATS__( false, io.flush.external += 1; )
     
    642642        #if defined(CFA_WITH_IO_URING_IDLE)
    643643                bool __kernel_read(processor * proc, io_future_t & future, iovec & iov, int fd) {
    644                         $io_context * ctx = proc->io.ctx;
     644                        io_context$ * ctx = proc->io.ctx;
    645645                        /* paranoid */ verify( ! __preemption_enabled() );
    646646                        /* paranoid */ verify( proc == __cfaabi_tls.this_processor );
Note: See TracChangeset for help on using the changeset viewer.