Ignore:
Timestamp:
Oct 4, 2018, 11:47:36 PM (3 years ago)
Author:
alain
Message:

Complete restructuration of kernel locks.

File:
1 edited

Legend:

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

    r503 r564  
    4343
    4444/////////////////////////////////////////////////////////////////////////////////////////
    45 //      array of function pointers  (must be consistent with enum in rpc.h)
     45// Array of function pointers and array of printable strings.
     46// These arrays must be kept consistent with enum in rpc.h file.
    4647/////////////////////////////////////////////////////////////////////////////////////////
    4748
     
    8283};
    8384
    84 //////////////////////////////////////////////
     85char * rpc_str[RPC_MAX_INDEX] =
     86{
     87    "PMEM_GET_PAGES",         // 0
     88    "PMEM_RELEASE_PAGES",     // 1
     89    "undefined",              // 2
     90    "PROCESS_MAKE_FORK",      // 3
     91    "undefined",              // 4
     92    "undefined",              // 5
     93    "THREAD_USER_CREATE",     // 6
     94    "THREAD_KERNEL_CREATE",   // 7
     95    "undefined",              // 8
     96    "PROCESS_SIGACTION",      // 9
     97
     98    "VFS_INODE_CREATE",       // 10
     99    "VFS_INODE_DESTROY",      // 11
     100    "VFS_DENTRY_CREATE",      // 12
     101    "VFS_DENTRY_DESTROY",     // 13
     102    "VFS_FILE_CREATE",        // 14
     103    "VFS_FILE_DESTROY",       // 15
     104    "VFS_INODE_LOAD",         // 16
     105    "VFS_MAPPER_LOAD_ALL",    // 17
     106    "FATFS_GET_CLUSTER",      // 18
     107    "undefined",              // 19
     108
     109    "GET_VSEG",               // 20
     110    "GET_PTE",                // 21
     111    "KCM_ALLOC",              // 22
     112    "KCM_FREE",               // 23
     113    "MAPPER_MOVE_BUFFER",     // 24
     114    "MAPPER_GET_PAGE",        // 25
     115    "VMM_CREATE_VSEG",        // 26
     116    "undefined",              // 27
     117    "VMM_SET_COW",            // 28
     118    "VMM_DISPLAY",            // 29
     119};
     120
     121//////////////////////////////////////////////////////////////////////////////////
    85122void __attribute__((noinline)) rpc_undefined( xptr_t xp __attribute__ ((unused)) )
    86123{
     
    105142    client_core_lid = this->core->lid;
    106143
     144// check calling thread can yield when it is not the idle thread
     145assert( (this->busylocks == 0) || (this->type == THREAD_IDLE),
     146"cannot yield : busylocks = %d\n", this->busylocks );
     147
    107148#if DEBUG_RPC_CLIENT_GENERIC
    108149uint32_t cycle = (uint32_t)hal_get_cycles();
    109150if( DEBUG_RPC_CLIENT_GENERIC < cycle )
    110 printk("\n[DBG] %s : thread %x in process %x enter for rpc[%d] / cycle %d\n",
    111 __FUNCTION__, this->trdid, this->process->pid, rpc->index, cycle );
     151printk("\n[DBG] %s : thread %x in process %x enter for rpc %s / server_cxy %x / cycle %d\n",
     152__FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], server_cxy, cycle );
    112153#endif
    113154
    114155    // select a server_core : use client core index if possible / core 0 otherwise
    115     if( client_core_lid < hal_remote_lw( XPTR( server_cxy , &LOCAL_CLUSTER->cores_nr ) ) )
     156    if( client_core_lid < hal_remote_l32( XPTR( server_cxy , &LOCAL_CLUSTER->cores_nr ) ) )
    116157    {
    117158        server_core_lid = client_core_lid;
     
    130171
    131172    // get local pointer on rpc_fifo in remote cluster,
    132     remote_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo[server_core_lid];
    133 
    134         // post RPC in remote fifo / deschedule and retry if fifo full
     173    remote_fifo_t * rpc_fifo    = &LOCAL_CLUSTER->rpc_fifo[server_core_lid];
     174    xptr_t          rpc_fifo_xp = XPTR( server_cxy , rpc_fifo );
     175
     176        // post RPC in remote fifo / deschedule without blocking if fifo full
    135177    do
    136178    {
    137         full = remote_fifo_put_item( XPTR( server_cxy , rpc_fifo ), (uint64_t )desc_xp );
     179        full = remote_fifo_put_item( rpc_fifo_xp , (uint64_t )desc_xp );
     180
    138181            if ( full )
    139182        {
     
    151194#if DEBUG_RPC_CLIENT_GENERIC
    152195cycle = (uint32_t)hal_get_cycles();
     196uint32_t items = remote_fifo_items( rpc_fifo_xp );
    153197if( DEBUG_RPC_CLIENT_GENERIC < cycle )
    154 printk("\n[DBG] %s : thread %x in process %x / rpc[%d] / rpc_ptr %x / cycle %d\n",
    155 __FUNCTION__, this->trdid, this->process->pid, rpc->index, rpc, cycle );
     198printk("\n[DBG] %s : thread %x in process %x / rpc %s / items %d / cycle %d\n",
     199__FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], items, cycle );
    156200#endif
    157201       
     
    159203   dev_pic_send_ipi( server_cxy , server_core_lid );
    160204
    161     // wait RPC completion before returning if blocking RPC
    162     // - busy waiting policy during kernel_init, or if threads cannot yield
    163     // - block and deschedule in all other cases
     205    // wait RPC completion before returning if blocking RPC :
     206    // - descheduling without blocking if thread idle (in lernel init)
     207    // - block and deschedule policy for any other thread
    164208    if ( rpc->blocking )
    165209    {
    166         if( (this->type == THREAD_IDLE) || (thread_can_yield() == false) ) // busy waiting
     210        if( this->type == THREAD_IDLE )  // deschedule without blocking policy
    167211        {
    168 
     212 
    169213#if DEBUG_RPC_CLIENT_GENERIC
    170214cycle = (uint32_t)hal_get_cycles();
    171215if( DEBUG_RPC_CLIENT_GENERIC < cycle )
    172 printk("\n[DBG] %s : thread %x in process %x busy waiting for rpc[%d] / cycle %d\n",
    173 __FUNCTION__, this->trdid, this->process->pid, rpc->index , cycle );
    174 #endif
    175 
    176             while( rpc->responses ) hal_fixed_delay( 100 );
     216printk("\n[DBG] %s : thread %x in process %x enter waiting loop for rpc %s / cycle %d\n",
     217__FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle );
     218#endif
     219
     220             while( rpc->responses ) sched_yield( "busy waiting on RPC");
    177221   
    178222#if DEBUG_RPC_CLIENT_GENERIC
    179223cycle = (uint32_t)hal_get_cycles();
    180224if( DEBUG_RPC_CLIENT_GENERIC < cycle )
    181 printk("\n[DBG] %s : thread %x in process %x resumes for rpc[%d] / cycle %d\n",
    182 __FUNCTION__, this->trdid, this->process->pid, rpc->index, cycle );
    183 #endif
    184         }
    185         else                                                         // block & deschedule
     225printk("\n[DBG] %s : thread %x in process %x received response for rpc %s / cycle %d\n",
     226__FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle );
     227#endif
     228 
     229        }
     230        else                            // block and deschedule policy
    186231        {
    187232
     
    189234cycle = (uint32_t)hal_get_cycles();
    190235if( DEBUG_RPC_CLIENT_GENERIC < cycle )
    191 printk("\n[DBG] %s : thread %x in process %x blocks & deschedules for rpc[%d] / cycle %d\n",
    192 __FUNCTION__, this->trdid, this->process->pid, rpc->index , cycle );
    193 #endif
    194             thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_RPC );
    195             sched_yield("blocked on RPC");
     236printk("\n[DBG] %s : thread %x in process %x blocks & deschedules for rpc %s / cycle %d\n",
     237__FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle );
     238#endif
     239
     240        // block client thread
     241        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_RPC );
     242
     243        // deschedule
     244        sched_yield("blocked on RPC");
    196245
    197246#if DEBUG_RPC_CLIENT_GENERIC
    198247cycle = (uint32_t)hal_get_cycles();
    199248if( DEBUG_RPC_CLIENT_GENERIC < cycle )
    200 printk("\n[DBG] %s : thread %x in process %x resumes for rpc[%d] / cycle %d\n",
    201 __FUNCTION__, this->trdid, this->process->pid, rpc->index, cycle );
     249printk("\n[DBG] %s : thread %x in process %x resumes for rpc %s / cycle %d\n",
     250__FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle );
    202251#endif
    203252        }
    204253
    205         // check response available
    206         assert( (rpc->responses == 0) , "illegal RPC response\n" );
     254// response must be available for a blocking RPC
     255assert( (rpc->responses == 0) , "illegal response for RPC %s\n", rpc_str[rpc->index] );
     256
    207257    }
    208     else  // non blocking RPC
     258    else       // non blocking RPC
    209259    {
    210260
     
    212262cycle = (uint32_t)hal_get_cycles();
    213263if( DEBUG_RPC_CLIENT_GENERIC < cycle )
    214 printk("\n[DBG] %s : thread %x in process %x returns for non blocking rpc[%d] / cycle %d\n",
    215 __FUNCTION__, this->trdid, this->process->pid, rpc->index, cycle );
     264printk("\n[DBG] %s : thread %x in process %x returns for non blocking rpc %s / cycle %d\n",
     265__FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], cycle );
    216266#endif
    217267
     
    224274/***************************************************************************************/
    225275
    226 ////////////////
    227 void rpc_check( void )
    228 {
    229     error_t         error;
    230     thread_t      * thread; 
    231     uint32_t        sr_save;
    232 
    233 #if DEBUG_RPC_SERVER_GENERIC
    234 uint32_t cycle;
    235 #endif
    236 
    237     bool_t          found    = false;
    238         thread_t      * this     = CURRENT_THREAD;
    239     core_t        * core     = this->core;
    240     scheduler_t   * sched    = &core->scheduler;
    241         remote_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo[core->lid];
    242 
    243     // interrupted thread not preemptable during RPC chek
    244         hal_disable_irq( &sr_save );
    245 
    246     // activate (or create) RPC thread if RPC FIFO not empty and no acive RPC thread 
    247         if( (rpc_fifo->owner == 0) && (local_fifo_is_empty(rpc_fifo) == false) )
    248     {
    249 
    250 #if DEBUG_RPC_SERVER_GENERIC
    251 cycle = (uint32_t)hal_get_cycles();
    252 if( DEBUG_RPC_SERVER_GENERIC < cycle )
    253 printk("\n[DBG] %s : RPC FIFO non empty for core[%x,%d] / cycle %d\n",
    254 __FUNCTION__, local_cxy, core->lid, cycle );
    255 #endif
    256 
    257         // search one IDLE RPC thread associated to the selected core   
    258         list_entry_t * iter;
    259         LIST_FOREACH( &sched->k_root , iter )
    260         {
    261             thread = LIST_ELEMENT( iter , thread_t , sched_list );
    262             if( (thread->type == THREAD_RPC) && (thread->blocked == THREAD_BLOCKED_IDLE ) )
    263             {
    264                 // unblock found RPC thread
    265                 thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_IDLE );
    266 
    267                 // exit loop
    268                 found = true;
    269                 break;
    270             }
    271         }
    272 
    273         // create new RPC thread for the selected core if not found   
    274         if( found == false )                   
    275         {
    276             error = thread_kernel_create( &thread,
    277                                           THREAD_RPC,
    278                                                       &rpc_thread_func,
    279                                           NULL,
    280                                                       core->lid );
    281                  
    282             assert( (error == 0),
    283             "no memory to allocate a new RPC thread in cluster %x", local_cxy );
    284 
    285             // unblock created RPC thread
    286             thread->blocked = 0;
    287 
    288             // update RRPC threads counter 
    289             hal_atomic_add( &LOCAL_CLUSTER->rpc_threads[core->lid] , 1 );
    290 
    291 #if DEBUG_RPC_SERVER_GENERIC
    292 cycle = (uint32_t)hal_get_cycles();
    293 if( DEBUG_RPC_SERVER_GENERIC < cycle )
    294 printk("\n[DBG] %s : new RPC thread %x created for core[%x,%d] / cycle %d\n",
    295 __FUNCTION__, thread, local_cxy, core->lid, cycle );
    296 #endif
    297         }
    298     }
    299 
    300 #if DEBUG_RPC_SERVER_GENERIC
    301 cycle = (uint32_t)hal_get_cycles();
    302 if( DEBUG_RPC_SERVER_GENERIC < cycle )
    303 printk("\n[DBG] %s : interrupted thread %x deschedules on core[%x,%d] / cycle %d\n",
    304 __FUNCTION__, this, local_cxy, core->lid, cycle );
    305 #endif
    306 
    307     // interrupted thread always deschedule         
    308         sched_yield("IPI received");
    309 
    310 #if DEBUG_RPC_SERVER_GENERIC
    311 cycle = (uint32_t)hal_get_cycles();
    312 if( DEBUG_RPC_SERVER_GENERIC < cycle )
    313 printk("\n[DBG] %s : interrupted thread %x resumes on core[%x,%d] / cycle %d\n",
    314 __FUNCTION__, this, local_cxy, core->lid, cycle );
    315 #endif
    316 
    317     // interrupted thread restore IRQs after resume
    318         hal_restore_irq( sr_save );
    319 
    320 } // end rpc_check()
    321 
    322 
    323 //////////////////////
     276////////////////////////////
    324277void rpc_thread_func( void )
    325278{
     
    345298        rpc_fifo        = &LOCAL_CLUSTER->rpc_fifo[server_core_lid];
    346299
    347     // two embedded loops:
    348     // - external loop : "infinite" RPC thread
    349     // - internal loop : handle one RPC request per iteration
    350  
    351         while(1)  // infinite loop
     300    // "infinite" RPC thread loop
     301        while(1)
    352302        {
    353303        // try to take RPC_FIFO ownership
    354         if( hal_atomic_test_set( &rpc_fifo->owner , server_ptr->trdid ) )
     304        if( hal_atomic_test_set( &rpc_fifo->owner , server_ptr->trdid ) ) 
    355305        {
    356306
     
    358308uint32_t cycle = (uint32_t)hal_get_cycles();
    359309if( DEBUG_RPC_SERVER_GENERIC < cycle )
    360 printk("\n[DBG] %s : RPC thread %x in cluster %x takes RPC fifo ownership / cycle %d\n",
    361 __FUNCTION__, server_ptr, local_cxy, cycle );
    362 #endif
    363                 while( 1 )  //  one RPC request per iteration
     310printk("\n[DBG] %s : RPC thread %x on core[%d] takes RPC_FIFO ownership / cycle %d\n",
     311__FUNCTION__, server_ptr->trdid, server_core_lid, cycle );
     312#endif
     313                // try to consume one RPC request 
     314                empty = remote_fifo_get_item( rpc_fifo , (uint64_t *)&desc_xp );
     315
     316            // release RPC_FIFO ownership
     317            rpc_fifo->owner = 0;
     318
     319            // handle RPC request if success
     320                if ( empty == 0 )   
    364321            {
    365                     empty = local_fifo_get_item( rpc_fifo , (uint64_t *)&desc_xp );
    366 
    367                 // exit when FIFO empty or FIFO ownership lost (in case of descheduling)
    368                     if ( (empty == 0) && (rpc_fifo->owner == server_ptr->trdid) )
     322                // get client cluster and pointer on RPC descriptor
     323                desc_cxy = GET_CXY( desc_xp );
     324                desc_ptr = GET_PTR( desc_xp );
     325
     326                    index    = hal_remote_l32( XPTR( desc_cxy , &desc_ptr->index ) );
     327                blocking = hal_remote_l32( XPTR( desc_cxy , &desc_ptr->blocking ) );
     328
     329#if DEBUG_RPC_SERVER_GENERIC
     330cycle = (uint32_t)hal_get_cycles();
     331uint32_t items = remote_fifo_items( XPTR( local_cxy , rpc_fifo ) );
     332if( DEBUG_RPC_SERVER_GENERIC < cycle )
     333printk("\n[DBG] %s : RPC thread %x got rpc %s / client_cxy %x / items %d / cycle %d\n",
     334__FUNCTION__, server_ptr->trdid, rpc_str[index], desc_cxy, items, cycle );
     335#endif
     336                // call the relevant server function
     337                rpc_server[index]( desc_xp );
     338
     339#if DEBUG_RPC_SERVER_GENERIC
     340cycle = (uint32_t)hal_get_cycles();
     341if( DEBUG_RPC_SERVER_GENERIC < cycle )
     342printk("\n[DBG] %s : RPC thread %x completes rpc %s / client_cxy %x / cycle %d\n",
     343__FUNCTION__, server_ptr->trdid, rpc_str[index], desc_cxy, cycle );
     344#endif
     345                // decrement response counter in RPC descriptor if blocking RPC
     346                if( blocking )
    369347                {
    370                     // get client cluster and pointer on RPC descriptor
    371                     desc_cxy = GET_CXY( desc_xp );
    372                     desc_ptr = GET_PTR( desc_xp );
    373 
    374                         index    = hal_remote_lw( XPTR( desc_cxy , &desc_ptr->index ) );
    375                     blocking = hal_remote_lw( XPTR( desc_cxy , &desc_ptr->blocking ) );
     348                    // decrement responses counter in RPC descriptor
     349                    hal_remote_atomic_add( XPTR( desc_cxy, &desc_ptr->responses ), -1 );
     350
     351                    // get client thread pointer and client core lid from RPC descriptor
     352                    client_ptr      = hal_remote_lpt( XPTR( desc_cxy , &desc_ptr->thread ) );
     353                    client_core_lid = hal_remote_l32 ( XPTR( desc_cxy , &desc_ptr->lid ) );
     354
     355                    // unblock client thread
     356                    thread_unblock( XPTR( desc_cxy , client_ptr ) , THREAD_BLOCKED_RPC );
     357
     358                    hal_fence();
    376359
    377360#if DEBUG_RPC_SERVER_GENERIC
    378361cycle = (uint32_t)hal_get_cycles();
    379362if( DEBUG_RPC_SERVER_GENERIC < cycle )
    380 printk("\n[DBG] %s : RPC thread %x in cluster %x got rpc[%d] / rpc_cxy %x / rpc_ptr %x\n",
    381 __FUNCTION__, server_ptr, local_cxy, index, desc_cxy, desc_ptr );
    382 #endif
    383                     // call the relevant server function
    384                     rpc_server[index]( desc_xp );
    385 
    386 #if DEBUG_RPC_SERVER_GENERIC
    387 cycle = (uint32_t)hal_get_cycles();
    388 if( DEBUG_RPC_SERVER_GENERIC < cycle )
    389 printk("\n[DBG] %s : RPC thread %x in cluster %x completes rpc[%d] / rpc_ptr %x / cycle %d\n",
    390 __FUNCTION__, server_ptr, local_cxy, index, desc_ptr, cycle );
    391 #endif
    392                     // decrement response counter in RPC descriptor if blocking
    393                     if( blocking )
    394                     {
    395                         // decrement responses counter in RPC descriptor
    396                         hal_remote_atomic_add( XPTR( desc_cxy, &desc_ptr->responses ), -1 );
    397 
    398                         // get client thread pointer and client core lid from RPC descriptor
    399                         client_ptr      = hal_remote_lpt( XPTR( desc_cxy , &desc_ptr->thread ) );
    400                         client_core_lid = hal_remote_lw ( XPTR( desc_cxy , &desc_ptr->lid ) );
    401 
    402                         // unblock client thread
    403                         thread_unblock( XPTR( desc_cxy , client_ptr ) , THREAD_BLOCKED_RPC );
    404 
    405                         hal_fence();
    406 
    407 #if DEBUG_RPC_SERVER_GENERIC
    408 cycle = (uint32_t)hal_get_cycles();
    409 if( DEBUG_RPC_SERVER_GENERIC < cycle )
    410 printk("\n[DBG] %s : RPC thread %x (cluster %x) unblocked client thread %x (cluster %x)\n",
    411 __FUNCTION__, server_ptr, local_cxy, client_ptr, desc_cxy, cycle );
    412 #endif
    413                         // send IPI to client core
    414                             // dev_pic_send_ipi( desc_cxy , client_core_lid );
    415                     }
    416                         }
    417                 else
    418                 {
    419                     break;
    420                 }
    421                 } // end internal loop
    422 
    423             // release rpc_fifo ownership if not lost
    424             if( rpc_fifo->owner == server_ptr->trdid ) rpc_fifo->owner = 0;
    425 
    426         }  // end if RPC fifo
    427 
    428         // RPC thread blocks on IDLE
    429         thread_block( server_xp , THREAD_BLOCKED_IDLE );
    430 
    431         // sucide if too many RPC threads / simply deschedule otherwise
     363printk("\n[DBG] %s : RPC thread %x unblocked client thread %x / cycle %d\n",
     364__FUNCTION__, server_ptr->trdid, client_ptr->trdid, cycle );
     365#endif
     366                    // send IPI to client core
     367                    dev_pic_send_ipi( desc_cxy , client_core_lid );
     368
     369                }  // end if blocking RPC
     370            }  // end RPC handling if fifo non empty
     371        }  // end if RPC_fIFO ownership successfully taken and released
     372
     373        // sucide if too many RPC threads
    432374        if( LOCAL_CLUSTER->rpc_threads[server_core_lid] >= CONFIG_RPC_THREADS_MAX )
    433375            {
     
    436378uint32_t cycle = (uint32_t)hal_get_cycles();
    437379if( DEBUG_RPC_SERVER_GENERIC < cycle )
    438 printk("\n[DBG] %s : RPC thread %x in cluster %x suicides / cycle %d\n",
    439 __FUNCTION__, server_ptr, local_cxy, cycle );
     380printk("\n[DBG] %s : RPC thread %x suicides / cycle %d\n",
     381__FUNCTION__, server_ptr->trdid, cycle );
    440382#endif
    441383            // update RPC threads counter
    442                 hal_atomic_add( &LOCAL_CLUSTER->rpc_threads , -1 );
     384                hal_atomic_add( &LOCAL_CLUSTER->rpc_threads[server_core_lid] , -1 );
    443385
    444386            // RPC thread blocks on GLOBAL
     
    448390            hal_remote_atomic_or( server_xp , THREAD_FLAG_REQ_DELETE );
    449391            }
     392        // block and deschedule otherwise
    450393        else
    451394        {
     
    454397uint32_t cycle = (uint32_t)hal_get_cycles();
    455398if( DEBUG_RPC_SERVER_GENERIC < cycle )
    456 printk("\n[DBG] %s : RPC thread %x in cluster %x block & deschedules / cycle %d\n",
    457 __FUNCTION__, server_ptr, local_cxy, cycle );
    458 #endif
     399printk("\n[DBG] %s : RPC thread %x block IDLE & deschedules / cycle %d\n",
     400__FUNCTION__, server_ptr->trdid, cycle );
     401#endif
     402            // RPC thread blocks on IDLE
     403            thread_block( server_xp , THREAD_BLOCKED_IDLE );
    459404
    460405            // RPC thread deschedules
    461             assert( thread_can_yield() , "illegal sched_yield\n" );
    462             sched_yield("RPC fifo empty");
     406            sched_yield("RPC_FIFO empty");
    463407        }
    464 
    465408        } // end infinite loop
    466 
    467409} // end rpc_thread_func()
    468410
     
    478420{
    479421#if DEBUG_RPC_PMEM_GET_PAGES
     422thread_t * this = CURRENT_THREAD;
    480423uint32_t cycle = (uint32_t)hal_get_cycles();
    481424if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
    482 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    483 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     425printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     426__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    484427#endif
    485428
     
    504447cycle = (uint32_t)hal_get_cycles();
    505448if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
    506 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    507 __FUNCTION__ , CURRENT_THREAD , cycle );
     449printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     450__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    508451#endif
    509452}
     
    513456{
    514457#if DEBUG_RPC_PMEM_GET_PAGES
     458thread_t * this = CURRENT_THREAD;
    515459uint32_t cycle = (uint32_t)hal_get_cycles();
    516460if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
    517 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    518 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     461printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     462__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    519463#endif
    520464
     
    524468
    525469    // get input arguments from client RPC descriptor
    526     uint32_t order = (uint32_t)hal_remote_lwd( XPTR( cxy , &desc->args[0] ) );
     470    uint32_t order = (uint32_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) );
    527471   
    528472    // call local pmem allocator
     
    530474
    531475    // set output arguments into client RPC descriptor
    532     hal_remote_swd( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
     476    hal_remote_s64( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
    533477
    534478#if DEBUG_RPC_PMEM_GET_PAGES
    535479cycle = (uint32_t)hal_get_cycles();
    536480if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
    537 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    538 __FUNCTION__ , CURRENT_THREAD , cycle );
     481printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     482__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    539483#endif
    540484}
     
    549493{
    550494#if DEBUG_RPC_PMEM_RELEASE_PAGES
     495thread_t * this = CURRENT_THREAD;
    551496uint32_t cycle = (uint32_t)hal_get_cycles();
    552497if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
    553 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    554 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     498printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     499__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    555500#endif
    556501
     
    572517cycle = (uint32_t)hal_get_cycles();
    573518if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
    574 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    575 __FUNCTION__ , CURRENT_THREAD , cycle );
     519printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     520__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    576521#endif
    577522}
     
    581526{
    582527#if DEBUG_RPC_PMEM_RELEASE_PAGES
     528thread_t * this = CURRENT_THREAD;
    583529uint32_t cycle = (uint32_t)hal_get_cycles();
    584530if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
    585 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    586 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     531printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     532__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    587533#endif
    588534
     
    592538
    593539    // get input arguments from client RPC descriptor
    594     page_t * page = (page_t *)(intptr_t)hal_remote_lwd( XPTR( cxy , &desc->args[0] ) );
     540    page_t * page = (page_t *)(intptr_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) );
    595541   
    596542    // release memory to local pmem
     
    603549cycle = (uint32_t)hal_get_cycles();
    604550if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
    605 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    606 __FUNCTION__ , CURRENT_THREAD , cycle );
     551printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     552__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    607553#endif
    608554}
     
    625571{
    626572#if DEBUG_RPC_PROCESS_MAKE_FORK
     573thread_t * this = CURRENT_THREAD;
    627574uint32_t cycle = (uint32_t)hal_get_cycles();
    628575if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK )
    629 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    630 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     576printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     577__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    631578#endif
    632579
     
    654601cycle = (uint32_t)hal_get_cycles();
    655602if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK )
    656 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    657 __FUNCTION__ , CURRENT_THREAD , cycle );
     603printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     604__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    658605#endif
    659606}
     
    663610{
    664611#if DEBUG_RPC_PROCESS_MAKE_FORK
     612thread_t * this = CURRENT_THREAD;
    665613uint32_t cycle = (uint32_t)hal_get_cycles();
    666614if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK )
    667 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    668 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     615printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     616__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    669617#endif
    670618
     
    680628
    681629    // get input arguments from cient RPC descriptor
    682     ref_process_xp   = (xptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
    683     parent_thread_xp = (xptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
     630    ref_process_xp   = (xptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     631    parent_thread_xp = (xptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
    684632
    685633    // call local kernel function
     
    690638
    691639    // set output argument into client RPC descriptor
    692     hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)child_pid );
    693     hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)(intptr_t)child_thread_ptr );
    694     hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
     640    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)child_pid );
     641    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)(intptr_t)child_thread_ptr );
     642    hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
    695643
    696644#if DEBUG_RPC_PROCESS_MAKE_FORK
    697645cycle = (uint32_t)hal_get_cycles();
    698646if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK )
    699 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    700 __FUNCTION__ , CURRENT_THREAD , cycle );
     647printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     648__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    701649#endif
    702650}
     
    723671                                    error_t        * error )      // out
    724672{
     673#if DEBUG_RPC_THREAD_USER_CREATE
     674thread_t * this = CURRENT_THREAD;
     675uint32_t cycle = (uint32_t)hal_get_cycles();
     676if( cycle > DEBUG_RPC_THREAD_USER_CREATE)
     677printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     678__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     679#endif
     680
    725681    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    726682
     
    744700    *error     = (error_t)rpc.args[5];
    745701
     702#if DEBUG_RPC_THREAD_USER_CREATE
     703cycle = (uint32_t)hal_get_cycles();
     704if( cycle > DEBUG_RPC_THREAD_USER_CREATE)
     705printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     706__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     707#endif
    746708}
    747709
     
    749711void rpc_thread_user_create_server( xptr_t xp )
    750712{
     713#if DEBUG_RPC_THREAD_USER_CREATE
     714thread_t * this = CURRENT_THREAD;
     715uint32_t cycle = (uint32_t)hal_get_cycles();
     716if( cycle > DEBUG_RPC_THREAD_USER_CREATE)
     717printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     718__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     719#endif
    751720
    752721    pthread_attr_t * attr_ptr;   // pointer on attributes structure in client cluster
     
    767736
    768737    // get input arguments from RPC descriptor
    769     pid        = (pid_t)                     hal_remote_lwd(XPTR(client_cxy , &desc->args[0]));
    770     start_func = (void *)(intptr_t)          hal_remote_lwd(XPTR(client_cxy , &desc->args[1]));
    771     start_arg  = (void *)(intptr_t)          hal_remote_lwd(XPTR(client_cxy , &desc->args[2]));
    772     attr_ptr   = (pthread_attr_t *)(intptr_t)hal_remote_lwd(XPTR(client_cxy , &desc->args[3]));
     738    pid        = (pid_t)                     hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     739    start_func = (void *)(intptr_t)          hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
     740    start_arg  = (void *)(intptr_t)          hal_remote_l64(XPTR(client_cxy , &desc->args[2]));
     741    attr_ptr   = (pthread_attr_t *)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[3]));
    773742
    774743    // makes a local copy of attributes structure
     
    786755    // set output arguments
    787756    thread_xp = XPTR( local_cxy , thread_ptr );
    788     hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)thread_xp );
    789     hal_remote_swd( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );
    790 
     757    hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)thread_xp );
     758    hal_remote_s64( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );
     759
     760#if DEBUG_RPC_THREAD_USER_CREATE
     761cycle = (uint32_t)hal_get_cycles();
     762if( cycle > DEBUG_RPC_THREAD_USER_CREATE)
     763printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     764__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     765#endif
    791766}
    792767
     
    803778                                      error_t * error )      // out
    804779{
     780#if DEBUG_RPC_THREAD_KERNEL_CREATE
     781thread_t * this = CURRENT_THREAD;
     782uint32_t cycle = (uint32_t)hal_get_cycles();
     783if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE)
     784printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     785__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     786#endif
     787
    805788    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    806789
     
    823806    *error     = (error_t)rpc.args[4];
    824807
     808#if DEBUG_RPC_THREAD_KERNEL_CREATE
     809cycle = (uint32_t)hal_get_cycles();
     810if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE)
     811printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     812__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     813#endif
    825814}
    826815
     
    828817void rpc_thread_kernel_create_server( xptr_t xp )
    829818{
     819#if DEBUG_RPC_THREAD_KERNEL_CREATE
     820thread_t * this = CURRENT_THREAD;
     821uint32_t cycle = (uint32_t)hal_get_cycles();
     822if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE)
     823printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     824__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     825#endif
     826
    830827    thread_t       * thread_ptr;  // local pointer on thread descriptor
    831828    xptr_t           thread_xp;   // extended pointer on thread descriptor
     
    838835
    839836    // get attributes from RPC descriptor
    840     uint32_t  type = (uint32_t)       hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
    841     void    * func = (void*)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
    842     void    * args = (void*)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[2] ) );
     837    uint32_t  type = (uint32_t)       hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     838    void    * func = (void*)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
     839    void    * args = (void*)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
    843840
    844841    // select one core
     
    850847    // set output arguments
    851848    thread_xp = XPTR( local_cxy , thread_ptr );
    852     hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
    853     hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp );
    854 
     849    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
     850    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp );
     851
     852#if DEBUG_RPC_THREAD_KERNEL_CREATE
     853cycle = (uint32_t)hal_get_cycles();
     854if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE)
     855printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     856__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
     857#endif
    855858}
    856859
     
    913916
    914917    // get arguments from RPC descriptor
    915     action   = (uint32_t)hal_remote_lwd( XPTR(client_cxy , &rpc->args[0]) );
    916     pid      = (pid_t)   hal_remote_lwd( XPTR(client_cxy , &rpc->args[1]) );
     918    action   = (uint32_t)hal_remote_l64( XPTR(client_cxy , &rpc->args[0]) );
     919    pid      = (pid_t)   hal_remote_l64( XPTR(client_cxy , &rpc->args[1]) );
    917920
    918921#if DEBUG_RPC_PROCESS_SIGACTION
     
    945948    {
    946949        // get client core lid
    947         client_lid    = (lid_t)     hal_remote_lw ( XPTR( client_cxy , &rpc->lid    ) );
     950        client_lid    = (lid_t)     hal_remote_l32 ( XPTR( client_cxy , &rpc->lid    ) );
    948951
    949952        // unblock client thread
     
    981984{
    982985#if DEBUG_RPC_VFS_INODE_CREATE
     986thread_t * this = CURRENT_THREAD;
    983987uint32_t cycle = (uint32_t)hal_get_cycles();
    984988if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
    985 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    986 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     989printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     990__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    987991#endif
    988992
     
    10131017
    10141018#if DEBUG_RPC_VFS_INODE_CREATE
    1015 uint32_t cycle = (uint32_t)hal_get_cycles();
     1019cycle = (uint32_t)hal_get_cycles();
    10161020if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
    1017 printk("\n[DBG] %s : thread %x exit on core[%x,%d] / cycle %d\n",
    1018 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1021printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1022__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    10191023#endif
    10201024}
     
    10241028{
    10251029#if DEBUG_RPC_VFS_INODE_CREATE
     1030thread_t * this = CURRENT_THREAD;
    10261031uint32_t cycle = (uint32_t)hal_get_cycles();
    10271032if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
    1028 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1029 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1033printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1034__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    10301035#endif
    10311036
     
    10461051
    10471052    // get input arguments from client rpc descriptor
    1048     dentry_xp  = (xptr_t)          hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
    1049     fs_type    = (uint32_t)        hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
    1050     inode_type = (uint32_t)        hal_remote_lwd( XPTR( client_cxy , &desc->args[2] ) );
    1051     extend     = (void *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[3] ) );
    1052     attr       = (uint32_t)        hal_remote_lwd( XPTR( client_cxy , &desc->args[4] ) );
    1053     rights     = (uint32_t)        hal_remote_lwd( XPTR( client_cxy , &desc->args[5] ) );
    1054     uid        = (uid_t)           hal_remote_lwd( XPTR( client_cxy , &desc->args[6] ) );
    1055     gid        = (gid_t)           hal_remote_lwd( XPTR( client_cxy , &desc->args[7] ) );
     1053    dentry_xp  = (xptr_t)          hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     1054    fs_type    = (uint32_t)        hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
     1055    inode_type = (uint32_t)        hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
     1056    extend     = (void *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
     1057    attr       = (uint32_t)        hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) );
     1058    rights     = (uint32_t)        hal_remote_l64( XPTR( client_cxy , &desc->args[5] ) );
     1059    uid        = (uid_t)           hal_remote_l64( XPTR( client_cxy , &desc->args[6] ) );
     1060    gid        = (gid_t)           hal_remote_l64( XPTR( client_cxy , &desc->args[7] ) );
    10561061
    10571062    // call local kernel function
     
    10671072
    10681073    // set output arguments
    1069     hal_remote_swd( XPTR( client_cxy , &desc->args[8] ) , (uint64_t)inode_xp );
    1070     hal_remote_swd( XPTR( client_cxy , &desc->args[9] ) , (uint64_t)error );
     1074    hal_remote_s64( XPTR( client_cxy , &desc->args[8] ) , (uint64_t)inode_xp );
     1075    hal_remote_s64( XPTR( client_cxy , &desc->args[9] ) , (uint64_t)error );
    10711076
    10721077#if DEBUG_RPC_VFS_INODE_CREATE
    1073 uint32_t cycle = (uint32_t)hal_get_cycles();
     1078cycle = (uint32_t)hal_get_cycles();
    10741079if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
    1075 printk("\n[DBG] %s : thread %x exit on core[%x,%d] / cycle %d\n",
    1076 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1080printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1081__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    10771082#endif
    10781083}
     
    10881093{
    10891094#if DEBUG_RPC_VFS_INODE_DESTROY
     1095thread_t * this = CURRENT_THREAD;
    10901096uint32_t cycle = (uint32_t)hal_get_cycles();
    10911097if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
    1092 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1093 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1098printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1099__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    10941100#endif
    10951101
     
    11121118
    11131119#if DEBUG_RPC_VFS_INODE_DESTROY
    1114 uint32_t cycle = (uint32_t)hal_get_cycles();
     1120cycle = (uint32_t)hal_get_cycles();
    11151121if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
    1116 printk("\n[DBG] %s : thread %x exit on core[%x,%d] / cycle %d\n",
    1117 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1122printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1123__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    11181124#endif
    11191125}
     
    11231129{
    11241130#if DEBUG_RPC_VFS_INODE_DESTROY
     1131thread_t * this = CURRENT_THREAD;
    11251132uint32_t cycle = (uint32_t)hal_get_cycles();
    11261133if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
    1127 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1128 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1134printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1135__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    11291136#endif
    11301137
     
    11371144
    11381145    // get arguments "inode" from client RPC descriptor
    1139     inode = (vfs_inode_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
     1146    inode = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    11401147                       
    11411148    // call local kernel function
     
    11431150
    11441151    // set output argument
    1145     hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
     1152    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
    11461153
    11471154#if DEBUG_RPC_VFS_INODE_DESTROY
    1148 uint32_t cycle = (uint32_t)hal_get_cycles();
     1155cycle = (uint32_t)hal_get_cycles();
    11491156if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
    1150 printk("\n[DBG] %s : thread %x exit on core[%x,%d] / cycle %d\n",
    1151 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1157printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1158__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    11521159#endif
    11531160}
     
    11661173{
    11671174#if DEBUG_RPC_VFS_DENTRY_CREATE
     1175thread_t * this = CURRENT_THREAD;
    11681176uint32_t cycle = (uint32_t)hal_get_cycles();
    11691177if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
    1170 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1171 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1178printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1179__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    11721180#endif
    11731181
     
    11951203cycle = (uint32_t)hal_get_cycles();
    11961204if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
    1197 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    1198 __FUNCTION__ , CURRENT_THREAD , cycle );
     1205printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1206__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    11991207#endif
    12001208}
     
    12041212{
    12051213#if DEBUG_RPC_VFS_DENTRY_CREATE
     1214thread_t * this = CURRENT_THREAD;
    12061215uint32_t cycle = (uint32_t)hal_get_cycles();
    12071216if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
    1208 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1209 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1217printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1218__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    12101219#endif
    12111220
     
    12221231
    12231232    // get arguments "name", "type", and "parent" from client RPC descriptor
    1224     type   = (uint32_t)               hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
    1225     name   = (char *)(intptr_t)       hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
    1226     parent = (vfs_inode_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[2] ) );
     1233    type   = (uint32_t)               hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     1234    name   = (char *)(intptr_t)       hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
     1235    parent = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
    12271236
    12281237    // makes a local copy of  name
     
    12361245                               &dentry_xp );
    12371246    // set output arguments
    1238     hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)dentry_xp );
    1239     hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
     1247    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)dentry_xp );
     1248    hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
    12401249
    12411250#if DEBUG_RPC_VFS_DENTRY_CREATE
    12421251cycle = (uint32_t)hal_get_cycles();
    12431252if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
    1244 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    1245 __FUNCTION__ , CURRENT_THREAD , cycle );
     1253printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1254__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    12461255#endif
    12471256}
     
    12571266{
    12581267#if DEBUG_RPC_VFS_DENTRY_DESTROY
     1268thread_t * this = CURRENT_THREAD;
    12591269uint32_t cycle = (uint32_t)hal_get_cycles();
    12601270if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
    1261 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1262 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1271printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1272__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    12631273#endif
    12641274
     
    12831293cycle = (uint32_t)hal_get_cycles();
    12841294if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
    1285 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    1286 __FUNCTION__ , CURRENT_THREAD , cycle );
     1295printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1296__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    12871297#endif
    12881298}
     
    12921302{
    12931303#if DEBUG_RPC_VFS_DENTRY_DESTROY
     1304thread_t * this = CURRENT_THREAD;
    12941305uint32_t cycle = (uint32_t)hal_get_cycles();
    12951306if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
    1296 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1297 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1307printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1308__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    12981309#endif
    12991310
     
    13061317
    13071318    // get arguments "dentry" from client RPC descriptor
    1308     dentry = (vfs_dentry_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
     1319    dentry = (vfs_dentry_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    13091320                       
    13101321    // call local kernel function
     
    13121323
    13131324    // set output argument
    1314     hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
     1325    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
    13151326
    13161327#if DEBUG_RPC_VFS_DENTRY_DESTROY
    13171328cycle = (uint32_t)hal_get_cycles();
    13181329if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
    1319 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    1320 __FUNCTION__ , CURRENT_THREAD , cycle );
     1330printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1331__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    13211332#endif
    13221333}
     
    13351346{
    13361347#if DEBUG_RPC_VFS_FILE_CREATE
     1348thread_t * this = CURRENT_THREAD;
    13371349uint32_t cycle = (uint32_t)hal_get_cycles();
    13381350if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
    1339 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1340 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1351printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1352__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    13411353#endif
    13421354
     
    13631375cycle = (uint32_t)hal_get_cycles();
    13641376if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
    1365 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    1366 __FUNCTION__ , CURRENT_THREAD , cycle );
     1377printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1378__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    13671379#endif
    13681380}
     
    13721384{
    13731385#if DEBUG_RPC_VFS_FILE_CREATE
     1386thread_t * this = CURRENT_THREAD;
    13741387uint32_t cycle = (uint32_t)hal_get_cycles();
    13751388if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
    1376 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1377 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1389printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1390__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    13781391#endif
    13791392
     
    13881401
    13891402    // get arguments "file_attr" and "inode" from client RPC descriptor
    1390     inode     = (vfs_inode_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
    1391     file_attr = (uint32_t)               hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
     1403    inode     = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     1404    file_attr = (uint32_t)               hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
    13921405                       
    13931406    // call local kernel function
     
    13971410 
    13981411    // set output arguments
    1399     hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)file_xp );
    1400     hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
     1412    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)file_xp );
     1413    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    14011414
    14021415#if DEBUG_RPC_VFS_FILE_CREATE
    14031416cycle = (uint32_t)hal_get_cycles();
    14041417if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
    1405 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    1406 __FUNCTION__ , CURRENT_THREAD , cycle );
     1418printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1419__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    14071420#endif
    14081421}
     
    14171430{
    14181431#if DEBUG_RPC_VFS_FILE_DESTROY
     1432thread_t * this = CURRENT_THREAD;
    14191433uint32_t cycle = (uint32_t)hal_get_cycles();
    14201434if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
    1421 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1422 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1435printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1436__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    14231437#endif
    14241438
     
    14401454cycle = (uint32_t)hal_get_cycles();
    14411455if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
    1442 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    1443 __FUNCTION__ , CURRENT_THREAD , cycle );
     1456printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1457__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    14441458#endif
    14451459}
     
    14491463{
    14501464#if DEBUG_RPC_VFS_FILE_DESTROY
     1465thread_t * this = CURRENT_THREAD;
    14511466uint32_t cycle = (uint32_t)hal_get_cycles();
    14521467if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
    1453 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1454 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1468printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1469__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    14551470#endif
    14561471
     
    14621477
    14631478    // get arguments "dentry" from client RPC descriptor
    1464     file = (vfs_file_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
     1479    file = (vfs_file_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    14651480                       
    14661481    // call local kernel function
     
    14701485cycle = (uint32_t)hal_get_cycles();
    14711486if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
    1472 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    1473 __FUNCTION__ , CURRENT_THREAD , cycle );
     1487printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1488__FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle );
    14741489#endif
    14751490}
     
    15221537
    15231538    // get arguments "parent", "name", and "child_xp"
    1524     parent     = (vfs_inode_t*)(intptr_t)hal_remote_lwd(XPTR(client_cxy , &desc->args[0]));
    1525     name       = (char*)(intptr_t)       hal_remote_lwd(XPTR(client_cxy , &desc->args[1]));
    1526     child_xp   = (xptr_t)                hal_remote_lwd(XPTR(client_cxy , &desc->args[2]));
     1539    parent     = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     1540    name       = (char*)(intptr_t)       hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
     1541    child_xp   = (xptr_t)                hal_remote_l64(XPTR(client_cxy , &desc->args[2]));
    15271542
    15281543    // get name local copy
     
    15341549
    15351550    // set output argument
    1536     hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
     1551    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    15371552
    15381553}
     
    15771592
    15781593    // get arguments "parent", "name", and "child_xp"
    1579     inode = (vfs_inode_t*)(intptr_t)hal_remote_lwd(XPTR(client_cxy , &desc->args[0]));
     1594    inode = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
    15801595
    15811596    // call the kernel function
     
    15831598
    15841599    // set output argument
    1585     hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
     1600    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
    15861601
    15871602}
     
    16361651    // get input arguments
    16371652    mapper = (mapper_t *)(intptr_t)hal_remote_lpt( XPTR( client_cxy , &desc->args[0] ) );
    1638     first  = (uint32_t)            hal_remote_lw ( XPTR( client_cxy , &desc->args[1] ) );
    1639     index  = (uint32_t)            hal_remote_lw ( XPTR( client_cxy , &desc->args[2] ) );
     1653    first  = (uint32_t)            hal_remote_l32 ( XPTR( client_cxy , &desc->args[1] ) );
     1654    index  = (uint32_t)            hal_remote_l32 ( XPTR( client_cxy , &desc->args[2] ) );
    16401655
    16411656    // call the kernel function
     
    16431658
    16441659    // set output argument
    1645     hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)cluster );
    1646     hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
     1660    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)cluster );
     1661    hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
    16471662
    16481663}
     
    16601675{
    16611676#if DEBUG_RPC_VMM_GET_VSEG
     1677thread_t * this = CURRENT_THREAD;
    16621678uint32_t cycle = (uint32_t)hal_get_cycles();
    16631679if( cycle > DEBUG_RPC_VMM_GET_VSEG )
    1664 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1665 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1680printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1681__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    16661682#endif
    16671683
     
    16881704cycle = (uint32_t)hal_get_cycles();
    16891705if( cycle > DEBUG_RPC_VMM_GET_VSEG )
    1690 printk("\n[DBG] %s : thread %x exit on core[%x,%d] / cycle %d\n",
    1691 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1706printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1707__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    16921708#endif
    16931709}
     
    16971713{
    16981714#if DEBUG_RPC_VMM_GET_VSEG
     1715thread_t * this = CURRENT_THREAD;
    16991716uint32_t cycle = (uint32_t)hal_get_cycles();
    17001717if( cycle > DEBUG_RPC_VMM_GET_VSEG )
    1701 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1702 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1718printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1719__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    17031720#endif
    17041721
     
    17141731
    17151732    // get input argument from client RPC descriptor
    1716     process = (process_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
    1717     vaddr   = (intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
     1733    process = (process_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     1734    vaddr   = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
    17181735   
    17191736    // call local kernel function
     
    17221739    // set output arguments to client RPC descriptor
    17231740    vseg_xp = XPTR( local_cxy , vseg_ptr );
    1724     hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)vseg_xp );
    1725     hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
     1741    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)vseg_xp );
     1742    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    17261743
    17271744#if DEBUG_RPC_VMM_GET_VSEG
    17281745cycle = (uint32_t)hal_get_cycles();
    17291746if( cycle > DEBUG_RPC_VMM_GET_VSEG )
    1730 printk("\n[DBG] %s : thread %x exit on core[%x,%d] / cycle %d\n",
    1731 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1747printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1748__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    17321749#endif
    17331750}
     
    17481765{
    17491766#if DEBUG_RPC_VMM_GET_PTE
     1767thread_t * this = CURRENT_THREAD;
    17501768uint32_t cycle = (uint32_t)hal_get_cycles();
    17511769if( cycle > DEBUG_RPC_VMM_GET_PTE )
    1752 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1753 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1770printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1771__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    17541772#endif
    17551773
     
    17781796cycle = (uint32_t)hal_get_cycles();
    17791797if( cycle > DEBUG_RPC_VMM_GET_PTE )
    1780 printk("\n[DBG] %s : thread %x exit on core[%x,%d] / cycle %d\n",
    1781 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1798printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1799__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    17821800#endif
    17831801}
     
    17871805{
    17881806#if DEBUG_RPC_VMM_GET_PTE
     1807thread_t * this = CURRENT_THREAD;
    17891808uint32_t cycle = (uint32_t)hal_get_cycles();
    17901809if( cycle > DEBUG_RPC_VMM_GET_PTE )
    1791 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n",
    1792 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1810printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1811__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    17931812#endif
    17941813
     
    18051824
    18061825    // get input argument "process" & "vpn" from client RPC descriptor
    1807     process = (process_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
    1808     vpn     = (vpn_t)                hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
    1809     cow     = (bool_t)               hal_remote_lwd( XPTR( client_cxy , &desc->args[2] ) );
     1826    process = (process_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     1827    vpn     = (vpn_t)                hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
     1828    cow     = (bool_t)               hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
    18101829   
    18111830    // call local kernel function
     
    18131832
    18141833    // set output argument "attr" & "ppn" to client RPC descriptor
    1815     hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)attr );
    1816     hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)ppn );
    1817     hal_remote_swd( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );
     1834    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)attr );
     1835    hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)ppn );
     1836    hal_remote_s64( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );
    18181837
    18191838#if DEBUG_RPC_VMM_GET_PTE
    18201839cycle = (uint32_t)hal_get_cycles();
    18211840if( cycle > DEBUG_RPC_VMM_GET_PTE )
    1822 printk("\n[DBG] %s : thread %x exit on core[%x,%d] / cycle %d\n",
    1823 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
     1841printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1842__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
    18241843#endif
    18251844}
     
    18341853                           xptr_t *   buf_xp )     // out
    18351854{
     1855#if DEBUG_RPC_KCM_ALLOC
     1856thread_t * this = CURRENT_THREAD;
     1857uint32_t cycle = (uint32_t)hal_get_cycles();
     1858if( cycle > DEBUG_RPC_KCM_ALLOC )
     1859printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1860__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1861#endif
     1862
    18361863    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    18371864
     
    18511878    *buf_xp = (xptr_t)rpc.args[1];
    18521879
     1880#if DEBUG_RPC_KCM_ALLOC
     1881cycle = (uint32_t)hal_get_cycles();
     1882if( cycle > DEBUG_RPC_KCM_ALLOC )
     1883printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1884__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1885#endif
    18531886}
    18541887
     
    18561889void rpc_kcm_alloc_server( xptr_t xp )
    18571890{
     1891#if DEBUG_RPC_KCM_ALLOC
     1892thread_t * this = CURRENT_THREAD;
     1893uint32_t cycle = (uint32_t)hal_get_cycles();
     1894if( cycle > DEBUG_RPC_KCM_ALLOC )
     1895printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1896__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1897#endif
     1898
    18581899    // get client cluster identifier and pointer on RPC descriptor
    18591900    cxy_t        client_cxy  = GET_CXY( xp );
     
    18611902
    18621903    // get input argument "kmem_type" from client RPC descriptor
    1863     uint32_t kmem_type = (uint32_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
     1904    uint32_t kmem_type = (uint32_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
    18641905
    18651906    // allocates memory for kcm
     
    18711912    // set output argument
    18721913    xptr_t buf_xp = XPTR( local_cxy , buf_ptr );
    1873     hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)buf_xp );
    1874 
     1914    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)buf_xp );
     1915
     1916#if DEBUG_RPC_KCM_ALLOC
     1917cycle = (uint32_t)hal_get_cycles();
     1918if( cycle > DEBUG_RPC_KCM_ALLOC )
     1919printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1920__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1921#endif
    18751922}   
    18761923
     
    18841931                          uint32_t   kmem_type )   // in
    18851932{
     1933#if DEBUG_RPC_KCM_FREE
     1934thread_t * this = CURRENT_THREAD;
     1935uint32_t cycle = (uint32_t)hal_get_cycles();
     1936if( cycle > DEBUG_RPC_KCM_FREE )
     1937printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1938__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1939#endif
     1940
    18861941    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    18871942
     
    18991954    rpc_send( cxy , &rpc );
    19001955
     1956#if DEBUG_RPC_KCM_FREE
     1957cycle = (uint32_t)hal_get_cycles();
     1958if( cycle > DEBUG_RPC_KCM_FREE )
     1959printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1960__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1961#endif
    19011962}
    19021963
     
    19041965void rpc_kcm_free_server( xptr_t xp )
    19051966{
     1967#if DEBUG_RPC_KCM_FREE
     1968thread_t * this = CURRENT_THREAD;
     1969uint32_t cycle = (uint32_t)hal_get_cycles();
     1970if( cycle > DEBUG_RPC_KCM_FREE )
     1971printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
     1972__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1973#endif
     1974
    19061975    // get client cluster identifier and pointer on RPC descriptor
    19071976    cxy_t        client_cxy  = GET_CXY( xp );
     
    19091978
    19101979    // get input arguments "buf" and "kmem_type" from client RPC descriptor
    1911     void     * buf = (void *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
    1912     uint32_t   kmem_type = (uint32_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
     1980    void     * buf = (void *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     1981    uint32_t   kmem_type = (uint32_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
    19131982
    19141983    // releases memory
     
    19181987    kmem_free( &req );
    19191988
     1989#if DEBUG_RPC_KCM_FREE
     1990cycle = (uint32_t)hal_get_cycles();
     1991if( cycle > DEBUG_RPC_KCM_FREE )
     1992printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
     1993__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
     1994#endif
    19201995}   
    19211996
     
    19752050
    19762051    // get arguments from client RPC descriptor
    1977     mapper      = (mapper_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
    1978     to_buffer   =                       hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
    1979     is_user     =                       hal_remote_lwd( XPTR( client_cxy , &desc->args[2] ) );
    1980     file_offset =                       hal_remote_lwd( XPTR( client_cxy , &desc->args[3] ) );
    1981     size        =                       hal_remote_lwd( XPTR( client_cxy , &desc->args[5] ) );
     2052    mapper      = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     2053    to_buffer   =                       hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
     2054    is_user     =                       hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
     2055    file_offset =                       hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
     2056    size        =                       hal_remote_l64( XPTR( client_cxy , &desc->args[5] ) );
    19822057
    19832058    // call local kernel function
    19842059    if( is_user )
    19852060    {
    1986         user_buffer = (void *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[4] ) );
     2061        user_buffer = (void *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) );
    19872062
    19882063        error = mapper_move_user( mapper,
     
    19942069    else
    19952070    {
    1996         kern_buffer = (xptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[4] ) );
     2071        kern_buffer = (xptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) );
    19972072
    19982073        error = mapper_move_kernel( mapper,
     
    20042079
    20052080    // set output argument to client RPC descriptor
    2006     hal_remote_swd( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error );
     2081    hal_remote_s64( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error );
    20072082
    20082083}
     
    20462121
    20472122    // get input arguments from client RPC descriptor
    2048     mapper_t * mapper = (mapper_t *)(intptr_t)hal_remote_lwd( XPTR( cxy , &desc->args[0] ) );
    2049     uint32_t   index  = (uint32_t)            hal_remote_lwd( XPTR( cxy , &desc->args[1] ) );
     2123    mapper_t * mapper = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) );
     2124    uint32_t   index  = (uint32_t)            hal_remote_l64( XPTR( cxy , &desc->args[1] ) );
    20502125   
    20512126    // call local pmem allocator
     
    20532128
    20542129    // set output arguments into client RPC descriptor
    2055     hal_remote_swd( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
     2130    hal_remote_s64( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
    20562131
    20572132}
     
    21072182
    21082183    // get input arguments from client RPC descriptor
    2109     process_t * process     = (process_t *)(intptr_t)hal_remote_lwd( XPTR(cxy , &desc->args[0]));
    2110     vseg_type_t type        = (vseg_type_t)(uint32_t)hal_remote_lwd( XPTR(cxy , &desc->args[1]));
    2111     intptr_t    base        = (intptr_t)             hal_remote_lwd( XPTR(cxy , &desc->args[2]));
    2112     uint32_t    size        = (uint32_t)             hal_remote_lwd( XPTR(cxy , &desc->args[3]));
    2113     uint32_t    file_offset = (uint32_t)             hal_remote_lwd( XPTR(cxy , &desc->args[4]));
    2114     uint32_t    file_size   = (uint32_t)             hal_remote_lwd( XPTR(cxy , &desc->args[5]));
    2115     xptr_t      mapper_xp   = (xptr_t)               hal_remote_lwd( XPTR(cxy , &desc->args[6]));
    2116     cxy_t       vseg_cxy    = (cxy_t)(uint32_t)      hal_remote_lwd( XPTR(cxy , &desc->args[7]));
     2184    process_t * process     = (process_t *)(intptr_t)hal_remote_l64( XPTR(cxy , &desc->args[0]));
     2185    vseg_type_t type        = (vseg_type_t)(uint32_t)hal_remote_l64( XPTR(cxy , &desc->args[1]));
     2186    intptr_t    base        = (intptr_t)             hal_remote_l64( XPTR(cxy , &desc->args[2]));
     2187    uint32_t    size        = (uint32_t)             hal_remote_l64( XPTR(cxy , &desc->args[3]));
     2188    uint32_t    file_offset = (uint32_t)             hal_remote_l64( XPTR(cxy , &desc->args[4]));
     2189    uint32_t    file_size   = (uint32_t)             hal_remote_l64( XPTR(cxy , &desc->args[5]));
     2190    xptr_t      mapper_xp   = (xptr_t)               hal_remote_l64( XPTR(cxy , &desc->args[6]));
     2191    cxy_t       vseg_cxy    = (cxy_t)(uint32_t)      hal_remote_l64( XPTR(cxy , &desc->args[7]));
    21172192   
    21182193    // call local kernel function
     
    21272202
    21282203    // set output arguments into client RPC descriptor
    2129     hal_remote_swd( XPTR( cxy , &desc->args[8] ) , (uint64_t)(intptr_t)vseg );
     2204    hal_remote_s64( XPTR( cxy , &desc->args[8] ) , (uint64_t)(intptr_t)vseg );
    21302205
    21312206}
     
    21692244
    21702245    // get input arguments from client RPC descriptor
    2171     process = (process_t *)(intptr_t)hal_remote_lwd( XPTR(cxy , &desc->args[0]));
     2246    process = (process_t *)(intptr_t)hal_remote_l64( XPTR(cxy , &desc->args[0]));
    21722247   
    21732248    // call local kernel function
     
    22132288
    22142289    // get input arguments from client RPC descriptor
    2215     process  = (process_t *)(intptr_t)hal_remote_lwd( XPTR(cxy , &desc->args[0]));
    2216     detailed = (bool_t)               hal_remote_lwd( XPTR(cxy , &desc->args[1]));
     2290    process  = (process_t *)(intptr_t)hal_remote_l64( XPTR(cxy , &desc->args[0]));
     2291    detailed = (bool_t)               hal_remote_l64( XPTR(cxy , &desc->args[1]));
    22172292   
    22182293    // call local kernel function
Note: See TracChangeset for help on using the changeset viewer.