Ignore:
File:
1 edited

Legend:

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

    r108345a rcefd0b9  
    3434#include "kernel.hfa"
    3535#include "io/types.hfa"
     36#include "stats.hfa"
    3637
    3738//=============================================================================================
     
    7475        ;
    7576
    76         extern struct $io_context * cfa_io_allocate(struct io_uring_sqe * out_sqes[], __u32 out_idxs[], __u32 want)  __attribute__((nonnull (1,2)));
    77         extern void cfa_io_submit( struct $io_context * in_ctx, __u32 in_idxs[], __u32 have, bool lazy ) __attribute__((nonnull (1,2)));
     77        extern struct io_context$ * cfa_io_allocate(struct io_uring_sqe * out_sqes[], __u32 out_idxs[], __u32 want)  __attribute__((nonnull (1,2)));
     78        extern void cfa_io_submit( struct io_context$ * in_ctx, __u32 in_idxs[], __u32 have, bool lazy ) __attribute__((nonnull (1,2)));
    7879#endif
    7980
     
    199200                __u32 idx;
    200201                struct io_uring_sqe * sqe;
    201                 struct $io_context * ctx = cfa_io_allocate( &sqe, &idx, 1 );
    202 
     202                struct io_context$ * ctx = cfa_io_allocate( &sqe, &idx, 1 );
     203
     204                memset(sqe, 0, sizeof(*sqe));
    203205                sqe->opcode = IORING_OP_{op};
     206                sqe->flags = sflags;
    204207                sqe->user_data = (uintptr_t)&future;
    205                 sqe->flags = sflags;
    206                 sqe->ioprio = 0;
    207                 sqe->fd = 0;
    208                 sqe->off = 0;
    209                 sqe->addr = 0;
    210                 sqe->len = 0;
    211                 sqe->fsync_flags = 0;
    212                 sqe->__pad2[0] = 0;
    213                 sqe->__pad2[1] = 0;
    214                 sqe->__pad2[2] = 0;{body}
     208                {body}
    215209
    216210                asm volatile("": : :"memory");
     
    226220        async_{name}( future, {args}, submit_flags );
    227221
    228         wait( future );
     222        __attribute__((unused)) bool parked;
     223        parked = wait( future );
     224        __STATS__(false, if(!parked) io.submit.nblk += 1; )
    229225        if( future.result < 0 ) {{
    230226                errno = -future.result;
Note: See TracChangeset for help on using the changeset viewer.