|
1 # |
|
2 # This patch was developed in-house. |
|
3 # This is Solaris-specific: not suitable for upstream. |
|
4 # |
|
5 --- openssl-1.0.1h/crypto/sparcv9cap.c.~1~ Mon Aug 4 15:18:42 2014 |
|
6 +++ openssl-1.0.1h/crypto/sparcv9cap.c Mon Aug 4 15:30:21 2014 |
|
7 @@ -5,6 +5,7 @@ |
|
8 #include <signal.h> |
|
9 #include <sys/time.h> |
|
10 #include <openssl/bn.h> |
|
11 +#include <sys/auxv.h> |
|
12 |
|
13 #define SPARCV9_TICK_PRIVILEGED (1<<0) |
|
14 #define SPARCV9_PREFER_FPU (1<<1) |
|
15 @@ -31,7 +32,6 @@ |
|
16 void _sparcv9_vis1_probe(void); |
|
17 unsigned long _sparcv9_vis1_instrument(void); |
|
18 void _sparcv9_vis2_probe(void); |
|
19 -void _sparcv9_fmadd_probe(void); |
|
20 |
|
21 unsigned long OPENSSL_rdtsc(void) |
|
22 { |
|
23 @@ -171,6 +171,7 @@ |
|
24 struct sigaction common_act,ill_oact,bus_oact; |
|
25 sigset_t all_masked,oset; |
|
26 static int trigger=0; |
|
27 + uint_t ui = 0; |
|
28 |
|
29 if (trigger) return; |
|
30 trigger=1; |
|
31 @@ -183,6 +184,7 @@ |
|
32 |
|
33 /* Initial value, fits UltraSPARC-I&II... */ |
|
34 OPENSSL_sparcv9cap_P = SPARCV9_PREFER_FPU|SPARCV9_TICK_PRIVILEGED; |
|
35 + (void) getisax(&ui, 1); |
|
36 |
|
37 sigfillset(&all_masked); |
|
38 sigdelset(&all_masked,SIGILL); |
|
39 @@ -222,11 +224,8 @@ |
|
40 } |
|
41 } |
|
42 |
|
43 - if (sigsetjmp(common_jmp,1) == 0) |
|
44 - { |
|
45 - _sparcv9_fmadd_probe(); |
|
46 + if (ui & AV_SPARC_FMAF) |
|
47 OPENSSL_sparcv9cap_P |= SPARCV9_FMADD; |
|
48 - } |
|
49 |
|
50 sigaction(SIGBUS,&bus_oact,NULL); |
|
51 sigaction(SIGILL,&ill_oact,NULL); |
|
52 --- openssl-1.0.1h/crypto/sparccpuid.S.~1~ Mon Aug 4 15:18:57 2014 |
|
53 +++ openssl-1.0.1h/crypto/sparccpuid.S Mon Aug 4 15:30:34 2014 |
|
54 @@ -304,16 +304,6 @@ |
|
55 .type _sparcv9_vis2_probe,#function |
|
56 .size _sparcv9_vis2_probe,.-_sparcv9_vis2_probe |
|
57 |
|
58 -.global _sparcv9_fmadd_probe |
|
59 -.align 8 |
|
60 -_sparcv9_fmadd_probe: |
|
61 - .word 0x81b00d80 !fxor %f0,%f0,%f0 |
|
62 - .word 0x85b08d82 !fxor %f2,%f2,%f2 |
|
63 - retl |
|
64 - .word 0x81b80440 !fmaddd %f0,%f0,%f2,%f0 |
|
65 -.type _sparcv9_fmadd_probe,#function |
|
66 -.size _sparcv9_fmadd_probe,.-_sparcv9_fmadd_probe |
|
67 - |
|
68 .global OPENSSL_cleanse |
|
69 .align 32 |
|
70 OPENSSL_cleanse: |