source: asp3_tinet_ecnl_arm/trunk/musl-1.1.18/arch/arm/pthread_arch.h@ 352

Last change on this file since 352 was 352, checked in by coas-nagasima, 6 years ago

arm向けASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 805 bytes
Line 
1#if ((__ARM_ARCH_6K__ || __ARM_ARCH_6ZK__) && !__thumb__) \
2 || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
3
4static inline pthread_t __pthread_self()
5{
6 char *p;
7 __asm__ __volatile__ ( "mrc p15,0,%0,c13,c0,3" : "=r"(p) );
8 return (void *)(p+8-sizeof(struct pthread));
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
19static inline pthread_t __pthread_self()
20{
21 extern uintptr_t __attribute__((__visibility__("hidden"))) __a_gettp_ptr;
22 register uintptr_t p __asm__("r0");
23 __asm__ __volatile__ ( BLX " %1" : "=r"(p) : "r"(__a_gettp_ptr) : "cc", "lr" );
24 return (void *)(p+8-sizeof(struct pthread));
25}
26
27#endif
28
29#define TLS_ABOVE_TP
30#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) - 8)
31
32#define MC_PC arm_pc
Note: See TracBrowser for help on using the repository browser.