- File:
-
- 1 edited
-
libcfa/src/concurrency/io/setup.cfa (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io/setup.cfa
r4ecc35a ra986807 39 39 40 40 #else 41 #pragma GCC diagnostic push42 #pragma GCC diagnostic ignored "-Waddress-of-packed-member"43 41 #include <errno.h> 44 42 #include <stdint.h> … … 58 56 59 57 #include "bitmanip.hfa" 60 #include "fstream.hfa" 61 #include "kernel/private.hfa" 58 #include "kernel_private.hfa" 62 59 #include "thread.hfa" 63 #pragma GCC diagnostic pop64 60 65 61 void ?{}(io_context_params & this) { … … 115 111 this.ext_sq.empty = true; 116 112 (this.ext_sq.queue){}; 117 __io_uring_setup( this, cl.io.params, proc->idle_ wctx.evfd );113 __io_uring_setup( this, cl.io.params, proc->idle_fd ); 118 114 __cfadbg_print_safe(io_core, "Kernel I/O : Created ring for io_context %u (%p)\n", this.fd, &this); 119 115 } … … 125 121 __cfadbg_print_safe(io_core, "Kernel I/O : Destroyed ring for io_context %u\n", this.fd); 126 122 } 123 124 extern void __disable_interrupts_hard(); 125 extern void __enable_interrupts_hard(); 127 126 128 127 static void __io_uring_setup( $io_context & this, const io_context_params & params_in, int procfd ) { … … 214 213 215 214 // completion queue 216 cq.lock = 0;217 215 cq.head = (volatile __u32 *)(((intptr_t)cq.ring_ptr) + params.cq_off.head); 218 216 cq.tail = (volatile __u32 *)(((intptr_t)cq.ring_ptr) + params.cq_off.tail); … … 228 226 __cfadbg_print_safe(io_core, "Kernel I/O : registering %d for completion with ring %d\n", procfd, fd); 229 227 228 __disable_interrupts_hard(); 229 230 230 int ret = syscall( __NR_io_uring_register, fd, IORING_REGISTER_EVENTFD, &procfd, 1); 231 231 if (ret < 0) { 232 232 abort("KERNEL ERROR: IO_URING EVENTFD REGISTER - %s\n", strerror(errno)); 233 233 } 234 235 __enable_interrupts_hard(); 234 236 235 237 __cfadbg_print_safe(io_core, "Kernel I/O : registered %d for completion with ring %d\n", procfd, fd); … … 256 258 struct __sub_ring_t & sq = this.sq; 257 259 struct __cmp_ring_t & cq = this.cq; 258 {259 __u32 fhead = sq.free_ring.head;260 __u32 ftail = sq.free_ring.tail;261 262 __u32 total = *sq.num;263 __u32 avail = ftail - fhead;264 265 if(avail != total) abort | "Processor (" | (void*)this.proc | ") tearing down ring with" | (total - avail) | "entries allocated but not submitted, out of" | total;266 }267 260 268 261 // unmap the submit queue entries
Note:
See TracChangeset
for help on using the changeset viewer.