Rev 1424 | Rev 1426 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1424 | Rev 1425 | ||
---|---|---|---|
Line 62... | Line 62... | ||
62 | * |
62 | * |
63 | * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e. serviced). |
63 | * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e. serviced). |
64 | */ |
64 | */ |
65 | int elf_page_fault(as_area_t *area, __address addr, pf_access_t access) |
65 | int elf_page_fault(as_area_t *area, __address addr, pf_access_t access) |
66 | { |
66 | { |
67 | elf_header_t *elf = (elf_header_t *) area->backend_data.d1; |
67 | elf_header_t *elf = area->backend_data.elf; |
68 | elf_segment_header_t *entry = (elf_segment_header_t *) area->backend_data.d2; |
68 | elf_segment_header_t *entry = area->backend_data.segment; |
69 | __address base, frame; |
69 | __address base, frame; |
70 | index_t i; |
70 | index_t i; |
71 | 71 | ||
72 | if (!as_area_check_access(area, access)) |
72 | if (!as_area_check_access(area, access)) |
73 | return AS_PF_FAULT; |
73 | return AS_PF_FAULT; |
Line 130... | Line 130... | ||
130 | * @param frame Frame to be released. |
130 | * @param frame Frame to be released. |
131 | * |
131 | * |
132 | */ |
132 | */ |
133 | void elf_frame_free(as_area_t *area, __address page, __address frame) |
133 | void elf_frame_free(as_area_t *area, __address page, __address frame) |
134 | { |
134 | { |
135 | elf_header_t *elf = (elf_header_t *) area->backend_data.d1; |
135 | elf_header_t *elf = area->backend_data.elf; |
136 | elf_segment_header_t *entry = (elf_segment_header_t *) area->backend_data.d2; |
136 | elf_segment_header_t *entry = area->backend_data.segment; |
137 | __address base; |
137 | __address base; |
138 | index_t i; |
138 | index_t i; |
139 | 139 | ||
140 | ASSERT((page >= entry->p_vaddr) && (page < entry->p_vaddr + entry->p_memsz)); |
140 | ASSERT((page >= entry->p_vaddr) && (page < entry->p_vaddr + entry->p_memsz)); |
141 | i = (page - entry->p_vaddr) >> PAGE_WIDTH; |
141 | i = (page - entry->p_vaddr) >> PAGE_WIDTH; |