- File:
-
- 1 edited
-
libcfa/src/concurrency/io/call.cfa.in (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io/call.cfa.in
rcefd0b9 r108345a 34 34 #include "kernel.hfa" 35 35 #include "io/types.hfa" 36 #include "stats.hfa"37 36 38 37 //============================================================================================= … … 75 74 ; 76 75 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)));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))); 79 78 #endif 80 79 … … 200 199 __u32 idx; 201 200 struct io_uring_sqe * sqe; 202 struct io_context$ * ctx = cfa_io_allocate( &sqe, &idx, 1 ); 203 204 memset(sqe, 0, sizeof(*sqe)); 201 struct $io_context * ctx = cfa_io_allocate( &sqe, &idx, 1 ); 202 205 203 sqe->opcode = IORING_OP_{op}; 204 sqe->user_data = (uintptr_t)&future; 206 205 sqe->flags = sflags; 207 sqe->user_data = (uintptr_t)&future; 208 {body} 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} 209 215 210 216 asm volatile("": : :"memory"); … … 220 226 async_{name}( future, {args}, submit_flags ); 221 227 222 __attribute__((unused)) bool parked; 223 parked = wait( future ); 224 __STATS__(false, if(!parked) io.submit.nblk += 1; ) 228 wait( future ); 225 229 if( future.result < 0 ) {{ 226 230 errno = -future.result;
Note:
See TracChangeset
for help on using the changeset viewer.