Changeset 1084a784 in mainline for src/mm/page.c
- Timestamp:
- 2005-10-04T22:09:41Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 342de62
- Parents:
- 8e3f47b3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mm/page.c
r8e3f47b3 r1084a784 34 34 #include <arch/asm.h> 35 35 #include <memstr.h> 36 37 36 38 37 void page_init(void) … … 110 109 SET_FRAME_FLAGS(ptl3, PTL3_INDEX(page), flags); 111 110 } 111 112 /** Find mapping for virtual page 113 * 114 * Find mapping for virtual page. 115 * 116 * @param page Virtual page. 117 * @param root PTL0 address if non-zero. 118 * 119 * @return NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise. 120 */ 121 pte_t *find_mapping(__address page, __address root) 122 { 123 pte_t *ptl0, *ptl1, *ptl2, *ptl3; 124 125 ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS()); 126 127 if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) 128 return NULL; 129 130 ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page))); 131 132 if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) 133 return NULL; 134 135 ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page))); 136 137 if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) 138 return NULL; 139 140 ptl3 = (pte_t *) PA2KA(GET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page))); 141 142 return &ptl3[PTL3_INDEX(page)]; 143 }
Note:
See TracChangeset
for help on using the changeset viewer.