Ignore:
Timestamp:
Dec 3, 2018, 12:15:01 PM (6 years ago)
Author:
alain
Message:

Improve the FAT32 file system to support cat, rm, cp commands.

File:
1 edited

Legend:

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

    r591 r601  
    4949rpc_server_t * rpc_server[RPC_MAX_INDEX] =
    5050{
    51     &rpc_pmem_get_pages_server,         // 0
    52     &rpc_pmem_release_pages_server,     // 1
    53     &rpc_undefined,                     // 2    unused slot
    54     &rpc_process_make_fork_server,      // 3
    55     &rpc_undefined,                     // 4    unused slot
    56     &rpc_undefined,                     // 5    unused slot
    57     &rpc_thread_user_create_server,     // 6
    58     &rpc_thread_kernel_create_server,   // 7
    59     &rpc_undefined,                     // 8    unused slot       
    60     &rpc_process_sigaction_server,      // 9
    61 
    62     &rpc_vfs_inode_create_server,       // 10 
    63     &rpc_vfs_inode_destroy_server,      // 11 
    64     &rpc_vfs_dentry_create_server,      // 12 
    65     &rpc_vfs_dentry_destroy_server,     // 13 
    66     &rpc_vfs_file_create_server,        // 14
    67     &rpc_vfs_file_destroy_server,       // 15
    68     &rpc_vfs_inode_load_server,         // 16
    69     &rpc_vfs_mapper_load_all_server,    // 17
    70     &rpc_fatfs_get_cluster_server,      // 18
    71     &rpc_undefined,                     // 19   unused slot
    72 
    73     &rpc_vmm_get_vseg_server,           // 20
    74     &rpc_vmm_global_update_pte_server,  // 21
    75     &rpc_kcm_alloc_server,              // 22
    76     &rpc_kcm_free_server,               // 23
    77     &rpc_mapper_move_buffer_server,     // 24
    78     &rpc_mapper_get_page_server,        // 25
    79     &rpc_vmm_create_vseg_server,        // 26
    80     &rpc_undefined,                     // 27   unused slot
    81     &rpc_vmm_set_cow_server,            // 28
    82     &rpc_vmm_display_server,            // 29
     51    &rpc_pmem_get_pages_server,            // 0
     52    &rpc_pmem_release_pages_server,        // 1
     53    &rpc_undefined,                        // 2    unused slot
     54    &rpc_process_make_fork_server,         // 3
     55    &rpc_undefined,                        // 4    unused slot
     56    &rpc_undefined,                        // 5    unused slot
     57    &rpc_thread_user_create_server,        // 6
     58    &rpc_thread_kernel_create_server,      // 7
     59    &rpc_undefined,                        // 8    unused slot       
     60    &rpc_process_sigaction_server,         // 9
     61
     62    &rpc_vfs_inode_create_server,          // 10 
     63    &rpc_vfs_inode_destroy_server,         // 11 
     64    &rpc_vfs_dentry_create_server,         // 12 
     65    &rpc_vfs_dentry_destroy_server,        // 13 
     66    &rpc_vfs_file_create_server,           // 14
     67    &rpc_vfs_file_destroy_server,          // 15
     68    &rpc_vfs_fs_child_init_server,         // 16
     69    &rpc_vfs_fs_add_dentry_server,         // 17
     70    &rpc_vfs_fs_remove_dentry_server,      // 18
     71    &rpc_vfs_inode_load_all_pages_server,  // 19
     72
     73    &rpc_vmm_get_vseg_server,              // 20
     74    &rpc_vmm_global_update_pte_server,     // 21
     75    &rpc_kcm_alloc_server,                 // 22
     76    &rpc_kcm_free_server,                  // 23
     77    &rpc_mapper_move_user_server,          // 24
     78    &rpc_mapper_handle_miss_server,        // 25
     79    &rpc_undefined,                        // 26   unused slot
     80    &rpc_vmm_create_vseg_server,           // 27
     81    &rpc_vmm_set_cow_server,               // 28
     82    &rpc_vmm_display_server,               // 29
    8383};
    8484
    8585char * rpc_str[RPC_MAX_INDEX] =
    8686{
    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     "GLOBAL_UPDATE_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
     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_FS_CHILD_INIT",         // 16
     105    "VFS_FS_ADD_DENTRY",         // 17
     106    "VFS_FS_REMOVE_DENTRY",      // 18
     107    "VFS_INODE_LOAD_ALL_PAGES",  // 19
     108
     109    "GET_VSEG",                  // 20
     110    "GLOBAL_UPDATE_PTE",         // 21
     111    "KCM_ALLOC",                 // 22
     112    "KCM_FREE",                  // 23
     113    "MAPPER_MOVE_USER",          // 24
     114    "MAPPER_HANDLE_MISS",        // 25
     115    "undefined",                 // 26
     116    "VMM_CREATE_VSEG",           // 27
     117    "VMM_SET_COW",               // 28
     118    "VMM_DISPLAY",               // 29
    119119};
    120120
     
    189189uint32_t items = remote_fifo_items( rpc_fifo_xp );
    190190if( DEBUG_RPC_CLIENT_GENERIC < cycle )
    191 printk("\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],
     191printk("\n[%s] thread[%x,%x] / rpc %s / server[%x,%d] / items %d / cycle %d\n",
     192__FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index],
    193193server_cxy, server_core_lid, items, cycle );
    194194#endif
     
    208208cycle = (uint32_t)hal_get_cycles();
    209209if( DEBUG_RPC_CLIENT_GENERIC < cycle )
    210 printk("\n[DBG] %s : thread %x in process %x enter waiting loop for rpc %s / cycle %d\n",
    211 __FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle );
     210printk("\n[%s] thread[%x,%x] enter waiting loop for rpc %s / cycle %d\n",
     211__FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle );
    212212#endif
    213213
     
    217217cycle = (uint32_t)hal_get_cycles();
    218218if( DEBUG_RPC_CLIENT_GENERIC < cycle )
    219 printk("\n[DBG] %s : thread %x in process %x received response for rpc %s / cycle %d\n",
    220 __FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle );
     219printk("\n[%s] thread[%x,%x] received response for rpc %s / cycle %d\n",
     220__FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle );
    221221#endif
    222222 
     
    228228cycle = (uint32_t)hal_get_cycles();
    229229if( DEBUG_RPC_CLIENT_GENERIC < cycle )
    230 printk("\n[DBG] %s : thread %x in process %x blocks & deschedules for rpc %s / cycle %d\n",
    231 __FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle );
     230printk("\n[%s] thread[%x,%x] blocks & deschedules for rpc %s / cycle %d\n",
     231__FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle );
    232232#endif
    233233
     
    241241cycle = (uint32_t)hal_get_cycles();
    242242if( DEBUG_RPC_CLIENT_GENERIC < cycle )
    243 printk("\n[DBG] %s : thread %x in process %x resumes for rpc %s / cycle %d\n",
    244 __FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle );
     243printk("\n[%s] thread[%x,%x] resumes for rpc %s / cycle %d\n",
     244__FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle );
    245245#endif
    246246        }
     
    256256cycle = (uint32_t)hal_get_cycles();
    257257if( DEBUG_RPC_CLIENT_GENERIC < cycle )
    258 printk("\n[DBG] %s : thread %x in process %x returns for non blocking rpc %s / cycle %d\n",
    259 __FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle );
     258printk("\n[%s] thread[%x,%x] returns for non blocking rpc %s / cycle %d\n",
     259__FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle );
    260260#endif
    261261
     
    417417uint32_t cycle = (uint32_t)hal_get_cycles();
    418418if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
    419 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    420 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     419printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     420__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    421421#endif
    422422
     
    441441cycle = (uint32_t)hal_get_cycles();
    442442if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
    443 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    444 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     443printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     444__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    445445#endif
    446446}
     
    453453uint32_t cycle = (uint32_t)hal_get_cycles();
    454454if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
    455 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    456 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     455printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     456__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    457457#endif
    458458
     
    473473cycle = (uint32_t)hal_get_cycles();
    474474if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
    475 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    476 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     475printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     476__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    477477#endif
    478478}
     
    490490uint32_t cycle = (uint32_t)hal_get_cycles();
    491491if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
    492 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    493 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     492printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     493__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    494494#endif
    495495
     
    511511cycle = (uint32_t)hal_get_cycles();
    512512if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
    513 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    514 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     513printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     514__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    515515#endif
    516516}
     
    523523uint32_t cycle = (uint32_t)hal_get_cycles();
    524524if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
    525 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    526 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     525printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     526__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    527527#endif
    528528
     
    543543cycle = (uint32_t)hal_get_cycles();
    544544if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
    545 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    546 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     545printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     546__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    547547#endif
    548548}
     
    568568uint32_t cycle = (uint32_t)hal_get_cycles();
    569569if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK )
    570 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    571 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     570printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     571__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    572572#endif
    573573
     
    595595cycle = (uint32_t)hal_get_cycles();
    596596if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK )
    597 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    598 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     597printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     598__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    599599#endif
    600600}
     
    607607uint32_t cycle = (uint32_t)hal_get_cycles();
    608608if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK )
    609 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    610 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     609printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     610__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    611611#endif
    612612
     
    639639cycle = (uint32_t)hal_get_cycles();
    640640if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK )
    641 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    642 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     641printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     642__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    643643#endif
    644644}
     
    669669uint32_t cycle = (uint32_t)hal_get_cycles();
    670670if( cycle > DEBUG_RPC_THREAD_USER_CREATE)
    671 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    672 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     671printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     672__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    673673#endif
    674674
     
    697697cycle = (uint32_t)hal_get_cycles();
    698698if( cycle > DEBUG_RPC_THREAD_USER_CREATE)
    699 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    700 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     699printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     700__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    701701#endif
    702702}
     
    709709uint32_t cycle = (uint32_t)hal_get_cycles();
    710710if( cycle > DEBUG_RPC_THREAD_USER_CREATE)
    711 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    712 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     711printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     712__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    713713#endif
    714714
     
    755755cycle = (uint32_t)hal_get_cycles();
    756756if( cycle > DEBUG_RPC_THREAD_USER_CREATE)
    757 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    758 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     757printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     758__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    759759#endif
    760760}
     
    776776uint32_t cycle = (uint32_t)hal_get_cycles();
    777777if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE)
    778 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    779 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     778printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     779__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    780780#endif
    781781
     
    803803cycle = (uint32_t)hal_get_cycles();
    804804if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE)
    805 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    806 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     805printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     806__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    807807#endif
    808808}
     
    815815uint32_t cycle = (uint32_t)hal_get_cycles();
    816816if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE)
    817 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    818 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     817printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     818__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    819819#endif
    820820
     
    847847cycle = (uint32_t)hal_get_cycles();
    848848if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE)
    849 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    850 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     849printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     850__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    851851#endif
    852852}
     
    969969                                  uint32_t       fs_type,    // in
    970970                                  uint32_t       inode_type, // in
    971                                   void         * extend,     // in
    972971                                  uint32_t       attr,       // in
    973972                                  uint32_t       rights,     // in
     
    981980uint32_t cycle = (uint32_t)hal_get_cycles();
    982981if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
    983 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    984 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     982printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     983__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    985984#endif
    986985
     
    997996    rpc.args[1] = (uint64_t)fs_type;
    998997    rpc.args[2] = (uint64_t)inode_type;
    999     rpc.args[3] = (uint64_t)(intptr_t)extend;
    1000     rpc.args[4] = (uint64_t)attr;
    1001     rpc.args[5] = (uint64_t)rights;
    1002     rpc.args[6] = (uint64_t)uid;
    1003     rpc.args[7] = (uint64_t)gid;
     998    rpc.args[3] = (uint64_t)attr;
     999    rpc.args[4] = (uint64_t)rights;
     1000    rpc.args[5] = (uint64_t)uid;
     1001    rpc.args[6] = (uint64_t)gid;
    10041002
    10051003    // register RPC request in remote RPC fifo
     
    10071005
    10081006    // get output values from RPC descriptor
    1009     *inode_xp = (xptr_t)rpc.args[8];
    1010     *error    = (error_t)rpc.args[9];
     1007    *inode_xp = (xptr_t)rpc.args[7];
     1008    *error    = (error_t)rpc.args[8];
    10111009
    10121010#if DEBUG_RPC_VFS_INODE_CREATE
    10131011cycle = (uint32_t)hal_get_cycles();
    10141012if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
    1015 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1016 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1013printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1014__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    10171015#endif
    10181016}
     
    10251023uint32_t cycle = (uint32_t)hal_get_cycles();
    10261024if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
    1027 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1028 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1025printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1026__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    10291027#endif
    10301028
     
    10321030    uint32_t         fs_type;
    10331031    uint32_t         inode_type;
    1034     void           * extend;
    10351032    uint32_t         attr;
    10361033    uint32_t         rights;
     
    10451042
    10461043    // get input arguments from client rpc descriptor
    1047     dentry_xp  = (xptr_t)          hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    1048     fs_type    = (uint32_t)        hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
    1049     inode_type = (uint32_t)        hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
    1050     extend     = (void *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
    1051     attr       = (uint32_t)        hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) );
    1052     rights     = (uint32_t)        hal_remote_l64( XPTR( client_cxy , &desc->args[5] ) );
    1053     uid        = (uid_t)           hal_remote_l64( XPTR( client_cxy , &desc->args[6] ) );
    1054     gid        = (gid_t)           hal_remote_l64( XPTR( client_cxy , &desc->args[7] ) );
     1044    dentry_xp  = (xptr_t)    hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     1045    fs_type    = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
     1046    inode_type = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
     1047    attr       = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
     1048    rights     = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) );
     1049    uid        = (uid_t)     hal_remote_l64( XPTR( client_cxy , &desc->args[5] ) );
     1050    gid        = (gid_t)     hal_remote_l64( XPTR( client_cxy , &desc->args[6] ) );
    10551051
    10561052    // call local kernel function
     
    10581054                              fs_type,
    10591055                              inode_type,
    1060                               extend,
    10611056                              attr,
    10621057                              rights,
     
    10661061
    10671062    // set output arguments
    1068     hal_remote_s64( XPTR( client_cxy , &desc->args[8] ) , (uint64_t)inode_xp );
    1069     hal_remote_s64( XPTR( client_cxy , &desc->args[9] ) , (uint64_t)error );
     1063    hal_remote_s64( XPTR( client_cxy , &desc->args[7] ) , (uint64_t)inode_xp );
     1064    hal_remote_s64( XPTR( client_cxy , &desc->args[8] ) , (uint64_t)error );
    10701065
    10711066#if DEBUG_RPC_VFS_INODE_CREATE
    10721067cycle = (uint32_t)hal_get_cycles();
    10731068if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
    1074 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1075 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1069printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1070__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    10761071#endif
    10771072}
     
    10831078/////////////////////////////////////////////////////////////
    10841079void rpc_vfs_inode_destroy_client( cxy_t                cxy,
    1085                                    struct vfs_inode_s * inode,
    1086                                    error_t            * error )
     1080                                   struct vfs_inode_s * inode )
    10871081{
    10881082#if DEBUG_RPC_VFS_INODE_DESTROY
     
    10901084uint32_t cycle = (uint32_t)hal_get_cycles();
    10911085if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
    1092 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1093 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1086printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1087__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    10941088#endif
    10951089
     
    11081102    rpc_send( cxy , &rpc );
    11091103
    1110     // get output argument from RPC descriptor
    1111     *error = (error_t)rpc.args[1];
    1112 
    11131104#if DEBUG_RPC_VFS_INODE_DESTROY
    11141105cycle = (uint32_t)hal_get_cycles();
    11151106if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
    1116 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1117 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1107printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1108__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    11181109#endif
    11191110}
     
    11261117uint32_t cycle = (uint32_t)hal_get_cycles();
    11271118if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
    1128 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1129 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1119printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1120__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    11301121#endif
    11311122
    11321123    vfs_inode_t * inode;
    1133     error_t       error;
    11341124
    11351125    // get client cluster identifier and pointer on RPC descriptor
     
    11371127    rpc_desc_t * desc        = GET_PTR( xp );
    11381128
    1139     // get arguments "inode" from client RPC descriptor
     1129    // get argument "inode" from client RPC descriptor
    11401130    inode = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    11411131                       
    11421132    // call local kernel function
    1143     error = vfs_inode_destroy( inode );
    1144 
    1145     // set output argument
    1146     hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
     1133    vfs_inode_destroy( inode );
    11471134
    11481135#if DEBUG_RPC_VFS_INODE_DESTROY
    11491136cycle = (uint32_t)hal_get_cycles();
    11501137if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
    1151 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1152 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1138printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1139__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    11531140#endif
    11541141}
     
    11701157uint32_t cycle = (uint32_t)hal_get_cycles();
    11711158if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
    1172 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1173 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1159printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1160__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    11741161#endif
    11751162
     
    11971184cycle = (uint32_t)hal_get_cycles();
    11981185if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
    1199 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1200 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1186printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1187__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    12011188#endif
    12021189}
     
    12091196uint32_t cycle = (uint32_t)hal_get_cycles();
    12101197if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
    1211 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1212 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1198printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1199__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    12131200#endif
    12141201
     
    12451232cycle = (uint32_t)hal_get_cycles();
    12461233if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
    1247 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1248 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1234printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1235__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    12491236#endif
    12501237}
     
    12561243///////////////////////////////////////////////////////
    12571244void rpc_vfs_dentry_destroy_client( cxy_t          cxy,
    1258                                     vfs_dentry_t * dentry,
    1259                                     error_t      * error )
     1245                                    vfs_dentry_t * dentry )
    12601246{
    12611247#if DEBUG_RPC_VFS_DENTRY_DESTROY
     
    12631249uint32_t cycle = (uint32_t)hal_get_cycles();
    12641250if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
    1265 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1266 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1251printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1252__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    12671253#endif
    12681254
     
    12811267    rpc_send( cxy , &rpc );
    12821268
    1283     // get output argument from RPC descriptor
    1284     *error = (error_t)rpc.args[1];
    1285 
    12861269#if DEBUG_RPC_VFS_DENTRY_DESTROY
    12871270cycle = (uint32_t)hal_get_cycles();
    12881271if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
    1289 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1290 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1272printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1273__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    12911274#endif
    12921275}
     
    12991282uint32_t cycle = (uint32_t)hal_get_cycles();
    13001283if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
    1301 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1302 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1284printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1285__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    13031286#endif
    13041287
    13051288    vfs_dentry_t * dentry;
    1306     error_t        error;
    13071289
    13081290    // get client cluster identifier and pointer on RPC descriptor
     
    13141296                       
    13151297    // call local kernel function
    1316     error = vfs_dentry_destroy( dentry );
    1317 
    1318     // set output argument
    1319     hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
     1298    vfs_dentry_destroy( dentry );
    13201299
    13211300#if DEBUG_RPC_VFS_DENTRY_DESTROY
    13221301cycle = (uint32_t)hal_get_cycles();
    13231302if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
    1324 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1325 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1303printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1304__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    13261305#endif
    13271306}
     
    13431322uint32_t cycle = (uint32_t)hal_get_cycles();
    13441323if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
    1345 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1346 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1324printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1325__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    13471326#endif
    13481327
     
    13691348cycle = (uint32_t)hal_get_cycles();
    13701349if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
    1371 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1372 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1350printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1351__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    13731352#endif
    13741353}
     
    13811360uint32_t cycle = (uint32_t)hal_get_cycles();
    13821361if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
    1383 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1384 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1362printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1363__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    13851364#endif
    13861365
     
    14101389cycle = (uint32_t)hal_get_cycles();
    14111390if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
    1412 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1413 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1391printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1392__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    14141393#endif
    14151394}
     
    14271406uint32_t cycle = (uint32_t)hal_get_cycles();
    14281407if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
    1429 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1430 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1408printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1409__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    14311410#endif
    14321411
     
    14481427cycle = (uint32_t)hal_get_cycles();
    14491428if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
    1450 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1451 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     1429printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1430__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    14521431#endif
    14531432}
     
    14601439uint32_t cycle = (uint32_t)hal_get_cycles();
    14611440if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
    1462 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1463 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1441printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1442__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    14641443#endif
    14651444
     
    14791458cycle = (uint32_t)hal_get_cycles();
    14801459if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
    1481 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1482 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    1483 #endif
    1484 }
    1485 
    1486 /////////////////////////////////////////////////////////////////////////////////////////
    1487 // [16]          Marshaling functions attached to RPC_VFS_INODE_LOAD   (blocking)
    1488 /////////////////////////////////////////////////////////////////////////////////////////
    1489 
    1490 //////////////////////////////////////////////////
    1491 void rpc_vfs_inode_load_client( cxy_t         cxy,
    1492                                 vfs_inode_t * parent_inode,    // in
    1493                                 char        * name,            // in
    1494                                 xptr_t        child_inode_xp,  // in
    1495                                 error_t     * error )          // out
    1496 {
     1460printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1461__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1462#endif
     1463}
     1464
     1465/////////////////////////////////////////////////////////////////////////////////////////
     1466// [16]      Marshaling functions attached to RPC_VFS_FS_CHILD_INIT  (blocking)
     1467/////////////////////////////////////////////////////////////////////////////////////////
     1468
     1469/////////////////////////////////////////////////////////
     1470void rpc_vfs_fs_child_init_client( cxy_t         cxy,
     1471                                   vfs_inode_t * parent_inode,    // in
     1472                                   char        * name,            // in
     1473                                   xptr_t        child_inode_xp,  // in
     1474                                   error_t     * error )          // out
     1475{
     1476#if DEBUG_RPC_VFS_FS_CHILD_INIT
     1477thread_t * this = CURRENT_THREAD;
     1478uint32_t cycle = (uint32_t)hal_get_cycles();
     1479if( cycle > DEBUG_RPC_VFS_FS_CHILD_INIT )
     1480printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1481__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1482#endif
     1483
    14971484    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    14981485
    14991486    // initialise RPC descriptor header
    15001487    rpc_desc_t  rpc;
    1501     rpc.index    = RPC_VFS_INODE_LOAD;
     1488    rpc.index    = RPC_VFS_FS_CHILD_INIT;
    15021489    rpc.blocking = true;
    15031490    rpc.responses = 1;
     
    15141501    *error   = (error_t)rpc.args[3];
    15151502
    1516 }
    1517 
    1518 ///////////////////////////////////////////
    1519 void rpc_vfs_inode_load_server( xptr_t xp )
    1520 {
     1503#if DEBUG_RPC_VFS_FS_CHILD_INIT
     1504cycle = (uint32_t)hal_get_cycles();
     1505if( cycle > DEBUG_RPC_VFS_FS_CHILD_INIT )
     1506printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1507__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1508#endif
     1509}
     1510
     1511//////////////////////////////////////////////
     1512void rpc_vfs_fs_child_init_server( xptr_t xp )
     1513{
     1514#if DEBUG_RPC_VFS_FS_CHILD_INIT
     1515thread_t * this = CURRENT_THREAD;
     1516uint32_t cycle = (uint32_t)hal_get_cycles();
     1517if( cycle > DEBUG_RPC_VFS_FS_CHILD_INIT )
     1518printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1519__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1520#endif
     1521
    15211522    error_t       error;
    15221523    vfs_inode_t * parent;
     
    15401541
    15411542    // call the kernel function
    1542     error = vfs_inode_load( parent , name_copy , child_xp );
     1543    error = vfs_fs_child_init( parent , name_copy , child_xp );
    15431544
    15441545    // set output argument
    15451546    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    15461547
    1547 }
    1548 
    1549 /////////////////////////////////////////////////////////////////////////////////////////
    1550 // [17]          Marshaling functions attached to RPC_VFS_MAPPER_LOAD_ALL  (blocking)
    1551 /////////////////////////////////////////////////////////////////////////////////////////
    1552 
    1553 ///////////////////////////////////////////////////////
    1554 void rpc_vfs_mapper_load_all_client( cxy_t         cxy,
    1555                                      vfs_inode_t * inode,      // in
    1556                                      error_t     * error )     // out
    1557 {
     1548#if DEBUG_RPC_VFS_FS_CHILD_INIT
     1549cycle = (uint32_t)hal_get_cycles();
     1550if( cycle > DEBUG_RPC_VFS_FS_CHILD_INIT )
     1551printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1552__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1553#endif
     1554}
     1555
     1556/////////////////////////////////////////////////////////////////////////////////////////
     1557// [17]      Marshaling function attached to RPC_VFS_FS_ADD_DENTRY  (blocking)
     1558/////////////////////////////////////////////////////////////////////////////////////////
     1559
     1560void rpc_vfs_fs_add_dentry_client( cxy_t          cxy,
     1561                                   vfs_inode_t  * parent,     // in
     1562                                   vfs_dentry_t * dentry,     // in
     1563                                   error_t      * error )     // out
     1564{
     1565#if DEBUG_RPC_VFS_FS_ADD_DENTRY
     1566thread_t * this = CURRENT_THREAD;
     1567uint32_t cycle = (uint32_t)hal_get_cycles();
     1568if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
     1569printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1570__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1571#endif
     1572
    15581573    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    15591574
    15601575    // initialise RPC descriptor header
    15611576    rpc_desc_t  rpc;
    1562     rpc.index    = RPC_VFS_MAPPER_LOAD_ALL;
     1577    rpc.index    = RPC_VFS_FS_ADD_DENTRY;
    15631578    rpc.blocking = true;
    15641579    rpc.responses = 1;
    15651580
    15661581    // set input arguments in RPC descriptor
    1567     rpc.args[0] = (uint64_t)(intptr_t)inode;
     1582    rpc.args[0] = (uint64_t)(intptr_t)parent;
     1583    rpc.args[1] = (uint64_t)(intptr_t)dentry;
    15681584
    15691585    // register RPC request in remote RPC fifo
     
    15711587
    15721588    // get output values from RPC descriptor
    1573     *error   = (error_t)rpc.args[1];
    1574 
    1575 }
    1576 
    1577 ////////////////////////////////////////////////
    1578 void rpc_vfs_mapper_load_all_server( xptr_t xp )
    1579 {
    1580     error_t       error;
    1581     vfs_inode_t * inode;
     1589    *error   = (error_t)rpc.args[2];
     1590
     1591#if DEBUG_RPC_VFS_FS_ADD_DENTRY
     1592cycle = (uint32_t)hal_get_cycles();
     1593if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
     1594printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1595__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1596#endif
     1597}
     1598
     1599/////////////////////////////////////////////////
     1600void rpc_vfs_fs_add_dentry_server( xptr_t xp )
     1601{
     1602#if DEBUG_RPC_VFS_FS_ADD_DENTRY
     1603thread_t * this = CURRENT_THREAD;
     1604uint32_t cycle = (uint32_t)hal_get_cycles();
     1605if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
     1606printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1607__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1608#endif
     1609
     1610    error_t        error;
     1611    vfs_inode_t  * parent;
     1612    vfs_dentry_t * dentry;
    15821613
    15831614    // get client cluster identifier and pointer on RPC descriptor
     
    15851616    rpc_desc_t * desc        = GET_PTR( xp );
    15861617
    1587     // get arguments "parent", "name", and "child_xp"
    1588     inode = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     1618    // get input arguments
     1619    parent = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     1620    dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
    15891621
    15901622    // call the kernel function
    1591     error = vfs_mapper_load_all( inode );
     1623    error = vfs_fs_add_dentry( parent , dentry );
    15921624
    15931625    // set output argument
    1594     hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
    1595 
    1596 }
    1597 
    1598 /////////////////////////////////////////////////////////////////////////////////////////
    1599 // [18]          Marshaling functions attached to RPC_FATFS_GET_CLUSTER  (blocking)
    1600 /////////////////////////////////////////////////////////////////////////////////////////
    1601 
    1602 //////////////////////////////////////////////////
    1603 void rpc_fatfs_get_cluster_client( cxy_t      cxy,
    1604                                    mapper_t * mapper,    // in
    1605                                    uint32_t   first,     // in
    1606                                    uint32_t   index,     // in
    1607                                    uint32_t * cluster,   // out
    1608                                    error_t  * error )    // out
    1609 {
     1626    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)error );
     1627
     1628#if DEBUG_RPC_VFS_FS_ADD_DENTRY
     1629cycle = (uint32_t)hal_get_cycles();
     1630if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
     1631printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1632__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1633#endif
     1634}
     1635
     1636/////////////////////////////////////////////////////////////////////////////////////////
     1637// [18]      Marshaling function attached to RPC_VFS_FS_REMOVE_DENTRY  (blocking)
     1638/////////////////////////////////////////////////////////////////////////////////////////
     1639
     1640void rpc_vfs_fs_remove_dentry_client( cxy_t          cxy,
     1641                                      vfs_inode_t  * parent,     // in
     1642                                      vfs_dentry_t * dentry,     // in
     1643                                      error_t      * error )     // out
     1644{
     1645#if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
     1646thread_t * this = CURRENT_THREAD;
     1647uint32_t cycle = (uint32_t)hal_get_cycles();
     1648if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
     1649printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1650__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1651#endif
     1652
    16101653    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    16111654
    16121655    // initialise RPC descriptor header
    16131656    rpc_desc_t  rpc;
    1614     rpc.index    = RPC_FATFS_GET_CLUSTER;
     1657    rpc.index    = RPC_VFS_FS_REMOVE_DENTRY;
    16151658    rpc.blocking = true;
    16161659    rpc.responses = 1;
    16171660
    16181661    // set input arguments in RPC descriptor
    1619     rpc.args[0] = (uint64_t)(intptr_t)mapper;
    1620     rpc.args[1] = (uint64_t)first;
    1621     rpc.args[2] = (uint64_t)index;
    1622 
    1623     // register RPC request in remote RPC fifo
     1662    rpc.args[0] = (uint64_t)(intptr_t)parent;
     1663    rpc.args[1] = (uint64_t)(intptr_t)dentry;
     1664
     1665    // register RPC request in remote RPC fifo
    16241666    rpc_send( cxy , &rpc );
    16251667
    1626     // get output argument from rpc descriptor
    1627     *cluster = (uint32_t)rpc.args[3];
    1628     *error   = (error_t)rpc.args[4];
    1629 
    1630 }
    1631 
    1632 //////////////////////////////////////////////
    1633 void rpc_fatfs_get_cluster_server( xptr_t xp )
    1634 {
    1635     mapper_t    * mapper;
    1636     uint32_t      first;
    1637     uint32_t      index;
    1638     uint32_t      cluster;
    1639     error_t       error;
     1668    // get output values from RPC descriptor
     1669    *error   = (error_t)rpc.args[2];
     1670
     1671#if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
     1672cycle = (uint32_t)hal_get_cycles();
     1673if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
     1674printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1675__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1676#endif
     1677}
     1678
     1679/////////////////////////////////////////////////
     1680void rpc_vfs_fs_remove_dentry_server( xptr_t xp )
     1681{
     1682#if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
     1683thread_t * this = CURRENT_THREAD;
     1684uint32_t cycle = (uint32_t)hal_get_cycles();
     1685if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
     1686printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1687__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1688#endif
     1689
     1690    error_t        error;
     1691    vfs_inode_t  * parent;
     1692    vfs_dentry_t * dentry;
    16401693
    16411694    // get client cluster identifier and pointer on RPC descriptor
     
    16441697
    16451698    // get input arguments
    1646     mapper = (mapper_t *)(intptr_t)hal_remote_lpt( XPTR( client_cxy , &desc->args[0] ) );
    1647     first  = (uint32_t)            hal_remote_l32 ( XPTR( client_cxy , &desc->args[1] ) );
    1648     index  = (uint32_t)            hal_remote_l32 ( XPTR( client_cxy , &desc->args[2] ) );
     1699    parent = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     1700    dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
    16491701
    16501702    // call the kernel function
    1651     error = fatfs_get_cluster( mapper , first , index , &cluster );
     1703    error = vfs_fs_remove_dentry( parent , dentry );
    16521704
    16531705    // set output argument
    1654     hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)cluster );
    1655     hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
    1656 
     1706    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)error );
     1707
     1708#if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
     1709cycle = (uint32_t)hal_get_cycles();
     1710if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
     1711printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1712__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1713#endif
     1714}
     1715
     1716/////////////////////////////////////////////////////////////////////////////////////////
     1717// [19]     Marshaling functions attached to RPC_VFS_INODE_LOAD_ALL_PAGES  (blocking)
     1718/////////////////////////////////////////////////////////////////////////////////////////
     1719
     1720////////////////////////////////////////////////////////////
     1721void rpc_vfs_inode_load_all_pages_client( cxy_t         cxy,
     1722                                          vfs_inode_t * inode,      // in
     1723                                          error_t     * error )     // out
     1724{
     1725#if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
     1726thread_t * this = CURRENT_THREAD;
     1727uint32_t cycle = (uint32_t)hal_get_cycles();
     1728if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
     1729printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1730__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1731#endif
     1732
     1733    assert( (cxy != local_cxy) , "target cluster is not remote\n");
     1734
     1735    // initialise RPC descriptor header
     1736    rpc_desc_t  rpc;
     1737    rpc.index    = RPC_VFS_INODE_LOAD_ALL_PAGES;
     1738    rpc.blocking = true;
     1739    rpc.responses = 1;
     1740
     1741    // set input arguments in RPC descriptor
     1742    rpc.args[0] = (uint64_t)(intptr_t)inode;
     1743
     1744    // register RPC request in remote RPC fifo
     1745    rpc_send( cxy , &rpc );
     1746
     1747    // get output values from RPC descriptor
     1748    *error   = (error_t)rpc.args[1];
     1749
     1750#if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
     1751cycle = (uint32_t)hal_get_cycles();
     1752if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
     1753printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1754__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1755#endif
     1756}
     1757
     1758/////////////////////////////////////////////////////
     1759void rpc_vfs_inode_load_all_pages_server( xptr_t xp )
     1760{
     1761#if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
     1762thread_t * this = CURRENT_THREAD;
     1763uint32_t cycle = (uint32_t)hal_get_cycles();
     1764if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
     1765printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1766__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1767#endif
     1768
     1769    error_t       error;
     1770    vfs_inode_t * inode;
     1771
     1772    // get client cluster identifier and pointer on RPC descriptor
     1773    cxy_t        client_cxy  = GET_CXY( xp );
     1774    rpc_desc_t * desc        = GET_PTR( xp );
     1775
     1776    // get input argument
     1777    inode = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     1778
     1779    // call the kernel function
     1780    error = vfs_inode_load_all_pages( inode );
     1781
     1782    // set output argument
     1783    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
     1784
     1785#if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
     1786cycle = (uint32_t)hal_get_cycles();
     1787if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
     1788printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1789__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1790#endif
    16571791}
    16581792
     
    16721806uint32_t cycle = (uint32_t)hal_get_cycles();
    16731807if( cycle > DEBUG_RPC_VMM_GET_VSEG )
    1674 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1675 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1808printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1809__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    16761810#endif
    16771811
     
    16981832cycle = (uint32_t)hal_get_cycles();
    16991833if( cycle > DEBUG_RPC_VMM_GET_VSEG )
    1700 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1701 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1834printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1835__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    17021836#endif
    17031837}
     
    17101844uint32_t cycle = (uint32_t)hal_get_cycles();
    17111845if( cycle > DEBUG_RPC_VMM_GET_VSEG )
    1712 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1713 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1846printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1847__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    17141848#endif
    17151849
     
    17391873cycle = (uint32_t)hal_get_cycles();
    17401874if( cycle > DEBUG_RPC_VMM_GET_VSEG )
    1741 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1742 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1875printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1876__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    17431877#endif
    17441878}
     
    17601894uint32_t cycle = (uint32_t)hal_get_cycles();
    17611895if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE )
    1762 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1763 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1896printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1897__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    17641898#endif
    17651899
     
    17841918cycle = (uint32_t)hal_get_cycles();
    17851919if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE )
    1786 printk("\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 );
     1920printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1921__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    17881922#endif
    17891923}
     
    17961930uint32_t cycle = (uint32_t)hal_get_cycles();
    17971931if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE )
    1798 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1799 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1932printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1933__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    18001934#endif
    18011935
     
    18211955cycle = (uint32_t)hal_get_cycles();
    18221956if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE )
    1823 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1824 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1957printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1958__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    18251959#endif
    18261960}
     
    18391973uint32_t cycle = (uint32_t)hal_get_cycles();
    18401974if( cycle > DEBUG_RPC_KCM_ALLOC )
    1841 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1842 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1975printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1976__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    18431977#endif
    18441978
     
    18631997cycle = (uint32_t)hal_get_cycles();
    18641998if( cycle > DEBUG_RPC_KCM_ALLOC )
    1865 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1866 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1999printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2000__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    18672001#endif
    18682002}
     
    18752009uint32_t cycle = (uint32_t)hal_get_cycles();
    18762010if( cycle > DEBUG_RPC_KCM_ALLOC )
    1877 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1878 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     2011printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2012__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    18792013#endif
    18802014
     
    18992033cycle = (uint32_t)hal_get_cycles();
    19002034if( cycle > DEBUG_RPC_KCM_ALLOC )
    1901 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1902 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     2035printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2036__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    19032037#endif
    19042038}   
     
    19172051uint32_t cycle = (uint32_t)hal_get_cycles();
    19182052if( cycle > DEBUG_RPC_KCM_FREE )
    1919 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1920 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     2053printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2054__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    19212055#endif
    19222056
     
    19392073cycle = (uint32_t)hal_get_cycles();
    19402074if( cycle > DEBUG_RPC_KCM_FREE )
    1941 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1942 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     2075printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2076__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    19432077#endif
    19442078}
     
    19512085uint32_t cycle = (uint32_t)hal_get_cycles();
    19522086if( cycle > DEBUG_RPC_KCM_FREE )
    1953 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
    1954 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     2087printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2088__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    19552089#endif
    19562090
     
    19722106cycle = (uint32_t)hal_get_cycles();
    19732107if( cycle > DEBUG_RPC_KCM_FREE )
    1974 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
    1975 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     2108printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2109__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    19762110#endif
    19772111}   
    19782112
    19792113/////////////////////////////////////////////////////////////////////////////////////////
    1980 // [24]          Marshaling functions attached to RPC_MAPPER_MOVE_BUFFER
    1981 /////////////////////////////////////////////////////////////////////////////////////////
    1982 
    1983 ///////////////////////////////////////////////////
    1984 void rpc_mapper_move_buffer_client( cxy_t      cxy,
    1985                                     mapper_t * mapper,        // in
    1986                                     bool_t     to_buffer,     // in
    1987                                     bool_t     is_user,       // in
    1988                                     uint32_t   file_offset,   // in
    1989                                     uint64_t   buffer,        // in
    1990                                     uint32_t   size,          // in
    1991                                     error_t  * error )        // out
    1992 {
     2114// [24]          Marshaling functions attached to RPC_MAPPER_MOVE_USER 
     2115/////////////////////////////////////////////////////////////////////////////////////////
     2116
     2117/////////////////////////////////////////////////
     2118void rpc_mapper_move_user_client( cxy_t      cxy,
     2119                                  mapper_t * mapper,        // in
     2120                                  bool_t     to_buffer,     // in
     2121                                  uint32_t   file_offset,   // in
     2122                                  void     * buffer,        // in
     2123                                  uint32_t   size,          // in
     2124                                  error_t  * error )        // out
     2125{
     2126#if DEBUG_RPC_MAPPER_MOVE_USER
     2127uint32_t cycle = (uint32_t)hal_get_cycles();
     2128if( cycle > DEBUG_RPC_MAPPER_MOVE_USER )
     2129printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2130__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2131#endif
     2132
    19932133    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    19942134
    19952135    // initialise RPC descriptor header
    19962136    rpc_desc_t  rpc;
    1997     rpc.index    = RPC_MAPPER_MOVE_BUFFER;
     2137    rpc.index    = RPC_MAPPER_MOVE_USER;
    19982138    rpc.blocking = true;
    19992139    rpc.responses = 1;
     
    20022142    rpc.args[0] = (uint64_t)(intptr_t)mapper;
    20032143    rpc.args[1] = (uint64_t)to_buffer;
    2004     rpc.args[2] = (uint64_t)is_user;
    2005     rpc.args[3] = (uint64_t)file_offset;
    2006     rpc.args[4] = (uint64_t)buffer;
    2007     rpc.args[5] = (uint64_t)size;
     2144    rpc.args[2] = (uint64_t)file_offset;
     2145    rpc.args[3] = (uint64_t)(intptr_t)buffer;
     2146    rpc.args[4] = (uint64_t)size;
    20082147
    20092148    // register RPC request in remote RPC fifo
     
    20112150
    20122151    // get output values from RPC descriptor
    2013     *error     = (error_t)rpc.args[6];
    2014 
    2015 }
    2016 
    2017 ///////////////////////////////////////////////
    2018 void rpc_mapper_move_buffer_server( xptr_t xp )
    2019 {
     2152    *error     = (error_t)rpc.args[5];
     2153
     2154#if DEBUG_RPC_MAPPER_MOVE_USER
     2155cycle = (uint32_t)hal_get_cycles();
     2156if( cycle > DEBUG_RPC_MAPPER_MOVE_USER )
     2157printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2158__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2159#endif
     2160}
     2161
     2162/////////////////////////////////////////////
     2163void rpc_mapper_move_user_server( xptr_t xp )
     2164{
     2165#if DEBUG_RPC_MAPPER_MOVE_USER
     2166uint32_t cycle = (uint32_t)hal_get_cycles();
     2167if( cycle > DEBUG_RPC_MAPPER_MOVE_USER )
     2168printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2169__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2170#endif
     2171
    20202172    mapper_t * mapper;
    20212173    bool_t     to_buffer;
    2022     bool_t     is_user;
    20232174    uint32_t   file_offset;
    2024     void     * user_buffer;
    2025     xptr_t     kern_buffer;
     2175    void     * buffer;
    20262176    uint32_t   size;
    20272177    error_t    error;
     
    20342184    mapper      = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    20352185    to_buffer   =                       hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
    2036     is_user    =                       hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
    2037     file_offset =                       hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
    2038     size        =                       hal_remote_l64( XPTR( client_cxy , &desc->args[5] ) );
     2186    file_offset =                       hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
     2187    buffer      = (void *)(intptr_t)    hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
     2188    size        =                       hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) );
    20392189
    20402190    // call local kernel function
    2041     if( is_user )
    2042     {
    2043         user_buffer = (void *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) );
    2044 
    2045         error = mapper_move_user( mapper,
    2046                                   to_buffer,
    2047                                   file_offset,
    2048                                   user_buffer,
    2049                                   size );
    2050     }
    2051     else
    2052     {
    2053         kern_buffer = (xptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) );
    2054 
    2055         error = mapper_move_kernel( mapper,
    2056                                     to_buffer,
    2057                                     file_offset,
    2058                                     kern_buffer,
    2059                                     size );
    2060     }
     2191    error = mapper_move_user( mapper,
     2192                              to_buffer,
     2193                              file_offset,
     2194                              buffer,
     2195                              size );
    20612196
    20622197    // set output argument to client RPC descriptor
    20632198    hal_remote_s64( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error );
    20642199
    2065 }
    2066 
    2067 /////////////////////////////////////////////////////////////////////////////////////////
    2068 // [25]          Marshaling functions attached to RPC_MAPPER_GET_PAGE (blocking)
    2069 /////////////////////////////////////////////////////////////////////////////////////////
    2070 
    2071 ///////////////////////////////////////////////////////
    2072 void rpc_mapper_get_page_client( cxy_t             cxy,
    2073                                  struct mapper_s * mapper,     // in
    2074                                  uint32_t          index,      // in
    2075                                  page_t         ** page )      // out
    2076 {
     2200#if DEBUG_RPC_MAPPER_MOVE_USER
     2201cycle = (uint32_t)hal_get_cycles();
     2202if( cycle > DEBUG_RPC_MAPPER_MOVE_USER )
     2203printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2204__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2205#endif
     2206}
     2207
     2208/////////////////////////////////////////////////////////////////////////////////////////
     2209// [25]          Marshaling functions attached to RPC_MAPPER_HANDLE_MISS (blocking)
     2210/////////////////////////////////////////////////////////////////////////////////////////
     2211
     2212//////////////////////////////////////////////////////////
     2213void rpc_mapper_handle_miss_client( cxy_t             cxy,
     2214                                    struct mapper_s * mapper,
     2215                                    uint32_t          page_id,
     2216                                    xptr_t          * page_xp,
     2217                                    error_t         * error )
     2218{
     2219#if DEBUG_RPC_MAPPER_HANDLE_MISS
     2220uint32_t cycle = (uint32_t)hal_get_cycles();
     2221if( cycle > DEBUG_RPC_MAPPER_HANDLE_MISS )
     2222printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2223__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2224#endif
     2225
    20772226    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    20782227
    20792228    // initialise RPC descriptor header
    20802229    rpc_desc_t  rpc;
    2081     rpc.index    = RPC_MAPPER_GET_PAGE;
     2230    rpc.index    = RPC_MAPPER_HANDLE_MISS;
    20822231    rpc.blocking = true;
    20832232    rpc.responses = 1;
     
    20852234    // set input arguments in RPC descriptor
    20862235    rpc.args[0] = (uint64_t)(intptr_t)mapper;
    2087     rpc.args[1] = (uint64_t)index;
     2236    rpc.args[1] = (uint64_t)page_id;
    20882237
    20892238    // register RPC request in remote RPC fifo
     
    20912240
    20922241    // get output values from RPC descriptor
    2093     *page = (page_t *)(intptr_t)rpc.args[2];
    2094 
    2095 }
    2096 
    2097 ////////////////////////////////////////////
    2098 void rpc_mapper_get_page_server( xptr_t xp )
    2099 {
     2242    *page_xp = (xptr_t)rpc.args[2];
     2243    *error   = (error_t)rpc.args[3];
     2244
     2245#if DEBUG_RPC_MAPPER_HANDLE_MISS
     2246cycle = (uint32_t)hal_get_cycles();
     2247if( cycle > DEBUG_RPC_MAPPER_HANDLE_MISS )
     2248printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2249__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2250#endif
     2251}
     2252
     2253///////////////////////////////////////////////
     2254void rpc_mapper_handle_miss_server( xptr_t xp )
     2255{
     2256#if DEBUG_RPC_MAPPER_HANDLE_MISS
     2257uint32_t cycle = (uint32_t)hal_get_cycles();
     2258if( cycle > DEBUG_RPC_MAPPER_HANDLE_MISS )
     2259printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2260__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2261#endif
     2262
     2263    mapper_t * mapper;
     2264    uint32_t   page_id;
     2265    xptr_t     page_xp;
     2266    error_t    error;
     2267
    21002268    // get client cluster identifier and pointer on RPC descriptor
    2101     cxy_t        cxy  = GET_CXY( xp );
    2102     rpc_desc_t * desc = GET_PTR( xp );
    2103 
    2104     // get input arguments from client RPC descriptor
    2105     mapper_t * mapper = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) );
    2106     uint32_t   index  = (uint32_t)            hal_remote_l64( XPTR( cxy , &desc->args[1] ) );
    2107    
    2108     // call local pmem allocator
    2109     page_t * page = mapper_get_page( mapper , index );
    2110 
    2111     // set output arguments into client RPC descriptor
    2112     hal_remote_s64( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
    2113 
    2114 }
    2115 
    2116 /////////////////////////////////////////////////////////////////////////////////////////
    2117 // [26]          Marshaling functions attached to RPC_VMM_CREATE_VSEG (blocking)
     2269    cxy_t        client_cxy  = GET_CXY( xp );
     2270    rpc_desc_t * desc        = GET_PTR( xp );
     2271
     2272    // get arguments from client RPC descriptor
     2273    mapper  = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     2274    page_id =                       hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
     2275
     2276    // call local kernel function
     2277    error = mapper_handle_miss( mapper,
     2278                                page_id,
     2279                                &page_xp );
     2280
     2281    // set output argument to client RPC descriptor
     2282    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)error );
     2283    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)page_xp );
     2284
     2285#if DEBUG_RPC_MAPPER_HANDLE_MISS
     2286cycle = (uint32_t)hal_get_cycles();
     2287if( cycle > DEBUG_RPC_MAPPER_HANDLE_MISS )
     2288printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2289__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2290#endif
     2291}
     2292
     2293/////////////////////////////////////////////////////////////////////////////////////////
     2294// [26]         undefined slot
     2295/////////////////////////////////////////////////////////////////////////////////////////
     2296
     2297/////////////////////////////////////////////////////////////////////////////////////////
     2298// [27]          Marshaling functions attached to RPC_VMM_CREATE_VSEG (blocking)
    21182299/////////////////////////////////////////////////////////////////////////////////////////
    21192300
     
    21892370
    21902371/////////////////////////////////////////////////////////////////////////////////////////
    2191 // [27]         undefined slot
    2192 /////////////////////////////////////////////////////////////////////////////////////////
    2193 
    2194 /////////////////////////////////////////////////////////////////////////////////////////
    21952372// [28]          Marshaling functions attached to RPC_VMM_SET_COW (blocking)
    21962373/////////////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.