Changeset 611 for trunk/kernel/mm/kmem.c


Ignore:
Timestamp:
Jan 9, 2019, 3:02:51 PM (5 years ago)
Author:
alain
Message:

Introduce sigificant modifs in VFS to support the <ls> command,
and the . and .. directories entries.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/kmem.c

    r577 r611  
    4040#include <fatfs.h>
    4141#include <ramfs.h>
     42#include <remote_dir.h>
    4243#include <remote_sem.h>
    4344#include <remote_barrier.h>
     
    100101    else if( type == KMEM_CONDVAR )       return sizeof( remote_condvar_t );
    101102    else if( type == KMEM_MUTEX )         return sizeof( remote_mutex_t );
     103    else if( type == KMEM_DIR )           return sizeof( remote_dir_t );
     104
    102105        else if( type == KMEM_512_BYTES )     return 512;
    103106
     
    128131    else if( type == KMEM_CONDVAR )       return "KMEM_CONDVAR";
    129132    else if( type == KMEM_MUTEX )         return "KMEM_MUTEX";
     133    else if( type == KMEM_DIR )           return "KMEM_DIR";
     134
    130135        else if( type == KMEM_512_BYTES )     return "KMEM_512_BYTES";
    131136
     
    144149
    145150#if DEBUG_KMEM
     151thread_t * this = CURRENT_THREAD;
    146152uint32_t cycle = (uint32_t)hal_get_cycles();
    147153if( DEBUG_KMEM < cycle )
    148 printk("\n[DBG] %s : thread %x enter / KCM type %s missing in cluster %x / cycle %d\n",
    149 __FUNCTION__, CURRENT_THREAD, kmem_type_str( type ), local_cxy, cycle );
     154printk("\n[%s] thread[%x,%x] enter / KCM type %s missing in cluster %x / cycle %d\n",
     155__FUNCTION__, this->process->pid, this->trdid, kmem_type_str( type ), local_cxy, cycle );
    150156#endif
    151157
     
    174180cycle = (uint32_t)hal_get_cycles();
    175181if( DEBUG_KMEM < cycle )
    176 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
    177 __FUNCTION__, CURRENT_THREAD, cycle );
     182printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
     183__FUNCTION__, this->process->pid, this->trdid, cycle );
    178184#endif
    179185
     
    198204
    199205#if DEBUG_KMEM
     206thread_t * this = CURRENT_THREAD;
    200207uint32_t cycle = (uint32_t)hal_get_cycles();
    201208if( DEBUG_KMEM < cycle )
    202 printk("\n[DBG] %s : thread %x enter / type %s / cluster %x / cycle %d\n",
    203 __FUNCTION__, CURRENT_THREAD, kmem_type_str( type ), local_cxy, cycle );
     209printk("\n[%s] thread [%x,%x] enter / %s / size %d / cluster %x / cycle %d\n",
     210__FUNCTION__, this->process->pid, this->trdid,
     211kmem_type_str( type ), size, local_cxy, cycle );
    204212#endif
    205213
     
    222230cycle = (uint32_t)hal_get_cycles();
    223231if( DEBUG_KMEM < cycle )
    224 printk("\n[DBG] %s : thread %x exit / %d page(s) allocated / ppn %x / cycle %d\n",
    225 __FUNCTION__, CURRENT_THREAD, 1<<size, ppm_page2ppn(XPTR(local_cxy,ptr)), cycle );
     232printk("\n[%s] thread[%x,%x] exit / %d page(s) allocated / ppn %x / cycle %d\n",
     233__FUNCTION__, this->process->pid, this->trdid,
     2341<<size, ppm_page2ppn(XPTR(local_cxy,ptr)), cycle );
    226235#endif
    227236
     
    244253cycle = (uint32_t)hal_get_cycles();
    245254if( DEBUG_KMEM < cycle )
    246 printk("\n[DBG] %s : thread %x exit / type %s allocated / base %x / size %d / cycle %d\n",
    247 __FUNCTION__, CURRENT_THREAD, kmem_type_str( type ), (intptr_t)ptr, size, cycle );
     255printk("\n[%s] thread[%x,%x] exit / type %s allocated / base %x / size %d / cycle %d\n",
     256__FUNCTION__, this->process->pid, this->trdid,
     257kmem_type_str( type ), (intptr_t)ptr, size, cycle );
    248258#endif
    249259
     
    286296cycle = (uint32_t)hal_get_cycles();
    287297if( DEBUG_KMEM < cycle )
    288 printk("\n[DBG] %s : thread %x exit / type %s allocated / base %x / size %d / cycle %d\n",
    289 __FUNCTION__, CURRENT_THREAD, kmem_type_str(type), (intptr_t)ptr,
     298printk("\n[%s] thread [%x,%x] exit / type %s allocated / base %x / size %d / cycle %d\n",
     299__FUNCTION__, this->process->pid, this->trdid, kmem_type_str(type), (intptr_t)ptr,
    290300kmem_type_size(type), cycle );
    291301#endif
Note: See TracChangeset for help on using the changeset viewer.