VirtualBox

source: vbox/trunk/src/libs/openssl-1.1.0g/crypto/s390xcap.c@ 69890

Last change on this file since 69890 was 69890, checked in by vboxsync, 7 years ago

Added OpenSSL 1.1.0g with unneeded files removed, otherwise unmodified.
bugref:8070: src/libs maintenance

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1/*
2 * Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#include <stdio.h>
11#include <stdlib.h>
12#include <string.h>
13#include <setjmp.h>
14#include <signal.h>
15
16unsigned long long OPENSSL_s390xcap_P[10];
17
18static sigjmp_buf ill_jmp;
19static void ill_handler(int sig)
20{
21 siglongjmp(ill_jmp, sig);
22}
23
24unsigned long OPENSSL_s390x_facilities(void);
25
26void OPENSSL_cpuid_setup(void)
27{
28 sigset_t oset;
29 struct sigaction ill_act, oact;
30
31 if (OPENSSL_s390xcap_P[0])
32 return;
33
34 OPENSSL_s390xcap_P[0] = 1UL << (8 * sizeof(unsigned long) - 1);
35
36 memset(&ill_act, 0, sizeof(ill_act));
37 ill_act.sa_handler = ill_handler;
38 sigfillset(&ill_act.sa_mask);
39 sigdelset(&ill_act.sa_mask, SIGILL);
40 sigdelset(&ill_act.sa_mask, SIGTRAP);
41 sigprocmask(SIG_SETMASK, &ill_act.sa_mask, &oset);
42 sigaction(SIGILL, &ill_act, &oact);
43
44 /* protection against missing store-facility-list-extended */
45 if (sigsetjmp(ill_jmp, 1) == 0)
46 OPENSSL_s390x_facilities();
47
48 sigaction(SIGILL, &oact, NULL);
49 sigprocmask(SIG_SETMASK, &oset, NULL);
50}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette