Changeset 2a2fbc8 in mainline for kernel/arch/sparc64/src
- Timestamp:
- 2016-09-01T17:05:13Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 42d08592
- Parents:
- f126c87 (diff), fb63c06 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- kernel/arch/sparc64/src/mm
- Files:
-
- 2 edited
-
sun4u/tlb.c (modified) (6 diffs)
-
sun4v/tlb.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/mm/sun4u/tlb.c
rf126c87 r2a2fbc8 197 197 { 198 198 size_t index = (istate->tpc >> MMU_PAGE_WIDTH) % MMU_PAGES_PER_PAGE; 199 pte_t *t;200 201 t = page_mapping_find(AS, istate->tpc, true);202 if ( t && PTE_EXECUTABLE(t)) {199 pte_t t; 200 201 bool found = page_mapping_find(AS, istate->tpc, true, &t); 202 if (found && PTE_EXECUTABLE(&t)) { 203 203 /* 204 204 * The mapping was found in the software page hash table. 205 205 * Insert it into ITLB. 206 206 */ 207 t ->a = true;208 itlb_pte_copy( t, index);207 t.a = true; 208 itlb_pte_copy(&t, index); 209 209 #ifdef CONFIG_TSB 210 itsb_pte_copy(t, index); 211 #endif 210 itsb_pte_copy(&t, index); 211 #endif 212 page_mapping_update(AS, istate->tpc, true, &t); 212 213 } else { 213 214 /* … … 233 234 uintptr_t page_16k; 234 235 size_t index; 235 pte_t *t;236 pte_t t; 236 237 as_t *as = AS; 237 238 … … 253 254 } 254 255 255 t = page_mapping_find(as, page_16k, true);256 if ( t) {256 bool found = page_mapping_find(as, page_16k, true, &t); 257 if (found) { 257 258 /* 258 259 * The mapping was found in the software page hash table. 259 260 * Insert it into DTLB. 260 261 */ 261 t ->a = true;262 dtlb_pte_copy( t, index, true);262 t.a = true; 263 dtlb_pte_copy(&t, index, true); 263 264 #ifdef CONFIG_TSB 264 dtsb_pte_copy(t, index, true); 265 #endif 265 dtsb_pte_copy(&t, index, true); 266 #endif 267 page_mapping_update(as, page_16k, true, &t); 266 268 } else { 267 269 /* … … 283 285 uintptr_t page_16k; 284 286 size_t index; 285 pte_t *t;287 pte_t t; 286 288 as_t *as = AS; 287 289 … … 293 295 as = AS_KERNEL; 294 296 295 t = page_mapping_find(as, page_16k, true);296 if ( t && PTE_WRITABLE(t)) {297 bool found = page_mapping_find(as, page_16k, true, &t); 298 if (found && PTE_WRITABLE(&t)) { 297 299 /* 298 300 * The mapping was found in the software page hash table and is … … 300 302 * into DTLB. 301 303 */ 302 t ->a = true;303 t ->d = true;304 t.a = true; 305 t.d = true; 304 306 dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_SECONDARY, 305 307 page_16k + index * MMU_PAGE_SIZE); 306 dtlb_pte_copy( t, index, false);308 dtlb_pte_copy(&t, index, false); 307 309 #ifdef CONFIG_TSB 308 dtsb_pte_copy(t, index, false); 309 #endif 310 dtsb_pte_copy(&t, index, false); 311 #endif 312 page_mapping_update(as, page_16k, true, &t); 310 313 } else { 311 314 /* -
kernel/arch/sparc64/src/mm/sun4v/tlb.c
rf126c87 r2a2fbc8 211 211 { 212 212 uintptr_t va = ALIGN_DOWN(istate->tpc, PAGE_SIZE); 213 pte_t *t; 214 215 t = page_mapping_find(AS, va, true); 216 217 if (t && PTE_EXECUTABLE(t)) { 213 pte_t t; 214 215 bool found = page_mapping_find(AS, va, true, &t); 216 if (found && PTE_EXECUTABLE(&t)) { 218 217 /* 219 218 * The mapping was found in the software page hash table. 220 219 * Insert it into ITLB. 221 220 */ 222 t ->a = true;223 itlb_pte_copy( t);221 t.a = true; 222 itlb_pte_copy(&t); 224 223 #ifdef CONFIG_TSB 225 itsb_pte_copy(t); 226 #endif 224 itsb_pte_copy(&t); 225 #endif 226 page_mapping_update(AS, va, true, &t); 227 227 } else { 228 228 /* … … 244 244 void fast_data_access_mmu_miss(unsigned int tt, istate_t *istate) 245 245 { 246 pte_t *t;246 pte_t t; 247 247 uintptr_t va = DMISS_ADDRESS(istate->tlb_tag_access); 248 248 uint16_t ctx = DMISS_CONTEXT(istate->tlb_tag_access); … … 261 261 } 262 262 263 t = page_mapping_find(as, va, true);264 if ( t) {263 bool found = page_mapping_find(as, va, true, &t); 264 if (found) { 265 265 /* 266 266 * The mapping was found in the software page hash table. 267 267 * Insert it into DTLB. 268 268 */ 269 t ->a = true;270 dtlb_pte_copy( t, true);269 t.a = true; 270 dtlb_pte_copy(&t, true); 271 271 #ifdef CONFIG_TSB 272 dtsb_pte_copy(t, true); 273 #endif 272 dtsb_pte_copy(&t, true); 273 #endif 274 page_mapping_update(as, va, true, &t); 274 275 } else { 275 276 /* … … 288 289 void fast_data_access_protection(unsigned int tt, istate_t *istate) 289 290 { 290 pte_t *t;291 pte_t t; 291 292 uintptr_t va = DMISS_ADDRESS(istate->tlb_tag_access); 292 293 uint16_t ctx = DMISS_CONTEXT(istate->tlb_tag_access); … … 296 297 as = AS_KERNEL; 297 298 298 t = page_mapping_find(as, va, true);299 if ( t && PTE_WRITABLE(t)) {299 bool found = page_mapping_find(as, va, true, &t); 300 if (found && PTE_WRITABLE(&t)) { 300 301 /* 301 302 * The mapping was found in the software page hash table and is … … 303 304 * into DTLB. 304 305 */ 305 t ->a = true;306 t ->d = true;306 t.a = true; 307 t.d = true; 307 308 mmu_demap_page(va, ctx, MMU_FLAG_DTLB); 308 dtlb_pte_copy( t, false);309 dtlb_pte_copy(&t, false); 309 310 #ifdef CONFIG_TSB 310 dtsb_pte_copy(t, false); 311 #endif 311 dtsb_pte_copy(&t, false); 312 #endif 313 page_mapping_update(as, va, true, &t); 312 314 } else { 313 315 /*
Note:
See TracChangeset
for help on using the changeset viewer.
