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/powerpc/kernel/misc_32.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/powerpc/kernel/misc_32.S')
-rw-r--r-- | arch/powerpc/kernel/misc_32.S | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 27274108116f..0b0e908b5065 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
@@ -496,21 +496,21 @@ _GLOBAL(flush_icache_range) | |||
496 | BEGIN_FTR_SECTION | 496 | BEGIN_FTR_SECTION |
497 | blr /* for 601, do nothing */ | 497 | blr /* for 601, do nothing */ |
498 | END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) | 498 | END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) |
499 | li r5,L1_CACHE_LINE_SIZE-1 | 499 | li r5,L1_CACHE_BYTES-1 |
500 | andc r3,r3,r5 | 500 | andc r3,r3,r5 |
501 | subf r4,r3,r4 | 501 | subf r4,r3,r4 |
502 | add r4,r4,r5 | 502 | add r4,r4,r5 |
503 | srwi. r4,r4,LG_L1_CACHE_LINE_SIZE | 503 | srwi. r4,r4,L1_CACHE_SHIFT |
504 | beqlr | 504 | beqlr |
505 | mtctr r4 | 505 | mtctr r4 |
506 | mr r6,r3 | 506 | mr r6,r3 |
507 | 1: dcbst 0,r3 | 507 | 1: dcbst 0,r3 |
508 | addi r3,r3,L1_CACHE_LINE_SIZE | 508 | addi r3,r3,L1_CACHE_BYTES |
509 | bdnz 1b | 509 | bdnz 1b |
510 | sync /* wait for dcbst's to get to ram */ | 510 | sync /* wait for dcbst's to get to ram */ |
511 | mtctr r4 | 511 | mtctr r4 |
512 | 2: icbi 0,r6 | 512 | 2: icbi 0,r6 |
513 | addi r6,r6,L1_CACHE_LINE_SIZE | 513 | addi r6,r6,L1_CACHE_BYTES |
514 | bdnz 2b | 514 | bdnz 2b |
515 | sync /* additional sync needed on g4 */ | 515 | sync /* additional sync needed on g4 */ |
516 | isync | 516 | isync |
@@ -523,16 +523,16 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) | |||
523 | * clean_dcache_range(unsigned long start, unsigned long stop) | 523 | * clean_dcache_range(unsigned long start, unsigned long stop) |
524 | */ | 524 | */ |
525 | _GLOBAL(clean_dcache_range) | 525 | _GLOBAL(clean_dcache_range) |
526 | li r5,L1_CACHE_LINE_SIZE-1 | 526 | li r5,L1_CACHE_BYTES-1 |
527 | andc r3,r3,r5 | 527 | andc r3,r3,r5 |
528 | subf r4,r3,r4 | 528 | subf r4,r3,r4 |
529 | add r4,r4,r5 | 529 | add r4,r4,r5 |
530 | srwi. r4,r4,LG_L1_CACHE_LINE_SIZE | 530 | srwi. r4,r4,L1_CACHE_SHIFT |
531 | beqlr | 531 | beqlr |
532 | mtctr r4 | 532 | mtctr r4 |
533 | 533 | ||
534 | 1: dcbst 0,r3 | 534 | 1: dcbst 0,r3 |
535 | addi r3,r3,L1_CACHE_LINE_SIZE | 535 | addi r3,r3,L1_CACHE_BYTES |
536 | bdnz 1b | 536 | bdnz 1b |
537 | sync /* wait for dcbst's to get to ram */ | 537 | sync /* wait for dcbst's to get to ram */ |
538 | blr | 538 | blr |
@@ -544,16 +544,16 @@ _GLOBAL(clean_dcache_range) | |||
544 | * flush_dcache_range(unsigned long start, unsigned long stop) | 544 | * flush_dcache_range(unsigned long start, unsigned long stop) |
545 | */ | 545 | */ |
546 | _GLOBAL(flush_dcache_range) | 546 | _GLOBAL(flush_dcache_range) |
547 | li r5,L1_CACHE_LINE_SIZE-1 | 547 | li r5,L1_CACHE_BYTES-1 |
548 | andc r3,r3,r5 | 548 | andc r3,r3,r5 |
549 | subf r4,r3,r4 | 549 | subf r4,r3,r4 |
550 | add r4,r4,r5 | 550 | add r4,r4,r5 |
551 | srwi. r4,r4,LG_L1_CACHE_LINE_SIZE | 551 | srwi. r4,r4,L1_CACHE_SHIFT |
552 | beqlr | 552 | beqlr |
553 | mtctr r4 | 553 | mtctr r4 |
554 | 554 | ||
555 | 1: dcbf 0,r3 | 555 | 1: dcbf 0,r3 |
556 | addi r3,r3,L1_CACHE_LINE_SIZE | 556 | addi r3,r3,L1_CACHE_BYTES |
557 | bdnz 1b | 557 | bdnz 1b |
558 | sync /* wait for dcbst's to get to ram */ | 558 | sync /* wait for dcbst's to get to ram */ |
559 | blr | 559 | blr |
@@ -566,16 +566,16 @@ _GLOBAL(flush_dcache_range) | |||
566 | * invalidate_dcache_range(unsigned long start, unsigned long stop) | 566 | * invalidate_dcache_range(unsigned long start, unsigned long stop) |
567 | */ | 567 | */ |
568 | _GLOBAL(invalidate_dcache_range) | 568 | _GLOBAL(invalidate_dcache_range) |
569 | li r5,L1_CACHE_LINE_SIZE-1 | 569 | li r5,L1_CACHE_BYTES-1 |
570 | andc r3,r3,r5 | 570 | andc r3,r3,r5 |
571 | subf r4,r3,r4 | 571 | subf r4,r3,r4 |
572 | add r4,r4,r5 | 572 | add r4,r4,r5 |
573 | srwi. r4,r4,LG_L1_CACHE_LINE_SIZE | 573 | srwi. r4,r4,L1_CACHE_SHIFT |
574 | beqlr | 574 | beqlr |
575 | mtctr r4 | 575 | mtctr r4 |
576 | 576 | ||
577 | 1: dcbi 0,r3 | 577 | 1: dcbi 0,r3 |
578 | addi r3,r3,L1_CACHE_LINE_SIZE | 578 | addi r3,r3,L1_CACHE_BYTES |
579 | bdnz 1b | 579 | bdnz 1b |
580 | sync /* wait for dcbi's to get to ram */ | 580 | sync /* wait for dcbi's to get to ram */ |
581 | blr | 581 | blr |
@@ -596,7 +596,7 @@ _GLOBAL(flush_dcache_all) | |||
596 | mtctr r4 | 596 | mtctr r4 |
597 | lis r5, KERNELBASE@h | 597 | lis r5, KERNELBASE@h |
598 | 1: lwz r3, 0(r5) /* Load one word from every line */ | 598 | 1: lwz r3, 0(r5) /* Load one word from every line */ |
599 | addi r5, r5, L1_CACHE_LINE_SIZE | 599 | addi r5, r5, L1_CACHE_BYTES |
600 | bdnz 1b | 600 | bdnz 1b |
601 | blr | 601 | blr |
602 | #endif /* CONFIG_NOT_COHERENT_CACHE */ | 602 | #endif /* CONFIG_NOT_COHERENT_CACHE */ |
@@ -614,16 +614,16 @@ BEGIN_FTR_SECTION | |||
614 | blr /* for 601, do nothing */ | 614 | blr /* for 601, do nothing */ |
615 | END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) | 615 | END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) |
616 | rlwinm r3,r3,0,0,19 /* Get page base address */ | 616 | rlwinm r3,r3,0,0,19 /* Get page base address */ |
617 | li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */ | 617 | li r4,4096/L1_CACHE_BYTES /* Number of lines in a page */ |
618 | mtctr r4 | 618 | mtctr r4 |
619 | mr r6,r3 | 619 | mr r6,r3 |
620 | 0: dcbst 0,r3 /* Write line to ram */ | 620 | 0: dcbst 0,r3 /* Write line to ram */ |
621 | addi r3,r3,L1_CACHE_LINE_SIZE | 621 | addi r3,r3,L1_CACHE_BYTES |
622 | bdnz 0b | 622 | bdnz 0b |
623 | sync | 623 | sync |
624 | mtctr r4 | 624 | mtctr r4 |
625 | 1: icbi 0,r6 | 625 | 1: icbi 0,r6 |
626 | addi r6,r6,L1_CACHE_LINE_SIZE | 626 | addi r6,r6,L1_CACHE_BYTES |
627 | bdnz 1b | 627 | bdnz 1b |
628 | sync | 628 | sync |
629 | isync | 629 | isync |
@@ -646,16 +646,16 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) | |||
646 | mtmsr r0 | 646 | mtmsr r0 |
647 | isync | 647 | isync |
648 | rlwinm r3,r3,0,0,19 /* Get page base address */ | 648 | rlwinm r3,r3,0,0,19 /* Get page base address */ |
649 | li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */ | 649 | li r4,4096/L1_CACHE_BYTES /* Number of lines in a page */ |
650 | mtctr r4 | 650 | mtctr r4 |
651 | mr r6,r3 | 651 | mr r6,r3 |
652 | 0: dcbst 0,r3 /* Write line to ram */ | 652 | 0: dcbst 0,r3 /* Write line to ram */ |
653 | addi r3,r3,L1_CACHE_LINE_SIZE | 653 | addi r3,r3,L1_CACHE_BYTES |
654 | bdnz 0b | 654 | bdnz 0b |
655 | sync | 655 | sync |
656 | mtctr r4 | 656 | mtctr r4 |
657 | 1: icbi 0,r6 | 657 | 1: icbi 0,r6 |
658 | addi r6,r6,L1_CACHE_LINE_SIZE | 658 | addi r6,r6,L1_CACHE_BYTES |
659 | bdnz 1b | 659 | bdnz 1b |
660 | sync | 660 | sync |
661 | mtmsr r10 /* restore DR */ | 661 | mtmsr r10 /* restore DR */ |
@@ -670,7 +670,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) | |||
670 | * void clear_pages(void *page, int order) ; | 670 | * void clear_pages(void *page, int order) ; |
671 | */ | 671 | */ |
672 | _GLOBAL(clear_pages) | 672 | _GLOBAL(clear_pages) |
673 | li r0,4096/L1_CACHE_LINE_SIZE | 673 | li r0,4096/L1_CACHE_BYTES |
674 | slw r0,r0,r4 | 674 | slw r0,r0,r4 |
675 | mtctr r0 | 675 | mtctr r0 |
676 | #ifdef CONFIG_8xx | 676 | #ifdef CONFIG_8xx |
@@ -682,7 +682,7 @@ _GLOBAL(clear_pages) | |||
682 | #else | 682 | #else |
683 | 1: dcbz 0,r3 | 683 | 1: dcbz 0,r3 |
684 | #endif | 684 | #endif |
685 | addi r3,r3,L1_CACHE_LINE_SIZE | 685 | addi r3,r3,L1_CACHE_BYTES |
686 | bdnz 1b | 686 | bdnz 1b |
687 | blr | 687 | blr |
688 | 688 | ||
@@ -708,7 +708,7 @@ _GLOBAL(copy_page) | |||
708 | 708 | ||
709 | #ifdef CONFIG_8xx | 709 | #ifdef CONFIG_8xx |
710 | /* don't use prefetch on 8xx */ | 710 | /* don't use prefetch on 8xx */ |
711 | li r0,4096/L1_CACHE_LINE_SIZE | 711 | li r0,4096/L1_CACHE_BYTES |
712 | mtctr r0 | 712 | mtctr r0 |
713 | 1: COPY_16_BYTES | 713 | 1: COPY_16_BYTES |
714 | bdnz 1b | 714 | bdnz 1b |
@@ -722,13 +722,13 @@ _GLOBAL(copy_page) | |||
722 | li r11,4 | 722 | li r11,4 |
723 | mtctr r0 | 723 | mtctr r0 |
724 | 11: dcbt r11,r4 | 724 | 11: dcbt r11,r4 |
725 | addi r11,r11,L1_CACHE_LINE_SIZE | 725 | addi r11,r11,L1_CACHE_BYTES |
726 | bdnz 11b | 726 | bdnz 11b |
727 | #else /* MAX_COPY_PREFETCH == 1 */ | 727 | #else /* MAX_COPY_PREFETCH == 1 */ |
728 | dcbt r5,r4 | 728 | dcbt r5,r4 |
729 | li r11,L1_CACHE_LINE_SIZE+4 | 729 | li r11,L1_CACHE_BYTES+4 |
730 | #endif /* MAX_COPY_PREFETCH */ | 730 | #endif /* MAX_COPY_PREFETCH */ |
731 | li r0,4096/L1_CACHE_LINE_SIZE - MAX_COPY_PREFETCH | 731 | li r0,4096/L1_CACHE_BYTES - MAX_COPY_PREFETCH |
732 | crclr 4*cr0+eq | 732 | crclr 4*cr0+eq |
733 | 2: | 733 | 2: |
734 | mtctr r0 | 734 | mtctr r0 |
@@ -736,12 +736,12 @@ _GLOBAL(copy_page) | |||
736 | dcbt r11,r4 | 736 | dcbt r11,r4 |
737 | dcbz r5,r3 | 737 | dcbz r5,r3 |
738 | COPY_16_BYTES | 738 | COPY_16_BYTES |
739 | #if L1_CACHE_LINE_SIZE >= 32 | 739 | #if L1_CACHE_BYTES >= 32 |
740 | COPY_16_BYTES | 740 | COPY_16_BYTES |
741 | #if L1_CACHE_LINE_SIZE >= 64 | 741 | #if L1_CACHE_BYTES >= 64 |
742 | COPY_16_BYTES | 742 | COPY_16_BYTES |
743 | COPY_16_BYTES | 743 | COPY_16_BYTES |
744 | #if L1_CACHE_LINE_SIZE >= 128 | 744 | #if L1_CACHE_BYTES >= 128 |
745 | COPY_16_BYTES | 745 | COPY_16_BYTES |
746 | COPY_16_BYTES | 746 | COPY_16_BYTES |
747 | COPY_16_BYTES | 747 | COPY_16_BYTES |