Changeset 606 for trunk/kernel/mm/ppm.h
- Timestamp:
- Dec 3, 2018, 12:20:18 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/ppm.h
r567 r606 29 29 #include <list.h> 30 30 #include <busylock.h> 31 #include < queuelock.h>31 #include <remote_queuelock.h> 32 32 #include <boot_info.h> 33 33 #include <page.h> … … 39 39 * contains an integer number of pages, defined by the <pages_nr> field in the 40 40 * boot_info structure. It is split in three parts: 41 * 41 42 * - the "kernel_code" section contains the kernel code, loaded by the boot-loader. 42 43 * It starts at PPN = 0 and the size is defined by the <pages_offset> field in the … … 60 61 * Another service is to register the dirty pages in a specific dirty_list, that is 61 62 * also rooted in the PPM, in order to be able to save all dirty pages on disk. 62 * This dirty list is protected by a specific local queuelock. 63 * This dirty list is protected by a specific remote_queuelock, because it can be 64 * modified by a remote thread, but it is implemented as a local list, because it 65 * contains only local pages. 63 66 ****************************************************************************************/ 64 67 65 68 typedef struct ppm_s 66 69 { 67 busylock_t free_lock;/*! lock protecting free_pages[] lists */68 list_entry_t free_pages_root[CONFIG_PPM_MAX_ORDER]; /*! roots of free lists*/69 uint32_t free_pages_nr[CONFIG_PPM_MAX_ORDER]; /*! numbers of free pages*/70 page_t * pages_tbl;/*! pointer on page descriptors array */71 uint32_t pages_nr;/*! total number of small physical page */72 queuelock_t dirty_lock;/*! lock protecting dirty pages list */73 list_entry_t dirty_root;/*! root of dirty pages list */74 void * vaddr_base;/*! pointer on local physical memory base */70 busylock_t free_lock; /*! lock protecting free_pages[] lists */ 71 list_entry_t free_pages_root[CONFIG_PPM_MAX_ORDER]; /*! roots of free lists */ 72 uint32_t free_pages_nr[CONFIG_PPM_MAX_ORDER]; /*! free pages number */ 73 page_t * pages_tbl; /*! pointer on page descriptors array */ 74 uint32_t pages_nr; /*! total number of small physical page */ 75 remote_queuelock_t dirty_lock; /*! lock protecting dirty pages list */ 76 list_entry_t dirty_root; /*! root of dirty pages list */ 77 void * vaddr_base; /*! pointer on local physical memory base */ 75 78 } 76 79 ppm_t; … … 135 138 inline xptr_t ppm_base2page( xptr_t base_xp ); 136 139 137 138 139 140 /***************************************************************************************** 140 141 * Get extended pointer on page base from global PPN. … … 153 154 inline ppn_t ppm_base2ppn( xptr_t base_xp ); 154 155 155 156 157 156 /***************************************************************************************** 158 157 * Get global PPN from extended pointer on page descriptor. … … 172 171 173 172 173 /*********** debug functions **********************************************************/ 174 174 175 175 /***************************************************************************************** … … 190 190 191 191 /***************************************************************************************** 192 * This function registers a physical page as dirty. 192 * This function registers a page identified by the <page_xp> argument as dirty. 193 * It can be called by a thread running in any cluster. 193 194 * - it takes the queuelock protecting the PPM dirty_list. 194 195 * - it test the PG_DIRTY flag in the page descriptor. … … 197 198 * - it releases the queuelock protecting the PPM dirty_list. 198 199 ***************************************************************************************** 199 * @ page :pointer on page descriptor.200 * @ page_xp : extended pointer on page descriptor. 200 201 * @ returns true if page was not dirty / returns false if page was dirty 201 202 ****************************************************************************************/ 202 bool_t ppm_page_do_dirty( page_t * page ); 203 204 /***************************************************************************************** 205 * This function unregisters a physical page as dirty. 203 bool_t ppm_page_do_dirty( xptr_t page_xp ); 204 205 /***************************************************************************************** 206 * This function unregisters a page identified by the <page_xp> argument as dirty. 207 * It can be called by a thread running in any cluster. 206 208 * - it takes the queuelock protecting the PPM dirty_list. 207 209 * - it test the PG_DIRTY flag in the page descriptor. … … 210 212 * - it releases the queuelock protecting the PPM dirty_list. 211 213 ***************************************************************************************** 212 * @ page :pointer on page descriptor.214 * @ page_xp : extended pointer on page descriptor. 213 215 * @ returns true if page was dirty / returns false if page was not dirty 214 216 ****************************************************************************************/ 215 bool_t ppm_page_undo_dirty( page_t * page);216 217 /***************************************************************************************** 218 * This function synchronizes (i.e. update the disk) all dirty pages in a cluster.217 bool_t ppm_page_undo_dirty( xptr_t page_xp ); 218 219 /***************************************************************************************** 220 * This function synchronizes (i.e. update the IOC device) all dirty pages in a cluster. 219 221 * - it takes the queuelock protecting the PPM dirty_list. 220 222 * - it scans the PPM dirty list, and for each page: … … 226 228 $ The PPM dirty_list is empty when the sync operation completes. 227 229 ****************************************************************************************/ 228 void ppm_sync_ all_pages( void );230 void ppm_sync_dirty_pages( void ); 229 231 230 232 #endif /* _PPM_H_ */
Note: See TracChangeset
for help on using the changeset viewer.