Changeset 38dc82d in mainline for kernel/generic/src/mm/as.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/generic/src/mm/as.c
rdc05a9a r38dc82d 888 888 889 889 for (; i < node_size; i++) { 890 pte_t *pte = page_mapping_find(as, 891 ptr + P2SZ(i), false); 890 pte_t pte; 891 bool found = page_mapping_find(as, 892 ptr + P2SZ(i), false, &pte); 892 893 893 ASSERT( pte);894 ASSERT(PTE_VALID( pte));895 ASSERT(PTE_PRESENT( pte));894 ASSERT(found); 895 ASSERT(PTE_VALID(&pte)); 896 ASSERT(PTE_PRESENT(&pte)); 896 897 897 898 if ((area->backend) && … … 899 900 area->backend->frame_free(area, 900 901 ptr + P2SZ(i), 901 PTE_GET_FRAME( pte));902 PTE_GET_FRAME(&pte)); 902 903 } 903 904 … … 1002 1003 1003 1004 for (size = 0; size < (size_t) node->value[i]; size++) { 1004 pte_t *pte = page_mapping_find(as, 1005 ptr + P2SZ(size), false); 1005 pte_t pte; 1006 bool found = page_mapping_find(as, 1007 ptr + P2SZ(size), false, &pte); 1006 1008 1007 ASSERT( pte);1008 ASSERT(PTE_VALID( pte));1009 ASSERT(PTE_PRESENT( pte));1009 ASSERT(found); 1010 ASSERT(PTE_VALID(&pte)); 1011 ASSERT(PTE_PRESENT(&pte)); 1010 1012 1011 1013 if ((area->backend) && … … 1013 1015 area->backend->frame_free(area, 1014 1016 ptr + P2SZ(size), 1015 PTE_GET_FRAME( pte));1017 PTE_GET_FRAME(&pte)); 1016 1018 } 1017 1019 … … 1314 1316 1315 1317 for (size = 0; size < (size_t) node->value[i]; size++) { 1316 pte_t *pte = page_mapping_find(as, 1317 ptr + P2SZ(size), false); 1318 pte_t pte; 1319 bool found = page_mapping_find(as, 1320 ptr + P2SZ(size), false, &pte); 1318 1321 1319 ASSERT( pte);1320 ASSERT(PTE_VALID( pte));1321 ASSERT(PTE_PRESENT( pte));1322 ASSERT(found); 1323 ASSERT(PTE_VALID(&pte)); 1324 ASSERT(PTE_PRESENT(&pte)); 1322 1325 1323 old_frame[frame_idx++] = PTE_GET_FRAME( pte);1326 old_frame[frame_idx++] = PTE_GET_FRAME(&pte); 1324 1327 1325 1328 /* Remove old mapping */ … … 1451 1454 * we need to make sure the mapping has not been already inserted. 1452 1455 */ 1453 pte_t *pte; 1454 if ((pte = page_mapping_find(AS, page, false))) { 1455 if (PTE_PRESENT(pte)) { 1456 if (((access == PF_ACCESS_READ) && PTE_READABLE(pte)) || 1457 (access == PF_ACCESS_WRITE && PTE_WRITABLE(pte)) || 1458 (access == PF_ACCESS_EXEC && PTE_EXECUTABLE(pte))) { 1456 pte_t pte; 1457 bool found = page_mapping_find(AS, page, false, &pte); 1458 if (found) { 1459 if (PTE_PRESENT(&pte)) { 1460 if (((access == PF_ACCESS_READ) && PTE_READABLE(&pte)) || 1461 (access == PF_ACCESS_WRITE && PTE_WRITABLE(&pte)) || 1462 (access == PF_ACCESS_EXEC && PTE_EXECUTABLE(&pte))) { 1459 1463 page_table_unlock(AS, false); 1460 1464 mutex_unlock(&area->lock);
Note:
See TracChangeset
for help on using the changeset viewer.