Rev 1409 | Rev 1423 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1409 | Rev 1411 | ||
---|---|---|---|
Line 54... | Line 54... | ||
54 | 54 | ||
55 | static int segment_header(elf_segment_header_t *entry, elf_header_t *elf, as_t *as); |
55 | static int segment_header(elf_segment_header_t *entry, elf_header_t *elf, as_t *as); |
56 | static int section_header(elf_section_header_t *entry, elf_header_t *elf, as_t *as); |
56 | static int section_header(elf_section_header_t *entry, elf_header_t *elf, as_t *as); |
57 | static int load_segment(elf_segment_header_t *entry, elf_header_t *elf, as_t *as); |
57 | static int load_segment(elf_segment_header_t *entry, elf_header_t *elf, as_t *as); |
58 | 58 | ||
59 | static int elf_page_fault(as_area_t *area, __address addr); |
59 | static int elf_page_fault(as_area_t *area, __address addr, pf_access_t access); |
60 | static void elf_frame_free(as_area_t *area, __address page, __address frame); |
60 | static void elf_frame_free(as_area_t *area, __address page, __address frame); |
61 | 61 | ||
62 | mem_backend_t elf_backend = { |
62 | mem_backend_t elf_backend = { |
63 | .backend_page_fault = elf_page_fault, |
63 | .backend_page_fault = elf_page_fault, |
64 | .backend_frame_free = elf_frame_free |
64 | .backend_frame_free = elf_frame_free |
Line 223... | Line 223... | ||
223 | * |
223 | * |
224 | * The address space area and page tables must be already locked. |
224 | * The address space area and page tables must be already locked. |
225 | * |
225 | * |
226 | * @param area Pointer to the address space area. |
226 | * @param area Pointer to the address space area. |
227 | * @param addr Faulting virtual address. |
227 | * @param addr Faulting virtual address. |
- | 228 | * @param access Access mode that caused the fault (i.e. read/write/exec). |
|
228 | * |
229 | * |
229 | * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e. serviced). |
230 | * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e. serviced). |
230 | */ |
231 | */ |
231 | int elf_page_fault(as_area_t *area, __address addr) |
232 | int elf_page_fault(as_area_t *area, __address addr, pf_access_t access) |
232 | { |
233 | { |
233 | elf_header_t *elf = (elf_header_t *) area->backend_data[0]; |
234 | elf_header_t *elf = (elf_header_t *) area->backend_data[0]; |
234 | elf_segment_header_t *entry = (elf_segment_header_t *) area->backend_data[1]; |
235 | elf_segment_header_t *entry = (elf_segment_header_t *) area->backend_data[1]; |
235 | __address base, frame; |
236 | __address base, frame; |
236 | index_t i; |
237 | index_t i; |