10 unsigned int OPENSSL_armcap_P
;
12 static sigset_t all_masked
;
14 static sigjmp_buf ill_jmp
;
15 static void ill_handler (int sig
) { siglongjmp(ill_jmp
,sig
); }
18 * Following subroutines could have been inlined, but it's not all
19 * ARM compilers support inline assembler...
21 void _armv7_neon_probe(void);
22 unsigned int _armv7_tick(void);
24 unsigned int OPENSSL_rdtsc(void)
26 if (OPENSSL_armcap_P
|ARMV7_TICK
)
32 #if defined(__GNUC__) && __GNUC__>=2
33 void OPENSSL_cpuid_setup(void) __attribute__((constructor
));
35 void OPENSSL_cpuid_setup(void)
38 struct sigaction ill_oact
,ill_act
;
45 if ((e
=getenv("OPENSSL_armcap")))
47 OPENSSL_armcap_P
=strtoul(e
,NULL
,0);
51 sigfillset(&all_masked
);
52 sigdelset(&all_masked
,SIGILL
);
53 sigdelset(&all_masked
,SIGTRAP
);
54 sigdelset(&all_masked
,SIGFPE
);
55 sigdelset(&all_masked
,SIGBUS
);
56 sigdelset(&all_masked
,SIGSEGV
);
60 memset(&ill_act
,0,sizeof(ill_act
));
61 ill_act
.sa_handler
= ill_handler
;
62 ill_act
.sa_mask
= all_masked
;
64 sigprocmask(SIG_SETMASK
,&ill_act
.sa_mask
,&oset
);
65 sigaction(SIGILL
,&ill_act
,&ill_oact
);
67 if (sigsetjmp(ill_jmp
,1) == 0)
70 OPENSSL_armcap_P
|= ARMV7_NEON
;
72 if (sigsetjmp(ill_jmp
,1) == 0)
75 OPENSSL_armcap_P
|= ARMV7_TICK
;
78 sigaction (SIGILL
,&ill_oact
,NULL
);
79 sigprocmask(SIG_SETMASK
,&oset
,NULL
);