X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fx86cpuid.pl;h=54dc1b55d0ef093c9355729f2f3bee1de6cc9dbd;hb=71c34b7f2d66808b21b1d341cea6f1c939d07324;hp=c18b0e2486d6ead7578d88a0cb227995b93eb67f;hpb=68d2cf51bcfc1c2c1d0deec9be21c3d743737656;p=oweals%2Fopenssl.git diff --git a/crypto/x86cpuid.pl b/crypto/x86cpuid.pl index c18b0e2486..54dc1b55d0 100644 --- a/crypto/x86cpuid.pl +++ b/crypto/x86cpuid.pl @@ -67,6 +67,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } &inc ("esi"); # number of cores &mov ("eax",1); + &xor ("ecx","ecx"); &cpuid (); &bt ("edx",28); &jnc (&label("generic")); @@ -78,6 +79,16 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } &jmp (&label("generic")); &set_label("intel"); + &cmp ("edi",7); + &jb (&label("cacheinfo")); + + &mov ("esi",&wparam(0)); + &mov ("eax",7); + &xor ("ecx","ecx"); + &cpuid (); + &mov (&DWP(8,"esi"),"ebx"); + +&set_label("cacheinfo"); &cmp ("edi",4); &mov ("edi",-1); &jb (&label("nocacheinfo")); @@ -91,6 +102,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } &set_label("nocacheinfo"); &mov ("eax",1); + &xor ("ecx","ecx"); &cpuid (); &and ("edx",0xbfefffff); # force reserved bits #20, #30 to 0 &cmp ("ebp",0); @@ -353,4 +365,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } &initseg("OPENSSL_cpuid_setup"); +&hidden("OPENSSL_cpuid_setup"); +&hidden("OPENSSL_ia32cap_P"); + &asm_finish();