Changeset 672


Ignore:
Timestamp:
Nov 19, 2020, 11:49:01 PM (3 years ago)
Author:
alain
Message:

1) Introduce up to 4 command lines arguments in the KSH "load" command.
These arguments are transfered to the user process through the
argc/argv mechanism, using the user space "args" vseg.

2) Introduce the named and anonymous "pipes", for inter-process communication
through the pipe() and mkfifo() syscalls.

3) Introduce the "chat" application to validate the two above mechanisms.

4) Improve printk() and assert() fonctions in printk.c.

Location:
trunk/kernel/mm
Files:
9 edited

Legend:

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

    r657 r672  
    22 * kcm.c -  Kernel Cache Manager implementation.
    33 *
    4  * Author  Alain Greiner    (2016,2017,2018,2019)
     4 * Author  Alain Greiner    (2016,2017,2018,2019,2020)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    6060    uint64_t status = kcm_page->status;
    6161
    62 assert( (count < max) , "kcm_page should not be full" );
     62assert( __FUNCTION__, (count < max) , "kcm_page should not be full" );
    6363
    6464    uint32_t index  = 1;
     
    9494        void * ptr = (void *)((intptr_t)kcm_page + (index * size) );
    9595
    96 #if (DEBUG_KCM & 1)
     96#if DEBUG_KCM
    9797thread_t * this  = CURRENT_THREAD;
    9898uint32_t   cycle = (uint32_t)hal_get_cycles();
     
    132132    uint64_t mask = ((uint64_t)0x1) << index;
    133133
    134 assert( (status & mask) , "released block not allocated : status (%x,%x) / mask(%x,%x)",
    135 GET_CXY(status), GET_PTR(status), GET_CXY(mask  ), GET_PTR(mask  ) );
     134    if( (status & mask) == 0 )
     135    {
     136        printk("\n[WARNING] in %s : block[%x,%x] not allocated / kcm %x / kcm_page %x\n",
     137        __FUNCTION__, local_cxy, block_ptr, kcm, kcm_page );
     138        printk("   status %L / mask %L / sts & msk %L\n", status, mask, (status & mask) );
     139        kcm_remote_display( local_cxy , kcm );
     140        return;
     141    }
    136142
    137143    // update status & count in kcm_page
     
    149155        }
    150156
    151 #if (DEBUG_KCM & 1)
     157#if DEBUG_KCM
    152158thread_t * this  = CURRENT_THREAD;
    153159uint32_t   cycle = (uint32_t)hal_get_cycles();
    154160if( DEBUG_KCM < cycle )
    155 printk("\n[%s] thread[%x,%x] released block %x in page %x / size %d / count %d / cycle %d\n",
     161printk("\n[%s] thread[%x,%x] block %x / page %x / size %d / count %d / cycle %d\n",
    156162__FUNCTION__, this->process->pid, this->trdid, block_ptr, kcm_page, size, count - 1, cycle );
    157163#endif
     
    219225{
    220226
    221 assert( ((order > 5) && (order < 12)) , "order must be in [6,11]" );
     227assert( __FUNCTION__, ((order > 5) && (order < 12)) , "order must be in [6,11]" );
     228
     229assert( __FUNCTION__, (CONFIG_PPM_PAGE_SHIFT == 12) , "check status bit_vector width" );
    222230
    223231        // initialize lock
     
    286294    if( order < 6 ) order = 6;
    287295
    288 assert( (order < 12) , "order = %d / must be less than 12" , order );
     296assert( __FUNCTION__, (order < 12) , "order = %d / must be less than 12" , order );
    289297
    290298    // get local pointer on relevant KCM allocator
     
    303311thread_t * this  = CURRENT_THREAD;
    304312uint32_t   cycle = (uint32_t)hal_get_cycles();
    305 if( (DEBUG_KCM < cycle) && (local_cxy == 1) )
     313if( DEBUG_KCM < cycle )
    306314{
    307315printk("\n[%s] thread[%x,%x] enters / order %d / page %x / kcm %x / page_status (%x|%x)\n",
     
    325333
    326334#if DEBUG_KCM
    327 if( (DEBUG_KCM < cycle) && (local_cxy == 1) )
    328 {
     335if( DEBUG_KCM < cycle )
    329336printk("\n[%s] thread[%x,%x] exit / order %d / block %x / kcm %x / page_status (%x|%x)\n",
    330337__FUNCTION__, this->process->pid, this->trdid, order, block_ptr, kcm_ptr,
    331338GET_CXY( kcm_page->status ), GET_PTR( kcm_page->status ) );
    332 kcm_remote_display( local_cxy , kcm_ptr );
    333 }
    334339#endif
    335340
     
    345350
    346351// check argument
    347 assert( (block_ptr != NULL) , "block pointer cannot be NULL" );
     352assert( __FUNCTION__, (block_ptr != NULL) , "block pointer cannot be NULL" );
    348353
    349354    // get local pointer on KCM page
     
    389394}  // end kcm_free()
    390395
     396
    391397/////////////////////////////////////////////////////////////////////////////////////
    392398//        Remote access functions
     
    414420    uint32_t size   = 1 << order;
    415421
    416 assert( (count < max) , "kcm_page should not be full" );
     422assert( __FUNCTION__, (count < max) , "kcm_page should not be full" );
    417423
    418424    uint32_t index  = 1;
     
    485491
    486492    // compute mask in bit vector
    487     uint64_t mask = 1 << index;
    488 
    489 assert( (status & mask) , "released page not allocated" );
     493    uint64_t mask = ((uint64_t)0x1) << index;
     494
     495    if( (status & mask) == 0 )
     496    {
     497        printk("\n[WARNING] in %s : block[%x,%x] not allocated / kcm %x / kcm_page %x\n",
     498        __FUNCTION__, kcm_cxy, block_ptr, kcm_ptr, kcm_page );
     499        printk("   status %L / mask %L / sts & msk %L\n", status, mask, (status & mask) );
     500        kcm_remote_display( kcm_cxy , kcm_ptr );
     501        return;
     502    }
    490503
    491504    // update status & count in kcm_page
     
    507520uint32_t   cycle = (uint32_t)hal_get_cycles();
    508521if( DEBUG_KCM_REMOTE < cycle )
    509 printk("\n[%s] thread[%x,%x] released block %x in page %x / cluster %x / size %x / count %d\n",
     522printk("\n[%s] thread[%x,%x] block %x / page %x / cluster %x / size %x / count %d\n",
    510523__FUNCTION__, this->process->pid, this->trdid, block_ptr, kcm_page, size, count - 1 )
    511524#endif
     
    564577}  // end kcm_remote_get_page()
    565578
    566 /////////////////////////////////////////
     579//////////////////////////////////////////
    567580void * kcm_remote_alloc( cxy_t    kcm_cxy,
    568581                         uint32_t order )
     
    574587    if( order < 6 ) order = 6;
    575588
    576 assert( (order < 12) , "order = %d / must be less than 12" , order );
     589assert( __FUNCTION__, (order < 12) , "order = %d / must be less than 12" , order );
    577590
    578591    // get local pointer on relevant KCM allocator
     
    620633
    621634// check argument
    622 assert( (block_ptr != NULL) , "block pointer cannot be NULL" );
     635assert( __FUNCTION__, (block_ptr != NULL) , "block pointer cannot be NULL" );
    623636
    624637    // get local pointer on remote KCM page
  • trunk/kernel/mm/kcm.h

    r657 r672  
    22 * kcm.h - Kernel Cache Manager definition.
    33 *
    4  * Authors    Alain Greiner (2016,2017,2018,2019)
     4 * Authors    Alain Greiner (2016,2017,2018,2019,2020)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    5858        list_entry_t         active_root;      /*! root of active pages list               */
    5959
    60         uint32_t             full_pages_nr;    /*! number of busy pages                    */
     60        uint32_t             full_pages_nr;    /*! number of full pages                    */
    6161        uint32_t             active_pages_nr;  /*! number of active pages                  */
    6262
     
    6969/****************************************************************************************
    7070 * This structure defines a KCM-page descriptor.
    71  * A KCM-page contains at most (CONFIG_PPM_PAGE_SIZE / CONFIG_KCM_SLOT_SIZE) slots,
    72  * and each slot contains one block. The kcm page descriptor is stored in first slot.
     71 * A KCM-page contains (CONFIG_PPM_PAGE_SIZE / block_size) slots.
     72 * Each slot contains one block, but the kcm page descriptor is stored in first slot.
    7373 * The current allocation status is defined by the 64 bits "status" bit vector: each
    74  * non zero bit defines an allocated block / "counts is the number of allocated blocks.
    75  * Each kcm_page is registered in one of the two following page_list:
     74 * non zero bit defines an allocated block / "count" is the number of allocated blocks.
     75 * Each kcm_page is registered in one of the two following lists, rooted in the kcm:
    7676 * - full   : when count == max
    7777 * - active : count < max
     
    148148
    149149/****************************************************************************************
    150  * This debug function can be called by any thread running in any cluster.
    151  * It diplays on TXT0 the current state of a local KCM allocator.
     150 * This debug function can be called by any thread running in any cluster. It displays
     151 * on TXT0 the state of a KCM, identified by the <kcm_cxy> & <kcm_ptr> arguments.
    152152 ****************************************************************************************
    153153 * @ kcm_cxy : remote KCM cluster identifier.
  • trunk/kernel/mm/khm.c

    r567 r672  
    4040{
    4141        // check config parameters
    42         assert( ((CONFIG_PPM_PAGE_SHIFT + CONFIG_PPM_HEAP_ORDER) < 32 ) ,
     42        assert( __FUNCTION__, ((CONFIG_PPM_PAGE_SHIFT + CONFIG_PPM_HEAP_ORDER) < 32 ) ,
    4343                 "CONFIG_PPM_HEAP_ORDER too large" );
    4444
     
    142142        busylock_acquire(&khm->lock);
    143143
    144         assert( (current->busy == 1) , "page already freed" );
     144        assert( __FUNCTION__, (current->busy == 1) , "page already freed" );
    145145
    146146        // release block
  • trunk/kernel/mm/kmem.c

    r657 r672  
    2727#include <printk.h>
    2828#include <cluster.h>
     29#include <thread.h>
    2930#include <memcpy.h>
    3031#include <khm.h>
  • trunk/kernel/mm/mapper.c

    r657 r672  
    230230    // - it is a directory mapper
    231231    // - it is a file mapper, and it exist data on IOC device for this page
    232     if( (inode == NULL) || (inode_type == INODE_TYPE_DIR) || (inode_size > (page_id << 10) ) )
     232    if( (inode == NULL) || (inode_type == FILE_TYPE_DIR) || (inode_size > (page_id << 10) ) )
    233233    {
    234234        error = vfs_fs_move_page( page_xp , IOC_SYNC_READ );
     
    284284    cxy_t      mapper_cxy = GET_CXY( mapper_xp );
    285285
    286 assert( (hal_remote_lpt( XPTR( mapper_cxy , &mapper_ptr->inode ) ) != NULL ),
     286assert( __FUNCTION__, (hal_remote_lpt( XPTR( mapper_cxy , &mapper_ptr->inode ) ) != NULL ),
    287287"should not be used for the FAT mapper");
    288288
     
    385385    cxy_t      mapper_cxy = GET_CXY( mapper_xp );
    386386
    387 assert( (hal_remote_lpt( XPTR( mapper_cxy , &mapper_ptr->inode ) ) == NULL ),
     387assert( __FUNCTION__, (hal_remote_lpt( XPTR( mapper_cxy , &mapper_ptr->inode ) ) == NULL ),
    388388"should be used for the FAT mapper");
    389389
     
    890890    char       name[CONFIG_VFS_MAX_NAME_LENGTH];
    891891
    892 assert( (nbytes <= 4096)         , "nbytes cannot be larger than 4096");
    893 assert( (mapper_xp != XPTR_NULL) , "mapper_xp argument cannot be null");
     892assert( __FUNCTION__, (nbytes <= 4096)         , "nbytes cannot be larger than 4096");
     893assert( __FUNCTION__, (mapper_xp != XPTR_NULL) , "mapper_xp argument cannot be null");
    894894
    895895    // get mapper cluster and local pointer
     
    908908    mapper_t * mapper  = hal_remote_lpt( XPTR( page_cxy , &page_ptr->mapper ) );
    909909
    910 assert( (mapper_cxy == page_cxy ) , "mapper and page must be in same cluster");
    911 assert( (mapper_ptr == mapper   ) , "unconsistent mapper field in page descriptor");
    912 assert( (page_id    == index    ) , "unconsistent index  field in page descriptor");
     910assert( __FUNCTION__, (mapper_cxy == page_cxy ) , "mapper and page must be in same cluster");
     911assert( __FUNCTION__, (mapper_ptr == mapper   ) , "unconsistent mapper field in page descriptor");
     912assert( __FUNCTION__, (page_id    == index    ) , "unconsistent index  field in page descriptor");
    913913
    914914    // get inode
  • trunk/kernel/mm/ppm.c

    r657 r672  
    158158        page_t   * pages_tbl   = ppm->pages_tbl;
    159159
    160 assert( !page_is_flag( page , PG_FREE ) ,
     160assert( __FUNCTION__, !page_is_flag( page , PG_FREE ) ,
    161161"page already released : ppn = %x\n" , ppm_page2ppn( XPTR( local_cxy , page ) ) );
    162162
    163 assert( !page_is_flag( page , PG_RESERVED ) ,
     163assert( __FUNCTION__, !page_is_flag( page , PG_RESERVED ) ,
    164164"reserved page : ppn = %x\n" , ppm_page2ppn( XPTR( local_cxy , page ) ) );
    165165
     
    232232
    233233// check order
    234 assert( (order < CONFIG_PPM_MAX_ORDER) , "illegal order argument = %d\n" , order );
     234assert( __FUNCTION__, (order < CONFIG_PPM_MAX_ORDER) , "illegal order argument = %d\n" , order );
    235235
    236236    //build extended pointer on lock protecting remote PPM
     
    388388
    389389// check order
    390 assert( (order < CONFIG_PPM_MAX_ORDER) , "illegal order argument = %d\n" , order );
     390assert( __FUNCTION__, (order < CONFIG_PPM_MAX_ORDER) , "illegal order argument = %d\n" , order );
    391391
    392392    // get local pointer on PPM (same in all clusters)
     
    548548        remote_busylock_acquire( lock_xp );
    549549
    550 assert( !page_remote_is_flag( page_xp , PG_FREE ) ,
     550assert( __FUNCTION__, !page_remote_is_flag( page_xp , PG_FREE ) ,
    551551"page already released : ppn = %x\n" , ppm_page2ppn(XPTR( page_cxy , page_ptr ) ) );
    552552
    553 assert( !page_remote_is_flag( page_xp , PG_RESERVED ) ,
     553assert( __FUNCTION__, !page_remote_is_flag( page_xp , PG_RESERVED ) ,
    554554"reserved page : ppn = %x\n" , ppm_page2ppn(XPTR( page_cxy , page_ptr ) ) );
    555555
  • trunk/kernel/mm/vmm.c

    r665 r672  
    22 * vmm.c - virtual memory manager related operations definition.
    33 *
    4  * Authors   Ghassan Almaless (2008,2009,2010,2011, 2012)
    5  *           Alain Greiner (2016,2017,2018,2019,2020)
     4 * Authors   Ghassan Almaless (2008,2009,2010,2011,2012)
     5 *           Alain Greiner    (2016,2017,2018,2019,2020)
    66 *
    77 * Copyright (c) UPMC Sorbonne Universites
     
    6363
    6464// check STACK zone
    65 assert( ((CONFIG_VMM_STACK_SIZE * CONFIG_THREADS_MAX_PER_CLUSTER) <=
     65assert( __FUNCTION__, ((CONFIG_VMM_STACK_SIZE * CONFIG_THREADS_MAX_PER_CLUSTER) <=
    6666(CONFIG_VMM_VSPACE_SIZE - CONFIG_VMM_STACK_BASE)) , "STACK zone too small\n");
    6767
     
    8989
    9090// check ltid argument
    91 assert( (ltid <= ((CONFIG_VMM_VSPACE_SIZE - CONFIG_VMM_STACK_BASE) / CONFIG_VMM_STACK_SIZE)),
     91assert( __FUNCTION__, (ltid <= ((CONFIG_VMM_VSPACE_SIZE - CONFIG_VMM_STACK_BASE) / CONFIG_VMM_STACK_SIZE)),
    9292"slot index %d too large for an user stack vseg", ltid );
    9393
     
    9999
    100100// check requested slot is available
    101 assert( (bitmap_state( &mgr->bitmap , ltid ) == false),
     101assert( __FUNCTION__, (bitmap_state( &mgr->bitmap , ltid ) == false),
    102102"slot index %d already allocated", ltid );
    103103
     
    149149
    150150// check index
    151 assert( (index <= ((CONFIG_VMM_VSPACE_SIZE - CONFIG_VMM_STACK_BASE) / CONFIG_VMM_STACK_SIZE)),
     151assert( __FUNCTION__, (index <= ((CONFIG_VMM_VSPACE_SIZE - CONFIG_VMM_STACK_BASE) / CONFIG_VMM_STACK_SIZE)),
    152152"slot index %d too large for an user stack vseg", index );
    153153
    154154// check released slot is allocated
    155 assert( (bitmap_state( &mgr->bitmap , index ) == true),
     155assert( __FUNCTION__, (bitmap_state( &mgr->bitmap , index ) == true),
    156156"released slot index %d non allocated", index );
    157157
     
    226226
    227227// check HEAP base and size
    228 assert( (CONFIG_VMM_HEAP_BASE == 0x40000) & (CONFIG_VMM_STACK_BASE == 0xc0000),
     228assert( __FUNCTION__, (CONFIG_VMM_HEAP_BASE == 0x40000) & (CONFIG_VMM_STACK_BASE == 0xc0000),
    229229"CONFIG_VMM_HEAP_BASE != 0x40000 or CONFIG_VMM_STACK_BASE != 0xc0000" );
    230230
    231231// check  MMAP vseg max order
    232 assert( (CONFIG_VMM_HEAP_MAX_ORDER == 18), "max mmap vseg size is 256K pages" );
     232assert( __FUNCTION__, (CONFIG_VMM_HEAP_MAX_ORDER == 18), "max mmap vseg size is 256K pages" );
    233233
    234234    // get pointer on MMAP allocator
     
    252252    vseg_t * vseg0 = vseg_alloc();
    253253
    254 assert( (vseg0 != NULL) , "cannot allocate vseg" );
     254assert( __FUNCTION__, (vseg0 != NULL) , "cannot allocate vseg" );
    255255
    256256    vseg0->vpn_base = CONFIG_VMM_HEAP_BASE;
     
    263263    vseg_t * vseg1 = vseg_alloc();
    264264
    265 assert( (vseg1 != NULL) , "cannot allocate vseg" );
     265assert( __FUNCTION__, (vseg1 != NULL) , "cannot allocate vseg" );
    266266
    267267    vseg1->vpn_base = CONFIG_VMM_HEAP_BASE << 1;
     
    555555
    556556// check UTILS zone
    557 assert( ((CONFIG_VMM_ARGS_SIZE + CONFIG_VMM_ENVS_SIZE) <=
    558          (CONFIG_VMM_ELF_BASE - CONFIG_VMM_UTILS_BASE)) ,
    559          "UTILS zone too small\n" );
     557assert( __FUNCTION__ , ((CONFIG_VMM_ARGS_SIZE + CONFIG_VMM_ENVS_SIZE) <=
     558(CONFIG_VMM_ELF_BASE - CONFIG_VMM_UTILS_BASE)) , "UTILS zone too small\n" );
    560559
    561560    // initialize lock protecting the VSL
    562561        remote_queuelock_init( XPTR( local_cxy , &vmm->vsl_lock ) , LOCK_VMM_VSL );
    563 
    564562
    565563    // initialize STACK allocator
     
    577575        vmm->global_pgfault_cost = 0;
    578576
    579 /*
    580     // register "args" vseg in VSL
    581     base = CONFIG_VMM_UTILS_BASE << CONFIG_PPM_PAGE_SHIFT;
    582     size = CONFIG_VMM_ARGS_SIZE << CONFIG_PPM_PAGE_SHIFT;
    583 
    584     vseg_args = vmm_create_vseg( process,
    585                                  VSEG_TYPE_DATA,
    586                                  base,
    587                                  size,
    588                                  0,             // file_offset unused
    589                                  0,             // file_size unused
    590                                  XPTR_NULL,     // mapper_xp unused
    591                                  local_cxy );
    592     if( vseg_args == NULL )
    593     {
    594         printk("\n[ERROR] in %s : cannot register args vseg\n", __FUNCTION__ );
    595         return -1;
    596     }
    597 
    598     vmm->args_vpn_base = base;
    599 
    600     // register "envs" vseg in VSL
    601     base = (CONFIG_VMM_UTILS_BASE + CONFIG_VMM_ARGS_SIZE) << CONFIG_PPM_PAGE_SHIFT;
    602     size = CONFIG_VMM_ENVS_SIZE << CONFIG_PPM_PAGE_SHIFT;
    603 
    604     vseg_envs = vmm_create_vseg( process,
    605                                  VSEG_TYPE_DATA,
    606                                  base,
    607                                  size,
    608                                  0,             // file_offset unused
    609                                  0,             // file_size unused
    610                                  XPTR_NULL,     // mapper_xp unused
    611                                  local_cxy );
    612     if( vseg_envs == NULL )
    613     {
    614         printk("\n[ERROR] in %s : cannot register envs vseg\n", __FUNCTION__ );
    615         return -1;
    616     }
    617 
    618     vmm->envs_vpn_base = base;
    619 */
    620577    hal_fence();
    621578
     
    716673// FIXME il faut gérer les process copies...
    717674
     675    // re-initialise VMM
     676    vmm_user_init( process );
     677
    718678#if DEBUG_VMM_USER_RESET
    719679cycle = (uint32_t)hal_get_cycles();
     
    11331093
    11341094// check cluster is reference
    1135 assert( (XPTR( local_cxy , process ) == process->ref_xp),
     1095assert( __FUNCTION__, (XPTR( local_cxy , process ) == process->ref_xp),
    11361096"local cluster must be process reference cluster\n");
    11371097
     
    18691829
    18701830// check arguments
    1871 assert( (process != NULL), "process argument is NULL" );
    1872 assert( (vseg    != NULL), "vseg argument is NULL" );
     1831assert( __FUNCTION__, (process != NULL), "process argument is NULL" );
     1832assert( __FUNCTION__, (vseg    != NULL), "vseg argument is NULL" );
    18731833
    18741834    // get pointers on local process VMM
     
    19601920
    19611921// check arguments
    1962 assert( (process != NULL), "process argument is NULL" );
    1963 assert( (vseg    != NULL), "vseg argument is NULL" );
     1922assert( __FUNCTION__, (process != NULL), "process argument is NULL" );
     1923assert( __FUNCTION__, (vseg    != NULL), "vseg argument is NULL" );
    19641924
    19651925#if DEBUG_VMM_RESIZE_VSEG
     
    22282188
    22292189// check vseg type
    2230 assert( ( type != VSEG_TYPE_FILE ) , "illegal vseg type\n" );
     2190assert( __FUNCTION__, ( type != VSEG_TYPE_FILE ) , "illegal vseg type\n" );
    22312191
    22322192    // compute target cluster identifier
     
    23022262        xptr_t mapper_xp = vseg->mapper_xp;
    23032263
    2304 assert( (mapper_xp != XPTR_NULL),
     2264assert( __FUNCTION__, (mapper_xp != XPTR_NULL),
    23052265"mapper not defined for a FILE vseg\n" );
    23062266       
     
    23272287            xptr_t     mapper_xp = vseg->mapper_xp;
    23282288
    2329 assert( (mapper_xp != XPTR_NULL),
     2289assert( __FUNCTION__, (mapper_xp != XPTR_NULL),
    23302290"mapper not defined for a CODE or DATA vseg\n" );
    23312291       
  • trunk/kernel/mm/vmm.h

    r657 r672  
    33 *
    44 * Authors   Ghassan Almaless (2008,2009,2010,2011, 2012)
    5  *           Alain Greiner (2016,2017,2018,2019,2020))
     5 *           Alain Greiner    (2016,2017,2018,2019,2020))
    66 *
    77 * Copyright (c) UPMC Sorbonne Universites
     
    5353 *   corresponding bit in the bitmap.
    5454 * - The de-allocator reset the corresponding bit in the bitmap.
     55 *
     56 * An  architecture dependant hal_vmm_display() function is defined in <hal_vmm.h> file.
    5557 ********************************************************************************************/
    5658
     
    9395/*********************************************************************************************
    9496 * This structure defines the Virtual Memory Manager for a given process in a given cluster.
    95  * This local VMM implements four main services:
    96  * 1) It contains the local copy of vseg list (VSL), only complete in referrence.
     97 * This VMM implements four main services:
     98 * 1) It contains the local copy of the vseg list (VSL), only complete in reference cluster.
    9799 * 2) It contains the local copy of the generic page table (GPT), only complete in reference.
    98100 * 3) The stack manager dynamically allocates virtual memory space for the STACK vsegs.
     
    141143
    142144/*********************************************************************************************
    143  * This function makes only a partial initialisation of the VMM attached to an user
    144  * process: It intializes the STACK and MMAP allocators, and the VSL lock.
    145  * - The GPT has been previously created, with the hal_gpt_create() function.
    146  * - The "kernel" vsegs are previously registered, by the hal_vmm_kernel_update() function.
    147  * - The "code" and "data" vsegs arlmmmmmme registered by the elf_load_process() function.
    148  * - The "stack" vsegs are dynamically registered by the thread_user_create() function.
     145 * This function makes a partial initialisation of the VMM attached to an user process.
     146 * It intializes the STACK and MMAP allocators, the VSL lock, and the instrumentation
     147 * counters, but it does not register any vseg in the VSL:
     148 * - The "kernel" vsegs are registered, by the hal_vmm_kernel_update() function.
     149 * - The "args" & "envs" vsegs are registered by the process_make_exec() function.
     150 * - The "code" and "data" vsegs are registered by the elf_load_process() function.
     151 * - The "stack" vsegs are registered by process_make_exec() / thread_user_create().
    149152 * - The "file", "anon", "remote" vsegs are dynamically registered by the mmap() syscall.
    150153 *********************************************************************************************
     
    155158
    156159/*********************************************************************************************
    157  * This function re-initialises the VMM attached to an user process to prepare a new
    158  * call to the vmm_user_init() function after an exec() syscall.
    159  * It removes from the VMM of the process identified by the <process> argument all
    160  * all user vsegs, by calling the vmm_remove_vseg() function.
    161  * - the vsegs are removed from the VSL.
    162  * - the corresponding GPT entries are removed from the GPT.
    163  * - the physical pages are released to the relevant kmem when they are not shared.
    164  * The VSL and the GPT are not modified for the kernel vsegs.
     160 * This function is called by the process_make_exec() function to re-initialises the VMM
     161 * attached to an user process:
     162 * - It removes from the VMM of the process identified by the <process> argument all user
     163 *   vsegs, by calling the vmm_remove_vseg() function: the vsegs are removed from the VSL,
     164 *   the corresponding GPT entries are removed from the GPT, and the physical pages are
     165 *   released to the relevant kmem when they are not shared.
     166 * - The VSL and the GPT are not modified for the kernel vsegs.
     167 * - Finally, it calls the vmm_user_init() function to re-initialize the STAK and MMAP
     168 *   allocators, and the lock protecting GPT.
    165169 *********************************************************************************************
    166170 * @ process   : pointer on process descriptor.
  • trunk/kernel/mm/vseg.c

    r657 r672  
    142142    else
    143143    {
    144             assert( false , "illegal vseg type\n" );
     144            assert( __FUNCTION__, false , "illegal vseg type\n" );
    145145    }
    146146
     
    191191        default:
    192192        {
    193             assert( false, "Illegal vseg type" );
     193            assert( __FUNCTION__, false, "Illegal vseg type" );
    194194            break;
    195195        }
Note: See TracChangeset for help on using the changeset viewer.