Module Name:    src
Committed By:   christos
Date:           Sun Jan  6 22:20:50 UTC 2019

Modified Files:
        src/crypto/external/bsd/openssl/dist/crypto: ppccpuid.pl

Log Message:
PR/53838: Scole Mail: OPENSSL_rdtsc() is reading a time counter
for randomness, and the powerpc code uses mftbu and mftb for access.
The 601 is different than other powerpcs. It doesn't have a time
base register (TBR), but a real time clock (RTC) so it needs to
use different calls like mfrtcu/mfrtcl instead.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
    src/crypto/external/bsd/openssl/dist/crypto/ppccpuid.pl

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/ppccpuid.pl
diff -u src/crypto/external/bsd/openssl/dist/crypto/ppccpuid.pl:1.6 src/crypto/external/bsd/openssl/dist/crypto/ppccpuid.pl:1.7
--- src/crypto/external/bsd/openssl/dist/crypto/ppccpuid.pl:1.6	Thu Feb  8 16:51:24 2018
+++ src/crypto/external/bsd/openssl/dist/crypto/ppccpuid.pl	Sun Jan  6 17:20:50 2019
@@ -132,6 +132,17 @@ $code.=<<___	if ($flavour =~ /64/);
 	mftb	r3
 ___
 $code.=<<___	if ($flavour !~ /64/);
+	mfspr	r0,287
+	srwi	r0,r0,0x10
+	cmplwi	r0,0x1
+	bgt	.Loop_rdtsc
+.Loop_rdtsc_601:	
+	mfrtcu	r5
+	mfrtcl	r3
+	mfrtcu	r4
+	cmplw	r4,r5
+	bne	.Loop_rdtsc_601
+	blr
 Loop_rdtsc:
 	mftbu	r5
 	mftb	r3

Reply via email to