Changeset 601 for trunk/kernel


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.

Location:
trunk/kernel/kern
Files:
5 edited

Legend:

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

    r593 r601  
    175175if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
    176176printk("\n[%s] client[%x,%x] enter for RX / server[%x,%x] / cycle %d\n",
    177 __FUNCTION__, this->process->pid, this->trdid, server_ptr->process->pid, server_ptr->trdid, rx_cycle );
     177__FUNCTION__, this->process->pid, this->trdid,
     178server_ptr->process->pid, server_ptr->trdid, rx_cycle );
    178179#endif
    179180
     
    182183if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
    183184printk("\n[%s] client[%x,%x] enter for TX / server[%x,%x] / cycle %d\n",
    184 __FUNCTION__, this->process->pid, this->trdid, server_ptr->process->pid, server_ptr->trdid, tx_cycle );
     185__FUNCTION__, this->process->pid, this->trdid,
     186server_ptr->process->pid, server_ptr->trdid, tx_cycle );
    185187#endif
    186188
     
    223225if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
    224226printk("\n[%s] client thread[%x,%x] blocked\n",
    225 __FUNCTION__, this->process_pid, this->trdid );
     227__FUNCTION__, this->process->pid, this->trdid );
    226228#endif
    227229
     
    341343uint32_t rx_cycle = (uint32_t)hal_get_cycles();
    342344if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
    343 printk("\n[%s] dev_thread[%x,%x] start RX / cycle %d\n",
     345printk("\n[%s] thread[%x,%x] start RX / cycle %d\n",
    344346__FUNCTION__ , server->process->pid, server->trdid, rx_cycle );
    345347#endif
     
    348350uint32_t tx_cycle = (uint32_t)hal_get_cycles();
    349351if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
    350 printk("\n[%s] dev_thread[%x,%x] start TX / cycle %d\n",
     352printk("\n[%s] thread[%x,%x] start TX / cycle %d\n",
    351353__FUNCTION__ , server->process->pid, server->trdid, tx_cycle );
    352354#endif
     355
     356        // check server thread can yield
     357        thread_assert_can_yield( server , __FUNCTION__ );
    353358
    354359        // get the lock protecting the waiting queue
     
    358363        if( xlist_is_empty( root_xp ) ) // waiting queue empty
    359364        {
     365            // release lock protecting the waiting queue
     366            remote_busylock_release( lock_xp );
    360367
    361368#if DEBUG_CHDEV_SERVER_RX
    362369rx_cycle = (uint32_t)hal_get_cycles();
    363370if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
    364 printk("\n[%s] dev_thread[%x,%x] found RX queue empty => blocks / cycle %d\n",
     371printk("\n[%s] thread[%x,%x] found RX queue empty => blocks / cycle %d\n",
    365372__FUNCTION__ , server->process->pid, server->trdid, rx_cycle );
    366373#endif
     
    369376tx_cycle = (uint32_t)hal_get_cycles();
    370377if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
    371 printk("\n[%s] dev_thread[%x,%x] found TX queue empty => blocks / cycle %d\n",
     378printk("\n[%s] thread[%x,%x] found TX queue empty => blocks / cycle %d\n",
    372379__FUNCTION__ , server->process->pid, server->trdid, tx_cycle );
    373380#endif
    374 
    375             // release lock
    376             remote_busylock_release( lock_xp );
    377 
    378381            // block
    379382            thread_block( XPTR( local_cxy , server ) , THREAD_BLOCKED_IDLE );
    380 
    381 // check server thread can yield
    382 assert( (server->busylocks == 0),
    383 "cannot yield : busylocks = %d\n", server->busylocks );
    384383
    385384            // deschedule
     
    388387        else                            // waiting queue not empty
    389388        {
     389            // release lock protecting the waiting queue
     390            remote_busylock_release( lock_xp );
     391
    390392            // get extended pointer on first client thread
    391393            client_xp = XLIST_FIRST( root_xp , thread_t , wait_list );
     
    395397            client_ptr = GET_PTR( client_xp );
    396398
    397             // remove this first client thread from waiting queue
    398             xlist_unlink( XPTR( client_cxy , &client_ptr->wait_list ) );
    399 
    400             // release lock
    401             remote_busylock_release( lock_xp );
     399#if( DDEBUG_CHDEV_SERVER_TX || DEBUG_CHDEV_SERVER_RX )
     400process_t * process      = hal_remote_lpt( XPTR( client_cxy , &client_ptr->process ) );
     401pid_t       client_pid   = hal_remote_l32( XPTR( client_cxy , &process->pid ) );
     402process_t   client_trdid = hal_remote_l32( XPTR( client_cxy , &client_ptr->trdid ) );
     403#endif
    402404
    403405#if DEBUG_CHDEV_SERVER_RX
    404406rx_cycle = (uint32_t)hal_get_cycles();
    405407if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
    406 printk("\n[%s] dev_thread[%x,%x] for RX get client thread[%x,%x] / cycle %d\n",
    407 __FUNCTION__, server->process->pid, server->trdid,
    408 client_ptr->process->pid, client_ptr->trdid, rx_cycle );
     408printk("\n[%s] thread[%x,%x] for RX get client thread[%x,%x] / cycle %d\n",
     409__FUNCTION__, server->process->pid, server->trdid, client_pid, client_trdid, cycle );
    409410#endif
    410411
     
    412413tx_cycle = (uint32_t)hal_get_cycles();
    413414if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
    414 printk("\n[%s] dev_thread[%x,%x] for TX get client thread[%x,%x] / cycle %d\n",
    415 __FUNCTION__, server->process->pid, server->trdid,
    416 client_ptr->process->pid, client_ptr->trdid, tx_cycle );
     415printk("\n[%s] thread[%x,%x] for TX get client thread[%x,%x] / cycle %d\n",
     416__FUNCTION__, server->process->pid, server->trdid, client_pid, client_trdid, cycle );
    417417#endif
    418418
     
    425425#endif
    426426
    427             // call driver command function to execute I/O operation
     427            // call the (blocking) driver command function
     428            // to launch I/O operation AND wait completion
    428429            chdev->cmd( client_xp );
    429430       
    430             // unblock client thread
     431            // unblock client thread when driver returns
    431432            thread_unblock( client_xp , THREAD_BLOCKED_IO );
     433
     434            // get the lock protecting the waiting queue
     435            remote_busylock_acquire( lock_xp );
     436
     437            // remove this client thread from chdev waiting queue
     438            xlist_unlink( XPTR( client_cxy , &client_ptr->wait_list ) );
     439
     440            // release lock protecting the waiting queue
     441            remote_busylock_release( lock_xp );
    432442
    433443#if DEBUG_CHDEV_SERVER_RX
    434444rx_cycle = (uint32_t)hal_get_cycles();
    435445if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
    436 printk("\n[%s] dev_thread[%x,%x] completes RX for client thread[%x,%x] / cycle %d\n",
    437 __FUNCTION__, server->process->pid, server->trdid,
    438 client_ptr->process->pid, client_ptr->trdid, rx_cycle );
     446printk("\n[%s] thread[%x,%x] completes RX for client thread[%x,%x] / cycle %d\n",
     447__FUNCTION__, server->process->pid, server->trdid, client_pid, client_trdid, cycle );
    439448#endif
    440449
     
    442451tx_cycle = (uint32_t)hal_get_cycles();
    443452if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
    444 printk("\n[%s] dev_thread[%x,%x] completes TX for client thread[%x,%x] / cycle %d\n",
    445 __FUNCTION__, server->process->pid, server->trdid,
    446 client_ptr->process->pid, client_ptr->trdid, tx_cycle );
     453printk("\n[%s] thread[%x,%x] completes TX for client thread[%x,%x] / cycle %d\n",
     454__FUNCTION__, server->process->pid, server->trdid, client_pid, client_trdid, cycle );
    447455#endif
    448456
     
    633641                        pid        = hal_remote_l32 ( XPTR( thread_cxy , &process->pid        ) );
    634642
    635             nolock_printk("- thread %X / cluster %X / trdid %X / pid %X\n",
    636             thread_ptr, thread_cxy, trdid, pid );
     643            nolock_printk("- thread[%x,%x]\n", pid, trdid );
    637644        }
    638645    }
  • trunk/kernel/kern/kernel_init.c

    r583 r601  
    159159
    160160    "CLUSTER_PREFTBL",       // 21
     161
    161162    "PPM_DIRTY",             // 22
    162 
    163163    "CLUSTER_LOCALS",        // 23
    164164    "CLUSTER_COPIES",        // 24
     
    166166    "PROCESS_USERSYNC",      // 26
    167167    "PROCESS_FDARRAY",       // 27
    168 
    169     "MAPPER_STATE",          // 28
     168    "FATFS_FREE",            // 28
     169
    170170    "PROCESS_THTBL",         // 29
    171171
    172     "PROCESS_CWD",           // 30
    173     "VFS_INODE",             // 31
    174     "VFS_FILE",              // 32
    175     "VMM_VSL",               // 33
    176     "VMM_GPT",               // 34
     172    "MAPPER_STATE",          // 30
     173    "PROCESS_CWD",           // 31
     174    "VFS_INODE",             // 32
     175    "VFS_FILE",              // 33
     176    "VMM_VSL",               // 34
     177    "VMM_GPT",               // 35
    177178};       
    178179
    179 // these debug variables are used to analyse the sys_read() and sys_write() syscalls timing
     180// debug variables to analyse the sys_read() and sys_write() syscalls timing
    180181
    181182#if DEBUG_SYS_READ
     
    417418#if( DEBUG_KERNEL_INIT & 0x1 )
    418419if( hal_time_stamp() > DEBUG_KERNEL_INIT )
    419 printk("\n[DBG] %s : created MMC in cluster %x / chdev = %x\n",
     420printk("\n[%s] : created MMC in cluster %x / chdev = %x\n",
    420421__FUNCTION__ , local_cxy , chdev_ptr );
    421422#endif
     
    451452#if( DEBUG_KERNEL_INIT & 0x1 )
    452453if( hal_time_stamp() > DEBUG_KERNEL_INIT )
    453 printk("\n[DBG] %s : created DMA[%d] in cluster %x / chdev = %x\n",
     454printk("\n[%s] : created DMA[%d] in cluster %x / chdev = %x\n",
    454455__FUNCTION__ , channel , local_cxy , chdev_ptr );
    455456#endif
     
    611612#if( DEBUG_KERNEL_INIT & 0x1 )
    612613if( hal_time_stamp() > DEBUG_KERNEL_INIT )
    613 printk("\n[DBG] %s : create chdev %s / channel = %d / rx = %d / cluster %x / chdev = %x\n",
     614printk("\n[%s] : create chdev %s / channel = %d / rx = %d / cluster %x / chdev = %x\n",
    614615__FUNCTION__ , chdev_func_str( func ), channel , rx , local_cxy , chdev );
    615616#endif
     
    779780
    780781#if( DEBUG_KERNEL_INIT & 0x1 )
    781 if( hal_tim_stamp() > DEBUG_KERNEL_INIT )
     782if( hal_time_stamp() > DEBUG_KERNEL_INIT )
    782783{
    783     printk("\n[DBG] %s created PIC chdev in cluster %x at cycle %d\n",
     784    printk("\n[%s] created PIC chdev in cluster %x at cycle %d\n",
    784785    __FUNCTION__ , local_cxy , (uint32_t)hal_time_stamp() );
    785786    dev_pic_inputs_display();
     
    969970#if DEBUG_KERNEL_INIT
    970971if( (core_lid ==  0) & (local_cxy == 0) )
    971 printk("\n[DBG] %s : exit barrier 0 : TXT0 initialized / sr %x / cycle %d\n",
     972printk("\n[%s] : exit barrier 0 : TXT0 initialized / sr %x / cycle %d\n",
    972973__FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() );
    973974#endif
     
    10111012#if DEBUG_KERNEL_INIT
    10121013if( (core_lid ==  0) & (local_cxy == 0) )
    1013 printk("\n[DBG] %s : exit barrier 1 : clusters initialised / sr %x / cycle %d\n",
     1014printk("\n[%s] : exit barrier 1 : clusters initialised / sr %x / cycle %d\n",
    10141015__FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() );
    10151016#endif
     
    10381039#if DEBUG_KERNEL_INIT
    10391040if( (core_lid ==  0) & (local_cxy == 0) )
    1040 printk("\n[DBG] %s : exit barrier 2 : PIC initialised / sr %x / cycle %d\n",
     1041printk("\n[%s] : exit barrier 2 : PIC initialised / sr %x / cycle %d\n",
    10411042__FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() );
    10421043#endif
     
    10711072#if DEBUG_KERNEL_INIT
    10721073if( (core_lid ==  0) & (local_cxy == 0) )
    1073 printk("\n[DBG] %s : exit barrier 3 : all chdev initialised / sr %x / cycle %d\n",
     1074printk("\n[%s] : exit barrier 3 : all chdevs initialised / sr %x / cycle %d\n",
    10741075__FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() );
    10751076#endif
     
    11151116        if( CONFIG_VFS_ROOT_IS_FATFS )
    11161117        {
    1117             // 1. allocate memory for FATFS context in cluster 0
     1118            // 1. allocate memory for FATFS context extension in cluster 0
    11181119            fatfs_ctx_t * fatfs_ctx = fatfs_ctx_alloc();
    11191120
     
    11341135            uint32_t total_clusters   = fatfs_ctx->fat_sectors_count << 7;
    11351136 
    1136             // 4. initialize the FATFS entry in the vfs_context[] array
    1137             vfs_ctx_init( FS_TYPE_FATFS,                               // fs type
    1138                           0,                                           // attributes: unused
    1139                               total_clusters,               
    1140                               cluster_size,
    1141                               vfs_root_inode_xp,                           // VFS root
    1142                           fatfs_ctx );                                 // extend
    1143 
    1144             // 5. create VFS root inode in cluster 0
     1137            // 4. create VFS root inode in cluster 0
    11451138            error = vfs_inode_create( XPTR_NULL,                           // dentry_xp
    11461139                                      FS_TYPE_FATFS,                       // fs_type
    11471140                                      INODE_TYPE_DIR,                      // inode_type
    1148                                       (void *)(intptr_t)root_dir_cluster,  // extend
    11491141                                      0,                                   // attr
    11501142                                      0,                                   // rights
     
    11591151            }
    11601152
    1161             // 6. update the FATFS entry in vfs_context[] array
    1162             fs_context[FS_TYPE_FATFS].vfs_root_xp = vfs_root_inode_xp;
    1163 
    1164             // 7. check FATFS initialization
    1165             vfs_ctx_t   * vfs_ctx = &fs_context[FS_TYPE_FATFS];
    1166 
    1167             if( ((fatfs_ctx_t *)vfs_ctx->extend)->sectors_per_cluster != 8 )
    1168             {
    1169                 printk("\n[PANIC] in %s : illegal FATFS context in cluster 0\n",
    1170                 __FUNCTION__ );
    1171                 hal_core_sleep();
    1172             }
    1173                
     1153            // 5. update FATFS root inode extension 
     1154            cxy_t         vfs_root_cxy = GET_CXY( vfs_root_inode_xp );
     1155            vfs_inode_t * vfs_root_ptr = GET_PTR( vfs_root_inode_xp );
     1156            hal_remote_spt( XPTR( vfs_root_cxy , &vfs_root_ptr->extend ),
     1157                            (void*)(intptr_t)root_dir_cluster );
     1158
     1159            // 6. initialize the generic VFS context for FATFS
     1160            vfs_ctx_init( FS_TYPE_FATFS,                               // fs type
     1161                          0,                                           // attributes: unused
     1162                              total_clusters,                              // number of clusters
     1163                              cluster_size,                                // bytes
     1164                              vfs_root_inode_xp,                           // VFS root
     1165                          fatfs_ctx );                                 // extend
    11741166        }
    11751167        else
     
    11931185#if DEBUG_KERNEL_INIT
    11941186if( (core_lid ==  0) & (local_cxy == 0) )
    1195 printk("\n[DBG] %s : exit barrier 4 : VFS root initialized in cluster 0 / sr %x / cycle %d\n",
     1187printk("\n[%s] : exit barrier 4 : VFS root initialized in cluster 0 / sr %x / cycle %d\n",
    11961188__FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() );
    11971189#endif
     
    12621254#if DEBUG_KERNEL_INIT
    12631255if( (core_lid ==  0) & (local_cxy == 1) )
    1264 printk("\n[DBG] %s : exit barrier 5 : VFS root initialized in cluster 1 / sr %x / cycle %d\n",
     1256printk("\n[%s] : exit barrier 5 : VFS root initialized in cluster 1 / sr %x / cycle %d\n",
    12651257__FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() );
    12661258#endif
     
    13111303#if DEBUG_KERNEL_INIT
    13121304if( (core_lid ==  0) & (local_cxy == 0) )
    1313 printk("\n[DBG] %s : exit barrier 6 : DEVFS root initialized in cluster 0 / sr %x / cycle %d\n",
     1305printk("\n[%s] : exit barrier 6 : DEVFS root initialized in cluster 0 / sr %x / cycle %d\n",
    13141306__FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() );
    13151307#endif
     
    13481340#if DEBUG_KERNEL_INIT
    13491341if( (core_lid ==  0) & (local_cxy == 0) )
    1350 printk("\n[DBG] %s : exit barrier 7 : DEV initialized in cluster 0 / sr %x / cycle %d\n",
     1342printk("\n[%s] : exit barrier 7 : DEV initialized in cluster 0 / sr %x / cycle %d\n",
    13511343__FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() );
    13521344#endif
     
    13741366#if DEBUG_KERNEL_INIT
    13751367if( (core_lid ==  0) & (local_cxy == 0) )
    1376 printk("\n[DBG] %s : exit barrier 8 : process init created / sr %x / cycle %d\n",
     1368printk("\n[%s] : exit barrier 8 : process init created / sr %x / cycle %d\n",
    13771369__FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() );
    13781370#endif
     
    14451437
    14461438#if DEBUG_KERNEL_INIT
    1447 printk("\n[DBG] %s : thread %x on core[%x,%d] jumps to thread_idle_func() / cycle %d\n",
     1439printk("\n[%s] : thread %x on core[%x,%d] jumps to thread_idle_func() / cycle %d\n",
    14481440__FUNCTION__ , CURRENT_THREAD , local_cxy , core_lid , (uint32_t)hal_get_cycles() );
    14491441#endif
  • trunk/kernel/kern/process.h

    r593 r601  
    3434#include <bits.h>
    3535#include <busylock.h>
     36#include <rwlock.h>
    3637#include <queuelock.h>
    3738#include <remote_queuelock.h>
  • 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/////////////////////////////////////////////////////////////////////////////////////////
  • trunk/kernel/kern/rpc.h

    r583 r601  
    5959typedef enum
    6060{
    61     RPC_PMEM_GET_PAGES         = 0,
    62     RPC_PMEM_RELEASE_PAGES     = 1,
    63     RPC_UNDEFINED_2            = 2,     
    64     RPC_PROCESS_MAKE_FORK      = 3,
    65     RPC_UNDEFINED_4            = 4,
    66     RPC_UNDEFINED_5            = 5,
    67     RPC_THREAD_USER_CREATE     = 6,
    68     RPC_THREAD_KERNEL_CREATE   = 7,
    69     RPC_UNDEFINED_8            = 8,
    70     RPC_PROCESS_SIGACTION      = 9,
    71 
    72     RPC_VFS_INODE_CREATE       = 10,
    73     RPC_VFS_INODE_DESTROY      = 11,
    74     RPC_VFS_DENTRY_CREATE      = 12,
    75     RPC_VFS_DENTRY_DESTROY     = 13,
    76     RPC_VFS_FILE_CREATE        = 14,
    77     RPC_VFS_FILE_DESTROY       = 15,
    78     RPC_VFS_INODE_LOAD         = 16,
    79     RPC_VFS_MAPPER_LOAD_ALL    = 17,
    80     RPC_FATFS_GET_CLUSTER      = 18,
    81     RPC_UNDEFINED_19           = 19,
    82 
    83     RPC_VMM_GET_VSEG           = 20,
    84     RPC_VMM_GLOBAL_UPDATE_PTE  = 21,
    85     RPC_KCM_ALLOC              = 22,
    86     RPC_KCM_FREE               = 23,
    87     RPC_MAPPER_MOVE_BUFFER     = 24,
    88     RPC_MAPPER_GET_PAGE        = 25,
    89     RPC_VMM_CREATE_VSEG        = 26,
    90     RPC_UNDEFINED_27           = 27,
    91     RPC_VMM_SET_COW            = 28,
    92     RPC_VMM_DISPLAY            = 29,
    93 
    94     RPC_MAX_INDEX              = 30,
     61    RPC_PMEM_GET_PAGES            = 0,
     62    RPC_PMEM_RELEASE_PAGES        = 1,
     63    RPC_UNDEFINED_2               = 2,     
     64    RPC_PROCESS_MAKE_FORK         = 3,
     65    RPC_UNDEFINED_4               = 4,
     66    RPC_UNDEFINED_5               = 5,
     67    RPC_THREAD_USER_CREATE        = 6,
     68    RPC_THREAD_KERNEL_CREATE      = 7,
     69    RPC_UNDEFINED_8               = 8,
     70    RPC_PROCESS_SIGACTION         = 9,
     71
     72    RPC_VFS_INODE_CREATE          = 10,
     73    RPC_VFS_INODE_DESTROY         = 11,
     74    RPC_VFS_DENTRY_CREATE         = 12,
     75    RPC_VFS_DENTRY_DESTROY        = 13,
     76    RPC_VFS_FILE_CREATE           = 14,
     77    RPC_VFS_FILE_DESTROY          = 15,
     78    RPC_VFS_FS_CHILD_INIT         = 16,
     79    RPC_VFS_FS_REMOVE_DENTRY      = 17,
     80    RPC_VFS_FS_ADD_DENTRY         = 18,
     81    RPC_VFS_INODE_LOAD_ALL_PAGES  = 19,
     82
     83    RPC_VMM_GET_VSEG              = 20,
     84    RPC_VMM_GLOBAL_UPDATE_PTE     = 21,
     85    RPC_KCM_ALLOC                 = 22,
     86    RPC_KCM_FREE                  = 23,
     87    RPC_MAPPER_MOVE_USER          = 24,
     88    RPC_MAPPER_HANDLE_MISS        = 25,
     89    RPC_UNDEFINED_26              = 26,
     90    RPC_VMM_CREATE_VSEG           = 27,
     91    RPC_VMM_SET_COW               = 28,
     92    RPC_VMM_DISPLAY               = 29,
     93
     94    RPC_MAX_INDEX                 = 30,
    9595}
    9696rpc_index_t;
     
    310310 * @ fs_type    : [in]  file system type.
    311311 * @ inode_type : [in]  file system type.
    312  * @ extend     : [in]  fs_type_specific inode extension.
    313312 * @ attr       : [in]  inode attributes.
    314313 * @ rights     : [in]  access rights
     
    322321                                  uint32_t   fs_type,
    323322                                  uint32_t   inode_type,
    324                                   void     * extend,
    325323                                  uint32_t   attr,   
    326324                                  uint32_t   rights, 
     
    338336 * @ cxy       :  server cluster identifier
    339337 * @ inode     : [in]  local pointer on inode.
    340  * @ error     : [out] error status (0 if success).
    341  **********************************************************************************/
    342 void rpc_vfs_inode_destroy_client( cxy_t                 cxy,
    343                                    struct vfs_inode_s * inode,
    344                                    error_t            * error );
     338 **********************************************************************************/
     339void rpc_vfs_inode_destroy_client( cxy_t                cxy,
     340                                   struct vfs_inode_s * inode );
    345341
    346342void rpc_vfs_inode_destroy_server( xptr_t xp );
     
    372368 * @ cxy       :  server cluster identifier
    373369 * @ dentry     : [in]  local pointer on dentry.
    374  * @ error     : [out] error status (0 if success).
    375370 **********************************************************************************/
    376371void rpc_vfs_dentry_destroy_client( cxy_t                 cxy,
    377                                     struct vfs_dentry_s * dentry,
    378                                     error_t             * error );
     372                                    struct vfs_dentry_s * dentry );
    379373
    380374void rpc_vfs_dentry_destroy_server( xptr_t xp );
     
    411405
    412406/***********************************************************************************
    413  * [16] The RPC_VFS_LOAD_INODE calls the vfs_inode_load() kernel function in a
    414  * remote cluster containing a parent inode directory to scan the associated
    415  * mapper, find a directory entry, identified by its name, and update the remote
    416  * child inode.
    417  ***********************************************************************************
    418  * @ cxy            :  server cluster identifier
     407 * [16] The RPC_VFS_FS_CHILD_INIT calls the vfs_fs_child_init_load_inode()
     408 * function in a remote cluster containing a parent inode directory to scan the
     409 * associated mapper, find a directory entry identified by its name, and update
     410 * both the child inode and the dentry.
     411 ***********************************************************************************
     412 * @ cxy            : server cluster identifier
    419413 * @ parent_inode   : [in]  local pointer on parent inode.
    420414 * @ name           : [in]  local pointer on child name (in client cluster).
     
    422416 * @ error          : [out] error status (0 if success).
    423417 **********************************************************************************/
    424 void rpc_vfs_inode_load_client( cxy_t                cxy,
    425                                 struct vfs_inode_s * parent_inode,
    426                                 char               * name,
    427                                 xptr_t               child_inode_xp,
    428                                 error_t            * error );
    429 
    430 void rpc_vfs_inode_load_server( xptr_t xp );
    431 
    432 /***********************************************************************************
    433  * [17] The RPC_VFS_MAPPER_LOAD_ALL calls the vfs_mapper_load_all() kernel function
    434  * in a remote cluster containing an inode, to load all pages of the associated
    435  * mapper from the file system on device.
    436  ***********************************************************************************
    437  * @ cxy     :  server cluster identifier
     418void rpc_vfs_fs_child_init_client( cxy_t                cxy,
     419                                   struct vfs_inode_s * parent_inode,
     420                                   char               * name,
     421                                   xptr_t               child_inode_xp,
     422                                   error_t            * error );
     423
     424void rpc_vfs_fs_child_init_server( xptr_t xp );
     425
     426/***********************************************************************************
     427 * [17] The RPC_VFS_FS_ADD_DENTRY calls the vfs_fs_add_dentry() function in a
     428 * remote cluster containing a directory inode and mapper, to add a new dentry
     429 * in the mapper of this directory.
     430 ***********************************************************************************
     431 * @ cxy            : server cluster identifier
     432 * @ parent         : [in]  local pointer on directory inode.
     433 * @ dentry         : [in]  local pointer on dentry.
     434 * @ error          : [out] error status (0 if success).
     435 **********************************************************************************/
     436void rpc_vfs_fs_add_dentry_client( cxy_t,
     437                                   struct vfs_inode_s  * parent,
     438                                   struct vfs_dentry_s * dentry,
     439                                   error_t             * error );
     440
     441void rpc_vfs_fs_add_dentry_server( xptr_t xp );
     442
     443/***********************************************************************************
     444 * [18] The RPC_VFS_FS_REMOVE_DENTRY calls the vfs_fs_remove_dentry() function in a
     445 * remote cluster containing a directory inode and mapper, to remove a dentry from
     446 * the mapper of this directory.
     447 ***********************************************************************************
     448 * @ cxy            : server cluster identifier
     449 * @ parent         : [in]  local pointer on directory inode.
     450 * @ dentry         : [in]  local pointer on dentry.
     451 * @ error          : [out] error status (0 if success).
     452 **********************************************************************************/
     453void rpc_vfs_fs_remove_dentry_client( cxy_t,
     454                                      struct vfs_inode_s  * parent,
     455                                      struct vfs_dentry_s * dentry,
     456                                      error_t             * error );
     457
     458void rpc_vfs_fs_remove_dentry_server( xptr_t xp );
     459
     460/***********************************************************************************
     461 * [19] The RPC_VFS_INODE_LOAD_ALL_PAGES calls the vfs_inode_load_all_pages()
     462 * function a remote cluster containing an inode to load all pages in the
     463 * associated mapper. 
     464 ***********************************************************************************
     465 * @ cxy     : server cluster identifier
    438466 * @ inode   : [in]  local pointer on inode in server cluster.
    439467 * @ error   : [out] error status (0 if success).
    440468 **********************************************************************************/
    441 void rpc_vfs_mapper_load_all_client( cxy_t                cxy,
    442                                      struct vfs_inode_s * inode,
    443                                      error_t            * error );
    444 
    445 void rpc_vfs_mapper_load_all_server( xptr_t xp );
    446 
    447 /***********************************************************************************
    448  * [18] The RPC_FATFS_GET_CLUSTER can be send by any thread running in a "client"
    449  * cluster to scan the FAT mapper, stored in a remote "server" cluster, and get
    450  * from the mapper the local pointer on a given page.
    451  ***********************************************************************************
    452  * @ cxy      : server cluster identifier.
    453  * @ mapper   : [in]  local pointer on FAT mapper.
    454  * @ first    : [in]  FATFS cluster index allocated to first page of file.
    455  * @ page     : [in]  page index in file.
    456  * @ cluster  : [out] local pointer on buffer for found FATFS cluster index.
    457  * @ error    : [out] local pointer on buffer for error code (in client cluster).
    458  **********************************************************************************/
    459 void rpc_fatfs_get_cluster_client( cxy_t             cxy,
    460                                    struct mapper_s * mapper,
    461                                    uint32_t          first,
    462                                    uint32_t          page,
    463                                    uint32_t        * cluster,
    464                                    error_t         * error );   
    465 
    466 void rpc_fatfs_get_cluster_server( xptr_t xp );
    467 
    468 /***********************************************************************************
    469  * [19] undefined slot
    470  **********************************************************************************/
     469void rpc_vfs_inode_load_all_pages_client( cxy_t                cxy,
     470                                          struct vfs_inode_s * inode,
     471                                          error_t            * error );
     472
     473void rpc_vfs_inode_load_all_pages_server( xptr_t xp );
    471474
    472475/***********************************************************************************
     
    543546
    544547/***********************************************************************************
    545  * [24] The RPC_MAPPER_MOVE_BUFFER allows a client thread to require a remote
    546  * mapper to move data to/from a kernel or user buffer.
    547  * - It calls the mapper_move_user() function for a - possibly distributed -
    548  *   user buffer identified by a user-space pointer, and casted to uint64_t.
    549  * - It calls the mapper_move_kernel() function for a - possibly remote -
    550  *   kernel buffer identified by an extended pointer, and casted to uint64_t.
     548 * [24] The RPC_MAPPER_MOVE_USER allows a client thread to require a remote
     549 * mapper to move data to/from a distributed user buffer.
    551550 * It is used by the vfs_move_user() function to move data between a mapper
    552551 * and an user buffer required by a sys_read() or a sys_write().
    553  * It is used by the vmm_get_one_ppn() function to initialise a physical page
    554  * from a .elf file mapper, for a CODE or DATA vseg page fault.
    555  ***********************************************************************************
    556  * @ cxy         : server cluster identifier.
    557  * @ mapper      : [in]  local pointer on mapper
    558  * @ to_buffer   : [in]  move data from mapper to buffer if non zero.
    559  * @ is_user     : [in]  buffer in user space if true
    560  * @ file_offset : [in]  first byte to move in mapper
    561  * @ buffer      : [in]  user space pointer / kernel extended pointer
    562  * @ size        : [in]  number of bytes to move
    563  * @ error       : [out] error status (0 if success).
    564  **********************************************************************************/
    565 void rpc_mapper_move_buffer_client( cxy_t             cxy,
    566                                     struct mapper_s * mapper,
    567                                     bool_t            to_buffer,
    568                                     bool_t            is_user,
    569                                     uint32_t          file_offset,
    570                                     uint64_t          buffer,
    571                                     uint32_t          size,
    572                                     error_t         * error );
    573 
    574 void rpc_mapper_move_buffer_server( xptr_t xp );
    575 
    576 /***********************************************************************************
    577  * [25] The RPC_MAPPER_GET_PAGE allows a client thread to get the local pointer
    578  * on a remote page descriptor, for a page, identified by the page index in mapper.
    579  * It is used by the vmm_get_one_ppn() function to handle a page fault on
    580  * a FILE type vseg.
    581552 ***********************************************************************************
    582553 * @ cxy         : server cluster identifier.
    583554 * @ mapper      : [in]  local pointer on mapper.
    584  * @ index       : [in]  page index in mapper.
    585  * @ page        : [out] local pointer on page descriptor / NULL if failure.
    586  **********************************************************************************/
    587 void rpc_mapper_get_page_client( cxy_t             cxy,
    588                                  struct mapper_s * mapper,
    589                                  uint32_t          index,
    590                                  struct page_s  ** page );
    591 
    592 void rpc_mapper_get_page_server( xptr_t xp );
    593 
    594 /***********************************************************************************
    595  * [26] The RPC_VMM_CREATE_VSEG allows a client thread to request the remote
     555 * @ to_buffer   : [in]  move data from mapper to buffer if non zero.
     556 * @ file_offset : [in]  first byte to move in mapper.
     557 * @ buffer      : [in]  user space buffer pointer.
     558 * @ size        : [in]  number of bytes to move.
     559 * @ error       : [out] error status (0 if success).
     560 **********************************************************************************/
     561void rpc_mapper_move_user_client( cxy_t             cxy,
     562                                  struct mapper_s * mapper,
     563                                  bool_t            to_buffer,
     564                                  uint32_t          file_offset,
     565                                  void            * buffer,
     566                                  uint32_t          size,
     567                                  error_t         * error );
     568
     569void rpc_mapper_move_user_server( xptr_t xp );
     570
     571/***********************************************************************************
     572 * [25] The RPC__MAPPER_HANDLE_MISS allows a client thread to request a remote
     573 * mapper to load a missing page from the IOC device.
     574 * On the server side, this RPC call the mapper_handle_miss() function and return
     575 * an extended pointer on the allocated page descriptor and an error status.
     576 * @ cxy         : server cluster identifier.
     577 * @ mapper      : [in]  local pointer on mapper.
     578 * @ page_id     : [in]  missing page index in mapper
     579 * @ buffer      : [in]  user space pointer / kernel extended pointer
     580 * @ page_xp     : [out] pointer on buffer for extended pointer on page descriptor.
     581 * @ error       : [out] error status (0 if success).
     582 **********************************************************************************/
     583void rpc_mapper_handle_miss_client( cxy_t             cxy,
     584                                    struct mapper_s * mapper,
     585                                    uint32_t          page_id,
     586                                    xptr_t          * page_xp,
     587                                    error_t         * error );
     588 
     589void rpc_mapper_handle_miss_server( xptr_t xp );
     590
     591/***********************************************************************************
     592 * [26] undefined slot
     593 **********************************************************************************/
     594
     595/***********************************************************************************
     596 * [27] The RPC_VMM_CREATE_VSEG allows a client thread to request the remote
    596597 * reference cluster of a given process to allocate and register in the reference
    597598 * process VMM a new vseg descriptor.
     
    624625
    625626/***********************************************************************************
    626  * [27] undefined slot
    627  **********************************************************************************/
    628 
    629 /***********************************************************************************
    630627 * [28] The RPC_VMM_SET_COW allows a client thread to request the remote reference
    631628 * cluster to set the COW flag and reset the WRITABLE flag of all GPT entries for
Note: See TracChangeset for help on using the changeset viewer.