- Timestamp:
- Apr 22, 2020, 5:29:20 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b8c1307
- Parents:
- 5d7e049
- Location:
- libcfa/src/concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io.cfa
r5d7e049 r185efe6 36 36 37 37 static void * __io_poller( void * arg ); 38 39 // Weirdly, some systems that do support io_uring don't actually define these 40 #ifdef __alpha__ 41 /* 42 * alpha is the only exception, all other architectures 43 * have common numbers for new system calls. 44 */ 45 # ifndef __NR_io_uring_setup 46 # define __NR_io_uring_setup 535 47 # endif 48 # ifndef __NR_io_uring_enter 49 # define __NR_io_uring_enter 536 50 # endif 51 # ifndef __NR_io_uring_register 52 # define __NR_io_uring_register 537 53 # endif 54 #else /* !__alpha__ */ 55 # ifndef __NR_io_uring_setup 56 # define __NR_io_uring_setup 425 57 # endif 58 # ifndef __NR_io_uring_enter 59 # define __NR_io_uring_enter 426 60 # endif 61 # ifndef __NR_io_uring_register 62 # define __NR_io_uring_register 427 63 # endif 64 #endif 65 38 66 39 67 //============================================================================================= … … 188 216 189 217 struct io_user_data * data = (struct io_user_data *)cqe.user_data; 190 __cfaabi_bits_print_safe( STDERR_FILENO, "Performed reading io cqe %p, result %d for %p\n", data, cqe.res, data->thrd );218 // __cfaabi_bits_print_safe( STDERR_FILENO, "Performed reading io cqe %p, result %d for %p\n", data, cqe.res, data->thrd ); 191 219 192 220 data->result = cqe.res; … … 296 324 // Submit however, many entries need to be submitted 297 325 int ret = syscall( __NR_io_uring_enter, ring.fd, 1, 0, 0, 0p, 0); 298 __cfaabi_bits_print_safe( STDERR_FILENO, "Performed io_submit, returned %d\n", ret );326 // __cfaabi_bits_print_safe( STDERR_FILENO, "Performed io_submit, returned %d\n", ret ); 299 327 if( ret < 0 ) { 300 328 switch((int)errno) { … … 352 380 #define __submit_wait \ 353 381 io_user_data data = { 0, active_thread() }; \ 354 __cfaabi_bits_print_safe( STDERR_FILENO, "Preparing user data %p for %p\n", &data, data.thrd );\382 /*__cfaabi_bits_print_safe( STDERR_FILENO, "Preparing user data %p for %p\n", &data, data.thrd );*/ \ 355 383 sqe->user_data = (uint64_t)&data; \ 356 384 __submit( ring, idx ); \ -
libcfa/src/concurrency/preemption.cfa
r5d7e049 r185efe6 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 pending 102 } 99 103 100 104 // Check if this is a kernel … … 107 111 108 112 // Check if this is a periodic alarm 109 Duration period = node->period;110 113 if( period > 0 ) { 111 114 // __cfaabi_dbg_print_buffer_local( " KERNEL: alarm period is %lu.\n", period.tv ); 112 115 node->alarm = currtime + period; // Alarm is periodic, add currtime to it (used cached current time) 113 116 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 pending117 117 } 118 118 }
Note: See TracChangeset
for help on using the changeset viewer.