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


Ignore:
Timestamp:
Oct 5, 2018, 12:01:52 AM (6 years ago)
Author:
alain
Message:

Complete restructuration of kernel locks.

File:
1 edited

Legend:

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

    r469 r567  
    3030#include <bits.h>
    3131#include <list.h>
    32 #include <spinlock.h>
     32#include <queuelock.h>
    3333#include <hal_gpt.h>
    3434#include <vseg.h>
     
    5454typedef struct stack_mgr_s
    5555{
    56     spinlock_t     lock;               /*! lock protecting STACK allocator                  */
     56    busylock_t     lock;               /*! lock protecting STACK allocator                  */
    5757    vpn_t          vpn_base;           /*! first page of STACK zone                         */
    5858    bitmap_t       bitmap;             /*! bit bector of allocated stacks                   */
     
    7979typedef struct mmap_mgr_s
    8080{
    81     spinlock_t     lock;               /*! lock protecting MMAP allocator                   */
     81    busylock_t     lock;               /*! lock protecting MMAP allocator                   */
    8282    vpn_t          vpn_base;           /*! first page of MMAP zone                          */
    8383    vpn_t          vpn_size;           /*! number of pages in MMAP zone                     */
     
    9090 * This structure defines the Virtual Memory Manager for a given process in a given cluster.
    9191 * This local VMM provides four main services:
    92  * 1) It registers all vsegs in the local copy of the vseg list (VSL).
    93  * 2) It contains the local copy of the generic page table (GPT).
     92 * 1) It contains the local copy of vseg list (VSL), only complete in referrence.
     93 * 2) It contains the local copy of the generic page table (GPT), only complete in reference.
    9494 * 3) The stack manager dynamically allocates virtual memory space for the STACK vsegs.
    9595 * 4) The mmap manager dynamically allocates virtual memory for the (FILE/ANON/REMOTE) vsegs.
     
    105105typedef struct vmm_s
    106106{
    107         remote_rwlock_t  vsegs_lock;         /*! lock protecting the vsegs list                 */
     107        remote_rwlock_t  vsegs_lock;         /*! lock protecting the local VSL                  */
    108108        xlist_entry_t    vsegs_root;         /*! VSL root (VSL only complete in reference)      */
    109109        uint32_t         vsegs_nr;           /*! total number of local vsegs                    */
     
    153153void vmm_display( struct process_s * process,
    154154                  bool_t             mapping );
     155
     156/*******************************************************************************************
     157 * This function adds a vseg descriptor in the VSL of a given VMM,
     158 * and updates the vmm field in the vseg descriptor.
     159 * It takes the lock protecting VSL.
     160 *******************************************************************************************
     161 * @ vmm       : pointer on the VMM
     162 * @ vseg      : pointer on the vseg descriptor
     163 ******************************************************************************************/
     164void vmm_vseg_attach( struct vmm_s  * vmm,
     165                      vseg_t        * vseg );
     166
     167/*******************************************************************************************
     168 * This function removes a vseg descriptor from the set of vsegs controlled by a given VMM,
     169 * and updates the vmm field in the vseg descriptor. No memory is released.
     170 * It takes the lock protecting VSL.
     171 *******************************************************************************************
     172 * @ vmm       : pointer on the VMM
     173 * @ vseg      : pointer on the vseg descriptor
     174 ******************************************************************************************/
     175void vmm_vseg_detach( struct vmm_s  * vmm,
     176                      vseg_t        * vseg );
    155177
    156178/*********************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.