]>
git.ipfire.org Git - thirdparty/openssl.git/blob - crypto/s390xcap.c
8 extern unsigned long OPENSSL_s390xcap_P
[];
10 static sigjmp_buf ill_jmp
;
11 static void ill_handler(int sig
)
13 siglongjmp(ill_jmp
, sig
);
16 unsigned long OPENSSL_s390x_facilities(void);
18 void OPENSSL_cpuid_setup(void)
21 struct sigaction ill_act
, oact
;
23 if (OPENSSL_s390xcap_P
[0])
26 OPENSSL_s390xcap_P
[0] = 1UL << (8 * sizeof(unsigned long) - 1);
28 memset(&ill_act
, 0, sizeof(ill_act
));
29 ill_act
.sa_handler
= ill_handler
;
30 sigfillset(&ill_act
.sa_mask
);
31 sigdelset(&ill_act
.sa_mask
, SIGILL
);
32 sigdelset(&ill_act
.sa_mask
, SIGTRAP
);
33 sigprocmask(SIG_SETMASK
, &ill_act
.sa_mask
, &oset
);
34 sigaction(SIGILL
, &ill_act
, &oact
);
36 /* protection against missing store-facility-list-extended */
37 if (sigsetjmp(ill_jmp
, 1) == 0)
38 OPENSSL_s390x_facilities();
40 sigaction(SIGILL
, &oact
, NULL
);
41 sigprocmask(SIG_SETMASK
, &oset
, NULL
);