aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-07-10 12:33:02 -0400
committerRalf Baechle <ralf@linux-mips.org>2007-07-10 12:33:02 -0400
commita36920200c5b89d56120a5e839fe4a603d51b16c (patch)
treeaefb1fc4b0792ef788024fa596954a5689f15d0a /arch/mips/kernel
parentd223a86154f8c66f5a380b17e1c8091d56f47cf8 (diff)
[MIPS] Enable support for the userlocal hardware register
Which will cut down the cost of RDHWR $29 which is used to obtain the TLS pointer and so far being emulated in software down to a single cycle operation. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/cpu-probe.c2
-rw-r--r--arch/mips/kernel/syscall.c5
-rw-r--r--arch/mips/kernel/traps.c9
3 files changed, 12 insertions, 4 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index b12eeee0e974..27fc1843423e 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -588,6 +588,8 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c)
588 c->options |= MIPS_CPU_VEIC; 588 c->options |= MIPS_CPU_VEIC;
589 if (config3 & MIPS_CONF3_MT) 589 if (config3 & MIPS_CONF3_MT)
590 c->ases |= MIPS_ASE_MIPSMT; 590 c->ases |= MIPS_ASE_MIPSMT;
591 if (config3 & MIPS_CONF3_ULRI)
592 c->options |= MIPS_CPU_ULRI;
591 593
592 return config3 & MIPS_CONF_M; 594 return config3 & MIPS_CONF_M;
593} 595}
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 9dd5a2df8eac..b947c61c0cc8 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -272,9 +272,8 @@ asmlinkage int sys_set_thread_area(unsigned long addr)
272 struct thread_info *ti = task_thread_info(current); 272 struct thread_info *ti = task_thread_info(current);
273 273
274 ti->tp_value = addr; 274 ti->tp_value = addr;
275 275 if (cpu_has_userlocal)
276 /* If some future MIPS implementation has this register in hardware, 276 write_c0_userlocal(addr);
277 * we will need to update it here (and in context switches). */
278 277
279 return 0; 278 return 0;
280} 279}
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index c598e890a880..9b19a84d11ef 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1341,7 +1341,14 @@ void __init per_cpu_trap_init(void)
1341 set_c0_status(ST0_MX); 1341 set_c0_status(ST0_MX);
1342 1342
1343#ifdef CONFIG_CPU_MIPSR2 1343#ifdef CONFIG_CPU_MIPSR2
1344 write_c0_hwrena (0x0000000f); /* Allow rdhwr to all registers */ 1344 if (cpu_has_mips_r2) {
1345 unsigned int enable = 0x0000000f;
1346
1347 if (cpu_has_userlocal)
1348 enable |= (1 << 29);
1349
1350 write_c0_hwrena(enable);
1351 }
1345#endif 1352#endif
1346 1353
1347#ifdef CONFIG_MIPS_MT_SMTC 1354#ifdef CONFIG_MIPS_MT_SMTC