Changeset 406 for trunk/kernel


Ignore:
Timestamp:
Aug 29, 2017, 12:03:37 PM (7 years ago)
Author:
alain
Message:

This version executed successfully the user "init" process on a mono-processor TSAR architecture.

Location:
trunk/kernel
Files:
42 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/devices/dev_dma.c

    r296 r406  
    8888    thread_t * this = CURRENT_THREAD;
    8989
    90     dma_dmsg("\n[INFO] %s : enters for thread %x / dst = %l /src = %l / size = %x\n",
     90    dma_dmsg("\n[DMSG] %s : enters for thread %x / dst = %l /src = %l / size = %x\n",
    9191              __FUNCTION__ , this->trdid , dst_xp , src_xp , size );
    9292
     
    110110    chdev_register_command( dev_xp , this );
    111111
    112     dma_dmsg("\n[INFO] %s : completes for thread %x / error = %d\n",
     112    dma_dmsg("\n[DMSG] %s : completes for thread %x / error = %d\n",
    113113             __FUNCTION__ ,  this->trdid , this->dma_cmd.error );
    114114
  • trunk/kernel/devices/dev_fbf.c

    r279 r406  
    143143    }
    144144
    145     fbf_dmsg("\n[INFO] %s : thread %x in process %x / vaddr = %p / paddr = %l\n",
     145    fbf_dmsg("\n[DMSG] %s : thread %x in process %x / vaddr = %p / paddr = %l\n",
    146146             __FUNCTION__ , this->trdid , this->process->pid , buffer , buf_paddr );
    147147
  • trunk/kernel/devices/dev_ioc.c

    r401 r406  
    9999    thread_t * this = CURRENT_THREAD;              // pointer on client thread
    100100
    101     ioc_dmsg("\n[INFO] %s : thread %x in process %x"
     101    ioc_dmsg("\n[DMSG] %s : thread %x in process %x"
    102102             " for lba = %x / buffer = %x / at cycle %d\n",
    103103             __FUNCTION__ , this->trdid , this->process->pid ,
     
    128128    chdev_register_command( dev_xp , this );
    129129
    130     ioc_dmsg("\n[INFO] in %s : thread %x in process %x"
     130    ioc_dmsg("\n[DMSG] in %s : thread %x in process %x"
    131131             " completes / error = %d / at cycle %d\n",
    132132             __FUNCTION__ , this->trdid , this->process->pid ,
     
    162162    thread_t * this = CURRENT_THREAD;
    163163
    164     ioc_dmsg("\n[INFO] %s : core[%x,%d] enter for %d blocks / lba = %x / cycle %d\n",
     164    ioc_dmsg("\n[DMSG] %s : core[%x,%d] enter for %d blocks / lba = %x / cycle %d\n",
    165165    __FUNCTION__ , local_cxy , this->core->lid , count , lba , hal_time_stamp() );
    166166
     
    199199    dev_pic_enable_irq( lid , ioc_xp );
    200200
    201     ioc_dmsg("\n[INFO] %s : core[%x,%d] exit / error = %d / cycle %d\n",
     201    ioc_dmsg("\n[DMSG] %s : core[%x,%d] exit / error = %d / cycle %d\n",
    202202    __FUNCTION__ , local_cxy , this->core->lid , this->ioc_cmd.error , hal_time_stamp() );
    203203
  • trunk/kernel/devices/dev_mmc.c

    r279 r406  
    9999    thread_t * this = CURRENT_THREAD;
    100100
    101     mmc_dmsg("\n[INFO] %s enters for thread %x in process %x / buf_xp = %l\n",
     101    mmc_dmsg("\n[DMSG] %s enters for thread %x in process %x / buf_xp = %l\n",
    102102                 __FUNCTION__ , this->trdid , this->process->pid , buf_xp );
    103103
     
    124124    error = dev_mmc_access( this );
    125125
    126     mmc_dmsg("\n[INFO] %s completes for thread %x in process %x / error = %d\n",
     126    mmc_dmsg("\n[DMSG] %s completes for thread %x in process %x / error = %d\n",
    127127             __FUNCTION__ , this->trdid , this->process->pid , error );
    128128
     
    139139    thread_t * this = CURRENT_THREAD;
    140140
    141     mmc_dmsg("\n[INFO] %s enters for thread %x in process %x / buf_xp = %l\n",
     141    mmc_dmsg("\n[DMSG] %s enters for thread %x in process %x / buf_xp = %l\n",
    142142                 __FUNCTION__ , this->trdid , this->process->pid , buf_xp );
    143143
     
    164164    error = dev_mmc_access( this );
    165165
    166     mmc_dmsg("\n[INFO] %s completes for thread %x in process %x / error = %d\n",
     166    mmc_dmsg("\n[DMSG] %s completes for thread %x in process %x / error = %d\n",
    167167                 __FUNCTION__ , this->trdid , this->process->pid , error );
    168168
  • trunk/kernel/devices/dev_nic.c

    r296 r406  
    9797    core_t * core = thread_ptr->core;
    9898
    99     nic_dmsg("\n[INFO] %s enters for NIC-RX thread on core %d in cluster %x\n",
     99    nic_dmsg("\n[DMSG] %s enters for NIC-RX thread on core %d in cluster %x\n",
    100100                 __FUNCTION__ , core->lid , local_cxy );
    101101
     
    147147    pkd->length = thread_ptr->nic_cmd.length;
    148148
    149     nic_dmsg("\n[INFO] %s exit for NIC-RX thread on core %d in cluster %x\n",
     149    nic_dmsg("\n[DMSG] %s exit for NIC-RX thread on core %d in cluster %x\n",
    150150             __FUNCTION__ , core->lid , local_cxy );
    151151
     
    167167    core_t * core = thread_ptr->core;
    168168
    169     nic_dmsg("\n[INFO] %s enters for NIC-RX thread on core %d in cluster %x\n",
     169    nic_dmsg("\n[DMSG] %s enters for NIC-RX thread on core %d in cluster %x\n",
    170170                 __FUNCTION__ , core->lid , local_cxy );
    171171
     
    215215    if( error ) return error;
    216216
    217     nic_dmsg("\n[INFO] %s exit for NIC-TX thread on core %d in cluster %x\n",
     217    nic_dmsg("\n[DMSG] %s exit for NIC-TX thread on core %d in cluster %x\n",
    218218             __FUNCTION__ , core->lid , local_cxy );
    219219
  • trunk/kernel/devices/dev_pic.c

    r337 r406  
    8383                         xptr_t  src_chdev_xp )
    8484{
    85     irq_dmsg("\n[INFO] %s : core = [%x,%d] / source_chdev_xp = %l\n",
    86              __FUNCTION__ , local_cxy , lid , src_chdev_xp );
     85    irq_dmsg("\n[DMSG] %s : core = [%x,%d] / src_chdev_cxy = %x / src_chdev_ptr = %x\n",
     86    __FUNCTION__ , local_cxy , lid , GET_CXY(src_chdev_xp) , GET_PTR(src_chdev_xp) );
    8787
    8888    // get pointer on PIC chdev
     
    101101                          xptr_t  src_chdev_xp )
    102102{
    103     irq_dmsg("\n[INFO] %s : core = [%x,%d] / source_chdev_xp = %l\n",
    104              __FUNCTION__ , local_cxy , lid , src_chdev_xp );
     103    irq_dmsg("\n[DMSG] %s : core = [%x,%d] / src_chdev_cxy = %x / src_chdev_ptr = %x\n",
     104    __FUNCTION__ , local_cxy , lid , GET_CXY(src_chdev_xp) , GET_PTR(src_chdev_xp) );
    105105
    106106    // get pointer on PIC chdev
     
    118118void dev_pic_enable_timer( uint32_t period )
    119119{
    120     irq_dmsg("\n[INFO] %s : core = [%x,%d] / period = %d\n",
    121              __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , period );
     120    irq_dmsg("\n[DMSG] %s : core = [%x,%d] / period = %d\n",
     121    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , period );
    122122
    123123    // get pointer on PIC chdev
     
    135135void dev_pic_enable_ipi()
    136136{
    137     irq_dmsg("\n[INFO] %s : core = [%x,?]\n",
    138              __FUNCTION__ , local_cxy );
     137    irq_dmsg("\n[DMSG] %s : core = [%x,%d]\n",
     138    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid );
    139139
    140140    // get pointer on PIC chdev
     
    153153                       lid_t  lid )
    154154{
    155     irq_dmsg("\n[INFO] %s : enter / src_core = [%x,%d] / dst_core = [%x,%d] / cycle %d\n",
    156              __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, cxy, lid, hal_time_stamp() );
     155    irq_dmsg("\n[DMSG] %s : enter / src_core = [%x,%d] / dst_core = [%x,%d] / cycle %d\n",
     156    __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, cxy, lid, hal_time_stamp() );
    157157
    158158    // get pointer on PIC chdev
     
    166166    f( cxy , lid );
    167167
    168     irq_dmsg("\n[INFO] %s : exit / src_core = [%x,%d] / dst_core = [%x,%d] / cycle %d\n",
    169              __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, cxy, lid, hal_time_stamp() );
     168    irq_dmsg("\n[DMSG] %s : exit / src_core = [%x,%d] / dst_core = [%x,%d] / cycle %d\n",
     169    __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, cxy, lid, hal_time_stamp() );
    170170}
    171171
  • trunk/kernel/devices/dev_pic.h

    r279 r406  
    212212/*****************************************************************************************
    213213 * This function activates the TIM_IRQ for the calling core.
    214  * The <period> argument define the number of cycles between twoo successive IRQs.
    215  *****************************************************************************************
    216  * @ period      : number of cycles between IRQs.
     214 * The <period> argument is a number of milli-seconds between two successive IRQs.
     215 * It is converted to a number of cycles by the PIC driver implementation.
     216 *****************************************************************************************
     217 * @ period      : number of milliseconds.
    217218 ****************************************************************************************/
    218219void dev_pic_enable_timer( uint32_t period );
  • trunk/kernel/devices/dev_txt.c

    r296 r406  
    101101    thread_t * this = CURRENT_THREAD;
    102102
    103     txt_dmsg("\n[INFO] in %s : thread %x in process %x enters\n",
     103    txt_dmsg("\n[DMSG] in %s : thread %x in process %x enters\n",
    104104                 __FUNCTION__ , this->trdid , this->process->pid );
    105105
     
    123123    chdev_register_command( dev_xp , this );
    124124
    125     txt_dmsg("\n[INFO] in %s : thread %x in process %x completes / error = %d\n",
     125    txt_dmsg("\n[DMSG] in %s : thread %x in process %x completes / error = %d\n",
    126126             __FUNCTION__ , this->trdid , this->process->pid , this->txt_cmd.error );
    127127
  • trunk/kernel/kern/cluster.c

    r374 r406  
    8282        spinlock_init( &cluster->kcm_lock );
    8383
    84     cluster_dmsg("\n[INFO] %s for cluster %x enters\n",
     84    cluster_dmsg("\n[DMSG] %s for cluster %x enters\n",
    8585                 __FUNCTION__ , local_cxy );
    8686
     
    102102    }
    103103
    104     cluster_dmsg("\n[INFO] %s : PPM initialized in cluster %x at cycle %d\n",
     104    cluster_dmsg("\n[DMSG] %s : PPM initialized in cluster %x at cycle %d\n",
    105105                 __FUNCTION__ , local_cxy , hal_get_cycles() );
    106106
     
    108108        khm_init( &cluster->khm );
    109109
    110     cluster_dmsg("\n[INFO] %s : KHM initialized in cluster %x at cycle %d\n",
     110    cluster_dmsg("\n[DMSG] %s : KHM initialized in cluster %x at cycle %d\n",
    111111                 __FUNCTION__ , local_cxy , hal_get_cycles() );
    112112
     
    114114        kcm_init( &cluster->kcm , KMEM_KCM );
    115115
    116     cluster_dmsg("\n[INFO] %s : KCM initialized in cluster %x at cycle %d\n",
     116    cluster_dmsg("\n[DMSG] %s : KCM initialized in cluster %x at cycle %d\n",
    117117                 __FUNCTION__ , local_cxy , hal_get_cycles() );
    118118
     
    125125        }
    126126
    127     cluster_dmsg("\n[INFO] %s : cores initialized in cluster %x at cycle %d\n",
     127    cluster_dmsg("\n[DMSG] %s : cores initialized in cluster %x at cycle %d\n",
    128128                 __FUNCTION__ , local_cxy , hal_get_cycles() );
    129129
     
    132132    cluster->rpc_threads = 0;
    133133
    134     cluster_dmsg("\n[INFO] %s : RPC fifo inialized in cluster %x at cycle %d\n",
     134    cluster_dmsg("\n[DMSG] %s : RPC fifo inialized in cluster %x at cycle %d\n",
    135135                 __FUNCTION__ , local_cxy , hal_get_cycles() );
    136136
     
    157157    }
    158158
    159     cluster_dmsg("\n[INFO] %s Process Manager initialized in cluster %x at cycle %d\n",
     159    cluster_dmsg("\n[DMSG] %s Process Manager initialized in cluster %x at cycle %d\n",
    160160                 __FUNCTION__ , local_cxy , hal_get_cycles() );
    161161
  • trunk/kernel/kern/core.c

    r380 r406  
    113113        if( (ticks % CONFIG_SCHED_TICKS_PER_QUANTUM) == 0 ) sched_yield( NULL );
    114114
    115         // update DQDT TODO  This update should depend on the cluster identifier,
    116         // to avoid simultaneous updates from various clusters ... AG
     115        // update DQDT
    117116        if( ((ticks % CONFIG_DQDT_TICKS_PER_QUANTUM) == 0) && (core->lid == 0) )
    118117        dqdt_global_update();
  • trunk/kernel/kern/do_syscall.c

    r375 r406  
    116116        }
    117117
    118         syscall_dmsg("\n[INFO] %s : pid = %x / trdid = %x / service #%d\n"
     118        syscall_dmsg("\n[DMSG] %s : pid = %x / trdid = %x / service #%d\n"
    119119                 "         arg0 = %x / arg1 = %x / arg2 = %x / arg3 = %x\n",
    120120                         __FUNCTION__ , this->process->pid , this->trdid , service_num ,
  • trunk/kernel/kern/dqdt.c

    r374 r406  
    6060        for ( i = 0 ; i < 4 ; i++ )
    6161        {
    62             if ( local_node.children[i] != XPTR_NULL ) dqdt_global_print( local_node.children[i] );
     62            if ( local_node.children[i] != XPTR_NULL )
     63                dqdt_global_print( local_node.children[i] );
    6364        }
    6465    }
     
    7071                    uint32_t y_width )
    7172{
    72     if( (x_size > 32) || (y_size > 32) )
    73     {
    74         panic("illegal mesh size for DQDT support");
    75     }
     73    assert( ((x_size <= 32) && (y_size <= 32)) , __FUNCTION__ , "illegal mesh size\n");
    7674
    7775        dqdt_node_t * node;
  • trunk/kernel/kern/kernel_init.c

    r401 r406  
    137137           "    /_/        \\_\\ |______| |_|    |_|   \\_____/  |______/        |_|    |_|  |_|  \\_\\ |_|   |_|  \n"
    138138           "\n\n\t\t Advanced Locality Management Operating System / Multi Kernel Hybrid\n"
    139            "\n\n\t\t\t Version 0.0 : %d cluster(s)   /  %d core(s) per cluster\n\n", nclusters , ncores );
     139           "\n\n\t\t\t Version 0.0 / %d cluster(s) / %d core(s) per cluster\n\n", nclusters , ncores );
    140140}
    141141
     
    274274
    275275#if( CONFIG_KINIT_DEBUG > 1 )
    276 printk("\n[INFO] %s : created MMC in cluster %x / chdev = %x\n",
     276printk("\n[DMSG] %s : created MMC in cluster %x / chdev = %x\n",
    277277__FUNCTION__ , channel , local_cxy , chdev_ptr );
    278278#endif
     
    302302
    303303#if( CONFIG_KINIT_DEBUG > 1 )
    304 printk("\n[INFO] %s : created DMA[%d] in cluster %x / chdev = %x\n",
     304printk("\n[DMSG] %s : created DMA[%d] in cluster %x / chdev = %x\n",
    305305__FUNCTION__ , channel , local_cxy , chdev_ptr );
    306306#endif
     
    436436
    437437#if( CONFIG_KINIT_DEBUG > 1 )
    438 printk("\n[INFO] %s : create chdev %s[%d] in cluster %x / chdev = %x\n",
     438printk("\n[DMSG] %s : create chdev %s[%d] in cluster %x / chdev = %x\n",
    439439__FUNCTION__ , chdev_func_str( func ), channel , local_cxy , chdev );
    440440#endif
     
    554554
    555555#if( CONFIG_KINIT_DEBUG > 1 )
    556 printk("\n[INFO] %s created PIC chdev in cluster %x at cycle %d\n",
     556printk("\n[DMSG] %s created PIC chdev in cluster %x at cycle %d\n",
    557557__FUNCTION__ , local_cxy , (uint32_t)hal_time_stamp() );
    558558#endif
     
    728728
    729729    if( (core_lid ==  0) && (local_cxy == 0) )
    730     kinit_dmsg("\n[INFO] %s : exit barrier 0 : TXT0 initialized / cycle %d\n",
     730    printk("\n[KINIT] %s : exit barrier 0 : TXT0 initialized / cycle %d\n",
    731731    __FUNCTION__, hal_time_stamp() );
    732732
     
    762762
    763763    if( (core_lid ==  0) && (local_cxy == 0) )
    764     kinit_dmsg("\n[INFO] %s : exit barrier 1 : clusters initialised / cycle %d\n",
     764    printk("\n[KINIT] %s : exit barrier 1 : clusters initialised / cycle %d\n",
    765765    __FUNCTION__, hal_time_stamp() );
    766766
     
    787787
    788788    if( (core_lid ==  0) && (local_cxy == 0) )
    789     kinit_dmsg("\n[INFO] %s : exit barrier 2 : PIC initialised / cycle %d\n",
     789    printk("\n[KINIT] %s : exit barrier 2 : PIC initialised / cycle %d\n",
    790790    __FUNCTION__, hal_time_stamp() );
    791791
     
    818818
    819819    if( (core_lid ==  0) && (local_cxy == 0) )
    820     kinit_dmsg("\n[INFO] %s : exit barrier 3 : all chdev initialised / cycle %d\n",
     820    printk("\n[KINIT] %s : exit barrier 3 : all chdev initialised / cycle %d\n",
    821821               __FUNCTION__, hal_time_stamp());
    822822
     
    829829    /////////////////////////////////////////////////////////////////////////////////
    830830
    831 #if( CONFIG_KINIT_DEBUG > 1 )
     831#if CONFIG_KINIT_DEBUG
    832832chdev_dir_display();
    833833#endif
     
    856856    core->scheduler.idle = thread;
    857857
    858 #if( CONFIG_KINIT_DEBUG > 1 )
     858#if CONFIG_KINIT_DEBUG
    859859sched_display();
    860860#endif
     
    928928
    929929    if( (core_lid ==  0) && (local_cxy == 0) )
    930     kinit_dmsg("\n[INFO] %s : exit barrier 4 : VFS_root = %l in cluster 0 / cycle %d\n",
     930    printk("\n[KINIT] %s : exit barrier 4 : VFS_root = %l in cluster 0 / cycle %d\n",
    931931               __FUNCTION__, vfs_root_inode_xp , hal_time_stamp());
    932932
     
    987987
    988988    if( (core_lid ==  0) && (local_cxy == 0) )
    989     kinit_dmsg("\n[INFO] %s : exit barrier 5 : VFS_root = %l in cluster IO / cycle %d\n",
     989    printk("\n[KINIT] %s : exit barrier 5 : VFS_root = %l in cluster IO / cycle %d\n",
    990990    __FUNCTION__, vfs_root_inode_xp , hal_time_stamp() );
    991991
     
    10201020
    10211021    if( (core_lid ==  0) && (local_cxy == 0) )
    1022     kinit_dmsg("\n[INFO] %s : exit barrier 6 : dev_root = %l in cluster IO / cycle %d\n",
     1022    printk("\n[KINIT] %s : exit barrier 6 : dev_root = %l in cluster IO / cycle %d\n",
    10231023    __FUNCTION__, devfs_dev_inode_xp , hal_time_stamp() );
    10241024
     
    10571057
    10581058    if( (core_lid ==  0) && (local_cxy == 0) )
    1059     kinit_dmsg("\n[INFO] %s : exit barrier 7 : dev_root = %l in cluster 0 / cycle %d\n",
     1059    printk("\n[KINIT] %s : exit barrier 7 : dev_root = %l in cluster 0 / cycle %d\n",
    10601060    __FUNCTION__, devfs_dev_inode_xp , hal_time_stamp() );
    10611061
     
    10761076
    10771077    if( (core_lid ==  0) && (local_cxy == 0) )
    1078     kinit_dmsg("\n[INFO] %s : exit barrier 8 : process init created / cycle %d\n",
     1078    printk("\n[KINIT] %s : exit barrier 8 : process init created / cycle %d\n",
    10791079    __FUNCTION__ , hal_time_stamp() );
    10801080
     
    10871087        print_banner( (info->x_size * info->y_size) , info->cores_nr );
    10881088
     1089#if CONFIG_KINIT_DEBUG
     1090
    10891091        vfs_display( vfs_root_inode_xp );
    1090        
    1091         kinit_dmsg("\n\n***** memory fooprint for main kernel objects\n\n"
     1092
     1093        printk("\n\n***** memory fooprint for main kernel objects\n\n"
    10921094                   " - thread descriptor  : %d bytes\n"
    10931095                   " - process descriptor : %d bytes\n"
     
    11301132                   sizeof( rwlock_t          ),
    11311133                   sizeof( remote_rwlock_t   ));
     1134#endif
     1135
    11321136    }
    11331137
  • trunk/kernel/kern/printk.c

    r372 r406  
    327327            case ('l'):            /* 64 bits hexadecimal unsigned */
    328328            {
    329                 uint64_t val = va_arg( *args , uint64_t );
     329                unsigned long long val = va_arg( *args , unsigned long long );
    330330                txt_write( channel, busy, "0x" , 2 );
    331331                for(i = 0; i < 16; i++)
     
    340340            case ('L'):           /* 64 bits hexadecimal unsigned on 18 char */
    341341            {
    342                 uint64_t val = va_arg( *args , uint64_t );
     342                unsigned long long val = va_arg( *args , unsigned long long );
    343343                txt_write( channel, busy, "0x" , 2 );
    344344                for(i = 0; i < 16; i++)
  • trunk/kernel/kern/printk.h

    r389 r406  
    109109
    110110#if CONFIG_CLUSTER_DEBUG
    111 #define cluster_dmsg(...)   printk(__VA_ARGS__)
     111#define cluster_dmsg(...)   if(hal_time_stamp() > CONFIG_CLUSTER_DEBUG) printk(__VA_ARGS__)
    112112#else
    113113#define cluster_dmsg(...)
     
    115115
    116116#if CONFIG_CONTEXT_DEBUG
    117 #define context_dmsg(...)   printk(__VA_ARGS__)
     117#define context_dmsg(...)   if(hal_time_stamp() > CONFIG_CONTEXT_DEBUG) printk(__VA_ARGS__)
    118118#else
    119119#define context_dmsg(...)
     
    121121
    122122#if CONFIG_CORE_DEBUG
    123 #define core_dmsg(...)   printk(__VA_ARGS__)
     123#define core_dmsg(...)   if(hal_time_stamp() > CONFIG_CORE_DEBUG) printk(__VA_ARGS__)
    124124#else
    125125#define core_dmsg(...)
     
    127127
    128128#if CONFIG_DEVFS_DEBUG
    129 #define devfs_dmsg(...)   printk(__VA_ARGS__)
     129#define devfs_dmsg(...)   if(hal_time_stamp() > CONFIG_DEVFS_DEBUG) printk(__VA_ARGS__)
    130130#else
    131131#define devfs_dmsg(...)
     
    133133
    134134#if CONFIG_DMA_DEBUG
    135 #define dma_dmsg(...)   printk(__VA_ARGS__)
     135#define dma_dmsg(...)   if(hal_time_stamp() > CONFIG_DMA_DEBUG) printk(__VA_ARGS__)
    136136#else
    137137#define dma_dmsg(...)
     
    139139
    140140#if CONFIG_DQDT_DEBUG
    141 #define dma_dmsg(...)   printk(__VA_ARGS__)
    142 #else
    143 #define dma_dmsg(...)
    144 #endif
    145 
    146 #if CONFIG_DQDT_DEBUG
    147 #define dqdt_dmsg(...)   printk(__VA_ARGS__)
     141#define dqdt_dmsg(...)   if(hal_time_stamp() > CONFIG_DQDT_DEBUG) printk(__VA_ARGS__)
    148142#else
    149143#define dqdt_dmsg(...)
     
    151145
    152146#if CONFIG_ELF_DEBUG
    153 #define elf_dmsg(...)   printk(__VA_ARGS__)
     147#define elf_dmsg(...)   if(hal_time_stamp() > CONFIG_ELF_DEBUG) printk(__VA_ARGS__)
    154148#else
    155149#define elf_dmsg(...)
     
    157151
    158152#if CONFIG_EXEC_DEBUG
    159 #define exec_dmsg(...)   printk(__VA_ARGS__)
     153#define exec_dmsg(...)   if(hal_time_stamp() > CONFIG_EXEC_DEBUG) printk(__VA_ARGS__)
    160154#else
    161155#define exec_dmsg(...)
    162156#endif
    163157
     158#if CONFIG_EXCP_DEBUG
     159#define excp_dmsg(...)   if(hal_time_stamp() > CONFIG_EXCP_DEBUG) printk(__VA_ARGS__)
     160#else
     161#define excp_dmsg(...)
     162#endif
     163
    164164#if CONFIG_FATFS_DEBUG
    165 #define fatfs_dmsg(...)   printk(__VA_ARGS__)
     165#define fatfs_dmsg(...)   if(hal_time_stamp() > CONFIG_FATFS_DEBUG) printk(__VA_ARGS__)
    166166#else
    167167#define fatfs_dmsg(...)
     
    169169
    170170#if CONFIG_FBF_DEBUG
    171 #define fbf_dmsg(...)   printk(__VA_ARGS__)
     171#define fbf_dmsg(...)   if(hal_time_stamp() > CONFIG_FBF_DEBUG) printk(__VA_ARGS__)
    172172#else
    173173#define fbf_dmsg(...)
     
    175175
    176176#if CONFIG_FORK_DEBUG
    177 #define fork_dmsg(...)   printk(__VA_ARGS__)
     177#define fork_dmsg(...)   if(hal_time_stamp() > CONFIG_FORK_DEBUG) printk(__VA_ARGS__)
    178178#else
    179179#define fork_dmsg(...)
    180180#endif
    181181
     182#if CONFIG_GPT_DEBUG
     183#define gpt_dmsg(...)   if(hal_time_stamp() > CONFIG_GPT_DEBUG) printk(__VA_ARGS__)
     184#else
     185#define gpt_dmsg(...)
     186#endif
     187
    182188#if CONFIG_IDLE_DEBUG
    183 #define idle_dmsg(...) printk(__VA_ARGS__)
     189#define idle_dmsg(...)   if(hal_time_stamp() > CONFIG_IDLE_DEBUG) printk(__VA_ARGS__)
    184190#else
    185191#define idle_dmsg(...)
     
    193199
    194200#if CONFIG_IRQ_DEBUG
    195 #define irq_dmsg(...)   printk(__VA_ARGS__)
     201#define irq_dmsg(...)   if(hal_time_stamp() > CONFIG_IRQ_DEBUG) printk(__VA_ARGS__)
    196202#else
    197203#define irq_dmsg(...)
     
    199205
    200206#if CONFIG_KCM_DEBUG
    201 #define kcm_dmsg(...) printk(__VA_ARGS__)
     207#define kcm_dmsg(...)   if(hal_time_stamp() > CONFIG_KCM_DEBUG) printk(__VA_ARGS__)
    202208#else
    203209#define kcm_dmsg(...)
     
    205211
    206212#if CONFIG_KHM_DEBUG
    207 #define khm_dmsg(...) printk(__VA_ARGS__)
     213#define khm_dmsg(...)   if(hal_time_stamp() > CONFIG_KHM_DEBUG) printk(__VA_ARGS__)
    208214#else
    209215#define khm_dmsg(...)
     
    211217
    212218#if CONFIG_KINIT_DEBUG
    213 #define kinit_dmsg(...) printk(__VA_ARGS__)
     219#define kinit_dmsg(...)   if(hal_time_stamp() > CONFIG_KINIT_DEBUG) printk(__VA_ARGS__)
    214220#else
    215221#define kinit_dmsg(...)
     
    217223
    218224#if CONFIG_KMEM_DEBUG
    219 #define kmem_dmsg(...) printk(__VA_ARGS__)
     225#define kmem_dmsg(...)   if(hal_time_stamp() > CONFIG_KMEM_DEBUG) printk(__VA_ARGS__)
    220226#else
    221227#define kmem_dmsg(...)
     
    223229
    224230#if CONFIG_MAPPER_DEBUG
    225 #define mapper_dmsg(...)   printk(__VA_ARGS__)
     231#define mapper_dmsg(...)   if(hal_time_stamp() > CONFIG_MAPPER_DEBUG) printk(__VA_ARGS__)
    226232#else
    227233#define mapper_dmsg(...)
     
    229235
    230236#if CONFIG_MMC_DEBUG
    231 #define mmc_dmsg(...)   printk(__VA_ARGS__)
     237#define mmc_dmsg(...)   if(hal_time_stamp() > CONFIG_MMC_DEBUG) printk(__VA_ARGS__)
    232238#else
    233239#define mmc_dmsg(...)
     
    235241
    236242#if CONFIG_NIC_DEBUG
    237 #define nic_dmsg(...)   printk(__VA_ARGS__)
     243#define nic_dmsg(...)   if(hal_time_stamp() > CONFIG_NIC_DEBUG) printk(__VA_ARGS__)
    238244#else
    239245#define nic_dmsg(...)
     
    241247
    242248#if CONFIG_PIC_DEBUG
    243 #define pic_dmsg(...)   printk(__VA_ARGS__)
     249#define pic_dmsg(...)   if(hal_time_stamp() > CONFIG_PIC_DEBUG) printk(__VA_ARGS__)
    244250#else
    245251#define pic_dmsg(...)
     
    247253
    248254#if CONFIG_PPM_DEBUG
    249 #define ppm_dmsg(...)   printk(__VA_ARGS__)
     255#define ppm_dmsg(...)   if(hal_time_stamp() > CONFIG_PPM_DEBUG) printk(__VA_ARGS__)
    250256#else
    251257#define ppm_dmsg(...)
     
    253259
    254260#if CONFIG_PROCESS_DEBUG
    255 #define process_dmsg(...)   printk(__VA_ARGS__)
     261#define process_dmsg(...)   if(hal_time_stamp() > CONFIG_PROCESS_DEBUG) printk(__VA_ARGS__)
    256262#else
    257263#define process_dmsg(...)
     
    264270#endif
    265271
    266 #if CONFIG_RPCG_DEBUG
    267 #define rpcg_dmsg(...)   printk(__VA_ARGS__)
    268 #else
    269 #define rpcg_dmsg(...)
    270 #endif
    271 
    272272#if CONFIG_SCHED_DEBUG
    273 #define sched_dmsg(...)   printk(__VA_ARGS__)
     273#define sched_dmsg(...)   if(hal_time_stamp() > CONFIG_SCHED_DEBUG) printk(__VA_ARGS__)
    274274#else
    275275#define sched_dmsg(...)
     
    277277
    278278#if CONFIG_SIGNAL_DEBUG
    279 #define signal_dmsg(...)   printk(__VA_ARGS__)
     279#define signal_dmsg(...)   if(hal_time_stamp() > CONFIG_SIGNAL_DEBUG) printk(__VA_ARGS__)
    280280#else
    281281#define signal_dmsg(...)
     
    283283
    284284#if CONFIG_SYSCALL_DEBUG
    285 #define syscall_dmsg(...)   printk(__VA_ARGS__)
     285#define syscall_dmsg(...)   if(hal_time_stamp() > CONFIG_SYSCALL_DEBUG) printk(__VA_ARGS__)
    286286#else
    287287#define syscall_dmsg(...)
     
    289289
    290290#if CONFIG_THREAD_DEBUG
    291 #define thread_dmsg(...)   printk(__VA_ARGS__)
     291#define thread_dmsg(...)   if(hal_time_stamp() > CONFIG_THREAD_DEBUG) printk(__VA_ARGS__)
    292292#else
    293293#define thread_dmsg(...)
     
    295295
    296296#if CONFIG_TXT_DEBUG
    297 #define txt_dmsg(...)   printk(__VA_ARGS__)
     297#define txt_dmsg(...)   if(hal_time_stamp() > CONFIG_TXT_DEBUG) printk(__VA_ARGS__)
    298298#else
    299299#define txt_dmsg(...)
     
    307307
    308308#if CONFIG_VMM_DEBUG
    309 #define vmm_dmsg(...)   printk(__VA_ARGS__)
     309#define vmm_dmsg(...)   if(hal_time_stamp() > CONFIG_VMM_DEBUG) printk(__VA_ARGS__)
    310310#else
    311311#define vmm_dmsg(...)
  • trunk/kernel/kern/process.c

    r380 r406  
    9090    pid_t       parent_pid;
    9191
    92     process_dmsg("\n[INFO] %s : enters for process %x in cluster %x\n",
    93                  __FUNCTION__ , pid , local_cxy );
     92    process_dmsg("\n[DMSG] %s : core[%x,%d] enters for process %x\n",
     93    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , pid );
    9494
    9595    // get parent process cluster, local pointer, and pid
     
    116116    process->ppid  = parent_pid;
    117117
    118     // reset reference process vmm (not for kernel process)
     118    // initialize reference process vmm (not for kernel process)
    119119    if( pid ) vmm_init( process );
    120120
     
    169169        hal_fence();
    170170
    171     process_dmsg("\n[INFO] %s : exit for process %x in cluster %x\n",
     171    process_dmsg("\n[DMSG] %s : exit for process %x in cluster %x\n",
    172172                 __FUNCTION__ , pid );
    173173
     
    198198    local_process->ref_xp = reference_process_xp;
    199199
    200     process_dmsg("\n[INFO] %s : enter for process %x in cluster %x\n",
     200    process_dmsg("\n[DMSG] %s : enter for process %x in cluster %x\n",
    201201                 __FUNCTION__ , local_process->pid );
    202202
     
    233233        hal_fence();
    234234
    235     process_dmsg("\n[INFO] %s : exit for process %x in cluster %x\n",
     235    process_dmsg("\n[DMSG] %s : exit for process %x in cluster %x\n",
    236236                 __FUNCTION__ , local_process->pid );
    237237
     
    288288    vmm_destroy( process );
    289289
    290         process_dmsg("\n[INFO] %s for pid %d / page_faults = %d\n",
     290        process_dmsg("\n[DMSG] %s for pid %d / page_faults = %d\n",
    291291                 __FUNCTION__ , process->pid, process->vmm.pgfault_nr );
    292292}
     
    627627    parent_pid = hal_remote_lw( XPTR( parent_cxy , &parent_ptr->pid ) );
    628628
    629     exec_dmsg("\n[INFO] %s : thread %x on core[%x,%d] enters for path = %s\n",
     629    exec_dmsg("\n[DMSG] %s : thread %x on core[%x,%d] enters for path = %s\n",
    630630    __FUNCTION__, CURRENT_THREAD->trdid, local_cxy, CURRENT_THREAD->core->lid , path );
    631631
     
    654654    process_reference_init( process , pid , parent_xp );
    655655
    656     exec_dmsg("\n[INFO] %s : thread %x on core[%x,%d] created process %x / path = %s\n",
     656    exec_dmsg("\n[DMSG] %s : thread %x on core[%x,%d] created process %x / path = %s\n",
    657657    __FUNCTION__, CURRENT_THREAD->trdid, local_cxy, CURRENT_THREAD->core->lid, pid, path );
    658658
     
    670670                            XPTR( parent_cxy , &parent_ptr->fd_array) );
    671671
    672     exec_dmsg("\n[INFO] %s : fd_array copied from process %x to process %x\n",
     672    exec_dmsg("\n[DMSG] %s : fd_array copied from process %x to process %x\n",
    673673    __FUNCTION__, parent_pid , pid );
    674674
     
    688688        }
    689689
    690     exec_dmsg("\n[INFO] %s : code and data vsegs registered for process %x / path = %s\n",
     690    exec_dmsg("\n[DMSG] %s : code and data vsegs registered for process %x / path = %s\n",
    691691    __FUNCTION__ , pid , path );
    692692
     
    714714        }
    715715
    716         exec_dmsg("\n[INFO] %s : thread created for process %x on core %d in cluster %x\n",
     716        exec_dmsg("\n[DMSG] %s : thread created for process %x on core %d in cluster %x\n",
    717717               __FUNCTION__ , pid , core->lid , local_cxy );
     718
     719#if CONFIG_EXEC_DEBUG
     720if( hal_time_stamp() > CONFIG_EXEC_DEBUG )
     721{
     722    grdxt_print( &process->vmm.grdxt , GRDXT_TYPE_VSEG , process->pid );
     723    hal_gpt_print( &process->vmm.gpt , process->pid );
     724}
     725#endif
    718726
    719727    // update children list in parent process
     
    725733        thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_GLOBAL );
    726734
    727     exec_dmsg("\n[INFO] %s : exit for process %x\n",
     735    exec_dmsg("\n[DMSG] %s : exit for process %x\n",
    728736                __FUNCTION__, process->pid );
    729737
     
    747755    uint32_t  stderr_id;
    748756
    749         process_dmsg("\n[INFO] %s : enters in cluster %x\n", __FUNCTION__ , local_cxy );
     757        process_dmsg("\n[DMSG] %s : enters in cluster %x\n", __FUNCTION__ , local_cxy );
    750758
    751759    // open stdin / stdout / stderr pseudo-files
     
    771779        assert( (error1 == 0) , __FUNCTION__ , "cannot create process_init\n");
    772780
    773         process_dmsg("\n[INFO] %s : exit in cluster %x\n", __FUNCTION__ , local_cxy );
     781        process_dmsg("\n[DMSG] %s : exit in cluster %x\n", __FUNCTION__ , local_cxy );
    774782               
    775783    hal_fence();
  • trunk/kernel/kern/rpc.c

    r389 r406  
    9797                                page_t  ** page )      // out
    9898{
    99     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     99    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    100100    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    101101    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    117117    *page    = (page_t *)(intptr_t)rpc.args[1];
    118118
    119     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     119    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    120120    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    121121    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    125125void rpc_pmem_get_pages_server( xptr_t xp )
    126126{
    127     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     127    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    128128    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    129129    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    142142    hal_remote_swd( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
    143143
    144     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     144    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    145145    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    146146    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    157157                                   pid_t     * pid )     // out
    158158{
    159     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     159    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    160160    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    161161    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    178178    *error  = (error_t)rpc.args[2];     
    179179
    180     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     180    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    181181    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    182182    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    190190    pid_t       pid;       // output : process identifier
    191191
    192     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     192    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    193193    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    194194    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    209209    hal_remote_sw( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)pid );
    210210
    211     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     211    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    212212    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    213213    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    224224                              error_t     * error )   // out
    225225{
    226     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     226    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    227227    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    228228    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    244244    *error  = (error_t)rpc.args[1];     
    245245
    246     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     246    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    247247    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    248248    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    256256    error_t       error;     // local error error status
    257257
    258     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     258    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    259259    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    260260    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    278278    hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
    279279
    280     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     280    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    281281    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    282282    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    291291void rpc_process_kill_client( process_t * process )
    292292{
    293     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     293    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    294294    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    295295    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    325325    }
    326326
    327     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     327    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    328328    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    329329    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    336336    process_t * process; 
    337337
    338     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     338    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    339339    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    340340    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    360360    }
    361361
    362     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     362    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    363363    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    364364    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    379379                                    error_t        * error )      // out
    380380{
    381     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     381    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    382382    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    383383    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    403403    *error     = (error_t)rpc.args[5];
    404404
    405     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     405    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    406406    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    407407    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    421421    error_t          error;
    422422
    423     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     423    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    424424    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    425425    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    456456    hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp );
    457457
    458     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     458    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    459459    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    460460    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    473473                                      error_t * error )      // out
    474474{
    475     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     475    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    476476    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    477477    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    496496    *error     = (error_t)rpc.args[4];
    497497
    498     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     498    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    499499    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    500500    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    509509    error_t          error;   
    510510
    511     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     511    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    512512    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    513513    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    533533    hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp );
    534534
    535     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     535    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    536536    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    537537    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    547547                             uint32_t    sig_id )    // in
    548548{
    549     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     549    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    550550    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    551551    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    565565    rpc_send_sync( cxy , &rpc );
    566566
    567     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     567    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    568568    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    569569    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    576576    uint32_t     sig_id;   // signal index
    577577
    578     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     578    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    579579    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    580580    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    591591    signal_rise( process , sig_id );
    592592
    593     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     593    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    594594    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    595595    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    613613                                  error_t      * error )     // out
    614614{
    615     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     615    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    616616    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    617617    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    641641    *error    = (error_t)rpc.args[9];
    642642
    643     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     643    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    644644    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    645645    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    660660    error_t          error;
    661661
    662     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     662    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    663663    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    664664    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    693693    hal_remote_swd( XPTR( client_cxy , &desc->args[9] ) , (uint64_t)error );
    694694
    695     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     695    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    696696    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    697697    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    706706                                   struct vfs_inode_s * inode )
    707707{
    708     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     708    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    709709    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    710710    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    723723    rpc_send_sync( cxy , &rpc );
    724724
    725     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     725    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    726726    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    727727    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    733733    vfs_inode_t * inode;
    734734
    735     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     735    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    736736    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    737737    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    747747    vfs_inode_destroy( inode );
    748748
    749     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     749    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    750750    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    751751    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    764764                                   error_t              * error )       // out
    765765{
    766     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     766    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    767767    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    768768    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    787787    *error     = (error_t)rpc.args[4];
    788788
    789     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     789    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    790790    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    791791    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    803803    char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
    804804
    805     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     805    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    806806    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    807807    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    829829    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
    830830
    831     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     831    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    832832    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    833833    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    843843                                    vfs_dentry_t * dentry )
    844844{
    845     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     845    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    846846    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    847847    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    860860    rpc_send_sync( cxy , &rpc );
    861861
    862     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     862    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    863863    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    864864    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    870870    vfs_dentry_t * dentry;
    871871
    872     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     872    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    873873    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    874874    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    884884    vfs_dentry_destroy( dentry );
    885885
    886     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     886    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    887887    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    888888    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    901901                                 error_t              * error )      // out
    902902{
    903     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     903    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    904904    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    905905    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    923923    *error   = (error_t)rpc.args[3];
    924924
    925     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     925    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    926926    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    927927    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    936936    error_t       error;
    937937
    938     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     938    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    939939    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    940940    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    957957    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    958958
    959     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     959    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    960960    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    961961    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    970970                                  vfs_file_t * file )
    971971{
    972     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     972    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    973973    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    974974    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    987987    rpc_send_sync( cxy , &rpc );
    988988
    989     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     989    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    990990    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    991991    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    997997    vfs_file_t * file;
    998998
    999     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     999    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    10001000    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    10011001    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    10111011    vfs_file_destroy( file );
    10121012
    1013     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1013    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    10141014    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    10151015    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    10271027                                error_t     * error )          // out
    10281028{
    1029     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1029    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    10301030    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    10311031    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    10491049    *error   = (error_t)rpc.args[3];
    10501050
    1051     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1051    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    10521052    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    10531053    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    10641064    char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
    10651065
    1066     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1066    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    10671067    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    10681068    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    10871087    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    10881088
    1089     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1089    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    10901090    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    10911091    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    11011101                                     error_t     * error )     // out
    11021102{
    1103     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1103    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    11041104    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    11051105    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    11211121    *error   = (error_t)rpc.args[1];
    11221122
    1123     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1123    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    11241124    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    11251125    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    11321132    vfs_inode_t * inode;
    11331133
    1134     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1134    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    11351135    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    11361136    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    11491149    hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
    11501150
    1151     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1151    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    11521152    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    11531153    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    11661166                                   error_t  * error )    // out
    11671167{
    1168     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1168    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    11691169    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    11701170    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    11891189    *error   = (error_t)rpc.args[4];
    11901190
    1191     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1191    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    11921192    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    11931193    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    12031203    error_t       error;
    12041204
    1205     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1205    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    12061206    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    12071207    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    12231223    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
    12241224
    1225     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1225    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    12261226    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    12271227    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    12391239                              error_t   * error )      // out
    12401240{
    1241     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1241    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    12421242    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    12431243    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    12611261    *error   = (error_t)rpc.args[3];
    12621262
    1263     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1263    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    12641264    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    12651265    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    12751275    error_t       error;
    12761276
    1277     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1277    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    12781278    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    12791279    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    12951295    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    12961296
    1297     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1297    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    12981298    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    12991299    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    13131313                             error_t   * error )   // out
    13141314{
    1315     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1315    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    13161316    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    13171317    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    13361336    *error = (error_t)rpc.args[4];
    13371337
    1338     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1338    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    13391339    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    13401340    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    13501350    error_t       error;
    13511351
    1352     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1352    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    13531353    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    13541354    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    13701370    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
    13711371
    1372     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1372    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    13731373    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    13741374    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    13841384                           xptr_t *   buf_xp )     // out
    13851385{
    1386     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1386    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    13871387    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    13881388    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    14041404    *buf_xp = (xptr_t)rpc.args[1];
    14051405
    1406     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1406    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    14071407    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    14081408    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    14121412void rpc_kcm_alloc_server( xptr_t xp )
    14131413{
    1414     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1414    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    14151415    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    14161416    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    14331433    hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)buf_xp );
    14341434
    1435     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1435    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    14361436    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    14371437    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    14471447                          uint32_t   kmem_type )   // in
    14481448{
    1449     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1449    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    14501450    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    14511451    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    14651465    rpc_send_sync( cxy , &rpc );
    14661466
    1467     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1467    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    14681468    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    14691469    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    14731473void rpc_kcm_free_server( xptr_t xp )
    14741474{
    1475     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1475    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    14761476    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    14771477    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    14911491    kmem_free( &req );
    14921492
    1493     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1493    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    14941494    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    14951495    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    15101510                                    error_t  * error )        // out
    15111511{
    1512     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1512    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    15131513    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    15141514    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    15351535    *error     = (error_t)rpc.args[6];
    15361536
    1537     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1537    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    15381538    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    15391539    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    15521552    error_t    error;
    15531553
    1554     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1554    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    15551555    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    15561556    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    15921592    hal_remote_swd( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error );
    15931593
    1594     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1594    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    15951595    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    15961596    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    16071607                                 page_t         ** page )      // out
    16081608{
    1609     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1609    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    16101610    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    16111611    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    16281628    *page = (page_t *)(intptr_t)rpc.args[2];
    16291629
    1630     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1630    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    16311631    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    16321632    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    16361636void rpc_mapper_get_page_server( xptr_t xp )
    16371637{
    1638     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1638    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    16391639    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    16401640    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    16541654    hal_remote_swd( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
    16551655
    1656     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     1656    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    16571657    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    16581658    CURRENT_THREAD->core->lid , hal_time_stamp() );
     
    16731673    reg_t      sr_save;
    16741674
    1675     rpcg_dmsg("\n[INFO] %s : enter / client_cxy = %x / server_cxy = %x / cycle %d\n",
     1675    rpc_dmsg("\n[DMSG] %s : enter / client_cxy = %x / server_cxy = %x / cycle %d\n",
    16761676    __FUNCTION__ , local_cxy , server_cxy , hal_time_stamp() );
    16771677
     
    17001700    while( error );
    17011701 
    1702     rpcg_dmsg("\n[INFO] %s : RPC %l registered / server_cxy = %x / cycle %d\n",
     1702    rpc_dmsg("\n[DMSG] %s : RPC %l registered / server_cxy = %x / cycle %d\n",
    17031703    __FUNCTION__ , desc_xp , server_cxy , hal_time_stamp() );
    17041704       
     
    17141714                    dev_pic_send_ipi( server_cxy , 0 );
    17151715
    1716                     rpcg_dmsg("\n[INFO] %s : IPI sent / client_cxy = %x / server_cxy = %x\n",
     1716                    rpc_dmsg("\n[DMSG] %s : IPI sent / client_cxy = %x / server_cxy = %x\n",
    17171717            __FUNCTION__, local_cxy , server_cxy );
    17181718        }
     
    17291729        hal_restore_irq( sr_save );
    17301730
    1731     rpcg_dmsg("\n[INFO] %s : completed / client_cxy = %x / server_cxy = %x / cycle %d\n",
     1731    rpc_dmsg("\n[DMSG] %s : completed / client_cxy = %x / server_cxy = %x / cycle %d\n",
    17321732    __FUNCTION__ , local_cxy , server_cxy , hal_time_stamp() );
    17331733
     
    17641764        count = 0;
    17651765
    1766     rpcg_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1766    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    17671767    __FUNCTION__, this->trdid, local_cxy, core->lid , hal_time_stamp() );
    17681768 
     
    17811781                index = hal_remote_lw( XPTR( client_cxy , &desc->index ) );
    17821782
    1783             rpcg_dmsg("\n[INFO] %s : thread %x on core [%x,%d] / rpc = %d\n",
     1783            rpc_dmsg("\n[DMSG] %s : thread %x on core [%x,%d] / rpc = %d\n",
    17841784                     __FUNCTION__ , this->trdid , core->lid , local_cxy , index );
    17851785
     
    18501850        thread->blocked = 0;
    18511851
    1852         rpcg_dmsg("\n[INFO] %s : activate RPC thread %x on core [%x,%d] / cycle %d\n",
     1852        rpc_dmsg("\n[DMSG] %s : activate RPC thread %x on core [%x,%d] / cycle %d\n",
    18531853                          __FUNCTION__ , thread , core->gid , local_cxy , hal_time_stamp() );
    18541854    }
     
    18751875            hal_atomic_add( &LOCAL_CLUSTER->rpc_threads , 1 );
    18761876
    1877         rpcg_dmsg("\n[INFO] %s : create RPC thread %x on core [%x,%d] / cycle %d\n",
     1877        rpc_dmsg("\n[DMSG] %s : create RPC thread %x on core [%x,%d] / cycle %d\n",
    18781878                          __FUNCTION__ , thread->trdid, local_cxy, core->lid, hal_time_stamp() );
    18791879    }
     
    19001900    error_t      error;
    19011901
    1902     rpcg_dmsg("\n[INFO] %s : enter / thread %x / cluster %x / cycle %d\n",
     1902    rpc_dmsg("\n[DMSG] %s : enter / thread %x / cluster %x / cycle %d\n",
    19031903             __FUNCTION__ , this->trdid , local_cxy , hal_time_stamp() );
    19041904
     
    19061906        if( (rpc_fifo->owner != 0) || (local_fifo_is_empty( &rpc_fifo->fifo )) )
    19071907    {
    1908         rpcg_dmsg("\n[INFO] %s : exit do nothing / thread %x / cluster %x / cycle %d\n",
     1908        rpc_dmsg("\n[DMSG] %s : exit do nothing / thread %x / cluster %x / cycle %d\n",
    19091909                 __FUNCTION__ , this->trdid , local_cxy , hal_time_stamp() );
    19101910
     
    19261926        }
    19271927
    1928         rpcg_dmsg("\n[INFO] %s : exit after RPC thread activation / "
     1928        rpc_dmsg("\n[DMSG] %s : exit after RPC thread activation / "
    19291929                 "thread %x / cluster %x / cycle %d\n",
    19301930                 __FUNCTION__ , this->trdid , local_cxy , hal_time_stamp() );
     
    19341934    else  // light lock taken by another thread
    19351935    {
    1936         rpcg_dmsg("\n[INFO] %s : exit do nothing / thread %x / cluster %x / cycle %d\n",
     1936        rpc_dmsg("\n[DMSG] %s : exit do nothing / thread %x / cluster %x / cycle %d\n",
    19371937                 __FUNCTION__ , this->trdid , local_cxy , hal_time_stamp() );
    19381938
     
    19511951        rpc_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo;
    19521952
    1953     rpcg_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     1953    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    19541954             __FUNCTION__, this->trdid, local_cxy, this->core->lid, hal_time_stamp() );
    19551955
     
    19751975                if( LOCAL_CLUSTER->rpc_threads >= CONFIG_RPC_THREADS_MAX )
    19761976                {
    1977             rpcg_dmsg("\n[INFO] %s : RPC thread %x on core[%x,%d] suicide / cycle %d\n",
     1977            rpc_dmsg("\n[DMSG] %s : RPC thread %x on core[%x,%d] suicide / cycle %d\n",
    19781978                    __FUNCTION__, this->trdid, local_cxy, this->core->lid, hal_time_stamp() );
    19791979
     
    19861986        else
    19871987        {
    1988             rpcg_dmsg("\n[INFO] %s : RPC thread %x on core[%x,%d] blocks / cycle %d\n",
     1988            rpc_dmsg("\n[DMSG] %s : RPC thread %x on core[%x,%d] blocks / cycle %d\n",
    19891989                        __FUNCTION__, this->trdid, local_cxy, this->core->lid, hal_time_stamp() );
    19901990
     
    19921992            sched_yield( NULL );
    19931993
    1994                     rpcg_dmsg("\n[INFO] %s : RPC thread %x wake up on core[%x,%d] / cycle %d\n",
     1994                    rpc_dmsg("\n[DMSG] %s : RPC thread %x wake up on core[%x,%d] / cycle %d\n",
    19951995                __FUNCTION__, this->trdid, local_cxy, this->core->lid, hal_time_stamp() );
    19961996        }
  • trunk/kernel/kern/scheduler.c

    r374 r406  
    154154    scheduler_t * sched = &core->scheduler;
    155155
    156     sched_dmsg("\n[INFO] %s : enter core[%x,%d] / cycle %d\n",
     156    sched_dmsg("\n[DMSG] %s : enter core[%x,%d] / cycle %d\n",
    157157    __FUNCTION__ , local_cxy , core->lid , hal_time_stamp() );
    158158
     
    185185                spinlock_unlock( &sched->lock );
    186186
    187                 sched_dmsg("\n[INFO] %s : exit core[%x,%d] / k_thread = %x / cycle %d\n",
     187                sched_dmsg("\n[DMSG] %s : exit core[%x,%d] / k_thread = %x / cycle %d\n",
    188188                __FUNCTION__ , local_cxy , core->lid , thread->trdid , hal_time_stamp() );
    189189
     
    216216                spinlock_unlock( &sched->lock );
    217217
    218                 sched_dmsg("\n[INFO] %s : exit core[%x,%d] / u_thread = %x / cycle %d\n",
     218                sched_dmsg("\n[DMSG] %s : exit core[%x,%d] / u_thread = %x / cycle %d\n",
    219219                __FUNCTION__ , local_cxy , core->lid , thread->trdid , hal_time_stamp() );
    220220                return thread;
     
    227227    spinlock_unlock( &sched->lock );
    228228
    229     sched_dmsg("\n[INFO] %s : exit core[%x,%d] / idle = %x / cycle %d\n",
     229    sched_dmsg("\n[DMSG] %s : exit core[%x,%d] / idle = %x / cycle %d\n",
    230230    __FUNCTION__ , local_cxy , core->lid , sched->idle->trdid , hal_time_stamp() );
    231231
     
    242242    scheduler_t  * sched = &core->scheduler;
    243243
    244     sched_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d]\n",
     244    sched_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d]\n",
    245245    __FUNCTION__, CURRENT_THREAD->trdid , local_cxy , core->lid );
    246246
     
    265265    spinlock_unlock( &sched->lock );
    266266
    267     sched_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d]\n",
     267    sched_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d]\n",
    268268    __FUNCTION__, CURRENT_THREAD->trdid , local_cxy , core->lid );
    269269
     
    279279    scheduler_t * sched   = &core->scheduler;
    280280
    281     sched_dmsg("\n[INFO] %s : thread %x on core[%x,%d] enter / cycle %d\n",
     281    sched_dmsg("\n[DMSG] %s : thread %x on core[%x,%d] enter / cycle %d\n",
    282282    __FUNCTION__, current->trdid, local_cxy, core->lid, hal_time_stamp() );
    283283
     
    304304        if( next != current )
    305305    {
    306         sched_dmsg("\n[INFO] %s : trd %x (%s) on core[%x,%d] => trd %x (%s) / cycle %d\n",
     306        sched_dmsg("\n[DMSG] %s : trd %x (%s) on core[%x,%d] => trd %x (%s) / cycle %d\n",
    307307        __FUNCTION__, current->trdid, thread_type_str(current->type), local_cxy, core->lid,
    308308        next->trdid, thread_type_str(next->type), hal_time_stamp() );
     
    331331    else
    332332    {
    333         sched_dmsg("\n[INFO] %s : thread %x on core[%x,%d] continue / cycle %d\n",
     333        sched_dmsg("\n[DMSG] %s : thread %x on core[%x,%d] continue / cycle %d\n",
    334334        __FUNCTION__, current->trdid, local_cxy, core->lid, hal_time_stamp() );
    335335    }
  • trunk/kernel/kern/signal.c

    r23 r406  
    4444                hal_atomic_or( &thread->signals , (1 << sig_id) );
    4545
    46         signal_dmsg("\n[INFO] %s : thread %x in process %x received signal %d\n",
     46        signal_dmsg("\n[DMSG] %s : thread %x in process %x received signal %d\n",
    4747                    __FUNCTION__, thread->trdid , process->pid , sig_id );
    4848        }
     
    5959        thread_s * this = CURRENT_THREAD;
    6060
    61         printk("\n[INFO] %s : threadReceived signal %d, pid %d, tid %x, core %d  [ KILLED ]\n",
     61        printk("\n[DMSG] %s : threadReceived signal %d, pid %d, tid %x, core %d  [ KILLED ]\n",
    6262               sig,
    6363               this->process->pid,
  • trunk/kernel/kern/thread.c

    r374 r406  
    221221    vseg_t       * vseg;         // stack vseg
    222222
    223     thread_dmsg("\n[INFO] %s : enters for process %x\n", __FUNCTION__ , pid );
     223    thread_dmsg("\n[DMSG] %s : enters for process %x\n", __FUNCTION__ , pid );
    224224
    225225    // get process descriptor local copy
     
    311311    }
    312312
    313     thread_dmsg("\n[INFO] %s : exit / trdid = %x / process %x / core = %d\n",
     313    thread_dmsg("\n[DMSG] %s : exit / trdid = %x / process %x / core = %d\n",
    314314                __FUNCTION__ , thread->trdid , process->pid , core_lid );
    315315
     
    328328        vseg_t       * vseg;         // stack vseg
    329329
    330     thread_dmsg("\n[INFO] %s : enters\n", __FUNCTION__ );
     330    thread_dmsg("\n[DMSG] %s : enters\n", __FUNCTION__ );
    331331
    332332    // allocate a stack from local VMM
     
    398398    }
    399399
    400     thread_dmsg("\n[INFO] %s : exit / thread %x for process %x on core %d in cluster %x\n",
     400    thread_dmsg("\n[DMSG] %s : exit / thread %x for process %x on core %d in cluster %x\n",
    401401                 __FUNCTION__, thread->trdid, process->pid, core_lid, local_cxy );
    402402
     
    416416        thread_t     * thread;       // pointer on new thread descriptor
    417417
    418     thread_dmsg("\n[INFO] %s : enter / for type %s on core[%x,%d] / cycle %d\n",
     418    thread_dmsg("\n[DMSG] %s : enter / for type %s on core[%x,%d] / cycle %d\n",
    419419    __FUNCTION__ , thread_type_str( type ) , local_cxy , core_lid , hal_time_stamp() );
    420420
     
    449449        hal_cpu_context_create( thread );
    450450
    451     thread_dmsg("\n[INFO] %s : exit / trdid = %x / type = %s / core = [%x,%d] / cycle %d\n",
     451    thread_dmsg("\n[DMSG] %s : exit / trdid = %x / type = %s / core = [%x,%d] / cycle %d\n",
    452452    __FUNCTION__ , thread->trdid , thread_type_str(type) ,
    453453    local_cxy , core_lid , hal_time_stamp() );
     
    502502    core_t     * core       = thread->core;
    503503
    504     thread_dmsg("\n[INFO] %s : enters for thread %x in process %x / type = %s\n",
     504    thread_dmsg("\n[DMSG] %s : enters for thread %x in process %x / type = %s\n",
    505505                __FUNCTION__ , thread->trdid , process->pid , thread_type_str( thread->type ) );
    506506
     
    556556        tm_end = hal_get_cycles();
    557557
    558         thread_dmsg("\n[INFO] %s : exit for thread %x in process %x / duration = %d\n",
     558        thread_dmsg("\n[DMSG] %s : exit for thread %x in process %x / duration = %d\n",
    559559                       __FUNCTION__, thread->trdid , process->pid , tm_end - tm_start );
    560560}
     
    732732    while( 1 )
    733733    {
    734         idle_dmsg("\n[INFO] %s : core[%x][%d] goes to sleep at cycle %d\n",
     734        idle_dmsg("\n[DMSG] %s : core[%x][%d] goes to sleep at cycle %d\n",
    735735                    __FUNCTION__ , local_cxy , lid , hal_get_cycles() );
    736736
     
    738738        //hal_core_sleep();
    739739
    740         idle_dmsg("\n[INFO] %s : core[%x][%d] wake up at cycle %d\n",
     740        idle_dmsg("\n[DMSG] %s : core[%x][%d] wake up at cycle %d\n",
    741741                    __FUNCTION__ , local_cxy , lid , hal_get_cycles() );
    742742
  • trunk/kernel/kern/thread.h

    r367 r406  
    158158 * This TRDID is computed by the process_register_thread() function, when the user
    159159 * thread is registered in the local copy of the process descriptor.
     160 *
     161 * WARNING : Don't modify the first 4 fields order, as this order is used by the
     162 * hal_kentry assembly code for the TSAR architecture.
    160163 **************************************************************************************/
    161164
     
    164167typedef struct thread_s
    165168{
    166     void              * cpu_uzone;       /*! used for exception/interrupt/syscall     */
    167169        void              * cpu_context;     /*! used for context switch                  */
    168170        void              * fpu_context;     /*! used for dynamic FPU allocation          */
     171
     172        intptr_t            k_stack_base;    /*! kernel stack base address                */
     173        uint32_t            k_stack_size;    /*! kernel stack size (bytes)                */
    169174
    170175        uint32_t            trdid;           /*! thread index (cxy.ltid)                  */
     
    189194        intptr_t            u_stack_base;    /*! user stack base address                  */
    190195        uint32_t            u_stack_size;    /*! user stack size (bytes)                  */
    191         intptr_t            k_stack_base;    /*! kernel stack base address                */
    192         uint32_t            k_stack_size;    /*! kernel stack size (bytes)                */
    193196
    194197    void              * entry_func;      /*! pointer on entry function                */
  • trunk/kernel/libk/elf.c

    r401 r406  
    2424#include <kernel_config.h>
    2525#include <hal_types.h>
     26#include <hal_special.h>
    2627#include <hal_uspace.h>
    2728#include <printk.h>
    2829#include <process.h>
     30#include <thread.h>
     31#include <mapper.h>
    2932#include <vseg.h>
    3033#include <kmem.h>
     
    165168                        type                       = VSEG_TYPE_CODE;
    166169                        process->vmm.code_vpn_base = vbase >> CONFIG_PPM_PAGE_SHIFT;
    167 
    168                         elf_dmsg("\n[INFO] %s : found CODE vseg / base = %x / size = %x\n",
    169                                  __FUNCTION__ , vbase , mem_size );
    170170                }
    171171                else               // found DATA segment
     
    173173                        type                       = VSEG_TYPE_DATA;
    174174                        process->vmm.data_vpn_base = vbase >> CONFIG_PPM_PAGE_SHIFT;
    175 
    176                         elf_dmsg("\n[INFO] %s : found DATA vseg / base = %x / size = %x\n",
    177                                  __FUNCTION__, vbase , mem_size );
    178175                }
    179176
     
    194191        vfs_file_t * file_ptr = (vfs_file_t *)GET_PTR( file_xp );
    195192
     193        // get local pointer on .elf file mapper
     194        mapper_t * mapper_ptr = (mapper_t *)hal_remote_lpt( XPTR( file_cxy ,
     195                                                                  &file_ptr->mapper ) );
     196
    196197        // initialize "file_mapper", "file_offset", "file_size" fields in vseg
    197         vseg->mapper_xp   = (xptr_t)hal_remote_lwd( XPTR( file_cxy , &file_ptr->mapper ) );
     198        vseg->mapper_xp   = XPTR( file_cxy , mapper_ptr );
    198199        vseg->file_offset = file_offset;
    199200        vseg->file_size   = file_size;
     
    201202        // update reference counter in file descriptor
    202203                vfs_file_count_up( file_xp );
     204
     205                elf_dmsg("\n[DMSG] %s : found %s vseg / base = %x / size = %x\n"
     206                 "       file_size = %x / file_offset = %x / mapper_xp = %l\n",
     207            __FUNCTION__ , vseg_type_str(vseg->type) , vseg->min , vseg->max - vseg->min ,
     208        vseg->file_size , vseg->file_offset , vseg->mapper_xp );
    203209        }
    204210
     
    219225        error_t      error;
    220226
    221     elf_dmsg("\n[INFO] %s : core[%x,%d] enter for <%s>\n",
     227    elf_dmsg("\n[DMSG] %s : core[%x,%d] enter for <%s>\n",
    222228    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , pathname );
    223229
     
    239245        }
    240246
    241     elf_dmsg("\n[INFO] %s : open file <%s>\n", __FUNCTION__ , pathname );
     247    elf_dmsg("\n[DMSG] %s : open file <%s>\n", __FUNCTION__ , pathname );
    242248
    243249        // load header in local buffer
     
    252258        }
    253259
    254         elf_dmsg("\n[INFO] %s : loaded elf header for %s\n", __FUNCTION__ , pathname );
     260        elf_dmsg("\n[DMSG] %s : loaded elf header for %s\n", __FUNCTION__ , pathname );
    255261
    256262        if( header.e_phnum == 0 )
     
    289295        }
    290296
    291         elf_dmsg("\n[INFO] %s : segments array allocated for %s\n", __FUNCTION__ , pathname );
     297        elf_dmsg("\n[DMSG] %s : segments array allocated for %s\n", __FUNCTION__ , pathname );
    292298
    293299        // load seg descriptors array to local buffer
     
    306312        }
    307313
    308         elf_dmsg("\n[INFO] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname );
     314        elf_dmsg("\n[DMSG] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname );
    309315
    310316        // register loadable segments in process VMM
     
    331337        kmem_free(&req);
    332338
    333     elf_dmsg("\n[INFO] %s : core[%x,%d] exit for <%s> / entry_point = %x\n",
     339    elf_dmsg("\n[DMSG] %s : core[%x,%d] exit for <%s> / entry_point = %x\n",
    334340    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , pathname , header.e_entry );
    335341
  • trunk/kernel/libk/grdxt.c

    r396 r406  
    2626#include <errno.h>
    2727#include <printk.h>
     28#include <vseg.h>
    2829#include <kmem.h>
    2930#include <grdxt.h>
     
    125126    intptr_t        value;
    126127
    127         printk("*** %s : n1 = %d / n2 = %d / n3 = %d\n",
     128        printk("\n***** Generic Radix tree %s : n1 = %d / n2 = %d / n3 = %d\n\n",
    128129           name, 1<<w1 , 1<<w2 , 1<<w3 );
    129130
  • trunk/kernel/libk/grdxt.h

    r1 r406  
    3636 * Memory for the second and third levels arrays is dynamically allocated by the
    3737 * grdxt_insert() function and is only released by grdxt_destroy().
    38  * - It used to by the VMM to retrieve a vseg descriptor: key is the virtual address.
    39  * - It is used by the mapper to implement the file cache: key is the page index in file.
     38 * It is used by the MAPPER to implement the file cache: key is the page index in file.
    4039 ******************************************************************************************/
    4140
     
    4847}
    4948grdxt_t;
    50 
    5149
    5250/*******************************************************************************************
     
    122120
    123121/*******************************************************************************************
    124  * This function displays the content of the radix_tree.
     122 * This function displays the current content of a radix_tree.
    125123 *******************************************************************************************
    126124 * @ rt      : pointer on the radix-tree descriptor.
    127  * @ name    : string identifying the radix-tree.
     125 * @ string  : radix tree identifier.
    128126 ******************************************************************************************/
    129127void grdxt_print( grdxt_t * rt,
    130                   char    * name );
     128                  char    * string );
    131129
    132130
  • trunk/kernel/mm/kcm.c

    r352 r406  
    4747                             kcm_page_t * kcm_page )
    4848{
    49         kcm_dmsg("\n[INFO] %s : enters for %s / page %x / count = %d / active = %d\n",
     49        kcm_dmsg("\n[DMSG] %s : enters for %s / page %x / count = %d / active = %d\n",
    5050                 __FUNCTION__ , kmem_type_str( kcm->type ) ,
    5151                 (intptr_t)kcm_page , kcm_page->count , kcm_page->active );
     
    8080                     + (index * kcm->block_size) );
    8181
    82         kcm_dmsg("\n[INFO] %s : allocated one block  %s / ptr = %p / page = %x / count = %d\n",
     82        kcm_dmsg("\n[DMSG] %s : allocated one block  %s / ptr = %p / page = %x / count = %d\n",
    8383                 __FUNCTION__ , kmem_type_str( kcm->type ) , ptr ,
    8484                 (intptr_t)kcm_page , kcm_page->count );
     
    231231        kcm->blocks_nr = blocks_nr;
    232232
    233         kcm_dmsg("\n[INFO] %s : KCM %s initialised / block_size = %d / blocks_nr = %d\n",
     233        kcm_dmsg("\n[DMSG] %s : KCM %s initialised / block_size = %d / blocks_nr = %d\n",
    234234                 __FUNCTION__ , kmem_type_str( type ) , kcm->block_size , kcm->blocks_nr );
    235235}
     
    301301                kcm_page->active = 1;
    302302
    303                 kcm_dmsg("\n[INFO] %s : enters for type %s at cycle %d / new page = %x / count = %d\n",
     303                kcm_dmsg("\n[DMSG] %s : enters for type %s at cycle %d / new page = %x / count = %d\n",
    304304                         __FUNCTION__ , kmem_type_str( kcm->type ) , hal_get_cycles() ,
    305305                         (intptr_t)kcm_page , kcm_page->count );
     
    311311                kcm_page = (kcm_page_t *)LIST_FIRST( &kcm->active_root , kcm_page_t , list );
    312312
    313                 kcm_dmsg("\n[INFO] %s : enters for type %s at cycle %d / page = %x / count = %d\n",
     313                kcm_dmsg("\n[DMSG] %s : enters for type %s at cycle %d / page = %x / count = %d\n",
    314314                         __FUNCTION__ , kmem_type_str( kcm->type ) , hal_get_cycles() ,
    315315                         (intptr_t)kcm_page , kcm_page->count );
  • trunk/kernel/mm/kmem.c

    r394 r406  
    145145        assert( ((type > 1) && (type < KMEM_TYPES_NR) ) , __FUNCTION__ , "illegal KCM type" );
    146146
    147         kmem_dmsg("\n[INFO] %s : enters / KCM type %s missing in cluster %x\n",
     147        kmem_dmsg("\n[DMSG] %s : enters / KCM type %s missing in cluster %x\n",
    148148                  __FUNCTION__ , kmem_type_str( type ) , local_cxy );
    149149
     
    169169        hal_fence();
    170170
    171         kmem_dmsg("\n[INFO] %s : exit / KCM type %s created in cluster %x\n",
     171        kmem_dmsg("\n[DMSG] %s : exit / KCM type %s created in cluster %x\n",
    172172                  __FUNCTION__ , kmem_type_str( type ) , local_cxy );
    173173
     
    192192        assert( (type < KMEM_TYPES_NR) , __FUNCTION__ , "illegal KMEM request type" );
    193193
    194         kmem_dmsg("\n[INFO] %s : enters in cluster %x for type %s\n",
     194        kmem_dmsg("\n[DMSG] %s : enters in cluster %x for type %s\n",
    195195                      __FUNCTION__ , local_cxy , kmem_type_str( type ) );
    196196
     
    210210                if( flags & AF_ZERO ) page_zero( (page_t *)ptr );
    211211
    212                 kmem_dmsg("\n[INFO] %s : exit in cluster %x for type %s / page = %x / base = %x\n",
     212                kmem_dmsg("\n[DMSG] %s : exit in cluster %x for type %s / page = %x / base = %x\n",
    213213                          __FUNCTION__, local_cxy , kmem_type_str( type ) ,
    214214                          (intptr_t)ptr , (intptr_t)ppm_page2base( ptr ) );
     
    228228                if( flags & AF_ZERO ) memset( ptr , 0 , size );
    229229
    230                 kmem_dmsg("\n[INFO] %s : exit in cluster %x for type %s / base = %x / size = %d\n",
     230                kmem_dmsg("\n[DMSG] %s : exit in cluster %x for type %s / base = %x / size = %d\n",
    231231                          __FUNCTION__, local_cxy , kmem_type_str( type ) ,
    232232                          (intptr_t)ptr , req->size );
     
    255255                if( flags & AF_ZERO ) memset( ptr , 0 , kmem_type_size( type ) );
    256256
    257                 kmem_dmsg("\n[INFO] %s : exit in cluster %x for type %s / base = %x / size = %d\n",
     257                kmem_dmsg("\n[DMSG] %s : exit in cluster %x for type %s / base = %x / size = %d\n",
    258258                          __FUNCTION__, local_cxy , kmem_type_str( type ) ,
    259259                          (intptr_t)ptr , kmem_type_size( type ) );
  • trunk/kernel/mm/mapper.c

    r367 r406  
    143143    error_t       error;
    144144
    145     mapper_dmsg("\n[INFO] %s : enters for page %d in mapper %x\n",
     145    mapper_dmsg("\n[DMSG] %s : enters for page %d / mapper %x\n",
    146146                __FUNCTION__ , index , mapper );
    147147
     
    170170        if ( page == NULL )   // missing page => create it and load it from file system
    171171        {
    172             mapper_dmsg("\n[INFO] %s : missing page => load from device\n", __FUNCTION__ );
     172            mapper_dmsg("\n[DMSG] %s : missing page => load from device\n", __FUNCTION__ );
    173173
    174174            // allocate one page from PPM
     
    212212            }
    213213
    214             // update the mapper and index fields in page descriptor
    215             // required by the vfs_move_page_to_mapper()
    216             page->mapper = mapper;
    217             page->index  = index;
    218 
    219214            // launch I/O operation to load page from file system
    220215            error = vfs_mapper_move_page( page,
     
    259254    }
    260255
    261     mapper_dmsg("\n[INFO] %s : exit for page %d in mapper %x / page_desc = %x\n",
     256    mapper_dmsg("\n[DMSG] %s : exit for page %d / mapper %x / page_desc = %x\n",
    262257                __FUNCTION__ , index , mapper , page );
    263258
     
    315310    uint8_t  * buf_ptr;        // current buffer  address
    316311
    317     mapper_dmsg("\n[INFO] %s : enters / to_buf = %d / buffer = %x\n",
     312    mapper_dmsg("\n[DMSG] %s : enters / to_buf = %d / buffer = %x\n",
    318313                __FUNCTION__ , to_buffer , buffer );
    319314
     
    341336        else                       page_count = CONFIG_PPM_PAGE_SIZE;
    342337
    343         mapper_dmsg("\n[INFO] %s : index = %d / offset = %d / count = %d\n",
     338        mapper_dmsg("\n[DMSG] %s : index = %d / offset = %d / count = %d\n",
    344339                    __FUNCTION__ , index , page_offset , page_count );
    345340
     
    356351        buf_ptr = (uint8_t *)buffer + done;
    357352
    358         mapper_dmsg("\n[INFO] %s : index = %d / buf_ptr = %x / map_ptr = %x\n",
     353        mapper_dmsg("\n[DMSG] %s : index = %d / buf_ptr = %x / map_ptr = %x\n",
    359354                    __FUNCTION__ , index , buf_ptr , map_ptr );
    360355
     
    373368    }
    374369
    375     mapper_dmsg("\n[INFO] %s : exit for buffer %x\n",
     370    mapper_dmsg("\n[DMSG] %s : exit for buffer %x\n",
    376371                __FUNCTION__, buffer );
    377372
     
    398393    cxy_t      dst_cxy;        // destination cluster
    399394
    400     mapper_dmsg("\n[INFO] %s : enters / to_buf = %d / buffer = %l / size = %x / cycle %d\n",
    401                 __FUNCTION__ , to_buffer , buffer_xp , size , hal_time_stamp() );
     395    // get buffer cluster and local pointer
     396    cxy_t     buffer_cxy = GET_CXY( buffer_xp );
     397    uint8_t * buffer_ptr = (uint8_t *)GET_PTR( buffer_xp );
     398
     399    mapper_dmsg("\n[DMSG] %s : to_buf = %d / buf_cxy = %x / buf_ptr = %x / size = %x\n",
     400    __FUNCTION__ , to_buffer , buffer_cxy , buffer_ptr , size );
    402401
    403402    // compute offsets of first and last bytes in file
     
    409408    uint32_t last  = max_byte >> CONFIG_PPM_PAGE_SHIFT;
    410409
    411     // get buffer cluster and local pointer
    412     cxy_t     buffer_cxy = GET_CXY( buffer_xp );
    413     uint8_t * buffer_ptr = (uint8_t *)GET_PTR( buffer_xp );
     410    mapper_dmsg("\n[DMSG] %s : first_page = %d / last_page = %d\n",
     411    __FUNCTION__ , first , last );
    414412
    415413    // compute source and destination clusters
     
    440438        else                       page_count = CONFIG_PPM_PAGE_SIZE;
    441439
    442         mapper_dmsg("\n[INFO] %s : page_index = %d / offset = %d / count = %d\n",
     440        mapper_dmsg("\n[DMSG] %s : page_index = %d / offset = %d / bytes = %d\n",
    443441                    __FUNCTION__ , index , page_offset , page_count );
    444442
     
    466464        }
    467465
    468         mapper_dmsg("\n[INFO] %s : index = %d\n", __FUNCTION__ , index );
    469 
    470466        // move fragment
    471467        hal_remote_memcpy( XPTR( dst_cxy , dst_ptr ), XPTR( src_cxy , src_ptr ), page_count );
     
    474470    }
    475471
    476     mapper_dmsg("\n[INFO] %s : exit for buffer %l / size = %x / cycle %d\n",
    477                 __FUNCTION__ , buffer_xp , size , hal_time_stamp() );
     472    mapper_dmsg("\n[DMSG] %s : exit / buf_cxy = %x / buf_ptr = %x / size = %x\n",
     473    __FUNCTION__ , buffer_cxy , buffer_ptr , size );
    478474
    479475    return 0;
    480476
    481 }  // end mapper_move_kernel_buffer()
    482 
     477}  // end mapper_move_kernel()
     478
  • trunk/kernel/mm/ppm.c

    r315 r406  
    5656    page_t * page_ptr = (page_t *)GET_PTR( page_xp );
    5757
    58     void   * base_ptr = ppm->vaddr_base +
    59                         ((page_ptr - ppm->pages_tbl)<<CONFIG_PPM_PAGE_SHIFT);
    60  
     58   void   * base_ptr = ppm->vaddr_base +
     59                       ((page_ptr - ppm->pages_tbl)<<CONFIG_PPM_PAGE_SHIFT);
     60
    6161        return XPTR( page_cxy , base_ptr );
    6262
     
    203203        assert( (order < CONFIG_PPM_MAX_ORDER) , __FUNCTION__ , "illegal order argument" );
    204204
    205         page_t * block = NULL;
    206 
    207         ppm_dmsg("\n[INFO] %s : enters / order = %d\n",
     205        page_t * block = NULL; 
     206
     207        ppm_dmsg("\n[DMSG] %s : enters / order = %d\n",
    208208                 __FUNCTION__ , order );
    209209
     
    256256        spinlock_unlock( &ppm->free_lock );
    257257
    258         ppm_dmsg("\n[INFO] %s : base = %x / order = %d\n",
     258        ppm_dmsg("\n[DMSG] %s : base = %x / order = %d\n",
    259259                 __FUNCTION__ , (uint32_t)ppm_page2base( block ) , order );
    260260
  • trunk/kernel/mm/vmm.c

    r401 r406  
    6262    intptr_t  size;
    6363
    64     vmm_dmsg("\n[INFO] %s : enter for process %x\n", __FUNCTION__ , process->pid );
     64    vmm_dmsg("\n[DMSG] %s : enter for process %x\n", __FUNCTION__ , process->pid );
    6565
    6666    // get pointer on VMM
     
    8383    vmm->vsegs_nr = 0;
    8484        list_root_init( &vmm->vsegs_root );
    85     error = grdxt_init( &vmm->grdxt,
    86                         CONFIG_VMM_GRDXT_W1,
    87                         CONFIG_VMM_GRDXT_W2,
    88                         CONFIG_VMM_GRDXT_W3 );
    89  
    90     assert( (error == 0) , __FUNCTION__ , "cannot initialize radix tree\n" );
    9185
    9286    // register kentry vseg in VMM
    93     base = 1 << CONFIG_PPM_PAGE_SHIFT;
     87    base = CONFIG_VMM_KENTRY_BASE << CONFIG_PPM_PAGE_SHIFT;
    9488    size = CONFIG_VMM_KENTRY_SIZE << CONFIG_PPM_PAGE_SHIFT;
     89
    9590    vseg_kentry = vmm_create_vseg( process , base , size , VSEG_TYPE_CODE );
    9691
    9792    assert( (vseg_kentry != NULL) , __FUNCTION__ , "cannot register kentry vseg\n" );
    9893
    99     vmm->kent_vpn_base = 1;
    100 
    101     // register the args vseg in VMM
    102     base = (CONFIG_VMM_KENTRY_SIZE + 1 )<<CONFIG_PPM_PAGE_SHIFT;
     94    vmm->kent_vpn_base = base;
     95
     96    // register args vseg in VMM
     97    base = (CONFIG_VMM_KENTRY_BASE +
     98            CONFIG_VMM_KENTRY_SIZE ) << CONFIG_PPM_PAGE_SHIFT;
    10399    size = CONFIG_VMM_ARGS_SIZE << CONFIG_PPM_PAGE_SHIFT;
     100
    104101    vseg_args = vmm_create_vseg( process , base , size , VSEG_TYPE_DATA );
    105102
    106103    assert( (vseg_args != NULL) , __FUNCTION__ , "cannot register args vseg\n" );
    107104
    108     vmm->args_vpn_base = CONFIG_VMM_KENTRY_SIZE + 1;
     105    vmm->args_vpn_base = base;
    109106
    110107    // register the envs vseg in VMM
    111     base = (CONFIG_VMM_KENTRY_SIZE + CONFIG_VMM_ARGS_SIZE + 1 )<<CONFIG_PPM_PAGE_SHIFT;
     108    base = (CONFIG_VMM_KENTRY_BASE +
     109            CONFIG_VMM_KENTRY_SIZE +
     110            CONFIG_VMM_ARGS_SIZE   ) << CONFIG_PPM_PAGE_SHIFT;
    112111    size = CONFIG_VMM_ENVS_SIZE << CONFIG_PPM_PAGE_SHIFT;
     112
    113113    vseg_envs = vmm_create_vseg( process , base , size , VSEG_TYPE_DATA );
    114114
    115115    assert( (vseg_envs != NULL) , __FUNCTION__ , "cannot register envs vseg\n" );
    116116
    117     vmm->envs_vpn_base = CONFIG_VMM_KENTRY_SIZE + CONFIG_VMM_ARGS_SIZE + 1;
     117    vmm->envs_vpn_base = base;
    118118
    119119    // register the heap vseg in VMM
    120120    base = CONFIG_VMM_HEAP_BASE << CONFIG_PPM_PAGE_SHIFT;
    121121    size = (CONFIG_VMM_MMAP_BASE-CONFIG_VMM_HEAP_BASE) << CONFIG_PPM_PAGE_SHIFT;
     122
    122123    vseg_heap = vmm_create_vseg( process , base , size , VSEG_TYPE_HEAP );
    123124
    124125    assert( (vseg_heap != NULL) , __FUNCTION__ , "cannot register heap vseg\n" );
    125126
    126     vmm->heap_vpn_base = CONFIG_VMM_HEAP_BASE;
     127    vmm->heap_vpn_base = base;
    127128
    128129    // initialize generic page table
     
    149150    hal_fence();
    150151
    151     vmm_dmsg("\n[INFO] %s : exit for process %x\n", __FUNCTION__ , process->pid );
     152    vmm_dmsg("\n[DMSG] %s : exit for process %x / entry_point = %x\n",
     153    __FUNCTION__ , process->pid , process->vmm.entry_point );
    152154
    153155}  // end vmm_init()
     
    171173    dst_vmm->vsegs_nr = 0;
    172174    list_root_init( &dst_vmm->vsegs_root );
    173     error = grdxt_init( &dst_vmm->grdxt,
    174                         CONFIG_VMM_GRDXT_W1,
    175                         CONFIG_VMM_GRDXT_W2,
    176                         CONFIG_VMM_GRDXT_W3 );
    177     if( error )
    178     {
    179         printk("\n[ERROR] in %s : cannot initialize radix tree for process %x\n",
    180                __FUNCTION__ , dst_process->pid );
    181         return ENOMEM;
    182     }
    183175
    184176    // loop on src_vmm list of vsegs to create
     
    292284        vseg_free( vseg );
    293285        }
    294 
    295     // delete vsegs radix_tree
    296     grdxt_destroy( &vmm->grdxt );
    297286
    298287    // release lock
     
    456445        vmm_t * vmm = &process->vmm;
    457446
    458         vmm_dmsg("\n[INFO] %s : enter for process %x / base = %x / size = %x / type = %s\n",
     447        vmm_dmsg("\n[DMSG] %s : enter for process %x / base = %x / size = %x / type = %s\n",
    459448                     __FUNCTION__ , process->pid , base , size , vseg_type_str(type) );
    460449
     
    527516
    528517    // update "heap_vseg" in VMM
    529         process->vmm.heap_vseg = vseg;
     518        if( type == VSEG_TYPE_HEAP ) process->vmm.heap_vseg = vseg;
    530519
    531520    // attach vseg to vmm
     
    534523        rwlock_wr_unlock( &vmm->vsegs_lock );
    535524
    536         vmm_dmsg("\n[INFO] %s : exit for process %x / vseg [%x, %x] has been mapped\n",
     525        vmm_dmsg("\n[DMSG] %s : exit for process %x / vseg [%x, %x] registered\n",
    537526                     __FUNCTION__ , process->pid , vseg->min , vseg->max );
    538527
    539528        return vseg;
    540 }
     529
     530}  // vmm_create_vseg()
    541531
    542532/////////////////////////////////////
     
    665655}
    666656
     657///////////////////////////////////////////////////////////////////////////////////////
     658// This low-level static function is called by the vmm_get_vseg() and vmm_resize_vseg()
     659// functions.  It scan the list of registered vsegs to find the unique vseg containing
     660// a given virtual address.
     661///////////////////////////////////////////////////////////////////////////////////////
     662// @ vmm     : pointer on the process VMM.
     663// @ vaddr   : virtual address.
     664// @ return vseg pointer if success / return NULL if not found.
     665///////////////////////////////////////////////////////////////////////////////////////
     666static vseg_t * vseg_from_vaddr( vmm_t    * vmm,
     667                                 intptr_t   vaddr )
     668{
     669    list_entry_t * iter;
     670    vseg_t       * vseg = NULL;
     671
     672    // get lock protecting the vseg list
     673    rwlock_rd_lock( &vmm->vsegs_lock );
     674
     675    // scan the list of vsegs
     676    LIST_FOREACH( &vmm->vsegs_root , iter )
     677    {
     678        vseg = LIST_ELEMENT( iter , vseg_t , list );
     679        if( (vaddr >= vseg->min) && (vaddr < vseg->max) ) break;
     680    }
     681
     682    // release the lock
     683    rwlock_rd_unlock( &vmm->vsegs_lock );
     684
     685    return vseg;
     686}
     687
    667688/////////////////////////////////////////////
    668689error_t vmm_resize_vseg( process_t * process,
     
    670691                         intptr_t    size )
    671692{
    672         error_t error;
     693    error_t   error;
     694    vseg_t  * new;
     695    vpn_t     vpn_min;
     696    vpn_t     vpn_max;
    673697
    674698    // get pointer on process VMM
     
    677701    intptr_t addr_min = base;
    678702        intptr_t addr_max = base + size;
    679     uint32_t shift    = CONFIG_PPM_PAGE_SHIFT;
    680703
    681704    // get pointer on vseg
    682         vseg_t * vseg = grdxt_lookup( &vmm->grdxt , (uint32_t)(base >> shift) );
     705        vseg_t * vseg = vseg_from_vaddr( vmm , base );
    683706
    684707        if( vseg == NULL)  return EINVAL;
     
    696719        error = 0;
    697720    }
    698         else if( vseg->min == addr_min )                              // vseg must be resized
    699     {
    700         panic("resize not implemented yet");
    701                 error = 0;
    702     }
    703         else if( vseg->max == addr_max )                              // vseg must be resized
    704     {
    705         panic("resize not implemented yet");
    706                 error = 0;
    707     }
    708     else            // vseg cut in three regions => vseg must be resized & new vseg created
    709     {
    710         panic("resize not implemented yet");
    711                 error = 0;
     721        else if( vseg->min == addr_min )                         // vseg must be resized
     722    {
     723        // update vseg base address
     724        vseg->min = addr_max;
     725
     726        // update vpn_base and vpn_size
     727        vpn_min        = vseg->min >> CONFIG_PPM_PAGE_SHIFT;
     728        vpn_max        = (vseg->max - 1) >> CONFIG_PPM_PAGE_SHIFT;
     729        vseg->vpn_base = vpn_min;
     730        vseg->vpn_size = vpn_max - vpn_min + 1;
     731        error = 0;
     732    }
     733        else if( vseg->max == addr_max )                          // vseg must be resized
     734    {
     735        // update vseg max address
     736        vseg->max = addr_min;
     737
     738        // update vpn_base and vpn_size
     739        vpn_min        = vseg->min >> CONFIG_PPM_PAGE_SHIFT;
     740        vpn_max        = (vseg->max - 1) >> CONFIG_PPM_PAGE_SHIFT;
     741        vseg->vpn_base = vpn_min;
     742        vseg->vpn_size = vpn_max - vpn_min + 1;
     743        error = 0;
     744    }
     745    else                                                      // vseg cut in three regions
     746    {
     747        // resize existing vseg
     748        vseg->max = addr_min;
     749
     750        // update vpn_base and vpn_size
     751        vpn_min        = vseg->min >> CONFIG_PPM_PAGE_SHIFT;
     752        vpn_max        = (vseg->max - 1) >> CONFIG_PPM_PAGE_SHIFT;
     753        vseg->vpn_base = vpn_min;
     754        vseg->vpn_size = vpn_max - vpn_min + 1;
     755
     756        // create new vseg
     757        new = vmm_create_vseg( process , addr_min , (vseg->max - addr_max) , vseg->type );
     758        if( new == NULL ) error = EINVAL;
     759        else              error = 0;
    712760    }
    713761
     
    716764
    717765        return error;
    718 }
     766
     767}  // vmm_resize_vseg()
    719768
    720769///////////////////////////////////////////
     
    723772                       vseg_t   ** found_vseg )
    724773{
    725     vmm_t    * vmm;
    726     vseg_t   * vseg;
    727 
    728     // get pointer on process VMM
    729     vmm = &process->vmm;
    730 
    731     // get lock protecting the vseg list
    732     rwlock_rd_lock( &vmm->vsegs_lock );
    733 
    734     // get pointer on vseg from local radix tree
    735         vseg = grdxt_lookup( &vmm->grdxt, (uint32_t)(vaddr >> CONFIG_PPM_PAGE_SHIFT) );
    736 
    737     // release the lock
    738     rwlock_rd_unlock( &vmm->vsegs_lock );
     774    vmm_t  * vmm = &process->vmm;
     775
     776    // get vseg from vaddr
     777    vseg_t * vseg = vseg_from_vaddr( vmm , vaddr );
    739778
    740779    if( vseg == NULL )   // vseg not found in local cluster => try to get it from ref
     
    752791        xptr_t   vseg_xp;
    753792        error_t  error;
     793
    754794        rpc_vmm_get_vseg_client( ref_cxy , ref_ptr , vaddr , &vseg_xp , &error );
    755795           
     
    759799        vseg = vseg_alloc();
    760800
    761         if( vseg == NULL ) panic("no memory for vseg copy in cluster %x", local_cxy );
     801        if( vseg == NULL ) return -1;
    762802
    763803        // initialise local vseg from reference
     
    765805
    766806        // register local vseg in local VMM
    767         error = vseg_attach( &process->vmm , vseg );
    768 
    769         if( error ) panic("no memory for vseg registration in cluster %x", local_cxy );
     807        vseg_attach( &process->vmm , vseg );
    770808    }   
    771809   
     
    784822    cxy_t      page_cxy;          // physical page cluster
    785823    page_t   * page_ptr;          // local pointer on physical page descriptor
    786 
    787     uint32_t   type      = vseg->type;
    788     xptr_t     mapper_xp = vseg->mapper_xp;
    789     uint32_t   flags     = vseg->flags;
    790 
    791     // get mapper cluster and local pointer
    792     cxy_t      mapper_cxy = GET_CXY( mapper_xp );
    793     mapper_t * mapper_ptr = (mapper_t *)GET_PTR( mapper_xp );
    794 
    795     // FILE type : simply get the physical page from the file mapper
     824    uint32_t   index;             // missing page index in vseg mapper
     825    uint32_t   type;              // vseg type;
     826
     827    type      = vseg->type;
     828    index     = vpn - vseg->vpn_base;
     829
     830    vmm_dmsg("\n[DMSG] %s : core[%x,%d] enter for vpn = %x / type = %s / index = %d\n",
     831    __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, vpn, vseg_type_str(type), index );
     832
     833    // FILE type : get the physical page from the file mapper
    796834    if( type == VSEG_TYPE_FILE )
    797835    {
    798         // compute index in file mapper
    799         uint32_t index = vpn - vseg->vpn_base;
     836        // get extended pointer on mapper
     837        xptr_t     mapper_xp = vseg->mapper_xp;
     838
     839        assert( (mapper_xp != XPTR_NULL), __FUNCTION__,
     840        "mapper not defined for a FILE vseg\n" );
     841       
     842        // get mapper cluster and local pointer
     843        cxy_t      mapper_cxy = GET_CXY( mapper_xp );
     844        mapper_t * mapper_ptr = (mapper_t *)GET_PTR( mapper_xp );
    800845
    801846        // get page descriptor from mapper
     
    814859    }
    815860
    816     // all other types : allocate a physical page from target cluster,
     861    // Other types : allocate a physical page from target cluster,
    817862    else
    818863    {
     864        uint32_t flags = vseg->flags;
     865
    819866        // get target cluster for physical page
    820867        if( flags & VSEG_DISTRIB ) // depends on VPN LSB
    821868        {
    822             uint32_t x_width = LOCAL_CLUSTER->x_width;
    823             uint32_t y_width = LOCAL_CLUSTER->y_width;
    824             page_cxy = vpn & ((1<<(x_width + y_width)) - 1);
     869            uint32_t x_size = LOCAL_CLUSTER->x_size;
     870            uint32_t y_size = LOCAL_CLUSTER->y_size;
     871            page_cxy = vpn & ((x_size * y_size) - 1);
    825872        }
    826873        else                       // defined in vseg descriptor
     
    831878        // allocate a physical page in target cluster
    832879        kmem_req_t   req;
    833         if( page_cxy == local_cxy )    // target cluster is the local cluster
     880        if( page_cxy == local_cxy )  // target cluster is the local cluster
    834881        {
    835882            req.type  = KMEM_PAGE;
     
    845892        if( page_ptr == NULL ) return ENOMEM;
    846893
    847         // initialise page from .elf file mapper for DATA and CODE types
     894        // initialise missing page from .elf file mapper for DATA and CODE types
     895        // => the mapper_xp field is an extended pointer on the .elf file mapper
    848896        if( (type == VSEG_TYPE_CODE) || (type == VSEG_TYPE_DATA) )
    849897        {
    850             // compute missing page index in vseg
    851             vpn_t page_index = vpn - vseg->vpn_base;
     898            // get extended pointer on mapper
     899            xptr_t     mapper_xp = vseg->mapper_xp;
     900
     901            assert( (mapper_xp != XPTR_NULL), __FUNCTION__,
     902            "mapper not defined for a CODE or DATA vseg\n" );
     903       
     904            // get mapper cluster and local pointer
     905            cxy_t      mapper_cxy = GET_CXY( mapper_xp );
     906            mapper_t * mapper_ptr = (mapper_t *)GET_PTR( mapper_xp );
     907
     908            // compute missing page offset in vseg
     909            uint32_t offset = index << CONFIG_PPM_PAGE_SHIFT;
    852910
    853911            // compute missing page offset in .elf file
    854             intptr_t page_offset = vseg->file_offset +
    855                                    (page_index << CONFIG_PPM_PAGE_SHIFT);
    856 
    857             // compute extended pointer on page first byte
    858             xptr_t base_xp = ppm_page2base( XPTR( page_cxy , page_ptr ) );
    859 
    860             // file_size can be smaller than vseg_size for BSS
    861             intptr_t file_size = vseg->file_size;
    862 
    863             if( file_size < page_offset )                                // fully in  BSS
     912            uint32_t elf_offset = vseg->file_offset + offset;
     913
     914            vmm_dmsg("\n[DMSG] %s : core[%x,%d] for vpn = %x / elf_offset = %x\n",
     915            __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, vpn, elf_offset );
     916
     917            // compute extended pointer on page base
     918            xptr_t base_xp  = ppm_page2base( XPTR( page_cxy , page_ptr ) );
     919
     920            // file_size (in .elf mapper) can be smaller than vseg_size (BSS)
     921            uint32_t file_size = vseg->file_size;
     922
     923            if( file_size < offset )                 // missing page fully in  BSS
    864924            {
     925                vmm_dmsg("\n[DMSG] %s : core[%x,%d] for vpn = %x / fully in BSS\n",
     926                __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, vpn );
     927
    865928                if( page_cxy == local_cxy )
    866929                {
     
    872935                }
    873936            }
    874             else if( file_size >= (page_offset + CONFIG_PPM_PAGE_SIZE) )  // fully in  mapper
     937            else if( file_size >= (offset + CONFIG_PPM_PAGE_SIZE) )  // fully in  mapper
    875938            {
     939                vmm_dmsg("\n[DMSG] %s : core[%x,%d] for vpn = %x / fully in mapper\n",
     940                __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, vpn );
     941
    876942                if( mapper_cxy == local_cxy )
    877943                {
    878944                    error = mapper_move_kernel( mapper_ptr,
    879945                                                true,             // to_buffer
    880                                                 page_offset,
     946                                                elf_offset,
    881947                                                base_xp,
    882948                                                CONFIG_PPM_PAGE_SIZE );
     
    888954                                                   true,         // to buffer
    889955                                                   false,        // kernel buffer
    890                                                    page_offset,
    891                                                    (uint64_t)base_xp,
     956                                                   elf_offset,
     957                                                   base_xp,
    892958                                                   CONFIG_PPM_PAGE_SIZE,
    893959                                                   &error );
     
    895961                if( error ) return EINVAL;
    896962            }
    897             else  // in mapper : from page_offset -> (file_size - page_offset)
    898                   // in BSS    : from file_size   -> (page_offset + page_size)
     963            else  // both in mapper and in BSS :
     964                  // - (file_size - offset)             bytes from mapper
     965                  // - (page_size + offset - file_size) bytes from BSS
    899966            {
     967                vmm_dmsg("\n[DMSG] %s : core[%x,%d] for vpn = %x / both mapper & BSS\n"
     968                         "      %d bytes from mapper / %d bytes from BSS\n",
     969                __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, vpn,
     970                file_size - offset , offset + CONFIG_PPM_PAGE_SIZE - file_size  );
     971
    900972                // initialize mapper part
    901973                if( mapper_cxy == local_cxy )
     
    903975                    error = mapper_move_kernel( mapper_ptr,
    904976                                                true,         // to buffer
    905                                                 page_offset,
     977                                                elf_offset,
    906978                                                base_xp,
    907                                                 file_size - page_offset );
     979                                                file_size - offset );
    908980                }
    909981                else                               
     
    913985                                                   true,         // to buffer
    914986                                                   false,        // kernel buffer
    915                                                    page_offset,
    916                                                    (uint64_t)base_xp,
    917                                                    file_size - page_offset,
     987                                                   elf_offset,
     988                                                   base_xp,
     989                                                   file_size - offset,
    918990                                                   &error );
    919991                }
     
    923995                if( page_cxy == local_cxy )
    924996                {
    925                     memset( GET_PTR( base_xp ) + file_size - page_offset , 0 ,
    926                             page_offset + CONFIG_PPM_PAGE_SIZE - file_size );
     997                    memset( GET_PTR( base_xp ) + file_size - offset , 0 ,
     998                            offset + CONFIG_PPM_PAGE_SIZE - file_size );
    927999                }
    9281000                else
    9291001                {
    930                    hal_remote_memset( base_xp + file_size - page_offset , 0 ,
    931                                       page_offset + CONFIG_PPM_PAGE_SIZE - file_size );
     1002                   hal_remote_memset( base_xp + file_size - offset , 0 ,
     1003                                      offset + CONFIG_PPM_PAGE_SIZE - file_size );
    9321004                }
    9331005            }   
     
    9371009    // return ppn
    9381010    *ppn = ppm_page2ppn( XPTR( page_cxy , page_ptr ) );
     1011
     1012    vmm_dmsg("\n[DMSG] %s : core[%x,%d] exit for vpn = %x / ppn = %x\n",
     1013    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , vpn , *ppn );
     1014
    9391015    return 0;
    9401016
     
    9541030    // this function must be called by a thread running in the reference cluster
    9551031    assert( (GET_CXY( process->ref_xp ) == local_cxy ) , __FUNCTION__ ,
    956              " not called in the reference cluster\n" );
     1032    "not called in the reference cluster\n" );
     1033
     1034    vmm_dmsg("\n[DMSG] %s : core[%x,%d] enter for vpn = %x in process %x\n",
     1035    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , vpn , process->pid );
    9571036
    9581037    // get VMM pointer
     
    9681047    if( (attr & GPT_MAPPED) == 0 )
    9691048    {
     1049        vmm_dmsg("\n[DMSG] %s : core[%x,%d] page %x unmapped => try to map it\n",
     1050        __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , vpn );
     1051
    9701052        // 1. get vseg pointer
    9711053        error = vmm_get_vseg( process , vpn<<CONFIG_PPM_PAGE_SHIFT , &vseg );
     
    9771059            return error;
    9781060        }
     1061
     1062        vmm_dmsg("\n[DMSG] %s : core[%x,%d] found vseg %s / vpn_base = %x / vpn_size = %x\n",
     1063        __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid ,
     1064        vseg_type_str(vseg->type) , vseg->vpn_base , vseg->vpn_size );
    9791065
    9801066        // 2. get physical page number, depending on vseg type
     
    10051091    }  // end new PTE
    10061092
     1093    vmm_dmsg("\n[DMSG] %s : core[%x,%d] exit for vpn = %x / ppn = %x\n",
     1094    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , vpn , ppn );
     1095
    10071096    *ret_ppn  = ppn;
    10081097    *ret_attr = attr;
  • trunk/kernel/mm/vmm.h

    r401 r406  
    3030#include <bits.h>
    3131#include <list.h>
    32 #include <grdxt.h>
    3332#include <spinlock.h>
    3433#include <hal_gpt.h>
     
    9291 * This structure defines the Virtual Memory Manager for a given process in a given cluster.
    9392 * This local VMM provides three main services:
    94  * 1) It registers all vsegs statically or dynamically defined in the vseg list,
    95  *    and in the associated radix-tree.
    96  * 2) It allocates virtual memory space for the STACKS and MMAP vsegs,
    97  *    using dedicated allocators.
     93 * 1) It registers all vsegs statically or dynamically defined in the vseg list.
     94 * 2) It allocates virtual memory space for the STACKS and MMAP vsegs.
    9895 * 3) It contains the local copy of the generic page table descriptor.
    9996 ********************************************************************************************/
     
    104101        list_entry_t   vsegs_root;         /*! all vsegs in same process and same cluster       */
    105102        uint32_t       vsegs_nr;           /*! total number of local vsegs                      */
    106         grdxt_t        grdxt;              /*! embedded generic vsegs radix tree (key is vpn)   */
    107103
    108104    gpt_t          gpt;                /*! embedded generic page table descriptor           */
     
    144140
    145141/*********************************************************************************************
    146  * This function initialises the virtual memory manager attached to a process.
    147  * - It initializes the VSL (list of vsegs and associated radix tree).
    148  * - It initializes the generic page table (empty).
     142 * This function initialises the virtual memory manager attached to an user process.
     143 * - It registers the "kentry", "args", "envs" and "heap" vsegs in the vsegs list.
     144 *   The "code" and "data" vsegs are registered by the elf_load_process() function,
     145 *   the "stack" vsegs are registered by the thread_user_create() function, and the
     146 *   "mmap" vsegs are dynamically created by syscalls.
     147 * - It initializes the generic page table, calling the HAL specific hal_gpt_init() function.
     148 *   For TSAR it map all pages for the "kentry" vseg, that must be identity mapping.
    149149 * - It initializes the STAK and MMAP allocators.
    150  * - It registers the "kentry", "args", "envs" and "heap" vsegs in the vsegs list.
    151  * Any error in this function gives a kernel panic.
     150 * TODO : Any error in this function gives a kernel panic => improve error handling.
    152151 *********************************************************************************************
    153152 * @ process   : pointer on process descriptor
     
    249248 * (a) if the region is not entirely mapped in an existing vseg, it's an error.
    250249 * (b) if the region has same base and size as an existing vseg, the vseg is removed.
    251  * (c) if the removed region cut the vseg in two parts, it is removed and re-created.
    252  * (d) if the removed region cut the vseg in three parts, it is removed, and two are created.
    253  * TODO : cases (c) and (d) are not implemented [AG]
     250 * (c) if the removed region cut the vseg in two parts, it is modified.
     251 * (d) if the removed region cut the vseg in three parts, it is modified, and a new
     252 *     vseg is created with same type.
    254253 *********************************************************************************************
    255254 * @ process   : pointer on process descriptor
     
    267266 * - if the vseg is missing in local VMM, it uses a RPC to get it from the reference cluster,
    268267 *   register it in local VMM and returns the local vseg pointer, if success.
    269  * - if the vseg is missing in reference VMM, it returns an user error.
    270  * It creates a kernel panic if there is not enough memory to create a new vseg descriptor
    271  * in the cluster containing the calling thread.
     268 * - it returns an user error if the vseg is missing in the reference VMM, or if there is
     269 *   not enough memory for a new vseg descriptor in cluster containing the calling thread.
    272270 *********************************************************************************************
    273271 * @ process   : [in] pointer on process descriptor
     
    320318 * Depending on the vseg type, defined by the <vseg> argument, it returns the PPN
    321319 * (Physical Page Number) associated to a missing page defined by the <vpn> argument.
    322  * - For the VSEG_TYPE_FILE, it returns the physical page from the file mapper.
    323  *   For all other types, it allocates a new physical page from the cluster defined
    324  *   by the <vseg->cxy> field, or by the <vpn> MSB bits for a distributed vseg.
    325  * - For the VSEG_TYPE_CODE and VSEG_TYPE_DATA types, the allocated page is initialized
    326  *   from the .elf file mapper. For others vseg types it is not initialised.
     320 * - For the FILE type, it returns directly the physical page from the file mapper.
     321 * - For the CODE and DATA types, it allocates a new phsical page from the cluster defined
     322 *   by the <vseg->cxy> field, or by the <vpn> MSB bits for a distributed vseg,
     323 *   and initialize this page from the .elf file mapper.
     324 * - For all other types, it allocates a new physical page from the cluster defined
     325 *   by the <vseg->cxy> field, or by the <vpn> MSB bits for a distributed vseg,
     326 *   but the new page is not initialized.
    327327 *********************************************************************************************
    328328 * @ vseg   : local pointer on vseg containing the mising page.
  • trunk/kernel/mm/vseg.c

    r394 r406  
    188188
    189189///////////////////////////////
    190 error_t vseg_attach( vmm_t  * vmm,
    191                      vseg_t * vseg )
    192 {
    193     // add vseg in radix-tree
    194     error_t error = grdxt_insert( &vmm->grdxt , vseg->vpn_base , vseg );
    195     if ( error ) return ENOMEM;
    196 
     190void vseg_attach( vmm_t  * vmm,
     191                  vseg_t * vseg )
     192{
    197193    // update vseg descriptor
    198194    vseg->vmm = vmm;
     
    200196    // add vseg in vmm list
    201197    list_add_last( &vmm->vsegs_root , &vseg->list );
    202 
    203     return 0;
    204198}
    205199
     
    208202                  vseg_t * vseg )
    209203{
    210     // remove vseg from radix-tree
    211     grdxt_remove( &vmm->grdxt , vseg->vpn_base );
    212 
    213204    // update vseg descriptor
    214205    vseg->vmm = NULL;
  • trunk/kernel/mm/vseg.h

    r388 r406  
    149149 * @ vmm       : pointer on the VMM
    150150 * @ vseg      : pointer on the vseg descriptor
    151  * @ returns 0 if success / returns ENOMEM if registration in GRDXT unpossible.
    152151 *********************************************************************************************/
    153 error_t vseg_attach( struct vmm_s  * vmm,
    154                      vseg_t        * vseg );
     152void vseg_attach( struct vmm_s  * vmm,
     153                  vseg_t        * vseg );
    155154
    156155/**********************************************************************************************
  • trunk/kernel/syscalls/sys_exec.c

    r315 r406  
    223223    bool_t    is_local   = (cxy_server == cxy_client);
    224224
    225     exec_dmsg("\n[INFO] %s starts for process %x on core %d in cluster %x"
     225    exec_dmsg("\n[DMSG] %s starts for process %x on core %d in cluster %x"
    226226                 " / target_cluster = %x / cycle %d\n",
    227227                 __FUNCTION__, process->pid , CURRENT_CORE->lid,
     
    261261    }
    262262
    263     exec_dmsg("\n[INFO] %s starts exec for process %x at cycle %d\n",
     263    exec_dmsg("\n[DMSG] %s starts exec for process %x at cycle %d\n",
    264264              __FUNCTION__, process->pid, hal_get_cycles() );
    265265
     
    275275    }
    276276
    277     exec_dmsg("\n[INFO] %s completes exec for process %x at cycle %d\n",
     277    exec_dmsg("\n[DMSG] %s completes exec for process %x at cycle %d\n",
    278278              __FUNCTION__, process->pid , hal_get_cycles() );
    279279
  • trunk/kernel/syscalls/sys_fork.c

    r101 r406  
    6363        }
    6464
    65         fork_dmsg("\n[INFO] %s : enters for process %d at cycle [%d]\n",
     65        fork_dmsg("\n[DMSG] %s : enters for process %d at cycle [%d]\n",
    6666                  __FUNCTION__, parent_process->pid, hal_get_cycles());
    6767
     
    7171        {
    7272                hal_fpu_context_save( parent_thread );
    73                 fork_dmsg("\n[INFO] %s : save FPU\n", __FUNCTION__);
     73                fork_dmsg("\n[DMSG] %s : save FPU\n", __FUNCTION__);
    7474        }
    7575
     
    129129    process_reference_init( child_process , child_pid , parent_pid );
    130130
    131         fork_dmsg("\n[INFO] : %s created child process : pid = %x / ppid = %x\n",
     131        fork_dmsg("\n[DMSG] : %s created child process : pid = %x / ppid = %x\n",
    132132              __FUNCTION__, child_pid , parent_pid );
    133133
     
    148148                            XPTR( local_cxy , &parent_process->fd_array ) );
    149149
    150         fork_dmsg("\n[INFO] %s : duplicated child process from parent process\n",
     150        fork_dmsg("\n[DMSG] %s : duplicated child process from parent process\n",
    151151                  __FUNCTION__ );
    152152
     
    162162    }
    163163 
    164         fork_dmsg("\n[INFO] %s : parent vmm duplicated in child process\n", __FUNCTION__ );
     164        fork_dmsg("\n[DMSG] %s : parent vmm duplicated in child process\n", __FUNCTION__ );
    165165
    166166    // create child main thread descriptor in local cluster
     
    197197    child_thread->trdid   = child_trdid;
    198198
    199         fork_dmsg("\n[INFO] %s : initialised child main thread\n", __FUNCTION__ );
     199        fork_dmsg("\n[DMSG] %s : initialised child main thread\n", __FUNCTION__ );
    200200
    201201    // register local child thread into local child process th_tbl[]
     
    208208        sched_register_thread( child_thread->core , child_thread );
    209209 
    210         fork_dmsg("\n[INFO] %s : registered main thread in scheduler\n", __FUNCTION__);
     210        fork_dmsg("\n[DMSG] %s : registered main thread in scheduler\n", __FUNCTION__);
    211211
    212212        // update DQDT for the child thread
    213213    dqdt_local_update_threads( 1 );
    214214
    215         fork_dmsg("\n[INFO] %s : completed / parent pid = %x / child pid = %x / at cycle [%d]\n",
     215        fork_dmsg("\n[DMSG] %s : completed / parent pid = %x / child pid = %x / at cycle [%d]\n",
    216216                  __FUNCTION__, parent_process->pid, child_process->pid, hal_get_cycles() );
    217217
  • trunk/kernel/syscalls/sys_signal.c

    r23 r406  
    4545        this->process->sig_mgr.sigactions[sig_id] = handler;
    4646
    47         signal_dmsg("\n[INFO] %s : handler @%x has been registred for signal %d\n",
     47        signal_dmsg("\n[DMSG] %s : handler @%x has been registred for signal %d\n",
    4848                    __FUNCTION__ , handler , sig_id );
    4949
  • trunk/kernel/syscalls/sys_thread_create.c

    r289 r406  
    161161        tm_end = hal_get_cycles();
    162162
    163         thread_dmsg("\n[INFO] %s created thread %x for process %x in cluster %x\n"
     163        thread_dmsg("\n[DMSG] %s created thread %x for process %x in cluster %x\n"
    164164                    "  start_cycle = %d / end_cycle = %d\n",
    165165                       trdid , process->pid , k_attr.cxy , tm_start , tm_end );
  • trunk/kernel/syscalls/sys_thread_sleep.c

    r296 r406  
    3232    thread_t * this = CURRENT_THREAD;
    3333
    34     thread_dmsg("\n[INFO] %s : thread %x in process %x goes to sleep at cycle %d\n",
     34    thread_dmsg("\n[DMSG] %s : thread %x in process %x goes to sleep at cycle %d\n",
    3535                __FUNCTION__, this->trdid, this->process->pid, hal_get_cycles() );
    3636
     
    3838    sched_yield( NULL );
    3939
    40     thread_dmsg("\n[INFO] %s : thread %x in process %x resume at cycle\n",
     40    thread_dmsg("\n[DMSG] %s : thread %x in process %x resume at cycle\n",
    4141                __FUNCTION__, this->trdid, this->process->pid, hal_get_cycles() );
    4242
  • trunk/kernel/syscalls/sys_trace.c

    r124 r406  
    4949        // desactivate thread trace TODO
    5050
    51             printk("\n[INFO] %s : trace OFF  for thread %x in process %x\n",
     51            printk("\n[DMSG] %s : trace OFF  for thread %x in process %x\n",
    5252               __FUNCTION__ , trdid , pid );
    5353    }
     
    5656        // activate thread trace TODO
    5757                   
    58             printk("\n[INFO] %s : trace ON for thread %x in process %x\n",
     58            printk("\n[DMSG] %s : trace ON for thread %x in process %x\n",
    5959               __FUNCTION__ , trdid , pid );
    6060    }
  • trunk/kernel/vfs/devfs.c

    r279 r406  
    7979    error_t  error;
    8080
    81     devfs_dmsg("\n[INFO] %s : enter in cluster %x\n",
     81    devfs_dmsg("\n[DMSG] %s : enter in cluster %x\n",
    8282               __FUNCTION__ , local_cxy );
    8383
     
    9393    assert( (error == 0) , __FUNCTION__ , "cannot create <dev>\n" );
    9494
    95     devfs_dmsg("\n[INFO] %s : <dev> created in cluster %x\n",
     95    devfs_dmsg("\n[DMSG] %s : <dev> created in cluster %x\n",
    9696               __FUNCTION__ , local_cxy );
    9797
     
    107107    assert( (error == 0) , __FUNCTION__ , "cannot create <external>\n" );
    108108
    109     devfs_dmsg("\n[INFO] %s : <external> created in cluster %x\n",
     109    devfs_dmsg("\n[DMSG] %s : <external> created in cluster %x\n",
    110110               __FUNCTION__ , local_cxy );
    111111}
  • trunk/kernel/vfs/fatfs.c

    r401 r406  
    249249error_t fatfs_get_cluster( mapper_t * mapper,
    250250                           uint32_t   first_cluster_id,
    251                            uint32_t   page_index,
     251                           uint32_t   searched_page_index,
    252252                           uint32_t * searched_cluster_id )
    253253{
    254254    page_t   * current_page_desc;      // pointer on current page descriptor
    255255    uint32_t * current_page_buffer;    // pointer on current page (array of uint32_t)
    256     uint32_t   current_page_index;     // index of current page in mapper
     256    uint32_t   current_page_index;     // index of current page in FAT
    257257    uint32_t   current_page_offset;    // offset of slot in current page
    258258    uint32_t   page_count_in_file;     // index of page in file (index in linked list)
    259     uint32_t   current_cluster_id;     // content of current FAT slot
    260 
    261     assert( (page_index > 0) , __FUNCTION__ , "no FAT access required for first page\n");
    262 
    263     fatfs_dmsg("\n[INFO] %s : enters / mapper = %x / first_cluster_id = %d / page_index = %d\n",
    264                __FUNCTION__ , first_cluster_id , page_index );
    265 
    266 #if (CONFIG_FATFS_DEBUG > 1)
    267     xptr_t     base_xp = ppm_page2base( XPTR( local_cxy , mapper_get_page ( mapper , 0 ) ) );
    268     uint32_t * buf     = (uint32_t *)GET_PTR( base_xp );
    269     uint32_t   line , word;
    270     printk("\n***  FAT mapper content for first 256 entries ***\n");
    271     for( line = 0 ; line < 16 ; line++ )
    272     {
    273         printk("%X : ", line );
    274         for( word = 0 ; word < 16 ; word++ ) printk("%X ", buf[(line<<4) + word] );
    275         printk("\n");
    276     }
    277 #endif
    278 
    279     // compute number of FAT slots per page
     259    uint32_t   next_cluster_id;        // content of current FAT slot
     260
     261    assert( (searched_page_index > 0) , __FUNCTION__ ,
     262    "no FAT access required for first page\n");
     263
     264    fatfs_dmsg("\n[DMSG] %s : enter / first_cluster_id = %d / searched_page_index = %d\n",
     265    __FUNCTION__ , first_cluster_id , searched_page_index );
     266
     267    // get number of FAT slots per page
    280268    uint32_t slots_per_page = CONFIG_PPM_PAGE_SIZE >> 2;
    281269
     
    284272    current_page_offset = first_cluster_id % slots_per_page;
    285273    page_count_in_file  = 0;
     274    next_cluster_id     = 0xFFFFFFFF;
    286275
    287276    // scan FAT (i.e. traverse FAT linked list)
    288     while( page_count_in_file <= page_index )
    289     {
    290 
    291         fatfs_dmsg("\n[INFO] %s : page_index = %d / page_offset = %d / count = %d\n",
    292                __FUNCTION__ , current_page_index , current_page_offset , page_count_in_file );
    293 
     277    while( page_count_in_file < searched_page_index )
     278    {
    294279        // get pointer on current page descriptor
    295280        current_page_desc = mapper_get_page( mapper , current_page_index );
     
    302287
    303288        // get FAT slot content
    304         current_cluster_id = current_page_buffer[current_page_offset];
     289        next_cluster_id = current_page_buffer[current_page_offset];
     290
     291        fatfs_dmsg("\n[DMSG] %s : traverse FAT / current_page_index = %d\n"
     292                   "       current_page_offset = %d / next_cluster_id = %d\n",
     293        __FUNCTION__ , current_page_index , current_page_offset , next_cluster_id );
    305294
    306295        // update loop variables
    307         current_page_index  = current_cluster_id / slots_per_page;
    308         current_page_offset = current_cluster_id % slots_per_page;
     296        current_page_index  = next_cluster_id / slots_per_page;
     297        current_page_offset = next_cluster_id % slots_per_page;
    309298        page_count_in_file++;
    310299    }
    311    
    312     fatfs_dmsg("\n[INFO] %s : exit / cluster_id = %d\n",
    313                __FUNCTION__ , current_cluster_id );
    314 
    315     *searched_cluster_id = current_cluster_id;
     300
     301    if( next_cluster_id == 0xFFFFFFFF ) return EIO;
     302   
     303    fatfs_dmsg("\n[DMSG] %s : exit / cluster_id = %d\n", __FUNCTION__ , next_cluster_id );
     304
     305    *searched_cluster_id = next_cluster_id;
    316306    return 0;
    317307
     
    343333    uint8_t     * buffer;
    344334
    345     fatfs_dmsg("\n[INFO] %s : enter for fatfs_ctx = %x\n",
     335    fatfs_dmsg("\n[DMSG] %s : enter for fatfs_ctx = %x\n",
    346336               __FUNCTION__ , fatfs_ctx );
    347337
     
    357347                   "cannot allocate memory for 512 bytes buffer\n" );
    358348     
    359     fatfs_dmsg("\n[INFO] %s : allocated 512 bytes buffer\n", __FUNCTION__ );
     349    fatfs_dmsg("\n[DMSG] %s : allocated 512 bytes buffer\n", __FUNCTION__ );
    360350
    361351    // load the boot record from device
     
    363353    error = dev_ioc_sync_read( buffer , 0 , 1 );
    364354
    365     fatfs_dmsg("\n[INFO] %s : buffer loaded\n", __FUNCTION__ );
    366 
    367     assert( (error == 0) , __FUNCTION__ ,
    368                    "cannot access boot record\n" );
    369 
    370 #if (CONFIG_FATFS_DEBUG > 1)
     355    fatfs_dmsg("\n[DMSG] %s : buffer loaded\n", __FUNCTION__ );
     356
     357    assert( (error == 0) , __FUNCTION__ , "cannot access boot record\n" );
     358
     359#if (CONFIG_FATFS_DEBUG & 0x1)
     360if( hal_time_stamp() > CONFIG_FATFS_DEBUG )
     361{
    371362    uint32_t   line;
    372363    uint32_t   byte = 0;
    373     printk("\n***** FAT boot record\n" );
     364    printk("\n***** %s : FAT boot record\n", __FUNCTION__ );
    374365    for ( line = 0 ; line < 32 ; line++ )
    375366    {
     
    383374         byte += 16;
    384375    }
     376}
    385377#endif
    386378
     
    423415    kmem_free( &req );
    424416
    425     fatfs_dmsg("\n[INFO] %s : boot record read & released\n",
     417    fatfs_dmsg("\n[DMSG] %s : boot record read & released\n",
    426418               __FUNCTION__ );
    427419
     
    445437    fatfs_ctx->fat_mapper_xp         = XPTR( local_cxy , fat_mapper );
    446438
    447     fatfs_dmsg("\n[INFO] %s : exit for fatfs_ctx = %x\n",
     439    fatfs_dmsg("\n[DMSG] %s : exit for fatfs_ctx = %x\n",
    448440               __FUNCTION__ , fatfs_ctx );
    449441
     
    472464    fatfs_ctx_t * fatfs_ctx;   // pointer on local FATFS context
    473465
    474     // get pointer on source mapper and page index from page descriptor
     466    // get pointer on mapper and page index from page descriptor
    475467    mapper = page->mapper;
    476468    index  = page->index;
    477469
    478     // get VFS inode pointer from mapper
     470    // get inode pointer from mapper
    479471    inode = mapper->inode;
    480472
    481     fatfs_dmsg("\n[INFO] %s : core[%x,%d] enter for inode %x / page_id = %d / mapper = %x\n",
    482     __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , inode , index , mapper );
    483 
    484     // get page to move base address
     473    fatfs_dmsg("\n[DMSG] %s : core[%x,%d] enter for page %d / inode %x / mapper %x\n",
     474    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , index , inode , mapper );
     475
     476    // get page base address
    485477    xptr_t base_xp = ppm_page2base( XPTR( local_cxy , page ) );
    486478    buffer = (uint8_t *)GET_PTR( base_xp );
     
    496488        lba = fatfs_ctx->fat_begin_lba + (count * index);
    497489 
    498         fatfs_dmsg("\n[INFO] %s : core[%x,%d] access FAT on device / lba = %d\n",
     490        fatfs_dmsg("\n[DMSG] %s : core[%x,%d] access FAT on device / lba = %d\n",
    499491        __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , lba );
    500492
     
    519511        else                        // FAT mapper access required
    520512        {
     513            fatfs_dmsg("\n[DMSG] %s : core[%x,%d] must access FAT\n",
     514            __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid );
     515
    521516            // get cluster and local pointer on FAT mapper
    522517            xptr_t     fat_mapper_xp  = fatfs_ctx->fat_mapper_xp;
     
    545540        }
    546541
     542        fatfs_dmsg("\n[DMSG] %s : core[%x,%d] access device for inode %x / cluster_id %d\n",
     543        __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , inode , searched_cluster_id );
     544
    547545        // get lba from cluster_id
    548546        lba = fatfs_lba_from_cluster( fatfs_ctx , searched_cluster_id );
    549 
    550         fatfs_dmsg("\n[INFO] %s : core[%x,%d] access device for inode %x / cluster_id = %d\n",
    551         __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , inode , first_cluster_id );
    552547
    553548        // access device
     
    558553    }
    559554
    560     fatfs_dmsg("\n[INFO] %s : core[%x,%d] exit for inode %x / page_id = %d / mapper = %x\n",
    561     __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , inode , index , mapper );
     555    fatfs_dmsg("\n[DMSG] %s : core[%x,%d] exit for page %d / inode %x / mapper %x\n",
     556    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , index , inode , mapper );
     557
     558#if (CONFIG_FATFS_DEBUG & 0x1)
     559if( hal_time_stamp() > CONFIG_FATFS_DEBUG )
     560{
     561    uint32_t * tab = (uint32_t *)buffer;
     562    uint32_t line , word;
     563    printk("\n***** %s : First 64 words of loaded page\n", __FUNCTION__ );
     564    for( line = 0 ; line < 8 ; line++ )
     565    {
     566        printk("%X : ", line );
     567        for( word = 0 ; word < 8 ; word++ ) printk("%X ", tab[(line<<3) + word] );
     568        printk("\n");
     569    }
     570}
     571#endif
    562572
    563573    return 0;
     
    574584    // - scan the directory entries in each 4 Kbytes page
    575585
    576     fatfs_dmsg("\n[INFO] %s : enter for child <%s> in parent inode %l\n",
     586    fatfs_dmsg("\n[DMSG] %s : enter for child <%s> in parent inode %l\n",
    577587               __FUNCTION__ , name , XPTR( local_cxy , parent_inode ) );
    578588
     
    612622        base = (uint8_t *)GET_PTR( base_xp );
    613623
    614 #if (CONFIG_FATFS_DEBUG > 1)
     624#if (CONFIG_FATFS_DEBUG & 0x1)
     625if( hal_time_stamp() > CONFIG_FATFS_DEBUG )
     626{
    615627    uint32_t * buf = (uint32_t *)base;
    616628    uint32_t line , word;
    617     printk("\n***** first 16 dir entries for parent inode %x\n", parent_inode );
     629    printk("\n***** %s : First 16 dentries for parent inode %x\n",
     630    __FUNCTION__ , parent_inode );
    618631    for( line = 0 ; line < 16 ; line++ )
    619632    {
     
    622635        printk("\n");
    623636    }
     637}
    624638#endif
    625 
    626 
    627639        // scan this page until end of directory, end of page, or name found
    628640        while( (offset < 4096) && (found == 0) )
     
    693705    if ( found == -1 )  // found end of directory => failure
    694706    {
    695         fatfs_dmsg("\n[INFO] %s : exit / child <%s> not found in parent inode %l\n",
     707        fatfs_dmsg("\n[DMSG] %s : exit / child <%s> not found in parent inode %l\n",
    696708                   __FUNCTION__ , name , XPTR( local_cxy , parent_inode ) );
    697709
     
    711723        hal_remote_sw( XPTR( child_cxy , &child_ptr->extend ) , cluster );
    712724
    713         fatfs_dmsg("\n[INFO] %s : exit / child <%s> found in parent inode %l\n",
     725        fatfs_dmsg("\n[DMSG] %s : exit / child <%s> found in parent inode %l\n",
    714726                   __FUNCTION__ , name , XPTR( local_cxy , parent_inode ) );
    715727
  • trunk/kernel/vfs/fatfs.h

    r401 r406  
    202202 ******************************************************************************************
    203203 * @ mapper                  : local pointer on the FAT mapper.
    204  * @ first_cluster_id    : index of the first FATFS cluster allocated to the file.
    205  * @ searched_page       : index of searched page in the file.
     204 * @ first_cluster       : index of the first FATFS cluster allocated to the file.
     205 * @ page_index          : index of searched page in file.
    206206 * @ searched_cluster_id : [out] found FATFS cluster index.
    207207 * @ return 0 if success / return EIO if a FAT mapper miss cannot be solved.
  • trunk/kernel/vfs/vfs.c

    r401 r406  
    17071707    assert( (mapper != NULL) , __FUNCTION__ , "no mapper for page\n" );
    17081708
    1709     vfs_dmsg("\n[INFO] %s : enters for page %d in mapper / inode_xp %l\n",
    1710     __FUNCTION__ , page->index , XPTR( local_cxy , &mapper->inode ) );
     1709    vfs_dmsg("\n[DMSG] %s : enters for page %d / inode_cxy = %x / inode_ptr = %x\n",
     1710    __FUNCTION__ , page->index , local_cxy , mapper->inode );
    17111711
    17121712    // get FS type
     
    17331733    }
    17341734
    1735     vfs_dmsg("\n[INFO] %s : exit for page %d in mapper / inode %l\n",
    1736     __FUNCTION__ , page->index , XPTR( local_cxy , &mapper->inode) );
     1735    vfs_dmsg("\n[DMSG] %s : exit for page %d / inode_cxy = %x / inode_ptr = %x\n",
     1736    __FUNCTION__ , page->index , local_cxy , mapper->inode );
    17371737
    17381738    return error;
Note: See TracChangeset for help on using the changeset viewer.