Changeset 8bee858 for libcfa/src/concurrency/io
- Timestamp:
- Aug 15, 2022, 11:19:28 AM (21 months ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- d93ea1d
- Parents:
- 41a6a78
- Location:
- libcfa/src/concurrency/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io/call.cfa.in
r41a6a78 r8bee858 75 75 ; 76 76 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)));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))); 79 79 #endif 80 80 … … 200 200 __u32 idx; 201 201 struct io_uring_sqe * sqe; 202 struct $io_context* ctx = cfa_io_allocate( &sqe, &idx, 1 );202 struct io_context$ * ctx = cfa_io_allocate( &sqe, &idx, 1 ); 203 203 204 204 sqe->opcode = IORING_OP_{op}; -
libcfa/src/concurrency/io/setup.cfa
r41a6a78 r8bee858 28 28 void ?{}(io_context_params & this) libcfa_public {} 29 29 30 void ?{}( $io_context& this, struct cluster & cl) {}31 void ^?{}( $io_context& this) {}30 void ?{}(io_context$ & this, struct cluster & cl) {} 31 void ^?{}(io_context$ & this) {} 32 32 33 33 void __cfa_io_start( processor * proc ) {} … … 37 37 void __cfa_io_stop ( processor * proc ) {} 38 38 39 $io_arbiter* create(void) { return 0p; }40 void destroy( $io_arbiter*) {}39 io_arbiter$ * create(void) { return 0p; } 40 void destroy(io_arbiter$ *) {} 41 41 42 42 #else … … 105 105 106 106 107 static void __io_uring_setup ( $io_context& this, const io_context_params & params_in, int procfd );108 static void __io_uring_teardown( $io_context& this );109 static void __epoll_register( $io_context& ctx);110 static void __epoll_unregister( $io_context& ctx);111 void __ioarbiter_register( $io_arbiter & mutex, $io_context& ctx );112 void __ioarbiter_unregister( $io_arbiter & mutex, $io_context& ctx );113 114 void ?{}( $io_context& this, processor * proc, struct cluster & cl) {107 static void __io_uring_setup ( io_context$ & this, const io_context_params & params_in, int procfd ); 108 static void __io_uring_teardown( io_context$ & this ); 109 static void __epoll_register(io_context$ & ctx); 110 static void __epoll_unregister(io_context$ & ctx); 111 void __ioarbiter_register( io_arbiter$ & mutex, io_context$ & ctx ); 112 void __ioarbiter_unregister( io_arbiter$ & mutex, io_context$ & ctx ); 113 114 void ?{}(io_context$ & this, processor * proc, struct cluster & cl) { 115 115 /* paranoid */ verify( cl.io.arbiter ); 116 116 this.proc = proc; … … 122 122 } 123 123 124 void ^?{}( $io_context& this) {124 void ^?{}(io_context$ & this) { 125 125 __cfadbg_print_safe(io_core, "Kernel I/O : tearing down io_context %u\n", this.fd); 126 126 … … 129 129 } 130 130 131 static void __io_uring_setup( $io_context& this, const io_context_params & params_in, int procfd ) {131 static void __io_uring_setup( io_context$ & this, const io_context_params & params_in, int procfd ) { 132 132 // Step 1 : call to setup 133 133 struct io_uring_params params; … … 270 270 } 271 271 272 static void __io_uring_teardown( $io_context& this ) {272 static void __io_uring_teardown( io_context$ & this ) { 273 273 // Shutdown the io rings 274 274 struct __sub_ring_t & sq = this.sq; … … 313 313 // I/O Context Sleep 314 314 //============================================================================================= 315 // static inline void __epoll_ctl( $io_context& ctx, int op, const char * error) {315 // static inline void __epoll_ctl(io_context$ & ctx, int op, const char * error) { 316 316 // struct epoll_event ev; 317 317 // ev.events = EPOLLIN | EPOLLONESHOT; … … 323 323 // } 324 324 325 // static void __epoll_register( $io_context& ctx) {325 // static void __epoll_register(io_context$ & ctx) { 326 326 // __epoll_ctl(ctx, EPOLL_CTL_ADD, "ADD"); 327 327 // } 328 328 329 // static void __epoll_unregister( $io_context& ctx) {329 // static void __epoll_unregister(io_context$ & ctx) { 330 330 // // Read the current epoch so we know when to stop 331 331 // size_t curr = __atomic_load_n(&iopoll.epoch, __ATOMIC_SEQ_CST); … … 346 346 // } 347 347 348 // void __ioctx_prepare_block( $io_context& ctx) {348 // void __ioctx_prepare_block(io_context$ & ctx) { 349 349 // __cfadbg_print_safe(io_core, "Kernel I/O - epoll : Re-arming io poller %d (%p)\n", ctx.fd, &ctx); 350 350 // __epoll_ctl(ctx, EPOLL_CTL_MOD, "REARM"); … … 355 355 // I/O Context Misc Setup 356 356 //============================================================================================= 357 void ?{}( $io_arbiter& this ) {357 void ?{}( io_arbiter$ & this ) { 358 358 this.pending.empty = true; 359 359 } 360 360 361 void ^?{}( $io_arbiter& mutex this ) {}362 363 $io_arbiter* create(void) {361 void ^?{}( io_arbiter$ & mutex this ) {} 362 363 io_arbiter$ * create(void) { 364 364 return new(); 365 365 } 366 void destroy( $io_arbiter* arbiter) {366 void destroy(io_arbiter$ * arbiter) { 367 367 delete(arbiter); 368 368 } -
libcfa/src/concurrency/io/types.hfa
r41a6a78 r8bee858 33 33 34 34 struct processor; 35 monitor $io_arbiter;35 monitor io_arbiter$; 36 36 37 37 //----------------------------------------------------------------------- … … 125 125 126 126 127 struct __attribute__((aligned(64))) $io_context{128 $io_arbiter* arbiter;127 struct __attribute__((aligned(64))) io_context$ { 128 io_arbiter$ * arbiter; 129 129 processor * proc; 130 130 … … 137 137 }; 138 138 139 static inline unsigned long long ts( $io_context*& this) {139 static inline unsigned long long ts(io_context$ *& this) { 140 140 const __u32 head = *this->cq.head; 141 141 const __u32 tail = *this->cq.tail; … … 150 150 __u32 * idxs; 151 151 __u32 want; 152 $io_context* ctx;152 io_context$ * ctx; 153 153 }; 154 154 155 monitor __attribute__((aligned(64))) $io_arbiter{155 monitor __attribute__((aligned(64))) io_arbiter$ { 156 156 __outstanding_io_queue pending; 157 157 }; … … 186 186 #endif 187 187 188 // void __ioctx_prepare_block( $io_context& ctx);188 // void __ioctx_prepare_block(io_context$ & ctx); 189 189 #endif
Note: See TracChangeset
for help on using the changeset viewer.