From 4bb90087d745c26401e09a3bd10137d7b05e9ea3 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Fri, 27 May 2011 15:32:43 +0000 Subject: x86[_64]cpuid.pl: harmonize usage of reserved bits #20 and #30. --- crypto/x86cpuid.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'crypto/x86cpuid.pl') diff --git a/crypto/x86cpuid.pl b/crypto/x86cpuid.pl index f424c2debe..716f44da92 100644 --- a/crypto/x86cpuid.pl +++ b/crypto/x86cpuid.pl @@ -92,13 +92,15 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } &set_label("nocacheinfo"); &mov ("eax",1); &cpuid (); + &and ("edx",~(1<<20|1<<30)); # force reserved bits to 0 &cmp ("ebp",0); - &jne (&label("notP4")); + &jne (&label("notintel")); + &or ("edx",1<<30); # set reserved bit#30 on Intel CPUs &and (&HB("eax"),15); # familiy ID &cmp (&HB("eax"),15); # P4? - &jne (&label("notP4")); - &or ("edx",1<<20); # use reserved bit to engage RC4_CHAR -&set_label("notP4"); + &jne (&label("notintel")); + &or ("edx",1<<20); # set reserved bit#20 to engage RC4_CHAR +&set_label("notintel"); &bt ("edx",28); # test hyper-threading bit &jnc (&label("generic")); &and ("edx",0xefffffff); -- cgit v1.2.3