Changeset 406 for trunk/kernel/mm/vmm.h


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.
Note: See TracChangeset for help on using the changeset viewer.