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