提交 4400f6c6 编写于 作者: A Andy Polyakov

sparcv9cap.c: add Fujitsu SPARC64 X AES capability detection.

Reviewed-by: NRichard Levitte <levitte@openssl.org>
上级 fb65020b
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
# define SPARCV9_VIS3 (1<<6) # define SPARCV9_VIS3 (1<<6)
# define SPARCV9_RANDOM (1<<7) # define SPARCV9_RANDOM (1<<7)
# define SPARCV9_64BIT_STACK (1<<8) # define SPARCV9_64BIT_STACK (1<<8)
# define SPARCV9_FJAESX (1<<9)/* Fujitsu SPARC64 X AES */
/* /*
* OPENSSL_sparcv9cap_P[1] is copy of Compatibility Feature Register, * OPENSSL_sparcv9cap_P[1] is copy of Compatibility Feature Register,
......
...@@ -349,6 +349,14 @@ _sparcv9_random: ...@@ -349,6 +349,14 @@ _sparcv9_random:
.type _sparcv9_random,#function .type _sparcv9_random,#function
.size _sparcv9_random,.-_sparcv9_vis3_probe .size _sparcv9_random,.-_sparcv9_vis3_probe
.global _sparcv9_fjaesx_probe
.align 8
_sparcv9_fjaesx_probe:
.word 0x81b09206 !faesencx %f2,%f6,%f0
retl
nop
.size _sparcv9_fjaesx_probe,.-_sparcv9_fjaesx_probe
.global OPENSSL_cleanse .global OPENSSL_cleanse
.align 32 .align 32
OPENSSL_cleanse: OPENSSL_cleanse:
......
...@@ -149,11 +149,12 @@ void OPENSSL_cpuid_setup(void) ...@@ -149,11 +149,12 @@ void OPENSSL_cpuid_setup(void)
unsigned int vec[1]; unsigned int vec[1];
if (getisax (vec,1)) { if (getisax (vec,1)) {
if (vec[0]&0x0020) OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS1; if (vec[0]&0x0020) OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS1;
if (vec[0]&0x0040) OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS2; if (vec[0]&0x0040) OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS2;
if (vec[0]&0x0080) OPENSSL_sparcv9cap_P[0] |= SPARCV9_BLK; if (vec[0]&0x0080) OPENSSL_sparcv9cap_P[0] |= SPARCV9_BLK;
if (vec[0]&0x0100) OPENSSL_sparcv9cap_P[0] |= SPARCV9_FMADD; if (vec[0]&0x0100) OPENSSL_sparcv9cap_P[0] |= SPARCV9_FMADD;
if (vec[0]&0x0400) OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS3; if (vec[0]&0x0400) OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS3;
if (vec[0]&0x10000) OPENSSL_sparcv9cap_P[0] |= SPARCV9_FJAESX;
/* reconstruct %cfr copy */ /* reconstruct %cfr copy */
OPENSSL_sparcv9cap_P[1] = (vec[0]>>17)&0x3ff; OPENSSL_sparcv9cap_P[1] = (vec[0]>>17)&0x3ff;
...@@ -233,6 +234,11 @@ void OPENSSL_cpuid_setup(void) ...@@ -233,6 +234,11 @@ void OPENSSL_cpuid_setup(void)
OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS3; OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS3;
} }
if (sigsetjmp(common_jmp, 1) == 0) {
_sparcv9_fjaesx_probe();
OPENSSL_sparcv9cap_P[0] |= SPARCV9_FJAESX;
}
/* /*
* In wait for better solution _sparcv9_rdcfr is masked by * In wait for better solution _sparcv9_rdcfr is masked by
* VIS3 flag, because it goes to uninterruptable endless * VIS3 flag, because it goes to uninterruptable endless
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册