Ignore:
Timestamp:
Mar 18, 2020, 11:16:59 PM (5 years ago)
Author:
alain
Message:

Introduce remote_buf.c/.h & socket.c/.h files.
Update dev_nic.c/.h files.

File:
1 edited

Legend:

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

    r641 r657  
    22 * rpc.c - RPC operations implementation.
    33 *
    4  * Author    Alain Greiner (2016,2017,2018,2019)
     4 * Author    Alain Greiner (2016,2017,2018,2019,2020)
    55 *
    66 * Copyright (c)  UPMC Sorbonne Universites
     
    5959    &rpc_thread_user_create_server,        // 6
    6060    &rpc_thread_kernel_create_server,      // 7
    61     &rpc_vfs_fs_update_dentry_server,      // 8
     61    &rpc_undefined,                        // 8
    6262    &rpc_process_sigaction_server,         // 9
    6363
    64     &rpc_vfs_inode_create_server,          // 10 
    65     &rpc_vfs_inode_destroy_server,         // 11 
    66     &rpc_vfs_dentry_create_server,         // 12 
    67     &rpc_vfs_dentry_destroy_server,        // 13 
    68     &rpc_vfs_file_create_server,           // 14
    69     &rpc_vfs_file_destroy_server,          // 15
    70     &rpc_vfs_fs_new_dentry_server,         // 16
    71     &rpc_vfs_fs_add_dentry_server,         // 17
    72     &rpc_vfs_fs_remove_dentry_server,      // 18
    73     &rpc_vfs_inode_load_all_pages_server,  // 19
    74 
    75     &rpc_undefined,                        // 20
    76     &rpc_undefined,                        // 21
    77     &rpc_undefined,                        // 22
    78     &rpc_undefined,                        // 23
    79     &rpc_mapper_sync_server,               // 24
    80     &rpc_vmm_resize_vseg_server,           // 25
    81     &rpc_vmm_remove_vseg_server,           // 26
    82     &rpc_vmm_create_vseg_server,           // 27
    83     &rpc_vmm_set_cow_server,               // 28
    84     &rpc_undefined,                        // 29
     64    &rpc_undefined,                        // 10
     65    &rpc_undefined,                        // 11
     66    &rpc_undefined,                        // 12
     67    &rpc_undefined,                        // 13
     68    &rpc_undefined,                        // 14
     69    &rpc_vmm_resize_vseg_server,           // 15
     70    &rpc_vmm_remove_vseg_server,           // 16
     71    &rpc_vmm_create_vseg_server,           // 17
     72    &rpc_vmm_set_cow_server,               // 18
     73    &rpc_undefined,                        // 19
    8574};
    8675
     
    9584    "THREAD_USER_CREATE",        // 6
    9685    "THREAD_KERNEL_CREATE",      // 7
    97     "VFS_FS_UPDATE_DENTRY",      // 8
     86    "FBF_DISPLAY",               // 8
    9887    "PROCESS_SIGACTION",         // 9
    9988
    100     "VFS_INODE_CREATE",          // 10
    101     "VFS_INODE_DESTROY",         // 11
    102     "VFS_DENTRY_CREATE",         // 12
    103     "VFS_DENTRY_DESTROY",        // 13
    104     "VFS_FILE_CREATE",           // 14
    105     "VFS_FILE_DESTROY",          // 15
    106     "VFS_FS_NEW_DENTRY",         // 16
    107     "VFS_FS_ADD_DENTRY",         // 17
    108     "VFS_FS_REMOVE_DENTRY",      // 18
    109     "VFS_INODE_LOAD_ALL_PAGES",  // 19
    110 
    111     "VMM_GLOBAL_RESIZE_VSEG",    // 20
    112     "VMM_GLOBAL_UPDATE_PTE",     // 21
    113     "undefined_22",              // 22
    114     "undefined_23",              // 23
    115     "MAPPER_SYNC",               // 24
    116     "undefined_25",              // 25
    117     "VMM_REMOVE_VSEG",           // 26
    118     "VMM_CREATE_VSEG",           // 27
    119     "VMM_SET_COW",               // 28
    120     "undefined_29",              // 29
     89    "undefined_10",              // 10
     90    "undefined_11",              // 11
     91    "undefined_12",              // 12
     92    "undefined_13",              // 13
     93    "undefined_14",              // 14
     94    "VMM_RESIZE_VSEG",           // 15
     95    "VMM_REMOVE_VSEG",           // 16
     96    "VMM_CREATE_VSEG",           // 17
     97    "VMM_SET_COW",               // 18
     98    "undefined_19",              // 19
    12199};
    122100
     
    423401
    424402
    425 /////////////////////////////////////////////////////////////////////////////////////////
    426 // [0]       RPC_PMEM_GET_PAGES deprecated [AG] May 2019
    427 /////////////////////////////////////////////////////////////////////////////////////////
    428 
    429 /*
    430 ///////////////////////////////////////////////
    431 void rpc_pmem_get_pages_client( cxy_t      cxy,
    432                                 uint32_t   order,      // in
    433                                 page_t  ** page )      // out
    434 {
    435 #if DEBUG_RPC_PMEM_GET_PAGES
    436 thread_t * this = CURRENT_THREAD;
    437 uint32_t cycle = (uint32_t)hal_get_cycles();
    438 if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
    439 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    440 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    441 #endif
    442 
    443     uint32_t responses = 1;
    444 
    445     // initialise RPC descriptor header
    446     rpc_desc_t  rpc;
    447     rpc.index     = RPC_PMEM_GET_PAGES;
    448     rpc.blocking  = true;
    449     rpc.rsp       = &responses;
    450 
    451     // set input arguments in RPC descriptor
    452     rpc.args[0] = (uint64_t)order;
    453 
    454     // register RPC request in remote RPC fifo
    455     rpc_send( cxy , &rpc );
    456 
    457     // get output arguments from RPC descriptor
    458     *page = (page_t *)(intptr_t)rpc.args[1];
    459 
    460 #if DEBUG_RPC_PMEM_GET_PAGES
    461 cycle = (uint32_t)hal_get_cycles();
    462 if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
    463 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    464 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    465 #endif
    466 }
    467 
    468 ///////////////////////////////////////////
    469 void rpc_pmem_get_pages_server( xptr_t xp )
    470 {
    471 #if DEBUG_RPC_PMEM_GET_PAGES
    472 thread_t * this = CURRENT_THREAD;
    473 uint32_t cycle = (uint32_t)hal_get_cycles();
    474 if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
    475 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    476 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    477 #endif
    478 
    479     // get client cluster identifier and pointer on RPC descriptor
    480     cxy_t        cxy  = GET_CXY( xp );
    481     rpc_desc_t * desc = GET_PTR( xp );
    482 
    483     // get input arguments from client RPC descriptor
    484     uint32_t order = (uint32_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) );
    485    
    486     // call local pmem allocator
    487     page_t * page = ppm_alloc_pages( order );
    488 
    489     // set output arguments into client RPC descriptor
    490     hal_remote_s64( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
    491 
    492 #if DEBUG_RPC_PMEM_GET_PAGES
    493 cycle = (uint32_t)hal_get_cycles();
    494 if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
    495 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    496 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    497 #endif
    498 }
    499 */
    500 
    501 /////////////////////////////////////////////////////////////////////////////////////////
    502 // [1]       RPC_PMEM_RELEASE_PAGES deprecated [AG] may 2019
    503 /////////////////////////////////////////////////////////////////////////////////////////
    504 
    505 /*
    506 //////////////////////////////////////////////////
    507 void rpc_pmem_release_pages_client( cxy_t     cxy,
    508                                     page_t  * page )      // out
    509 {
    510 #if DEBUG_RPC_PMEM_RELEASE_PAGES
    511 thread_t * this = CURRENT_THREAD;
    512 uint32_t cycle = (uint32_t)hal_get_cycles();
    513 if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
    514 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    515 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    516 #endif
    517 
    518     uint32_t responses = 1;
    519 
    520     // initialise RPC descriptor header
    521     rpc_desc_t  rpc;
    522     rpc.index    = RPC_PMEM_RELEASE_PAGES;
    523     rpc.blocking = true;
    524     rpc.rsp      = &responses;
    525 
    526     // set input arguments in RPC descriptor
    527     rpc.args[0] = (uint64_t)(intptr_t)page;
    528 
    529     // register RPC request in remote RPC fifo
    530     rpc_send( cxy , &rpc );
    531 
    532 #if DEBUG_RPC_PMEM_RELEASE_PAGES
    533 cycle = (uint32_t)hal_get_cycles();
    534 if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
    535 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    536 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    537 #endif
    538 }
    539 
    540 ///////////////////////////////////////////////
    541 void rpc_pmem_release_pages_server( xptr_t xp )
    542 {
    543 #if DEBUG_RPC_PMEM_RELEASE_PAGES
    544 thread_t * this = CURRENT_THREAD;
    545 uint32_t cycle = (uint32_t)hal_get_cycles();
    546 if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
    547 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    548 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    549 #endif
    550 
    551     // get client cluster identifier and pointer on RPC descriptor
    552     cxy_t        cxy  = GET_CXY( xp );
    553     rpc_desc_t * desc = GET_PTR( xp );
    554 
    555     // get input arguments from client RPC descriptor
    556     page_t * page = (page_t *)(intptr_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) );
    557    
    558     // release memory to local pmem
    559     kmem_req_t req;
    560     req.type = KMEM_PPM;
    561     req.ptr  = page;
    562     kmem_free( &req );
    563 
    564 #if DEBUG_RPC_PMEM_RELEASE_PAGES
    565 cycle = (uint32_t)hal_get_cycles();
    566 if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
    567 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    568 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    569 #endif
    570 }
    571 */
    572 
    573 /////////////////////////////////////////////////////////////////////////////////////////
    574 // [2]          RPC_PPM_DISPLAY deprecated [AG] May 2019   
    575 /////////////////////////////////////////////////////////////////////////////////////////
    576 
    577 /*
    578 /////////////////////////////////////////
    579 void rpc_ppm_display_client( cxy_t  cxy )
    580 {
    581 #if DEBUG_RPC_PPM_DISPLAY
    582 thread_t * this = CURRENT_THREAD;
    583 uint32_t cycle = (uint32_t)hal_get_cycles();
    584 if( cycle > DEBUG_RPC_PPM_DISPLAY )
    585 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    586 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    587 #endif
    588 
    589     uint32_t responses = 1;
    590 
    591     // initialise RPC descriptor header
    592     rpc_desc_t  rpc;
    593     rpc.index    = RPC_PPM_DISPLAY;
    594     rpc.blocking = true;
    595     rpc.rsp      = &responses;
    596 
    597     // register RPC request in remote RPC fifo
    598     rpc_send( cxy , &rpc );
    599 
    600 #if DEBUG_RPC_PPM_DISPLAY
    601 cycle = (uint32_t)hal_get_cycles();
    602 if( cycle > DEBUG_RPC_PPM_DISPLAY )
    603 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    604 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    605 #endif
    606 }
    607 
    608 ////////////////////////////////////////////////////////////////////
    609 void rpc_ppm_display_server( xptr_t __attribute__((__unused__)) xp )
    610 {
    611 #if DEBUG_RPC_PPM_DISPLAY
    612 thread_t * this = CURRENT_THREAD;
    613 uint32_t cycle = (uint32_t)hal_get_cycles();
    614 if( cycle > DEBUG_RPC_PPM_DISPLAY )
    615 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    616 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    617 #endif
    618 
    619     // call local kernel function
    620     ppm_display();
    621 
    622 #if DEBUG_RPC_PPM_DISPLAY
    623 cycle = (uint32_t)hal_get_cycles();
    624 if( cycle > DEBUG_RPC_PPM_DISPLAY )
    625 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    626 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    627 #endif
    628 }
    629 */
    630 
    631 /////////////////////////////////////////////////////////////////////////////////////////
    632 // [3]           Marshaling functions attached to RPC_PROCESS_MAKE_FORK
     403/***************************************************************************************/
     404/************ Marshaling functions ordered by increasing index *************************/
     405/***************************************************************************************/
     406
     407
     408/////////////////////////////////////////////////////////////////////////////////////////
     409// [0]           undefined                                               
     410/////////////////////////////////////////////////////////////////////////////////////////
     411
     412/////////////////////////////////////////////////////////////////////////////////////////
     413// [1]           undefined                                               
     414/////////////////////////////////////////////////////////////////////////////////////////
     415
     416/////////////////////////////////////////////////////////////////////////////////////////
     417// [2]           undefined                                               
     418/////////////////////////////////////////////////////////////////////////////////////////
     419
     420
     421/////////////////////////////////////////////////////////////////////////////////////////
     422// [3]           Marshaling function attached to RPC_MAKE_FORK           
    633423/////////////////////////////////////////////////////////////////////////////////////////
    634424
     
    1073863
    1074864/////////////////////////////////////////////////////////////////////////////////////////
    1075 // [8]   Marshaling functions attached to RPC_VFS_FS_UPDATE_DENTRY
    1076 /////////////////////////////////////////////////////////////////////////////////////////
    1077 
    1078 /////////////////////////////////////////////////////////
    1079 void rpc_vfs_fs_update_dentry_client( cxy_t          cxy,
    1080                                       vfs_inode_t  * inode,
    1081                                       vfs_dentry_t * dentry,
    1082                                       uint32_t       size,
    1083                                       error_t      * error )
    1084 {
    1085 #if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
    1086 thread_t * this = CURRENT_THREAD;
    1087 uint32_t cycle = (uint32_t)hal_get_cycles();
    1088 if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
    1089 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1090 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1091 #endif
    1092 
    1093     uint32_t responses = 1;
    1094 
    1095     // initialise RPC descriptor header
    1096     rpc_desc_t  rpc;
    1097     rpc.index    = RPC_VFS_FS_UPDATE_DENTRY;
    1098     rpc.blocking = true;
    1099     rpc.rsp      = &responses;
    1100 
    1101     // set input arguments in RPC descriptor
    1102     rpc.args[0] = (uint64_t)(intptr_t)inode;
    1103     rpc.args[1] = (uint64_t)(intptr_t)dentry;
    1104     rpc.args[2] = (uint64_t)size;
    1105 
    1106     // register RPC request in remote RPC fifo
    1107     rpc_send( cxy , &rpc );
    1108 
    1109     // get output values from RPC descriptor
    1110     *error   = (error_t)rpc.args[3];
    1111 
    1112 #if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
    1113 cycle = (uint32_t)hal_get_cycles();
    1114 if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
    1115 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1116 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1117 #endif
    1118 }
    1119 
    1120 /////////////////////////////////////////////////
    1121 void rpc_vfs_fs_update_dentry_server( xptr_t xp )
    1122 {
    1123 #if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
    1124 thread_t * this = CURRENT_THREAD;
    1125 uint32_t cycle = (uint32_t)hal_get_cycles();
    1126 if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
    1127 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1128 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1129 #endif
    1130 
    1131     error_t        error;
    1132     vfs_inode_t  * inode;
    1133     vfs_dentry_t * dentry;
    1134     uint32_t       size;
    1135 
    1136     // get client cluster identifier and pointer on RPC descriptor
    1137     cxy_t        client_cxy  = GET_CXY( xp );
    1138     rpc_desc_t * desc        = GET_PTR( xp );
    1139 
    1140     // get input arguments
    1141     inode  = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
    1142     dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
    1143     size   = (uint32_t)               hal_remote_l64(XPTR(client_cxy , &desc->args[2]));
    1144 
    1145     // call the kernel function
    1146     error = vfs_fs_update_dentry( inode , dentry , size );
    1147 
    1148     // set output argument
    1149     hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    1150 
    1151 #if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
    1152 cycle = (uint32_t)hal_get_cycles();
    1153 if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
    1154 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1155 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1156 #endif
    1157 }
     865// [8]      undefined
     866/////////////////////////////////////////////////////////////////////////////////////////
    1158867
    1159868/////////////////////////////////////////////////////////////////////////////////////////
     
    1197906process_action_str( action ), pid, cycle );
    1198907#endif
    1199 }  // end rpc_process_sigaction_client()
     908}
    1200909
    1201910//////////////////////////////////////////////
     
    1241950process_action_str( action ), pid, cycle );
    1242951#endif
    1243 } // end rpc_process_sigaction_server()
    1244 
    1245 /////////////////////////////////////////////////////////////////////////////////////////
    1246 // [10]     Marshaling functions attached to RPC_VFS_INODE_CREATE
    1247 /////////////////////////////////////////////////////////////////////////////////////////
    1248 
    1249 /////////////////////////////////////////////////////
    1250 void rpc_vfs_inode_create_client( cxy_t          cxy,     
    1251                                   uint32_t       fs_type,    // in
    1252                                   uint32_t       attr,       // in
    1253                                   uint32_t       rights,     // in
    1254                                   uint32_t       uid,        // in
    1255                                   uint32_t       gid,        // in
    1256                                   xptr_t       * inode_xp,   // out
    1257                                   error_t      * error )     // out
    1258 {
    1259 #if DEBUG_RPC_VFS_INODE_CREATE
    1260 thread_t * this = CURRENT_THREAD;
    1261 uint32_t cycle = (uint32_t)hal_get_cycles();
    1262 if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
    1263 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1264 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1265 #endif
    1266 
    1267     uint32_t responses = 1;
    1268 
    1269     // initialise RPC descriptor header
    1270     rpc_desc_t  rpc;
    1271     rpc.index    = RPC_VFS_INODE_CREATE;
    1272     rpc.blocking = true;
    1273     rpc.rsp      = &responses;
    1274 
    1275     // set input arguments in RPC descriptor
    1276     rpc.args[0] = (uint64_t)fs_type;
    1277     rpc.args[1] = (uint64_t)attr;
    1278     rpc.args[2] = (uint64_t)rights;
    1279     rpc.args[3] = (uint64_t)uid;
    1280     rpc.args[4] = (uint64_t)gid;
    1281 
    1282     // register RPC request in remote RPC fifo
    1283     rpc_send( cxy , &rpc );
    1284 
    1285     // get output values from RPC descriptor
    1286     *inode_xp = (xptr_t)rpc.args[5];
    1287     *error    = (error_t)rpc.args[6];
    1288 
    1289 #if DEBUG_RPC_VFS_INODE_CREATE
    1290 cycle = (uint32_t)hal_get_cycles();
    1291 if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
    1292 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1293 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1294 #endif
    1295 }
    1296 
    1297 /////////////////////////////////////////////
    1298 void rpc_vfs_inode_create_server( xptr_t xp )
    1299 {
    1300 #if DEBUG_RPC_VFS_INODE_CREATE
    1301 thread_t * this = CURRENT_THREAD;
    1302 uint32_t cycle = (uint32_t)hal_get_cycles();
    1303 if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
    1304 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1305 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1306 #endif
    1307 
    1308     uint32_t         fs_type;
    1309     uint32_t         attr;
    1310     uint32_t         rights;
    1311     uint32_t         uid;
    1312     uint32_t         gid;
    1313     xptr_t           inode_xp;
    1314     error_t          error;
    1315 
    1316     // get client cluster identifier and pointer on RPC descriptor
    1317     cxy_t        client_cxy  = GET_CXY( xp );
    1318     rpc_desc_t * desc        = GET_PTR( xp );
    1319 
    1320     // get input arguments from client rpc descriptor
    1321     fs_type    = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    1322     attr       = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
    1323     rights     = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
    1324     uid        = (uid_t)     hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
    1325     gid        = (gid_t)     hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) );
    1326 
    1327     // call local kernel function
    1328     error = vfs_inode_create( fs_type,
    1329                               attr,
    1330                               rights,
    1331                               uid,
    1332                               gid,
    1333                               &inode_xp );
    1334 
    1335     // set output arguments
    1336     hal_remote_s64( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)inode_xp );
    1337     hal_remote_s64( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error );
    1338 
    1339 #if DEBUG_RPC_VFS_INODE_CREATE
    1340 cycle = (uint32_t)hal_get_cycles();
    1341 if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
    1342 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1343 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1344 #endif
    1345 }
    1346 
    1347 /////////////////////////////////////////////////////////////////////////////////////////
    1348 // [11]          Marshaling functions attached to RPC_VFS_INODE_DESTROY
    1349 /////////////////////////////////////////////////////////////////////////////////////////
    1350 
    1351 /////////////////////////////////////////////////////////////
    1352 void rpc_vfs_inode_destroy_client( cxy_t                cxy,
    1353                                    struct vfs_inode_s * inode )
    1354 {
    1355 #if DEBUG_RPC_VFS_INODE_DESTROY
    1356 thread_t * this = CURRENT_THREAD;
    1357 uint32_t cycle = (uint32_t)hal_get_cycles();
    1358 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
    1359 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1360 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1361 #endif
    1362 
    1363     uint32_t responses = 1;
    1364 
    1365     // initialise RPC descriptor header
    1366     rpc_desc_t  rpc;
    1367     rpc.index    = RPC_VFS_INODE_DESTROY;
    1368     rpc.blocking = true;
    1369     rpc.rsp      = &responses;
    1370 
    1371     // set input arguments in RPC descriptor
    1372     rpc.args[0] = (uint64_t)(intptr_t)inode;
    1373    
    1374     // register RPC request in remote RPC fifo
    1375     rpc_send( cxy , &rpc );
    1376 
    1377 #if DEBUG_RPC_VFS_INODE_DESTROY
    1378 cycle = (uint32_t)hal_get_cycles();
    1379 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
    1380 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1381 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1382 #endif
    1383 }
    1384 
    1385 //////////////////////////////////////////////
    1386 void rpc_vfs_inode_destroy_server( xptr_t xp )
    1387 {
    1388 #if DEBUG_RPC_VFS_INODE_DESTROY
    1389 thread_t * this = CURRENT_THREAD;
    1390 uint32_t cycle = (uint32_t)hal_get_cycles();
    1391 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
    1392 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1393 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1394 #endif
    1395 
    1396     vfs_inode_t * inode;
    1397 
    1398     // get client cluster identifier and pointer on RPC descriptor
    1399     cxy_t        client_cxy  = GET_CXY( xp );
    1400     rpc_desc_t * desc        = GET_PTR( xp );
    1401 
    1402     // get argument "inode" from client RPC descriptor
    1403     inode = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    1404                        
    1405     // call local kernel function
    1406     vfs_inode_destroy( inode );
    1407 
    1408 #if DEBUG_RPC_VFS_INODE_DESTROY
    1409 cycle = (uint32_t)hal_get_cycles();
    1410 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
    1411 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1412 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1413 #endif
    1414 }
    1415 
    1416 /////////////////////////////////////////////////////////////////////////////////////////
    1417 // [12]          Marshaling functions attached to RPC_VFS_DENTRY_CREATE
    1418 /////////////////////////////////////////////////////////////////////////////////////////
    1419 
    1420 //////////////////////////////////////////////////////////////
    1421 void rpc_vfs_dentry_create_client( cxy_t                  cxy,
    1422                                    uint32_t               type,         // in
    1423                                    char                 * name,         // in
    1424                                    xptr_t               * dentry_xp,    // out
    1425                                    error_t              * error )       // out
    1426 {
    1427 #if DEBUG_RPC_VFS_DENTRY_CREATE
    1428 thread_t * this = CURRENT_THREAD;
    1429 uint32_t cycle = (uint32_t)hal_get_cycles();
    1430 if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
    1431 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1432 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1433 #endif
    1434 
    1435     uint32_t responses = 1;
    1436 
    1437     // initialise RPC descriptor header
    1438     rpc_desc_t  rpc;
    1439     rpc.index    = RPC_VFS_DENTRY_CREATE;
    1440     rpc.blocking = true;
    1441     rpc.rsp      = &responses;
    1442 
    1443     // set input arguments in RPC descriptor
    1444     rpc.args[0] = (uint64_t)type;
    1445     rpc.args[1] = (uint64_t)(intptr_t)name;
    1446 
    1447     // register RPC request in remote RPC fifo
    1448     rpc_send( cxy , &rpc );
    1449 
    1450     // get output values from RPC descriptor
    1451     *dentry_xp = (xptr_t)rpc.args[2];
    1452     *error     = (error_t)rpc.args[3];
    1453 
    1454 #if DEBUG_RPC_VFS_DENTRY_CREATE
    1455 cycle = (uint32_t)hal_get_cycles();
    1456 if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
    1457 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1458 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1459 #endif
    1460 }
    1461 
    1462 //////////////////////////////////////////////
    1463 void rpc_vfs_dentry_create_server( xptr_t xp )
    1464 {
    1465 #if DEBUG_RPC_VFS_DENTRY_CREATE
    1466 thread_t * this = CURRENT_THREAD;
    1467 uint32_t cycle = (uint32_t)hal_get_cycles();
    1468 if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
    1469 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1470 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1471 #endif
    1472 
    1473     uint32_t      type;
    1474     char        * name;
    1475     xptr_t        dentry_xp;
    1476     error_t       error;
    1477     char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
    1478 
    1479     // get client cluster identifier and pointer on RPC descriptor
    1480     cxy_t        client_cxy  = GET_CXY( xp );
    1481     rpc_desc_t * desc        = GET_PTR( xp );
    1482 
    1483     // get arguments "name", "type", and "parent" from client RPC descriptor
    1484     type   = (uint32_t)         hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    1485     name   = (char *)(intptr_t) hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
    1486 
    1487     // makes a local copy of  name
    1488     hal_remote_strcpy( XPTR( local_cxy , name_copy ),
    1489                        XPTR( client_cxy , name ) );
    1490 
    1491     // call local kernel function
    1492     error = vfs_dentry_create( type,
    1493                                name_copy,
    1494                                &dentry_xp );
    1495     // set output arguments
    1496     hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)dentry_xp );
    1497     hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    1498 
    1499 #if DEBUG_RPC_VFS_DENTRY_CREATE
    1500 cycle = (uint32_t)hal_get_cycles();
    1501 if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
    1502 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1503 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1504 #endif
    1505 }
    1506 
    1507 /////////////////////////////////////////////////////////////////////////////////////////
    1508 // [13]          Marshaling functions attached to RPC_VFS_DENTRY_DESTROY
    1509 /////////////////////////////////////////////////////////////////////////////////////////
    1510 
    1511 ///////////////////////////////////////////////////////
    1512 void rpc_vfs_dentry_destroy_client( cxy_t          cxy,
    1513                                     vfs_dentry_t * dentry )
    1514 {
    1515 #if DEBUG_RPC_VFS_DENTRY_DESTROY
    1516 thread_t * this = CURRENT_THREAD;
    1517 uint32_t cycle = (uint32_t)hal_get_cycles();
    1518 if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
    1519 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1520 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1521 #endif
    1522 
    1523     uint32_t responses = 1;
    1524 
    1525     // initialise RPC descriptor header
    1526     rpc_desc_t  rpc;
    1527     rpc.index    = RPC_VFS_DENTRY_DESTROY;
    1528     rpc.blocking = true;
    1529     rpc.rsp      = &responses;
    1530 
    1531     // set input arguments in RPC descriptor
    1532     rpc.args[0] = (uint64_t)(intptr_t)dentry;
    1533    
    1534     // register RPC request in remote RPC fifo
    1535     rpc_send( cxy , &rpc );
    1536 
    1537 #if DEBUG_RPC_VFS_DENTRY_DESTROY
    1538 cycle = (uint32_t)hal_get_cycles();
    1539 if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
    1540 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1541 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1542 #endif
    1543 }
    1544 
    1545 ///////////////////////////////////////////////
    1546 void rpc_vfs_dentry_destroy_server( xptr_t xp )
    1547 {
    1548 #if DEBUG_RPC_VFS_DENTRY_DESTROY
    1549 thread_t * this = CURRENT_THREAD;
    1550 uint32_t cycle = (uint32_t)hal_get_cycles();
    1551 if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
    1552 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1553 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1554 #endif
    1555 
    1556     vfs_dentry_t * dentry;
    1557 
    1558     // get client cluster identifier and pointer on RPC descriptor
    1559     cxy_t        client_cxy  = GET_CXY( xp );
    1560     rpc_desc_t * desc        = GET_PTR( xp );
    1561 
    1562     // get arguments "dentry" from client RPC descriptor
    1563     dentry = (vfs_dentry_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    1564                        
    1565     // call local kernel function
    1566     vfs_dentry_destroy( dentry );
    1567 
    1568 #if DEBUG_RPC_VFS_DENTRY_DESTROY
    1569 cycle = (uint32_t)hal_get_cycles();
    1570 if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
    1571 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1572 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1573 #endif
    1574 }
    1575 
    1576 
    1577 /////////////////////////////////////////////////////////////////////////////////////////
    1578 // [14]          Marshaling functions attached to RPC_VFS_FILE_CREATE 
    1579 /////////////////////////////////////////////////////////////////////////////////////////
    1580 
    1581 //////////////////////////////////////////////////////////////
    1582 void rpc_vfs_file_create_client( cxy_t                  cxy,
    1583                                  struct vfs_inode_s   * inode,       // in
    1584                                  uint32_t               file_attr,   // in
    1585                                  xptr_t               * file_xp,     // out
    1586                                  error_t              * error )      // out
    1587 {
    1588 #if DEBUG_RPC_VFS_FILE_CREATE
    1589 thread_t * this = CURRENT_THREAD;
    1590 uint32_t cycle = (uint32_t)hal_get_cycles();
    1591 if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
    1592 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1593 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1594 #endif
    1595 
    1596     uint32_t responses = 1;
    1597 
    1598     // initialise RPC descriptor header
    1599     rpc_desc_t  rpc;
    1600     rpc.index    = RPC_VFS_FILE_CREATE;
    1601     rpc.blocking = true;
    1602     rpc.rsp      = &responses;
    1603 
    1604     // set input arguments in RPC descriptor
    1605     rpc.args[0] = (uint64_t)(intptr_t)inode;
    1606     rpc.args[1] = (uint64_t)file_attr;
    1607 
    1608     // register RPC request in remote RPC fifo
    1609     rpc_send( cxy , &rpc );
    1610 
    1611     // get output values from RPC descriptor
    1612     *file_xp = (xptr_t)rpc.args[2];
    1613     *error   = (error_t)rpc.args[3];
    1614 
    1615 #if DEBUG_RPC_VFS_FILE_CREATE
    1616 cycle = (uint32_t)hal_get_cycles();
    1617 if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
    1618 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1619 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1620 #endif
    1621 }
    1622 
    1623 ////////////////////////////////////////////
    1624 void rpc_vfs_file_create_server( xptr_t xp )
    1625 {
    1626 #if DEBUG_RPC_VFS_FILE_CREATE
    1627 thread_t * this = CURRENT_THREAD;
    1628 uint32_t cycle = (uint32_t)hal_get_cycles();
    1629 if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
    1630 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1631 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1632 #endif
    1633 
    1634     uint32_t      file_attr;
    1635     vfs_inode_t * inode;
    1636     xptr_t        file_xp;
    1637     error_t       error;
    1638 
    1639     // get client cluster identifier and pointer on RPC descriptor
    1640     cxy_t        client_cxy  = GET_CXY( xp );
    1641     rpc_desc_t * desc        = GET_PTR( xp );
    1642 
    1643     // get arguments "file_attr" and "inode" from client RPC descriptor
    1644     inode     = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    1645     file_attr = (uint32_t)               hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
    1646                        
    1647     // call local kernel function
    1648     error = vfs_file_create( inode,
    1649                              file_attr,
    1650                              &file_xp );
    1651  
    1652     // set output arguments
    1653     hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)file_xp );
    1654     hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    1655 
    1656 #if DEBUG_RPC_VFS_FILE_CREATE
    1657 cycle = (uint32_t)hal_get_cycles();
    1658 if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
    1659 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1660 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1661 #endif
    1662 }
    1663 
    1664 /////////////////////////////////////////////////////////////////////////////////////////
    1665 // [15]          Marshaling functions attached to RPC_VFS_FILE_DESTROY 
    1666 /////////////////////////////////////////////////////////////////////////////////////////
    1667 
    1668 ///////////////////////////////////////////////////
    1669 void rpc_vfs_file_destroy_client( cxy_t        cxy,
    1670                                   vfs_file_t * file )
    1671 {
    1672 #if DEBUG_RPC_VFS_FILE_DESTROY
    1673 thread_t * this = CURRENT_THREAD;
    1674 uint32_t cycle = (uint32_t)hal_get_cycles();
    1675 if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
    1676 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1677 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1678 #endif
    1679 
    1680     uint32_t responses = 1;
    1681 
    1682     // initialise RPC descriptor header
    1683     rpc_desc_t  rpc;
    1684     rpc.index    = RPC_VFS_FILE_DESTROY;
    1685     rpc.blocking = true;
    1686     rpc.rsp      = &responses;
    1687 
    1688     // set input arguments in RPC descriptor
    1689     rpc.args[0] = (uint64_t)(intptr_t)file;
    1690    
    1691     // register RPC request in remote RPC fifo
    1692     rpc_send( cxy , &rpc );
    1693 
    1694 #if DEBUG_RPC_VFS_FILE_DESTROY
    1695 cycle = (uint32_t)hal_get_cycles();
    1696 if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
    1697 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1698 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1699 #endif
    1700 }
    1701 
    1702 /////////////////////////////////////////////
    1703 void rpc_vfs_file_destroy_server( xptr_t xp )
    1704 {
    1705 #if DEBUG_RPC_VFS_FILE_DESTROY
    1706 thread_t * this = CURRENT_THREAD;
    1707 uint32_t cycle = (uint32_t)hal_get_cycles();
    1708 if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
    1709 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1710 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1711 #endif
    1712 
    1713     vfs_file_t * file;
    1714 
    1715     // get client cluster identifier and pointer on RPC descriptor
    1716     cxy_t        client_cxy  = GET_CXY( xp );
    1717     rpc_desc_t * desc        = GET_PTR( xp );
    1718 
    1719     // get arguments "dentry" from client RPC descriptor
    1720     file = (vfs_file_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    1721                        
    1722     // call local kernel function
    1723     vfs_file_destroy( file );
    1724 
    1725 #if DEBUG_RPC_VFS_FILE_DESTROY
    1726 cycle = (uint32_t)hal_get_cycles();
    1727 if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
    1728 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1729 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
    1730 #endif
    1731 }
    1732 
    1733 /////////////////////////////////////////////////////////////////////////////////////////
    1734 // [16]      Marshaling functions attached to RPC_VFS_FS_GET_DENTRY
    1735 /////////////////////////////////////////////////////////////////////////////////////////
    1736 
    1737 /////////////////////////////////////////////////////////
    1738 void rpc_vfs_fs_new_dentry_client( cxy_t         cxy,
    1739                                    vfs_inode_t * parent_inode,    // in
    1740                                    char        * name,            // in
    1741                                    xptr_t        child_inode_xp,  // in
    1742                                    error_t     * error )          // out
    1743 {
    1744 #if DEBUG_RPC_VFS_FS_NEW_DENTRY
    1745 thread_t * this = CURRENT_THREAD;
    1746 uint32_t cycle = (uint32_t)hal_get_cycles();
    1747 if( cycle > DEBUG_RPC_VFS_FS_NEW_DENTRY )
    1748 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1749 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1750 #endif
    1751 
    1752     uint32_t responses = 1;
    1753 
    1754     // initialise RPC descriptor header
    1755     rpc_desc_t  rpc;
    1756     rpc.index    = RPC_VFS_FS_NEW_DENTRY;
    1757     rpc.blocking = true;
    1758     rpc.rsp      = &responses;
    1759 
    1760     // set input arguments in RPC descriptor
    1761     rpc.args[0] = (uint64_t)(intptr_t)parent_inode;
    1762     rpc.args[1] = (uint64_t)(intptr_t)name;
    1763     rpc.args[2] = (uint64_t)child_inode_xp;
    1764 
    1765     // register RPC request in remote RPC fifo
    1766     rpc_send( cxy , &rpc );
    1767 
    1768     // get output values from RPC descriptor
    1769     *error   = (error_t)rpc.args[3];
    1770 
    1771 #if DEBUG_RPC_VFS_FS_NEW_DENTRY
    1772 cycle = (uint32_t)hal_get_cycles();
    1773 if( cycle > DEBUG_RPC_VFS_FS_NEW_DENTRY )
    1774 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1775 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1776 #endif
    1777 }
    1778 
    1779 //////////////////////////////////////////////
    1780 void rpc_vfs_fs_new_dentry_server( xptr_t xp )
    1781 {
    1782 #if DEBUG_RPC_VFS_FS_NEW_DENTRY
    1783 thread_t * this = CURRENT_THREAD;
    1784 uint32_t cycle = (uint32_t)hal_get_cycles();
    1785 if( cycle > DEBUG_RPC_VFS_FS_NEW_DENTRY )
    1786 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1787 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1788 #endif
    1789 
    1790     error_t       error;
    1791     vfs_inode_t * parent;
    1792     xptr_t        child_xp;
    1793     char        * name;
    1794 
    1795     char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
    1796 
    1797     // get client cluster identifier and pointer on RPC descriptor
    1798     cxy_t        client_cxy  = GET_CXY( xp );
    1799     rpc_desc_t * desc        = GET_PTR( xp );
    1800 
    1801     // get arguments "parent", "name", and "child_xp"
    1802     parent     = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
    1803     name       = (char*)(intptr_t)       hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
    1804     child_xp   = (xptr_t)                hal_remote_l64(XPTR(client_cxy , &desc->args[2]));
    1805 
    1806     // get name local copy
    1807     hal_remote_strcpy( XPTR( local_cxy , name_copy ) ,
    1808                        XPTR( client_cxy , name ) );
    1809 
    1810     // call the kernel function
    1811     error = vfs_fs_new_dentry( parent , name_copy , child_xp );
    1812 
    1813     // set output argument
    1814     hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    1815 
    1816 #if DEBUG_RPC_VFS_FS_NEW_DENTRY
    1817 cycle = (uint32_t)hal_get_cycles();
    1818 if( cycle > DEBUG_RPC_VFS_FS_NEW_DENTRY )
    1819 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1820 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1821 #endif
    1822 }
    1823 
    1824 /////////////////////////////////////////////////////////////////////////////////////////
    1825 // [17]      Marshaling function attached to RPC_VFS_FS_ADD_DENTRY 
    1826 /////////////////////////////////////////////////////////////////////////////////////////
    1827 
    1828 void rpc_vfs_fs_add_dentry_client( cxy_t          cxy,
    1829                                    vfs_inode_t  * parent,     // in
    1830                                    vfs_dentry_t * dentry,     // in
    1831                                    error_t      * error )     // out
    1832 {
    1833 #if DEBUG_RPC_VFS_FS_ADD_DENTRY
    1834 thread_t * this = CURRENT_THREAD;
    1835 uint32_t cycle = (uint32_t)hal_get_cycles();
    1836 if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
    1837 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1838 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1839 #endif
    1840 
    1841     uint32_t responses = 1;
    1842 
    1843     // initialise RPC descriptor header
    1844     rpc_desc_t  rpc;
    1845     rpc.index    = RPC_VFS_FS_ADD_DENTRY;
    1846     rpc.blocking = true;
    1847     rpc.rsp      = &responses;
    1848 
    1849     // set input arguments in RPC descriptor
    1850     rpc.args[0] = (uint64_t)(intptr_t)parent;
    1851     rpc.args[1] = (uint64_t)(intptr_t)dentry;
    1852 
    1853     // register RPC request in remote RPC fifo
    1854     rpc_send( cxy , &rpc );
    1855 
    1856     // get output values from RPC descriptor
    1857     *error   = (error_t)rpc.args[2];
    1858 
    1859 #if DEBUG_RPC_VFS_FS_ADD_DENTRY
    1860 cycle = (uint32_t)hal_get_cycles();
    1861 if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
    1862 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1863 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1864 #endif
    1865 }
    1866 
    1867 //////////////////////////////////////////////
    1868 void rpc_vfs_fs_add_dentry_server( xptr_t xp )
    1869 {
    1870 #if DEBUG_RPC_VFS_FS_ADD_DENTRY
    1871 thread_t * this = CURRENT_THREAD;
    1872 uint32_t cycle = (uint32_t)hal_get_cycles();
    1873 if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
    1874 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1875 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1876 #endif
    1877 
    1878     error_t        error;
    1879     vfs_inode_t  * parent;
    1880     vfs_dentry_t * dentry;
    1881 
    1882     // get client cluster identifier and pointer on RPC descriptor
    1883     cxy_t        client_cxy  = GET_CXY( xp );
    1884     rpc_desc_t * desc        = GET_PTR( xp );
    1885 
    1886     // get input arguments
    1887     parent = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
    1888     dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
    1889 
    1890     // call the kernel function
    1891     error = vfs_fs_add_dentry( parent , dentry );
    1892 
    1893     // set output argument
    1894     hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)error );
    1895 
    1896 #if DEBUG_RPC_VFS_FS_ADD_DENTRY
    1897 cycle = (uint32_t)hal_get_cycles();
    1898 if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
    1899 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1900 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1901 #endif
    1902 }
    1903 
    1904 /////////////////////////////////////////////////////////////////////////////////////////
    1905 // [18]      Marshaling function attached to RPC_VFS_FS_REMOVE_DENTRY
    1906 /////////////////////////////////////////////////////////////////////////////////////////
    1907 
    1908 void rpc_vfs_fs_remove_dentry_client( cxy_t          cxy,
    1909                                       vfs_inode_t  * parent,     // in
    1910                                       vfs_dentry_t * dentry,     // in
    1911                                       error_t      * error )     // out
    1912 {
    1913 #if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
    1914 thread_t * this = CURRENT_THREAD;
    1915 uint32_t cycle = (uint32_t)hal_get_cycles();
    1916 if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
    1917 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1918 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1919 #endif
    1920 
    1921     uint32_t responses = 1;
    1922 
    1923     // initialise RPC descriptor header
    1924     rpc_desc_t  rpc;
    1925     rpc.index    = RPC_VFS_FS_REMOVE_DENTRY;
    1926     rpc.blocking = true;
    1927     rpc.rsp      = &responses;
    1928 
    1929     // set input arguments in RPC descriptor
    1930     rpc.args[0] = (uint64_t)(intptr_t)parent;
    1931     rpc.args[1] = (uint64_t)(intptr_t)dentry;
    1932 
    1933     // register RPC request in remote RPC fifo
    1934     rpc_send( cxy , &rpc );
    1935 
    1936     // get output values from RPC descriptor
    1937     *error   = (error_t)rpc.args[2];
    1938 
    1939 #if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
    1940 cycle = (uint32_t)hal_get_cycles();
    1941 if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
    1942 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1943 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1944 #endif
    1945 }
    1946 
    1947 /////////////////////////////////////////////////
    1948 void rpc_vfs_fs_remove_dentry_server( xptr_t xp )
    1949 {
    1950 #if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
    1951 thread_t * this = CURRENT_THREAD;
    1952 uint32_t cycle = (uint32_t)hal_get_cycles();
    1953 if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
    1954 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1955 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1956 #endif
    1957 
    1958     error_t        error;
    1959     vfs_inode_t  * parent;
    1960     vfs_dentry_t * dentry;
    1961 
    1962     // get client cluster identifier and pointer on RPC descriptor
    1963     cxy_t        client_cxy  = GET_CXY( xp );
    1964     rpc_desc_t * desc        = GET_PTR( xp );
    1965 
    1966     // get input arguments
    1967     parent = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
    1968     dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
    1969 
    1970     // call the kernel function
    1971     error = vfs_fs_remove_dentry( parent , dentry );
    1972 
    1973     // set output argument
    1974     hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)error );
    1975 
    1976 #if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
    1977 cycle = (uint32_t)hal_get_cycles();
    1978 if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
    1979 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    1980 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1981 #endif
    1982 }
    1983 
    1984 /////////////////////////////////////////////////////////////////////////////////////////
    1985 // [19]     Marshaling functions attached to RPC_VFS_INODE_LOAD_ALL_PAGES
    1986 /////////////////////////////////////////////////////////////////////////////////////////
    1987 
    1988 ////////////////////////////////////////////////////////////
    1989 void rpc_vfs_inode_load_all_pages_client( cxy_t         cxy,
    1990                                           vfs_inode_t * inode,      // in
    1991                                           error_t     * error )     // out
    1992 {
    1993 #if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
    1994 thread_t * this = CURRENT_THREAD;
    1995 uint32_t cycle = (uint32_t)hal_get_cycles();
    1996 if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
    1997 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    1998 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    1999 #endif
    2000 
    2001     uint32_t responses = 1;
    2002 
    2003     // initialise RPC descriptor header
    2004     rpc_desc_t  rpc;
    2005     rpc.index    = RPC_VFS_INODE_LOAD_ALL_PAGES;
    2006     rpc.blocking = true;
    2007     rpc.rsp      = &responses;
    2008 
    2009     // set input arguments in RPC descriptor
    2010     rpc.args[0] = (uint64_t)(intptr_t)inode;
    2011 
    2012     // register RPC request in remote RPC fifo
    2013     rpc_send( cxy , &rpc );
    2014 
    2015     // get output values from RPC descriptor
    2016     *error   = (error_t)rpc.args[1];
    2017 
    2018 #if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
    2019 cycle = (uint32_t)hal_get_cycles();
    2020 if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
    2021 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    2022 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2023 #endif
    2024 }
    2025 
    2026 /////////////////////////////////////////////////////
    2027 void rpc_vfs_inode_load_all_pages_server( xptr_t xp )
    2028 {
    2029 #if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
    2030 thread_t * this = CURRENT_THREAD;
    2031 uint32_t cycle = (uint32_t)hal_get_cycles();
    2032 if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
    2033 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    2034 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2035 #endif
    2036 
    2037     error_t       error;
    2038     vfs_inode_t * inode;
    2039 
    2040     // get client cluster identifier and pointer on RPC descriptor
    2041     cxy_t        client_cxy  = GET_CXY( xp );
    2042     rpc_desc_t * desc        = GET_PTR( xp );
    2043 
    2044     // get input argument
    2045     inode = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
    2046 
    2047     // call the kernel function
    2048     error = vfs_inode_load_all_pages( inode );
    2049 
    2050     // set output argument
    2051     hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
    2052 
    2053 #if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
    2054 cycle = (uint32_t)hal_get_cycles();
    2055 if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
    2056 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    2057 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2058 #endif
    2059 }
    2060 
    2061 /////////////////////////////////////////////////////////////////////////////////////////
    2062 // [20]          RPC_VMM_GET_VSEG deprecated [AG] sept 2019
    2063 /////////////////////////////////////////////////////////////////////////////////////////
    2064 
    2065 /*
    2066 //////////////////////////////////////////////////
    2067 void rpc_vmm_get_vseg_client( cxy_t       cxy,     
    2068                               process_t * process,     // in 
    2069                               intptr_t    vaddr,       // in 
    2070                               xptr_t    * vseg_xp,     // out
    2071                               error_t   * error )      // out
    2072 {
    2073 #if DEBUG_RPC_VMM_GET_VSEG
    2074 thread_t * this = CURRENT_THREAD;
    2075 uint32_t cycle = (uint32_t)hal_get_cycles();
    2076 if( cycle > DEBUG_RPC_VMM_GET_VSEG )
    2077 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    2078 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2079 #endif
    2080 
    2081     uint32_t responses = 1;
    2082 
    2083     // initialise RPC descriptor header
    2084     rpc_desc_t  rpc;
    2085     rpc.index    = RPC_VMM_GET_VSEG;
    2086     rpc.blocking = true;
    2087     rpc.rsp      = &responses;
    2088 
    2089     // set input arguments in RPC descriptor
    2090     rpc.args[0] = (uint64_t)(intptr_t)process;
    2091     rpc.args[1] = (uint64_t)vaddr;
    2092 
    2093     // register RPC request in remote RPC fifo
    2094     rpc_send( cxy , &rpc );
    2095 
    2096     // get output argument from rpc descriptor
    2097     *vseg_xp = rpc.args[2];
    2098     *error   = (error_t)rpc.args[3];
    2099 
    2100 #if DEBUG_RPC_VMM_GET_VSEG
    2101 cycle = (uint32_t)hal_get_cycles();
    2102 if( cycle > DEBUG_RPC_VMM_GET_VSEG )
    2103 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    2104 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2105 #endif
    2106 }
    2107 
    2108 /////////////////////////////////////////
    2109 void rpc_vmm_get_vseg_server( xptr_t xp )
    2110 {
    2111 #if DEBUG_RPC_VMM_GET_VSEG
    2112 thread_t * this = CURRENT_THREAD;
    2113 uint32_t cycle = (uint32_t)hal_get_cycles();
    2114 if( cycle > DEBUG_RPC_VMM_GET_VSEG )
    2115 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    2116 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2117 #endif
    2118 
    2119     process_t   * process;
    2120     intptr_t      vaddr;
    2121     vseg_t      * vseg_ptr;
    2122     xptr_t        vseg_xp;
    2123     error_t       error;
    2124 
    2125     // get client cluster identifier and pointer on RPC descriptor
    2126     cxy_t        client_cxy  = GET_CXY( xp );
    2127     rpc_desc_t * desc        = GET_PTR( xp );
    2128 
    2129     // get input argument from client RPC descriptor
    2130     process = (process_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    2131     vaddr   = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
    2132    
    2133     // call local kernel function
    2134     error = vmm_get_vseg( process , vaddr , &vseg_ptr );
    2135 
    2136     // set output arguments to client RPC descriptor
    2137     vseg_xp = XPTR( local_cxy , vseg_ptr );
    2138     hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)vseg_xp );
    2139     hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    2140 
    2141 #if DEBUG_RPC_VMM_GET_VSEG
    2142 cycle = (uint32_t)hal_get_cycles();
    2143 if( cycle > DEBUG_RPC_VMM_GET_VSEG )
    2144 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    2145 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2146 #endif
    2147 }
    2148 */
    2149 
    2150 /////////////////////////////////////////////////////////////////////////////////////////
    2151 // [21]    undefined
    2152 /////////////////////////////////////////////////////////////////////////////////////////
    2153 
    2154 /////////////////////////////////////////////////////////////////////////////////////////
    2155 // [22]          RPC_KCM_ALLOC deprecated [AG] sept 2019
    2156 /////////////////////////////////////////////////////////////////////////////////////////
    2157 
    2158 /*
    2159 //////////////////////////////////////////
    2160 void rpc_kcm_alloc_client( cxy_t      cxy,
    2161                            uint32_t   kmem_type,   // in
    2162                            xptr_t   * buf_xp )     // out
    2163 {
    2164 #if DEBUG_RPC_KCM_ALLOC
    2165 thread_t * this = CURRENT_THREAD;
    2166 uint32_t cycle = (uint32_t)hal_get_cycles();
    2167 if( cycle > DEBUG_RPC_KCM_ALLOC )
    2168 printk("\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 
    2172     uint32_t responses = 1;
    2173 
    2174     // initialise RPC descriptor header
    2175     rpc_desc_t  rpc;
    2176     rpc.index    = RPC_KCM_ALLOC;
    2177     rpc.blocking = true;
    2178     rpc.rsp      = &responses;
    2179 
    2180     // set input arguments in RPC descriptor
    2181     rpc.args[0] = (uint64_t)kmem_type;
    2182 
    2183     // register RPC request in remote RPC fifo
    2184     rpc_send( cxy , &rpc );
    2185 
    2186     // get output arguments from RPC descriptor
    2187     *buf_xp = (xptr_t)rpc.args[1];
    2188 
    2189 #if DEBUG_RPC_KCM_ALLOC
    2190 cycle = (uint32_t)hal_get_cycles();
    2191 if( cycle > DEBUG_RPC_KCM_ALLOC )
    2192 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    2193 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2194 #endif
    2195 }
    2196 
    2197 //////////////////////////////////////
    2198 void rpc_kcm_alloc_server( xptr_t xp )
    2199 {
    2200 #if DEBUG_RPC_KCM_ALLOC
    2201 thread_t * this = CURRENT_THREAD;
    2202 uint32_t cycle = (uint32_t)hal_get_cycles();
    2203 if( cycle > DEBUG_RPC_KCM_ALLOC )
    2204 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    2205 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2206 #endif
    2207 
    2208     // get client cluster identifier and pointer on RPC descriptor
    2209     cxy_t        client_cxy  = GET_CXY( xp );
    2210     rpc_desc_t * desc        = GET_PTR( xp );
    2211 
    2212     // get input argument "kmem_type" from client RPC descriptor
    2213     uint32_t kmem_type = (uint32_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    2214 
    2215     // allocates memory for kcm
    2216     kmem_req_t  req;
    2217     req.type  = kmem_type;
    2218     req.flags = AF_ZERO;
    2219     void * buf_ptr = kmem_alloc( &req );
    2220 
    2221     // set output argument
    2222     xptr_t buf_xp = XPTR( local_cxy , buf_ptr );
    2223     hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)buf_xp );
    2224 
    2225 #if DEBUG_RPC_KCM_ALLOC
    2226 cycle = (uint32_t)hal_get_cycles();
    2227 if( cycle > DEBUG_RPC_KCM_ALLOC )
    2228 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    2229 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2230 #endif
    2231 }   
    2232 */
    2233 
    2234 /////////////////////////////////////////////////////////////////////////////////////////
    2235 // [23]          RPC_KCM_FREE deprecated [AG] sept 2019
    2236 /////////////////////////////////////////////////////////////////////////////////////////
    2237 
    2238 /*
    2239 /////////////////////////////////////////
    2240 void rpc_kcm_free_client( cxy_t      cxy,
    2241                           void     * buf,          // in
    2242                           uint32_t   kmem_type )   // in
    2243 {
    2244 #if DEBUG_RPC_KCM_FREE
    2245 thread_t * this = CURRENT_THREAD;
    2246 uint32_t cycle = (uint32_t)hal_get_cycles();
    2247 if( cycle > DEBUG_RPC_KCM_FREE )
    2248 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    2249 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2250 #endif
    2251 
    2252     uint32_t responses = 1;
    2253 
    2254     // initialise RPC descriptor header
    2255     rpc_desc_t  rpc;
    2256     rpc.index    = RPC_KCM_FREE;
    2257     rpc.blocking = true;
    2258     rpc.rsp      = &responses;
    2259 
    2260     // set input arguments in RPC descriptor
    2261     rpc.args[0] = (uint64_t)(intptr_t)buf;
    2262     rpc.args[1] = (uint64_t)kmem_type;
    2263 
    2264     // register RPC request in remote RPC fifo
    2265     rpc_send( cxy , &rpc );
    2266 
    2267 #if DEBUG_RPC_KCM_FREE
    2268 cycle = (uint32_t)hal_get_cycles();
    2269 if( cycle > DEBUG_RPC_KCM_FREE )
    2270 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    2271 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2272 #endif
    2273 }
    2274 
    2275 /////////////////////////////////////
    2276 void rpc_kcm_free_server( xptr_t xp )
    2277 {
    2278 #if DEBUG_RPC_KCM_FREE
    2279 thread_t * this = CURRENT_THREAD;
    2280 uint32_t cycle = (uint32_t)hal_get_cycles();
    2281 if( cycle > DEBUG_RPC_KCM_FREE )
    2282 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    2283 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2284 #endif
    2285 
    2286     // get client cluster identifier and pointer on RPC descriptor
    2287     cxy_t        client_cxy  = GET_CXY( xp );
    2288     rpc_desc_t * desc        = GET_PTR( xp );
    2289 
    2290     // get input arguments "buf" and "kmem_type" from client RPC descriptor
    2291     void     * buf = (void *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    2292     uint32_t   kmem_type = (uint32_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
    2293 
    2294     // releases memory
    2295     kmem_req_t  req;
    2296     req.type = kmem_type;
    2297     req.ptr  = buf;
    2298     kmem_free( &req );
    2299 
    2300 #if DEBUG_RPC_KCM_FREE
    2301 cycle = (uint32_t)hal_get_cycles();
    2302 if( cycle > DEBUG_RPC_KCM_FREE )
    2303 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    2304 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2305 #endif
    2306 }   
    2307 */
    2308 
    2309 /////////////////////////////////////////////////////////////////////////////////////////
    2310 // [24]          Marshaling functions attached to RPC_MAPPER_SYNC
    2311 /////////////////////////////////////////////////////////////////////////////////////////
    2312 
    2313 ///////////////////////////////////////////////////
    2314 void rpc_mapper_sync_client( cxy_t             cxy,
    2315                              struct mapper_s * mapper,
    2316                              error_t         * error )
    2317 {
    2318 #if DEBUG_RPC_MAPPER_SYNC
    2319 thread_t * this = CURRENT_THREAD;
    2320 uint32_t cycle = (uint32_t)hal_get_cycles();
    2321 if( cycle > DEBUG_RPC_MAPPER_SYNC )
    2322 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    2323 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2324 #endif
    2325 
    2326     uint32_t responses = 1;
    2327 
    2328     // initialise RPC descriptor header
    2329     rpc_desc_t  rpc;
    2330     rpc.index    = RPC_MAPPER_SYNC;
    2331     rpc.blocking = true;
    2332     rpc.rsp      = &responses;
    2333 
    2334     // set input arguments in RPC descriptor
    2335     rpc.args[0] = (uint64_t)(intptr_t)mapper;
    2336 
    2337     // register RPC request in remote RPC fifo
    2338     rpc_send( cxy , &rpc );
    2339 
    2340     // get output values from RPC descriptor
    2341     *error   = (error_t)rpc.args[1];
    2342 
    2343 #if DEBUG_RPC_MAPPER_SYNC
    2344 cycle = (uint32_t)hal_get_cycles();
    2345 if( cycle > DEBUG_RPC_MAPPER_SYNC )
    2346 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    2347 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2348 #endif
    2349 }
    2350 
    2351 ////////////////////////////////////////
    2352 void rpc_mapper_sync_server( xptr_t xp )
    2353 {
    2354 #if DEBUG_RPC_MAPPER_SYNC
    2355 thread_t * this = CURRENT_THREAD;
    2356 uint32_t cycle = (uint32_t)hal_get_cycles();
    2357 if( cycle > DEBUG_RPC_MAPPER_SYNC )
    2358 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
    2359 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2360 #endif
    2361 
    2362     mapper_t * mapper;
    2363     error_t    error;
    2364 
    2365     // get client cluster identifier and pointer on RPC descriptor
    2366     cxy_t        client_cxy  = GET_CXY( xp );
    2367     rpc_desc_t * desc        = GET_PTR( xp );
    2368 
    2369     // get arguments from client RPC descriptor
    2370     mapper  = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    2371 
    2372     // call local kernel function
    2373     error = mapper_sync( mapper );
    2374 
    2375     // set output argument to client RPC descriptor
    2376     hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
    2377 
    2378 #if DEBUG_RPC_MAPPER_SYNC
    2379 cycle = (uint32_t)hal_get_cycles();
    2380 if( cycle > DEBUG_RPC_MAPPER_SYNC )
    2381 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
    2382 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
    2383 #endif
    2384 }
    2385 
    2386 /////////////////////////////////////////////////////////////////////////////////////////
    2387 // [25]          Marshaling functions attached to RPC_VMM_RESIZE_VSEG
     952}
     953
     954/////////////////////////////////////////////////////////////////////////////////////////
     955// [10]          undefined                                         
     956/////////////////////////////////////////////////////////////////////////////////////////
     957
     958/////////////////////////////////////////////////////////////////////////////////////////
     959// [11]          undefined                                         
     960/////////////////////////////////////////////////////////////////////////////////////////
     961
     962/////////////////////////////////////////////////////////////////////////////////////////
     963// [12]          undefined                                         
     964/////////////////////////////////////////////////////////////////////////////////////////
     965
     966/////////////////////////////////////////////////////////////////////////////////////////
     967// [13]          undefined                                       
     968/////////////////////////////////////////////////////////////////////////////////////////
     969
     970/////////////////////////////////////////////////////////////////////////////////////////
     971// [14]          undefined                                       
     972/////////////////////////////////////////////////////////////////////////////////////////
     973
     974/////////////////////////////////////////////////////////////////////////////////////////
     975// [15]          Marshaling functions attached to RPC_VMM_RESIZE_VSEG
    2388976/////////////////////////////////////////////////////////////////////////////////////////
    2389977
     
    24781066
    24791067/////////////////////////////////////////////////////////////////////////////////////////
    2480 // [26]  Marshaling functions attached to RPC_VMM_REMOVE_VSEG
     1068// [16]  Marshaling functions attached to RPC_VMM_REMOVE_VSEG
    24811069/////////////////////////////////////////////////////////////////////////////////////////
    24821070
     
    25601148
    25611149/////////////////////////////////////////////////////////////////////////////////////////
    2562 // [27]          Marshaling functions attached to RPC_VMM_CREATE_VSEG
     1150// [17]          Marshaling functions attached to RPC_VMM_CREATE_VSEG
    25631151/////////////////////////////////////////////////////////////////////////////////////////
    25641152
     
    26621250
    26631251/////////////////////////////////////////////////////////////////////////////////////////
    2664 // [28]          Marshaling functions attached to RPC_VMM_SET_COW
     1252// [18]          Marshaling functions attached to RPC_VMM_SET_COW
    26651253/////////////////////////////////////////////////////////////////////////////////////////
    26661254
     
    27301318}
    27311319
     1320
     1321
     1322/////////////////////////////////////////////////////////////////////////////////////////
     1323/////////////////////////////////////////////////////////////////////////////////////////
     1324//                            DEPRECATED RPCs
     1325/////////////////////////////////////////////////////////////////////////////////////////
     1326/////////////////////////////////////////////////////////////////////////////////////////
     1327
     1328/*
     1329
     1330/////////////////////////////////////////////////////////////////////////////////////////
     1331// [0]       RPC_PMEM_GET_PAGES deprecated [AG] May 2019
     1332/////////////////////////////////////////////////////////////////////////////////////////
     1333void rpc_pmem_get_pages_client( cxy_t      cxy,
     1334                                uint32_t   order,      // in
     1335                                page_t  ** page )      // out
     1336{
     1337#if DEBUG_RPC_PMEM_GET_PAGES
     1338thread_t * this = CURRENT_THREAD;
     1339uint32_t cycle = (uint32_t)hal_get_cycles();
     1340if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
     1341printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1342__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1343#endif
     1344
     1345    uint32_t responses = 1;
     1346
     1347    // initialise RPC descriptor header
     1348    rpc_desc_t  rpc;
     1349    rpc.index     = RPC_PMEM_GET_PAGES;
     1350    rpc.blocking  = true;
     1351    rpc.rsp       = &responses;
     1352
     1353    // set input arguments in RPC descriptor
     1354    rpc.args[0] = (uint64_t)order;
     1355
     1356    // register RPC request in remote RPC fifo
     1357    rpc_send( cxy , &rpc );
     1358
     1359    // get output arguments from RPC descriptor
     1360    *page = (page_t *)(intptr_t)rpc.args[1];
     1361
     1362#if DEBUG_RPC_PMEM_GET_PAGES
     1363cycle = (uint32_t)hal_get_cycles();
     1364if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
     1365printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1366__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1367#endif
     1368}
     1369
     1370///////////////////////////////////////////
     1371void rpc_pmem_get_pages_server( xptr_t xp )
     1372{
     1373#if DEBUG_RPC_PMEM_GET_PAGES
     1374thread_t * this = CURRENT_THREAD;
     1375uint32_t cycle = (uint32_t)hal_get_cycles();
     1376if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
     1377printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1378__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1379#endif
     1380
     1381    // get client cluster identifier and pointer on RPC descriptor
     1382    cxy_t        cxy  = GET_CXY( xp );
     1383    rpc_desc_t * desc = GET_PTR( xp );
     1384
     1385    // get input arguments from client RPC descriptor
     1386    uint32_t order = (uint32_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) );
     1387   
     1388    // call local pmem allocator
     1389    page_t * page = ppm_alloc_pages( order );
     1390
     1391    // set output arguments into client RPC descriptor
     1392    hal_remote_s64( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
     1393
     1394#if DEBUG_RPC_PMEM_GET_PAGES
     1395cycle = (uint32_t)hal_get_cycles();
     1396if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
     1397printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1398__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1399#endif
     1400}
     1401
     1402/////////////////////////////////////////////////////////////////////////////////////////
     1403// [1]       RPC_PMEM_RELEASE_PAGES deprecated [AG] may 2019
     1404/////////////////////////////////////////////////////////////////////////////////////////
     1405void rpc_pmem_release_pages_client( cxy_t     cxy,
     1406                                    page_t  * page )      // out
     1407{
     1408#if DEBUG_RPC_PMEM_RELEASE_PAGES
     1409thread_t * this = CURRENT_THREAD;
     1410uint32_t cycle = (uint32_t)hal_get_cycles();
     1411if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
     1412printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1413__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1414#endif
     1415
     1416    uint32_t responses = 1;
     1417
     1418    // initialise RPC descriptor header
     1419    rpc_desc_t  rpc;
     1420    rpc.index    = RPC_PMEM_RELEASE_PAGES;
     1421    rpc.blocking = true;
     1422    rpc.rsp      = &responses;
     1423
     1424    // set input arguments in RPC descriptor
     1425    rpc.args[0] = (uint64_t)(intptr_t)page;
     1426
     1427    // register RPC request in remote RPC fifo
     1428    rpc_send( cxy , &rpc );
     1429
     1430#if DEBUG_RPC_PMEM_RELEASE_PAGES
     1431cycle = (uint32_t)hal_get_cycles();
     1432if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
     1433printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1434__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1435#endif
     1436}
     1437
     1438///////////////////////////////////////////////
     1439void rpc_pmem_release_pages_server( xptr_t xp )
     1440{
     1441#if DEBUG_RPC_PMEM_RELEASE_PAGES
     1442thread_t * this = CURRENT_THREAD;
     1443uint32_t cycle = (uint32_t)hal_get_cycles();
     1444if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
     1445printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1446__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1447#endif
     1448
     1449    // get client cluster identifier and pointer on RPC descriptor
     1450    cxy_t        cxy  = GET_CXY( xp );
     1451    rpc_desc_t * desc = GET_PTR( xp );
     1452
     1453    // get input arguments from client RPC descriptor
     1454    page_t * page = (page_t *)(intptr_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) );
     1455   
     1456    // release memory to local pmem
     1457    kmem_req_t req;
     1458    req.type = KMEM_PPM;
     1459    req.ptr  = page;
     1460    kmem_free( &req );
     1461
     1462#if DEBUG_RPC_PMEM_RELEASE_PAGES
     1463cycle = (uint32_t)hal_get_cycles();
     1464if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
     1465printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1466__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1467#endif
     1468}
     1469
     1470/////////////////////////////////////////////////////////////////////////////////////////
     1471// [2]          RPC_PPM_DISPLAY deprecated [AG] May 2019   
     1472/////////////////////////////////////////////////////////////////////////////////////////
     1473void rpc_ppm_display_client( cxy_t  cxy )
     1474{
     1475#if DEBUG_RPC_PPM_DISPLAY
     1476thread_t * this = CURRENT_THREAD;
     1477uint32_t cycle = (uint32_t)hal_get_cycles();
     1478if( cycle > DEBUG_RPC_PPM_DISPLAY )
     1479printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1480__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1481#endif
     1482
     1483    uint32_t responses = 1;
     1484
     1485    // initialise RPC descriptor header
     1486    rpc_desc_t  rpc;
     1487    rpc.index    = RPC_PPM_DISPLAY;
     1488    rpc.blocking = true;
     1489    rpc.rsp      = &responses;
     1490
     1491    // register RPC request in remote RPC fifo
     1492    rpc_send( cxy , &rpc );
     1493
     1494#if DEBUG_RPC_PPM_DISPLAY
     1495cycle = (uint32_t)hal_get_cycles();
     1496if( cycle > DEBUG_RPC_PPM_DISPLAY )
     1497printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1498__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1499#endif
     1500}
     1501
     1502////////////////////////////////////////////////////////////////////
     1503void rpc_ppm_display_server( xptr_t __attribute__((__unused__)) xp )
     1504{
     1505#if DEBUG_RPC_PPM_DISPLAY
     1506thread_t * this = CURRENT_THREAD;
     1507uint32_t cycle = (uint32_t)hal_get_cycles();
     1508if( cycle > DEBUG_RPC_PPM_DISPLAY )
     1509printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1510__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1511#endif
     1512
     1513    // call local kernel function
     1514    ppm_display();
     1515
     1516#if DEBUG_RPC_PPM_DISPLAY
     1517cycle = (uint32_t)hal_get_cycles();
     1518if( cycle > DEBUG_RPC_PPM_DISPLAY )
     1519printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1520__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1521#endif
     1522}
     1523
     1524/////////////////////////////////////////////////////////////////////////////////////////
     1525// [8]   RPC_VFS_FS_UPDATE_DENTRY deprecated [AG] dec 2019
     1526/////////////////////////////////////////////////////////////////////////////////////////
     1527void rpc_vfs_fs_update_dentry_client( cxy_t          cxy,
     1528                                      vfs_inode_t  * inode,
     1529                                      vfs_dentry_t * dentry,
     1530                                      uint32_t       size,
     1531                                      error_t      * error )
     1532{
     1533#if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
     1534thread_t * this = CURRENT_THREAD;
     1535uint32_t cycle = (uint32_t)hal_get_cycles();
     1536if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
     1537printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1538__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1539#endif
     1540
     1541    uint32_t responses = 1;
     1542
     1543    // initialise RPC descriptor header
     1544    rpc_desc_t  rpc;
     1545    rpc.index    = RPC_VFS_FS_UPDATE_DENTRY;
     1546    rpc.blocking = true;
     1547    rpc.rsp      = &responses;
     1548
     1549    // set input arguments in RPC descriptor
     1550    rpc.args[0] = (uint64_t)(intptr_t)inode;
     1551    rpc.args[1] = (uint64_t)(intptr_t)dentry;
     1552    rpc.args[2] = (uint64_t)size;
     1553
     1554    // register RPC request in remote RPC fifo
     1555    rpc_send( cxy , &rpc );
     1556
     1557    // get output values from RPC descriptor
     1558    *error   = (error_t)rpc.args[3];
     1559
     1560#if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
     1561cycle = (uint32_t)hal_get_cycles();
     1562if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
     1563printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1564__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1565#endif
     1566}
     1567
     1568/////////////////////////////////////////////////
     1569void rpc_vfs_fs_update_dentry_server( xptr_t xp )
     1570{
     1571#if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
     1572thread_t * this = CURRENT_THREAD;
     1573uint32_t cycle = (uint32_t)hal_get_cycles();
     1574if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
     1575printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1576__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1577#endif
     1578
     1579    error_t        error;
     1580    vfs_inode_t  * inode;
     1581    vfs_dentry_t * dentry;
     1582    uint32_t       size;
     1583
     1584    // get client cluster identifier and pointer on RPC descriptor
     1585    cxy_t        client_cxy  = GET_CXY( xp );
     1586    rpc_desc_t * desc        = GET_PTR( xp );
     1587
     1588    // get input arguments
     1589    inode  = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     1590    dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
     1591    size   = (uint32_t)               hal_remote_l64(XPTR(client_cxy , &desc->args[2]));
     1592
     1593    // call the kernel function
     1594    error = vfs_fs_update_dentry( inode , dentry , size );
     1595
     1596    // set output argument
     1597    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
     1598
     1599#if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
     1600cycle = (uint32_t)hal_get_cycles();
     1601if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
     1602printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1603__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1604#endif
     1605}
     1606
     1607
    27321608/////////////////////////////////////////////////////////////////////////////////////////
    27331609// [29]      RPC_VMM_DISPLAY deprecated [AG] June 2019
    27341610/////////////////////////////////////////////////////////////////////////////////////////
    2735 
    2736 /*
    2737 /////////////////////////////////////////////
    27381611void rpc_hal_vmm_display_client( cxy_t       cxy,
    27391612                             process_t * process,
     
    28041677}
    28051678
     1679/////////////////////////////////////////////////////////////////////////////////////////
     1680// [10]  to RPC_VFS_INODE_CREATE   deprecated [AG] dec 2019
     1681/////////////////////////////////////////////////////////////////////////////////////////
     1682void rpc_vfs_inode_create_client( cxy_t          cxy,     
     1683                                  uint32_t       fs_type,    // in
     1684                                  uint32_t       attr,       // in
     1685                                  uint32_t       rights,     // in
     1686                                  uint32_t       uid,        // in
     1687                                  uint32_t       gid,        // in
     1688                                  xptr_t       * inode_xp,   // out
     1689                                  error_t      * error )     // out
     1690{
     1691#if DEBUG_RPC_VFS_INODE_CREATE
     1692thread_t * this = CURRENT_THREAD;
     1693uint32_t cycle = (uint32_t)hal_get_cycles();
     1694if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
     1695printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1696__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1697#endif
     1698
     1699    uint32_t responses = 1;
     1700
     1701    // initialise RPC descriptor header
     1702    rpc_desc_t  rpc;
     1703    rpc.index    = RPC_VFS_INODE_CREATE;
     1704    rpc.blocking = true;
     1705    rpc.rsp      = &responses;
     1706
     1707    // set input arguments in RPC descriptor
     1708    rpc.args[0] = (uint64_t)fs_type;
     1709    rpc.args[1] = (uint64_t)attr;
     1710    rpc.args[2] = (uint64_t)rights;
     1711    rpc.args[3] = (uint64_t)uid;
     1712    rpc.args[4] = (uint64_t)gid;
     1713
     1714    // register RPC request in remote RPC fifo
     1715    rpc_send( cxy , &rpc );
     1716
     1717    // get output values from RPC descriptor
     1718    *inode_xp = (xptr_t)rpc.args[5];
     1719    *error    = (error_t)rpc.args[6];
     1720
     1721#if DEBUG_RPC_VFS_INODE_CREATE
     1722cycle = (uint32_t)hal_get_cycles();
     1723if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
     1724printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1725__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1726#endif
     1727}
     1728
     1729/////////////////////////////////////////////
     1730void rpc_vfs_inode_create_server( xptr_t xp )
     1731{
     1732#if DEBUG_RPC_VFS_INODE_CREATE
     1733thread_t * this = CURRENT_THREAD;
     1734uint32_t cycle = (uint32_t)hal_get_cycles();
     1735if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
     1736printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1737__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1738#endif
     1739
     1740    uint32_t         fs_type;
     1741    uint32_t         attr;
     1742    uint32_t         rights;
     1743    uint32_t         uid;
     1744    uint32_t         gid;
     1745    xptr_t           inode_xp;
     1746    error_t          error;
     1747
     1748    // get client cluster identifier and pointer on RPC descriptor
     1749    cxy_t        client_cxy  = GET_CXY( xp );
     1750    rpc_desc_t * desc        = GET_PTR( xp );
     1751
     1752    // get input arguments from client rpc descriptor
     1753    fs_type    = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     1754    attr       = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
     1755    rights     = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
     1756    uid        = (uid_t)     hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
     1757    gid        = (gid_t)     hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) );
     1758
     1759    // call local kernel function
     1760    error = vfs_inode_create( fs_type,
     1761                              attr,
     1762                              rights,
     1763                              uid,
     1764                              gid,
     1765                              &inode_xp );
     1766
     1767    // set output arguments
     1768    hal_remote_s64( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)inode_xp );
     1769    hal_remote_s64( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error );
     1770
     1771#if DEBUG_RPC_VFS_INODE_CREATE
     1772cycle = (uint32_t)hal_get_cycles();
     1773if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
     1774printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1775__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1776#endif
     1777}
     1778
     1779/////////////////////////////////////////////////////////////////////////////////////////
     1780// [11]  to RPC_VFS_INODE_DESTROY   deprecated [AG] dec 2019
     1781/////////////////////////////////////////////////////////////////////////////////////////
     1782void rpc_vfs_inode_destroy_client( cxy_t                cxy,
     1783                                   struct vfs_inode_s * inode )
     1784{
     1785#if DEBUG_RPC_VFS_INODE_DESTROY
     1786thread_t * this = CURRENT_THREAD;
     1787uint32_t cycle = (uint32_t)hal_get_cycles();
     1788if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
     1789printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1790__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1791#endif
     1792
     1793    uint32_t responses = 1;
     1794
     1795    // initialise RPC descriptor header
     1796    rpc_desc_t  rpc;
     1797    rpc.index    = RPC_VFS_INODE_DESTROY;
     1798    rpc.blocking = true;
     1799    rpc.rsp      = &responses;
     1800
     1801    // set input arguments in RPC descriptor
     1802    rpc.args[0] = (uint64_t)(intptr_t)inode;
     1803   
     1804    // register RPC request in remote RPC fifo
     1805    rpc_send( cxy , &rpc );
     1806
     1807#if DEBUG_RPC_VFS_INODE_DESTROY
     1808cycle = (uint32_t)hal_get_cycles();
     1809if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
     1810printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1811__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1812#endif
     1813}
     1814
     1815//////////////////////////////////////////////
     1816void rpc_vfs_inode_destroy_server( xptr_t xp )
     1817{
     1818#if DEBUG_RPC_VFS_INODE_DESTROY
     1819thread_t * this = CURRENT_THREAD;
     1820uint32_t cycle = (uint32_t)hal_get_cycles();
     1821if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
     1822printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1823__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1824#endif
     1825
     1826    vfs_inode_t * inode;
     1827
     1828    // get client cluster identifier and pointer on RPC descriptor
     1829    cxy_t        client_cxy  = GET_CXY( xp );
     1830    rpc_desc_t * desc        = GET_PTR( xp );
     1831
     1832    // get argument "inode" from client RPC descriptor
     1833    inode = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     1834                       
     1835    // call local kernel function
     1836    vfs_inode_destroy( inode );
     1837
     1838#if DEBUG_RPC_VFS_INODE_DESTROY
     1839cycle = (uint32_t)hal_get_cycles();
     1840if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
     1841printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1842__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1843#endif
     1844}
     1845
     1846/////////////////////////////////////////////////////////////////////////////////////////
     1847// [12]  RPC_VFS_DENTRY_CREATE   deprecated [AG] dec 2019
     1848/////////////////////////////////////////////////////////////////////////////////////////
     1849void rpc_vfs_dentry_create_client( cxy_t                  cxy,
     1850                                   uint32_t               type,         // in
     1851                                   char                 * name,         // in
     1852                                   xptr_t               * dentry_xp,    // out
     1853                                   error_t              * error )       // out
     1854{
     1855#if DEBUG_RPC_VFS_DENTRY_CREATE
     1856thread_t * this = CURRENT_THREAD;
     1857uint32_t cycle = (uint32_t)hal_get_cycles();
     1858if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
     1859printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1860__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1861#endif
     1862
     1863    uint32_t responses = 1;
     1864
     1865    // initialise RPC descriptor header
     1866    rpc_desc_t  rpc;
     1867    rpc.index    = RPC_VFS_DENTRY_CREATE;
     1868    rpc.blocking = true;
     1869    rpc.rsp      = &responses;
     1870
     1871    // set input arguments in RPC descriptor
     1872    rpc.args[0] = (uint64_t)type;
     1873    rpc.args[1] = (uint64_t)(intptr_t)name;
     1874
     1875    // register RPC request in remote RPC fifo
     1876    rpc_send( cxy , &rpc );
     1877
     1878    // get output values from RPC descriptor
     1879    *dentry_xp = (xptr_t)rpc.args[2];
     1880    *error     = (error_t)rpc.args[3];
     1881
     1882#if DEBUG_RPC_VFS_DENTRY_CREATE
     1883cycle = (uint32_t)hal_get_cycles();
     1884if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
     1885printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1886__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1887#endif
     1888}
     1889
     1890//////////////////////////////////////////////
     1891void rpc_vfs_dentry_create_server( xptr_t xp )
     1892{
     1893#if DEBUG_RPC_VFS_DENTRY_CREATE
     1894thread_t * this = CURRENT_THREAD;
     1895uint32_t cycle = (uint32_t)hal_get_cycles();
     1896if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
     1897printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1898__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1899#endif
     1900
     1901    uint32_t      type;
     1902    char        * name;
     1903    xptr_t        dentry_xp;
     1904    error_t       error;
     1905    char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
     1906
     1907    // get client cluster identifier and pointer on RPC descriptor
     1908    cxy_t        client_cxy  = GET_CXY( xp );
     1909    rpc_desc_t * desc        = GET_PTR( xp );
     1910
     1911    // get arguments "name", "type", and "parent" from client RPC descriptor
     1912    type   = (uint32_t)         hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     1913    name   = (char *)(intptr_t) hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
     1914
     1915    // makes a local copy of  name
     1916    hal_remote_strcpy( XPTR( local_cxy , name_copy ),
     1917                       XPTR( client_cxy , name ) );
     1918
     1919    // call local kernel function
     1920    error = vfs_dentry_create( type,
     1921                               name_copy,
     1922                               &dentry_xp );
     1923    // set output arguments
     1924    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)dentry_xp );
     1925    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
     1926
     1927#if DEBUG_RPC_VFS_DENTRY_CREATE
     1928cycle = (uint32_t)hal_get_cycles();
     1929if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
     1930printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1931__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1932#endif
     1933}
     1934
     1935/////////////////////////////////////////////////////////////////////////////////////////
     1936// [13]  RPC_VFS_DENTRY_DESTROY   deprecated [AG] dec 2019
     1937/////////////////////////////////////////////////////////////////////////////////////////
     1938void rpc_vfs_dentry_destroy_client( cxy_t          cxy,
     1939                                    vfs_dentry_t * dentry )
     1940{
     1941#if DEBUG_RPC_VFS_DENTRY_DESTROY
     1942thread_t * this = CURRENT_THREAD;
     1943uint32_t cycle = (uint32_t)hal_get_cycles();
     1944if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
     1945printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1946__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1947#endif
     1948
     1949    uint32_t responses = 1;
     1950
     1951    // initialise RPC descriptor header
     1952    rpc_desc_t  rpc;
     1953    rpc.index    = RPC_VFS_DENTRY_DESTROY;
     1954    rpc.blocking = true;
     1955    rpc.rsp      = &responses;
     1956
     1957    // set input arguments in RPC descriptor
     1958    rpc.args[0] = (uint64_t)(intptr_t)dentry;
     1959   
     1960    // register RPC request in remote RPC fifo
     1961    rpc_send( cxy , &rpc );
     1962
     1963#if DEBUG_RPC_VFS_DENTRY_DESTROY
     1964cycle = (uint32_t)hal_get_cycles();
     1965if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
     1966printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1967__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1968#endif
     1969}
     1970
     1971///////////////////////////////////////////////
     1972void rpc_vfs_dentry_destroy_server( xptr_t xp )
     1973{
     1974#if DEBUG_RPC_VFS_DENTRY_DESTROY
     1975thread_t * this = CURRENT_THREAD;
     1976uint32_t cycle = (uint32_t)hal_get_cycles();
     1977if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
     1978printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     1979__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     1980#endif
     1981
     1982    vfs_dentry_t * dentry;
     1983
     1984    // get client cluster identifier and pointer on RPC descriptor
     1985    cxy_t        client_cxy  = GET_CXY( xp );
     1986    rpc_desc_t * desc        = GET_PTR( xp );
     1987
     1988    // get arguments "dentry" from client RPC descriptor
     1989    dentry = (vfs_dentry_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     1990                       
     1991    // call local kernel function
     1992    vfs_dentry_destroy( dentry );
     1993
     1994#if DEBUG_RPC_VFS_DENTRY_DESTROY
     1995cycle = (uint32_t)hal_get_cycles();
     1996if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
     1997printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     1998__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     1999#endif
     2000}
     2001
     2002
     2003/////////////////////////////////////////////////////////////////////////////////////////
     2004// [14]  RPC_VFS_FILE_CREATE  deprecated [AG] dec 2019
     2005/////////////////////////////////////////////////////////////////////////////////////////
     2006void rpc_vfs_file_create_client( cxy_t                  cxy,
     2007                                 struct vfs_inode_s   * inode,       // in
     2008                                 uint32_t               file_attr,   // in
     2009                                 xptr_t               * file_xp,     // out
     2010                                 error_t              * error )      // out
     2011{
     2012#if DEBUG_RPC_VFS_FILE_CREATE
     2013thread_t * this = CURRENT_THREAD;
     2014uint32_t cycle = (uint32_t)hal_get_cycles();
     2015if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
     2016printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2017__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2018#endif
     2019
     2020    uint32_t responses = 1;
     2021
     2022    // initialise RPC descriptor header
     2023    rpc_desc_t  rpc;
     2024    rpc.index    = RPC_VFS_FILE_CREATE;
     2025    rpc.blocking = true;
     2026    rpc.rsp      = &responses;
     2027
     2028    // set input arguments in RPC descriptor
     2029    rpc.args[0] = (uint64_t)(intptr_t)inode;
     2030    rpc.args[1] = (uint64_t)file_attr;
     2031
     2032    // register RPC request in remote RPC fifo
     2033    rpc_send( cxy , &rpc );
     2034
     2035    // get output values from RPC descriptor
     2036    *file_xp = (xptr_t)rpc.args[2];
     2037    *error   = (error_t)rpc.args[3];
     2038
     2039#if DEBUG_RPC_VFS_FILE_CREATE
     2040cycle = (uint32_t)hal_get_cycles();
     2041if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
     2042printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2043__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     2044#endif
     2045}
     2046
     2047////////////////////////////////////////////
     2048void rpc_vfs_file_create_server( xptr_t xp )
     2049{
     2050#if DEBUG_RPC_VFS_FILE_CREATE
     2051thread_t * this = CURRENT_THREAD;
     2052uint32_t cycle = (uint32_t)hal_get_cycles();
     2053if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
     2054printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2055__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2056#endif
     2057
     2058    uint32_t      file_attr;
     2059    vfs_inode_t * inode;
     2060    xptr_t        file_xp;
     2061    error_t       error;
     2062
     2063    // get client cluster identifier and pointer on RPC descriptor
     2064    cxy_t        client_cxy  = GET_CXY( xp );
     2065    rpc_desc_t * desc        = GET_PTR( xp );
     2066
     2067    // get arguments "file_attr" and "inode" from client RPC descriptor
     2068    inode     = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     2069    file_attr = (uint32_t)               hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
     2070                       
     2071    // call local kernel function
     2072    error = vfs_file_create( inode,
     2073                             file_attr,
     2074                             &file_xp );
     2075 
     2076    // set output arguments
     2077    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)file_xp );
     2078    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
     2079
     2080#if DEBUG_RPC_VFS_FILE_CREATE
     2081cycle = (uint32_t)hal_get_cycles();
     2082if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
     2083printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2084__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     2085#endif
     2086}
     2087
     2088/////////////////////////////////////////////////////////////////////////////////////////
     2089// [15]  RPC_VFS_FILE_DESTROY    deprecated [AG] dec 2019
     2090/////////////////////////////////////////////////////////////////////////////////////////
     2091void rpc_vfs_file_destroy_client( cxy_t        cxy,
     2092                                  vfs_file_t * file )
     2093{
     2094#if DEBUG_RPC_VFS_FILE_DESTROY
     2095thread_t * this = CURRENT_THREAD;
     2096uint32_t cycle = (uint32_t)hal_get_cycles();
     2097if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
     2098printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2099__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2100#endif
     2101
     2102    uint32_t responses = 1;
     2103
     2104    // initialise RPC descriptor header
     2105    rpc_desc_t  rpc;
     2106    rpc.index    = RPC_VFS_FILE_DESTROY;
     2107    rpc.blocking = true;
     2108    rpc.rsp      = &responses;
     2109
     2110    // set input arguments in RPC descriptor
     2111    rpc.args[0] = (uint64_t)(intptr_t)file;
     2112   
     2113    // register RPC request in remote RPC fifo
     2114    rpc_send( cxy , &rpc );
     2115
     2116#if DEBUG_RPC_VFS_FILE_DESTROY
     2117cycle = (uint32_t)hal_get_cycles();
     2118if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
     2119printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2120__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     2121#endif
     2122}
     2123
     2124/////////////////////////////////////////////
     2125void rpc_vfs_file_destroy_server( xptr_t xp )
     2126{
     2127#if DEBUG_RPC_VFS_FILE_DESTROY
     2128thread_t * this = CURRENT_THREAD;
     2129uint32_t cycle = (uint32_t)hal_get_cycles();
     2130if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
     2131printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2132__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2133#endif
     2134
     2135    vfs_file_t * file;
     2136
     2137    // get client cluster identifier and pointer on RPC descriptor
     2138    cxy_t        client_cxy  = GET_CXY( xp );
     2139    rpc_desc_t * desc        = GET_PTR( xp );
     2140
     2141    // get arguments "dentry" from client RPC descriptor
     2142    file = (vfs_file_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     2143                       
     2144    // call local kernel function
     2145    vfs_file_destroy( file );
     2146
     2147#if DEBUG_RPC_VFS_FILE_DESTROY
     2148cycle = (uint32_t)hal_get_cycles();
     2149if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
     2150printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2151__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     2152#endif
     2153}
     2154
     2155/////////////////////////////////////////////////////////////////////////////////////////
     2156// [16]  RPC_VFS_FS_GET_DENTRY   deprecated [AG] dec 2019
     2157/////////////////////////////////////////////////////////////////////////////////////////
     2158void rpc_vfs_fs_new_dentry_client( cxy_t         cxy,
     2159                                   vfs_inode_t * parent_inode,    // in
     2160                                   char        * name,            // in
     2161                                   xptr_t        child_inode_xp,  // in
     2162                                   error_t     * error )          // out
     2163{
     2164#if DEBUG_RPC_VFS_FS_NEW_DENTRY
     2165thread_t * this = CURRENT_THREAD;
     2166uint32_t cycle = (uint32_t)hal_get_cycles();
     2167if( cycle > DEBUG_RPC_VFS_FS_NEW_DENTRY )
     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
     2172    uint32_t responses = 1;
     2173
     2174    // initialise RPC descriptor header
     2175    rpc_desc_t  rpc;
     2176    rpc.index    = RPC_VFS_FS_NEW_DENTRY;
     2177    rpc.blocking = true;
     2178    rpc.rsp      = &responses;
     2179
     2180    // set input arguments in RPC descriptor
     2181    rpc.args[0] = (uint64_t)(intptr_t)parent_inode;
     2182    rpc.args[1] = (uint64_t)(intptr_t)name;
     2183    rpc.args[2] = (uint64_t)child_inode_xp;
     2184
     2185    // register RPC request in remote RPC fifo
     2186    rpc_send( cxy , &rpc );
     2187
     2188    // get output values from RPC descriptor
     2189    *error   = (error_t)rpc.args[3];
     2190
     2191#if DEBUG_RPC_VFS_FS_NEW_DENTRY
     2192cycle = (uint32_t)hal_get_cycles();
     2193if( cycle > DEBUG_RPC_VFS_FS_NEW_DENTRY )
     2194printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2195__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2196#endif
     2197}
     2198
     2199//////////////////////////////////////////////
     2200void rpc_vfs_fs_new_dentry_server( xptr_t xp )
     2201{
     2202#if DEBUG_RPC_VFS_FS_NEW_DENTRY
     2203thread_t * this = CURRENT_THREAD;
     2204uint32_t cycle = (uint32_t)hal_get_cycles();
     2205if( cycle > DEBUG_RPC_VFS_FS_NEW_DENTRY )
     2206printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2207__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2208#endif
     2209
     2210    error_t       error;
     2211    vfs_inode_t * parent;
     2212    xptr_t        child_xp;
     2213    char        * name;
     2214
     2215    char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
     2216
     2217    // get client cluster identifier and pointer on RPC descriptor
     2218    cxy_t        client_cxy  = GET_CXY( xp );
     2219    rpc_desc_t * desc        = GET_PTR( xp );
     2220
     2221    // get arguments "parent", "name", and "child_xp"
     2222    parent     = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     2223    name       = (char*)(intptr_t)       hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
     2224    child_xp   = (xptr_t)                hal_remote_l64(XPTR(client_cxy , &desc->args[2]));
     2225
     2226    // get name local copy
     2227    hal_remote_strcpy( XPTR( local_cxy , name_copy ) ,
     2228                       XPTR( client_cxy , name ) );
     2229
     2230    // call the kernel function
     2231    error = vfs_fs_new_dentry( parent , name_copy , child_xp );
     2232
     2233    // set output argument
     2234    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
     2235
     2236#if DEBUG_RPC_VFS_FS_NEW_DENTRY
     2237cycle = (uint32_t)hal_get_cycles();
     2238if( cycle > DEBUG_RPC_VFS_FS_NEW_DENTRY )
     2239printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2240__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2241#endif
     2242}
     2243
     2244/////////////////////////////////////////////////////////////////////////////////////////
     2245// [17]  RPC_VFS_FS_ADD_DENTRY  deprecated [AG] dec 2019
     2246/////////////////////////////////////////////////////////////////////////////////////////
     2247void rpc_vfs_fs_add_dentry_client( cxy_t          cxy,
     2248                                   vfs_inode_t  * parent,     // in
     2249                                   vfs_dentry_t * dentry,     // in
     2250                                   error_t      * error )     // out
     2251{
     2252#if DEBUG_RPC_VFS_FS_ADD_DENTRY
     2253thread_t * this = CURRENT_THREAD;
     2254uint32_t cycle = (uint32_t)hal_get_cycles();
     2255if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
     2256printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2257__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2258#endif
     2259
     2260    uint32_t responses = 1;
     2261
     2262    // initialise RPC descriptor header
     2263    rpc_desc_t  rpc;
     2264    rpc.index    = RPC_VFS_FS_ADD_DENTRY;
     2265    rpc.blocking = true;
     2266    rpc.rsp      = &responses;
     2267
     2268    // set input arguments in RPC descriptor
     2269    rpc.args[0] = (uint64_t)(intptr_t)parent;
     2270    rpc.args[1] = (uint64_t)(intptr_t)dentry;
     2271
     2272    // register RPC request in remote RPC fifo
     2273    rpc_send( cxy , &rpc );
     2274
     2275    // get output values from RPC descriptor
     2276    *error   = (error_t)rpc.args[2];
     2277
     2278#if DEBUG_RPC_VFS_FS_ADD_DENTRY
     2279cycle = (uint32_t)hal_get_cycles();
     2280if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
     2281printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2282__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2283#endif
     2284}
     2285
     2286//////////////////////////////////////////////
     2287void rpc_vfs_fs_add_dentry_server( xptr_t xp )
     2288{
     2289#if DEBUG_RPC_VFS_FS_ADD_DENTRY
     2290thread_t * this = CURRENT_THREAD;
     2291uint32_t cycle = (uint32_t)hal_get_cycles();
     2292if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
     2293printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2294__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2295#endif
     2296
     2297    error_t        error;
     2298    vfs_inode_t  * parent;
     2299    vfs_dentry_t * dentry;
     2300
     2301    // get client cluster identifier and pointer on RPC descriptor
     2302    cxy_t        client_cxy  = GET_CXY( xp );
     2303    rpc_desc_t * desc        = GET_PTR( xp );
     2304
     2305    // get input arguments
     2306    parent = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     2307    dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
     2308
     2309    // call the kernel function
     2310    error = vfs_fs_add_dentry( parent , dentry );
     2311
     2312    // set output argument
     2313    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)error );
     2314
     2315#if DEBUG_RPC_VFS_FS_ADD_DENTRY
     2316cycle = (uint32_t)hal_get_cycles();
     2317if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
     2318printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2319__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2320#endif
     2321}
     2322
     2323/////////////////////////////////////////////////////////////////////////////////////////
     2324// [18]   RPC_VFS_FS_REMOVE_DENTRY    deprecated [AG] dec 2019
     2325/////////////////////////////////////////////////////////////////////////////////////////
     2326void rpc_vfs_fs_remove_dentry_client( cxy_t          cxy,
     2327                                      vfs_inode_t  * parent,     // in
     2328                                      vfs_dentry_t * dentry,     // in
     2329                                      error_t      * error )     // out
     2330{
     2331#if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
     2332thread_t * this = CURRENT_THREAD;
     2333uint32_t cycle = (uint32_t)hal_get_cycles();
     2334if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
     2335printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2336__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2337#endif
     2338
     2339    uint32_t responses = 1;
     2340
     2341    // initialise RPC descriptor header
     2342    rpc_desc_t  rpc;
     2343    rpc.index    = RPC_VFS_FS_REMOVE_DENTRY;
     2344    rpc.blocking = true;
     2345    rpc.rsp      = &responses;
     2346
     2347    // set input arguments in RPC descriptor
     2348    rpc.args[0] = (uint64_t)(intptr_t)parent;
     2349    rpc.args[1] = (uint64_t)(intptr_t)dentry;
     2350
     2351    // register RPC request in remote RPC fifo
     2352    rpc_send( cxy , &rpc );
     2353
     2354    // get output values from RPC descriptor
     2355    *error   = (error_t)rpc.args[2];
     2356
     2357#if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
     2358cycle = (uint32_t)hal_get_cycles();
     2359if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
     2360printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2361__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2362#endif
     2363}
     2364
     2365/////////////////////////////////////////////////
     2366void rpc_vfs_fs_remove_dentry_server( xptr_t xp )
     2367{
     2368#if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
     2369thread_t * this = CURRENT_THREAD;
     2370uint32_t cycle = (uint32_t)hal_get_cycles();
     2371if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
     2372printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2373__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2374#endif
     2375
     2376    error_t        error;
     2377    vfs_inode_t  * parent;
     2378    vfs_dentry_t * dentry;
     2379
     2380    // get client cluster identifier and pointer on RPC descriptor
     2381    cxy_t        client_cxy  = GET_CXY( xp );
     2382    rpc_desc_t * desc        = GET_PTR( xp );
     2383
     2384    // get input arguments
     2385    parent = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     2386    dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
     2387
     2388    // call the kernel function
     2389    error = vfs_fs_remove_dentry( parent , dentry );
     2390
     2391    // set output argument
     2392    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)error );
     2393
     2394#if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
     2395cycle = (uint32_t)hal_get_cycles();
     2396if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
     2397printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2398__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2399#endif
     2400}
     2401
     2402/////////////////////////////////////////////////////////////////////////////////////////
     2403// [19]   RPC_VFS_INODE_LOAD_ALL_PAGES deprecated [AG] dec 2019
     2404/////////////////////////////////////////////////////////////////////////////////////////
     2405void rpc_vfs_inode_load_all_pages_client( cxy_t         cxy,
     2406                                          vfs_inode_t * inode,      // in
     2407                                          error_t     * error )     // out
     2408{
     2409#if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
     2410thread_t * this = CURRENT_THREAD;
     2411uint32_t cycle = (uint32_t)hal_get_cycles();
     2412if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
     2413printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2414__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2415#endif
     2416
     2417    uint32_t responses = 1;
     2418
     2419    // initialise RPC descriptor header
     2420    rpc_desc_t  rpc;
     2421    rpc.index    = RPC_VFS_INODE_LOAD_ALL_PAGES;
     2422    rpc.blocking = true;
     2423    rpc.rsp      = &responses;
     2424
     2425    // set input arguments in RPC descriptor
     2426    rpc.args[0] = (uint64_t)(intptr_t)inode;
     2427
     2428    // register RPC request in remote RPC fifo
     2429    rpc_send( cxy , &rpc );
     2430
     2431    // get output values from RPC descriptor
     2432    *error   = (error_t)rpc.args[1];
     2433
     2434#if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
     2435cycle = (uint32_t)hal_get_cycles();
     2436if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
     2437printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2438__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2439#endif
     2440}
     2441
     2442/////////////////////////////////////////////////////
     2443void rpc_vfs_inode_load_all_pages_server( xptr_t xp )
     2444{
     2445#if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
     2446thread_t * this = CURRENT_THREAD;
     2447uint32_t cycle = (uint32_t)hal_get_cycles();
     2448if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
     2449printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2450__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2451#endif
     2452
     2453    error_t       error;
     2454    vfs_inode_t * inode;
     2455
     2456    // get client cluster identifier and pointer on RPC descriptor
     2457    cxy_t        client_cxy  = GET_CXY( xp );
     2458    rpc_desc_t * desc        = GET_PTR( xp );
     2459
     2460    // get input argument
     2461    inode = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     2462
     2463    // call the kernel function
     2464    error = vfs_inode_load_all_pages( inode );
     2465
     2466    // set output argument
     2467    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
     2468
     2469#if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
     2470cycle = (uint32_t)hal_get_cycles();
     2471if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
     2472printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2473__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2474#endif
     2475}
     2476
     2477/////////////////////////////////////////////////////////////////////////////////////////
     2478// [20]  RPC_VMM_GET_VSEG deprecated [AG] sept 2019
     2479/////////////////////////////////////////////////////////////////////////////////////////
     2480void rpc_vmm_get_vseg_client( cxy_t       cxy,     
     2481                              process_t * process,     // in 
     2482                              intptr_t    vaddr,       // in 
     2483                              xptr_t    * vseg_xp,     // out
     2484                              error_t   * error )      // out
     2485{
     2486#if DEBUG_RPC_VMM_GET_VSEG
     2487thread_t * this = CURRENT_THREAD;
     2488uint32_t cycle = (uint32_t)hal_get_cycles();
     2489if( cycle > DEBUG_RPC_VMM_GET_VSEG )
     2490printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2491__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2492#endif
     2493
     2494    uint32_t responses = 1;
     2495
     2496    // initialise RPC descriptor header
     2497    rpc_desc_t  rpc;
     2498    rpc.index    = RPC_VMM_GET_VSEG;
     2499    rpc.blocking = true;
     2500    rpc.rsp      = &responses;
     2501
     2502    // set input arguments in RPC descriptor
     2503    rpc.args[0] = (uint64_t)(intptr_t)process;
     2504    rpc.args[1] = (uint64_t)vaddr;
     2505
     2506    // register RPC request in remote RPC fifo
     2507    rpc_send( cxy , &rpc );
     2508
     2509    // get output argument from rpc descriptor
     2510    *vseg_xp = rpc.args[2];
     2511    *error   = (error_t)rpc.args[3];
     2512
     2513#if DEBUG_RPC_VMM_GET_VSEG
     2514cycle = (uint32_t)hal_get_cycles();
     2515if( cycle > DEBUG_RPC_VMM_GET_VSEG )
     2516printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2517__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2518#endif
     2519}
     2520
     2521/////////////////////////////////////////
     2522void rpc_vmm_get_vseg_server( xptr_t xp )
     2523{
     2524#if DEBUG_RPC_VMM_GET_VSEG
     2525thread_t * this = CURRENT_THREAD;
     2526uint32_t cycle = (uint32_t)hal_get_cycles();
     2527if( cycle > DEBUG_RPC_VMM_GET_VSEG )
     2528printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2529__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2530#endif
     2531
     2532    process_t   * process;
     2533    intptr_t      vaddr;
     2534    vseg_t      * vseg_ptr;
     2535    xptr_t        vseg_xp;
     2536    error_t       error;
     2537
     2538    // get client cluster identifier and pointer on RPC descriptor
     2539    cxy_t        client_cxy  = GET_CXY( xp );
     2540    rpc_desc_t * desc        = GET_PTR( xp );
     2541
     2542    // get input argument from client RPC descriptor
     2543    process = (process_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     2544    vaddr   = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
     2545   
     2546    // call local kernel function
     2547    error = vmm_get_vseg( process , vaddr , &vseg_ptr );
     2548
     2549    // set output arguments to client RPC descriptor
     2550    vseg_xp = XPTR( local_cxy , vseg_ptr );
     2551    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)vseg_xp );
     2552    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
     2553
     2554#if DEBUG_RPC_VMM_GET_VSEG
     2555cycle = (uint32_t)hal_get_cycles();
     2556if( cycle > DEBUG_RPC_VMM_GET_VSEG )
     2557printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2558__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2559#endif
     2560}
     2561
     2562/////////////////////////////////////////////////////////////////////////////////////////
     2563// [22]          RPC_KCM_ALLOC deprecated [AG] sept 2019
     2564/////////////////////////////////////////////////////////////////////////////////////////
     2565void rpc_kcm_alloc_client( cxy_t      cxy,
     2566                           uint32_t   kmem_type,   // in
     2567                           xptr_t   * buf_xp )     // out
     2568{
     2569#if DEBUG_RPC_KCM_ALLOC
     2570thread_t * this = CURRENT_THREAD;
     2571uint32_t cycle = (uint32_t)hal_get_cycles();
     2572if( cycle > DEBUG_RPC_KCM_ALLOC )
     2573printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2574__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2575#endif
     2576
     2577    uint32_t responses = 1;
     2578
     2579    // initialise RPC descriptor header
     2580    rpc_desc_t  rpc;
     2581    rpc.index    = RPC_KCM_ALLOC;
     2582    rpc.blocking = true;
     2583    rpc.rsp      = &responses;
     2584
     2585    // set input arguments in RPC descriptor
     2586    rpc.args[0] = (uint64_t)kmem_type;
     2587
     2588    // register RPC request in remote RPC fifo
     2589    rpc_send( cxy , &rpc );
     2590
     2591    // get output arguments from RPC descriptor
     2592    *buf_xp = (xptr_t)rpc.args[1];
     2593
     2594#if DEBUG_RPC_KCM_ALLOC
     2595cycle = (uint32_t)hal_get_cycles();
     2596if( cycle > DEBUG_RPC_KCM_ALLOC )
     2597printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2598__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2599#endif
     2600}
     2601
     2602//////////////////////////////////////
     2603void rpc_kcm_alloc_server( xptr_t xp )
     2604{
     2605#if DEBUG_RPC_KCM_ALLOC
     2606thread_t * this = CURRENT_THREAD;
     2607uint32_t cycle = (uint32_t)hal_get_cycles();
     2608if( cycle > DEBUG_RPC_KCM_ALLOC )
     2609printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2610__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2611#endif
     2612
     2613    // get client cluster identifier and pointer on RPC descriptor
     2614    cxy_t        client_cxy  = GET_CXY( xp );
     2615    rpc_desc_t * desc        = GET_PTR( xp );
     2616
     2617    // get input argument "kmem_type" from client RPC descriptor
     2618    uint32_t kmem_type = (uint32_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     2619
     2620    // allocates memory for kcm
     2621    kmem_req_t  req;
     2622    req.type  = kmem_type;
     2623    req.flags = AF_ZERO;
     2624    void * buf_ptr = kmem_alloc( &req );
     2625
     2626    // set output argument
     2627    xptr_t buf_xp = XPTR( local_cxy , buf_ptr );
     2628    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)buf_xp );
     2629
     2630#if DEBUG_RPC_KCM_ALLOC
     2631cycle = (uint32_t)hal_get_cycles();
     2632if( cycle > DEBUG_RPC_KCM_ALLOC )
     2633printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2634__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2635#endif
     2636}   
     2637
     2638/////////////////////////////////////////////////////////////////////////////////////////
     2639// [23]          RPC_KCM_FREE deprecated [AG] sept 2019
     2640/////////////////////////////////////////////////////////////////////////////////////////
     2641void rpc_kcm_free_client( cxy_t      cxy,
     2642                          void     * buf,          // in
     2643                          uint32_t   kmem_type )   // in
     2644{
     2645#if DEBUG_RPC_KCM_FREE
     2646thread_t * this = CURRENT_THREAD;
     2647uint32_t cycle = (uint32_t)hal_get_cycles();
     2648if( cycle > DEBUG_RPC_KCM_FREE )
     2649printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2650__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2651#endif
     2652
     2653    uint32_t responses = 1;
     2654
     2655    // initialise RPC descriptor header
     2656    rpc_desc_t  rpc;
     2657    rpc.index    = RPC_KCM_FREE;
     2658    rpc.blocking = true;
     2659    rpc.rsp      = &responses;
     2660
     2661    // set input arguments in RPC descriptor
     2662    rpc.args[0] = (uint64_t)(intptr_t)buf;
     2663    rpc.args[1] = (uint64_t)kmem_type;
     2664
     2665    // register RPC request in remote RPC fifo
     2666    rpc_send( cxy , &rpc );
     2667
     2668#if DEBUG_RPC_KCM_FREE
     2669cycle = (uint32_t)hal_get_cycles();
     2670if( cycle > DEBUG_RPC_KCM_FREE )
     2671printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2672__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2673#endif
     2674}
     2675
     2676/////////////////////////////////////
     2677void rpc_kcm_free_server( xptr_t xp )
     2678{
     2679#if DEBUG_RPC_KCM_FREE
     2680thread_t * this = CURRENT_THREAD;
     2681uint32_t cycle = (uint32_t)hal_get_cycles();
     2682if( cycle > DEBUG_RPC_KCM_FREE )
     2683printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2684__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2685#endif
     2686
     2687    // get client cluster identifier and pointer on RPC descriptor
     2688    cxy_t        client_cxy  = GET_CXY( xp );
     2689    rpc_desc_t * desc        = GET_PTR( xp );
     2690
     2691    // get input arguments "buf" and "kmem_type" from client RPC descriptor
     2692    void     * buf = (void *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     2693    uint32_t   kmem_type = (uint32_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
     2694
     2695    // releases memory
     2696    kmem_req_t  req;
     2697    req.type = kmem_type;
     2698    req.ptr  = buf;
     2699    kmem_free( &req );
     2700
     2701#if DEBUG_RPC_KCM_FREE
     2702cycle = (uint32_t)hal_get_cycles();
     2703if( cycle > DEBUG_RPC_KCM_FREE )
     2704printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2705__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2706#endif
     2707}   
     2708
     2709/////////////////////////////////////////////////////////////////////////////////////////
     2710// [24]          Marshaling functions attached to RPC_MAPPER_SYNC
     2711/////////////////////////////////////////////////////////////////////////////////////////
     2712void rpc_mapper_sync_client( cxy_t             cxy,
     2713                             struct mapper_s * mapper,
     2714                             error_t         * error )
     2715{
     2716#if DEBUG_RPC_MAPPER_SYNC
     2717thread_t * this = CURRENT_THREAD;
     2718uint32_t cycle = (uint32_t)hal_get_cycles();
     2719if( cycle > DEBUG_RPC_MAPPER_SYNC )
     2720printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2721__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2722#endif
     2723
     2724    uint32_t responses = 1;
     2725
     2726    // initialise RPC descriptor header
     2727    rpc_desc_t  rpc;
     2728    rpc.index    = RPC_MAPPER_SYNC;
     2729    rpc.blocking = true;
     2730    rpc.rsp      = &responses;
     2731
     2732    // set input arguments in RPC descriptor
     2733    rpc.args[0] = (uint64_t)(intptr_t)mapper;
     2734
     2735    // register RPC request in remote RPC fifo
     2736    rpc_send( cxy , &rpc );
     2737
     2738    // get output values from RPC descriptor
     2739    *error   = (error_t)rpc.args[1];
     2740
     2741#if DEBUG_RPC_MAPPER_SYNC
     2742cycle = (uint32_t)hal_get_cycles();
     2743if( cycle > DEBUG_RPC_MAPPER_SYNC )
     2744printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2745__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2746#endif
     2747}
     2748
     2749////////////////////////////////////////
     2750void rpc_mapper_sync_server( xptr_t xp )
     2751{
     2752#if DEBUG_RPC_MAPPER_SYNC
     2753thread_t * this = CURRENT_THREAD;
     2754uint32_t cycle = (uint32_t)hal_get_cycles();
     2755if( cycle > DEBUG_RPC_MAPPER_SYNC )
     2756printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     2757__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2758#endif
     2759
     2760    mapper_t * mapper;
     2761    error_t    error;
     2762
     2763    // get client cluster identifier and pointer on RPC descriptor
     2764    cxy_t        client_cxy  = GET_CXY( xp );
     2765    rpc_desc_t * desc        = GET_PTR( xp );
     2766
     2767    // get arguments from client RPC descriptor
     2768    mapper  = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     2769
     2770    // call local kernel function
     2771    error = mapper_sync( mapper );
     2772
     2773    // set output argument to client RPC descriptor
     2774    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
     2775
     2776#if DEBUG_RPC_MAPPER_SYNC
     2777cycle = (uint32_t)hal_get_cycles();
     2778if( cycle > DEBUG_RPC_MAPPER_SYNC )
     2779printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     2780__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     2781#endif
     2782}
     2783
    28062784*/
     2785
     2786
     2787
     2788/*
     2789////////////////////////////////////////////////////
     2790void rpc_fbf_display_client( cxy_t        cxy,
     2791                             xptr_t       window_xp,
     2792                             uint32_t     cores,
     2793                             error_t    * error )
     2794{
     2795#if DEBUG_RPC_FBF_DISPLAY
     2796uint32_t  cycle = (uint32_t)hal_get_cycles();
     2797thread_t * this = CURRENT_THREAD;
     2798if( DEBUG_RPC_FBF_DISPLAY < cycle )
     2799printk("\n[%s] thread[%x,%x] on core %d : enter / cycle %d\n",
     2800__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     2801#endif
     2802
     2803    uint32_t    responses = 1;
     2804    rpc_desc_t  rpc;
     2805
     2806    // initialise RPC descriptor header
     2807    rpc.index    = RPC_FBF_DISPLAY;
     2808    rpc.blocking = true;
     2809    rpc.rsp      = &responses;
     2810
     2811    // set input arguments in RPC descriptor
     2812    rpc.args[0] = (uint64_t)window_xp;
     2813    rpc.args[1] = (uint64_t)cores;
     2814
     2815    // register RPC request in remote RPC fifo
     2816    rpc_send( cxy , &rpc );
     2817
     2818    // get output argument from RPC descriptor
     2819    *error     = (error_t)rpc.args[2];
     2820
     2821#if DEBUG_RPC_FBF_DISPLAY
     2822cycle = (uint32_t)hal_get_cycles();
     2823if( DEBUG_RPC_FBF_DISPLAY < cycle )
     2824printk("\n[%s] thread[%x,%x] on core %d : exit / cycle %d\n",
     2825__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     2826#endif
     2827}
     2828
     2829////////////////////////////////////////
     2830void rpc_fbf_display_server( xptr_t xp )
     2831{
     2832    // get client cluster identifier and pointer on RPC descriptor
     2833    cxy_t        client_cxy = GET_CXY( xp );
     2834    rpc_desc_t * desc       = GET_PTR( xp );
     2835
     2836    // get arguments from RPC descriptor
     2837    xptr_t   window_xp = (xptr_t  )hal_remote_l64( XPTR(client_cxy , &desc->args[0]) );
     2838    uint32_t ncores    = (uint32_t)hal_remote_l64( XPTR(client_cxy , &desc->args[1]) );
     2839
     2840#if DEBUG_RPC_FBF_DISPLAY
     2841uint32_t cycle = (uint32_t)hal_get_cycles();
     2842thread_t * this = CURRENT_THREAD;
     2843if( DEBUG_RPC_FBF_DISPLAY < cycle )
     2844printk("\n[%s] thread[%x,%x] on core %d : enter / cycle %d\n",
     2845__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     2846#endif
     2847
     2848    // call relevant kernel function
     2849    error_t error = dev_fbf_parallel_display( window_xp , ncores );
     2850
     2851    // WARNING : for parallel RPCs, the return error argument is shared
     2852    hal_remote_atomic_or( XPTR( client_cxy , &desc->args[2] ) , error );
     2853
     2854#if DEBUG_RPC_FBF_DISPLAY
     2855cycle = (uint32_t)hal_get_cycles();
     2856if( DEBUG_RPC_FBF_DISPLAY < cycle )
     2857printk("\n[%s] thread[%x,%x] on core %d : exit / cycle %d\n",
     2858__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     2859#endif
     2860}
     2861*/
     2862
     2863
Note: See TracChangeset for help on using the changeset viewer.