diff options
author | ed <ed@FreeBSD.org> | 2016-08-15 11:16:43 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2016-08-15 11:16:43 +0000 |
commit | 57dc175a34ff457a71a1b9dd76dd0ab79131f07c (patch) | |
tree | 2b4b7b5d529ef101d69b2ce593e51d125e111085 /sys/arm64 | |
parent | c3de4b6b3711ab2790410221c5295ff5c206fc2d (diff) | |
download | FreeBSD-src-57dc175a34ff457a71a1b9dd76dd0ab79131f07c.zip FreeBSD-src-57dc175a34ff457a71a1b9dd76dd0ab79131f07c.tar.gz |
MFC r303923:
Make cpu_set_user_tls() work when called on the running thread.
On all the other architectures, this function can also be called on the
currently running thread. In this case, we shouldn't fix up the address
in the PCB, but also patch up the register itself. Otherwise it will not
become active and will simply become overwritten by the next switch.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D7437
Diffstat (limited to 'sys/arm64')
-rw-r--r-- | sys/arm64/arm64/vm_machdep.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index 1de9424..1f8466d 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -201,6 +201,8 @@ cpu_set_user_tls(struct thread *td, void *tls_base) pcb = td->td_pcb; pcb->pcb_tpidr_el0 = (register_t)tls_base; + if (td == curthread) + WRITE_SPECIALREG(tpidr_el0, tls_base); return (0); } |