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


Ignore:
Timestamp:
Jun 3, 2017, 4:42:49 PM (8 years ago)
Author:
max@…
Message:

cosmetic, and a few typos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/vmm.h

    r1 r18  
    55 *           Mohamed Lamine Karaoui (2015)
    66 *           Alain Greiner (2016)
    7  * 
     7 *
    88 * Copyright (c) UPMC Sorbonne Universites
    99 *
     
    5050 * The slot index can be computed form the slot base address, and reversely.
    5151 * All allocation / release operations are registered in the stack_bitmap, that completely
    52  * define the STACK zone state. 
     52 * define the STACK zone state.
    5353 * In this implementation, the max number of slots is 32.
    5454 ********************************************************************************************/
     
    6565 * This structure defines the MMAP allocator used by the VMM to dynamically allocate
    6666 * MMAP vsegs requested or released by an user process.
    67  * This allocator sould be only used in the reference cluster.
    68  * - allocation policy : all allocated vsegs occupy an integer number of pages that is 
     67 * This allocator should be only used in the reference cluster.
     68 * - allocation policy : all allocated vsegs occupy an integer number of pages that is
    6969 *   power of 2, and are aligned on a page boundary. The requested number of pages is
    70  *   rounded if reqired. The first_free_vpn variable defines completely the MMAP zone state.
     70 *   rounded if required. The first_free_vpn variable defines completely the MMAP zone state.
    7171 *   It is never decremented, as the released vsegs are simply registered in a zombi_list.
    72  *   The relevant zombi_list is checked first for each allocation request. 
     72 *   The relevant zombi_list is checked first for each allocation request.
    7373 * - release policy : a released MMAP vseg is registered in an array of zombi_lists.
    7474 *   This array is indexed by ln(number of pages), and each entry contains the root of
     
    9595 *    and in the associated radix-tree.
    9696 * 2) It allocates virtual memory space for the STACKS and MMAP vsegs,
    97  *    using dedicated allocators. 
     97 *    using dedicated allocators.
    9898 * 3) It contains the local copy of the generic page table descriptor.
    9999 ********************************************************************************************/
     
    136136typedef struct mmap_attr_s
    137137{
    138         void     * addr;            /*! requested virtual address (unused : should be NULL)     */ 
     138        void     * addr;            /*! requested virtual address (unused : should be NULL)     */
    139139        uint32_t   length;          /*! requested vseg size (bytes)                             */
    140140        uint32_t   prot;            /*! access modes                                            */
     
    159159/*********************************************************************************************
    160160 * This function removes all vsegs registered in in a virtual memory manager,
    161  * and releases the memory allocated to the local generic page table. 
     161 * and releases the memory allocated to the local generic page table.
    162162 *********************************************************************************************
    163163 * @ vmm   : pointer on process descriptor.
     
    166166
    167167/*********************************************************************************************
    168  * This function scan the list of vsegs registered in the VMM of a given process descriptor
     168 * This function scans the list of vsegs registered in the VMM of a given process descriptor
    169169 * to check if a given virtual region (defined by a base and size) overlap an existing vseg.
    170170 *********************************************************************************************
     
    179179
    180180/*********************************************************************************************
    181  * This function allocates memory for a vseg descriptor, initialises it, and register it 
     181 * This function allocates memory for a vseg descriptor, initialises it, and register it
    182182 * in the VMM of the process. It checks the collision with pre-existing vsegs in VMM.
    183183 * For STACK and MMAP types vseg, it does not use the base argument, but uses the VMM STACK
    184184 * and MMAP specific allocators to get a base address in virtual space.
    185  * To comply with the "on-demand" paging policy, this function does NOT mofify the
     185 * To comply with the "on-demand" paging policy, this function does NOT modify the
    186186 * page table, and does not allocate physical memory for vseg data.
    187187 *********************************************************************************************
     
    193193 ********************************************************************************************/
    194194vseg_t * vmm_create_vseg( struct process_s * process,
    195                           intptr_t           base, 
    196                               intptr_t           size, 
     195                          intptr_t           base,
     196                              intptr_t           size,
    197197                              uint32_t           type );
    198198
    199199/*********************************************************************************************
    200  * Ths function removes a vseg identified by it's pointer from the VMM of the calling process.
     200 * This function removes a vseg identified by it's pointer from the VMM of the calling process.
    201201 * - If the vseg has not the STACK or MMAP type, it is removed from the vsegs list,
    202202 *   and the physical memory allocated to vseg descriptor is released to KMEM.
     
    213213
    214214/*********************************************************************************************
    215  * This function allocates physical memory from the local cluster to map all PTEs 
     215 * This function allocates physical memory from the local cluster to map all PTEs
    216216 * of a "kernel" vseg (type KCODE , KDATA, or KDEV) in the page table of process_zero.
    217  * It should not be used for other vseg types, because "user" vsegs use the 
     217 * It should not be used for other vseg types, because "user" vsegs use the
    218218 * "on-demand-paging" policy.
    219219 *********************************************************************************************
     
    226226
    227227/*********************************************************************************************
    228  * This function unmap all PTEs of a given vseg, in the generic page table asociated
     228 * This function unmaps all PTEs of a given vseg, in the generic page table associated
    229229 * to a given process descriptor, and releases the corresponding physical memory.
    230230 * It can be used for any type of vseg.
     
    237237
    238238/*********************************************************************************************
    239  * This function remove a given region (defined by a base address and a size) from
     239 * This function removes a given region (defined by a base address and a size) from
    240240 * the VMM of a given process descriptor. This can modify several vsegs:
    241241 * (a) if the region is not entirely mapped in an existing vseg, it's an error.
     
    254254
    255255/*********************************************************************************************
    256  * This function search if a given virtual address is contained in a vseg registered in
     256 * This function searches if a given virtual address is contained in a vseg registered in
    257257 * the local process VMM and returns the vseg pointer if success.
    258258 *********************************************************************************************
     
    265265
    266266/*********************************************************************************************
    267  * This function is called by the architecture specific exception handler when a 
    268  * page fault has been detected in a given cluster. 
     267 * This function is called by the architecture specific exception handler when a
     268 * page fault has been detected in a given cluster.
    269269 * If the local cluster is not the reference cluster, it send a RPC_VMM_GET_PTE
    270270 * to the reference cluster to get the missing PTE attributes and PPN, and update
     
    279279error_t vmm_handle_page_fault( struct process_s * process,
    280280                               vseg_t           * vseg,
    281                                vpn_t              vpn ); 
     281                               vpn_t              vpn );
    282282
    283283/*********************************************************************************************
    284284 * This function returns in the "attr" and "ppn" arguments the PTE associated to a given
    285  * VPN for a given process. This function must be called on the reference cluster. 
     285 * VPN for a given process. This function must be called on the reference cluster.
    286286 * To get the PTE from another cluster, use the RPC_VMM_GET_PTE.
    287287 * The vseg containing the searched VPN should be registered in the reference VMM.
    288288 * If the PTE in the reference page table is unmapped, this function allocates the missing
    289289 * physical page from the target cluster defined by the vseg type, and update the reference
    290  * page table. It can call a RPC_PMEM_GET_PAGES to get the missing physical page, 
     290 * page table. It can call a RPC_PMEM_GET_PAGES to get the missing physical page,
    291291 * if the target cluster is not the reference cluster.
    292292 *********************************************************************************************
     
    303303
    304304/*********************************************************************************************
    305  * This function makes the virtual to physical address translation, using the calling 
    306  * process page table. It uses identity mapping if required by the ident flag. 
     305 * This function makes the virtual to physical address translation, using the calling
     306 * process page table. It uses identity mapping if required by the ident flag.
    307307 * This address translation is required to configure the devices
    308  * that have a DMA capability, or to implement the software L2/L3 cache cohérence, 
     308 * that have a DMA capability, or to implement the software L2/L3 cache cohérence,
    309309 * using the MMC device synchronisation primitives.
    310310 * WARNING : the <ident> value must be defined by the CONFIG_KERNEL_IDENT parameter.
     
    333333/*********************************************************************************************
    334334 ********************************************************************************************/
    335 int sys_sbrk( uint32_t current_heap_ptr, 
     335int sys_sbrk( uint32_t current_heap_ptr,
    336336              uint32_t size );
    337337
    338338/*********************************************************************************************
    339339 ********************************************************************************************/
    340 error_t vmm_sbrk( vmm_t   * vmm, 
     340error_t vmm_sbrk( vmm_t   * vmm,
    341341                  uint32_t  current,
    342342                  uint32_t  size );
     
    345345 ********************************************************************************************/
    346346error_t vmm_madvise_migrate( vmm_t    * vmm,
    347                              uint32_t   start, 
     347                             uint32_t   start,
    348348                             uint32_t   len );
    349349
     
    361361
    362362/*********************************************************************************************
    363  * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked 
     363 * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked
    364364 ********************************************************************************************/
    365365error_t vmm_broadcast_inval( vseg_t * region,
     
    368368
    369369/*********************************************************************************************
    370  * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked 
     370 * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked
    371371 ********************************************************************************************/
    372372error_t vmm_migrate_shared_page_seq( vseg_t * region,
Note: See TracChangeset for help on using the changeset viewer.