Changeset 437 for trunk


Ignore:
Timestamp:
Mar 28, 2018, 2:40:29 PM (7 years ago)
Author:
alain
Message:

Fix various bugs

Location:
trunk
Files:
1 added
50 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.tsar

    r435 r437  
    171171              build/kernel/syscalls/sys_closedir.o        \
    172172              build/kernel/syscalls/sys_getcwd.o          \
     173              build/kernel/syscalls/sys_isatty.o          \
    173174              build/kernel/syscalls/sys_alarm.o           \
    174175              build/kernel/syscalls/sys_rmdir.o
  • trunk/hal/tsar_mips32/core/hal_exception.c

    r435 r437  
    154154
    155155//////////////////////////////////////////////////////////////////////////////////////////
    156 // This function is called when an MMU exception has been detected.
     156// This function is called when an MMU exception has been detected (IBE / DBE).
    157157// It get the relevant exception arguments from the MMU.
    158158// It signal a fatal error in case of illegal access. In case of page unmapped
     
    167167//////////////////////////////////////////////////////////////////////////////////////////
    168168error_t hal_mmu_exception( thread_t * this,
     169                           uint32_t   excPC,
    169170                           bool_t     is_ins )
    170171{
     
    294295        default:                             // this is a kernel error => panic   
    295296        {
    296             assert( false , __FUNCTION__ , "thread %x / excp_code = %x / vaddr = %x\n",
    297             this->trdid , excp_code , bad_vaddr );
     297            assert( false , __FUNCTION__ , "thread %x / epc %x / %s / vaddr = %x\n",
     298            this, excPC, hal_mmu_exception_str(excp_code) , bad_vaddr );
    298299
    299300            return EXCP_KERNEL_PANIC;
     
    379380        error_t      error;
    380381        uint32_t     excCode;                  // 4 bits XCODE from CP0_CR
     382        uint32_t     excPC;                    // fauty instruction address
    381383
    382384    // get pointer on faulty thread uzone
     
    384386    uzone = (uint32_t *)CURRENT_THREAD->uzone_current;
    385387
    386     // get 4 bits XCODE from CP0_CR register
     388    // get XCODE and EPC from UZONE
    387389        excCode        = (uzone[UZ_CR] >> 2) & 0xF;
     390    excPC          = uzone[UZ_EPC];
    388391
    389392#if CONFIG_DEBUG_HAL_EXCEPTIONS
    390393uint32_t cycle = (uint32_t)hal_get_cycles();
    391394if( CONFIG_DEBUG_HAL_EXCEPTIONS < cycle )
    392 printk("\n[DBG] %s : thread %x on core[%x,%d] enter / process %x / xcode %x / cycle %d\n",
    393 __FUNCTION__, this, local_cxy, this->core->lid, this->process->pid, excCode, cycle );
     395printk("\n[DBG] %s : thread %x enter / core[%x,%d] / pid %x / epc %x / xcode %x / cycle %d\n",
     396__FUNCTION__, this, local_cxy, this->core->lid, this->process->pid, excPC, excCode, cycle );
    394397#endif
    395398
     
    398401        case XCODE_DBE:     // can be non fatal
    399402        {
    400                     error = hal_mmu_exception( this , false );  // data MMU exception
     403                    error = hal_mmu_exception( this , excPC , false );  // data MMU exception
    401404            break;
    402405        }
    403406            case XCODE_IBE:     // can be non fatal
    404407        {
    405                     error = hal_mmu_exception( this , true );   // ins MMU exception
     408                    error = hal_mmu_exception( this , excPC , true );   // ins MMU exception
    406409                    break;
    407410        }
     
    450453cycle = (uint32_t)hal_get_cycles();
    451454if( CONFIG_DEBUG_HAL_EXCEPTIONS < cycle )
    452 printk("\n[DBG] %s : thread %x on core[%x,%d] exit / process %x / xcode %x / cycle %d\n",
    453 __FUNCTION__, this, local_cxy, this->core->lid, this->process->pid, excCode, cycle );
     455printk("\n[DBG] %s : thread %x exit / core[%x,%d] / pid %x / epc %x / xcode %x / cycle %d\n",
     456__FUNCTION__, this, local_cxy, this->core->lid, this->process->pid, excPC, excCode, cycle );
    454457#endif
    455458
  • trunk/hal/tsar_mips32/drivers/soclib_bdv.c

    r436 r437  
    22 * soclib_bdv.c - soclib simple block device driver implementation.
    33 *
    4  * Author     Alain Greiner (2016)
     4 * Author     Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    7474    buf_xp   = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->ioc_cmd.buf_xp ) );
    7575    ioc_xp   = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->ioc_cmd.dev_xp ) );
     76
     77#if CONFIG_DEBUG_HAL_IOC_RX
     78uint32_t cycle = (uint32_t)hal_get_cycles();
     79if( (CONFIG_DEBUG_HAL_IOC_RX < cycle) && (cmd_type != IOC_WRITE ) )
     80printk("\n[DBG] %s : thread %x enter for RX / cycle %d\n",
     81__FUNCTION__ , CURRENT_THREAD , cycle );
     82#endif
     83
     84#if CONFIG_DEBUG_HAL_IOC_TX
     85uint32_t cycle = (uint32_t)hal_get_cycles();
     86if( (CONFIG_DEBUG_HAL_IOC_TX < cycle) && (cmd_type == IOC_WRITE) )
     87printk("\n[DBG] %s : thread %x enter for TX / cycle %d\n",
     88__FUNCTION__ , CURRENT_THREAD , cycle );
     89#endif
    7690
    7791    // get IOC device cluster and local pointer
     
    138152    }
    139153   
     154#if CONFIG_DEBUG_HAL_IOC_RX
     155cycle = (uint32_t)hal_get_cycles();
     156if( (CONFIG_DEBUG_HAL_IOC_RX < cycle) && (cmd_type != TXT_WRITE) )
     157printk("\n[DBG] %s : thread %x exit after RX / cycle %d\n",
     158__FUNCTION__ , CURRENT_THREAD , cycle );
     159#endif
     160
     161#if CONFIG_DEBUG_HAL_IOC_TX
     162cycle = (uint32_t)hal_get_cycles();
     163if( (CONFIG_DEBUG_HAL_IOC_TX < cycle) && (cmd_type == TXT_WRITE) )
     164printk("\n[DBG] %s : thread %x exit after TX / cycle %d\n",
     165__FUNCTION__ , CURRENT_THREAD , cycle );
     166#endif
     167
    140168} // end soclib_bdv_cmd()
    141169
     
    144172void __attribute__ ((noinline)) soclib_bdv_isr( chdev_t * chdev )
    145173{
     174    error_t  error = 0;
     175
    146176    // get extended pointer on client thread
    147177    xptr_t root = XPTR( local_cxy , &chdev->wait_root );
     
    155185    thread_t * client_ptr = (thread_t *)GET_PTR( client_xp );
    156186
     187    // get command type
     188    uint32_t   cmd_type = hal_remote_lw( XPTR( client_cxy , &client_ptr->ioc_cmd.type ) );
     189   
    157190    // get SOCLIB_BDV device cluster and local pointer
    158191    cxy_t      bdv_cxy  = GET_CXY( chdev->base );
     
    162195        uint32_t status = hal_remote_lw( XPTR( bdv_cxy , bdv_ptr + BDV_STATUS_REG ) );   
    163196
     197    if( cmd_type == IOC_READ )
     198    {
     199            error = (status != BDV_READ_SUCCESS);
     200
     201#if CONFIG_DEBUG_HAL_IOC_RX
     202uint32_t cycle = (uint32_t)hal_get_cycles();
     203if( CONFIG_DEBUG_HAL_IOC_RX < cycle )
     204printk("\n[DBG] %s : IOC_IRQ / RX transfer / client %x / server %x / cycle %d\n",
     205__FUNCTION__, client_ptr , chdev->server , cycle );
     206#endif
     207
     208    }
     209        else if( cmd_type == IOC_WRITE )
     210    {
     211            error = (status != BDV_WRITE_SUCCESS);
     212
     213#if CONFIG_DEBUG_HAL_IOC_TX
     214uint32_t cycle = (uint32_t)hal_get_cycles();
     215if( CONFIG_DEBUG_HAL_IOC_TX < cycle )
     216printk("\n[DBG] %s : IOC_IRQ / RX transfer / client %x / server %x / cycle %d\n",
     217__FUNCTION__, client_ptr , chdev->server , cycle );
     218#endif
     219
     220    }
     221    else
     222    {
     223        assert( false , __FUNCTION__ , "IOC_SYNC_READ should not use IRQ" );
     224    }
     225
    164226    // set operation status in command
    165         if((status != BDV_READ_SUCCESS) && (status != BDV_WRITE_SUCCESS))
    166     {
    167         hal_remote_sw( XPTR( client_cxy , &client_ptr->ioc_cmd.error ) , 1 );
    168     }
    169         else
    170     {
    171         hal_remote_sw( XPTR( client_cxy , &client_ptr->ioc_cmd.error ) , 0 );
    172     }
     227    hal_remote_sw( XPTR( client_cxy , &client_ptr->ioc_cmd.error ) , error );
    173228
    174229    // unblock server thread
    175230    thread_unblock( server_xp , THREAD_BLOCKED_ISR );
    176231
    177     // unblock client thread
    178     thread_unblock( client_xp , THREAD_BLOCKED_IO );
    179 
    180232} // end soclib_bdv_isr()
    181233
  • trunk/hal/tsar_mips32/drivers/soclib_bdv.h

    r75 r437  
    22 * soclib_bdv.h - SOCLIB_BDV (simple block device) driver definition.
    33 *
    4  * Author    Alain Greiner
     4 * Author    Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
  • trunk/hal/tsar_mips32/drivers/soclib_hba.c

    r436 r437  
    22 * soclib_hba.c - soclib AHCI block device driver implementation.
    33 *
    4  * Author     Alain Greiner (2016)
     4 * Author     Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    290290            // unblock client thread
    291291            thread_unblock( client_xp , THREAD_BLOCKED_IO );
    292  
    293             ioc_dmsg("INFO in %s : thread %x at cycle %d\n",
    294             __FUNCTION__ , hal_remote_lw( XPTR( client_cxy , &client_ptr->trdid ) ) ,
    295             hal_get_cycles() );
    296292        }
    297293    }
  • trunk/hal/tsar_mips32/drivers/soclib_hba.h

    r75 r437  
    22 * soclib_hba.h - soclib AHCI block device driver definition.
    33 *
    4  * Author        Alain Greiner (2016)
     4 * Author        Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/devices/dev_dma.c

    r408 r437  
    22 * dev_dma.c - DMA (Interrupt Controler Unit) generic device API implementation.
    33 *
    4  * Authors   Alain Greiner  (2017)
     4 * Authors   Alain Greiner  (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    9090    thread_t * this = CURRENT_THREAD;
    9191
    92     dma_dmsg("\n[DBG] %s : enters for thread %x / dst = %l /src = %l / size = %x\n",
    93               __FUNCTION__ , this->trdid , dst_xp , src_xp , size );
     92#if CONGIG_DEBUG_DEV_DMA
     93uint32_t cycle = (uint32_t)hal_get_cycles();
     94if( CONGIG_DEBUG_DEV_DMA < cycle )
     95printk("\n[DBG] %s : thread %x enters / dst %l / src %l / size = %x\n",
     96__FUNCTION__ , this, dst_xp, src_xp, size );
     97#endif
    9498
    9599    // select DMA channel corresponding to core lid
     
    112116    chdev_register_command( dev_xp );
    113117
    114     dma_dmsg("\n[DBG] %s : completes for thread %x / error = %d\n",
    115              __FUNCTION__ ,  this->trdid , this->dma_cmd.error );
     118#if CONGIG_DEBUG_DEV_DMA
     119cycle = (uint32_t)hal_get_cycles();
     120if( CONGIG_DEBUG_DEV_DMA < cycle )
     121printk("\n[DBG] %s : thread %x exit / dst %l / src %l / size = %x\n",
     122__FUNCTION__ , this, dst_xp, src_xp, size );
     123#endif
    116124
    117125    // return I/O operation status from calling thread descriptor
  • trunk/kernel/devices/dev_dma.h

    r14 r437  
    22 * dev_dma.h - DMA (Direct Memory Access) generic device API definition.
    33 *
    4  * Authors   Alain Greiner  (2017)
     4 * Authors   Alain Greiner  (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/devices/dev_fbf.c

    r422 r437  
    22 * dev_fbf.c - FBF (Block Device Controler) generic device API implementation.
    33 *
    4  * Author  Alain Greiner    (2016)
     4 * Author  Alain Greiner    (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    137137    error = vmm_v2p_translate( CONFIG_KERNEL_IDENTITY_MAP , buffer , &buf_paddr );
    138138 
    139     if( error )
    140     {
    141         printk("\n[ERROR] in %s : cannot translate vaddr = %p in process %x\n",
    142                __FUNCTION__ , buffer , this->process->pid );
    143         return EINVAL;
    144     }
    145 
    146     fbf_dmsg("\n[DBG] %s : thread %x in process %x / vaddr = %p / paddr = %l\n",
    147              __FUNCTION__ , this->trdid , this->process->pid , buffer , buf_paddr );
     139    // check buffer is mapped
     140    assert( (error == 0) , __FUNCTION__ ,
     141    "cannot translate vaddr = %p in process %x\n", buffer, this->process->pid );
    148142
    149143    // get extended pointer on FBF chdev descriptor
     
    162156
    163157    // check offset and length versus FBF size
    164     if( (offset + length) > (width * height) )
    165     {
    166         printk("\n[ERROR] in %s : offset = %d / length = %d / width = %d / height = %d\n",
    167                __FUNCTION__ , offset , length , width , height );
    168         return EINVAL;
    169     }
     158    assert( ((offset + length) <= (width * height)) , __FUNCTION__ ,
     159    "offset %d / length %d / width %d / height %d\n", offset, length, width, height );
    170160
    171161    // compute extended pointers on frame buffer and memory buffer
     
    186176                      uint32_t       offset )
    187177{
     178
     179#if CONFIG_DEBUG_DEV_FBF_RX
     180uint32_t cycle = (uint32_t)hal_get_cycle();
     181if( CONFIG_DEBUG_DEV_FBF_RX < cycle )
     182printk("\n[DBG] %s : thread %x enter / process %x / vaddr %x / size %x\n",
     183__FUNCTION__ , this, this->process->pid , buffer , buf_paddr );
     184#endif
     185
    188186    return dev_fbf_access( false , buffer , length , offset );
     187
     188#if CONFIG_DEBUG_DEV_FBF_RX
     189cycle = (uint32_t)hal_get_cycle();
     190if( CONFIG_DEBUG_DEV_FBF_RX < cycle )
     191printk("\n[DBG] %s : thread %x exit / process %x / vaddr %x / size %x\n",
     192__FUNCTION__ , this, this->process->pid , buffer , buf_paddr );
     193#endif
     194
    189195
    190196
     
    194200                       uint32_t       offset )
    195201{
     202
     203#if CONFIG_DEBUG_DEV_FBF_TX
     204uint32_t cycle = (uint32_t)hal_get_cycle();
     205if( CONFIG_DEBUG_DEV_FBF_TX < cycle )
     206printk("\n[DBG] %s : thread %x enter / process %x / vaddr %x / size %x\n",
     207__FUNCTION__ , this, this->process->pid , buffer , buf_paddr );
     208#endif
     209
    196210    return dev_fbf_access( true , buffer , length , offset );
     211
     212#if CONFIG_DEBUG_DEV_FBF_RX
     213cycle = (uint32_t)hal_get_cycle();
     214if( CONFIG_DEBUG_DEV_FBF_RX < cycle )
     215printk("\n[DBG] %s : thread %x exit / process %x / vaddr %x / size %x\n",
     216__FUNCTION__ , this, this->process->pid , buffer , buf_paddr );
     217#endif
     218
    197219}
  • trunk/kernel/devices/dev_ioc.c

    r408 r437  
    22 * dev_ioc.c - IOC (Block Device Controler) generic device API implementation.
    33 *
    4  * Author  Alain Greiner    (2016)
     4 * Author  Alain Greiner    (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    101101    thread_t * this = CURRENT_THREAD;              // pointer on client thread
    102102
    103     ioc_dmsg("\n[DBG] %s : thread %x in process %x"
    104              " for lba = %x / buffer = %x / at cycle %d\n",
    105              __FUNCTION__ , this->trdid , this->process->pid ,
    106              lba , (intptr_t)buffer , hal_get_cycles() );
    107 
    108103    // software L2/L3 cache coherence for memory buffer
    109104    if( chdev_dir.iob )
     
    130125    chdev_register_command( dev_xp );
    131126
    132     ioc_dmsg("\n[DBG] in %s : thread %x in process %x"
    133              " completes / error = %d / at cycle %d\n",
    134              __FUNCTION__ , this->trdid , this->process->pid ,
    135              this->ioc_cmd.error , hal_get_cycles() );
    136 
    137127    // return I/O operation status
    138128    return this->ioc_cmd.error;
     
    145135                      uint32_t       count )
    146136{
     137
     138#if CONFIG_DEBUG_DEV_IOC_RX
     139uint32_t cycle = (uint32_t)hal_get_cycles();
     140if( CONFIG_DEBUG_DEV_IOC_RX < cycle )
     141printk("\n[DBG] %s : thread %x enters / lba  %x / buffer %x / cycle %d\n",
     142__FUNCTION__ , this, lba, buffer, cycle );
     143#endif
     144
    147145    return dev_ioc_access( IOC_READ , buffer , lba , count );
     146
     147#if CONFIG_DEBUG_DEV_IOC_RX
     148cycle = (uint32_t)hal_get_cycles();
     149if( CONFIG_DEBUG_DEV_IOC_RX < cycle )
     150printk("\n[DBG] %s : thread %x exit / lba  %x / buffer %x / cycle %d\n",
     151__FUNCTION__ , this, lba, buffer, cycle );
     152#endif
     153
    148154}
    149155
     
    153159                       uint32_t      count )
    154160{
     161
     162#if CONFIG_DEBUG_DEV_IOC_TX
     163uint32_t cycle = (uint32_t)hal_get_cycles();
     164if( CONFIG_DEBUG_DEV_IOC_TX < cycle )
     165printk("\n[DBG] %s : thread %x enters / lba  %x / buffer %x / cycle %d\n",
     166__FUNCTION__ , this, lba, buffer, cycle );
     167#endif
     168
    155169    return dev_ioc_access( IOC_WRITE , buffer , lba , count );
     170
     171#if CONFIG_DEBUG_DEV_IOC_TX
     172cycle = (uint32_t)hal_get_cycles();
     173if( CONFIG_DEBUG_DEV_IOC_TX < cycle )
     174printk("\n[DBG] %s : thread %x exit / lba  %x / buffer %x / cycle %d\n",
     175__FUNCTION__ , this, lba, buffer, cycle );
     176#endif
     177
    156178}
    157179
     
    164186    thread_t * this = CURRENT_THREAD;
    165187
    166     ioc_dmsg("\n[DBG] %s : core[%x,%d] enter for %d blocks / lba = %x / cycle %d\n",
    167     __FUNCTION__ , local_cxy , this->core->lid , count , lba , hal_time_stamp() );
     188#if CONFIG_DEBUG_DEV_IOC_RX
     189uint32_t cycle = (uint32_t)hal_get_cycles();
     190if( CONFIG_DEBUG_DEV_IOC_RX < cycle )
     191printk("\n[DBG] %s : thread %x enters / lba  %x / buffer %x / cycle %d\n",
     192__FUNCTION__ , this, lba, buffer, cycle );
     193#endif
    168194
    169195    // software L2/L3 cache coherence for memory buffer
     
    201227    dev_pic_enable_irq( lid , ioc_xp );
    202228
    203     ioc_dmsg("\n[DBG] %s : core[%x,%d] exit / error = %d / cycle %d\n",
    204     __FUNCTION__ , local_cxy , this->core->lid , this->ioc_cmd.error , hal_time_stamp() );
     229#if CONFIG_DEBUG_DEV_IOC_RX
     230cycle = (uint32_t)hal_get_cycles();
     231if( CONFIG_DEBUG_DEV_IOC_RX < cycle )
     232printk("\n[DBG] %s : thread %x exit / lba  %x / buffer %x / cycle %d\n",
     233__FUNCTION__ , this, lba, buffer, cycle );
     234#endif
    205235
    206236    // return I/O operation status from calling thread descriptor
  • trunk/kernel/devices/dev_ioc.h

    r246 r437  
    22 * dev_ioc.h - IOC (Block Device Controler) generic device API definition.
    33 *
    4  * Author  Alain Greiner    (2016)
     4 * Author  Alain Greiner    (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/devices/dev_mmc.c

    r407 r437  
    22 * dev_mmc.c - MMC (Memory Cache Controler) generic device API implementation.
    33 *
    4  * Author  Alain Greiner    (2016)
     4 * Author  Alain Greiner    (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    9999    thread_t * this = CURRENT_THREAD;
    100100
    101     mmc_dmsg("\n[DBG] %s enters for thread %x in process %x / buf_xp = %l\n",
    102                  __FUNCTION__ , this->trdid , this->process->pid , buf_xp );
     101#if CONFIG_DEBUG_DEV_MMC
     102uint32_t cycle = (uint32_t)hal_get_cycles();
     103if( CONFIG_DEBUG_DEV_MMC < cycle )
     104printk("\n[DBG] %s : thread %x enters / process %x / buf_xp = %l\n",
     105__FUNCTION__, this, this->process->pid , buf_xp );
     106#endif
    103107
    104108    // get buffer cluster and local pointer
     
    124128    error = dev_mmc_access( this );
    125129
    126     mmc_dmsg("\n[DBG] %s completes for thread %x in process %x / error = %d\n",
    127              __FUNCTION__ , this->trdid , this->process->pid , error );
     130#if CONFIG_DEBUG_DEV_MMC
     131cycle = (uint32_t)hal_get_cycles();
     132if( CONFIG_DEBUG_DEV_MMC < cycle )
     133printk("\n[DBG] %s : thread %x exit / process %x / buf_xp = %l\n",
     134__FUNCTION__, this, this->process->pid , buf_xp );
     135#endif
    128136
    129137    return error;
     
    139147    thread_t * this = CURRENT_THREAD;
    140148
    141     mmc_dmsg("\n[DBG] %s enters for thread %x in process %x / buf_xp = %l\n",
    142                  __FUNCTION__ , this->trdid , this->process->pid , buf_xp );
     149#if CONFIG_DEBUG_DEV_MMC
     150uint32_t cycle = (uint32_t)hal_get_cycles();
     151if( CONFIG_DEBUG_DEV_MMC < cycle )
     152printk("\n[DBG] %s : thread %x enters / process %x / buf_xp = %l\n",
     153__FUNCTION__, this, this->process->pid , buf_xp );
     154#endif
    143155
    144156    // get buffer cluster and local pointer
     
    164176    error = dev_mmc_access( this );
    165177
    166     mmc_dmsg("\n[DBG] %s completes for thread %x in process %x / error = %d\n",
    167                  __FUNCTION__ , this->trdid , this->process->pid , error );
     178#if CONFIG_DEBUG_DEV_MMC
     179cycle = (uint32_t)hal_get_cycles();
     180if( CONFIG_DEBUG_DEV_MMC < cycle )
     181printk("\n[DBG] %s : thread %x exit / process %x / buf_xp = %l\n",
     182__FUNCTION__, this, this->process->pid , buf_xp );
     183#endif
    168184
    169185    return error;
  • trunk/kernel/devices/dev_mmc.h

    r23 r437  
    22 * dev_mmc.h - MMC (Generic L2 cache controller) device API definition.
    33 *
    4  * Authors   Alain Greiner  (2016)
     4 * Authors   Alain Greiner  (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/devices/dev_nic.c

    r436 r437  
    22 * dev_nic.c - NIC (Network Controler) generic device API implementation.
    33 *
    4  * Author  Alain Greiner    (2016,2017)
     4 * Author  Alain Greiner    (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    9999    core_t * core = thread_ptr->core;
    100100
    101     nic_dmsg("\n[DBG] %s enters for NIC-RX thread on core %d in cluster %x\n",
    102                  __FUNCTION__ , core->lid , local_cxy );
     101#if CONFIG_DEBUG_DEV_NIC_RX
     102uint32_t cycle = (uint32_t)hal_get_cycles();
     103if( CONFIG_DEBUG_DEV_NIC_RX < cycle )
     104printk("\n[DBG] %s : thread %x enters for packet %x in cluster %x\n",
     105__FUNCTION__ , thread_ptr , pkd , local_cxy );
     106#endif
    103107
    104108    // get pointer on NIC-RX chdev descriptor
     
    149153    pkd->length = thread_ptr->nic_cmd.length;
    150154
    151     nic_dmsg("\n[DBG] %s exit for NIC-RX thread on core %d in cluster %x\n",
    152              __FUNCTION__ , core->lid , local_cxy );
     155#if CONFIG_DEBUG_DEV_NIC_RX
     156cycle = (uint32_t)hal_get_cycles();
     157if( CONFIG_DEBUG_DEV_NIC_RX < cycle )
     158printk("\n[DBG] %s : thread %x exit for packet %x in cluster %x\n",
     159__FUNCTION__ , thread_ptr , pkd , local_cxy );
     160#endif
    153161
    154162    return 0;
     
    169177    core_t * core = thread_ptr->core;
    170178
    171     nic_dmsg("\n[DBG] %s enters for NIC-RX thread on core %d in cluster %x\n",
    172                  __FUNCTION__ , core->lid , local_cxy );
     179#if CONFIG_DEBUG_DEV_NIC_RX
     180uint32_t cycle = (uint32_t)hal_get_cycles();
     181if( CONFIG_DEBUG_DEV_NIC_RX < cycle )
     182printk("\n[DBG] %s : thread %x enters for packet %x in cluster %x\n",
     183__FUNCTION__ , thread_ptr , pkd , local_cxy );
     184#endif
    173185
    174186    // get pointer on NIC-TX chdev descriptor
     
    217229    if( error ) return error;
    218230
    219     nic_dmsg("\n[DBG] %s exit for NIC-TX thread on core %d in cluster %x\n",
    220              __FUNCTION__ , core->lid , local_cxy );
     231#if CONFIG_DEBUG_DEV_NIC_RX
     232cycle = (uint32_t)hal_get_cycles();
     233if( CONFIG_DEBUG_DEV_NIC_RX < cycle )
     234printk("\n[DBG] %s : thread %x exit for packet %x in cluster %x\n",
     235__FUNCTION__ , thread_ptr , pkd , local_cxy );
     236#endif
    221237
    222238    return 0;
  • trunk/kernel/devices/dev_nic.h

    r407 r437  
    22 * dev_nic.h - NIC (Network Controler) generic device API definition.
    33 *
    4  * Author  Alain Greiner    (2016)
     4 * Author  Alain Greiner    (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/devices/dev_pic.c

    r422 r437  
    22 * dev_pic.c - PIC (External Interrupt Controler) generic device API implementation.
    33 *
    4  * Authors   Alain Greiner  (2016)
     4 * Authors   Alain Greiner  (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    8686{
    8787
    88 irq_dmsg("\n[DBG] %s : core = [%x,%d] / src_chdev_cxy = %x / src_chdev_ptr = %x\n",
    89 __FUNCTION__ , local_cxy , lid , GET_CXY(src_chdev_xp) , GET_PTR(src_chdev_xp) );
     88#if CONFIG_DEBUG_DEV_PIC
     89uint32_t cycle = (uint32_t)hal_get_cycles();
     90if( CONFIG_DEBUG_DEV_PIC < cycle )
     91printk("\n[DBG] %s : core[%x,%d] / src_chdev_cxy %x / src_chdev_ptr %x / cycle %d\n",
     92__FUNCTION__, local_cxy, lid, GET_CXY(src_chdev_xp), GET_PTR(src_chdev_xp), cycle );
     93#endif
    9094
    9195    // get pointer on PIC chdev
     
    105109{
    106110
    107 irq_dmsg("\n[DBG] %s : core = [%x,%d] / src_chdev_cxy = %x / src_chdev_ptr = %x\n",
    108 __FUNCTION__ , local_cxy , lid , GET_CXY(src_chdev_xp) , GET_PTR(src_chdev_xp) );
     111#if CONFIG_DEBUG_DEV_PIC
     112uint32_t cycle = (uint32_t)hal_get_cycles();
     113if( CONFIG_DEBUG_DEV_PIC < cycle )
     114printk("\n[DBG] %s : core[%x,%d] / src_chdev_cxy %x / src_chdev_ptr %x / cycle %d\n",
     115__FUNCTION__, local_cxy, lid, GET_CXY(src_chdev_xp), GET_PTR(src_chdev_xp), cycle );
     116#endif
    109117
    110118    // get pointer on PIC chdev
     
    123131{
    124132
    125 irq_dmsg("\n[DBG] %s : core = [%x,%d] / period = %d\n",
    126 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , period );
     133#if CONFIG_DEBUG_DEV_PIC
     134uint32_t cycle = (uint32_t)hal_get_cycles();
     135if( CONFIG_DEBUG_DEV_PIC < cycle )
     136printk("\n[DBG] %s : core[%x,%d] / period %d / cycle %d\n",
     137__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , period, cycle );
     138#endif
    127139
    128140    // get pointer on PIC chdev
     
    141153{
    142154
    143 irq_dmsg("\n[DBG] %s : core = [%x,%d] / cycle %d\n",
    144 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , hal_time_stamp() );
     155#if CONFIG_DEBUG_DEV_PIC
     156uint32_t cycle = (uint32_t)hal_get_cycles();
     157if( CONFIG_DEBUG_DEV_PIC < cycle )
     158printk("\n[DBG] %s : core[%x,%d] / cycle %d\n",
     159__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , cycle );
     160#endif
    145161
    146162    // get pointer on PIC chdev
     
    160176{
    161177
    162 irq_dmsg("\n[DBG] %s : src_core = [%x,%d] / dst_core = [%x,%d] / cycle %d\n",
    163 __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, cxy, lid, hal_time_stamp() );
     178#if CONFIG_DEBUG_DEV_PIC
     179uint32_t cycle = (uint32_t)hal_get_cycles();
     180if( CONFIG_DEBUG_DEV_PIC < cycle )
     181printk("\n[DBG] %s : src_core[%x,%d] / dst_core[%x,%d] / cycle %d\n",
     182__FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, cxy, lid, cycle );
     183#endif
    164184
    165185    // get pointer on PIC chdev
     
    178198{
    179199
    180 irq_dmsg("\n[DBG] %s : core = [%x,%d] / cycle %d\n",
    181 __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, hal_time_stamp() );
     200#if CONFIG_DEBUG_DEV_PIC
     201uint32_t cycle = (uint32_t)hal_get_cycles();
     202if( CONFIG_DEBUG_DEV_PIC < cycle )
     203printk("\n[DBG] %s : core[%x,%d] / cycle %d\n",
     204__FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, cycle );
     205#endif
    182206
    183207    // get pointer on PIC chdev
  • trunk/kernel/devices/dev_pic.h

    r407 r437  
    22 * dev_pic.h - PIC (Programmable Interrupt Controler) generic device API definition.
    33 *
    4  * Authors   Alain Greiner  (2016)
     4 * Authors   Alain Greiner  (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/fs/devfs.c

    r435 r437  
    8585}
    8686
    87 ///////////////////////////////////////////////////
     87/////////////////////////////////////////////////
    8888void devfs_global_init( xptr_t   parent_inode_xp,
    8989                        xptr_t * devfs_dev_inode_xp,
     
    109109
    110110    assert( (error == 0) , __FUNCTION__ , "cannot create <dev>\n" );
     111
     112#if( CONFIG_DEBUG_DEVFS_INIT & 1 )
     113if( CONFIG_DEBUG_DEVFS_INIT < cycle )
     114printk("\n[DBG] %s : created <dev> inode at cycle %d\n", __FUNCTION__, cycle );
     115#endif
    111116
    112117    // create DEVFS "external" inode in cluster IO
  • trunk/kernel/fs/vfs.c

    r436 r437  
    33 *
    44 * Author  Mohamed Lamine Karaoui (2015)
    5  *         Alain Greiner (2016,2017)
     5 *         Alain Greiner (2016,2017,2018)
    66 *
    77 * Copyright (c) UPMC Sorbonne Universites
     
    455455    if( length >= CONFIG_VFS_MAX_NAME_LENGTH )
    456456    {
    457         printk("\n[ERROR] in %s : name too long\n", __FUNCTION__ );
     457
     458#if CONFIG_DEBUG_SYSCALLS_ERROR
     459printk("\n[ERROR] in %s : name <name> too long\n", __FUNCTION__ , name );
     460#endif
    458461        return EINVAL;
    459462    }
     
    467470    if( dentry == NULL )
    468471    {
    469         printk("\n[ERROR] in %s : cannot allocate dentry descriptor\n", __FUNCTION__ );
     472
     473#if CONFIG_DEBUG_SYSCALLS_ERROR
     474printk("\n[ERROR] in %s : cannot allocate dentry\n", __FUNCTION__ );
     475#endif
    470476        return ENOMEM;
    471477    }
     
    478484    strcpy( dentry->name , name );
    479485
     486#if( CONFIG_DEBUG_VFS_DENTRY_CREATE & 1 )
     487cycle = (uint32_t)hal_get_cycles();
     488if( CONFIG_DEBUG_VFS_DENTRY_CREATE < cycle )
     489printk("\n[DBG] %s : dentry initialised\n", __FUNCTION__ );
     490#endif
     491
    480492    // register dentry in hash table rooted in parent inode
    481493    xhtab_insert( XPTR( local_cxy , &parent->children ),
    482494                  name,
    483495                  XPTR( local_cxy , &dentry->list ) );
     496
     497#if( CONFIG_DEBUG_VFS_DENTRY_CREATE & 1 )
     498cycle = (uint32_t)hal_get_cycles();
     499if( CONFIG_DEBUG_VFS_DENTRY_CREATE < cycle )
     500printk("\n[DBG] %s : dentry registerd in htab\n", __FUNCTION__ );
     501#endif
    484502
    485503    // return extended pointer on dentry
     
    16371655
    16381656#if (CONFIG_DEBUG_VFS_ADD_CHILD & 1)
    1639 if( CONFIG_DEBUG_VFS_ADD_CHILD < cycle )
     1657if( (CONFIG_DEBUG_VFS_ADD_CHILD < cycle) && (error == 0) )
    16401658printk("\n[DBG] %s : dentry <%s> created in cluster %x\n", __FUNCTION__, name, local_cxy );
    16411659#endif
     
    16521670
    16531671#if (CONFIG_DEBUG_VFS_ADD_CHILD & 1)
    1654 if( CONFIG_DEBUG_VFS_ADD_CHILD < cycle )
     1672if( (CONFIG_DEBUG_VFS_ADD_CHILD < cycle) && (error == 0) )
    16551673printk("\n[DBG] %s : dentry <%s> created in cluster %x\n", __FUNCTION__, name, parent_cxy );
    16561674#endif
     
    16601678    if( error )
    16611679    {
    1662         printk("\n[ERROR] in %s : cannot create dentry in cluster %x\n",
    1663         __FUNCTION__ , parent_cxy );
     1680        printk("\n[ERROR] in %s : cannot create dentry <%s> in cluster %x\n",
     1681        __FUNCTION__ , name , parent_cxy );
    16641682        return ENOMEM;
    16651683    }
     
    16881706__FUNCTION__ , GET_PTR(inode_xp) , local_cxy );
    16891707#endif
    1690 
    1691 vfs_dmsg("\n[DBG] %s : inode %x created in local cluster %x\n",
    1692 __FUNCTION__ , GET_PTR(inode_xp) , local_cxy );
    16931708
    16941709    }
  • trunk/kernel/fs/vfs.h

    r430 r437  
    33 *
    44 * Author  Mohamed Lamine Karaoui (2014,2015)
    5  *         Alain Greiner (2016,2017)
     5 *         Alain Greiner (2016,2017,2018)
    66 *
    77 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/kern/chdev.c

    r436 r437  
    140140    thread_t * this = CURRENT_THREAD;
    141141
    142 #if CONFIG_DEBUG_CHDEV_REGISTER_COMMAND
    143 uint32_t cycle = (uint32_t)hal_get_cycles();
    144 if( CONFIG_DEBUG_CHDEV_REGISTER_COMMAND < cycle )
    145 printk("\n[DBG] %s : client_thread %x (%s) enter / cycle %d\n",
    146 __FUNCTION__, this, thread_type_str(this->type) , cycle );
    147 #endif
    148 
    149142    // get device descriptor cluster and local pointer
    150143    cxy_t     chdev_cxy = GET_CXY( chdev_xp );
    151144    chdev_t * chdev_ptr = (chdev_t *)GET_PTR( chdev_xp );
     145
     146#if (CONFIG_DEBUG_CHDEV_CMD_RX || CONFIG_DEBUG_CHDEV_CMD_TX)
     147bool_t is_rx = hal_remote_lw( XPTR( chdev_cxy , &chdev_ptr->is_rx ) );
     148#endif
     149   
     150#if CONFIG_DEBUG_CHDEV_CMD_RX
     151uint32_t rx_cycle = (uint32_t)hal_get_cycles();
     152if( (is_rx) && (CONFIG_DEBUG_CHDEV_CMD_RX < rx_cycle) )
     153printk("\n[DBG] %s : client_thread %x (%s) enter for RX / cycle %d\n",
     154__FUNCTION__, this, thread_type_str(this->type) , rx_cycle );
     155#endif
     156
     157#if CONFIG_DEBUG_CHDEV_CMD_TX
     158uint32_t tx_cycle = (uint32_t)hal_get_cycles();
     159if( (is_rx == 0) && (CONFIG_DEBUG_CHDEV_CMD_TX < tx_cycle) )
     160printk("\n[DBG] %s : client_thread %x (%s) enter for TX / cycle %d\n",
     161__FUNCTION__, this, thread_type_str(this->type) , tx_cycle );
     162#endif
    152163
    153164    // build extended pointers on client thread xlist and device root
     
    196207    hal_restore_irq( save_sr );
    197208
    198 #if CONFIG_DEBUG_CHDEV_REGISTER_COMMAND
    199 cycle = (uint32_t)hal_get_cycles();
    200 if( CONFIG_DEBUG_CHDEV_REGISTER_COMMAND < cycle )
    201 printk("\n[DBG] %s : client_thread %x (%s) exit / cycle %d\n",
    202 __FUNCTION__, this, thread_type_str(this->type) , cycle );
     209#if CONFIG_DEBUG_CHDEV_CMD_RX
     210rx_cycle = (uint32_t)hal_get_cycles();
     211if( (is_rx) && (CONFIG_DEBUG_CHDEV_CMD_RX < rx_cycle) )
     212printk("\n[DBG] %s : client_thread %x (%s) exit for RX / cycle %d\n",
     213__FUNCTION__, this, thread_type_str(this->type) , rx_cycle );
     214#endif
     215
     216#if CONFIG_DEBUG_CHDEV_CMD_TX
     217tx_cycle = (uint32_t)hal_get_cycles();
     218if( (is_rx == 0) && (CONFIG_DEBUG_CHDEV_CMD_TX < tx_cycle) )
     219printk("\n[DBG] %s : client_thread %x (%s) exit for TX / cycle %d\n",
     220__FUNCTION__, this, thread_type_str(this->type) , tx_cycle );
    203221#endif
    204222
     
    225243    server = CURRENT_THREAD;
    226244
    227 #if CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER
    228 uint32_t cycle = (uint32_t)hal_get_cycles();
    229 if( CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER < cycle )
    230 printk("\n[DBG] %s : server_thread %x enter / chdev = %x / cycle %d\n",
    231 __FUNCTION__ , server , chdev , cycle );
    232 #endif
    233 
     245    // get root and lock on command queue
    234246    root_xp = XPTR( local_cxy , &chdev->wait_root );
    235247    lock_xp = XPTR( local_cxy , &chdev->wait_lock );
     
    253265        else                            // waiting queue not empty
    254266        {
    255 
    256 #if (CONFIG_DEBUG_SYS_READ & 1)
    257 enter_chdev_server_read = (uint32_t)hal_get_cycles();
    258 #endif
    259 
    260 #if (CONFIG_DEBUG_SYS_WRITE & 1)
    261 enter_chdev_server_write = (uint32_t)hal_get_cycles();
    262 #endif
    263 
    264267            // release lock
    265268            remote_spinlock_unlock( lock_xp );
     
    271274            client_cxy = GET_CXY( client_xp );
    272275            client_ptr = (thread_t *)GET_PTR( client_xp );
     276
     277#if CONFIG_DEBUG_CHDEV_SERVER_RX
     278uint32_t rx_cycle = (uint32_t)hal_get_cycles();
     279if( (chdev->is_rx) && (CONFIG_DEBUG_CHDEV_SERVER_RX < rx_cycle) )
     280printk("\n[DBG] %s : server_thread %x start RX / client %x / cycle %d\n",
     281__FUNCTION__ , server , client_ptr , rx_cycle );
     282#endif
     283
     284#if CONFIG_DEBUG_CHDEV_SERVER_TX
     285uint32_t tx_cycle = (uint32_t)hal_get_cycles();
     286if( (chdev->is_rx == 0) && (CONFIG_DEBUG_CHDEV_SERVER_TX < tx_cycle) )
     287printk("\n[DBG] %s : server_thread %x start TX / client %x / cycle %d\n",
     288__FUNCTION__ , server , client_ptr , tx_cycle );
     289#endif
     290
     291#if (CONFIG_DEBUG_SYS_READ & 1)
     292enter_chdev_server_read = (uint32_t)hal_get_cycles();
     293#endif
     294
     295#if (CONFIG_DEBUG_SYS_WRITE & 1)
     296enter_chdev_server_write = (uint32_t)hal_get_cycles();
     297#endif
    273298
    274299            // call driver command function to execute I/O operation
     
    283308            thread_unblock( client_xp , THREAD_BLOCKED_IO );
    284309
    285 #if CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER
    286 cycle = (uint32_t)hal_get_cycles();
    287 if( CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER < cycle )
    288 printk("\n[DBG] %s : server_thread %x complete operation for client %x / cycle %d\n",
    289 __FUNCTION__ , server , client_ptr , cycle );
     310#if CONFIG_DEBUG_CHDEV_SERVER_RX
     311rx_cycle = (uint32_t)hal_get_cycles();
     312if( (chdev->is_rx) && (CONFIG_DEBUG_CHDEV_SERVER_RX < rx_cycle) )
     313printk("\n[DBG] %s : server_thread %x completes RX / client %x / cycle %d\n",
     314__FUNCTION__ , server , client_ptr , rx_cycle );
     315#endif
     316
     317#if CONFIG_DEBUG_CHDEV_SERVER_TX
     318tx_cycle = (uint32_t)hal_get_cycles();
     319if( (chdev->is_rx == 0) && (CONFIG_DEBUG_CHDEV_SERVER_TX < tx_cycle) )
     320printk("\n[DBG] %s : server_thread %x completes TX / client %x / cycle %d\n",
     321__FUNCTION__ , server , client_ptr , tx_cycle );
    290322#endif
    291323
  • trunk/kernel/kern/cluster.c

    r436 r437  
    44 * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
    55 *         Mohamed Lamine Karaoui (2015)
    6  *         Alain Greiner (2016,2017)
     6 *         Alain Greiner (2016,2017,2018)
    77 *
    88 * Copyright (c) UPMC Sorbonne Universites
     
    9292uint32_t cycle = (uint32_t)hal_get_cycles();
    9393if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
    94 printk("\n[DBG] %s enters for cluster %x / cycle %d\n",
    95 __FUNCTION__ , local_cxy , cycle );
     94printk("\n[DBG] %s : thread %x enters for cluster %x / cycle %d\n",
     95__FUNCTION__ , CURRENT_THREAD , local_cxy , cycle );
    9696#endif
    9797
     
    113113    }
    114114
    115 #if CONFIG_DEBUG_CLUSTER_INIT
     115#if( CONFIG_DEBUG_CLUSTER_INIT & 1 )
    116116cycle = (uint32_t)hal_get_cycles();
    117117if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
    118 cluster_dmsg("\n[DBG] %s : PPM initialized in cluster %x / cycle %d\n",
     118printk("\n[DBG] %s : PPM initialized in cluster %x / cycle %d\n",
    119119__FUNCTION__ , local_cxy , cycle );
    120120#endif
     
    123123        khm_init( &cluster->khm );
    124124
    125     cluster_dmsg("\n[DBG] %s : KHM initialized in cluster %x at cycle %d\n",
    126                  __FUNCTION__ , local_cxy , hal_get_cycles() );
     125#if( CONFIG_DEBUG_CLUSTER_INIT & 1 )
     126uint32_t cycle = (uint32_t)hal_get_cycles();
     127if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
     128printk("\n[DBG] %s : KHM initialized in cluster %x at cycle %d\n",
     129__FUNCTION__ , local_cxy , hal_get_cycles() );
     130#endif
    127131
    128132    // initialises embedded KCM
    129133        kcm_init( &cluster->kcm , KMEM_KCM );
    130134
    131     cluster_dmsg("\n[DBG] %s : KCM initialized in cluster %x at cycle %d\n",
    132                  __FUNCTION__ , local_cxy , hal_get_cycles() );
     135#if( CONFIG_DEBUG_CLUSTER_INIT & 1 )
     136uint32_t cycle = (uint32_t)hal_get_cycles();
     137if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
     138printk("\n[DBG] %s : KCM initialized in cluster %x at cycle %d\n",
     139__FUNCTION__ , local_cxy , hal_get_cycles() );
     140#endif
    133141
    134142    // initialises all cores descriptors
     
    140148        }
    141149
    142 #if CONFIG_DEBUG_CLUSTER_INIT
     150#if( CONFIG_DEBUG_CLUSTER_INIT & 1 )
    143151cycle = (uint32_t)hal_get_cycles();
    144152if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
    145 cluster_dmsg("\n[DBG] %s : cores initialized in cluster %x / cycle %d\n",
     153printk("\n[DBG] %s : cores initialized in cluster %x / cycle %d\n",
    146154__FUNCTION__ , local_cxy , cycle );
    147155#endif
     
    151159    cluster->rpc_threads = 0;
    152160
    153 cluster_dmsg("\n[DBG] %s : RPC fifo inialized in cluster %x at cycle %d\n",
     161#if( CONFIG_DEBUG_CLUSTER_INIT & 1 )
     162cycle = (uint32_t)hal_get_cycles();
     163if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
     164printk("\n[DBG] %s : RPC fifo inialized in cluster %x at cycle %d\n",
    154165__FUNCTION__ , local_cxy , hal_get_cycles() );
     166#endif
    155167
    156168    // initialise pref_tbl[] in process manager
     
    179191cycle = (uint32_t)hal_get_cycles();
    180192if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
    181 cluster_dmsg("\n[DBG] %s Process Manager initialized in cluster %x / cycle %d\n",
    182 __FUNCTION__ , local_cxy , cycle );
     193printk("\n[DBG] %s , thread %x exit for cluster %x / cycle %d\n",
     194__FUNCTION__ , CURRENT_THREAD , local_cxy , cycle );
    183195#endif
    184196
  • trunk/kernel/kern/cluster.h

    r433 r437  
    44 * authors  Ghassan Almaless (2008,2009,2010,2011,2012)
    55 *          Mohamed Lamine Karaoui (2015)
    6  *          Alain Greiner (2016,2017)
     6 *          Alain Greiner (2016,2017,2018)
    77 *
    88 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/kern/do_syscall.c

    r428 r437  
    7878    sys_closedir,           // 25
    7979    sys_getcwd,             // 26
    80     sys_undefined,          // 27 
     80    sys_isatty,             // 27 
    8181    sys_alarm,              // 28
    8282    sys_rmdir,              // 29
  • trunk/kernel/kern/dqdt.c

    r406 r437  
    22 * dqdt.c - Distributed Quaternary Decision Tree implementation.
    33 *
    4  * Author : Alain Greiner (2016)
     4 * Author : Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c)  UPMC Sorbonne Universites
  • trunk/kernel/kern/dqdt.h

    r19 r437  
    22 * kern/dqdt.h - Distributed Quad Decision Tree
    33 *
    4  * Author : Alain Greiner (2016)
     4 * Author : Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c)  UPMC Sorbonne Universites
     
    4040 *
    4141 * - If both Y_SIZE and Y_SIZE are larger than 1, it makes the assumption that
    42  *   the cluster topology is a 2D mesh. The [X,Y] coordinates of a cluster are
     42 *   the clusters topology is a 2D mesh. The [X,Y] coordinates of a cluster are
    4343 *   obtained from the CXY identifier using the following rules :
    4444 *      X = CXY >> Y_WIDTH   /  Y = CXY & ((1<<Y_WIDTH)-1)
     
    9393
    9494/****************************************************************************************
    95  * This recursive function displays usage information for all DQDT nodes in the subtree
    96  * defined by the node argument. It traverses the quadtree from root to bottom.
    97  ****************************************************************************************
    98  * @ node_xp   : extended pointer on a DQDT node.
    99  ***************************************************************************************/
    100 void dqdt_global_print( xptr_t  node_xp );
    101 
    102 /****************************************************************************************
    103  * This function displays summary usage information in a given DQDT local node.
    104  ****************************************************************************************
    105  * @ node   : local pointer on a DQDT node.
    106  ***************************************************************************************/
    107 void dqdt_local_print( dqdt_node_t * node );
    108 
    109 /****************************************************************************************
    11095 * This recursive function traverses the DQDT quad-tree from bottom to root, to propagate
    11196 * the change in the threads number and allocated pages number in a leaf cluster,
     
    153138cxy_t dqdt_get_cluster_for_memory();
    154139
     140/****************************************************************************************
     141 * This recursive function displays usage information for all DQDT nodes in the subtree
     142 * defined by the node argument. It traverses the quadtree from root to bottom.
     143 ****************************************************************************************
     144 * @ node_xp   : extended pointer on a DQDT node.
     145 ***************************************************************************************/
     146void dqdt_global_print( xptr_t  node_xp );
     147
     148/****************************************************************************************
     149 * This function displays summary usage information in a given DQDT local node.
     150 ****************************************************************************************
     151 * @ node   : local pointer on a DQDT node.
     152 ***************************************************************************************/
     153void dqdt_local_print( dqdt_node_t * node );
     154
    155155
    156156#endif  /* _DQDT_H_ */
  • trunk/kernel/kern/kernel_init.c

    r436 r437  
    324324            }
    325325
    326 #if( CONFIG_KINIT_DEBUG & 0x1 )
    327 if( hal_time_stamp() > CONFIG_KINIT_DEBUG )
     326#if( CONFIG_DEBUG_KERNEL_INIT & 0x1 )
     327if( hal_time_stamp() > CONFIG_DEBUG_KERNEL_INIT )
    328328printk("\n[DBG] %s : created MMC in cluster %x / chdev = %x\n",
    329329__FUNCTION__ , local_cxy , chdev_ptr );
     
    353353                chdev_dir.dma[channel] = XPTR( local_cxy , chdev_ptr );
    354354
    355 #if( CONFIG_KINIT_DEBUG & 0x1 )
    356 if( hal_time_stamp() > CONFIG_KINIT_DEBUG )
     355#if( CONFIG_DEBUG_KERNEL_INIT & 0x1 )
     356if( hal_time_stamp() > CONFIG_DEBUG_KERNEL_INIT )
    357357printk("\n[DBG] %s : created DMA[%d] in cluster %x / chdev = %x\n",
    358358__FUNCTION__ , channel , local_cxy , chdev_ptr );
     
    488488                    }
    489489
    490 #if( CONFIG_KINIT_DEBUG & 0x1 )
    491 if( hal_time_stamp() > CONFIG_KINIT_DEBUG )
     490#if( CONFIG_DEBUG_KERNEL_INIT & 0x1 )
     491if( hal_time_stamp() > CONFIG_DEBUG_KERNEL_INIT )
    492492printk("\n[DBG] %s : create chdev %s / channel = %d / rx = %d / cluster %x / chdev = %x\n",
    493493__FUNCTION__ , chdev_func_str( func ), channel , rx , local_cxy , chdev );
     
    623623    }
    624624
    625 #if( CONFIG_KINIT_DEBUG & 0x1 )
    626 if( hal_time_stamp() > CONFIG_KINIT_DEBUG )
     625#if( CONFIG_DEBUG_KERNEL_INIT & 0x1 )
     626if( hal_time_stamp() > CONFIG_DEBUG_KERNEL_INIT )
    627627{
    628628    printk("\n[DBG] %s created PIC chdev in cluster %x at cycle %d\n",
     
    792792    thread->core = &LOCAL_CLUSTER->core_tbl[core_lid];
    793793
    794 #if CONFIG_LOCKS_DEBUG
     794    // each core initializes the idle thread lists of locks
    795795    list_root_init( &thread->locks_root );
    796796    xlist_root_init( XPTR( local_cxy , &thread->xlocks_root ) );
    797 #endif
     797    thread->local_locks = 0;
     798    thread->remote_locks = 0;
    798799
    799800    // CP0 in I/O cluster initialises TXT0 chdev descriptor
     
    804805                                        (info->x_size * info->y_size) );
    805806    barrier_wait( &local_barrier , info->cores_nr );
    806 
    807     if( (core_lid ==  0) && (local_cxy == 0) )
    808     kinit_dmsg("\n[DBG] %s : exit barrier 0 : TXT0 initialized / cycle %d\n",
    809     __FUNCTION__, hal_time_stamp() );
     807    /////////////////////////////////////////////////////////////////////////////////
     808
     809#if CONFIG_DEBUG_KERNEL_INIT
     810if( (core_lid ==  0) && (local_cxy == 0) )
     811printk("\n[DBG] %s : exit barrier 0 : TXT0 initialized / cycle %d\n",
     812__FUNCTION__, (uint32_t)hal_get_cycles() );
     813#endif
    810814
    811815    /////////////////////////////////////////////////////////////////////////////
     
    841845    /////////////////////////////////////////////////////////////////////////////////
    842846
    843     if( (core_lid ==  0) && (local_cxy == 0) )
    844     kinit_dmsg("\n[DBG] %s : exit barrier 1 : clusters initialised / cycle %d\n",
    845     __FUNCTION__, hal_time_stamp() );
     847#if CONFIG_DEBUG_KERNEL_INIT
     848if( (core_lid ==  0) && (local_cxy == 0) )
     849printk("\n[DBG] %s : exit barrier 1 : clusters initialised / cycle %d\n",
     850__FUNCTION__, (uint32_t)hal_get_cycles() );
     851#endif
    846852
    847853    /////////////////////////////////////////////////////////////////////////////////
     
    866872    ////////////////////////////////////////////////////////////////////////////////
    867873
    868     if( (core_lid ==  0) && (local_cxy == 0) )
    869     kinit_dmsg("\n[DBG] %s : exit barrier 2 : PIC initialised / cycle %d\n",
    870     __FUNCTION__, hal_time_stamp() );
     874#if CONFIG_DEBUG_KERNEL_INIT
     875if( (core_lid ==  0) && (local_cxy == 0) )
     876printk("\n[DBG] %s : exit barrier 2 : PIC initialised / cycle %d\n",
     877__FUNCTION__, (uint32_t)hal_get_cycles() );
     878#endif
    871879
    872880    ////////////////////////////////////////////////////////////////////////////////
     
    897905    /////////////////////////////////////////////////////////////////////////////////
    898906
    899     if( (core_lid ==  0) && (local_cxy == 0) )
    900     kinit_dmsg("\n[DBG] %s : exit barrier 3 : all chdev initialised / cycle %d\n",
    901                __FUNCTION__, hal_time_stamp());
    902 
     907#if CONFIG_DEBUG_KERNEL_INIT
     908if( (core_lid ==  0) && (local_cxy == 0) )
     909printk("\n[DBG] %s : exit barrier 3 : all chdev initialised / cycle %d\n",
     910__FUNCTION__, (uint32_t)hal_get_cycles() );
     911#endif
     912
     913#if( CONFIG_DEBUG_KERNEL_INIT & 1 )
     914chdev_dir_display();
     915#endif
     916   
    903917    /////////////////////////////////////////////////////////////////////////////////
    904918    // STEP 4 : All cores enable IPI (Inter Procesor Interrupt),
     
    908922    /////////////////////////////////////////////////////////////////////////////////
    909923
    910 #if CONFIG_KINIT_DEBUG
    911 chdev_dir_display();
    912 #endif
    913    
    914924    // All cores enable the shared IPI channel
    915925    dev_pic_enable_ipi();
     
    932942    core->scheduler.idle = thread;
    933943
    934 #if CONFIG_KINIT_DEBUG
     944#if( CONFIG_DEBUG_KERNEL_INIT & 1 )
    935945sched_display( core_lid );
    936946#endif
     
    10041014    /////////////////////////////////////////////////////////////////////////////////
    10051015
    1006     if( (core_lid ==  0) && (local_cxy == 0) )
    1007     kinit_dmsg("\n[DBG] %s : exit barrier 4 : VFS_root = %l in cluster 0 / cycle %d\n",
    1008                __FUNCTION__, vfs_root_inode_xp , hal_time_stamp());
     1016#if CONFIG_DEBUG_KERNEL_INIT
     1017if( (core_lid ==  0) && (local_cxy == 0) )
     1018printk("\n[DBG] %s : exit barrier 4 : VFS_root = %l in cluster 0 / cycle %d\n",
     1019__FUNCTION__, vfs_root_inode_xp , (uint32_t)hal_get_cycles());
     1020#endif
    10091021
    10101022    /////////////////////////////////////////////////////////////////////////////////
     
    10631075    /////////////////////////////////////////////////////////////////////////////////
    10641076
    1065     if( (core_lid ==  0) && (local_cxy == 0) )
    1066     kinit_dmsg("\n[DBG] %s : exit barrier 5 : VFS_root = %l in cluster IO / cycle %d\n",
    1067     __FUNCTION__, vfs_root_inode_xp , hal_time_stamp() );
     1077#if CONFIG_DEBUG_KERNEL_INIT
     1078if( (core_lid ==  0) && (local_cxy == io_cxy) )
     1079printk("\n[DBG] %s : exit barrier 5 : VFS_root = %l in cluster %x / cycle %d\n",
     1080__FUNCTION__, vfs_root_inode_xp , io_cxy , (uint32_t)hal_get_cycles());
     1081#endif
    10681082
    10691083    /////////////////////////////////////////////////////////////////////////////////
     
    10961110    /////////////////////////////////////////////////////////////////////////////////
    10971111
    1098     if( (core_lid ==  0) && (local_cxy == 0) )
    1099     kinit_dmsg("\n[DBG] %s : exit barrier 6 : dev_root = %l in cluster IO / cycle %d\n",
    1100     __FUNCTION__, devfs_dev_inode_xp , hal_time_stamp() );
     1112#if CONFIG_DEBUG_KERNEL_INIT
     1113if( (core_lid ==  0) && (local_cxy == io_cxy) )
     1114printk("\n[DBG] %s : exit barrier 6 : dev_root = %l in cluster %x / cycle %d\n",
     1115__FUNCTION__, devfs_dev_inode_xp , io_cxy , (uint32_t)hal_get_cycles() );
     1116#endif
    11011117
    11021118    /////////////////////////////////////////////////////////////////////////////////
     
    11331149    /////////////////////////////////////////////////////////////////////////////////
    11341150
     1151#if CONFIG_DEBUG_KERNEL_INIT
     1152if( (core_lid ==  0) && (local_cxy == 0) )
     1153printk("\n[DBG] %s : exit barrier 7 : dev_root = %l in cluster 0 / cycle %d\n",
     1154__FUNCTION__, devfs_dev_inode_xp , (uint32_t)hal_get_cycles() );
     1155#endif
     1156
     1157    /////////////////////////////////////////////////////////////////////////////////
     1158    // STEP 8 : CP0 in cluster 0 creates the first user process (process_init)
     1159    /////////////////////////////////////////////////////////////////////////////////
     1160
    11351161    if( (core_lid ==  0) && (local_cxy == 0) )
    1136     kinit_dmsg("\n[DBG] %s : exit barrier 7 : dev_root = %l in cluster 0 / cycle %d\n",
    1137     __FUNCTION__, devfs_dev_inode_xp , hal_time_stamp() );
    1138 
    1139     /////////////////////////////////////////////////////////////////////////////////
    1140     // STEP 8 : CP0 in cluster 0 creates the first user process (process_init)
    1141     /////////////////////////////////////////////////////////////////////////////////
    1142 
    1143     if( (core_lid ==  0) && (local_cxy == 0) )
    1144     {
    1145 
    1146 #if CONFIG_KINIT_DEBUG
     1162    {
     1163
     1164#if( CONFIG_DEBUG_KERNEL_INIT & 1 )
    11471165vfs_display( vfs_root_inode_xp );
    11481166#endif
     
    11571175    /////////////////////////////////////////////////////////////////////////////////
    11581176
    1159     if( (core_lid ==  0) && (local_cxy == 0) )
    1160     kinit_dmsg("\n[DBG] %s : exit barrier 8 : process init created / cycle %d\n",
    1161     __FUNCTION__ , hal_time_stamp() );
     1177#if CONFIG_DEBUG_KERNEL_INIT
     1178if( (core_lid ==  0) && (local_cxy == 0) )
     1179printk("\n[DBG] %s : exit barrier 8 : process init created / cycle %d\n",
     1180__FUNCTION__ , (uint32_t)hal_get_cycles() );
     1181#endif
    11621182
    11631183    /////////////////////////////////////////////////////////////////////////////////
     
    11691189        print_banner( (info->x_size * info->y_size) , info->cores_nr );
    11701190
    1171 #if CONFIG_KINIT_DEBUG
    1172 
    1173         printk("\n\n***** memory fooprint for main kernel objects\n\n"
     1191#if( CONFIG_DEBUG_KERNEL_INIT & 1 )
     1192printk("\n\n***** memory fooprint for main kernel objects\n\n"
    11741193                   " - thread descriptor  : %d bytes\n"
    11751194                   " - process descriptor : %d bytes\n"
  • trunk/kernel/kern/printk.c

    r428 r437  
    22 * printk.c - Kernel Log & debug messages API implementation.
    33 *
    4  * authors  Alain Greiner (2016)
     4 * authors  Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/kern/printk.h

    r428 r437  
    22 * printk.h - Kernel Log & debug messages API definition.
    33 *
    4  * authors  Alain Greiner (2016)
     4 * authors  Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    120120
    121121
    122 ///////////////////////////////////////////////////////////////////////////////////
    123 //       Conditional debug macros
    124 ///////////////////////////////////////////////////////////////////////////////////
     122
     123/*  deprecated march 2018 [AG]
    125124
    126125#if CONFIG_CHDEV_DEBUG
     
    364363#endif
    365364
     365*/
    366366
    367367#endif  // _PRINTK_H
  • trunk/kernel/kern/process.c

    r436 r437  
    366366    xptr_t      children_lock_xp;
    367367
     368    pid_t       pid = process->pid;
     369
    368370        assert( (process->th_nr == 0) , __FUNCTION__ ,
    369     "process %x in cluster %x has still active threads", process->pid , local_cxy );
     371    "process %x in cluster %x has still active threads", pid , local_cxy );
    370372
    371373#if CONFIG_DEBUG_PROCESS_DESTROY
     
    373375if( CONFIG_DEBUG_PROCESS_DESTROY )
    374376printk("\n[DBG] %s : thread %x enter to destroy process %x (pid = %x) / cycle %d\n",
    375 __FUNCTION__ , CURRENT_THREAD , process, process->pid , cycle );
     377__FUNCTION__ , CURRENT_THREAD , process, pid , cycle );
     378#endif
     379
     380#if CONFIG_DEBUG_PROCESS_DESTROY
     381if( CONFIG_DEBUG_PROCESS_DESTROY  & 1 )
     382cluster_processes_display( CXY_FROM_PID( pid ) );
    376383#endif
    377384
     
    383390
    384391    // remove process from children_list if process is in owner cluster
    385     if( CXY_FROM_PID( process->pid ) == local_cxy )
     392    if( CXY_FROM_PID( pid ) == local_cxy )
    386393    {
    387394        // get pointers on parent process
     
    400407
    401408    // release the process PID to cluster manager
    402     cluster_pid_release( process->pid );
     409    cluster_pid_release( pid );
    403410
    404411    // FIXME close all open files and update dirty [AG]
     
    419426if( CONFIG_DEBUG_PROCESS_DESTROY )
    420427printk("\n[DBG] %s : thread %x exit / destroyed process %x (pid = %x) / cycle %d\n",
    421 __FUNCTION__ , CURRENT_THREAD , process, process->pid, cycle );
     428__FUNCTION__ , CURRENT_THREAD , process, pid, cycle );
    422429#endif
    423430
  • trunk/kernel/kern/rpc.c

    r436 r437  
    11/*
    2  * rpc.c - RPC related operations implementation.
     2 * rpc.c - RPC operations implementation.
    33 *
    4  * Author    Alain Greiner (2016,2017)
     4 * Author    Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c)  UPMC Sorbonne Universites
     
    5252if( cycle > CONFIG_DEBUG_RPC_MARSHALING )                                              \
    5353printk("\n[DBG] %s : enter thread %x on core[%x,%d] / cycle %d\n",                     \
    54 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, CURRENT_THREAD->core->lid , cycle );
     54__FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
    5555
    5656#define RPC_DEBUG_EXIT                                                                 \
     
    5858if( cycle > CONFIG_DEBUG_RPC_MARSHALING )                                              \
    5959printk("\n[DBG] %s : exit thread %x on core[%x,%d] / cycle %d\n",                      \
    60 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, CURRENT_THREAD->core->lid , cycle );
     60__FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
    6161
    6262#else
     
    129129uint32_t cycle = (uint32_t)hal_get_cycles();
    130130if( CONFIG_DEBUG_RPC_SEND < cycle )
    131 printk("\n[DBG] %s : thread %x enter for rpc[%d] / rpc_ptr %x / cycle %d\n",
    132 __FUNCTION__, CURRENT_THREAD, rpc->index, rpc, cycle );
     131printk("\n[DBG] %s : thread %x in cluster %x enter for rpc[%d] / rpc_ptr %x / cycle %d\n",
     132__FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index, rpc, cycle );
    133133#endif
    134134
     
    174174cycle = (uint32_t)hal_get_cycles();
    175175if( CONFIG_DEBUG_RPC_SEND < cycle )
    176 printk("\n[DBG] %s : thread %x busy waiting / rpc[%d] / server = %x / cycle %d\n",
    177 __FUNCTION__, CURRENT_THREAD, rpc->index , server_cxy , cycle );
     176printk("\n[DBG] %s : thread %x in cluster %x busy waiting / rpc[%d] / cycle %d\n",
     177__FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index , cycle );
    178178#endif
    179179
     
    183183cycle = (uint32_t)hal_get_cycles();
    184184if( CONFIG_DEBUG_RPC_SEND < cycle )
    185 printk("\n[DBG] %s : thread % resume / rpc[%d] / cycle %d\n",
    186 __FUNCTION__, CURRENT_THREAD, rpc->index, cycle );
     185printk("\n[DBG] %s : thread % in cluster %x resume / rpc[%d] / cycle %d\n",
     186__FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index, cycle );
    187187#endif
    188188        }
     
    193193cycle = (uint32_t)hal_get_cycles();
    194194if( CONFIG_DEBUG_RPC_SEND < cycle )
    195 printk("\n[DBG] %s : thread %x block & deschedule / rpc[%d] / server = %x / cycle %d\n",
    196 __FUNCTION__, CURRENT_THREAD, rpc->index , server_cxy , cycle );
     195printk("\n[DBG] %s : thread %x in cluster %x deschedule / rpc[%d] / cycle %d\n",
     196__FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index , cycle );
    197197#endif
    198198            thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_RPC );
     
    202202cycle = (uint32_t)hal_get_cycles();
    203203if( CONFIG_DEBUG_RPC_SEND < cycle )
    204 printk("\n[DBG] %s : thread % resume / rpcr[%d] / cycle %d\n",
    205 __FUNCTION__, CURRENT_THREAD, rpc->index, cycle );
     204printk("\n[DBG] %s : thread % in cluster %x resume / rpcr[%d] / cycle %d\n",
     205__FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index, cycle );
    206206#endif
    207207        }
     
    219219cycle = (uint32_t)hal_get_cycles();
    220220if( CONFIG_DEBUG_RPC_SEND < cycle )
    221 printk("\n[DBG] %s : non blocking rpc[%d] => thread return  / cycle %d\n",
     221printk("\n[DBG] %s : non blocking rpc[%d] => thread %x return  / cycle %d\n",
    222222__FUNCTION__, rpc->index, CURRENT_THREAD, cycle );
    223223#endif
     
    355355uint32_t cycle = (uint32_t)hal_get_cycles();
    356356if( CONFIG_DEBUG_RPC_SERVER < cycle )
    357 printk("\n[DBG] %s : RPC thread %x takes RPC fifo ownership / cluster %x / cycle %d\n",
     357printk("\n[DBG] %s : RPC thread %x in cluster %x takes RPC fifo ownership / cycle %d\n",
    358358__FUNCTION__, this, local_cxy, cycle );
    359359#endif
     
    378378                    desc_ptr = GET_PTR( desc_xp );
    379379
    380                         index    = desc_ptr->index;
    381                     blocking = desc_ptr->blocking;
     380                        index    = hal_remote_lw( XPTR( desc_cxy , &desc_ptr->index ) );
     381                    blocking = hal_remote_lw( XPTR( desc_cxy , &desc_ptr->blocking ) );
    382382
    383383#if CONFIG_DEBUG_RPC_SERVER
    384384cycle = (uint32_t)hal_get_cycles();
    385385if( CONFIG_DEBUG_RPC_SERVER < cycle )
    386 printk("\n[DBG] %s : RPC thread %x got rpc[%d] / rpc_ptr %x / cycle %d\n",
    387 __FUNCTION__, this, index, desc_ptr, cycle );
     386printk("\n[DBG] %s : RPC thread %x in cluster %x got rpc[%d] / rpc_ptr %x / cycle %d\n",
     387__FUNCTION__, this, local_cxy, index, desc_ptr, cycle );
    388388#endif
    389389                    // call the relevant server function
     
    393393cycle = (uint32_t)hal_get_cycles();
    394394if( CONFIG_DEBUG_RPC_SERVER < cycle )
    395 printk("\n[DBG] %s : RPC thread %x completes rpc %d in cluster %x / cycle %d\n",
    396 __FUNCTION__, this, index, local_cxy, cycle );
     395printk("\n[DBG] %s : RPC thread %x in cluster %x completes rpc[%d] / rpc_ptr %x / cycle %d\n",
     396__FUNCTION__, this, local_cxy, index, cycle );
    397397#endif
    398398                    // increment handled RPCs counter
     
    435435uint32_t cycle = (uint32_t)hal_get_cycles();
    436436if( CONFIG_DEBUG_RPC_SERVER < cycle )
    437 printk("\n[DBG] %s : RPC thread %x suicides in cluster %x / cycle %d\n",
     437printk("\n[DBG] %s : RPC thread %x in cluster %x suicides / cycle %d\n",
    438438__FUNCTION__, this, local_cxy, cycle );
    439439#endif
     
    450450uint32_t cycle = (uint32_t)hal_get_cycles();
    451451if( CONFIG_DEBUG_RPC_SERVER < cycle )
    452 printk("\n[DBG] %s : RPC thread %x deschedules in cluster %x / cycle %d\n",
     452printk("\n[DBG] %s : RPC thread %x in cluster %x deschedules / cycle %d\n",
    453453__FUNCTION__, this, local_cxy, cycle );
    454454#endif
     
    460460cycle = (uint32_t)hal_get_cycles();
    461461if( CONFIG_DEBUG_RPC_SERVER < cycle )
    462 printk("\n[DBG] %s : RPC thread %x resumes in cluster %x / cycle %d\n",
     462printk("\n[DBG] %s : RPC thread %x in cluster %x resumes / cycle %d\n",
    463463__FUNCTION__, this, local_cxy, cycle );
    464464#endif
     
    478478                                page_t  ** page )      // out
    479479{
    480 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    481 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    482 CURRENT_THREAD->core->lid , hal_time_stamp() );
    483480
    484481    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     
    499496    *page = (page_t *)(intptr_t)rpc.args[1];
    500497
    501 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    502 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    503 CURRENT_THREAD->core->lid , hal_time_stamp() );
    504498}
    505499
     
    507501void rpc_pmem_get_pages_server( xptr_t xp )
    508502{
    509 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    510 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    511 CURRENT_THREAD->core->lid , hal_time_stamp() );
    512503
    513504    // get client cluster identifier and pointer on RPC descriptor
     
    524515    hal_remote_swd( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
    525516
    526 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    527 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    528 CURRENT_THREAD->core->lid , hal_time_stamp() );
    529517}
    530518
     
    537525                                    page_t  * page )      // out
    538526{
    539 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    540 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    541 CURRENT_THREAD->core->lid , hal_time_stamp() );
    542527
    543528    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     
    555540    rpc_send( cxy , &rpc );
    556541
    557 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    558 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    559 CURRENT_THREAD->core->lid , hal_time_stamp() );
    560542}
    561543
     
    563545void rpc_pmem_release_pages_server( xptr_t xp )
    564546{
    565 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    566 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    567 CURRENT_THREAD->core->lid , hal_time_stamp() );
    568547
    569548    // get client cluster identifier and pointer on RPC descriptor
     
    580559    kmem_free( &req );
    581560
    582 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    583 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    584 CURRENT_THREAD->core->lid , hal_time_stamp() );
    585561}
    586562
     
    601577                                   error_t   * error )              // out
    602578{
    603 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    604 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    605 CURRENT_THREAD->core->lid , hal_time_stamp() );
    606 
    607579    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    608580
     
    625597    *error             = (error_t)rpc.args[4];     
    626598
    627 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    628 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    629 CURRENT_THREAD->core->lid , hal_time_stamp() );
    630599}
    631600
     
    633602void rpc_process_make_fork_server( xptr_t xp )
    634603{
    635 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    636 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    637 CURRENT_THREAD->core->lid , hal_time_stamp() );
    638604
    639605    xptr_t     ref_process_xp;     // extended pointer on reference parent process
     
    662628    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
    663629
    664 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    665 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    666 CURRENT_THREAD->core->lid , hal_time_stamp() );
    667630}
    668631
     
    688651                                    error_t        * error )      // out
    689652{
    690 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    691 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    692 CURRENT_THREAD->core->lid , hal_time_stamp() );
    693 
    694653    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    695654
     
    713672    *error     = (error_t)rpc.args[5];
    714673
    715 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    716 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    717 CURRENT_THREAD->core->lid , hal_time_stamp() );
    718674}
    719675
     
    721677void rpc_thread_user_create_server( xptr_t xp )
    722678{
    723 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    724 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    725 CURRENT_THREAD->core->lid , hal_time_stamp() );
    726679
    727680    pthread_attr_t * attr_ptr;   // pointer on attributes structure in client cluster
     
    764717    hal_remote_swd( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );
    765718
    766 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    767 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    768 CURRENT_THREAD->core->lid , hal_time_stamp() );
    769719}
    770720
     
    781731                                      error_t * error )      // out
    782732{
    783 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    784 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    785 CURRENT_THREAD->core->lid , hal_time_stamp() );
    786 
    787733    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    788734
     
    805751    *error     = (error_t)rpc.args[4];
    806752
    807 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    808 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    809 CURRENT_THREAD->core->lid , hal_time_stamp() );
    810753}
    811754
     
    813756void rpc_thread_kernel_create_server( xptr_t xp )
    814757{
    815 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    816 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    817 CURRENT_THREAD->core->lid , hal_time_stamp() );
    818 
    819758    thread_t       * thread_ptr;  // local pointer on thread descriptor
    820759    xptr_t           thread_xp;   // extended pointer on thread descriptor
     
    842781    hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp );
    843782
    844 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    845 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    846 CURRENT_THREAD->core->lid , hal_time_stamp() );
    847783}
    848784
     
    962898                                  error_t      * error )     // out
    963899{
    964     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    965     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    966     CURRENT_THREAD->core->lid , hal_time_stamp() );
    967 
    968900    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    969901
     
    991923    *error    = (error_t)rpc.args[9];
    992924
    993     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    994     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    995     CURRENT_THREAD->core->lid , hal_time_stamp() );
    996925}
    997926
     
    1010939    error_t          error;
    1011940
    1012     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1013     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1014     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1015 
    1016941    // get client cluster identifier and pointer on RPC descriptor
    1017942    cxy_t        client_cxy  = GET_CXY( xp );
     
    1043968    hal_remote_swd( XPTR( client_cxy , &desc->args[9] ) , (uint64_t)error );
    1044969
    1045     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1046     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1047     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1048970}
    1049971
     
    1056978                                   struct vfs_inode_s * inode )
    1057979{
    1058     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1059     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1060     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1061 
    1062980    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    1063981
     
    1074992    rpc_send( cxy , &rpc );
    1075993
    1076     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1077     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1078     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1079994}
    1080995
     
    1083998{
    1084999    vfs_inode_t * inode;
    1085 
    1086     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1087     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1088     CURRENT_THREAD->core->lid , hal_time_stamp() );
    10891000
    10901001    // get client cluster identifier and pointer on RPC descriptor
     
    10981009    vfs_inode_destroy( inode );
    10991010
    1100     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1101     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1102     CURRENT_THREAD->core->lid , hal_time_stamp() );
    11031011}
    11041012
     
    11151023                                   error_t              * error )       // out
    11161024{
    1117     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1118     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1119     CURRENT_THREAD->core->lid , hal_time_stamp() );
     1025    RPC_DEBUG_ENTER
    11201026
    11211027    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     
    11391045    *error     = (error_t)rpc.args[4];
    11401046
    1141     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1142     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1143     CURRENT_THREAD->core->lid , hal_time_stamp() );
     1047    RPC_DEBUG_EXIT
    11441048}
    11451049
     
    11531057    error_t       error;
    11541058
     1059    RPC_DEBUG_ENTER
     1060
    11551061    char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
    1156 
    1157     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1158     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1159     CURRENT_THREAD->core->lid , hal_time_stamp() );
    11601062
    11611063    // get client cluster identifier and pointer on RPC descriptor
     
    11811083    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
    11821084
    1183     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1184     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1185     CURRENT_THREAD->core->lid , hal_time_stamp() );
     1085    RPC_DEBUG_EXIT
    11861086}
    11871087
     
    11951095                                    vfs_dentry_t * dentry )
    11961096{
    1197     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1198     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1199     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1200 
    12011097    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    12021098
     
    12131109    rpc_send( cxy , &rpc );
    12141110
    1215     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1216     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1217     CURRENT_THREAD->core->lid , hal_time_stamp() );
    12181111}
    12191112
     
    12221115{
    12231116    vfs_dentry_t * dentry;
    1224 
    1225     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1226     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1227     CURRENT_THREAD->core->lid , hal_time_stamp() );
    12281117
    12291118    // get client cluster identifier and pointer on RPC descriptor
     
    12371126    vfs_dentry_destroy( dentry );
    12381127
    1239     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1240     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1241     CURRENT_THREAD->core->lid , hal_time_stamp() );
    12421128}
    12431129
     
    12541140                                 error_t              * error )      // out
    12551141{
    1256     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1257     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1258     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1259 
    12601142    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    12611143
     
    12771159    *error   = (error_t)rpc.args[3];
    12781160
    1279     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1280     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1281     CURRENT_THREAD->core->lid , hal_time_stamp() );
    12821161}
    12831162
     
    12891168    xptr_t        file_xp;
    12901169    error_t       error;
    1291 
    1292     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1293     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1294     CURRENT_THREAD->core->lid , hal_time_stamp() );
    12951170
    12961171    // get client cluster identifier and pointer on RPC descriptor
     
    13111186    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    13121187
    1313     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1314     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1315     CURRENT_THREAD->core->lid , hal_time_stamp() );
    13161188}
    13171189
     
    13241196                                  vfs_file_t * file )
    13251197{
    1326     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1327     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1328     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1329 
    13301198    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    13311199
     
    13421210    rpc_send( cxy , &rpc );
    13431211
    1344     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1345     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1346     CURRENT_THREAD->core->lid , hal_time_stamp() );
    13471212}
    13481213
     
    13511216{
    13521217    vfs_file_t * file;
    1353 
    1354     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1355     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1356     CURRENT_THREAD->core->lid , hal_time_stamp() );
    13571218
    13581219    // get client cluster identifier and pointer on RPC descriptor
     
    13661227    vfs_file_destroy( file );
    13671228
    1368     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1369     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1370     CURRENT_THREAD->core->lid , hal_time_stamp() );
    13711229}
    13721230
     
    13821240                                error_t     * error )          // out
    13831241{
    1384     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1385     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1386     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1387 
    13881242    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    13891243
     
    14051259    *error   = (error_t)rpc.args[3];
    14061260
    1407     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1408     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1409     CURRENT_THREAD->core->lid , hal_time_stamp() );
    14101261}
    14111262
     
    14201271    char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
    14211272
    1422     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1423     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1424     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1425 
    14261273    // get client cluster identifier and pointer on RPC descriptor
    14271274    cxy_t        client_cxy  = GET_CXY( xp );
     
    14431290    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    14441291
    1445     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1446     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1447     CURRENT_THREAD->core->lid , hal_time_stamp() );
    14481292}
    14491293
     
    14571301                                     error_t     * error )     // out
    14581302{
    1459     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1460     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1461     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1462 
    14631303    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    14641304
     
    14781318    *error   = (error_t)rpc.args[1];
    14791319
    1480     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1481     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1482     CURRENT_THREAD->core->lid , hal_time_stamp() );
    14831320}
    14841321
     
    14891326    vfs_inode_t * inode;
    14901327
    1491     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1492     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1493     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1494 
    14951328    // get client cluster identifier and pointer on RPC descriptor
    14961329    cxy_t        client_cxy  = GET_CXY( xp );
     
    15061339    hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
    15071340
    1508     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1509     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1510     CURRENT_THREAD->core->lid , hal_time_stamp() );
    15111341}
    15121342
     
    15231353                                   error_t  * error )    // out
    15241354{
    1525     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1526     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1527     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1528 
    15291355    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    15301356
     
    15471373    *error   = (error_t)rpc.args[4];
    15481374
    1549     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1550     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1551     CURRENT_THREAD->core->lid , hal_time_stamp() );
    15521375}
    15531376
     
    15611384    error_t       error;
    15621385
    1563     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1564     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1565     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1566 
    15671386    // get client cluster identifier and pointer on RPC descriptor
    15681387    cxy_t        client_cxy  = GET_CXY( xp );
     
    15811400    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
    15821401
    1583     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1584     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1585     CURRENT_THREAD->core->lid , hal_time_stamp() );
    15861402}
    15871403
     
    15971413                              error_t   * error )      // out
    15981414{
    1599     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1600     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1601     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1602 
    16031415    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    16041416
     
    16201432    *error   = (error_t)rpc.args[3];
    16211433
    1622     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1623     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1624     CURRENT_THREAD->core->lid , hal_time_stamp() );
    16251434}
    16261435
     
    16331442    xptr_t        vseg_xp;
    16341443    error_t       error;
    1635 
    1636     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1637     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1638     CURRENT_THREAD->core->lid , hal_time_stamp() );
    16391444
    16401445    // get client cluster identifier and pointer on RPC descriptor
     
    16541459    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    16551460
    1656     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1657     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1658     CURRENT_THREAD->core->lid , hal_time_stamp() );
    16591461}
    16601462
     
    16731475                             error_t   * error )   // out
    16741476{
    1675     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1676     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1677     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1678 
    16791477    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    16801478
     
    16981496    *error = (error_t)rpc.args[5];
    16991497
    1700     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1701     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1702     CURRENT_THREAD->core->lid , hal_time_stamp() );
    17031498}
    17041499
     
    17121507    ppn_t         ppn;
    17131508    error_t       error;
    1714 
    1715     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1716     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1717     CURRENT_THREAD->core->lid , hal_time_stamp() );
    17181509
    17191510    // get client cluster identifier and pointer on RPC descriptor
     
    17341525    hal_remote_swd( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );
    17351526
    1736     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1737     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1738     CURRENT_THREAD->core->lid , hal_time_stamp() );
    17391527}
    17401528
     
    17481536                           xptr_t *   buf_xp )     // out
    17491537{
    1750     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1751     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1752     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1753 
    17541538    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    17551539
     
    17691553    *buf_xp = (xptr_t)rpc.args[1];
    17701554
    1771     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1772     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1773     CURRENT_THREAD->core->lid , hal_time_stamp() );
    17741555}
    17751556
     
    17771558void rpc_kcm_alloc_server( xptr_t xp )
    17781559{
    1779     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1780     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1781     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1782 
    17831560    // get client cluster identifier and pointer on RPC descriptor
    17841561    cxy_t        client_cxy  = GET_CXY( xp );
     
    17981575    hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)buf_xp );
    17991576
    1800     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1801     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1802     CURRENT_THREAD->core->lid , hal_time_stamp() );
    18031577}   
    18041578
     
    18121586                          uint32_t   kmem_type )   // in
    18131587{
    1814     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1815     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1816     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1817 
    18181588    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    18191589
     
    18311601    rpc_send( cxy , &rpc );
    18321602
    1833     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1834     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1835     CURRENT_THREAD->core->lid , hal_time_stamp() );
    18361603}
    18371604
     
    18391606void rpc_kcm_free_server( xptr_t xp )
    18401607{
    1841     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1842     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1843     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1844 
    18451608    // get client cluster identifier and pointer on RPC descriptor
    18461609    cxy_t        client_cxy  = GET_CXY( xp );
     
    18571620    kmem_free( &req );
    18581621
    1859     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1860     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1861     CURRENT_THREAD->core->lid , hal_time_stamp() );
    18621622}   
    18631623
     
    18761636                                    error_t  * error )        // out
    18771637{
    1878     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1879     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1880     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1881 
    18821638    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    18831639
     
    19021658    *error     = (error_t)rpc.args[6];
    19031659
    1904     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1905     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1906     CURRENT_THREAD->core->lid , hal_time_stamp() );
    19071660}
    19081661
     
    19181671    uint32_t   size;
    19191672    error_t    error;
    1920 
    1921     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1922     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1923     CURRENT_THREAD->core->lid , hal_time_stamp() );
    19241673
    19251674    // get client cluster identifier and pointer on RPC descriptor
     
    19591708    hal_remote_swd( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error );
    19601709
    1961     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1962     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1963     CURRENT_THREAD->core->lid , hal_time_stamp() );
    19641710}
    19651711
     
    19741720                                 page_t         ** page )      // out
    19751721{
    1976     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1977     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1978     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1979 
    19801722    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    19811723
     
    19961738    *page = (page_t *)(intptr_t)rpc.args[2];
    19971739
    1998     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1999     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2000     CURRENT_THREAD->core->lid , hal_time_stamp() );
    20011740}
    20021741
     
    20041743void rpc_mapper_get_page_server( xptr_t xp )
    20051744{
    2006     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2007     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2008     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2009 
    20101745    // get client cluster identifier and pointer on RPC descriptor
    20111746    cxy_t        cxy  = GET_CXY( xp );
     
    20221757    hal_remote_swd( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
    20231758
    2024     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2025     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2026     CURRENT_THREAD->core->lid , hal_time_stamp() );
    20271759}
    20281760
     
    20431775                                 struct vseg_s   ** vseg )
    20441776{
    2045     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2046     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2047     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2048 
    20491777    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    20501778
     
    20711799    *vseg = (vseg_t *)(intptr_t)rpc.args[8];
    20721800
    2073     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2074     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2075     CURRENT_THREAD->core->lid , hal_time_stamp() );
    20761801}
    20771802
     
    20791804void rpc_vmm_create_vseg_server( xptr_t xp )
    20801805{
    2081     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2082     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2083     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2084 
    20851806    // get client cluster identifier and pointer on RPC descriptor
    20861807    cxy_t        cxy  = GET_CXY( xp );
     
    21101831    hal_remote_swd( XPTR( cxy , &desc->args[8] ) , (uint64_t)(intptr_t)vseg );
    21111832
    2112     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2113     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2114     CURRENT_THREAD->core->lid , hal_time_stamp() );
    21151833}
    21161834
     
    21231841                               lid_t              lid)
    21241842{
    2125     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2126     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2127     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2128 
    21291843    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    21301844
     
    21411855    rpc_send( cxy , &rpc );
    21421856
    2143     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2144     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2145     CURRENT_THREAD->core->lid , hal_time_stamp() );
    21461857}
    21471858
     
    21491860void rpc_sched_display_server( xptr_t xp )
    21501861{
    2151     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2152     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2153     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2154 
    21551862    // get client cluster identifier and pointer on RPC descriptor
    21561863    cxy_t        cxy  = GET_CXY( xp );
     
    21631870    sched_display( lid );
    21641871
    2165     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2166     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2167     CURRENT_THREAD->core->lid , hal_time_stamp() );
    21681872}
    21691873
     
    21761880                             process_t * process )
    21771881{
    2178     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2179     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2180     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2181 
    21821882    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    21831883
     
    21941894    rpc_send( cxy , &rpc );
    21951895
    2196     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2197     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2198     CURRENT_THREAD->core->lid , hal_time_stamp() );
    21991896}
    22001897
     
    22021899void rpc_vmm_set_cow_server( xptr_t xp )
    22031900{
    2204     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2205     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2206     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2207 
    22081901    process_t * process;
    22091902
     
    22181911    vmm_set_cow( process );
    22191912
    2220     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2221     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2222     CURRENT_THREAD->core->lid , hal_time_stamp() );
    22231913}
    22241914
     
    22321922                             bool_t      detailed )
    22331923{
    2234     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2235     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2236     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2237 
    22381924    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    22391925
     
    22511937    rpc_send( cxy , &rpc );
    22521938
    2253     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2254     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2255     CURRENT_THREAD->core->lid , hal_time_stamp() );
    22561939}
    22571940
     
    22591942void rpc_vmm_display_server( xptr_t xp )
    22601943{
    2261     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2262     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2263     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2264 
    22651944    process_t * process;
    22661945    bool_t      detailed;
     
    22771956    vmm_display( process , detailed );
    22781957
    2279     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2280     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2281     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2282 }
    2283 
    2284 
     1958}
     1959
     1960
  • trunk/kernel/kern/rpc.h

    r436 r437  
    22 * rpc.h - RPC (Remote Procedure Call) operations definition.
    33 *
    4  * Author  Alain Greiner (2016,2017)
     4 * Author  Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/kern/scheduler.c

    r436 r437  
    9797    list_entry_t * current;
    9898    list_entry_t * last;
     99    list_entry_t * root;
     100    bool_t         done;
    99101
    100102    // take lock protecting sheduler lists
    101103    spinlock_lock( &sched->lock );
    102104
    103     // first loop : scan the kernel threads list if not empty
     105    // first : scan the kernel threads list if not empty
    104106    if( list_is_empty( &sched->k_root ) == false )
    105107    {
     108        root    = &sched->k_root;
    106109        last    = sched->k_last;
    107         current = sched->k_last;
    108         do
     110        current = last;
     111        done    = false;
     112
     113        while( done == false )
    109114        {
    110115            // get next entry in kernel list
    111             current = list_next( &sched->k_root , current );
     116            current = current->next;
     117
     118            // check exit condition
     119            if( current == last ) done = true;
    112120
    113121            // skip the root that does not contain a thread
    114             if( current == NULL ) current = sched->k_root.next;
     122            if( current == root ) continue;
    115123
    116124            // get thread pointer for this entry
     
    120128            switch( thread->type )
    121129            {
    122                 case THREAD_IDLE: // skip IDLE thread
    123                 break;
    124 
    125                 case THREAD_RPC:  // RPC thread if non blocked and FIFO non-empty
     130                case THREAD_RPC:  // if non blocked and RPC FIFO non-empty
    126131                if( (thread->blocked == 0) &&
    127132                    (local_fifo_is_empty( &LOCAL_CLUSTER->rpc_fifo ) == 0) )
     
    132137                break;
    133138
    134                 default:          // DEV thread if non blocked and waiting queue non empty
     139                case THREAD_DEV:  // if non blocked and waiting queue non empty
    135140                if( (thread->blocked == 0) &&
    136141                    (xlist_is_empty( XPTR( local_cxy , &thread->chdev->wait_root)) == 0) )
     
    140145                }
    141146                break;
    142             }  // end switch type
    143         }
    144         while( current != last );
    145     }
    146 
    147     // second loop : scan the user threads list if not empty
     147
     148                default:
     149                break;
     150            }
     151        } // end loop on kernel threads
     152    } // end if kernel threads
     153
     154    // second : scan the user threads list if not empty
    148155    if( list_is_empty( &sched->u_root ) == false )
    149156    {
     157        root    = &sched->u_root;
    150158        last    = sched->u_last;
    151         current = sched->u_last;
    152         do
     159        current = last;
     160        done    = false;
     161
     162        while( done == false )
    153163        {
    154164            // get next entry in user list
    155             current = list_next( &sched->u_root , current );
     165            current = current->next;
     166
     167            // check exit condition
     168            if( current == last ) done = true;
    156169
    157170            // skip the root that does not contain a thread
    158             if( current == NULL ) current = sched->u_root.next;
     171            if( current == root ) continue;
    159172
    160173            // get thread pointer for this entry
     
    167180                return thread;
    168181            }
    169         }
    170         while( current != last );
    171     }
    172 
    173     // third : return idle thread if no runnable thread
     182        } // end loop on user threads
     183    } // end if user threads
     184
     185    // third : return idle thread if no other runnable thread
    174186    spinlock_unlock( &sched->lock );
    175187    return sched->idle;
     
    180192void sched_handle_signals( core_t * core )
    181193{
     194
    182195    list_entry_t * iter;
    183196    thread_t     * thread;
     
    214227            process = thread->process;
    215228
     229#if CONFIG_DEBUG_SCHED_HANDLE_SIGNALS
     230uint32_t cycle = (uint32_t)hal_get_cycles();
     231if( CONFIG_DEBUG_SCHED_HANDLE_SIGNALS < cycle )
     232printk("\n[DBG] %s : thread %x in proces %x must be deleted / cycle %d\n",
     233__FUNCTION__ , thread , process->pid , cycle );
     234#endif
    216235                // release FPU if required
    217236                if( thread->core->fpu_owner == thread )  thread->core->fpu_owner = NULL;
     
    232251
    233252#if CONFIG_DEBUG_SCHED_HANDLE_SIGNALS
    234 uint32_t cycle = (uint32_t)hal_get_cycles();
     253cycle = (uint32_t)hal_get_cycles();
    235254if( CONFIG_DEBUG_SCHED_HANDLE_SIGNALS < cycle )
    236 printk("\n[DBG] %s : thread %x deleted thread %x / cycle %d\n",
    237 __FUNCTION__ , CURRENT_THREAD , thread , cycle );
     255printk("\n[DBG] %s : thread %x in process %x has been deleted / cycle %d\n",
     256__FUNCTION__ , thread , process->pid , cycle );
    238257#endif
    239258            // destroy process descriptor if no more threads
     
    246265cycle = (uint32_t)hal_get_cycles();
    247266if( CONFIG_DEBUG_SCHED_HANDLE_SIGNALS < cycle )
    248 printk("\n[DBG] %s : thread %x deleted process %x / cycle %d\n",
    249 __FUNCTION__ , CURRENT_THREAD , process , cycle );
     267printk("\n[DBG] %s : process %x has been deleted / cycle %d\n",
     268__FUNCTION__ , process->pid , cycle );
    250269#endif
    251270
     
    374393    remote_spinlock_lock_busy( lock_xp , &save_sr );
    375394
    376     nolock_printk("\n***** scheduler state for core[%x,%d] / cycle %d / current = (%x,%x)\n",
    377             local_cxy , core->lid, (uint32_t)hal_get_cycles(),
    378             sched->current->process->pid , sched->current->trdid );
     395    nolock_printk("\n***** threads on core[%x,%d] / current %x / cycle %d\n",
     396            local_cxy , core->lid, sched->current, (uint32_t)hal_get_cycles() );
    379397
    380398    // display kernel threads
     
    390408        else
    391409        {
    392             nolock_printk(" - %s / pid %X / trdid %X / desc %X / block %X / flags %X \n",
     410            nolock_printk(" - %s / pid %X / trdid %X / desc %X / block %X / flags %X\n",
    393411            thread_type_str( thread->type ), thread->process->pid, thread->trdid,
    394             thread, thread->blocked, thread->flags  );
     412            thread, thread->blocked, thread->flags );
    395413        }
    396414    }
  • trunk/kernel/kern/scheduler.h

    r436 r437  
    4040typedef struct scheduler_s
    4141{
    42     spinlock_t        lock;            /*! readlock protecting lists of threads             */
     42    spinlock_t        lock;            /*! lock protecting lists of threads                 */
    4343    uint16_t          u_threads_nr;    /*! total number of attached user threads            */
    4444    uint16_t          k_threads_nr;    /*! total number of attached kernel threads          */
  • trunk/kernel/kern/thread.h

    r436 r437  
    150150    xptr_t              parent;          /*! extended pointer on parent thread        */
    151151
    152         uint32_t            local_locks;         /*! number of local locks owned by thread    */
    153         uint32_t            remote_locks;        /*! number of remote locks owned by thread   */
    154 
    155152    remote_spinlock_t   join_lock;       /*! lock protecting the join/exit            */
    156153    xptr_t              join_xp;         /*! joining/killer thread extended pointer   */
     
    197194    list_entry_t        locks_root;      /*! root of list of locks taken              */
    198195    xlist_entry_t       xlocks_root;     /*! root of xlist of remote locks taken      */
     196        uint32_t            local_locks;         /*! number of local locks owned by thread    */
     197        uint32_t            remote_locks;        /*! number of remote locks owned by thread   */
    199198
    200199        thread_info_t       info;            /*! embedded thread_info_t                   */
  • trunk/kernel/libk/list.h

    r24 r437  
    9797#define LIST_LAST( root , type , member )               \
    9898        LIST_ELEMENT( (root)->pred , type , member )
    99 
    100 /***************************************************************************
    101  * This function returns the pointer on the next list_entry_t.
    102  ***************************************************************************
    103  * @ root    : pointer on the list root.
    104  * @ current : pointer on the current list_entry_t.
    105  * @ returns pointer on next entry if success.
    106  *   returns NULL if list empty or next is the root.
    107  **************************************************************************/
    108 static inline list_entry_t * list_next( list_entry_t * root,
    109                                         list_entry_t * current )
    110 {
    111         if((root == root->next) || (current->next == root)) return NULL;
    112  
    113         return current->next;
    114 }
    115 
    116 /***************************************************************************
    117  * This function returns the pointer on the previous list_entry_t.
    118  ***************************************************************************
    119  * @ root    : pointer on the list root.
    120  * @ current : pointer on the current list_entry.
    121  * @ returns pointer on previous entry if success.
    122  *   returns NULL if list empty or previous is the root.
    123  **************************************************************************/
    124 static inline list_entry_t * list_pred( list_entry_t * root,
    125                                         list_entry_t * current )
    126 {
    127         if((root == root->next) || (current->pred == root))
    128                 return NULL;
    129  
    130         return current->pred;
    131 }
    13299
    133100/***************************************************************************
     
    211178                                  list_entry_t * entry )
    212179{
    213     list_add_first( root->pred , entry );
     180    list_entry_t * pred_entry;
     181    list_entry_t * next_entry;
     182
     183        pred_entry = root->pred;
     184        next_entry = root;
     185       
     186        entry->next = next_entry;
     187        entry->pred = pred_entry;
     188 
     189        pred_entry->next = entry;
     190        next_entry->pred = entry;
    214191}
    215192
  • trunk/kernel/mm/kcm.c

    r435 r437  
    33 *
    44 * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
    5  *         Alain Greiner    (2016,2017)
     5 *         Alain Greiner    (2016,2017,2018)
    66 *
    77 * Copyright (c) UPMC Sorbonne Universites
     
    239239        uint32_t  blocks_nr = (CONFIG_PPM_PAGE_SIZE - CONFIG_KCM_SLOT_SIZE) / block_size;
    240240        kcm->blocks_nr = blocks_nr;
    241 
    242         kcm_dmsg("\n[DBG] %s : KCM %s initialised / block_size = %d / blocks_nr = %d\n",
    243                  __FUNCTION__ , kmem_type_str( type ) , kcm->block_size , kcm->blocks_nr );
    244241}
    245242
  • trunk/kernel/mm/kcm.h

    r188 r437  
    33 *
    44 * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
    5  *          Alain Greiner    (2016)
     5 *          Alain Greiner    (2016,2017,2018)
    66 *
    77 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/mm/ppm.c

    r433 r437  
    5454
    5555    cxy_t    page_cxy = GET_CXY( page_xp );
    56     page_t * page_ptr = (page_t *)GET_PTR( page_xp );
     56    page_t * page_ptr = GET_PTR( page_xp );
    5757
    5858   void   * base_ptr = ppm->vaddr_base +
     
    6969
    7070    cxy_t    base_cxy = GET_CXY( base_xp );
    71     void   * base_ptr = (void *)GET_PTR( base_xp );
     71    void   * base_ptr = GET_PTR( base_xp );
    7272
    7373        page_t * page_ptr = ppm->pages_tbl +
     
    8686
    8787    cxy_t    page_cxy = GET_CXY( page_xp );
    88     page_t * page_ptr = (page_t *)GET_PTR( page_xp );
     88    page_t * page_ptr = GET_PTR( page_xp );
    8989
    9090    paddr_t  paddr    = PADDR( page_cxy , (page_ptr - ppm->pages_tbl)<<CONFIG_PPM_PAGE_SHIFT );
    9191
    92     return paddr >> CONFIG_PPM_PAGE_SHIFT;
     92    return (ppn_t)(paddr >> CONFIG_PPM_PAGE_SHIFT);
    9393
    9494}  // end hal_page2ppn()
     
    9797inline xptr_t ppm_ppn2page( ppn_t ppn )
    9898{
    99         ppm_t  * ppm      = &LOCAL_CLUSTER->ppm;
    100 
    101     paddr_t  paddr    = ppn << CONFIG_PPM_PAGE_SHIFT;
    102 
    103     cxy_t    page_cxy = CXY_FROM_PADDR( paddr );
    104     lpa_t    page_lpa = LPA_FROM_PADDR( paddr );
    105 
    106     return XPTR( page_cxy , &ppm->pages_tbl[page_lpa>>CONFIG_PPM_PAGE_SHIFT] );
     99        ppm_t   * ppm  = &LOCAL_CLUSTER->ppm;
     100
     101    paddr_t  paddr = ((paddr_t)ppn) << CONFIG_PPM_PAGE_SHIFT;
     102
     103    cxy_t    cxy  = CXY_FROM_PADDR( paddr );
     104    lpa_t    lpa  = LPA_FROM_PADDR( paddr );
     105
     106    return XPTR( cxy , &ppm->pages_tbl[lpa>>CONFIG_PPM_PAGE_SHIFT] );
    107107
    108108}  // end hal_ppn2page
     
    113113inline xptr_t ppm_ppn2base( ppn_t ppn )
    114114{
    115         ppm_t  * ppm      = &LOCAL_CLUSTER->ppm;
     115        ppm_t  * ppm   = &LOCAL_CLUSTER->ppm;
    116116   
    117     paddr_t  paddr    = ppn << CONFIG_PPM_PAGE_SHIFT;
    118 
    119     cxy_t    page_cxy = CXY_FROM_PADDR( paddr );
    120     lpa_t    page_lpa = LPA_FROM_PADDR( paddr );
    121 
    122     void   * base_ptr = (void *)ppm->vaddr_base + (page_lpa & ~CONFIG_PPM_PAGE_SHIFT);
    123  
    124         return XPTR( page_cxy , base_ptr );
     117    paddr_t  paddr = ((paddr_t)ppn) << CONFIG_PPM_PAGE_SHIFT;
     118
     119    cxy_t    cxy   = CXY_FROM_PADDR( paddr );
     120    lpa_t    lpa   = LPA_FROM_PADDR( paddr );
     121
     122        return XPTR( cxy , (void *)ppm->vaddr_base + lpa );
    125123
    126124}  // end ppm_ppn2base()
     
    132130
    133131    cxy_t    base_cxy = GET_CXY( base_xp );
    134     void   * base_ptr = (void *)GET_PTR( base_xp );
     132    void   * base_ptr = GET_PTR( base_xp );
    135133
    136134    paddr_t  paddr    = PADDR( base_cxy , (base_ptr - ppm->vaddr_base) );
    137135
    138     return paddr >> CONFIG_PPM_PAGE_SHIFT;
     136    return (ppn_t)(paddr >> CONFIG_PPM_PAGE_SHIFT);
    139137
    140138}  // end ppm_base2ppn()
  • trunk/kernel/mm/vmm.c

    r435 r437  
    673673#endif
    674674
     675#if (CONFIG_DEBUG_VMM_DESTROY & 1 )
     676vmm_display( process , true );
     677#endif
     678
    675679    // get pointer on local VMM
    676680    vmm_t  * vmm = &process->vmm;
     
    690694        vseg    = GET_PTR( vseg_xp );
    691695
    692         // unmap rand release physical pages if required)
     696#if( CONFIG_DEBUG_VMM_DESTROY & 1 )
     697if( CONFIG_DEBUG_VMM_DESTROY < cycle )
     698printk("\n[DBG] %s : %s / vpn_base %x / vpn_size %d\n",
     699__FUNCTION__ , vseg_type_str( vseg->type ), vseg->vpn_base, vseg->vpn_size );
     700#endif
     701
     702        // unmap and release physical pages
    693703        vmm_unmap_vseg( process , vseg );
    694704
     
    11201130        if( attr & GPT_MAPPED )  // entry is mapped
    11211131        {
     1132
     1133#if( CONFIG_DEBUG_VMM_UNMAP_VSEG & 1 )
     1134if( CONFIG_DEBUG_VMM_UNMAP_VSEG < cycle )
     1135printk("- vpn %x / ppn %x\n" , vpn , ppn );
     1136#endif
     1137
    11221138            // check small page
    11231139            assert( (attr & GPT_SMALL) , __FUNCTION__ ,
     
    11401156                // FIXME lock the physical page
    11411157
    1142                 // get extended pointer on pending forks counter
    1143                 forks_xp = XPTR( page_cxy , &page_ptr->forks );
    1144 
    11451158                // get pending forks counter
    1146                 count = hal_remote_lw( forks_xp );
     1159                count = hal_remote_lw( XPTR( page_cxy , &page_ptr->forks ) );
    11471160               
    11481161                if( count )  // decrement pending forks counter
    11491162                {
     1163                    forks_xp = XPTR( page_cxy , &page_ptr->forks );
    11501164                    hal_remote_atomic_add( forks_xp , -1 );
    11511165                } 
  • trunk/kernel/mm/vmm.h

    r433 r437  
    44 * Authors   Ghassan Almaless (2008,2009,2010,2011, 2012)
    55 *           Mohamed Lamine Karaoui (2015)
    6  *           Alain Greiner (2016,2017)
     6 *           Alain Greiner (2016,2017,2018)
    77 *
    88 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/syscalls/shared_syscalls.h

    r435 r437  
    6161        SYS_CLOSEDIR       = 25,
    6262        SYS_GETCWD         = 26,
    63         SYS_UNDEFINED_27   = 27,   ///
     63        SYS_ISATTY         = 27,
    6464        SYS_ALARM          = 28,   
    6565        SYS_RMDIR          = 29,
  • trunk/kernel/syscalls/sys_munmap.c

    r410 r437  
    33 *
    44 * Authors       Ghassan Almaless (2008,2009,2010,2011,2012)
    5  *               Alain Greiner (2016,2017)
     5 *               Alain Greiner (2016,2017,2018)
    66 *
    77 * Copyright (c) UPMC Sorbonne Universites
     
    4040    error_t       error;
    4141
    42         uint32_t      tm_start;
    43         uint32_t      tm_end;
    44 
    45         tm_start = hal_get_cycles();
    46 
    4742        thread_t    * this    = CURRENT_THREAD;
    4843        process_t   * process = this->process;
     44
     45#if CONFIG_DEBUG_SYS_MUNMAP
     46uint64_t tm_start;
     47uint64_t tm_end;
     48tm_start = hal_get_cycles();
     49if( CONFIG_DEBUG_SYS_MUNMAP < tm_start )
     50printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n"
     51__FUNCTION__ , this, process->pid, (uint32_t)tm_start );
     52#endif
    4953
    5054    // call relevant kernel function
     
    5357    if ( error )
    5458    {
    55         printk("\n[ERROR] in %s : cannot remove mapping\n", __FUNCTION__ );
     59
     60#if CONFIG_DEBUG_SYSCALLS_ERROR
     61printk("\n[ERROR] in %s : cannot remove mapping\n", __FUNCTION__ );
     62#endif
    5663                this->errno = EINVAL;
    5764                return -1;
    5865    }
    5966
    60     tm_end = hal_get_cycles();
     67#if CONFIG_DEBUG_SYS_MUNMAP
     68tm_end = hal_get_cycles();
     69if( CONFIG_DEBUG_SYS_MUNMAP < tm_start )
     70printk("\n[DBG] %s : thread %x exit / process %x / cycle %d\n"
     71__FUNCTION__ , this, process->pid, (uint32_t)tm_end );
     72#endif
    6173
    62 syscall_dmsg("\n[DBG] %s : core[%x,%d] removed vseg in process %x / cycle %d\n"
    63 "      base = %x / size = %x / cost = %d\n",
    64 __FUNCTION__, local_cxy , this->core->lid , process->pid , tm_start ,
    65 vaddr , size , tm_end - tm_start );
     74    return 0;
    6675
    67         return 0;
     76}  // end sys_munmap()
    6877
    69 }  // end sys_mmap()
    70 
  • trunk/kernel/syscalls/sys_thread_create.c

    r407 r437  
    22 * sys_thread_create.c - creates a new user thread
    33 *
    4  * Author     Alain Greiner (2016,2017)
     4 * Author     Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    5757        error_t          error;
    5858
    59         uint32_t         tm_start;
    60         uint32_t         tm_end;
    61 
    62         tm_start = hal_get_cycles();
    63 
    6459        // get parent thead pointer, extended pointer, and process
    6560        parent     = CURRENT_THREAD;
     
    6762        process    = parent->process;
    6863
     64#if CONFIG_DEBUG_SYS_THREAD_CREATE
     65uint64_t tm_start;
     66uint64_t tm_end;
     67tm_start = hal_get_cycles();
     68if( CONFIG_DEBUG_SYS_THREAD_CREATE < tm_start )
     69printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n"
     70__FUNCTION__ , parent , process->pid, (uint32_t)tm_start );
     71#endif
     72
    6973        // check user_attr in user space & copy to kernel space
    7074    if( user_attr != NULL )
     
    7478            if( error )
    7579            {
    76                     printk("\n[ERROR] in %s : user_attr unmapped\n", __FUNCTION__ );
     80
     81#if CONFIG_DEBUG_SYSCALLS_ERROR
     82printk("\n[ERROR] in %s : user_attr unmapped\n", __FUNCTION__ );
     83#endif
    7784                    parent->errno = EINVAL;
    7885                    return -1;
     
    8794        if( error )
    8895        {
    89                 printk("\n[ERROR] in %s : start_func unmapped\n", __FUNCTION__ );
     96
     97#if CONFIG_DEBUG_SYSCALLS_ERROR
     98printk("\n[ERROR] in %s : start_func unmapped\n", __FUNCTION__ );
     99#endif
    90100                parent->errno = EINVAL;
    91101                return -1;
     
    97107        if( error )
    98108        {
    99                 printk("\n[ERROR] in %s : start_arg unmapped\n", __FUNCTION__ );
     109
     110#if CONFIG_DEBUG_SYSCALLS_ERROR
     111printk("\n[ERROR] in %s : start_arg unmapped\n", __FUNCTION__ );
     112#endif
    100113                parent->errno = EINVAL;
    101114                return -1;
     
    110123                    if( cluster_is_undefined( kern_attr.cxy ) )
    111124                    {
    112                             printk("\n[ERROR] in %s : illegal target cluster = %x\n",
    113                             __FUNCTION__ , kern_attr.cxy );
     125
     126#if CONFIG_DEBUG_SYSCALLS_ERROR
     127printk("\n[ERROR] in %s : illegal target cluster = %x\n", __FUNCTION__ , kern_attr.cxy );
     128#endif
    114129                            parent->errno = EINVAL;
    115130                            return -1;
     
    158173        if( error )
    159174        {
    160                 printk("\n[ERROR] in %s : cannot create thread\n", __FUNCTION__ );
     175
     176#if CONFIG_DEBUG_SYSCALLS_ERROR
     177printk("\n[ERROR] in %s : cannot create thread\n", __FUNCTION__ );
     178#endif
    161179                return ENOMEM;
    162180        }
     
    178196    hal_fence();
    179197
    180         tm_end = hal_get_cycles();
    181 
    182 syscall_dmsg("\n[DBG] %s : core[%x,%d] created thread %x for process %x / cycle %d\n"
    183 "      cluster %x / cost = %d cycles\n",
    184 __FUNCTION__ , local_cxy , parent->core->lid , trdid , process->pid , tm_end ,
    185 target_cxy , tm_end - tm_start );
     198#if CONFIG_DEBUG_SYS_THREAD_CREATE
     199tm_end = hal_get_cycles();
     200if( CONFIG_DEBUG_SYS_THREAD_CREATE < tm_end )
     201printk("\n[DBG] %s : thread %x created thread %x for process %x in cluster %x / cycle %d\n"
     202__FUNCTION__, parent, child_ptr, process->pid, target_cxy, (uint32_t)tm_end );
     203#endif
    186204
    187205        return 0;
  • trunk/kernel/syscalls/syscalls.h

    r436 r437  
    356356
    357357/******************************************************************************************
    358  * [27] This slot is not used.
    359  *****************************************************************************************/
     358 * [27] This function tests whether a given file descriptor dentified by the <file_id>
     359 * argument is an open file descriptor referring to a terminal.
     360 ******************************************************************************************
     361 * @ file_id   : file descriptor index
     362 * @ return 1 if it is a TXT device / return 0 if it is not a TXT device.
     363 *****************************************************************************************/
     364int sys_isatty( uint32_t file_id );
    360365
    361366/******************************************************************************************
  • trunk/kernel_config.h

    r436 r437  
    3838
    3939
    40 #define CONFIG_DEBUG_CHDEV_REGISTER_COMMAND   0
    41 #define CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER  0
     40#define CONFIG_DEBUG_CHDEV_CMD_RX             0
     41#define CONFIG_DEBUG_CHDEV_CMD_TX             0
     42#define CONFIG_DEBUG_CHDEV_SERVER_RX          0
     43#define CONFIG_DEBUG_CHDEV_SERVER_TX          0
    4244
    4345#define CONFIG_DEBUG_CLUSTER_INIT             0
     
    4648#define CONFIG_DEBUG_DEV_TXT_RX               0
    4749#define CONFIG_DEBUG_DEV_TXT_TX               0
    48 #define CONFIG_DEBUG_DEV_IOC                  0
     50#define CONFIG_DEBUG_DEV_IOC_RX               0
     51#define CONFIG_DEBUG_DEV_IOC_TX               0
    4952#define CONFIG_DEBUG_DEV_NIC_RX               0
    5053#define CONFIG_DEBUG_DEV_NIC_RX               0
    51 #define CONFIG_DEBUG_DEV_FBF                  0
     54#define CONFIG_DEBUG_DEV_FBF_RX               0
     55#define CONFIG_DEBUG_DEV_FBF_TX               0
     56#define CONFIG_DEBUG_DEV_DMA                  0
    5257#define CONFIG_DEBUG_DEV_MMC                  0
     58#define CONFIG_DEBUG_DEV_PIC                  0
    5359
    5460#define CONFIG_DEBUG_DEVFS_INIT               0
     
    6268
    6369#define CONFIG_DEBUG_HAL_KENTRY               0
     70#define CONFIG_DEBUG_HAL_EXCEPTIONS           0
     71#define CONFIG_DEBUG_HAL_IRQS                 0       
    6472#define CONFIG_DEBUG_HAL_TXT_RX               0
    6573#define CONFIG_DEBUG_HAL_TXT_TX               0
    66 #define CONFIG_DEBUG_HAL_EXCEPTIONS           0
    67 #define CONFIG_DEBUG_HAL_IRQS                 0       
     74#define CONFIG_DEBUG_HAL_IOC_RX               0
     75#define CONFIG_DEBUG_HAL_IOC_TX               0
    6876
    6977#define CONFIG_DEBUG_KCM                      0
     
    8391#define CONFIG_DEBUG_PROCESS_DESTROY          0
    8492#define CONFIG_DEBUG_PROCESS_INIT_CREATE      0
    85 #define CONFIG_DEBUG_PROCESS_MAKE_EXEC        0
    86 #define CONFIG_DEBUG_PROCESS_MAKE_FORK        0
     93#define CONFIG_DEBUG_PROCESS_MAKE_EXEC        1
     94#define CONFIG_DEBUG_PROCESS_MAKE_FORK        1
    8795#define CONFIG_DEBUG_PROCESS_REFERENCE_INIT   0
    8896#define CONFIG_DEBUG_PROCESS_SIGACTION        0
     
    100108
    101109#define CONFIG_DEBUG_SYS_DISPLAY              0
    102 #define CONFIG_DEBUG_SYS_EXEC                 0
     110#define CONFIG_DEBUG_SYS_EXEC                 1
    103111#define CONFIG_DEBUG_SYS_EXIT                 0
    104112#define CONFIG_DEBUG_SYS_FG                   0
    105 #define CONFIG_DEBUG_SYS_FORK                 0
     113#define CONFIG_DEBUG_SYS_FORK                 1
    106114#define CONFIG_DEBUG_SYS_GET_CONFIG           0
    107 #define CONFIG_DEBUG_SYS_KILL                 0
     115#define CONFIG_DEBUG_SYS_ISATTY               0
     116#define CONFIG_DEBUG_SYS_KILL                 1
    108117#define CONFIG_DEBUG_SYS_MMAP                 0
    109118#define CONFIG_DEBUG_SYS_READ                 0
  • trunk/libs/malloc.c

    r426 r437  
    7676// This static function display the current state of the allocator in cluster <cxy>.
    7777////////////////////////////////////////////////////////////////////////////////////////////
     78
     79#if 0
    7880static void display_free_array( unsigned int cxy )
    7981{
     
    98100    }
    99101}  // end display_free_array()
     102#endif
    100103
    101104
  • trunk/params.mk

    r435 r437  
    33ARCH      = /users/alain/soc/tsar-trunk-svn-2013/platforms/tsar_generic_iob
    44X_SIZE    = 1
    5 Y_SIZE    = 1
     5Y_SIZE    = 2
    66NB_PROCS  = 1
    77NB_TTYS   = 3
  • trunk/user/init/init.c

    r436 r437  
    4141        if( ret_fork < 0 )   // error in fork
    4242        {
    43             // INIT display error message on TXT0 terminal
    44             snprintf( string , 64 , "INIT cannot fork child[%d]" , i );
     43            // INIT display error message
     44            snprintf( string , 64 , "INIT cannot fork child[%d] => suicide" , i );
    4545            display_string( string );
    4646
     
    5555            if ( ret_exec )   // error in exec             
    5656            {
    57                 // CHILD[i] display error message on TXT0 terminal
     57                // CHILD[i] display error message
    5858                snprintf( string , 64 ,
    5959                "CHILD[%d] cannot exec KSH[%d] / ret_exec = %d" , i , i , ret_exec );
     
    6868        }
    6969    }
     70
     71// display processes and threads in clusters 0 & 1
     72display_cluster_processes( 0 );
     73display_sched( 0 , 0 );
     74display_cluster_processes( 1 );
     75display_sched( 1 , 0 );
    7076
    7177    // This loop detects the termination of the KSH[i] processes,
     
    8894        if( WIFSIGNALED( status ) || WIFEXITED( status ) )  // killed => recreate it
    8995        {
    90             // display string to report unexpected KSH process termination
     96            // display string to report KSH process termination
    9197            snprintf( string , 64 , "KSH process %x terminated => recreate KSH", rcv_pid );
    9298            display_string( string );
     
    97103            if( ret_fork < 0 )                          // error in fork
    98104            {
    99                 // INIT display error message on TXT0 terminal
    100                 snprintf( string , 64 , "INIT cannot fork child");
     105                // INIT display error message
     106                snprintf( string , 64 , "INIT cannot fork child => suicide");
    101107                display_string( string );
    102108
  • trunk/user/ksh/ksh.c

    r436 r437  
    715715// @@@
    716716
    717 char string[64];
    718    
    719717        while (1)
    720718        {
Note: See TracChangeset for help on using the changeset viewer.