Changes in kernel/generic/src/mm/backend_elf.c [59fb782:01029fc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/backend_elf.c
r59fb782 r01029fc 235 235 * 236 236 * @param area Pointer to the address space area. 237 * @param upage Faulting virtual page.237 * @param addr Faulting virtual address. 238 238 * @param access Access mode that caused the fault (i.e. 239 239 * read/write/exec). … … 242 242 * on success (i.e. serviced). 243 243 */ 244 int elf_page_fault(as_area_t *area, uintptr_t upage, pf_access_t access)244 int elf_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access) 245 245 { 246 246 elf_header_t *elf = area->backend_data.elf; … … 250 250 uintptr_t frame; 251 251 uintptr_t kpage; 252 uintptr_t upage; 252 253 uintptr_t start_anon; 253 254 size_t i; … … 256 257 ASSERT(page_table_locked(AS)); 257 258 ASSERT(mutex_locked(&area->lock)); 258 ASSERT(IS_ALIGNED(upage, PAGE_SIZE));259 259 260 260 if (!as_area_check_access(area, access)) 261 261 return AS_PF_FAULT; 262 262 263 if ( upage< ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE))263 if (addr < ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) 264 264 return AS_PF_FAULT; 265 265 266 if ( upage>= entry->p_vaddr + entry->p_memsz)266 if (addr >= entry->p_vaddr + entry->p_memsz) 267 267 return AS_PF_FAULT; 268 268 269 i = ( upage- ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) >> PAGE_WIDTH;269 i = (addr - ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) >> PAGE_WIDTH; 270 270 base = (uintptr_t) 271 271 (((void *) elf) + ALIGN_DOWN(entry->p_offset, PAGE_SIZE)); 272 273 /* Virtual address of faulting page */ 274 upage = ALIGN_DOWN(addr, PAGE_SIZE); 272 275 273 276 /* Virtual address of the end of initialized part of segment */
Note:
See TracChangeset
for help on using the changeset viewer.