Changeset 2c2d54a in mainline for kernel/arch/ppc32/src/mm/pht.c
- Timestamp:
- 2016-09-02T17:58:05Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4c3602c4
- Parents:
- 4bf0926e (diff), 3233adb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/src/mm/pht.c
r4bf0926e r2c2d54a 49 49 * @param access Access mode that caused the fault. 50 50 * @param istate Pointer to interrupted state. 51 * 52 * @return PTE on success, NULL otherwise. 53 * 54 */ 55 static pte_t *find_mapping_and_check(as_t *as, uintptr_t badvaddr, int access, 56 istate_t *istate) 51 * @param[out] pte Structure that will receive a copy of the found PTE. 52 * 53 * @return True if the mapping was found, false otherwise. 54 * 55 */ 56 static bool find_mapping_and_check(as_t *as, uintptr_t badvaddr, int access, 57 istate_t *istate, pte_t *pte) 57 58 { 58 59 /* 59 60 * Check if the mapping exists in page tables. 60 61 */ 61 pte_t *pte = page_mapping_find(as, badvaddr, true);62 if ( (pte) && (pte->present)) {62 bool found = page_mapping_find(as, badvaddr, true, pte); 63 if (found && pte->present) { 63 64 /* 64 65 * Mapping found in page tables. 65 66 * Immediately succeed. 66 67 */ 67 return pte;68 return true; 68 69 } 69 70 /* … … 76 77 * The mapping ought to be in place. 77 78 */ 78 pte = page_mapping_find(as, badvaddr, true); 79 ASSERT((pte) && (pte->present)); 80 return pte; 81 } 82 83 return NULL; 79 found = page_mapping_find(as, badvaddr, true, pte); 80 81 ASSERT(found); 82 ASSERT(pte->present); 83 84 return found; 85 } 86 87 return false; 84 88 } 85 89 … … 182 186 badvaddr = istate->pc; 183 187 184 pte_t *pte = find_mapping_and_check(AS, badvaddr, 185 PF_ACCESS_READ /* FIXME */, istate); 186 187 if (pte) { 188 pte_t pte; 189 bool found = find_mapping_and_check(AS, badvaddr, 190 PF_ACCESS_READ /* FIXME */, istate, &pte); 191 192 if (found) { 188 193 /* Record access to PTE */ 189 pte ->accessed = 1;190 pht_insert(badvaddr, pte);194 pte.accessed = 1; 195 pht_insert(badvaddr, &pte); 191 196 } 192 197 }
Note:
See TracChangeset
for help on using the changeset viewer.