diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/x86cpuid.pl | 39 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/x86cpuid.pl | 39 |
2 files changed, 0 insertions, 78 deletions
diff --git a/src/lib/libcrypto/x86cpuid.pl b/src/lib/libcrypto/x86cpuid.pl index c7a57a3465..169036d53d 100644 --- a/src/lib/libcrypto/x86cpuid.pl +++ b/src/lib/libcrypto/x86cpuid.pl | |||
@@ -257,45 +257,6 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } | |||
257 | &ret (); | 257 | &ret (); |
258 | &function_end_B("OPENSSL_atomic_add"); | 258 | &function_end_B("OPENSSL_atomic_add"); |
259 | 259 | ||
260 | # This function can become handy under Win32 in situations when | ||
261 | # we don't know which calling convention, __stdcall or __cdecl(*), | ||
262 | # indirect callee is using. In C it can be deployed as | ||
263 | # | ||
264 | #ifdef OPENSSL_CPUID_OBJ | ||
265 | # type OPENSSL_indirect_call(void *f,...); | ||
266 | # ... | ||
267 | # OPENSSL_indirect_call(func,[up to $max arguments]); | ||
268 | #endif | ||
269 | # | ||
270 | # (*) it's designed to work even for __fastcall if number of | ||
271 | # arguments is 1 or 2! | ||
272 | &function_begin_B("OPENSSL_indirect_call"); | ||
273 | { | ||
274 | my ($max,$i)=(7,); # $max has to be chosen as 4*n-1 | ||
275 | # in order to preserve eventual | ||
276 | # stack alignment | ||
277 | &push ("ebp"); | ||
278 | &mov ("ebp","esp"); | ||
279 | &sub ("esp",$max*4); | ||
280 | &mov ("ecx",&DWP(12,"ebp")); | ||
281 | &mov (&DWP(0,"esp"),"ecx"); | ||
282 | &mov ("edx",&DWP(16,"ebp")); | ||
283 | &mov (&DWP(4,"esp"),"edx"); | ||
284 | for($i=2;$i<$max;$i++) | ||
285 | { | ||
286 | # Some copies will be redundant/bogus... | ||
287 | &mov ("eax",&DWP(12+$i*4,"ebp")); | ||
288 | &mov (&DWP(0+$i*4,"esp"),"eax"); | ||
289 | } | ||
290 | &call_ptr (&DWP(8,"ebp"));# make the call... | ||
291 | &mov ("esp","ebp"); # ... and just restore the stack pointer | ||
292 | # without paying attention to what we called, | ||
293 | # (__cdecl *func) or (__stdcall *one). | ||
294 | &pop ("ebp"); | ||
295 | &ret (); | ||
296 | } | ||
297 | &function_end_B("OPENSSL_indirect_call"); | ||
298 | |||
299 | &function_begin_B("OPENSSL_ia32_rdrand"); | 260 | &function_begin_B("OPENSSL_ia32_rdrand"); |
300 | &mov ("ecx",8); | 261 | &mov ("ecx",8); |
301 | &set_label("loop"); | 262 | &set_label("loop"); |
diff --git a/src/lib/libssl/src/crypto/x86cpuid.pl b/src/lib/libssl/src/crypto/x86cpuid.pl index c7a57a3465..169036d53d 100644 --- a/src/lib/libssl/src/crypto/x86cpuid.pl +++ b/src/lib/libssl/src/crypto/x86cpuid.pl | |||
@@ -257,45 +257,6 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } | |||
257 | &ret (); | 257 | &ret (); |
258 | &function_end_B("OPENSSL_atomic_add"); | 258 | &function_end_B("OPENSSL_atomic_add"); |
259 | 259 | ||
260 | # This function can become handy under Win32 in situations when | ||
261 | # we don't know which calling convention, __stdcall or __cdecl(*), | ||
262 | # indirect callee is using. In C it can be deployed as | ||
263 | # | ||
264 | #ifdef OPENSSL_CPUID_OBJ | ||
265 | # type OPENSSL_indirect_call(void *f,...); | ||
266 | # ... | ||
267 | # OPENSSL_indirect_call(func,[up to $max arguments]); | ||
268 | #endif | ||
269 | # | ||
270 | # (*) it's designed to work even for __fastcall if number of | ||
271 | # arguments is 1 or 2! | ||
272 | &function_begin_B("OPENSSL_indirect_call"); | ||
273 | { | ||
274 | my ($max,$i)=(7,); # $max has to be chosen as 4*n-1 | ||
275 | # in order to preserve eventual | ||
276 | # stack alignment | ||
277 | &push ("ebp"); | ||
278 | &mov ("ebp","esp"); | ||
279 | &sub ("esp",$max*4); | ||
280 | &mov ("ecx",&DWP(12,"ebp")); | ||
281 | &mov (&DWP(0,"esp"),"ecx"); | ||
282 | &mov ("edx",&DWP(16,"ebp")); | ||
283 | &mov (&DWP(4,"esp"),"edx"); | ||
284 | for($i=2;$i<$max;$i++) | ||
285 | { | ||
286 | # Some copies will be redundant/bogus... | ||
287 | &mov ("eax",&DWP(12+$i*4,"ebp")); | ||
288 | &mov (&DWP(0+$i*4,"esp"),"eax"); | ||
289 | } | ||
290 | &call_ptr (&DWP(8,"ebp"));# make the call... | ||
291 | &mov ("esp","ebp"); # ... and just restore the stack pointer | ||
292 | # without paying attention to what we called, | ||
293 | # (__cdecl *func) or (__stdcall *one). | ||
294 | &pop ("ebp"); | ||
295 | &ret (); | ||
296 | } | ||
297 | &function_end_B("OPENSSL_indirect_call"); | ||
298 | |||
299 | &function_begin_B("OPENSSL_ia32_rdrand"); | 260 | &function_begin_B("OPENSSL_ia32_rdrand"); |
300 | &mov ("ecx",8); | 261 | &mov ("ecx",8); |
301 | &set_label("loop"); | 262 | &set_label("loop"); |