Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Fixup a few lose ends in explicit support for MIPS R1/R2. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+50 -51
+2 -2
arch/mips/kernel/Makefile
··· 28 28 obj-$(CONFIG_CPU_NEVADA) += r4k_fpu.o r4k_switch.o 29 29 obj-$(CONFIG_CPU_R10000) += r4k_fpu.o r4k_switch.o 30 30 obj-$(CONFIG_CPU_SB1) += r4k_fpu.o r4k_switch.o 31 - obj-$(CONFIG_CPU_MIPS32_R1) += r4k_fpu.o r4k_switch.o 32 - obj-$(CONFIG_CPU_MIPS64_R1) += r4k_fpu.o r4k_switch.o 31 + obj-$(CONFIG_CPU_MIPS32) += r4k_fpu.o r4k_switch.o 32 + obj-$(CONFIG_CPU_MIPS64) += r4k_fpu.o r4k_switch.o 33 33 obj-$(CONFIG_CPU_R6000) += r6000_fpu.o r4k_switch.o 34 34 35 35 obj-$(CONFIG_SMP) += smp.o
+1 -1
arch/mips/kernel/r4k_switch.S
··· 165 165 1: 166 166 #endif 167 167 168 - #ifdef CONFIG_CPU_MIPS32_R1 168 + #ifdef CONFIG_CPU_MIPS32 169 169 mtc1 t1, $f0 170 170 mtc1 t1, $f1 171 171 mtc1 t1, $f2
+1 -1
arch/mips/kernel/traps.c
··· 885 885 reg_val & (1<<22) ? "E0 " : ""); 886 886 printk("IDX: 0x%08x\n", reg_val & ((1<<22)-1)); 887 887 888 - #if defined(CONFIG_CPU_MIPS32_R1) || defined(CONFIG_CPU_MIPS64_R1) 888 + #if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) 889 889 if (reg_val & (1<<22)) 890 890 printk("DErrAddr0: 0x%0*lx\n", field, read_c0_derraddr0()); 891 891
+2 -2
arch/mips/lib-32/Makefile
··· 4 4 5 5 lib-y += csum_partial.o memset.o watch.o 6 6 7 - obj-$(CONFIG_CPU_MIPS32_R1) += dump_tlb.o 8 - obj-$(CONFIG_CPU_MIPS64_R1) += dump_tlb.o 7 + obj-$(CONFIG_CPU_MIPS32) += dump_tlb.o 8 + obj-$(CONFIG_CPU_MIPS64) += dump_tlb.o 9 9 obj-$(CONFIG_CPU_NEVADA) += dump_tlb.o 10 10 obj-$(CONFIG_CPU_R10000) += dump_tlb.o 11 11 obj-$(CONFIG_CPU_R3000) += r3k_dump_tlb.o
+2 -2
arch/mips/lib-64/Makefile
··· 4 4 5 5 lib-y += csum_partial.o memset.o watch.o 6 6 7 - obj-$(CONFIG_CPU_MIPS32_R1) += dump_tlb.o 8 - obj-$(CONFIG_CPU_MIPS64_R1) += dump_tlb.o 7 + obj-$(CONFIG_CPU_MIPS32) += dump_tlb.o 8 + obj-$(CONFIG_CPU_MIPS64) += dump_tlb.o 9 9 obj-$(CONFIG_CPU_NEVADA) += dump_tlb.o 10 10 obj-$(CONFIG_CPU_R10000) += dump_tlb.o 11 11 obj-$(CONFIG_CPU_R3000) += r3k_dump_tlb.o
+2 -2
arch/mips/mm/Makefile
··· 9 9 obj-$(CONFIG_64BIT) += pgtable-64.o 10 10 obj-$(CONFIG_HIGHMEM) += highmem.o 11 11 12 - obj-$(CONFIG_CPU_MIPS32_R1) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 13 - obj-$(CONFIG_CPU_MIPS64_R1) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 12 + obj-$(CONFIG_CPU_MIPS32) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 13 + obj-$(CONFIG_CPU_MIPS64) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 14 14 obj-$(CONFIG_CPU_NEVADA) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 15 15 obj-$(CONFIG_CPU_R10000) += c-r4k.o cex-gen.o pg-r4k.o tlb-andes.o 16 16 obj-$(CONFIG_CPU_R3000) += c-r3k.o tlb-r3k.o pg-r4k.o
+2 -2
arch/mips/oprofile/Makefile
··· 10 10 11 11 oprofile-y := $(DRIVER_OBJS) common.o 12 12 13 - oprofile-$(CONFIG_CPU_MIPS32_R1) += op_model_mipsxx.o 14 - oprofile-$(CONFIG_CPU_MIPS64_R1) += op_model_mipsxx.o 13 + oprofile-$(CONFIG_CPU_MIPS32) += op_model_mipsxx.o 14 + oprofile-$(CONFIG_CPU_MIPS64) += op_model_mipsxx.o 15 15 oprofile-$(CONFIG_CPU_RM9000) += op_model_rm9000.o
+1 -1
include/asm-mips/addrspace.h
··· 131 131 || defined (CONFIG_CPU_R5000) \ 132 132 || defined (CONFIG_CPU_NEVADA) \ 133 133 || defined (CONFIG_CPU_TX49XX) \ 134 - || defined (CONFIG_CPU_MIPS64_R1) 134 + || defined (CONFIG_CPU_MIPS64) 135 135 #define KUSIZE _LLCONST_(0x0000010000000000) /* 2^^40 */ 136 136 #define KUSIZE_64 _LLCONST_(0x0000010000000000) /* 2^^40 */ 137 137 #define K0SIZE _LLCONST_(0x0000001000000000) /* 2^^36 */
+28 -28
include/asm-mips/bitops.h
··· 12 12 #include <linux/config.h> 13 13 #include <linux/compiler.h> 14 14 #include <linux/types.h> 15 + #include <asm/bug.h> 15 16 #include <asm/byteorder.h> /* sigh ... */ 16 17 #include <asm/cpu-features.h> 17 18 ··· 547 546 return 1UL & (addr[nr >> SZLONG_LOG] >> (nr & SZLONG_MASK)); 548 547 } 549 548 550 - #ifdef CONFIG_CPU_MIPS32_R1 551 - /* 552 - * Return the bit position (0..31) of the most significant 1 bit in a word 553 - * Returns -1 if no 1 bit exists 554 - */ 555 - static __inline__ int __ilog2(unsigned long x) 556 - { 557 - int lz; 558 - 559 - __asm__ ( 560 - " .set push \n" 561 - " .set mips32 \n" 562 - " clz %0, %1 \n" 563 - " .set pop \n" 564 - : "=r" (lz) 565 - : "r" (x)); 566 - 567 - return 31 - lz; 568 - } 569 - #elif defined(CONFIG_CPU_MIPS64_R1) 570 549 /* 571 550 * Return the bit position (0..63) of the most significant 1 bit in a word 572 551 * Returns -1 if no 1 bit exists 573 552 */ 574 - static __inline__ int __ilog2(unsigned long x) 553 + static inline int __ilog2(unsigned long x) 575 554 { 576 555 int lz; 556 + 557 + if (sizeof(x) == 4) { 558 + __asm__ ( 559 + " .set push \n" 560 + " .set mips32 \n" 561 + " clz %0, %1 \n" 562 + " .set pop \n" 563 + : "=r" (lz) 564 + : "r" (x)); 565 + 566 + return 31 - lz; 567 + } 568 + 569 + BUG_ON(sizeof(x) != 8); 577 570 578 571 __asm__ ( 579 572 " .set push \n" ··· 579 584 580 585 return 63 - lz; 581 586 } 582 - #endif 583 587 584 588 /* 585 589 * __ffs - find first bit in word. ··· 589 595 */ 590 596 static inline unsigned long __ffs(unsigned long word) 591 597 { 592 - #if defined(CONFIG_CPU_MIPS32_R1) || defined(CONFIG_CPU_MIPS64_R1) 598 + #if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) 593 599 return __ilog2(word & -word); 594 600 #else 595 601 int b = 0, s; ··· 600 606 s = 4; if (word << 28 != 0) s = 0; b += s; word >>= s; 601 607 s = 2; if (word << 30 != 0) s = 0; b += s; word >>= s; 602 608 s = 1; if (word << 31 != 0) s = 0; b += s; 609 + 610 + return b; 603 611 #endif 604 612 #ifdef CONFIG_64BIT 605 613 s = 32; if (word << 32 != 0) s = 0; b += s; word >>= s; ··· 610 614 s = 4; if (word << 60 != 0) s = 0; b += s; word >>= s; 611 615 s = 2; if (word << 62 != 0) s = 0; b += s; word >>= s; 612 616 s = 1; if (word << 63 != 0) s = 0; b += s; 613 - #endif 617 + 614 618 return b; 619 + #endif 615 620 #endif 616 621 } 617 622 ··· 652 655 */ 653 656 static inline unsigned long flz(unsigned long word) 654 657 { 655 - #if defined(CONFIG_CPU_MIPS32_R1) || defined(CONFIG_CPU_MIPS64_R1) 658 + #if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) 656 659 return __ilog2(~word); 657 660 #else 658 - #if defined(CONFIG_32BIT) 661 + #ifdef CONFIG_32BIT 659 662 int r = 31, s; 660 663 word = ~word; 661 664 s = 16; if ((word & 0xffff0000)) s = 0; r -= s; word <<= s; ··· 663 666 s = 4; if ((word & 0xf0000000)) s = 0; r -= s; word <<= s; 664 667 s = 2; if ((word & 0xc0000000)) s = 0; r -= s; word <<= s; 665 668 s = 1; if ((word & 0x80000000)) s = 0; r -= s; 669 + 670 + return r; 666 671 #endif 667 - #if defined(CONFIG_64BIT) 672 + #ifdef CONFIG_64BIT 668 673 int r = 63, s; 669 674 word = ~word; 670 675 s = 32; if ((word & 0xffffffff00000000UL)) s = 0; r -= s; word <<= s; ··· 675 676 s = 4; if ((word & 0xf000000000000000UL)) s = 0; r -= s; word <<= s; 676 677 s = 2; if ((word & 0xc000000000000000UL)) s = 0; r -= s; word <<= s; 677 678 s = 1; if ((word & 0x8000000000000000UL)) s = 0; r -= s; 678 - #endif 679 + 679 680 return r; 681 + #endif 680 682 #endif 681 683 } 682 684
+1 -1
include/asm-mips/hazards.h
··· 232 232 233 233 #endif 234 234 235 - #if defined(CONFIG_CPU_MIPS32_R2) || defined (CONFIG_CPU_MIPS64_R2) 235 + #ifdef CONFIG_CPU_MIPSR2 236 236 #define instruction_hazard() \ 237 237 do { \ 238 238 __label__ __next; \
+5 -6
include/asm-mips/interrupt.h
··· 19 19 " .set push \n" 20 20 " .set reorder \n" 21 21 " .set noat \n" 22 - #if defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2) 22 + #ifdef CONFIG_CPU_MIPSR2 23 23 " ei \n" 24 24 #else 25 25 " mfc0 $1,$12 \n" ··· 51 51 " .macro local_irq_disable\n" 52 52 " .set push \n" 53 53 " .set noat \n" 54 - #if defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2) 54 + #ifdef CONFIG_CPU_MIPSR2 55 55 " di \n" 56 56 #else 57 57 " mfc0 $1,$12 \n" ··· 91 91 " .set push \n" 92 92 " .set reorder \n" 93 93 " .set noat \n" 94 - #if defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2) 94 + #ifdef CONFIG_CPU_MIPSR2 95 95 " di \\result \n" 96 96 #else 97 97 " mfc0 \\result, $12 \n" ··· 115 115 " .macro local_irq_restore flags \n" 116 116 " .set noreorder \n" 117 117 " .set noat \n" 118 - #if (defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)) && \ 119 - defined(CONFIG_IRQ_CPU) 118 + #if defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU) 120 119 /* 121 120 * Slow, but doesn't suffer from a relativly unlikely race 122 121 * condition we're having since days 1. ··· 124 125 " di \n" 125 126 " ei \n" 126 127 "1: \n" 127 - #elif defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2) 128 + #elif defined(CONFIG_CPU_MIPSR2) 128 129 /* 129 130 * Fast, dangerous. Life is fun, life is good. 130 131 */
+2 -2
include/asm-mips/mach-mips/cpu-feature-overrides.h
··· 14 14 /* 15 15 * CPU feature overrides for MIPS boards 16 16 */ 17 - #ifdef CONFIG_CPU_MIPS32_R1 17 + #ifdef CONFIG_CPU_MIPS32 18 18 #define cpu_has_tlb 1 19 19 #define cpu_has_4kex 1 20 20 #define cpu_has_4kcache 1 ··· 40 40 #define cpu_icache_snoops_remote_store 1 41 41 #endif 42 42 43 - #ifdef CONFIG_CPU_MIPS64_R1 43 + #ifdef CONFIG_CPU_MIPS64 44 44 #define cpu_has_tlb 1 45 45 #define cpu_has_4kex 1 46 46 #define cpu_has_4kcache 1
+1 -1
include/asm-mips/page.h
··· 76 76 * These are used to make use of C type-checking.. 77 77 */ 78 78 #ifdef CONFIG_64BIT_PHYS_ADDR 79 - #ifdef CONFIG_CPU_MIPS32_R1 79 + #ifdef CONFIG_CPU_MIPS32 80 80 typedef struct { unsigned long pte_low, pte_high; } pte_t; 81 81 #define pte_val(x) ((x).pte_low | ((unsigned long long)(x).pte_high << 32)) 82 82 #else