Changeset 457 for trunk/kernel/kern/rpc.c
- Timestamp:
- Aug 2, 2018, 11:47:13 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/rpc.c
r450 r457 23 23 24 24 #include <kernel_config.h> 25 #include <hal_ types.h>25 #include <hal_kernel_types.h> 26 26 #include <hal_atomic.h> 27 27 #include <hal_remote.h> … … 100 100 volatile error_t full; 101 101 thread_t * this; 102 cluster_t * cluster;103 104 #if DEBUG_RPC_CLIENT_GENERIC105 uint32_t cycle = (uint32_t)hal_get_cycles();106 if( DEBUG_RPC_CLIENT_GENERIC < cycle )107 printk("\n[DBG] %s : thread %x in cluster %x enter for rpc[%d] / rpc_ptr %x / cycle %d\n",108 __FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index, rpc, cycle );109 #endif110 102 111 103 full = 0; 112 104 this = CURRENT_THREAD; 113 cluster = LOCAL_CLUSTER;114 105 client_core_lid = this->core->lid; 115 106 107 #if DEBUG_RPC_CLIENT_GENERIC 108 uint32_t cycle = (uint32_t)hal_get_cycles(); 109 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 110 printk("\n[DBG] %s : thread %x in process %x enter for rpc[%d] / cycle %d\n", 111 __FUNCTION__, this->trdid, this->process->pid, rpc->index, cycle ); 112 #endif 113 116 114 // select a server_core : use client core index if possible / core 0 otherwise 117 if( client_core_lid < hal_remote_lw( XPTR( server_cxy , & cluster->cores_nr ) ) )115 if( client_core_lid < hal_remote_lw( XPTR( server_cxy , &LOCAL_CLUSTER->cores_nr ) ) ) 118 116 { 119 117 server_core_lid = client_core_lid; … … 150 148 151 149 hal_fence(); 150 151 #if DEBUG_RPC_CLIENT_GENERIC 152 cycle = (uint32_t)hal_get_cycles(); 153 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 154 printk("\n[DBG] %s : thread %x in process %x / rpc[%d] / rpc_ptr %x / cycle %d\n", 155 __FUNCTION__, this->trdid, this->process->pid, rpc->index, rpc, cycle ); 156 #endif 152 157 153 154 158 // send IPI to the selected server core 159 dev_pic_send_ipi( server_cxy , server_core_lid ); 155 160 156 161 // wait RPC completion before returning if blocking RPC … … 165 170 cycle = (uint32_t)hal_get_cycles(); 166 171 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 167 printk("\n[DBG] %s : thread %x in cluster %x busy waiting /rpc[%d] / cycle %d\n",168 __FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index , cycle );172 printk("\n[DBG] %s : thread %x in process %x busy waiting for rpc[%d] / cycle %d\n", 173 __FUNCTION__, this->trdid, this->process->pid, rpc->index , cycle ); 169 174 #endif 170 175 … … 174 179 cycle = (uint32_t)hal_get_cycles(); 175 180 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 176 printk("\n[DBG] %s : thread %x in cluster %x resumes /rpc[%d] / cycle %d\n",177 __FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index, cycle );181 printk("\n[DBG] %s : thread %x in process %x resumes for rpc[%d] / cycle %d\n", 182 __FUNCTION__, this->trdid, this->process->pid, rpc->index, cycle ); 178 183 #endif 179 184 } … … 184 189 cycle = (uint32_t)hal_get_cycles(); 185 190 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 186 printk("\n[DBG] %s : thread %x in cluster %x blocks & deschedules /rpc[%d] / cycle %d\n",187 __FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index , cycle );191 printk("\n[DBG] %s : thread %x in process %x blocks & deschedules for rpc[%d] / cycle %d\n", 192 __FUNCTION__, this->trdid, this->process->pid, rpc->index , cycle ); 188 193 #endif 189 194 thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_RPC ); … … 193 198 cycle = (uint32_t)hal_get_cycles(); 194 199 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 195 printk("\n[DBG] %s : thread %x in cluster %x resumes / rpcr[%d] / cycle %d\n",196 __FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index, cycle );200 printk("\n[DBG] %s : thread %x in process %x resumes for rpc[%d] / cycle %d\n", 201 __FUNCTION__, this->trdid, this->process->pid, rpc->index, cycle ); 197 202 #endif 198 203 } … … 207 212 cycle = (uint32_t)hal_get_cycles(); 208 213 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 209 printk("\n[DBG] %s : non blocking rpc[%d] => thread %x return/ cycle %d\n",210 __FUNCTION__, rpc->index, CURRENT_THREAD, cycle );214 printk("\n[DBG] %s : thread %x in process %x returns for non blocking rpc[%d] / cycle %d\n", 215 __FUNCTION__, this->trdid, this->process->pid, rpc->index, cycle ); 211 216 #endif 212 217 … … 225 230 thread_t * thread; 226 231 uint32_t sr_save; 232 233 #if DEBUG_RPC_SERVER_GENERIC 234 uint32_t cycle; 235 #endif 227 236 228 237 bool_t found = false; … … 232 241 remote_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo[core->lid]; 233 242 234 #if DEBUG_RPC_SERVER_GENERIC235 uint32_t cycle = (uint32_t)hal_get_cycles();236 if( DEBUG_RPC_SERVER_GENERIC < cycle )237 printk("\n[DBG] %s : thread %x interrupted in cluster %x / cycle %d\n",238 __FUNCTION__, this, local_cxy, cycle );239 #endif240 241 243 // interrupted thread not preemptable during RPC chek 242 244 hal_disable_irq( &sr_save ); … … 249 251 cycle = (uint32_t)hal_get_cycles(); 250 252 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 251 printk("\n[DBG] %s : RPC FIFO non empty in cluster %x/ cycle %d\n",252 __FUNCTION__, local_cxy, c ycle );253 printk("\n[DBG] %s : RPC FIFO non empty for core[%x,%d] / cycle %d\n", 254 __FUNCTION__, local_cxy, core->lid, cycle ); 253 255 #endif 254 256 … … 290 292 cycle = (uint32_t)hal_get_cycles(); 291 293 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 292 printk("\n[DBG] %s : create a new RPC thread %x in cluster %x/ cycle %d\n",293 __FUNCTION__, thread, local_cxy, c ycle );294 printk("\n[DBG] %s : new RPC thread %x created for core[%x,%d] / cycle %d\n", 295 __FUNCTION__, thread, local_cxy, core->lid, cycle ); 294 296 #endif 295 297 } … … 299 301 cycle = (uint32_t)hal_get_cycles(); 300 302 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 301 printk("\n[DBG] %s : interrupted thread %x deschedules in cluster %x/ cycle %d\n",302 __FUNCTION__, this, local_cxy, c ycle );303 printk("\n[DBG] %s : interrupted thread %x deschedules on core[%x,%d] / cycle %d\n", 304 __FUNCTION__, this, local_cxy, core->lid, cycle ); 303 305 #endif 304 306 … … 309 311 cycle = (uint32_t)hal_get_cycles(); 310 312 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 311 printk("\n[DBG] %s : interrupted thread %x resumes in cluster %x/ cycle %d\n",312 __FUNCTION__, this, local_cxy, c ycle );313 printk("\n[DBG] %s : interrupted thread %x resumes on core[%x,%d] / cycle %d\n", 314 __FUNCTION__, this, local_cxy, core->lid, cycle ); 313 315 #endif 314 316 … … 410 412 #endif 411 413 // send IPI to client core 412 dev_pic_send_ipi( desc_cxy , client_core_lid );414 // dev_pic_send_ipi( desc_cxy , client_core_lid ); 413 415 } 414 416 } … … 872 874 pid_t pid = rpc->args[1]; 873 875 if( DEBUG_RPC_PROCESS_SIGACTION < cycle ) 874 printk("\n[DBG] %s : enter to %sprocess %x in cluster %x / cycle %d\n",876 printk("\n[DBG] %s : enter to request %s of process %x in cluster %x / cycle %d\n", 875 877 __FUNCTION__ , process_action_str( action ) , pid , cxy , cycle ); 876 878 #endif … … 949 951 950 952 // send an IPI to client core 951 dev_pic_send_ipi( client_cxy , client_lid );953 // dev_pic_send_ipi( client_cxy , client_lid ); 952 954 } 953 955
Note: See TracChangeset
for help on using the changeset viewer.