Rev 1757 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1757 | Rev 1780 | ||
|---|---|---|---|
| Line 67... | Line 67... | ||
| 67 | * of page boundaries. |
67 | * of page boundaries. |
| 68 | * |
68 | * |
| 69 | * @param s Address of the structure. |
69 | * @param s Address of the structure. |
| 70 | * @param size Size of the structure. |
70 | * @param size Size of the structure. |
| 71 | */ |
71 | */ |
| 72 | void map_structure(__address s, size_t size) |
72 | void map_structure(uintptr_t s, size_t size) |
| 73 | { |
73 | { |
| 74 | int i, cnt, length; |
74 | int i, cnt, length; |
| 75 | 75 | ||
| 76 | length = size + (s - (s & ~(PAGE_SIZE - 1))); |
76 | length = size + (s - (s & ~(PAGE_SIZE - 1))); |
| 77 | cnt = length / PAGE_SIZE + (length % PAGE_SIZE > 0); |
77 | cnt = length / PAGE_SIZE + (length % PAGE_SIZE > 0); |
| Line 91... | Line 91... | ||
| 91 | * @param as Address space to wich page belongs. |
91 | * @param as Address space to wich page belongs. |
| 92 | * @param page Virtual address of the page to be mapped. |
92 | * @param page Virtual address of the page to be mapped. |
| 93 | * @param frame Physical address of memory frame to which the mapping is done. |
93 | * @param frame Physical address of memory frame to which the mapping is done. |
| 94 | * @param flags Flags to be used for mapping. |
94 | * @param flags Flags to be used for mapping. |
| 95 | */ |
95 | */ |
| 96 | void page_mapping_insert(as_t *as, __address page, __address frame, int flags) |
96 | void page_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, int flags) |
| 97 | { |
97 | { |
| 98 | ASSERT(page_mapping_operations); |
98 | ASSERT(page_mapping_operations); |
| 99 | ASSERT(page_mapping_operations->mapping_insert); |
99 | ASSERT(page_mapping_operations->mapping_insert); |
| 100 | 100 | ||
| 101 | page_mapping_operations->mapping_insert(as, page, frame, flags); |
101 | page_mapping_operations->mapping_insert(as, page, frame, flags); |
| Line 110... | Line 110... | ||
| 110 | * The page table must be locked and interrupts must be disabled. |
110 | * The page table must be locked and interrupts must be disabled. |
| 111 | * |
111 | * |
| 112 | * @param as Address space to wich page belongs. |
112 | * @param as Address space to wich page belongs. |
| 113 | * @param page Virtual address of the page to be demapped. |
113 | * @param page Virtual address of the page to be demapped. |
| 114 | */ |
114 | */ |
| 115 | void page_mapping_remove(as_t *as, __address page) |
115 | void page_mapping_remove(as_t *as, uintptr_t page) |
| 116 | { |
116 | { |
| 117 | ASSERT(page_mapping_operations); |
117 | ASSERT(page_mapping_operations); |
| 118 | ASSERT(page_mapping_operations->mapping_remove); |
118 | ASSERT(page_mapping_operations->mapping_remove); |
| 119 | 119 | ||
| 120 | page_mapping_operations->mapping_remove(as, page); |
120 | page_mapping_operations->mapping_remove(as, page); |
| Line 129... | Line 129... | ||
| 129 | * @param as Address space to wich page belongs. |
129 | * @param as Address space to wich page belongs. |
| 130 | * @param page Virtual page. |
130 | * @param page Virtual page. |
| 131 | * |
131 | * |
| 132 | * @return NULL if there is no such mapping; requested mapping otherwise. |
132 | * @return NULL if there is no such mapping; requested mapping otherwise. |
| 133 | */ |
133 | */ |
| 134 | pte_t *page_mapping_find(as_t *as, __address page) |
134 | pte_t *page_mapping_find(as_t *as, uintptr_t page) |
| 135 | { |
135 | { |
| 136 | ASSERT(page_mapping_operations); |
136 | ASSERT(page_mapping_operations); |
| 137 | ASSERT(page_mapping_operations->mapping_find); |
137 | ASSERT(page_mapping_operations->mapping_find); |
| 138 | 138 | ||
| 139 | return page_mapping_operations->mapping_find(as, page); |
139 | return page_mapping_operations->mapping_find(as, page); |