Changeset b5e68c8 in mainline for kernel/generic/src/mm/backend_phys.c
- Timestamp:
- 2011-05-12T16:49:44Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f36787d7
- Parents:
- e80329d6 (diff), 750636a (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/generic/src/mm/backend_phys.c
re80329d6 rb5e68c8 48 48 #include <align.h> 49 49 50 static int phys_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access); 51 static void phys_share(as_area_t *area); 50 static bool phys_create(as_area_t *); 51 static void phys_share(as_area_t *); 52 static void phys_destroy(as_area_t *); 53 54 static int phys_page_fault(as_area_t *, uintptr_t, pf_access_t); 52 55 53 56 mem_backend_t phys_backend = { 57 .create = phys_create, 58 .resize = NULL, 59 .share = phys_share, 60 .destroy = phys_destroy, 61 54 62 .page_fault = phys_page_fault, 55 63 .frame_free = NULL, 56 .share = phys_share57 64 }; 65 66 bool phys_create(as_area_t *area) 67 { 68 return true; 69 } 70 71 /** Share address space area backed by physical memory. 72 * 73 * Do actually nothing as sharing of address space areas 74 * that are backed up by physical memory is very easy. 75 * Note that the function must be defined so that 76 * as_area_share() will succeed. 77 */ 78 void phys_share(as_area_t *area) 79 { 80 ASSERT(mutex_locked(&area->as->lock)); 81 ASSERT(mutex_locked(&area->lock)); 82 } 83 84 85 void phys_destroy(as_area_t *area) 86 { 87 /* Nothing to do. */ 88 } 58 89 59 90 /** Service a page fault in the address space area backed by physical memory. … … 81 112 page_mapping_insert(AS, addr, base + (addr - area->base), 82 113 as_area_get_flags(area)); 83 if (!used_space_insert(area, ALIGN_DOWN(addr, PAGE_SIZE), 1)) 84 panic("Cannot insert used space."); 114 115 if (!used_space_insert(area, ALIGN_DOWN(addr, PAGE_SIZE), 1)) 116 panic("Cannot insert used space."); 85 117 86 118 return AS_PF_OK; 87 119 } 88 120 89 /** Share address space area backed by physical memory.90 *91 * Do actually nothing as sharing of address space areas92 * that are backed up by physical memory is very easy.93 * Note that the function must be defined so that94 * as_area_share() will succeed.95 */96 void phys_share(as_area_t *area)97 {98 ASSERT(mutex_locked(&area->as->lock));99 ASSERT(mutex_locked(&area->lock));100 }101 102 121 /** @} 103 122 */
Note:
See TracChangeset
for help on using the changeset viewer.