diff options
author | Kevin Cernekee <cernekee@gmail.com> | 2010-10-16 17:22:38 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-10-29 14:08:53 -0400 |
commit | 18d693b3598fdebdd5c65a613221793456a7ce45 (patch) | |
tree | bdec7d15eb2ba774292358b2a617965ab3ff4530 /arch/mips/kernel | |
parent | ea31a6b203710c03d1fc025377a19572e620588a (diff) |
MIPS: Allow UserLocal on MIPS_R1 processors
Some MIPS32R1 processors implement UserLocal (RDHWR $29) to accelerate
programs that make extensive use of thread-local storage. Therefore,
setting up the HWRENA register should not depend on cpu_has_mips_r2.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/traps.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 8d79b8774b30..8e9fbe75894e 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -1481,6 +1481,7 @@ void __cpuinit per_cpu_trap_init(void) | |||
1481 | { | 1481 | { |
1482 | unsigned int cpu = smp_processor_id(); | 1482 | unsigned int cpu = smp_processor_id(); |
1483 | unsigned int status_set = ST0_CU0; | 1483 | unsigned int status_set = ST0_CU0; |
1484 | unsigned int hwrena = cpu_hwrena_impl_bits; | ||
1484 | #ifdef CONFIG_MIPS_MT_SMTC | 1485 | #ifdef CONFIG_MIPS_MT_SMTC |
1485 | int secondaryTC = 0; | 1486 | int secondaryTC = 0; |
1486 | int bootTC = (cpu == 0); | 1487 | int bootTC = (cpu == 0); |
@@ -1513,14 +1514,14 @@ void __cpuinit per_cpu_trap_init(void) | |||
1513 | change_c0_status(ST0_CU|ST0_MX|ST0_RE|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX, | 1514 | change_c0_status(ST0_CU|ST0_MX|ST0_RE|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX, |
1514 | status_set); | 1515 | status_set); |
1515 | 1516 | ||
1516 | if (cpu_has_mips_r2) { | 1517 | if (cpu_has_mips_r2) |
1517 | unsigned int enable = 0x0000000f | cpu_hwrena_impl_bits; | 1518 | hwrena |= 0x0000000f; |
1518 | 1519 | ||
1519 | if (!noulri && cpu_has_userlocal) | 1520 | if (!noulri && cpu_has_userlocal) |
1520 | enable |= (1 << 29); | 1521 | hwrena |= (1 << 29); |
1521 | 1522 | ||
1522 | write_c0_hwrena(enable); | 1523 | if (hwrena) |
1523 | } | 1524 | write_c0_hwrena(hwrena); |
1524 | 1525 | ||
1525 | #ifdef CONFIG_MIPS_MT_SMTC | 1526 | #ifdef CONFIG_MIPS_MT_SMTC |
1526 | if (!secondaryTC) { | 1527 | if (!secondaryTC) { |