1 #include "pthread_impl.h"
6 /* Also perform sh-specific init */
8 #define CPU_HAS_LLSC 0x0040
10 __attribute__((__visibility__("hidden"))) unsigned __sh_atomic_model, __sh_nommu;
12 int __set_thread_area(void *p)
15 __asm__ __volatile__ ( "ldc %0, gbr" : : "r"(p) : "memory" );
17 if (__hwcap & CPU_HAS_LLSC) {
18 __sh_atomic_model = SH_A_LLSC;
21 #if !defined(__SH3__) && !defined(__SH4__)
22 for (aux=libc.auxv; *aux; aux+=2) {
23 if (*aux != AT_PLATFORM) continue;
24 const char *s = (void *)aux[1];
25 if (s[0]!='s' || s[1]!='h' || s[2]!='2' || s[3]-'0'<10u) break;
26 __sh_atomic_model = SH_A_IMASK;
31 /* __sh_atomic_model = SH_A_GUSA; */ /* 0, default */