2018-04-19 01:51:43 +00:00
|
|
|
#if ((__ARM_ARCH_6K__ || __ARM_ARCH_6KZ__ || __ARM_ARCH_6ZK__) && !__thumb__) \
|
2014-04-30 19:32:11 +00:00
|
|
|
|| __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
|
2014-04-07 08:03:18 +00:00
|
|
|
|
2020-08-25 02:23:08 +00:00
|
|
|
static inline uintptr_t __get_tp()
|
2014-04-07 08:03:18 +00:00
|
|
|
{
|
2020-08-25 02:23:08 +00:00
|
|
|
uintptr_t tp;
|
|
|
|
__asm__ ( "mrc p15,0,%0,c13,c0,3" : "=r"(tp) );
|
|
|
|
return tp;
|
2014-04-07 08:03:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
2012-02-25 07:52:18 +00:00
|
|
|
|
2016-12-19 00:38:53 +00:00
|
|
|
#if __ARM_ARCH_4__ || __ARM_ARCH_4T__ || __ARM_ARCH == 4
|
|
|
|
#define BLX "mov lr,pc\n\tbx"
|
2014-11-19 05:40:32 +00:00
|
|
|
#else
|
2016-12-19 00:38:53 +00:00
|
|
|
#define BLX "blx"
|
2014-11-19 05:40:32 +00:00
|
|
|
#endif
|
2016-12-19 00:38:53 +00:00
|
|
|
|
2020-08-25 02:23:08 +00:00
|
|
|
static inline uintptr_t __get_tp()
|
2016-12-19 00:38:53 +00:00
|
|
|
{
|
2018-09-05 16:43:34 +00:00
|
|
|
extern hidden uintptr_t __a_gettp_ptr;
|
2020-08-25 02:23:08 +00:00
|
|
|
register uintptr_t tp __asm__("r0");
|
|
|
|
__asm__ ( BLX " %1" : "=r"(tp) : "r"(__a_gettp_ptr) : "cc", "lr" );
|
|
|
|
return tp;
|
2014-11-19 05:40:32 +00:00
|
|
|
}
|
2012-10-15 22:51:53 +00:00
|
|
|
|
2014-04-07 08:03:18 +00:00
|
|
|
#endif
|
|
|
|
|
2012-10-15 22:51:53 +00:00
|
|
|
#define TLS_ABOVE_TP
|
2018-06-01 23:52:01 +00:00
|
|
|
#define GAP_ABOVE_TP 8
|
2011-09-18 20:44:54 +00:00
|
|
|
|
2015-11-02 17:39:28 +00:00
|
|
|
#define MC_PC arm_pc
|