Changeset 1e241723 in mainline for kernel/arch/ppc32/src/mm/tlb.c
- Timestamp:
- 2009-01-31T13:45:18Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c19a4169
- Parents:
- 53634f9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/src/mm/tlb.c
r53634f9 r1e241723 157 157 bool found = false; 158 158 159 /* Find unused orcolliding PTE in PTEG */159 /* Find colliding PTE in PTEG */ 160 160 for (i = 0; i < 8; i++) { 161 if (( !phte[base + i].v) ||162 ((phte[base + i].vsid == vsid)161 if ((phte[base + i].v) 162 && (phte[base + i].vsid == vsid) 163 163 && (phte[base + i].api == api) 164 && (phte[base + i].h == 0)) ){164 && (phte[base + i].h == 0)) { 165 165 found = true; 166 166 break; 167 } 168 } 169 170 if (!found) { 171 /* Find unused PTE in PTEG */ 172 for (i = 0; i < 8; i++) { 173 if (!phte[base + i].v) { 174 found = true; 175 break; 176 } 167 177 } 168 178 } … … 172 182 uint32_t base2 = (~hash & 0x3ff) << 3; 173 183 174 /* Find unused orcolliding PTE in PTEG */184 /* Find colliding PTE in PTEG */ 175 185 for (i = 0; i < 8; i++) { 176 if (( !phte[base2 + i].v) ||177 ((phte[base2 + i].vsid == vsid)186 if ((phte[base2 + i].v) 187 && (phte[base2 + i].vsid == vsid) 178 188 && (phte[base2 + i].api == api) 179 && (phte[base2 + i].h == 1)) ){189 && (phte[base2 + i].h == 1)) { 180 190 found = true; 181 191 base = base2; 182 192 h = 1; 183 193 break; 194 } 195 } 196 197 if (!found) { 198 /* Find unused PTE in PTEG */ 199 for (i = 0; i < 8; i++) { 200 if (!phte[base2 + i].v) { 201 found = true; 202 base = base2; 203 h = 1; 204 break; 205 } 184 206 } 185 207 } … … 309 331 bool found = false; 310 332 311 /* Find unused orcolliding PTE in PTEG */333 /* Find colliding PTE in PTEG */ 312 334 for (i = 0; i < 8; i++) { 313 if (( !phte_real[base + i].v) ||314 ((phte_real[base + i].vsid == vsid)335 if ((phte_real[base + i].v) 336 && (phte_real[base + i].vsid == vsid) 315 337 && (phte_real[base + i].api == api) 316 && (phte_real[base + i].h == 0)) ){338 && (phte_real[base + i].h == 0)) { 317 339 found = true; 318 340 break; 341 } 342 } 343 344 if (!found) { 345 /* Find unused PTE in PTEG */ 346 for (i = 0; i < 8; i++) { 347 if (!phte_real[base + i].v) { 348 found = true; 349 break; 350 } 319 351 } 320 352 } … … 324 356 uint32_t base2 = (~hash & 0x3ff) << 3; 325 357 326 /* Find unused orcolliding PTE in PTEG */358 /* Find colliding PTE in PTEG */ 327 359 for (i = 0; i < 8; i++) { 328 if (( !phte_real[base2 + i].v) ||329 ((phte_real[base2 + i].vsid == vsid)360 if ((phte_real[base2 + i].v) 361 && (phte_real[base2 + i].vsid == vsid) 330 362 && (phte_real[base2 + i].api == api) 331 && (phte_real[base2 + i].h == 1)) ){363 && (phte_real[base2 + i].h == 1)) { 332 364 found = true; 333 365 base = base2; 334 366 h = 1; 335 367 break; 368 } 369 } 370 371 if (!found) { 372 /* Find unused PTE in PTEG */ 373 for (i = 0; i < 8; i++) { 374 if (!phte_real[base2 + i].v) { 375 found = true; 376 base = base2; 377 h = 1; 378 break; 379 } 336 380 } 337 381 }
Note:
See TracChangeset
for help on using the changeset viewer.