Rev 689 | Rev 756 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 689 | Rev 755 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | 28 | ||
29 | #include <genarch/mm/page_pt.h> |
29 | #include <genarch/mm/page_pt.h> |
30 | #include <mm/page.h> |
30 | #include <mm/page.h> |
31 | #include <mm/frame.h> |
31 | #include <mm/frame.h> |
32 | #include <arch/mm/page.h> |
32 | #include <arch/mm/page.h> |
33 | #include <arch/mm/asid.h> |
33 | #include <arch/mm/as.h> |
34 | #include <arch/types.h> |
34 | #include <arch/types.h> |
35 | #include <typedefs.h> |
35 | #include <typedefs.h> |
36 | #include <arch/asm.h> |
36 | #include <arch/asm.h> |
37 | #include <memstr.h> |
37 | #include <memstr.h> |
38 | 38 | ||
39 | static void pt_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root); |
39 | static void pt_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root); |
40 | static pte_t *pt_mapping_find(__address page, asid_t asid, __address root); |
40 | static pte_t *pt_mapping_find(as_t *as, __address page, __address root); |
41 | 41 | ||
42 | page_operations_t page_pt_operations = { |
42 | page_operations_t page_pt_operations = { |
43 | .mapping_insert = pt_mapping_insert, |
43 | .mapping_insert = pt_mapping_insert, |
44 | .mapping_find = pt_mapping_find |
44 | .mapping_find = pt_mapping_find |
45 | }; |
45 | }; |
Line 47... | Line 47... | ||
47 | /** Map page to frame using hierarchical page tables. |
47 | /** Map page to frame using hierarchical page tables. |
48 | * |
48 | * |
49 | * Map virtual address 'page' to physical address 'frame' |
49 | * Map virtual address 'page' to physical address 'frame' |
50 | * using 'flags'. |
50 | * using 'flags'. |
51 | * |
51 | * |
- | 52 | * @param as Ignored. |
|
52 | * @param page Virtual address of the page to be mapped. |
53 | * @param page Virtual address of the page to be mapped. |
53 | * @param asid Ignored. |
- | |
54 | * @param frame Physical address of memory frame to which the mapping is done. |
54 | * @param frame Physical address of memory frame to which the mapping is done. |
55 | * @param flags Flags to be used for mapping. |
55 | * @param flags Flags to be used for mapping. |
56 | * @param root Explicit PTL0 address. |
56 | * @param root Explicit PTL0 address. |
57 | */ |
57 | */ |
58 | void pt_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root) |
58 | void pt_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root) |
59 | { |
59 | { |
60 | pte_t *ptl0, *ptl1, *ptl2, *ptl3; |
60 | pte_t *ptl0, *ptl1, *ptl2, *ptl3; |
61 | __address newpt; |
61 | __address newpt; |
62 | 62 | ||
63 | ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS()); |
63 | ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS()); |
Line 95... | Line 95... | ||
95 | 95 | ||
96 | /** Find mapping for virtual page in hierarchical page tables. |
96 | /** Find mapping for virtual page in hierarchical page tables. |
97 | * |
97 | * |
98 | * Find mapping for virtual page. |
98 | * Find mapping for virtual page. |
99 | * |
99 | * |
- | 100 | * @param as Ignored. |
|
100 | * @param page Virtual page. |
101 | * @param page Virtual page. |
101 | * @param asid Ignored. |
- | |
102 | * @param root PTL0 address if non-zero. |
102 | * @param root PTL0 address if non-zero. |
103 | * |
103 | * |
104 | * @return NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise. |
104 | * @return NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise. |
105 | */ |
105 | */ |
106 | pte_t *pt_mapping_find(__address page, asid_t asid, __address root) |
106 | pte_t *pt_mapping_find(as_t *as, __address page, __address root) |
107 | { |
107 | { |
108 | pte_t *ptl0, *ptl1, *ptl2, *ptl3; |
108 | pte_t *ptl0, *ptl1, *ptl2, *ptl3; |
109 | 109 | ||
110 | ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS()); |
110 | ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS()); |
111 | 111 |