diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-10-16 21:50:32 -0400 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-10-16 21:50:32 -0400 |
commit | 7dffb72028bfd909ac51a1546d182de2df4d2426 (patch) | |
tree | c465c35642872973543f710f8aa06b955b84f7e5 /arch/ppc/kernel/misc.S | |
parent | cf764855620aa1aa5b134687ca18b841ac9be4c7 (diff) |
ppc32: use L1_CACHE_SHIFT/L1_CACHE_BYTES
instead of L1_CACHE_LINE_SIZE and LG_L1_CACHE_LINE_SIZE
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch/ppc/kernel/misc.S')
-rw-r--r-- | arch/ppc/kernel/misc.S | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S index 2b9a16274b0b..2350f3e09f95 100644 --- a/arch/ppc/kernel/misc.S +++ b/arch/ppc/kernel/misc.S | |||
@@ -498,21 +498,21 @@ _GLOBAL(flush_icache_range) | |||
498 | BEGIN_FTR_SECTION | 498 | BEGIN_FTR_SECTION |
499 | blr /* for 601, do nothing */ | 499 | blr /* for 601, do nothing */ |
500 | END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) | 500 | END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) |
501 | li r5,L1_CACHE_LINE_SIZE-1 | 501 | li r5,L1_CACHE_BYTES-1 |
502 | andc r3,r3,r5 | 502 | andc r3,r3,r5 |
503 | subf r4,r3,r4 | 503 | subf r4,r3,r4 |
504 | add r4,r4,r5 | 504 | add r4,r4,r5 |
505 | srwi. r4,r4,LG_L1_CACHE_LINE_SIZE | 505 | srwi. r4,r4,L1_CACHE_SHIFT |
506 | beqlr | 506 | beqlr |
507 | mtctr r4 | 507 | mtctr r4 |
508 | mr r6,r3 | 508 | mr r6,r3 |
509 | 1: dcbst 0,r3 | 509 | 1: dcbst 0,r3 |
510 | addi r3,r3,L1_CACHE_LINE_SIZE | 510 | addi r3,r3,L1_CACHE_BYTES |
511 | bdnz 1b | 511 | bdnz 1b |
512 | sync /* wait for dcbst's to get to ram */ | 512 | sync /* wait for dcbst's to get to ram */ |
513 | mtctr r4 | 513 | mtctr r4 |
514 | 2: icbi 0,r6 | 514 | 2: icbi 0,r6 |
515 | addi r6,r6,L1_CACHE_LINE_SIZE | 515 | addi r6,r6,L1_CACHE_BYTES |
516 | bdnz 2b | 516 | bdnz 2b |
517 | sync /* additional sync needed on g4 */ | 517 | sync /* additional sync needed on g4 */ |
518 | isync | 518 | isync |
@@ -525,16 +525,16 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) | |||
525 | * clean_dcache_range(unsigned long start, unsigned long stop) | 525 | * clean_dcache_range(unsigned long start, unsigned long stop) |
526 | */ | 526 | */ |
527 | _GLOBAL(clean_dcache_range) | 527 | _GLOBAL(clean_dcache_range) |
528 | li r5,L1_CACHE_LINE_SIZE-1 | 528 | li r5,L1_CACHE_BYTES-1 |
529 | andc r3,r3,r5 | 529 | andc r3,r3,r5 |
530 | subf r4,r3,r4 | 530 | subf r4,r3,r4 |
531 | add r4,r4,r5 | 531 | add r4,r4,r5 |
532 | srwi. r4,r4,LG_L1_CACHE_LINE_SIZE | 532 | srwi. r4,r4,L1_CACHE_SHIFT |
533 | beqlr | 533 | beqlr |
534 | mtctr r4 | 534 | mtctr r4 |
535 | 535 | ||
536 | 1: dcbst 0,r3 | 536 | 1: dcbst 0,r3 |
537 | addi r3,r3,L1_CACHE_LINE_SIZE | 537 | addi r3,r3,L1_CACHE_BYTES |
538 | bdnz 1b | 538 | bdnz 1b |
539 | sync /* wait for dcbst's to get to ram */ | 539 | sync /* wait for dcbst's to get to ram */ |
540 | blr | 540 | blr |
@@ -546,16 +546,16 @@ _GLOBAL(clean_dcache_range) | |||
546 | * flush_dcache_range(unsigned long start, unsigned long stop) | 546 | * flush_dcache_range(unsigned long start, unsigned long stop) |
547 | */ | 547 | */ |
548 | _GLOBAL(flush_dcache_range) | 548 | _GLOBAL(flush_dcache_range) |
549 | li r5,L1_CACHE_LINE_SIZE-1 | 549 | li r5,L1_CACHE_BYTES-1 |
550 | andc r3,r3,r5 | 550 | andc r3,r3,r5 |
551 | subf r4,r3,r4 | 551 | subf r4,r3,r4 |
552 | add r4,r4,r5 | 552 | add r4,r4,r5 |
553 | srwi. r4,r4,LG_L1_CACHE_LINE_SIZE | 553 | srwi. r4,r4,L1_CACHE_SHIFT |
554 | beqlr | 554 | beqlr |
555 | mtctr r4 | 555 | mtctr r4 |
556 | 556 | ||
557 | 1: dcbf 0,r3 | 557 | 1: dcbf 0,r3 |
558 | addi r3,r3,L1_CACHE_LINE_SIZE | 558 | addi r3,r3,L1_CACHE_BYTES |
559 | bdnz 1b | 559 | bdnz 1b |
560 | sync /* wait for dcbst's to get to ram */ | 560 | sync /* wait for dcbst's to get to ram */ |
561 | blr | 561 | blr |
@@ -568,16 +568,16 @@ _GLOBAL(flush_dcache_range) | |||
568 | * invalidate_dcache_range(unsigned long start, unsigned long stop) | 568 | * invalidate_dcache_range(unsigned long start, unsigned long stop) |
569 | */ | 569 | */ |
570 | _GLOBAL(invalidate_dcache_range) | 570 | _GLOBAL(invalidate_dcache_range) |
571 | li r5,L1_CACHE_LINE_SIZE-1 | 571 | li r5,L1_CACHE_BYTES-1 |
572 | andc r3,r3,r5 | 572 | andc r3,r3,r5 |
573 | subf r4,r3,r4 | 573 | subf r4,r3,r4 |
574 | add r4,r4,r5 | 574 | add r4,r4,r5 |
575 | srwi. r4,r4,LG_L1_CACHE_LINE_SIZE | 575 | srwi. r4,r4,L1_CACHE_SHIFT |
576 | beqlr | 576 | beqlr |
577 | mtctr r4 | 577 | mtctr r4 |
578 | 578 | ||
579 | 1: dcbi 0,r3 | 579 | 1: dcbi 0,r3 |
580 | addi r3,r3,L1_CACHE_LINE_SIZE | 580 | addi r3,r3,L1_CACHE_BYTES |
581 | bdnz 1b | 581 | bdnz 1b |
582 | sync /* wait for dcbi's to get to ram */ | 582 | sync /* wait for dcbi's to get to ram */ |
583 | blr | 583 | blr |
@@ -598,7 +598,7 @@ _GLOBAL(flush_dcache_all) | |||
598 | mtctr r4 | 598 | mtctr r4 |
599 | lis r5, KERNELBASE@h | 599 | lis r5, KERNELBASE@h |
600 | 1: lwz r3, 0(r5) /* Load one word from every line */ | 600 | 1: lwz r3, 0(r5) /* Load one word from every line */ |
601 | addi r5, r5, L1_CACHE_LINE_SIZE | 601 | addi r5, r5, L1_CACHE_BYTES |
602 | bdnz 1b | 602 | bdnz 1b |
603 | blr | 603 | blr |
604 | #endif /* CONFIG_NOT_COHERENT_CACHE */ | 604 | #endif /* CONFIG_NOT_COHERENT_CACHE */ |
@@ -616,16 +616,16 @@ BEGIN_FTR_SECTION | |||
616 | blr /* for 601, do nothing */ | 616 | blr /* for 601, do nothing */ |
617 | END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) | 617 | END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) |
618 | rlwinm r3,r3,0,0,19 /* Get page base address */ | 618 | rlwinm r3,r3,0,0,19 /* Get page base address */ |
619 | li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */ | 619 | li r4,4096/L1_CACHE_BYTES /* Number of lines in a page */ |
620 | mtctr r4 | 620 | mtctr r4 |
621 | mr r6,r3 | 621 | mr r6,r3 |
622 | 0: dcbst 0,r3 /* Write line to ram */ | 622 | 0: dcbst 0,r3 /* Write line to ram */ |
623 | addi r3,r3,L1_CACHE_LINE_SIZE | 623 | addi r3,r3,L1_CACHE_BYTES |
624 | bdnz 0b | 624 | bdnz 0b |
625 | sync | 625 | sync |
626 | mtctr r4 | 626 | mtctr r4 |
627 | 1: icbi 0,r6 | 627 | 1: icbi 0,r6 |
628 | addi r6,r6,L1_CACHE_LINE_SIZE | 628 | addi r6,r6,L1_CACHE_BYTES |
629 | bdnz 1b | 629 | bdnz 1b |
630 | sync | 630 | sync |
631 | isync | 631 | isync |
@@ -648,16 +648,16 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) | |||
648 | mtmsr r0 | 648 | mtmsr r0 |
649 | isync | 649 | isync |
650 | rlwinm r3,r3,0,0,19 /* Get page base address */ | 650 | rlwinm r3,r3,0,0,19 /* Get page base address */ |
651 | li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */ | 651 | li r4,4096/L1_CACHE_BYTES /* Number of lines in a page */ |
652 | mtctr r4 | 652 | mtctr r4 |
653 | mr r6,r3 | 653 | mr r6,r3 |
654 | 0: dcbst 0,r3 /* Write line to ram */ | 654 | 0: dcbst 0,r3 /* Write line to ram */ |
655 | addi r3,r3,L1_CACHE_LINE_SIZE | 655 | addi r3,r3,L1_CACHE_BYTES |
656 | bdnz 0b | 656 | bdnz 0b |
657 | sync | 657 | sync |
658 | mtctr r4 | 658 | mtctr r4 |
659 | 1: icbi 0,r6 | 659 | 1: icbi 0,r6 |
660 | addi r6,r6,L1_CACHE_LINE_SIZE | 660 | addi r6,r6,L1_CACHE_BYTES |
661 | bdnz 1b | 661 | bdnz 1b |
662 | sync | 662 | sync |
663 | mtmsr r10 /* restore DR */ | 663 | mtmsr r10 /* restore DR */ |
@@ -672,7 +672,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) | |||
672 | * void clear_pages(void *page, int order) ; | 672 | * void clear_pages(void *page, int order) ; |
673 | */ | 673 | */ |
674 | _GLOBAL(clear_pages) | 674 | _GLOBAL(clear_pages) |
675 | li r0,4096/L1_CACHE_LINE_SIZE | 675 | li r0,4096/L1_CACHE_BYTES |
676 | slw r0,r0,r4 | 676 | slw r0,r0,r4 |
677 | mtctr r0 | 677 | mtctr r0 |
678 | #ifdef CONFIG_8xx | 678 | #ifdef CONFIG_8xx |
@@ -684,7 +684,7 @@ _GLOBAL(clear_pages) | |||
684 | #else | 684 | #else |
685 | 1: dcbz 0,r3 | 685 | 1: dcbz 0,r3 |
686 | #endif | 686 | #endif |
687 | addi r3,r3,L1_CACHE_LINE_SIZE | 687 | addi r3,r3,L1_CACHE_BYTES |
688 | bdnz 1b | 688 | bdnz 1b |
689 | blr | 689 | blr |
690 | 690 | ||
@@ -710,7 +710,7 @@ _GLOBAL(copy_page) | |||
710 | 710 | ||
711 | #ifdef CONFIG_8xx | 711 | #ifdef CONFIG_8xx |
712 | /* don't use prefetch on 8xx */ | 712 | /* don't use prefetch on 8xx */ |
713 | li r0,4096/L1_CACHE_LINE_SIZE | 713 | li r0,4096/L1_CACHE_BYTES |
714 | mtctr r0 | 714 | mtctr r0 |
715 | 1: COPY_16_BYTES | 715 | 1: COPY_16_BYTES |
716 | bdnz 1b | 716 | bdnz 1b |
@@ -724,13 +724,13 @@ _GLOBAL(copy_page) | |||
724 | li r11,4 | 724 | li r11,4 |
725 | mtctr r0 | 725 | mtctr r0 |
726 | 11: dcbt r11,r4 | 726 | 11: dcbt r11,r4 |
727 | addi r11,r11,L1_CACHE_LINE_SIZE | 727 | addi r11,r11,L1_CACHE_BYTES |
728 | bdnz 11b | 728 | bdnz 11b |
729 | #else /* MAX_COPY_PREFETCH == 1 */ | 729 | #else /* MAX_COPY_PREFETCH == 1 */ |
730 | dcbt r5,r4 | 730 | dcbt r5,r4 |
731 | li r11,L1_CACHE_LINE_SIZE+4 | 731 | li r11,L1_CACHE_BYTES+4 |
732 | #endif /* MAX_COPY_PREFETCH */ | 732 | #endif /* MAX_COPY_PREFETCH */ |
733 | li r0,4096/L1_CACHE_LINE_SIZE - MAX_COPY_PREFETCH | 733 | li r0,4096/L1_CACHE_BYTES - MAX_COPY_PREFETCH |
734 | crclr 4*cr0+eq | 734 | crclr 4*cr0+eq |
735 | 2: | 735 | 2: |
736 | mtctr r0 | 736 | mtctr r0 |
@@ -738,12 +738,12 @@ _GLOBAL(copy_page) | |||
738 | dcbt r11,r4 | 738 | dcbt r11,r4 |
739 | dcbz r5,r3 | 739 | dcbz r5,r3 |
740 | COPY_16_BYTES | 740 | COPY_16_BYTES |
741 | #if L1_CACHE_LINE_SIZE >= 32 | 741 | #if L1_CACHE_BYTES >= 32 |
742 | COPY_16_BYTES | 742 | COPY_16_BYTES |
743 | #if L1_CACHE_LINE_SIZE >= 64 | 743 | #if L1_CACHE_BYTES >= 64 |
744 | COPY_16_BYTES | 744 | COPY_16_BYTES |
745 | COPY_16_BYTES | 745 | COPY_16_BYTES |
746 | #if L1_CACHE_LINE_SIZE >= 128 | 746 | #if L1_CACHE_BYTES >= 128 |
747 | COPY_16_BYTES | 747 | COPY_16_BYTES |
748 | COPY_16_BYTES | 748 | COPY_16_BYTES |
749 | COPY_16_BYTES | 749 | COPY_16_BYTES |