Changes in kernel/generic/src/mm/backend_phys.c [cda1378:59fb782] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/backend_phys.c
rcda1378 r59fb782 52 52 static void phys_destroy(as_area_t *); 53 53 54 static bool phys_is_resizable(as_area_t *); 55 static bool phys_is_shareable(as_area_t *); 56 57 54 58 static int phys_page_fault(as_area_t *, uintptr_t, pf_access_t); 55 59 … … 59 63 .share = phys_share, 60 64 .destroy = phys_destroy, 65 66 .is_resizable = phys_is_resizable, 67 .is_shareable = phys_is_shareable, 61 68 62 69 .page_fault = phys_page_fault, … … 88 95 } 89 96 97 bool phys_is_resizable(as_area_t *area) 98 { 99 return false; 100 } 101 102 bool phys_is_shareable(as_area_t *area) 103 { 104 return true; 105 } 106 107 90 108 /** Service a page fault in the address space area backed by physical memory. 91 109 * … … 93 111 * 94 112 * @param area Pointer to the address space area. 95 * @param addr Faulting virtual address.113 * @param upage Faulting virtual page. 96 114 * @param access Access mode that caused the fault (i.e. read/write/exec). 97 115 * … … 99 117 * serviced). 100 118 */ 101 int phys_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access)119 int phys_page_fault(as_area_t *area, uintptr_t upage, pf_access_t access) 102 120 { 103 121 uintptr_t base = area->backend_data.base; … … 105 123 ASSERT(page_table_locked(AS)); 106 124 ASSERT(mutex_locked(&area->lock)); 125 ASSERT(IS_ALIGNED(upage, PAGE_SIZE)); 107 126 108 127 if (!as_area_check_access(area, access)) 109 128 return AS_PF_FAULT; 110 129 111 ASSERT( addr- area->base < area->backend_data.frames * FRAME_SIZE);112 page_mapping_insert(AS, addr, base + (addr- area->base),130 ASSERT(upage - area->base < area->backend_data.frames * FRAME_SIZE); 131 page_mapping_insert(AS, upage, base + (upage - area->base), 113 132 as_area_get_flags(area)); 114 133 115 if (!used_space_insert(area, ALIGN_DOWN(addr, PAGE_SIZE), 1))134 if (!used_space_insert(area, upage, 1)) 116 135 panic("Cannot insert used space."); 117 136
Note:
See TracChangeset
for help on using the changeset viewer.