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


Ignore:
Timestamp:
Aug 16, 2017, 2:33:17 PM (4 years ago)
Author:
alain
Message:

Change the vmm_get_vseg() function to access the reference cluster VMM,
in case of miss on the local VMM.

File:
1 edited

Legend:

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

    r313 r388  
    262262
    263263/*********************************************************************************************
    264  * This function searches if a given virtual address is contained in a vseg registered in
    265  * the local process VMM and returns the vseg pointer if success.
    266  *********************************************************************************************
    267  * @ process   : pointer on process descriptor
    268  * @ vaddr     : virtual address
    269  * @ returns the pointer on vseg if success / returns NULL if failure.
     264 * This function checks that a given virtual address is contained in a registered vseg.
     265 * - if the vseg is registered in local process VMM, it returns the local vseg pointer.
     266 * - if the vseg is missing in local VMM, it uses a RPC to get it from the reference cluster,
     267 *   register it in local VMM and returns the local vseg pointer, if success.
     268 * - if the vseg is missing in reference VMM, it returns an user error.
     269 * It creates a kernel panic if there is not enough memory to create a new vseg descriptor
     270 * in the cluster containing the calling thread.
     271 *********************************************************************************************
     272 * @ process   : [in] pointer on process descriptor
     273 * @ vaddr     : [in] virtual address
     274 * @ vseg      : [out] pointer on found vseg
     275 * @ returns 0 if success / returns -1 if user error.
    270276 *********************************************************************************************/
    271 vseg_t * vmm_get_vseg( struct process_s * process,
    272                        intptr_t           vaddr );
    273 
     277error_t vmm_get_vseg( struct process_s * process,
     278                      intptr_t            vaddr,
     279                      vseg_t            * vseg );           
    274280
    275281/*********************************************************************************************
     
    296302 * The vseg containing the searched VPN should be registered in the reference VMM.
    297303 * If the PTE in the reference page table is unmapped, this function allocates the missing
    298  * physical page from the target cluster defined by the vseg type, initilize it,
     304 * physical page from the target cluster defined by the vseg type, initialize it,
    299305 * and update the reference page table. It calls the RPC_PMEM_GET_PAGES to get and
    300306 * initialize the missing physical page, if the target cluster is not the reference cluster.
     
    347353
    348354
    349 /*********************************************************************************************
    350  ********************************************************************************************/
    351 int sys_madvise( void    * start,
    352                  uint32_t  length,
    353                  uint32_t  advice );
    354 
    355 /*********************************************************************************************
    356  ********************************************************************************************/
    357 int sys_sbrk( uint32_t current_heap_ptr,
    358               uint32_t size );
    359 
    360 /*********************************************************************************************
    361  ********************************************************************************************/
    362 error_t vmm_sbrk( vmm_t   * vmm,
    363                   uint32_t  current,
    364                   uint32_t  size );
    365 
    366 /*********************************************************************************************
    367  ********************************************************************************************/
    368 error_t vmm_madvise_migrate( vmm_t    * vmm,
    369                              uint32_t   start,
    370                              uint32_t   len );
    371 
    372 /*********************************************************************************************
    373  ********************************************************************************************/
    374 error_t vmm_madvise_willneed( vmm_t   * vmm,
    375                               uint32_t  start,
    376                               uint32_t  len );
    377 
    378 /*********************************************************************************************
    379  ********************************************************************************************/
    380 error_t vmm_set_auto_migrate( vmm_t    * vmm,
    381                               uint32_t   start,
    382                               uint32_t   flags );
    383 
    384 /*********************************************************************************************
    385  * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked
    386  ********************************************************************************************/
    387 error_t vmm_broadcast_inval( vseg_t * region,
    388                              page_t      * page,
    389                              page_t     ** new );
    390 
    391 /*********************************************************************************************
    392  * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked
    393  ********************************************************************************************/
    394 error_t vmm_migrate_shared_page_seq( vseg_t * region,
    395                                      page_t      * page,
    396                                      page_t     ** new );
    397355
    398356#endif /* _VMM_H_ */
Note: See TracChangeset for help on using the changeset viewer.