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

MIPS: Add definitions of SegCtl registers and use them

The SegCtl registers are standard for MIPSr3..MIPSr5. Add definitions of
these registers and use them rather than constants

Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Joshua Kinard <kumba@gentoo.org>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Chris Packham <judge.packham@gmail.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/13290/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Matt Redfearn and committed by
Ralf Baechle
5c33f8b2 dd317403

+6 -3
+3 -3
arch/mips/include/asm/mach-malta/kernel-entry-init.h
··· 56 56 (0 << MIPS_SEGCFG_PA_SHIFT) | \ 57 57 (1 << MIPS_SEGCFG_EU_SHIFT)) << 16) 58 58 or t0, t2 59 - mtc0 t0, $5, 2 59 + mtc0 t0, CP0_SEGCTL0 60 60 61 61 /* SegCtl1 */ 62 62 li t0, ((MIPS_SEGCFG_MUSUK << MIPS_SEGCFG_AM_SHIFT) | \ ··· 67 67 (0 << MIPS_SEGCFG_PA_SHIFT) | \ 68 68 (1 << MIPS_SEGCFG_EU_SHIFT)) << 16) 69 69 ins t0, t1, 16, 3 70 - mtc0 t0, $5, 3 70 + mtc0 t0, CP0_SEGCTL1 71 71 72 72 /* SegCtl2 */ 73 73 li t0, ((MIPS_SEGCFG_MUSUK << MIPS_SEGCFG_AM_SHIFT) | \ ··· 77 77 (4 << MIPS_SEGCFG_PA_SHIFT) | \ 78 78 (1 << MIPS_SEGCFG_EU_SHIFT)) << 16) 79 79 or t0, t2 80 - mtc0 t0, $5, 4 80 + mtc0 t0, CP0_SEGCTL2 81 81 82 82 jal mips_ihb 83 83 mfc0 t0, $16, 5
+3
arch/mips/include/asm/mipsregs.h
··· 48 48 #define CP0_CONF $3 49 49 #define CP0_CONTEXT $4 50 50 #define CP0_PAGEMASK $5 51 + #define CP0_SEGCTL0 $5, 2 52 + #define CP0_SEGCTL1 $5, 3 53 + #define CP0_SEGCTL2 $5, 4 51 54 #define CP0_WIRED $6 52 55 #define CP0_INFO $7 53 56 #define CP0_HWRENA $7, 0