Changeset 564 for trunk/kernel/kern/rpc.c
- Timestamp:
- Oct 4, 2018, 11:47:36 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/rpc.c
r503 r564 43 43 44 44 ///////////////////////////////////////////////////////////////////////////////////////// 45 // array of function pointers (must be consistent with enum in rpc.h) 45 // Array of function pointers and array of printable strings. 46 // These arrays must be kept consistent with enum in rpc.h file. 46 47 ///////////////////////////////////////////////////////////////////////////////////////// 47 48 … … 82 83 }; 83 84 84 ////////////////////////////////////////////// 85 char * rpc_str[RPC_MAX_INDEX] = 86 { 87 "PMEM_GET_PAGES", // 0 88 "PMEM_RELEASE_PAGES", // 1 89 "undefined", // 2 90 "PROCESS_MAKE_FORK", // 3 91 "undefined", // 4 92 "undefined", // 5 93 "THREAD_USER_CREATE", // 6 94 "THREAD_KERNEL_CREATE", // 7 95 "undefined", // 8 96 "PROCESS_SIGACTION", // 9 97 98 "VFS_INODE_CREATE", // 10 99 "VFS_INODE_DESTROY", // 11 100 "VFS_DENTRY_CREATE", // 12 101 "VFS_DENTRY_DESTROY", // 13 102 "VFS_FILE_CREATE", // 14 103 "VFS_FILE_DESTROY", // 15 104 "VFS_INODE_LOAD", // 16 105 "VFS_MAPPER_LOAD_ALL", // 17 106 "FATFS_GET_CLUSTER", // 18 107 "undefined", // 19 108 109 "GET_VSEG", // 20 110 "GET_PTE", // 21 111 "KCM_ALLOC", // 22 112 "KCM_FREE", // 23 113 "MAPPER_MOVE_BUFFER", // 24 114 "MAPPER_GET_PAGE", // 25 115 "VMM_CREATE_VSEG", // 26 116 "undefined", // 27 117 "VMM_SET_COW", // 28 118 "VMM_DISPLAY", // 29 119 }; 120 121 ////////////////////////////////////////////////////////////////////////////////// 85 122 void __attribute__((noinline)) rpc_undefined( xptr_t xp __attribute__ ((unused)) ) 86 123 { … … 105 142 client_core_lid = this->core->lid; 106 143 144 // check calling thread can yield when it is not the idle thread 145 assert( (this->busylocks == 0) || (this->type == THREAD_IDLE), 146 "cannot yield : busylocks = %d\n", this->busylocks ); 147 107 148 #if DEBUG_RPC_CLIENT_GENERIC 108 149 uint32_t cycle = (uint32_t)hal_get_cycles(); 109 150 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 );151 printk("\n[DBG] %s : thread %x in process %x enter for rpc %s / server_cxy %x / cycle %d\n", 152 __FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], server_cxy, cycle ); 112 153 #endif 113 154 114 155 // select a server_core : use client core index if possible / core 0 otherwise 115 if( client_core_lid < hal_remote_l w( XPTR( server_cxy , &LOCAL_CLUSTER->cores_nr ) ) )156 if( client_core_lid < hal_remote_l32( XPTR( server_cxy , &LOCAL_CLUSTER->cores_nr ) ) ) 116 157 { 117 158 server_core_lid = client_core_lid; … … 130 171 131 172 // get local pointer on rpc_fifo in remote cluster, 132 remote_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo[server_core_lid]; 133 134 // post RPC in remote fifo / deschedule and retry if fifo full 173 remote_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo[server_core_lid]; 174 xptr_t rpc_fifo_xp = XPTR( server_cxy , rpc_fifo ); 175 176 // post RPC in remote fifo / deschedule without blocking if fifo full 135 177 do 136 178 { 137 full = remote_fifo_put_item( XPTR( server_cxy , rpc_fifo ), (uint64_t )desc_xp ); 179 full = remote_fifo_put_item( rpc_fifo_xp , (uint64_t )desc_xp ); 180 138 181 if ( full ) 139 182 { … … 151 194 #if DEBUG_RPC_CLIENT_GENERIC 152 195 cycle = (uint32_t)hal_get_cycles(); 196 uint32_t items = remote_fifo_items( rpc_fifo_xp ); 153 197 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 );198 printk("\n[DBG] %s : thread %x in process %x / rpc %s / items %d / cycle %d\n", 199 __FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], items, cycle ); 156 200 #endif 157 201 … … 159 203 dev_pic_send_ipi( server_cxy , server_core_lid ); 160 204 161 // wait RPC completion before returning if blocking RPC 162 // - busy waiting policy during kernel_init, or if threads cannot yield163 // - block and deschedule in all other cases205 // wait RPC completion before returning if blocking RPC : 206 // - descheduling without blocking if thread idle (in lernel init) 207 // - block and deschedule policy for any other thread 164 208 if ( rpc->blocking ) 165 209 { 166 if( (this->type == THREAD_IDLE) || (thread_can_yield() == false) ) // busy waiting210 if( this->type == THREAD_IDLE ) // deschedule without blocking policy 167 211 { 168 212 169 213 #if DEBUG_RPC_CLIENT_GENERIC 170 214 cycle = (uint32_t)hal_get_cycles(); 171 215 if( DEBUG_RPC_CLIENT_GENERIC < 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 );174 #endif 175 176 while( rpc->responses ) hal_fixed_delay( 100);216 printk("\n[DBG] %s : thread %x in process %x enter waiting loop for rpc %s / cycle %d\n", 217 __FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle ); 218 #endif 219 220 while( rpc->responses ) sched_yield( "busy waiting on RPC"); 177 221 178 222 #if DEBUG_RPC_CLIENT_GENERIC 179 223 cycle = (uint32_t)hal_get_cycles(); 180 224 if( DEBUG_RPC_CLIENT_GENERIC < 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 ); 183 #endif 184 } 185 else // block & deschedule 225 printk("\n[DBG] %s : thread %x in process %x received response for rpc %s / cycle %d\n", 226 __FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle ); 227 #endif 228 229 } 230 else // block and deschedule policy 186 231 { 187 232 … … 189 234 cycle = (uint32_t)hal_get_cycles(); 190 235 if( DEBUG_RPC_CLIENT_GENERIC < 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 ); 193 #endif 194 thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_RPC ); 195 sched_yield("blocked on RPC"); 236 printk("\n[DBG] %s : thread %x in process %x blocks & deschedules for rpc %s / cycle %d\n", 237 __FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle ); 238 #endif 239 240 // block client thread 241 thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_RPC ); 242 243 // deschedule 244 sched_yield("blocked on RPC"); 196 245 197 246 #if DEBUG_RPC_CLIENT_GENERIC 198 247 cycle = (uint32_t)hal_get_cycles(); 199 248 if( DEBUG_RPC_CLIENT_GENERIC < 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 );249 printk("\n[DBG] %s : thread %x in process %x resumes for rpc %s / cycle %d\n", 250 __FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle ); 202 251 #endif 203 252 } 204 253 205 // check response available 206 assert( (rpc->responses == 0) , "illegal RPC response\n" ); 254 // response must be available for a blocking RPC 255 assert( (rpc->responses == 0) , "illegal response for RPC %s\n", rpc_str[rpc->index] ); 256 207 257 } 208 else // non blocking RPC258 else // non blocking RPC 209 259 { 210 260 … … 212 262 cycle = (uint32_t)hal_get_cycles(); 213 263 if( DEBUG_RPC_CLIENT_GENERIC < 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 );264 printk("\n[DBG] %s : thread %x in process %x returns for non blocking rpc %s / cycle %d\n", 265 __FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle ); 216 266 #endif 217 267 … … 224 274 /***************************************************************************************/ 225 275 226 //////////////// 227 void rpc_check( void ) 228 { 229 error_t error; 230 thread_t * thread; 231 uint32_t sr_save; 232 233 #if DEBUG_RPC_SERVER_GENERIC 234 uint32_t cycle; 235 #endif 236 237 bool_t found = false; 238 thread_t * this = CURRENT_THREAD; 239 core_t * core = this->core; 240 scheduler_t * sched = &core->scheduler; 241 remote_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo[core->lid]; 242 243 // interrupted thread not preemptable during RPC chek 244 hal_disable_irq( &sr_save ); 245 246 // activate (or create) RPC thread if RPC FIFO not empty and no acive RPC thread 247 if( (rpc_fifo->owner == 0) && (local_fifo_is_empty(rpc_fifo) == false) ) 248 { 249 250 #if DEBUG_RPC_SERVER_GENERIC 251 cycle = (uint32_t)hal_get_cycles(); 252 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 253 printk("\n[DBG] %s : RPC FIFO non empty for core[%x,%d] / cycle %d\n", 254 __FUNCTION__, local_cxy, core->lid, cycle ); 255 #endif 256 257 // search one IDLE RPC thread associated to the selected core 258 list_entry_t * iter; 259 LIST_FOREACH( &sched->k_root , iter ) 260 { 261 thread = LIST_ELEMENT( iter , thread_t , sched_list ); 262 if( (thread->type == THREAD_RPC) && (thread->blocked == THREAD_BLOCKED_IDLE ) ) 263 { 264 // unblock found RPC thread 265 thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_IDLE ); 266 267 // exit loop 268 found = true; 269 break; 270 } 271 } 272 273 // create new RPC thread for the selected core if not found 274 if( found == false ) 275 { 276 error = thread_kernel_create( &thread, 277 THREAD_RPC, 278 &rpc_thread_func, 279 NULL, 280 core->lid ); 281 282 assert( (error == 0), 283 "no memory to allocate a new RPC thread in cluster %x", local_cxy ); 284 285 // unblock created RPC thread 286 thread->blocked = 0; 287 288 // update RRPC threads counter 289 hal_atomic_add( &LOCAL_CLUSTER->rpc_threads[core->lid] , 1 ); 290 291 #if DEBUG_RPC_SERVER_GENERIC 292 cycle = (uint32_t)hal_get_cycles(); 293 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 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 ); 296 #endif 297 } 298 } 299 300 #if DEBUG_RPC_SERVER_GENERIC 301 cycle = (uint32_t)hal_get_cycles(); 302 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 303 printk("\n[DBG] %s : interrupted thread %x deschedules on core[%x,%d] / cycle %d\n", 304 __FUNCTION__, this, local_cxy, core->lid, cycle ); 305 #endif 306 307 // interrupted thread always deschedule 308 sched_yield("IPI received"); 309 310 #if DEBUG_RPC_SERVER_GENERIC 311 cycle = (uint32_t)hal_get_cycles(); 312 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 313 printk("\n[DBG] %s : interrupted thread %x resumes on core[%x,%d] / cycle %d\n", 314 __FUNCTION__, this, local_cxy, core->lid, cycle ); 315 #endif 316 317 // interrupted thread restore IRQs after resume 318 hal_restore_irq( sr_save ); 319 320 } // end rpc_check() 321 322 323 ////////////////////// 276 //////////////////////////// 324 277 void rpc_thread_func( void ) 325 278 { … … 345 298 rpc_fifo = &LOCAL_CLUSTER->rpc_fifo[server_core_lid]; 346 299 347 // two embedded loops: 348 // - external loop : "infinite" RPC thread 349 // - internal loop : handle one RPC request per iteration 350 351 while(1) // infinite loop 300 // "infinite" RPC thread loop 301 while(1) 352 302 { 353 303 // try to take RPC_FIFO ownership 354 if( hal_atomic_test_set( &rpc_fifo->owner , server_ptr->trdid ) ) 304 if( hal_atomic_test_set( &rpc_fifo->owner , server_ptr->trdid ) ) 355 305 { 356 306 … … 358 308 uint32_t cycle = (uint32_t)hal_get_cycles(); 359 309 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 360 printk("\n[DBG] %s : RPC thread %x in cluster %x takes RPC fifo ownership / cycle %d\n", 361 __FUNCTION__, server_ptr, local_cxy, cycle ); 362 #endif 363 while( 1 ) // one RPC request per iteration 310 printk("\n[DBG] %s : RPC thread %x on core[%d] takes RPC_FIFO ownership / cycle %d\n", 311 __FUNCTION__, server_ptr->trdid, server_core_lid, cycle ); 312 #endif 313 // try to consume one RPC request 314 empty = remote_fifo_get_item( rpc_fifo , (uint64_t *)&desc_xp ); 315 316 // release RPC_FIFO ownership 317 rpc_fifo->owner = 0; 318 319 // handle RPC request if success 320 if ( empty == 0 ) 364 321 { 365 empty = local_fifo_get_item( rpc_fifo , (uint64_t *)&desc_xp ); 366 367 // exit when FIFO empty or FIFO ownership lost (in case of descheduling) 368 if ( (empty == 0) && (rpc_fifo->owner == server_ptr->trdid) ) 322 // get client cluster and pointer on RPC descriptor 323 desc_cxy = GET_CXY( desc_xp ); 324 desc_ptr = GET_PTR( desc_xp ); 325 326 index = hal_remote_l32( XPTR( desc_cxy , &desc_ptr->index ) ); 327 blocking = hal_remote_l32( XPTR( desc_cxy , &desc_ptr->blocking ) ); 328 329 #if DEBUG_RPC_SERVER_GENERIC 330 cycle = (uint32_t)hal_get_cycles(); 331 uint32_t items = remote_fifo_items( XPTR( local_cxy , rpc_fifo ) ); 332 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 333 printk("\n[DBG] %s : RPC thread %x got rpc %s / client_cxy %x / items %d / cycle %d\n", 334 __FUNCTION__, server_ptr->trdid, rpc_str[index], desc_cxy, items, cycle ); 335 #endif 336 // call the relevant server function 337 rpc_server[index]( desc_xp ); 338 339 #if DEBUG_RPC_SERVER_GENERIC 340 cycle = (uint32_t)hal_get_cycles(); 341 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 342 printk("\n[DBG] %s : RPC thread %x completes rpc %s / client_cxy %x / cycle %d\n", 343 __FUNCTION__, server_ptr->trdid, rpc_str[index], desc_cxy, cycle ); 344 #endif 345 // decrement response counter in RPC descriptor if blocking RPC 346 if( blocking ) 369 347 { 370 // get client cluster and pointer on RPC descriptor 371 desc_cxy = GET_CXY( desc_xp ); 372 desc_ptr = GET_PTR( desc_xp ); 373 374 index = hal_remote_lw( XPTR( desc_cxy , &desc_ptr->index ) ); 375 blocking = hal_remote_lw( XPTR( desc_cxy , &desc_ptr->blocking ) ); 348 // decrement responses counter in RPC descriptor 349 hal_remote_atomic_add( XPTR( desc_cxy, &desc_ptr->responses ), -1 ); 350 351 // get client thread pointer and client core lid from RPC descriptor 352 client_ptr = hal_remote_lpt( XPTR( desc_cxy , &desc_ptr->thread ) ); 353 client_core_lid = hal_remote_l32 ( XPTR( desc_cxy , &desc_ptr->lid ) ); 354 355 // unblock client thread 356 thread_unblock( XPTR( desc_cxy , client_ptr ) , THREAD_BLOCKED_RPC ); 357 358 hal_fence(); 376 359 377 360 #if DEBUG_RPC_SERVER_GENERIC 378 361 cycle = (uint32_t)hal_get_cycles(); 379 362 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 380 printk("\n[DBG] %s : RPC thread %x in cluster %x got rpc[%d] / rpc_cxy %x / rpc_ptr %x\n", 381 __FUNCTION__, server_ptr, local_cxy, index, desc_cxy, desc_ptr ); 382 #endif 383 // call the relevant server function 384 rpc_server[index]( desc_xp ); 385 386 #if DEBUG_RPC_SERVER_GENERIC 387 cycle = (uint32_t)hal_get_cycles(); 388 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 389 printk("\n[DBG] %s : RPC thread %x in cluster %x completes rpc[%d] / rpc_ptr %x / cycle %d\n", 390 __FUNCTION__, server_ptr, local_cxy, index, desc_ptr, cycle ); 391 #endif 392 // decrement response counter in RPC descriptor if blocking 393 if( blocking ) 394 { 395 // decrement responses counter in RPC descriptor 396 hal_remote_atomic_add( XPTR( desc_cxy, &desc_ptr->responses ), -1 ); 397 398 // get client thread pointer and client core lid from RPC descriptor 399 client_ptr = hal_remote_lpt( XPTR( desc_cxy , &desc_ptr->thread ) ); 400 client_core_lid = hal_remote_lw ( XPTR( desc_cxy , &desc_ptr->lid ) ); 401 402 // unblock client thread 403 thread_unblock( XPTR( desc_cxy , client_ptr ) , THREAD_BLOCKED_RPC ); 404 405 hal_fence(); 406 407 #if DEBUG_RPC_SERVER_GENERIC 408 cycle = (uint32_t)hal_get_cycles(); 409 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 410 printk("\n[DBG] %s : RPC thread %x (cluster %x) unblocked client thread %x (cluster %x)\n", 411 __FUNCTION__, server_ptr, local_cxy, client_ptr, desc_cxy, cycle ); 412 #endif 413 // send IPI to client core 414 // dev_pic_send_ipi( desc_cxy , client_core_lid ); 415 } 416 } 417 else 418 { 419 break; 420 } 421 } // end internal loop 422 423 // release rpc_fifo ownership if not lost 424 if( rpc_fifo->owner == server_ptr->trdid ) rpc_fifo->owner = 0; 425 426 } // end if RPC fifo 427 428 // RPC thread blocks on IDLE 429 thread_block( server_xp , THREAD_BLOCKED_IDLE ); 430 431 // sucide if too many RPC threads / simply deschedule otherwise 363 printk("\n[DBG] %s : RPC thread %x unblocked client thread %x / cycle %d\n", 364 __FUNCTION__, server_ptr->trdid, client_ptr->trdid, cycle ); 365 #endif 366 // send IPI to client core 367 dev_pic_send_ipi( desc_cxy , client_core_lid ); 368 369 } // end if blocking RPC 370 } // end RPC handling if fifo non empty 371 } // end if RPC_fIFO ownership successfully taken and released 372 373 // sucide if too many RPC threads 432 374 if( LOCAL_CLUSTER->rpc_threads[server_core_lid] >= CONFIG_RPC_THREADS_MAX ) 433 375 { … … 436 378 uint32_t cycle = (uint32_t)hal_get_cycles(); 437 379 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 438 printk("\n[DBG] %s : RPC thread %x in cluster %xsuicides / cycle %d\n",439 __FUNCTION__, server_ptr , local_cxy, cycle );380 printk("\n[DBG] %s : RPC thread %x suicides / cycle %d\n", 381 __FUNCTION__, server_ptr->trdid, cycle ); 440 382 #endif 441 383 // update RPC threads counter 442 hal_atomic_add( &LOCAL_CLUSTER->rpc_threads , -1 );384 hal_atomic_add( &LOCAL_CLUSTER->rpc_threads[server_core_lid] , -1 ); 443 385 444 386 // RPC thread blocks on GLOBAL … … 448 390 hal_remote_atomic_or( server_xp , THREAD_FLAG_REQ_DELETE ); 449 391 } 392 // block and deschedule otherwise 450 393 else 451 394 { … … 454 397 uint32_t cycle = (uint32_t)hal_get_cycles(); 455 398 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 456 printk("\n[DBG] %s : RPC thread %x in cluster %x block & deschedules / cycle %d\n", 457 __FUNCTION__, server_ptr, local_cxy, cycle ); 458 #endif 399 printk("\n[DBG] %s : RPC thread %x block IDLE & deschedules / cycle %d\n", 400 __FUNCTION__, server_ptr->trdid, cycle ); 401 #endif 402 // RPC thread blocks on IDLE 403 thread_block( server_xp , THREAD_BLOCKED_IDLE ); 459 404 460 405 // RPC thread deschedules 461 assert( thread_can_yield() , "illegal sched_yield\n" ); 462 sched_yield("RPC fifo empty"); 406 sched_yield("RPC_FIFO empty"); 463 407 } 464 465 408 } // end infinite loop 466 467 409 } // end rpc_thread_func() 468 410 … … 478 420 { 479 421 #if DEBUG_RPC_PMEM_GET_PAGES 422 thread_t * this = CURRENT_THREAD; 480 423 uint32_t cycle = (uint32_t)hal_get_cycles(); 481 424 if( cycle > DEBUG_RPC_PMEM_GET_PAGES ) 482 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",483 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid, cycle );425 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 426 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 484 427 #endif 485 428 … … 504 447 cycle = (uint32_t)hal_get_cycles(); 505 448 if( cycle > DEBUG_RPC_PMEM_GET_PAGES ) 506 printk("\n[DBG] %s : thread %x exit / cycle %d\n",507 __FUNCTION__ , CURRENT_THREAD, cycle );449 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 450 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 508 451 #endif 509 452 } … … 513 456 { 514 457 #if DEBUG_RPC_PMEM_GET_PAGES 458 thread_t * this = CURRENT_THREAD; 515 459 uint32_t cycle = (uint32_t)hal_get_cycles(); 516 460 if( cycle > DEBUG_RPC_PMEM_GET_PAGES ) 517 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",518 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid, cycle );461 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 462 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 519 463 #endif 520 464 … … 524 468 525 469 // get input arguments from client RPC descriptor 526 uint32_t order = (uint32_t)hal_remote_l wd( XPTR( cxy , &desc->args[0] ) );470 uint32_t order = (uint32_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) ); 527 471 528 472 // call local pmem allocator … … 530 474 531 475 // set output arguments into client RPC descriptor 532 hal_remote_s wd( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );476 hal_remote_s64( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page ); 533 477 534 478 #if DEBUG_RPC_PMEM_GET_PAGES 535 479 cycle = (uint32_t)hal_get_cycles(); 536 480 if( cycle > DEBUG_RPC_PMEM_GET_PAGES ) 537 printk("\n[DBG] %s : thread %x exit / cycle %d\n",538 __FUNCTION__ , CURRENT_THREAD, cycle );481 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 482 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 539 483 #endif 540 484 } … … 549 493 { 550 494 #if DEBUG_RPC_PMEM_RELEASE_PAGES 495 thread_t * this = CURRENT_THREAD; 551 496 uint32_t cycle = (uint32_t)hal_get_cycles(); 552 497 if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES ) 553 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",554 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );498 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 499 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 555 500 #endif 556 501 … … 572 517 cycle = (uint32_t)hal_get_cycles(); 573 518 if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES ) 574 printk("\n[DBG] %s : thread %x exit / cycle %d\n",575 __FUNCTION__ , CURRENT_THREAD, cycle );519 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 520 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 576 521 #endif 577 522 } … … 581 526 { 582 527 #if DEBUG_RPC_PMEM_RELEASE_PAGES 528 thread_t * this = CURRENT_THREAD; 583 529 uint32_t cycle = (uint32_t)hal_get_cycles(); 584 530 if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES ) 585 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",586 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );531 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 532 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 587 533 #endif 588 534 … … 592 538 593 539 // get input arguments from client RPC descriptor 594 page_t * page = (page_t *)(intptr_t)hal_remote_l wd( XPTR( cxy , &desc->args[0] ) );540 page_t * page = (page_t *)(intptr_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) ); 595 541 596 542 // release memory to local pmem … … 603 549 cycle = (uint32_t)hal_get_cycles(); 604 550 if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES ) 605 printk("\n[DBG] %s : thread %x exit / cycle %d\n",606 __FUNCTION__ , CURRENT_THREAD, cycle );551 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 552 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 607 553 #endif 608 554 } … … 625 571 { 626 572 #if DEBUG_RPC_PROCESS_MAKE_FORK 573 thread_t * this = CURRENT_THREAD; 627 574 uint32_t cycle = (uint32_t)hal_get_cycles(); 628 575 if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK ) 629 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",630 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );576 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 577 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 631 578 #endif 632 579 … … 654 601 cycle = (uint32_t)hal_get_cycles(); 655 602 if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK ) 656 printk("\n[DBG] %s : thread %x exit / cycle %d\n",657 __FUNCTION__ , CURRENT_THREAD, cycle );603 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 604 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 658 605 #endif 659 606 } … … 663 610 { 664 611 #if DEBUG_RPC_PROCESS_MAKE_FORK 612 thread_t * this = CURRENT_THREAD; 665 613 uint32_t cycle = (uint32_t)hal_get_cycles(); 666 614 if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK ) 667 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",668 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid, cycle );615 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 616 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 669 617 #endif 670 618 … … 680 628 681 629 // get input arguments from cient RPC descriptor 682 ref_process_xp = (xptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[0] ) );683 parent_thread_xp = (xptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[1] ) );630 ref_process_xp = (xptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 631 parent_thread_xp = (xptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 684 632 685 633 // call local kernel function … … 690 638 691 639 // set output argument into client RPC descriptor 692 hal_remote_s wd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)child_pid );693 hal_remote_s wd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)(intptr_t)child_thread_ptr );694 hal_remote_s wd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );640 hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)child_pid ); 641 hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)(intptr_t)child_thread_ptr ); 642 hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error ); 695 643 696 644 #if DEBUG_RPC_PROCESS_MAKE_FORK 697 645 cycle = (uint32_t)hal_get_cycles(); 698 646 if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK ) 699 printk("\n[DBG] %s : thread %x exit / cycle %d\n",700 __FUNCTION__ , CURRENT_THREAD, cycle );647 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 648 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 701 649 #endif 702 650 } … … 723 671 error_t * error ) // out 724 672 { 673 #if DEBUG_RPC_THREAD_USER_CREATE 674 thread_t * this = CURRENT_THREAD; 675 uint32_t cycle = (uint32_t)hal_get_cycles(); 676 if( cycle > DEBUG_RPC_THREAD_USER_CREATE) 677 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 678 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 679 #endif 680 725 681 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 726 682 … … 744 700 *error = (error_t)rpc.args[5]; 745 701 702 #if DEBUG_RPC_THREAD_USER_CREATE 703 cycle = (uint32_t)hal_get_cycles(); 704 if( cycle > DEBUG_RPC_THREAD_USER_CREATE) 705 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 706 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 707 #endif 746 708 } 747 709 … … 749 711 void rpc_thread_user_create_server( xptr_t xp ) 750 712 { 713 #if DEBUG_RPC_THREAD_USER_CREATE 714 thread_t * this = CURRENT_THREAD; 715 uint32_t cycle = (uint32_t)hal_get_cycles(); 716 if( cycle > DEBUG_RPC_THREAD_USER_CREATE) 717 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 718 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 719 #endif 751 720 752 721 pthread_attr_t * attr_ptr; // pointer on attributes structure in client cluster … … 767 736 768 737 // get input arguments from RPC descriptor 769 pid = (pid_t) hal_remote_l wd(XPTR(client_cxy , &desc->args[0]));770 start_func = (void *)(intptr_t) hal_remote_l wd(XPTR(client_cxy , &desc->args[1]));771 start_arg = (void *)(intptr_t) hal_remote_l wd(XPTR(client_cxy , &desc->args[2]));772 attr_ptr = (pthread_attr_t *)(intptr_t)hal_remote_l wd(XPTR(client_cxy , &desc->args[3]));738 pid = (pid_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0])); 739 start_func = (void *)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[1])); 740 start_arg = (void *)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[2])); 741 attr_ptr = (pthread_attr_t *)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[3])); 773 742 774 743 // makes a local copy of attributes structure … … 786 755 // set output arguments 787 756 thread_xp = XPTR( local_cxy , thread_ptr ); 788 hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)thread_xp ); 789 hal_remote_swd( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error ); 790 757 hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)thread_xp ); 758 hal_remote_s64( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error ); 759 760 #if DEBUG_RPC_THREAD_USER_CREATE 761 cycle = (uint32_t)hal_get_cycles(); 762 if( cycle > DEBUG_RPC_THREAD_USER_CREATE) 763 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 764 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 765 #endif 791 766 } 792 767 … … 803 778 error_t * error ) // out 804 779 { 780 #if DEBUG_RPC_THREAD_KERNEL_CREATE 781 thread_t * this = CURRENT_THREAD; 782 uint32_t cycle = (uint32_t)hal_get_cycles(); 783 if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE) 784 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 785 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 786 #endif 787 805 788 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 806 789 … … 823 806 *error = (error_t)rpc.args[4]; 824 807 808 #if DEBUG_RPC_THREAD_KERNEL_CREATE 809 cycle = (uint32_t)hal_get_cycles(); 810 if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE) 811 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 812 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 813 #endif 825 814 } 826 815 … … 828 817 void rpc_thread_kernel_create_server( xptr_t xp ) 829 818 { 819 #if DEBUG_RPC_THREAD_KERNEL_CREATE 820 thread_t * this = CURRENT_THREAD; 821 uint32_t cycle = (uint32_t)hal_get_cycles(); 822 if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE) 823 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 824 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 825 #endif 826 830 827 thread_t * thread_ptr; // local pointer on thread descriptor 831 828 xptr_t thread_xp; // extended pointer on thread descriptor … … 838 835 839 836 // get attributes from RPC descriptor 840 uint32_t type = (uint32_t) hal_remote_l wd( XPTR( client_cxy , &desc->args[0] ) );841 void * func = (void*)(intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[1] ) );842 void * args = (void*)(intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[2] ) );837 uint32_t type = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 838 void * func = (void*)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 839 void * args = (void*)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) ); 843 840 844 841 // select one core … … 850 847 // set output arguments 851 848 thread_xp = XPTR( local_cxy , thread_ptr ); 852 hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 853 hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp ); 854 849 hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 850 hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp ); 851 852 #if DEBUG_RPC_THREAD_KERNEL_CREATE 853 cycle = (uint32_t)hal_get_cycles(); 854 if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE) 855 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 856 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 857 #endif 855 858 } 856 859 … … 913 916 914 917 // get arguments from RPC descriptor 915 action = (uint32_t)hal_remote_l wd( XPTR(client_cxy , &rpc->args[0]) );916 pid = (pid_t) hal_remote_l wd( XPTR(client_cxy , &rpc->args[1]) );918 action = (uint32_t)hal_remote_l64( XPTR(client_cxy , &rpc->args[0]) ); 919 pid = (pid_t) hal_remote_l64( XPTR(client_cxy , &rpc->args[1]) ); 917 920 918 921 #if DEBUG_RPC_PROCESS_SIGACTION … … 945 948 { 946 949 // get client core lid 947 client_lid = (lid_t) hal_remote_l w( XPTR( client_cxy , &rpc->lid ) );950 client_lid = (lid_t) hal_remote_l32 ( XPTR( client_cxy , &rpc->lid ) ); 948 951 949 952 // unblock client thread … … 981 984 { 982 985 #if DEBUG_RPC_VFS_INODE_CREATE 986 thread_t * this = CURRENT_THREAD; 983 987 uint32_t cycle = (uint32_t)hal_get_cycles(); 984 988 if( cycle > DEBUG_RPC_VFS_INODE_CREATE ) 985 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",986 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );989 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 990 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 987 991 #endif 988 992 … … 1013 1017 1014 1018 #if DEBUG_RPC_VFS_INODE_CREATE 1015 uint32_tcycle = (uint32_t)hal_get_cycles();1019 cycle = (uint32_t)hal_get_cycles(); 1016 1020 if( cycle > DEBUG_RPC_VFS_INODE_CREATE ) 1017 printk("\n[DBG] %s : thread %x exit on core[%x,%d]/ cycle %d\n",1018 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid, cycle );1021 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1022 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1019 1023 #endif 1020 1024 } … … 1024 1028 { 1025 1029 #if DEBUG_RPC_VFS_INODE_CREATE 1030 thread_t * this = CURRENT_THREAD; 1026 1031 uint32_t cycle = (uint32_t)hal_get_cycles(); 1027 1032 if( cycle > DEBUG_RPC_VFS_INODE_CREATE ) 1028 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1029 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid, cycle );1033 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1034 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1030 1035 #endif 1031 1036 … … 1046 1051 1047 1052 // get input arguments from client rpc descriptor 1048 dentry_xp = (xptr_t) hal_remote_l wd( XPTR( client_cxy , &desc->args[0] ) );1049 fs_type = (uint32_t) hal_remote_l wd( XPTR( client_cxy , &desc->args[1] ) );1050 inode_type = (uint32_t) hal_remote_l wd( XPTR( client_cxy , &desc->args[2] ) );1051 extend = (void *)(intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[3] ) );1052 attr = (uint32_t) hal_remote_l wd( XPTR( client_cxy , &desc->args[4] ) );1053 rights = (uint32_t) hal_remote_l wd( XPTR( client_cxy , &desc->args[5] ) );1054 uid = (uid_t) hal_remote_l wd( XPTR( client_cxy , &desc->args[6] ) );1055 gid = (gid_t) hal_remote_l wd( XPTR( client_cxy , &desc->args[7] ) );1053 dentry_xp = (xptr_t) hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1054 fs_type = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 1055 inode_type = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) ); 1056 extend = (void *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) ); 1057 attr = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) ); 1058 rights = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[5] ) ); 1059 uid = (uid_t) hal_remote_l64( XPTR( client_cxy , &desc->args[6] ) ); 1060 gid = (gid_t) hal_remote_l64( XPTR( client_cxy , &desc->args[7] ) ); 1056 1061 1057 1062 // call local kernel function … … 1067 1072 1068 1073 // set output arguments 1069 hal_remote_s wd( XPTR( client_cxy , &desc->args[8] ) , (uint64_t)inode_xp );1070 hal_remote_s wd( XPTR( client_cxy , &desc->args[9] ) , (uint64_t)error );1074 hal_remote_s64( XPTR( client_cxy , &desc->args[8] ) , (uint64_t)inode_xp ); 1075 hal_remote_s64( XPTR( client_cxy , &desc->args[9] ) , (uint64_t)error ); 1071 1076 1072 1077 #if DEBUG_RPC_VFS_INODE_CREATE 1073 uint32_tcycle = (uint32_t)hal_get_cycles();1078 cycle = (uint32_t)hal_get_cycles(); 1074 1079 if( cycle > DEBUG_RPC_VFS_INODE_CREATE ) 1075 printk("\n[DBG] %s : thread %x exit on core[%x,%d]/ cycle %d\n",1076 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid, cycle );1080 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1081 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1077 1082 #endif 1078 1083 } … … 1088 1093 { 1089 1094 #if DEBUG_RPC_VFS_INODE_DESTROY 1095 thread_t * this = CURRENT_THREAD; 1090 1096 uint32_t cycle = (uint32_t)hal_get_cycles(); 1091 1097 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY ) 1092 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1093 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid, cycle );1098 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1099 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1094 1100 #endif 1095 1101 … … 1112 1118 1113 1119 #if DEBUG_RPC_VFS_INODE_DESTROY 1114 uint32_tcycle = (uint32_t)hal_get_cycles();1120 cycle = (uint32_t)hal_get_cycles(); 1115 1121 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY ) 1116 printk("\n[DBG] %s : thread %x exit on core[%x,%d]/ cycle %d\n",1117 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid, cycle );1122 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1123 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1118 1124 #endif 1119 1125 } … … 1123 1129 { 1124 1130 #if DEBUG_RPC_VFS_INODE_DESTROY 1131 thread_t * this = CURRENT_THREAD; 1125 1132 uint32_t cycle = (uint32_t)hal_get_cycles(); 1126 1133 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY ) 1127 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1128 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid, cycle );1134 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1135 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1129 1136 #endif 1130 1137 … … 1137 1144 1138 1145 // get arguments "inode" from client RPC descriptor 1139 inode = (vfs_inode_t *)(intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[0] ) );1146 inode = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1140 1147 1141 1148 // call local kernel function … … 1143 1150 1144 1151 // set output argument 1145 hal_remote_s wd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );1152 hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 1146 1153 1147 1154 #if DEBUG_RPC_VFS_INODE_DESTROY 1148 uint32_tcycle = (uint32_t)hal_get_cycles();1155 cycle = (uint32_t)hal_get_cycles(); 1149 1156 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY ) 1150 printk("\n[DBG] %s : thread %x exit on core[%x,%d]/ cycle %d\n",1151 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid, cycle );1157 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1158 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1152 1159 #endif 1153 1160 } … … 1166 1173 { 1167 1174 #if DEBUG_RPC_VFS_DENTRY_CREATE 1175 thread_t * this = CURRENT_THREAD; 1168 1176 uint32_t cycle = (uint32_t)hal_get_cycles(); 1169 1177 if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE ) 1170 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1171 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid, cycle );1178 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1179 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1172 1180 #endif 1173 1181 … … 1195 1203 cycle = (uint32_t)hal_get_cycles(); 1196 1204 if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE ) 1197 printk("\n[DBG] %s : thread %x exit / cycle %d\n",1198 __FUNCTION__ , CURRENT_THREAD, cycle );1205 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1206 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1199 1207 #endif 1200 1208 } … … 1204 1212 { 1205 1213 #if DEBUG_RPC_VFS_DENTRY_CREATE 1214 thread_t * this = CURRENT_THREAD; 1206 1215 uint32_t cycle = (uint32_t)hal_get_cycles(); 1207 1216 if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE ) 1208 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1209 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1217 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1218 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1210 1219 #endif 1211 1220 … … 1222 1231 1223 1232 // get arguments "name", "type", and "parent" from client RPC descriptor 1224 type = (uint32_t) hal_remote_l wd( XPTR( client_cxy , &desc->args[0] ) );1225 name = (char *)(intptr_t) hal_remote_l wd( XPTR( client_cxy , &desc->args[1] ) );1226 parent = (vfs_inode_t *)(intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[2] ) );1233 type = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1234 name = (char *)(intptr_t) hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 1235 parent = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) ); 1227 1236 1228 1237 // makes a local copy of name … … 1236 1245 &dentry_xp ); 1237 1246 // set output arguments 1238 hal_remote_s wd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)dentry_xp );1239 hal_remote_s wd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );1247 hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)dentry_xp ); 1248 hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error ); 1240 1249 1241 1250 #if DEBUG_RPC_VFS_DENTRY_CREATE 1242 1251 cycle = (uint32_t)hal_get_cycles(); 1243 1252 if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE ) 1244 printk("\n[DBG] %s : thread %x exit / cycle %d\n",1245 __FUNCTION__ , CURRENT_THREAD, cycle );1253 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1254 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1246 1255 #endif 1247 1256 } … … 1257 1266 { 1258 1267 #if DEBUG_RPC_VFS_DENTRY_DESTROY 1268 thread_t * this = CURRENT_THREAD; 1259 1269 uint32_t cycle = (uint32_t)hal_get_cycles(); 1260 1270 if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY ) 1261 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1262 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1271 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1272 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1263 1273 #endif 1264 1274 … … 1283 1293 cycle = (uint32_t)hal_get_cycles(); 1284 1294 if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY ) 1285 printk("\n[DBG] %s : thread %x exit / cycle %d\n",1286 __FUNCTION__ , CURRENT_THREAD, cycle );1295 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1296 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1287 1297 #endif 1288 1298 } … … 1292 1302 { 1293 1303 #if DEBUG_RPC_VFS_DENTRY_DESTROY 1304 thread_t * this = CURRENT_THREAD; 1294 1305 uint32_t cycle = (uint32_t)hal_get_cycles(); 1295 1306 if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY ) 1296 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1297 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1307 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1308 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1298 1309 #endif 1299 1310 … … 1306 1317 1307 1318 // get arguments "dentry" from client RPC descriptor 1308 dentry = (vfs_dentry_t *)(intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[0] ) );1319 dentry = (vfs_dentry_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1309 1320 1310 1321 // call local kernel function … … 1312 1323 1313 1324 // set output argument 1314 hal_remote_s wd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );1325 hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 1315 1326 1316 1327 #if DEBUG_RPC_VFS_DENTRY_DESTROY 1317 1328 cycle = (uint32_t)hal_get_cycles(); 1318 1329 if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY ) 1319 printk("\n[DBG] %s : thread %x exit / cycle %d\n",1320 __FUNCTION__ , CURRENT_THREAD, cycle );1330 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1331 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1321 1332 #endif 1322 1333 } … … 1335 1346 { 1336 1347 #if DEBUG_RPC_VFS_FILE_CREATE 1348 thread_t * this = CURRENT_THREAD; 1337 1349 uint32_t cycle = (uint32_t)hal_get_cycles(); 1338 1350 if( cycle > DEBUG_RPC_VFS_FILE_CREATE ) 1339 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1340 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1351 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1352 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1341 1353 #endif 1342 1354 … … 1363 1375 cycle = (uint32_t)hal_get_cycles(); 1364 1376 if( cycle > DEBUG_RPC_VFS_FILE_CREATE ) 1365 printk("\n[DBG] %s : thread %x exit / cycle %d\n",1366 __FUNCTION__ , CURRENT_THREAD, cycle );1377 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1378 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1367 1379 #endif 1368 1380 } … … 1372 1384 { 1373 1385 #if DEBUG_RPC_VFS_FILE_CREATE 1386 thread_t * this = CURRENT_THREAD; 1374 1387 uint32_t cycle = (uint32_t)hal_get_cycles(); 1375 1388 if( cycle > DEBUG_RPC_VFS_FILE_CREATE ) 1376 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1377 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1389 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1390 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1378 1391 #endif 1379 1392 … … 1388 1401 1389 1402 // get arguments "file_attr" and "inode" from client RPC descriptor 1390 inode = (vfs_inode_t *)(intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[0] ) );1391 file_attr = (uint32_t) hal_remote_l wd( XPTR( client_cxy , &desc->args[1] ) );1403 inode = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1404 file_attr = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 1392 1405 1393 1406 // call local kernel function … … 1397 1410 1398 1411 // set output arguments 1399 hal_remote_s wd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)file_xp );1400 hal_remote_s wd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );1412 hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)file_xp ); 1413 hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error ); 1401 1414 1402 1415 #if DEBUG_RPC_VFS_FILE_CREATE 1403 1416 cycle = (uint32_t)hal_get_cycles(); 1404 1417 if( cycle > DEBUG_RPC_VFS_FILE_CREATE ) 1405 printk("\n[DBG] %s : thread %x exit / cycle %d\n",1406 __FUNCTION__ , CURRENT_THREAD, cycle );1418 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1419 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1407 1420 #endif 1408 1421 } … … 1417 1430 { 1418 1431 #if DEBUG_RPC_VFS_FILE_DESTROY 1432 thread_t * this = CURRENT_THREAD; 1419 1433 uint32_t cycle = (uint32_t)hal_get_cycles(); 1420 1434 if( cycle > DEBUG_RPC_VFS_FILE_DESTROY ) 1421 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1422 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1435 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1436 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1423 1437 #endif 1424 1438 … … 1440 1454 cycle = (uint32_t)hal_get_cycles(); 1441 1455 if( cycle > DEBUG_RPC_VFS_FILE_DESTROY ) 1442 printk("\n[DBG] %s : thread %x exit / cycle %d\n",1443 __FUNCTION__ , CURRENT_THREAD, cycle );1456 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1457 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1444 1458 #endif 1445 1459 } … … 1449 1463 { 1450 1464 #if DEBUG_RPC_VFS_FILE_DESTROY 1465 thread_t * this = CURRENT_THREAD; 1451 1466 uint32_t cycle = (uint32_t)hal_get_cycles(); 1452 1467 if( cycle > DEBUG_RPC_VFS_FILE_DESTROY ) 1453 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1454 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1468 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1469 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1455 1470 #endif 1456 1471 … … 1462 1477 1463 1478 // get arguments "dentry" from client RPC descriptor 1464 file = (vfs_file_t *)(intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[0] ) );1479 file = (vfs_file_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1465 1480 1466 1481 // call local kernel function … … 1470 1485 cycle = (uint32_t)hal_get_cycles(); 1471 1486 if( cycle > DEBUG_RPC_VFS_FILE_DESTROY ) 1472 printk("\n[DBG] %s : thread %x exit / cycle %d\n",1473 __FUNCTION__ , CURRENT_THREAD, cycle );1487 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1488 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1474 1489 #endif 1475 1490 } … … 1522 1537 1523 1538 // get arguments "parent", "name", and "child_xp" 1524 parent = (vfs_inode_t*)(intptr_t)hal_remote_l wd(XPTR(client_cxy , &desc->args[0]));1525 name = (char*)(intptr_t) hal_remote_l wd(XPTR(client_cxy , &desc->args[1]));1526 child_xp = (xptr_t) hal_remote_l wd(XPTR(client_cxy , &desc->args[2]));1539 parent = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0])); 1540 name = (char*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[1])); 1541 child_xp = (xptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[2])); 1527 1542 1528 1543 // get name local copy … … 1534 1549 1535 1550 // set output argument 1536 hal_remote_s wd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );1551 hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error ); 1537 1552 1538 1553 } … … 1577 1592 1578 1593 // get arguments "parent", "name", and "child_xp" 1579 inode = (vfs_inode_t*)(intptr_t)hal_remote_l wd(XPTR(client_cxy , &desc->args[0]));1594 inode = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0])); 1580 1595 1581 1596 // call the kernel function … … 1583 1598 1584 1599 // set output argument 1585 hal_remote_s wd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );1600 hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 1586 1601 1587 1602 } … … 1636 1651 // get input arguments 1637 1652 mapper = (mapper_t *)(intptr_t)hal_remote_lpt( XPTR( client_cxy , &desc->args[0] ) ); 1638 first = (uint32_t) hal_remote_l w( XPTR( client_cxy , &desc->args[1] ) );1639 index = (uint32_t) hal_remote_l w( XPTR( client_cxy , &desc->args[2] ) );1653 first = (uint32_t) hal_remote_l32 ( XPTR( client_cxy , &desc->args[1] ) ); 1654 index = (uint32_t) hal_remote_l32 ( XPTR( client_cxy , &desc->args[2] ) ); 1640 1655 1641 1656 // call the kernel function … … 1643 1658 1644 1659 // set output argument 1645 hal_remote_s wd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)cluster );1646 hal_remote_s wd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );1660 hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)cluster ); 1661 hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error ); 1647 1662 1648 1663 } … … 1660 1675 { 1661 1676 #if DEBUG_RPC_VMM_GET_VSEG 1677 thread_t * this = CURRENT_THREAD; 1662 1678 uint32_t cycle = (uint32_t)hal_get_cycles(); 1663 1679 if( cycle > DEBUG_RPC_VMM_GET_VSEG ) 1664 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1665 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1680 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1681 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1666 1682 #endif 1667 1683 … … 1688 1704 cycle = (uint32_t)hal_get_cycles(); 1689 1705 if( cycle > DEBUG_RPC_VMM_GET_VSEG ) 1690 printk("\n[DBG] %s : thread %x exit on core[%x,%d]/ cycle %d\n",1691 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1706 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1707 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1692 1708 #endif 1693 1709 } … … 1697 1713 { 1698 1714 #if DEBUG_RPC_VMM_GET_VSEG 1715 thread_t * this = CURRENT_THREAD; 1699 1716 uint32_t cycle = (uint32_t)hal_get_cycles(); 1700 1717 if( cycle > DEBUG_RPC_VMM_GET_VSEG ) 1701 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1702 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1718 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1719 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1703 1720 #endif 1704 1721 … … 1714 1731 1715 1732 // get input argument from client RPC descriptor 1716 process = (process_t *)(intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[0] ) );1717 vaddr = (intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[1] ) );1733 process = (process_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1734 vaddr = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 1718 1735 1719 1736 // call local kernel function … … 1722 1739 // set output arguments to client RPC descriptor 1723 1740 vseg_xp = XPTR( local_cxy , vseg_ptr ); 1724 hal_remote_s wd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)vseg_xp );1725 hal_remote_s wd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );1741 hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)vseg_xp ); 1742 hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error ); 1726 1743 1727 1744 #if DEBUG_RPC_VMM_GET_VSEG 1728 1745 cycle = (uint32_t)hal_get_cycles(); 1729 1746 if( cycle > DEBUG_RPC_VMM_GET_VSEG ) 1730 printk("\n[DBG] %s : thread %x exit on core[%x,%d]/ cycle %d\n",1731 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1747 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1748 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1732 1749 #endif 1733 1750 } … … 1748 1765 { 1749 1766 #if DEBUG_RPC_VMM_GET_PTE 1767 thread_t * this = CURRENT_THREAD; 1750 1768 uint32_t cycle = (uint32_t)hal_get_cycles(); 1751 1769 if( cycle > DEBUG_RPC_VMM_GET_PTE ) 1752 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1753 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1770 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1771 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1754 1772 #endif 1755 1773 … … 1778 1796 cycle = (uint32_t)hal_get_cycles(); 1779 1797 if( cycle > DEBUG_RPC_VMM_GET_PTE ) 1780 printk("\n[DBG] %s : thread %x exit on core[%x,%d]/ cycle %d\n",1781 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1798 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1799 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1782 1800 #endif 1783 1801 } … … 1787 1805 { 1788 1806 #if DEBUG_RPC_VMM_GET_PTE 1807 thread_t * this = CURRENT_THREAD; 1789 1808 uint32_t cycle = (uint32_t)hal_get_cycles(); 1790 1809 if( cycle > DEBUG_RPC_VMM_GET_PTE ) 1791 printk("\n[DBG] %s : thread %x enter on core[%x,%d]/ cycle %d\n",1792 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1810 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1811 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1793 1812 #endif 1794 1813 … … 1805 1824 1806 1825 // get input argument "process" & "vpn" from client RPC descriptor 1807 process = (process_t *)(intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[0] ) );1808 vpn = (vpn_t) hal_remote_l wd( XPTR( client_cxy , &desc->args[1] ) );1809 cow = (bool_t) hal_remote_l wd( XPTR( client_cxy , &desc->args[2] ) );1826 process = (process_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1827 vpn = (vpn_t) hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 1828 cow = (bool_t) hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) ); 1810 1829 1811 1830 // call local kernel function … … 1813 1832 1814 1833 // set output argument "attr" & "ppn" to client RPC descriptor 1815 hal_remote_s wd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)attr );1816 hal_remote_s wd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)ppn );1817 hal_remote_s wd( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );1834 hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)attr ); 1835 hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)ppn ); 1836 hal_remote_s64( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error ); 1818 1837 1819 1838 #if DEBUG_RPC_VMM_GET_PTE 1820 1839 cycle = (uint32_t)hal_get_cycles(); 1821 1840 if( cycle > DEBUG_RPC_VMM_GET_PTE ) 1822 printk("\n[DBG] %s : thread %x exit on core[%x,%d]/ cycle %d\n",1823 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );1841 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1842 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1824 1843 #endif 1825 1844 } … … 1834 1853 xptr_t * buf_xp ) // out 1835 1854 { 1855 #if DEBUG_RPC_KCM_ALLOC 1856 thread_t * this = CURRENT_THREAD; 1857 uint32_t cycle = (uint32_t)hal_get_cycles(); 1858 if( cycle > DEBUG_RPC_KCM_ALLOC ) 1859 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1860 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1861 #endif 1862 1836 1863 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1837 1864 … … 1851 1878 *buf_xp = (xptr_t)rpc.args[1]; 1852 1879 1880 #if DEBUG_RPC_KCM_ALLOC 1881 cycle = (uint32_t)hal_get_cycles(); 1882 if( cycle > DEBUG_RPC_KCM_ALLOC ) 1883 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1884 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1885 #endif 1853 1886 } 1854 1887 … … 1856 1889 void rpc_kcm_alloc_server( xptr_t xp ) 1857 1890 { 1891 #if DEBUG_RPC_KCM_ALLOC 1892 thread_t * this = CURRENT_THREAD; 1893 uint32_t cycle = (uint32_t)hal_get_cycles(); 1894 if( cycle > DEBUG_RPC_KCM_ALLOC ) 1895 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1896 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1897 #endif 1898 1858 1899 // get client cluster identifier and pointer on RPC descriptor 1859 1900 cxy_t client_cxy = GET_CXY( xp ); … … 1861 1902 1862 1903 // get input argument "kmem_type" from client RPC descriptor 1863 uint32_t kmem_type = (uint32_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[0] ) );1904 uint32_t kmem_type = (uint32_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1864 1905 1865 1906 // allocates memory for kcm … … 1871 1912 // set output argument 1872 1913 xptr_t buf_xp = XPTR( local_cxy , buf_ptr ); 1873 hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)buf_xp ); 1874 1914 hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)buf_xp ); 1915 1916 #if DEBUG_RPC_KCM_ALLOC 1917 cycle = (uint32_t)hal_get_cycles(); 1918 if( cycle > DEBUG_RPC_KCM_ALLOC ) 1919 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1920 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1921 #endif 1875 1922 } 1876 1923 … … 1884 1931 uint32_t kmem_type ) // in 1885 1932 { 1933 #if DEBUG_RPC_KCM_FREE 1934 thread_t * this = CURRENT_THREAD; 1935 uint32_t cycle = (uint32_t)hal_get_cycles(); 1936 if( cycle > DEBUG_RPC_KCM_FREE ) 1937 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1938 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1939 #endif 1940 1886 1941 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1887 1942 … … 1899 1954 rpc_send( cxy , &rpc ); 1900 1955 1956 #if DEBUG_RPC_KCM_FREE 1957 cycle = (uint32_t)hal_get_cycles(); 1958 if( cycle > DEBUG_RPC_KCM_FREE ) 1959 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1960 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1961 #endif 1901 1962 } 1902 1963 … … 1904 1965 void rpc_kcm_free_server( xptr_t xp ) 1905 1966 { 1967 #if DEBUG_RPC_KCM_FREE 1968 thread_t * this = CURRENT_THREAD; 1969 uint32_t cycle = (uint32_t)hal_get_cycles(); 1970 if( cycle > DEBUG_RPC_KCM_FREE ) 1971 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n", 1972 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1973 #endif 1974 1906 1975 // get client cluster identifier and pointer on RPC descriptor 1907 1976 cxy_t client_cxy = GET_CXY( xp ); … … 1909 1978 1910 1979 // get input arguments "buf" and "kmem_type" from client RPC descriptor 1911 void * buf = (void *)(intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[0] ) );1912 uint32_t kmem_type = (uint32_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[1] ) );1980 void * buf = (void *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1981 uint32_t kmem_type = (uint32_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 1913 1982 1914 1983 // releases memory … … 1918 1987 kmem_free( &req ); 1919 1988 1989 #if DEBUG_RPC_KCM_FREE 1990 cycle = (uint32_t)hal_get_cycles(); 1991 if( cycle > DEBUG_RPC_KCM_FREE ) 1992 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1993 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle ); 1994 #endif 1920 1995 } 1921 1996 … … 1975 2050 1976 2051 // get arguments from client RPC descriptor 1977 mapper = (mapper_t *)(intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[0] ) );1978 to_buffer = hal_remote_l wd( XPTR( client_cxy , &desc->args[1] ) );1979 is_user = hal_remote_l wd( XPTR( client_cxy , &desc->args[2] ) );1980 file_offset = hal_remote_l wd( XPTR( client_cxy , &desc->args[3] ) );1981 size = hal_remote_l wd( XPTR( client_cxy , &desc->args[5] ) );2052 mapper = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 2053 to_buffer = hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 2054 is_user = hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) ); 2055 file_offset = hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) ); 2056 size = hal_remote_l64( XPTR( client_cxy , &desc->args[5] ) ); 1982 2057 1983 2058 // call local kernel function 1984 2059 if( is_user ) 1985 2060 { 1986 user_buffer = (void *)(intptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[4] ) );2061 user_buffer = (void *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) ); 1987 2062 1988 2063 error = mapper_move_user( mapper, … … 1994 2069 else 1995 2070 { 1996 kern_buffer = (xptr_t)hal_remote_l wd( XPTR( client_cxy , &desc->args[4] ) );2071 kern_buffer = (xptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) ); 1997 2072 1998 2073 error = mapper_move_kernel( mapper, … … 2004 2079 2005 2080 // set output argument to client RPC descriptor 2006 hal_remote_s wd( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error );2081 hal_remote_s64( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error ); 2007 2082 2008 2083 } … … 2046 2121 2047 2122 // get input arguments from client RPC descriptor 2048 mapper_t * mapper = (mapper_t *)(intptr_t)hal_remote_l wd( XPTR( cxy , &desc->args[0] ) );2049 uint32_t index = (uint32_t) hal_remote_l wd( XPTR( cxy , &desc->args[1] ) );2123 mapper_t * mapper = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) ); 2124 uint32_t index = (uint32_t) hal_remote_l64( XPTR( cxy , &desc->args[1] ) ); 2050 2125 2051 2126 // call local pmem allocator … … 2053 2128 2054 2129 // set output arguments into client RPC descriptor 2055 hal_remote_s wd( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );2130 hal_remote_s64( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page ); 2056 2131 2057 2132 } … … 2107 2182 2108 2183 // get input arguments from client RPC descriptor 2109 process_t * process = (process_t *)(intptr_t)hal_remote_l wd( XPTR(cxy , &desc->args[0]));2110 vseg_type_t type = (vseg_type_t)(uint32_t)hal_remote_l wd( XPTR(cxy , &desc->args[1]));2111 intptr_t base = (intptr_t) hal_remote_l wd( XPTR(cxy , &desc->args[2]));2112 uint32_t size = (uint32_t) hal_remote_l wd( XPTR(cxy , &desc->args[3]));2113 uint32_t file_offset = (uint32_t) hal_remote_l wd( XPTR(cxy , &desc->args[4]));2114 uint32_t file_size = (uint32_t) hal_remote_l wd( XPTR(cxy , &desc->args[5]));2115 xptr_t mapper_xp = (xptr_t) hal_remote_l wd( XPTR(cxy , &desc->args[6]));2116 cxy_t vseg_cxy = (cxy_t)(uint32_t) hal_remote_l wd( XPTR(cxy , &desc->args[7]));2184 process_t * process = (process_t *)(intptr_t)hal_remote_l64( XPTR(cxy , &desc->args[0])); 2185 vseg_type_t type = (vseg_type_t)(uint32_t)hal_remote_l64( XPTR(cxy , &desc->args[1])); 2186 intptr_t base = (intptr_t) hal_remote_l64( XPTR(cxy , &desc->args[2])); 2187 uint32_t size = (uint32_t) hal_remote_l64( XPTR(cxy , &desc->args[3])); 2188 uint32_t file_offset = (uint32_t) hal_remote_l64( XPTR(cxy , &desc->args[4])); 2189 uint32_t file_size = (uint32_t) hal_remote_l64( XPTR(cxy , &desc->args[5])); 2190 xptr_t mapper_xp = (xptr_t) hal_remote_l64( XPTR(cxy , &desc->args[6])); 2191 cxy_t vseg_cxy = (cxy_t)(uint32_t) hal_remote_l64( XPTR(cxy , &desc->args[7])); 2117 2192 2118 2193 // call local kernel function … … 2127 2202 2128 2203 // set output arguments into client RPC descriptor 2129 hal_remote_s wd( XPTR( cxy , &desc->args[8] ) , (uint64_t)(intptr_t)vseg );2204 hal_remote_s64( XPTR( cxy , &desc->args[8] ) , (uint64_t)(intptr_t)vseg ); 2130 2205 2131 2206 } … … 2169 2244 2170 2245 // get input arguments from client RPC descriptor 2171 process = (process_t *)(intptr_t)hal_remote_l wd( XPTR(cxy , &desc->args[0]));2246 process = (process_t *)(intptr_t)hal_remote_l64( XPTR(cxy , &desc->args[0])); 2172 2247 2173 2248 // call local kernel function … … 2213 2288 2214 2289 // get input arguments from client RPC descriptor 2215 process = (process_t *)(intptr_t)hal_remote_l wd( XPTR(cxy , &desc->args[0]));2216 detailed = (bool_t) hal_remote_l wd( XPTR(cxy , &desc->args[1]));2290 process = (process_t *)(intptr_t)hal_remote_l64( XPTR(cxy , &desc->args[0])); 2291 detailed = (bool_t) hal_remote_l64( XPTR(cxy , &desc->args[1])); 2217 2292 2218 2293 // call local kernel function
Note: See TracChangeset
for help on using the changeset viewer.