Rev 1733 | Rev 1743 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1733 | Rev 1736 | ||
---|---|---|---|
Line 373... | Line 373... | ||
373 | // TODO |
373 | // TODO |
374 | tlb_invalidate_all(); |
374 | tlb_invalidate_all(); |
375 | } |
375 | } |
376 | 376 | ||
377 | 377 | ||
- | 378 | #define PRINT_BAT(name, ureg, lreg) \ |
|
- | 379 | asm volatile ( \ |
|
- | 380 | "mfspr %0," #ureg "\n" \ |
|
- | 381 | "mfspr %1," #lreg "\n" \ |
|
- | 382 | : "=r" (upper), "=r" (lower) \ |
|
- | 383 | ); \ |
|
- | 384 | mask = (upper & 0x1ffc) >> 2; \ |
|
- | 385 | if (upper & 3) { \ |
|
- | 386 | __u32 tmp = mask; \ |
|
- | 387 | length = 128; \ |
|
- | 388 | while (tmp) { \ |
|
- | 389 | if ((tmp & 1) == 0) { \ |
|
- | 390 | printf("ibat[0]: error in mask\n"); \ |
|
- | 391 | break; \ |
|
- | 392 | } \ |
|
- | 393 | length <<= 1; \ |
|
- | 394 | tmp >>= 1; \ |
|
- | 395 | } \ |
|
- | 396 | } else \ |
|
- | 397 | length = 0; \ |
|
- | 398 | printf(name ": page=%.*p frame=%.*p length=%d KB (mask=%#x)%s%s\n", sizeof(upper) * 2, upper & 0xffff0000, sizeof(lower) * 2, lower & 0xffff0000, length, mask, ((upper >> 1) & 1) ? " supervisor" : "", (upper & 1) ? " user" : ""); |
|
- | 399 | ||
- | 400 | ||
378 | void tlb_print(void) |
401 | void tlb_print(void) |
379 | { |
402 | { |
380 | __u32 sr; |
403 | __u32 sr; |
381 | 404 | ||
382 | for (sr = 0; sr < 16; sr++) { |
405 | for (sr = 0; sr < 16; sr++) { |
Line 384... | Line 407... | ||
384 | asm volatile ( |
407 | asm volatile ( |
385 | "mfsrin %0, %1\n" |
408 | "mfsrin %0, %1\n" |
386 | : "=r" (vsid) |
409 | : "=r" (vsid) |
387 | : "r" (sr << 28) |
410 | : "r" (sr << 28) |
388 | ); |
411 | ); |
389 | printf("vsid[%#x]=%#x\n", sr << 28, vsid); |
412 | printf("vsid[%d]: VSID=%.*p (ASID=%d)%s%s\n", sr, sizeof(vsid) * 2, vsid & 0xffffff, (vsid & 0xffffff) >> 4, ((vsid >> 30) & 1) ? " supervisor" : "", ((vsid >> 29) & 1) ? " user" : ""); |
390 | } |
413 | } |
- | 414 | ||
- | 415 | __u32 upper; |
|
- | 416 | __u32 lower; |
|
- | 417 | __u32 mask; |
|
- | 418 | __u32 length; |
|
- | 419 | ||
- | 420 | PRINT_BAT("ibat[0]", 528, 529); |
|
- | 421 | PRINT_BAT("ibat[1]", 530, 531); |
|
- | 422 | PRINT_BAT("ibat[2]", 532, 533); |
|
- | 423 | PRINT_BAT("ibat[3]", 534, 535); |
|
- | 424 | ||
- | 425 | PRINT_BAT("dbat[0]", 536, 537); |
|
- | 426 | PRINT_BAT("dbat[1]", 538, 539); |
|
- | 427 | PRINT_BAT("dbat[2]", 540, 541); |
|
- | 428 | PRINT_BAT("dbat[3]", 542, 543); |
|
391 | } |
429 | } |
392 | 430 | ||
393 | /** @} |
431 | /** @} |
394 | */ |
432 | */ |