Merging of projects/armv6, part 2

Handle TLS for ARMv6 and ARMv7
This commit is contained in:
Oleksandr Tymoshenko 2012-08-15 03:09:00 +00:00
parent 89e757fe6f
commit 8e585021b5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239271
2 changed files with 10 additions and 0 deletions

View File

@ -31,10 +31,16 @@ __FBSDID("$FreeBSD$");
#include <machine/sysarch.h>
ENTRY(__aeabi_read_tp)
#ifdef ARM_TP_ADDRESS
ldr r0, .Larm_tp_address
ldr r0, [r0]
#else
mrc p15, 0, r0, c13, c0, 3
#endif
RET
#ifdef ARM_TP_ADDRESS
.Larm_tp_address:
.word ARM_TP_ADDRESS
#endif

View File

@ -35,5 +35,9 @@ void
_set_tp(void *tp)
{
#ifdef ARM_TP_ADDRESS
*((struct tcb **)ARM_TP_ADDRESS) = tp;
#else
sysarch(ARM_SET_TP, tp);
#endif
}