- File:
-
- 1 edited
-
libcfa/src/concurrency/io/setup.cfa (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io/setup.cfa
r7425720 ra986807 32 32 33 33 void __cfa_io_start( processor * proc ) {} 34 bool __cfa_io_flush( processor * proc ) { return false; } 35 bool __cfa_io_drain( processor * proc ) __attribute__((nonnull (1))) { return false; } 36 void __cfa_io_idle ( processor * ) __attribute__((nonnull (1))) {} 34 bool __cfa_io_flush( processor * proc, int ) { return false; } 37 35 void __cfa_io_stop ( processor * proc ) {} 38 36 … … 41 39 42 40 #else 43 #pragma GCC diagnostic push44 #pragma GCC diagnostic ignored "-Waddress-of-packed-member"45 41 #include <errno.h> 46 42 #include <stdint.h> … … 60 56 61 57 #include "bitmanip.hfa" 62 #include "fstream.hfa" 63 #include "kernel/private.hfa" 64 #include "limits.hfa" 58 #include "kernel_private.hfa" 65 59 #include "thread.hfa" 66 #pragma GCC diagnostic pop67 60 68 61 void ?{}(io_context_params & this) { … … 118 111 this.ext_sq.empty = true; 119 112 (this.ext_sq.queue){}; 120 __io_uring_setup( this, cl.io.params, proc->idle_ wctx.evfd );113 __io_uring_setup( this, cl.io.params, proc->idle_fd ); 121 114 __cfadbg_print_safe(io_core, "Kernel I/O : Created ring for io_context %u (%p)\n", this.fd, &this); 122 115 } … … 128 121 __cfadbg_print_safe(io_core, "Kernel I/O : Destroyed ring for io_context %u\n", this.fd); 129 122 } 123 124 extern void __disable_interrupts_hard(); 125 extern void __enable_interrupts_hard(); 130 126 131 127 static void __io_uring_setup( $io_context & this, const io_context_params & params_in, int procfd ) { … … 217 213 218 214 // completion queue 219 cq.lock = false;220 cq.id = MAX;221 cq.ts = rdtscl();222 215 cq.head = (volatile __u32 *)(((intptr_t)cq.ring_ptr) + params.cq_off.head); 223 216 cq.tail = (volatile __u32 *)(((intptr_t)cq.ring_ptr) + params.cq_off.tail); … … 233 226 __cfadbg_print_safe(io_core, "Kernel I/O : registering %d for completion with ring %d\n", procfd, fd); 234 227 228 __disable_interrupts_hard(); 229 235 230 int ret = syscall( __NR_io_uring_register, fd, IORING_REGISTER_EVENTFD, &procfd, 1); 236 231 if (ret < 0) { 237 232 abort("KERNEL ERROR: IO_URING EVENTFD REGISTER - %s\n", strerror(errno)); 238 233 } 234 235 __enable_interrupts_hard(); 239 236 240 237 __cfadbg_print_safe(io_core, "Kernel I/O : registered %d for completion with ring %d\n", procfd, fd); … … 261 258 struct __sub_ring_t & sq = this.sq; 262 259 struct __cmp_ring_t & cq = this.cq; 263 {264 __u32 fhead = sq.free_ring.head;265 __u32 ftail = sq.free_ring.tail;266 267 __u32 total = *sq.num;268 __u32 avail = ftail - fhead;269 270 if(avail != total) abort | "Processor (" | (void*)this.proc | ") tearing down ring with" | (total - avail) | "entries allocated but not submitted, out of" | total;271 }272 260 273 261 // unmap the submit queue entries
Note:
See TracChangeset
for help on using the changeset viewer.