From d279279e2b5cd40dbcc863fb66a695990f304077 Mon Sep 17 00:00:00 2001 From: Petar Jovanovic Date: Wed, 18 Jun 2014 17:48:20 +0200 Subject: target-mips: implement UserLocal Register MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From MIPS documentation (Volume III): UserLocal Register (CP0 Register 4, Select 2) Compliance Level: Recommended. The UserLocal register is a read-write register that is not interpreted by the hardware and conditionally readable via the RDHWR instruction. This register only exists if the Config3-ULRI register field is set. Privileged software may write this register with arbitrary information and make it accessible to unprivileged software via register 29 (ULR) of the RDHWR instruction. To do so, bit 29 of the HWREna register must be set to a 1 to enable unprivileged access to the register. Signed-off-by: Petar Jovanovic Reviewed-by: Andreas Färber Reviewed-by: Aurelien Jarno Signed-off-by: Aurelien Jarno --- linux-user/mips/target_cpu.h | 2 +- linux-user/syscall.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'linux-user') diff --git a/linux-user/mips/target_cpu.h b/linux-user/mips/target_cpu.h index ba8e9eb1f9..19b8855000 100644 --- a/linux-user/mips/target_cpu.h +++ b/linux-user/mips/target_cpu.h @@ -30,7 +30,7 @@ static inline void cpu_clone_regs(CPUMIPSState *env, target_ulong newsp) static inline void cpu_set_tls(CPUMIPSState *env, target_ulong newtls) { - env->tls_value = newtls; + env->active_tc.CP0_UserLocal = newtls; } #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index c134c32d6f..7d7407920b 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8702,7 +8702,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #ifdef TARGET_NR_set_thread_area case TARGET_NR_set_thread_area: #if defined(TARGET_MIPS) - ((CPUMIPSState *) cpu_env)->tls_value = arg1; + ((CPUMIPSState *) cpu_env)->active_tc.CP0_UserLocal = arg1; ret = 0; break; #elif defined(TARGET_CRIS) -- cgit v1.2.1