Changeset 641 for trunk/kernel/kern/rpc.c
- Timestamp:
- Oct 10, 2019, 1:42:04 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/rpc.c
r640 r641 349 349 rpc_server[index]( desc_xp ); 350 350 351 // update responses counter 352 responses = hal_remote_atomic_add( rsp_xp , -1 ); 353 351 354 #if DEBUG_RPC_SERVER_GENERIC 352 355 cycle = (uint32_t)hal_get_cycles(); 353 356 if( DEBUG_RPC_SERVER_GENERIC < cycle ) 354 printk("\n[%s] RPC thread[%x,%x] completes rpc %s / client_cxy %x/ cycle %d\n",355 __FUNCTION__, server_ptr->process->pid, server_ptr->trdid, rpc_str[index], desc_cxy, cycle );357 printk("\n[%s] RPC thread[%x,%x] completes rpc %s / responses %d / cycle %d\n", 358 __FUNCTION__, server_ptr->process->pid, server_ptr->trdid, rpc_str[index], responses, cycle ); 356 359 #endif 357 360 // decrement expected responses counter 358 responses = hal_remote_atomic_add( rsp_xp , -1 );359 360 361 // unblock client thread if last response 361 362 if( responses == 1 ) … … 2388 2389 2389 2390 ////////////////////////////////////////////////////////// 2390 void rpc_vmm_resize_vseg_client( cxy_t 2391 struct process_s * process,2392 struct vseg_s * vseg,2393 intptr_t 2394 intptr_t 2391 void rpc_vmm_resize_vseg_client( cxy_t cxy, 2392 pid_t pid, 2393 intptr_t base, 2394 intptr_t new_base, 2395 intptr_t new_size ) 2395 2396 { 2396 2397 #if DEBUG_RPC_VMM_RESIZE_VSEG … … 2411 2412 2412 2413 // set input arguments in RPC descriptor 2413 rpc.args[0] = (uint64_t) (intptr_t)process;2414 rpc.args[1] = (uint64_t) (intptr_t)vseg;2414 rpc.args[0] = (uint64_t)pid; 2415 rpc.args[1] = (uint64_t)base; 2415 2416 rpc.args[2] = (uint64_t)new_base; 2416 2417 rpc.args[3] = (uint64_t)new_size; … … 2438 2439 #endif 2439 2440 2441 pid_t pid; 2440 2442 process_t * process; 2443 intptr_t base; 2441 2444 vseg_t * vseg; 2442 2445 intptr_t new_base; … … 2448 2451 2449 2452 // get arguments from client RPC descriptor 2450 process = (process_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 2451 vseg = (vseg_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 2452 new_base = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) ); 2453 new_size = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) ); 2453 pid = (pid_t) hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 2454 base = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 2455 new_base = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) ); 2456 new_size = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) ); 2457 2458 // get local pointer on target process 2459 process = cluster_get_local_process_from_pid( pid ); 2460 2461 // get target vseg from vaddr 2462 vmm_get_vseg( process , base , &vseg ); 2454 2463 2455 2464 // call relevant kernel function … … 2474 2483 ///////////////////////////////////////////////// 2475 2484 void rpc_vmm_remove_vseg_client( cxy_t cxy, 2476 p rocess_t * process,2477 vseg_t * vseg)2485 pid_t pid, 2486 intptr_t base ) 2478 2487 { 2479 2488 #if DEBUG_RPC_VMM_REMOVE_VSEG … … 2494 2503 2495 2504 // set input arguments in RPC descriptor 2496 rpc.args[0] = (uint64_t) (intptr_t)process;2497 rpc.args[1] = (uint64_t) (intptr_t)vseg;2505 rpc.args[0] = (uint64_t)pid; 2506 rpc.args[1] = (uint64_t)base; 2498 2507 2499 2508 // register RPC request in remote RPC fifo … … 2519 2528 #endif 2520 2529 2530 pid_t pid; 2531 intptr_t vaddr; 2521 2532 process_t * process; 2522 2533 vseg_t * vseg; … … 2527 2538 2528 2539 // get arguments from RPC descriptor 2529 process = (process_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 2530 vseg = (vseg_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 2540 pid = (pid_t) hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 2541 vaddr = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 2542 2543 // get local pointer on target process 2544 process = cluster_get_local_process_from_pid( pid ); 2545 2546 // get target vseg from vaddr 2547 vmm_get_vseg( process , vaddr , &vseg ); 2531 2548 2532 2549 // call relevant kernel function
Note: See TracChangeset
for help on using the changeset viewer.