Ignore:
Timestamp:
Oct 10, 2019, 1:42:04 PM (5 years ago)
Author:
alain
Message:
  • Fix several bugs.
  • Introduce the "stat" command in KSH.

This almos-mkh version sucessfully executed the FFT application
(65536 complex points) on the TSAR architecture from 1 to 64 cores.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/rpc.c

    r640 r641  
    349349                rpc_server[index]( desc_xp );
    350350
     351                // update responses counter
     352                responses = hal_remote_atomic_add( rsp_xp , -1 );
     353
    351354#if DEBUG_RPC_SERVER_GENERIC
    352355cycle = (uint32_t)hal_get_cycles();
    353356if( 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 );
     357printk("\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 );
    356359#endif
    357360                // decrement expected responses counter
    358                 responses = hal_remote_atomic_add( rsp_xp , -1 );
    359 
    360361                // unblock client thread if last response
    361362                if( responses == 1 )
     
    23882389
    23892390//////////////////////////////////////////////////////////
    2390 void rpc_vmm_resize_vseg_client( cxy_t             cxy,
    2391                                  struct process_s * process,
    2392                                  struct vseg_s    * vseg,
    2393                                  intptr_t           new_base,
    2394                                  intptr_t           new_size )
     2391void 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 )
    23952396{
    23962397#if DEBUG_RPC_VMM_RESIZE_VSEG
     
    24112412
    24122413    // 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;
    24152416    rpc.args[2] = (uint64_t)new_base;
    24162417    rpc.args[3] = (uint64_t)new_size;
     
    24382439#endif
    24392440
     2441    pid_t       pid;
    24402442    process_t * process;
     2443    intptr_t    base;
    24412444    vseg_t    * vseg;
    24422445    intptr_t    new_base;
     
    24482451
    24492452    // 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 );
    24542463
    24552464    // call relevant kernel function
     
    24742483/////////////////////////////////////////////////
    24752484void rpc_vmm_remove_vseg_client( cxy_t       cxy,
    2476                                  process_t * process,
    2477                                  vseg_t    * vseg )
     2485                                 pid_t       pid,
     2486                                 intptr_t    base )
    24782487{
    24792488#if DEBUG_RPC_VMM_REMOVE_VSEG
     
    24942503
    24952504    // 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;
    24982507
    24992508    // register RPC request in remote RPC fifo
     
    25192528#endif
    25202529
     2530    pid_t       pid;
     2531    intptr_t    vaddr;
    25212532    process_t * process;
    25222533    vseg_t    * vseg;
     
    25272538
    25282539    // 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 );
    25312548
    25322549    // call relevant kernel function
Note: See TracChangeset for help on using the changeset viewer.