Date: Wed, 15 Aug 2012 03:08:29 +0000 (UTC) From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r239270 - head/lib/libthr/arch/arm/include Message-ID: <201208150308.q7F38TAr091321@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gonzo Date: Wed Aug 15 03:08:29 2012 New Revision: 239270 URL: http://svn.freebsd.org/changeset/base/239270 Log: Merging of projects/armv6, part 2 Handle TLS for ARMv6 and ARMv7 Modified: head/lib/libthr/arch/arm/include/pthread_md.h Modified: head/lib/libthr/arch/arm/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/arm/include/pthread_md.h Wed Aug 15 03:07:41 2012 (r239269) +++ head/lib/libthr/arch/arm/include/pthread_md.h Wed Aug 15 03:08:29 2012 (r239270) @@ -57,7 +57,11 @@ void _tcb_dtor(struct tcb *); static __inline void _tcb_set(struct tcb *tcb) { - *((struct tcb **)ARM_TP_ADDRESS) = tcb; +#ifdef ARM_TP_ADDRESS + *((struct tcb **)ARM_TP_ADDRESS) = tcb; /* avoids a system call */ +#else + sysarch(ARM_SET_TP, tcb); +#endif } /* @@ -66,7 +70,15 @@ _tcb_set(struct tcb *tcb) static __inline struct tcb * _tcb_get(void) { +#ifdef ARM_TP_ADDRESS return (*((struct tcb **)ARM_TP_ADDRESS)); +#else + struct tcb *tcb; + + __asm __volatile("mrc p15, 0, %0, c13, c0, 3" \ + : "=r" (tcb)); + return (tcb); +#endif } extern struct pthread *_thr_initial;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208150308.q7F38TAr091321>