---
 crypto/ppccap.c    | 8 ++++++++
 crypto/ppccpuid.pl | 9 +++++++++
 2 files changed, 17 insertions(+)

diff --git a/crypto/ppccap.c b/crypto/ppccap.c
index 2e2f3fc..b38fc09 100644
--- a/crypto/ppccap.c
+++ b/crypto/ppccap.c
@@ -12,6 +12,7 @@
 
 #define PPC_FPU64      (1<<0)
 #define PPC_ALTIVEC    (1<<1)
+#define PPC_VCIPHER    (1<<2)
 
 static int OPENSSL_ppccap_P = 0;
 
@@ -58,6 +59,7 @@ static void ill_handler (int sig) { siglongjmp(ill_jmp,sig); }
 
 void OPENSSL_ppc64_probe(void);
 void OPENSSL_altivec_probe(void);
+void OPENSSL_vcipher_probe(void);
 
 void OPENSSL_cpuid_setup(void)
        {
@@ -130,6 +132,12 @@ void OPENSSL_cpuid_setup(void)
                OPENSSL_ppccap_P |= PPC_ALTIVEC;
                }
 
+       if (sigsetjmp(ill_jmp,1) == 0)
+               {
+               OPENSSL_vcipher_probe();
+               OPENSSL_ppccap_P |= PPC_VCIPHER;
+               }
+
        sigaction (SIGILL,&ill_oact,NULL);
        sigprocmask(SIG_SETMASK,&oset,NULL);
        }
diff --git a/crypto/ppccpuid.pl b/crypto/ppccpuid.pl
index b4990de..986185b 100755
--- a/crypto/ppccpuid.pl
+++ b/crypto/ppccpuid.pl
@@ -23,6 +23,15 @@ $code=<<___;
 .machine       "any"
 .text
 
+.globl .OPENSSL_vcipher_probe
+.align 4
+.OPENSSL_vcipher_probe:
+       vcipher vr0,vr0,vr0
+       blr
+       .long   0
+       .byte   0,12,0x14,0,0,0,0,0
+.size  .OPENSSL_vcipher_probe,.-.OPENSSL_vcipher_probe
+
 .globl .OPENSSL_ppc64_probe
 .align 4
 .OPENSSL_ppc64_probe:
-- 
1.7.12

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to