Ignore:
Timestamp:
Nov 1, 2018, 12:10:42 PM (6 years ago)
Author:
alain
Message:

Improve signals.

File:
1 edited

Legend:

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

    r581 r583  
    7272
    7373    &rpc_vmm_get_vseg_server,           // 20
    74     &rpc_vmm_get_pte_server,            // 21
     74    &rpc_vmm_global_update_pte_server,  // 21
    7575    &rpc_kcm_alloc_server,              // 22
    7676    &rpc_kcm_free_server,               // 23
     
    108108
    109109    "GET_VSEG",               // 20
    110     "GET_PTE",                // 21
     110    "GLOBAL_UPDATE_PTE",                // 21
    111111    "KCM_ALLOC",              // 22
    112112    "KCM_FREE",               // 23
     
    126126
    127127/***************************************************************************************/
    128 /************ Generic functions supporting RPCs : client side **************************/
     128/************ Generic function supporting RPCs : client side ***************************/
    129129/***************************************************************************************/
    130130
     
    145145    // RPCs executed by the IDLE thread during kernel_init do not deschedule
    146146    if( this->type != THREAD_IDLE ) thread_assert_can_yield( this , __FUNCTION__ );
    147 
    148 #if DEBUG_RPC_CLIENT_GENERIC
    149 uint32_t cycle = (uint32_t)hal_get_cycles();
    150 if( DEBUG_RPC_CLIENT_GENERIC < 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 );
    153 #endif
    154147
    155148    // select a server_core : use client core index if possible / core 0 otherwise
     
    163156    }
    164157
    165     // register client_thread pointer and client_core lid in RPC descriptor
     158    // register client_thread and client_core in RPC descriptor
    166159    rpc->thread = this;
    167160    rpc->lid    = client_core_lid;
     
    193186
    194187#if DEBUG_RPC_CLIENT_GENERIC
    195 cycle = (uint32_t)hal_get_cycles();
     188uint32_t cycle = (uint32_t)hal_get_cycles();
    196189uint32_t items = remote_fifo_items( rpc_fifo_xp );
    197190if( DEBUG_RPC_CLIENT_GENERIC < 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 );
     191printk("\n[DBG] %s : thread %x in process %x / rpc %s / server[%x,%d] / items %d / cycle %d\n",
     192__FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index],
     193server_cxy, server_core_lid, items, cycle );
    200194#endif
    201195       
     
    17521746
    17531747/////////////////////////////////////////////////////////////////////////////////////////
    1754 // [21]          Marshaling functions attached to RPC_VMM_GET_PTE  (blocking)
    1755 /////////////////////////////////////////////////////////////////////////////////////////
    1756 
    1757 ////////////////////////////////////////////
    1758 void rpc_vmm_get_pte_client( cxy_t       cxy,   
    1759                              process_t * process,  // in
    1760                              vpn_t       vpn,      // in
    1761                              bool_t      cow,      // in
    1762                              uint32_t  * attr,     // out
    1763                              ppn_t     * ppn,      // out
    1764                              error_t   * error )   // out
    1765 {
    1766 #if DEBUG_RPC_VMM_GET_PTE
    1767 thread_t * this = CURRENT_THREAD;
    1768 uint32_t cycle = (uint32_t)hal_get_cycles();
    1769 if( cycle > DEBUG_RPC_VMM_GET_PTE )
     1748// [21]    Marshaling functions attached to RPC_VMM_GLOBAL_UPDATE_PTE  (blocking)
     1749/////////////////////////////////////////////////////////////////////////////////////////
     1750
     1751///////////////////////////////////////////////////////
     1752void rpc_vmm_global_update_pte_client( cxy_t       cxy,   
     1753                                       process_t * process,  // in
     1754                                       vpn_t       vpn,      // in
     1755                                       uint32_t    attr,     // in
     1756                                       ppn_t       ppn )     // in
     1757{
     1758#if DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE
     1759thread_t * this = CURRENT_THREAD;
     1760uint32_t cycle = (uint32_t)hal_get_cycles();
     1761if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE )
    17701762printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    17711763__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     
    17761768    // initialise RPC descriptor header
    17771769    rpc_desc_t  rpc;
    1778     rpc.index    = RPC_VMM_GET_PTE;
     1770    rpc.index    = RPC_VMM_GLOBAL_UPDATE_PTE;
    17791771    rpc.blocking = true;
    17801772    rpc.responses = 1;
     
    17831775    rpc.args[0] = (uint64_t)(intptr_t)process;
    17841776    rpc.args[1] = (uint64_t)vpn;
    1785     rpc.args[2] = (uint64_t)cow;
     1777    rpc.args[2] = (uint64_t)attr;
     1778    rpc.args[3] = (uint64_t)ppn;
    17861779
    17871780    // register RPC request in remote RPC fifo
    17881781    rpc_send( cxy , &rpc );
    17891782
    1790     // get output argument from rpc descriptor
    1791     *attr  = (uint32_t)rpc.args[3];
    1792     *ppn   = (ppn_t)rpc.args[4];
    1793     *error = (error_t)rpc.args[5];
    1794 
    1795 #if DEBUG_RPC_VMM_GET_PTE
    1796 cycle = (uint32_t)hal_get_cycles();
    1797 if( cycle > DEBUG_RPC_VMM_GET_PTE )
    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 );
    1800 #endif
    1801 }
    1802 
    1803 ////////////////////////////////////////
    1804 void rpc_vmm_get_pte_server( xptr_t xp )
    1805 {
    1806 #if DEBUG_RPC_VMM_GET_PTE
    1807 thread_t * this = CURRENT_THREAD;
    1808 uint32_t cycle = (uint32_t)hal_get_cycles();
    1809 if( cycle > DEBUG_RPC_VMM_GET_PTE )
     1783#if DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE
     1784cycle = (uint32_t)hal_get_cycles();
     1785if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE )
     1786printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1787__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1788#endif
     1789}
     1790
     1791//////////////////////////////////////////////////
     1792void rpc_vmm_global_update_pte_server( xptr_t xp )
     1793{
     1794#if DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE
     1795thread_t * this = CURRENT_THREAD;
     1796uint32_t cycle = (uint32_t)hal_get_cycles();
     1797if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE )
    18101798printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    18111799__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     
    18141802    process_t   * process;
    18151803    vpn_t         vpn;
    1816     bool_t        cow;
    18171804    uint32_t      attr;
    18181805    ppn_t         ppn;
    1819     error_t       error;
    18201806
    18211807    // get client cluster identifier and pointer on RPC descriptor
     
    18261812    process = (process_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    18271813    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] ) );
     1814    attr    = (uint32_t)             hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
     1815    ppn     = (ppn_t)                hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
    18291816   
    18301817    // call local kernel function
    1831     error = vmm_get_pte( process , vpn , cow , &attr , &ppn );
    1832 
    1833     // set output argument "attr" & "ppn" to client RPC descriptor
    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 );
    1837 
    1838 #if DEBUG_RPC_VMM_GET_PTE
    1839 cycle = (uint32_t)hal_get_cycles();
    1840 if( cycle > DEBUG_RPC_VMM_GET_PTE )
     1818    vmm_global_update_pte( process , vpn , attr , ppn );
     1819
     1820#if DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE
     1821cycle = (uint32_t)hal_get_cycles();
     1822if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE )
    18411823printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    18421824__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
Note: See TracChangeset for help on using the changeset viewer.