summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x86cpuid.pl
diff options
context:
space:
mode:
authormiod <>2014-04-13 15:16:40 +0000
committermiod <>2014-04-13 15:16:40 +0000
commit52628ee3f51f011b463aaedb1a28aa0524b43cb3 (patch)
tree4bd2adeac981051908ec5756401424bbb4e57d6a /src/lib/libcrypto/x86cpuid.pl
parent40c22d3625a3818690c889ed6216fedf2be522c9 (diff)
downloadopenbsd-52628ee3f51f011b463aaedb1a28aa0524b43cb3.tar.gz
openbsd-52628ee3f51f011b463aaedb1a28aa0524b43cb3.tar.bz2
openbsd-52628ee3f51f011b463aaedb1a28aa0524b43cb3.zip
Import OpenSSL 1.0.1g
Diffstat (limited to 'src/lib/libcrypto/x86cpuid.pl')
-rw-r--r--src/lib/libcrypto/x86cpuid.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x86cpuid.pl b/src/lib/libcrypto/x86cpuid.pl
index 39fd8f2293..b270b44337 100644
--- a/src/lib/libcrypto/x86cpuid.pl
+++ b/src/lib/libcrypto/x86cpuid.pl
@@ -67,6 +67,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
67 &inc ("esi"); # number of cores 67 &inc ("esi"); # number of cores
68 68
69 &mov ("eax",1); 69 &mov ("eax",1);
70 &xor ("ecx","ecx");
70 &cpuid (); 71 &cpuid ();
71 &bt ("edx",28); 72 &bt ("edx",28);
72 &jnc (&label("generic")); 73 &jnc (&label("generic"));
@@ -91,6 +92,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
91 92
92&set_label("nocacheinfo"); 93&set_label("nocacheinfo");
93 &mov ("eax",1); 94 &mov ("eax",1);
95 &xor ("ecx","ecx");
94 &cpuid (); 96 &cpuid ();
95 &and ("edx",0xbfefffff); # force reserved bits #20, #30 to 0 97 &and ("edx",0xbfefffff); # force reserved bits #20, #30 to 0
96 &cmp ("ebp",0); 98 &cmp ("ebp",0);
@@ -165,7 +167,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
165 &jnz (&label("nohalt")); # not enough privileges 167 &jnz (&label("nohalt")); # not enough privileges
166 168
167 &pushf (); 169 &pushf ();
168 &pop ("eax") 170 &pop ("eax");
169 &bt ("eax",9); 171 &bt ("eax",9);
170 &jnc (&label("nohalt")); # interrupts are disabled 172 &jnc (&label("nohalt")); # interrupts are disabled
171 173
@@ -280,7 +282,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
280# arguments is 1 or 2! 282# arguments is 1 or 2!
281&function_begin_B("OPENSSL_indirect_call"); 283&function_begin_B("OPENSSL_indirect_call");
282 { 284 {
283 my $i,$max=7; # $max has to be chosen as 4*n-1 285 my ($max,$i)=(7,); # $max has to be chosen as 4*n-1
284 # in order to preserve eventual 286 # in order to preserve eventual
285 # stack alignment 287 # stack alignment
286 &push ("ebp"); 288 &push ("ebp");