[mips] add support for using the MIPS user register for TLS data.
authoradrian <adrian@FreeBSD.org>
Sun, 7 Aug 2016 01:29:55 +0000 (01:29 +0000)
committeradrian <adrian@FreeBSD.org>
Sun, 7 Aug 2016 01:29:55 +0000 (01:29 +0000)
commitc7b25f35123e645a5c855d2b0a7985e57c87358a
tree59e64e9ddca038df3058c11ece3c5e2fe4bad7f2
parent1af377219527a4a9451fdbdb45b4e4168e770998
[mips] add support for using the MIPS user register for TLS data.

This work, originally from Stacey Son, uses the MIPS UserReg for
reading the TLS data, and will fall back to the normal syscall path
when it isn't supported.

This code dynamically patches cpu_switch() to bypass the UserReg
instruction so to avoid generating a machine exception.

Thanks to sson for the original work, and to Dan Nelson for
bringing it to date and testing it on MIPS32 with me.

Tested:

* mips64 (sson)
* mips74k (dnelson_1901@yahoo.com) - AR9344 SoC, UserReg support
* mips24k (adrian) - AR9331 SoC, no UserReg support

Obtained from: sson, dnelson_1901@yahoo.com
lib/libthr/arch/mips/include/pthread_md.h
libexec/rtld-elf/mips/reloc.c
sys/mips/include/cpufunc.h
sys/mips/include/cpuinfo.h
sys/mips/include/cpuregs.h
sys/mips/mips/cpu.c
sys/mips/mips/genassym.c
sys/mips/mips/swtch.S
sys/mips/mips/sys_machdep.c
sys/mips/mips/vm_machdep.c