Changes in kernel/generic/src/mm/backend_elf.c [9d58539:59fb782] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/backend_elf.c
r9d58539 r59fb782 58 58 static void elf_destroy(as_area_t *); 59 59 60 static bool elf_is_resizable(as_area_t *); 61 static bool elf_is_shareable(as_area_t *); 62 60 63 static int elf_page_fault(as_area_t *, uintptr_t, pf_access_t); 61 64 static void elf_frame_free(as_area_t *, uintptr_t, uintptr_t); … … 66 69 .share = elf_share, 67 70 .destroy = elf_destroy, 71 72 .is_resizable = elf_is_resizable, 73 .is_shareable = elf_is_shareable, 68 74 69 75 .page_fault = elf_page_fault, … … 213 219 } 214 220 221 bool elf_is_resizable(as_area_t *area) 222 { 223 return true; 224 } 225 226 bool elf_is_shareable(as_area_t *area) 227 { 228 return true; 229 } 230 231 215 232 /** Service a page fault in the ELF backend address space area. 216 233 * … … 218 235 * 219 236 * @param area Pointer to the address space area. 220 * @param addr Faulting virtual address.237 * @param upage Faulting virtual page. 221 238 * @param access Access mode that caused the fault (i.e. 222 239 * read/write/exec). … … 225 242 * on success (i.e. serviced). 226 243 */ 227 int elf_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access)244 int elf_page_fault(as_area_t *area, uintptr_t upage, pf_access_t access) 228 245 { 229 246 elf_header_t *elf = area->backend_data.elf; … … 233 250 uintptr_t frame; 234 251 uintptr_t kpage; 235 uintptr_t upage;236 252 uintptr_t start_anon; 237 253 size_t i; … … 240 256 ASSERT(page_table_locked(AS)); 241 257 ASSERT(mutex_locked(&area->lock)); 258 ASSERT(IS_ALIGNED(upage, PAGE_SIZE)); 242 259 243 260 if (!as_area_check_access(area, access)) 244 261 return AS_PF_FAULT; 245 262 246 if ( addr< ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE))263 if (upage < ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) 247 264 return AS_PF_FAULT; 248 265 249 if ( addr>= entry->p_vaddr + entry->p_memsz)266 if (upage >= entry->p_vaddr + entry->p_memsz) 250 267 return AS_PF_FAULT; 251 268 252 i = ( addr- ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) >> PAGE_WIDTH;269 i = (upage - ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) >> PAGE_WIDTH; 253 270 base = (uintptr_t) 254 271 (((void *) elf) + ALIGN_DOWN(entry->p_offset, PAGE_SIZE)); 255 256 /* Virtual address of faulting page */257 upage = ALIGN_DOWN(addr, PAGE_SIZE);258 272 259 273 /* Virtual address of the end of initialized part of segment */
Note:
See TracChangeset
for help on using the changeset viewer.