summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorgonzo <gonzo@FreeBSD.org>2012-08-15 03:09:00 +0000
committergonzo <gonzo@FreeBSD.org>2012-08-15 03:09:00 +0000
commit0c19fd41e201fbcbf4ce5cb949c595c01a9ad102 (patch)
treede7bb8605de873c40e5d63c49ec0d337c9840256 /lib/libc
parent0761ed25354c932b4754aa6fa130cc9d9d2254c4 (diff)
downloadFreeBSD-src-0c19fd41e201fbcbf4ce5cb949c595c01a9ad102.zip
FreeBSD-src-0c19fd41e201fbcbf4ce5cb949c595c01a9ad102.tar.gz
Merging of projects/armv6, part 2
Handle TLS for ARMv6 and ARMv7
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/arm/gen/__aeabi_read_tp.S6
-rw-r--r--lib/libc/arm/gen/_set_tp.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/libc/arm/gen/__aeabi_read_tp.S b/lib/libc/arm/gen/__aeabi_read_tp.S
index 228acff..c3ea99d 100644
--- a/lib/libc/arm/gen/__aeabi_read_tp.S
+++ b/lib/libc/arm/gen/__aeabi_read_tp.S
@@ -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
diff --git a/lib/libc/arm/gen/_set_tp.c b/lib/libc/arm/gen/_set_tp.c
index 44bbdd8..97cabec 100644
--- a/lib/libc/arm/gen/_set_tp.c
+++ b/lib/libc/arm/gen/_set_tp.c
@@ -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
}
OpenPOWER on IntegriCloud