Changeset 38dc82d in mainline for kernel/arch/sparc64
- Timestamp:
- 2016-08-31T14:16:45Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 346b12a2
- Parents:
- dc05a9a
- Location:
- kernel/arch/sparc64/src/mm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/mm/sun4u/tlb.c
rdc05a9a r38dc82d 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);210 itsb_pte_copy(&t, index); 211 211 #endif 212 212 } else { … … 233 233 uintptr_t page_16k; 234 234 size_t index; 235 pte_t *t;235 pte_t t; 236 236 as_t *as = AS; 237 237 … … 253 253 } 254 254 255 t = page_mapping_find(as, page_16k, true);256 if ( t) {255 bool found = page_mapping_find(as, page_16k, true, &t); 256 if (found) { 257 257 /* 258 258 * The mapping was found in the software page hash table. 259 259 * Insert it into DTLB. 260 260 */ 261 t ->a = true;262 dtlb_pte_copy( t, index, true);261 t.a = true; 262 dtlb_pte_copy(&t, index, true); 263 263 #ifdef CONFIG_TSB 264 dtsb_pte_copy( t, index, true);264 dtsb_pte_copy(&t, index, true); 265 265 #endif 266 266 } else { … … 283 283 uintptr_t page_16k; 284 284 size_t index; 285 pte_t *t;285 pte_t t; 286 286 as_t *as = AS; 287 287 … … 293 293 as = AS_KERNEL; 294 294 295 t = page_mapping_find(as, page_16k, true);296 if ( t && PTE_WRITABLE(t)) {295 bool found = page_mapping_find(as, page_16k, true, &t); 296 if (found && PTE_WRITABLE(&t)) { 297 297 /* 298 298 * The mapping was found in the software page hash table and is … … 300 300 * into DTLB. 301 301 */ 302 t ->a = true;303 t ->d = true;302 t.a = true; 303 t.d = true; 304 304 dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_SECONDARY, 305 305 page_16k + index * MMU_PAGE_SIZE); 306 dtlb_pte_copy( t, index, false);306 dtlb_pte_copy(&t, index, false); 307 307 #ifdef CONFIG_TSB 308 dtsb_pte_copy( t, index, false);308 dtsb_pte_copy(&t, index, false); 309 309 #endif 310 310 } else { -
kernel/arch/sparc64/src/mm/sun4v/tlb.c
rdc05a9a r38dc82d 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);224 itsb_pte_copy(&t); 226 225 #endif 227 226 } else { … … 244 243 void fast_data_access_mmu_miss(unsigned int tt, istate_t *istate) 245 244 { 246 pte_t *t;245 pte_t t; 247 246 uintptr_t va = DMISS_ADDRESS(istate->tlb_tag_access); 248 247 uint16_t ctx = DMISS_CONTEXT(istate->tlb_tag_access); … … 261 260 } 262 261 263 t = page_mapping_find(as, va, true);264 if ( t) {262 bool found = page_mapping_find(as, va, true, &t); 263 if (found) { 265 264 /* 266 265 * The mapping was found in the software page hash table. 267 266 * Insert it into DTLB. 268 267 */ 269 t ->a = true;270 dtlb_pte_copy( t, true);268 t.a = true; 269 dtlb_pte_copy(&t, true); 271 270 #ifdef CONFIG_TSB 272 dtsb_pte_copy( t, true);271 dtsb_pte_copy(&t, true); 273 272 #endif 274 273 } else { … … 288 287 void fast_data_access_protection(unsigned int tt, istate_t *istate) 289 288 { 290 pte_t *t;289 pte_t t; 291 290 uintptr_t va = DMISS_ADDRESS(istate->tlb_tag_access); 292 291 uint16_t ctx = DMISS_CONTEXT(istate->tlb_tag_access); … … 296 295 as = AS_KERNEL; 297 296 298 t = page_mapping_find(as, va, true);299 if ( t && PTE_WRITABLE(t)) {297 bool found = page_mapping_find(as, va, true, &t); 298 if (found && PTE_WRITABLE(&t)) { 300 299 /* 301 300 * The mapping was found in the software page hash table and is … … 303 302 * into DTLB. 304 303 */ 305 t ->a = true;306 t ->d = true;304 t.a = true; 305 t.d = true; 307 306 mmu_demap_page(va, ctx, MMU_FLAG_DTLB); 308 dtlb_pte_copy( t, false);307 dtlb_pte_copy(&t, false); 309 308 #ifdef CONFIG_TSB 310 dtsb_pte_copy( t, false);309 dtsb_pte_copy(&t, false); 311 310 #endif 312 311 } else {
Note:
See TracChangeset
for help on using the changeset viewer.