• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #if ((__ARM_ARCH_6K__ || __ARM_ARCH_6KZ__ || __ARM_ARCH_6ZK__) && !__thumb__) \
2  || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
3 
__get_tp()4 static inline uintptr_t __get_tp()
5 {
6 	uintptr_t tp;
7 	__asm__ ( "mrc p15,0,%0,c13,c0,3" : "=r"(tp) );
8 	return tp;
9 }
10 
11 #else
12 
13 #if __ARM_ARCH_4__ || __ARM_ARCH_4T__ || __ARM_ARCH == 4
14 #define BLX "mov lr,pc\n\tbx"
15 #else
16 #define BLX "blx"
17 #endif
18 
__get_tp()19 static inline uintptr_t __get_tp()
20 {
21 	extern hidden uintptr_t __a_gettp_ptr;
22 	register uintptr_t tp __asm__("r0");
23 	__asm__ ( BLX " %1" : "=r"(tp) : "r"(__a_gettp_ptr) : "cc", "lr" );
24 	return tp;
25 }
26 
27 #endif
28 
29 extern pthread_t __pthread_self();
30 
31 #define TLS_ABOVE_TP
32 #define GAP_ABOVE_TP 8
33 
34 #define MC_PC arm_pc
35