summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2017-02-08 17:35:41 (GMT)
committer Chris Young <chris@unsatisfactorysoftware.co.uk>2017-02-08 17:35:41 (GMT)
commit90c909567a6de54962de0fc4decc527e37f6cda1 (patch)
tree563e51ad7ba9a3d9d57324899753692d0e972f1e
parentcd7176a33bf7627a03e30b23b4810d22ec04a930 (diff)
downloadtoolchains-90c909567a6de54962de0fc4decc527e37f6cda1.tar.gz
toolchains-90c909567a6de54962de0fc4decc527e37f6cda1.tar.bz2
AmigaOS4 patch for ppccap.c
Borrowed from https://github.com/jens-maus/amissl/blob/master/openssl/crypto/ppccap.c
-rw-r--r--sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p35
1 files changed, 35 insertions, 0 deletions
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p
new file mode 100644
index 0000000..e231885
--- a/dev/null
+++ b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p
@@ -0,0 +1,35 @@
+--- /home/chris/netsurf/toolchains/sdk/builddir-ppc-amigaos/openssl/openssl-1.0.2k/crypto/ppccap.c 2017-01-26 13:22:03.000000000 +0000
++++ ppccap.c 2017-02-08 17:33:45.674017881 +0000
+@@ -73,6 +73,7 @@ void sha512_block_data_order(void *ctx,
+ sha512_block_ppc(ctx, inp, len);
+ }
+
++#ifndef OPENSSL_SYS_AMIGAOS4
+ static sigjmp_buf ill_jmp;
+ static void ill_handler(int sig)
+ {
+@@ -157,3 +158,24 @@ void OPENSSL_cpuid_setup(void)
+ sigaction(SIGILL, &ill_oact, NULL);
+ sigprocmask(SIG_SETMASK, &oset, NULL);
+ }
++#else
++#include <proto/exec.h>
++void OPENSSL_cpuid_setup(void)
++{
++ uint32 family, vec;
++
++ GetCPUInfoTags(GCIT_Family, &family, GCIT_VectorUnit, &vec, TAG_DONE);
++
++ OPENSSL_ppccap_P = PPC_FPU;
++
++ if((family == CPUFAMILY_PA6T) || (family == CPUFAMILY_E5500))
++ OPENSSL_ppccap_P |= PPC_FPU64;
++
++ if((vec == VECTORTYPE_ALTIVEC) &&
++ ((SysBase->lib_Version == 51 && SysBase->lib_Revision >= 12) || SysBase->lib_Version > 51))
++ {
++ OPENSSL_ppccap_P |= PPC_ALTIVEC;
++ }
++}
++#endif
++