diff options
Diffstat (limited to 'src/lib/libcrypto/s390xcap.c')
-rw-r--r-- | src/lib/libcrypto/s390xcap.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/lib/libcrypto/s390xcap.c b/src/lib/libcrypto/s390xcap.c deleted file mode 100644 index 6fc60f27f2..0000000000 --- a/src/lib/libcrypto/s390xcap.c +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* $OpenBSD: s390xcap.c,v 1.3 2014/06/12 15:49:27 deraadt Exp $ */ | ||
2 | #include <stdio.h> | ||
3 | #include <stdlib.h> | ||
4 | #include <string.h> | ||
5 | #include <setjmp.h> | ||
6 | #include <signal.h> | ||
7 | |||
8 | extern unsigned long OPENSSL_s390xcap_P[]; | ||
9 | |||
10 | static sigjmp_buf ill_jmp; | ||
11 | static void ill_handler (int sig) | ||
12 | { | ||
13 | siglongjmp(ill_jmp, sig); | ||
14 | } | ||
15 | |||
16 | unsigned long OPENSSL_s390x_facilities(void); | ||
17 | |||
18 | void | ||
19 | OPENSSL_cpuid_setup(void) | ||
20 | { | ||
21 | sigset_t oset; | ||
22 | struct sigaction ill_act, oact; | ||
23 | |||
24 | if (OPENSSL_s390xcap_P[0]) | ||
25 | return; | ||
26 | |||
27 | OPENSSL_s390xcap_P[0] = 1UL << (8*sizeof(unsigned long) - 1); | ||
28 | |||
29 | memset(&ill_act, 0, sizeof(ill_act)); | ||
30 | ill_act.sa_handler = ill_handler; | ||
31 | sigfillset(&ill_act.sa_mask); | ||
32 | sigdelset(&ill_act.sa_mask, SIGILL); | ||
33 | sigdelset(&ill_act.sa_mask, SIGTRAP); | ||
34 | sigprocmask(SIG_SETMASK, &ill_act.sa_mask, &oset); | ||
35 | sigaction (SIGILL, &ill_act, &oact); | ||
36 | |||
37 | /* protection against missing store-facility-list-extended */ | ||
38 | if (sigsetjmp(ill_jmp, 1) == 0) | ||
39 | OPENSSL_s390x_facilities(); | ||
40 | |||
41 | sigaction (SIGILL, &oact, NULL); | ||
42 | sigprocmask(SIG_SETMASK, &oset, NULL); | ||
43 | } | ||