Changeset 38dc82d in mainline for kernel/genarch/src/mm/page_pt.c
- Timestamp:
- 2016-08-31T14:16:45Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 346b12a2
- Parents:
- dc05a9a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/mm/page_pt.c
rdc05a9a r38dc82d 53 53 static void pt_mapping_insert(as_t *, uintptr_t, uintptr_t, unsigned int); 54 54 static void pt_mapping_remove(as_t *, uintptr_t); 55 static pte_t *pt_mapping_find(as_t *, uintptr_t, bool);55 static bool pt_mapping_find(as_t *, uintptr_t, bool, pte_t *pte); 56 56 static void pt_mapping_make_global(uintptr_t, size_t); 57 57 … … 291 291 /** Find mapping for virtual page in hierarchical page tables. 292 292 * 293 * @param as Address space to which page belongs. 294 * @param page Virtual page. 295 * @param nolock True if the page tables need not be locked. 296 * 297 * @return NULL if there is no such mapping; entry from PTL3 describing 298 * the mapping otherwise. 299 * 300 */ 301 pte_t *pt_mapping_find(as_t *as, uintptr_t page, bool nolock) 293 * @param as Address space to which page belongs. 294 * @param page Virtual page. 295 * @param nolock True if the page tables need not be locked. 296 * @param[out] pte Structure that will receive a copy of the found PTE. 297 * 298 * @return True if the mapping was found, false otherwise. 299 */ 300 bool pt_mapping_find(as_t *as, uintptr_t page, bool nolock, pte_t *pte) 302 301 { 303 302 ASSERT(nolock || page_table_locked(as)); … … 305 304 pte_t *ptl0 = (pte_t *) PA2KA((uintptr_t) as->genarch.page_table); 306 305 if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) 307 return NULL;306 return false; 308 307 309 308 read_barrier(); … … 311 310 pte_t *ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page))); 312 311 if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) 313 return NULL;312 return false; 314 313 315 314 #if (PTL1_ENTRIES != 0) … … 322 321 pte_t *ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page))); 323 322 if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) 324 return NULL;323 return false; 325 324 326 325 #if (PTL2_ENTRIES != 0) … … 333 332 pte_t *ptl3 = (pte_t *) PA2KA(GET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page))); 334 333 335 return &ptl3[PTL3_INDEX(page)]; 334 *pte = ptl3[PTL3_INDEX(page)]; 335 return true; 336 336 } 337 337
Note:
See TracChangeset
for help on using the changeset viewer.