Rev 1757 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1757 | Rev 1780 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | #include <memstr.h> |
44 | #include <memstr.h> |
45 | #include <macros.h> |
45 | #include <macros.h> |
46 | #include <arch.h> |
46 | #include <arch.h> |
47 | #include <align.h> |
47 | #include <align.h> |
48 | 48 | ||
49 | static int phys_page_fault(as_area_t *area, __address addr, pf_access_t access); |
49 | static int phys_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access); |
50 | static void phys_share(as_area_t *area); |
50 | static void phys_share(as_area_t *area); |
51 | 51 | ||
52 | mem_backend_t phys_backend = { |
52 | mem_backend_t phys_backend = { |
53 | .page_fault = phys_page_fault, |
53 | .page_fault = phys_page_fault, |
54 | .frame_free = NULL, |
54 | .frame_free = NULL, |
Line 63... | Line 63... | ||
63 | * @param addr Faulting virtual address. |
63 | * @param addr Faulting virtual address. |
64 | * @param access Access mode that caused the fault (i.e. read/write/exec). |
64 | * @param access Access mode that caused the fault (i.e. read/write/exec). |
65 | * |
65 | * |
66 | * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e. serviced). |
66 | * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e. serviced). |
67 | */ |
67 | */ |
68 | int phys_page_fault(as_area_t *area, __address addr, pf_access_t access) |
68 | int phys_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access) |
69 | { |
69 | { |
70 | __address base = area->backend_data.base; |
70 | uintptr_t base = area->backend_data.base; |
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; |
74 | 74 | ||
75 | ASSERT(addr - area->base < area->backend_data.frames * FRAME_SIZE); |
75 | ASSERT(addr - area->base < area->backend_data.frames * FRAME_SIZE); |