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