Changes in / [b8c1307:6d5b85a]
- Location:
- libcfa/src/concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io.cfa
rb8c1307 r6d5b85a 36 36 37 37 static void * __io_poller( void * arg ); 38 39 // Weirdly, some systems that do support io_uring don't actually define these40 #ifdef __alpha__41 /*42 * alpha is the only exception, all other architectures43 * have common numbers for new system calls.44 */45 # ifndef __NR_io_uring_setup46 # define __NR_io_uring_setup 53547 # endif48 # ifndef __NR_io_uring_enter49 # define __NR_io_uring_enter 53650 # endif51 # ifndef __NR_io_uring_register52 # define __NR_io_uring_register 53753 # endif54 #else /* !__alpha__ */55 # ifndef __NR_io_uring_setup56 # define __NR_io_uring_setup 42557 # endif58 # ifndef __NR_io_uring_enter59 # define __NR_io_uring_enter 42660 # endif61 # ifndef __NR_io_uring_register62 # define __NR_io_uring_register 42763 # endif64 #endif65 66 38 67 39 //============================================================================================= … … 216 188 217 189 struct io_user_data * data = (struct io_user_data *)cqe.user_data; 218 //__cfaabi_bits_print_safe( STDERR_FILENO, "Performed reading io cqe %p, result %d for %p\n", data, cqe.res, data->thrd );190 __cfaabi_bits_print_safe( STDERR_FILENO, "Performed reading io cqe %p, result %d for %p\n", data, cqe.res, data->thrd ); 219 191 220 192 data->result = cqe.res; … … 324 296 // Submit however, many entries need to be submitted 325 297 int ret = syscall( __NR_io_uring_enter, ring.fd, 1, 0, 0, 0p, 0); 326 //__cfaabi_bits_print_safe( STDERR_FILENO, "Performed io_submit, returned %d\n", ret );298 __cfaabi_bits_print_safe( STDERR_FILENO, "Performed io_submit, returned %d\n", ret ); 327 299 if( ret < 0 ) { 328 300 switch((int)errno) { … … 380 352 #define __submit_wait \ 381 353 io_user_data data = { 0, active_thread() }; \ 382 /*__cfaabi_bits_print_safe( STDERR_FILENO, "Preparing user data %p for %p\n", &data, data.thrd );*/\354 __cfaabi_bits_print_safe( STDERR_FILENO, "Preparing user data %p for %p\n", &data, data.thrd ); \ 383 355 sqe->user_data = (uint64_t)&data; \ 384 356 __submit( ring, idx ); \ -
libcfa/src/concurrency/preemption.cfa
rb8c1307 r6d5b85a 97 97 while( node = get_expired( alarms, currtime ) ) { 98 98 // __cfaabi_dbg_print_buffer_decl( " KERNEL: preemption tick.\n" ); 99 Duration period = node->period;100 if( period == 0) {101 node->set = false; // Node is one-shot, just mark it as not pending102 }103 99 104 100 // Check if this is a kernel … … 111 107 112 108 // Check if this is a periodic alarm 109 Duration period = node->period; 113 110 if( period > 0 ) { 114 111 // __cfaabi_dbg_print_buffer_local( " KERNEL: alarm period is %lu.\n", period.tv ); 115 112 node->alarm = currtime + period; // Alarm is periodic, add currtime to it (used cached current time) 116 113 insert( alarms, node ); // Reinsert the node for the next time it triggers 114 } 115 else { 116 node->set = false; // Node is one-shot, just mark it as not pending 117 117 } 118 118 }
Note: See TracChangeset
for help on using the changeset viewer.