Rev 3993 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3993 | Rev 4129 | ||
---|---|---|---|
Line 116... | Line 116... | ||
116 | static inline void mmu_secondary_context_write(uint64_t v) |
116 | static inline void mmu_secondary_context_write(uint64_t v) |
117 | { |
117 | { |
118 | asi_u64_write(ASI_SECONDARY_CONTEXT_REG, VA_SECONDARY_CONTEXT_REG, v); |
118 | asi_u64_write(ASI_SECONDARY_CONTEXT_REG, VA_SECONDARY_CONTEXT_REG, v); |
119 | } |
119 | } |
120 | 120 | ||
121 | /** Perform IMMU TLB Demap Operation. |
- | |
122 | * |
- | |
123 | * @param type Selects between context and page demap (and entire MMU |
- | |
124 | * demap on US3). |
- | |
125 | * @param context_encoding Specifies which Context register has Context ID for |
- | |
126 | * demap. |
- | |
127 | * @param page Address which is on the page to be demapped. |
- | |
128 | */ |
- | |
129 | static inline void itlb_demap(int type, int context_encoding, uintptr_t page) |
- | |
130 | { |
- | |
131 | } |
- | |
132 | - | ||
133 | /** Perform DMMU TLB Demap Operation. |
- | |
134 | * |
- | |
135 | * @param type One of TLB_DEMAP_PAGE and TLB_DEMAP_CONTEXT. Selects |
- | |
136 | * between context and page demap. |
- | |
137 | * @param context_encoding Specifies which Context register has Context ID for |
- | |
138 | * demap. |
- | |
139 | * @param page Address which is on the page to be demapped. |
- | |
140 | */ |
- | |
141 | static inline void dtlb_demap(int type, int context_encoding, uintptr_t page) |
- | |
142 | { |
- | |
143 | #if 0 |
- | |
144 | - this implementation is not correct!!! |
- | |
145 | if (type == TLB_DEMAP_PAGE) { |
- | |
146 | __hypercall_fast5( |
- | |
147 | MMU_DEMAP_PAGE, 0, 0, |
- | |
148 | page, context_encoding, MMU_FLAG_DTLB); |
- | |
149 | } else if (type == TLB_DEMAP_CONTEXT) { |
- | |
150 | __hypercall_fast4( |
- | |
151 | MMU_DEMAP_CTX, 0, 0, |
- | |
152 | context_encoding, MMU_FLAG_DTLB); |
- | |
153 | } |
- | |
154 | #endif |
- | |
155 | } |
- | |
156 | - | ||
157 | /** |
121 | /** |
158 | * Demaps all mappings in a context. |
122 | * Demaps all mappings in a context. |
159 | * |
123 | * |
160 | * @param context number of the context |
124 | * @param context number of the context |
161 | * @param mmu_flag MMU_FLAG_DTLB, MMU_FLAG_ITLB or a combination of both |
125 | * @param mmu_flag MMU_FLAG_DTLB, MMU_FLAG_ITLB or a combination of both |
162 | */ |
126 | */ |
163 | static inline void mmu_demap_ctx(int context, int mmu_flag) { |
127 | static inline void mmu_demap_ctx(int context, int mmu_flag) { |
164 | __hypercall_fast4(MMU_DEMAP_CTX, 0, 0, context, mmu_flag); |
128 | __hypercall_fast4(MMU_DEMAP_CTX, 0, 0, context, mmu_flag); |
165 | } |
129 | } |
166 | 130 | ||
- | 131 | /** |
|
- | 132 | * Demaps given page. |
|
- | 133 | * |
|
- | 134 | * @param vaddr VA of the page to be demapped |
|
- | 135 | * @param context number of the context |
|
- | 136 | * @param mmu_flag MMU_FLAG_DTLB, MMU_FLAG_ITLB or a combination of both |
|
- | 137 | */ |
|
167 | static inline void mmu_demap_page(uintptr_t vaddr, int context, int mmu_flag) { |
138 | static inline void mmu_demap_page(uintptr_t vaddr, int context, int mmu_flag) { |
168 | __hypercall_fast5(MMU_DEMAP_PAGE, 0, 0, vaddr, context, mmu_flag); |
139 | __hypercall_fast5(MMU_DEMAP_PAGE, 0, 0, vaddr, context, mmu_flag); |
169 | } |
140 | } |
170 | 141 | ||
- | 142 | /** |
|
- | 143 | * Installs a locked TLB entry in kernel address space. |
|
- | 144 | * |
|
- | 145 | * @param vaddr VA of the page to be demapped |
|
- | 146 | * @param ra real address the page is mapped to |
|
- | 147 | * @param cacheable should the page be cacheble? |
|
- | 148 | * @param privileged should the mapping be privileged? |
|
- | 149 | * @param executable should the memory mapped be executable? |
|
- | 150 | * @param writable should the memory mapped be writable? |
|
- | 151 | * @param size code of the page size |
|
- | 152 | * @param mmu_flag MMU_FLAG_DTLB, MMU_FLAG_ITLB or a combination of both |
|
- | 153 | */ |
|
171 | static inline void mmu_map_perm_addr(uintptr_t vaddr, uintptr_t ra, |
154 | static inline void mmu_map_perm_addr(uintptr_t vaddr, uintptr_t ra, |
172 | bool cacheable, bool privileged, bool executable, |
155 | bool cacheable, bool privileged, bool executable, |
173 | bool writable, unsigned size, unsigned mmu_flags) { |
156 | bool writable, unsigned size, unsigned mmu_flags) { |
174 | 157 | ||
175 | tte_data_t data; |
158 | tte_data_t data; |
Line 190... | Line 173... | ||
190 | extern void fast_data_access_mmu_miss(unative_t, istate_t *); |
173 | extern void fast_data_access_mmu_miss(unative_t, istate_t *); |
191 | extern void fast_data_access_protection(unative_t, istate_t *); |
174 | extern void fast_data_access_protection(unative_t, istate_t *); |
192 | 175 | ||
193 | extern void dtlb_insert_mapping(uintptr_t, uintptr_t, int, bool, bool); |
176 | extern void dtlb_insert_mapping(uintptr_t, uintptr_t, int, bool, bool); |
194 | 177 | ||
195 | extern void describe_mmu_fault(void); |
178 | extern void describe_dmmu_fault(void); |
196 | 179 | ||
197 | #endif /* !def __ASM__ */ |
180 | #endif /* !def __ASM__ */ |
198 | 181 | ||
199 | #endif |
182 | #endif |
200 | 183 |