diff options
| author | miod <> | 2023-01-17 15:04:27 +0000 |
|---|---|---|
| committer | miod <> | 2023-01-17 15:04:27 +0000 |
| commit | a7f48cec18a6702191b620e72d8ffa41cd9173bc (patch) | |
| tree | ac2322b4572c0a9fa82ebffd1356547b8f6f6d3f /src/lib/libcrypto/x86cpuid.pl | |
| parent | 20d1b90213a8f1388cd79c1f9893015b9be9380f (diff) | |
| download | openbsd-a7f48cec18a6702191b620e72d8ffa41cd9173bc.tar.gz openbsd-a7f48cec18a6702191b620e72d8ffa41cd9173bc.tar.bz2 openbsd-a7f48cec18a6702191b620e72d8ffa41cd9173bc.zip | |
Remove non-visible and unused OPENSSL_wipe_cpu and OPENSSL_atomic_add
interfaces, and remove empty assembly OPENSSL_cpuid_setup routines - the
default empty C fallback will work as good.
ok jsing@
Diffstat (limited to 'src/lib/libcrypto/x86cpuid.pl')
| -rw-r--r-- | src/lib/libcrypto/x86cpuid.pl | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/lib/libcrypto/x86cpuid.pl b/src/lib/libcrypto/x86cpuid.pl index 0fc906a3e9..d6ebede0f8 100644 --- a/src/lib/libcrypto/x86cpuid.pl +++ b/src/lib/libcrypto/x86cpuid.pl | |||
| @@ -152,51 +152,6 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } | |||
| 152 | 152 | ||
| 153 | &external_label("OPENSSL_ia32cap_P"); | 153 | &external_label("OPENSSL_ia32cap_P"); |
| 154 | 154 | ||
| 155 | &function_begin_B("OPENSSL_wipe_cpu",""); | ||
| 156 | &xor ("eax","eax"); | ||
| 157 | &xor ("edx","edx"); | ||
| 158 | &picmeup("ecx","OPENSSL_ia32cap_P"); | ||
| 159 | &mov ("ecx",&DWP(0,"ecx")); | ||
| 160 | &bt (&DWP(0,"ecx"),"\$IA32CAP_BIT0_FPU"); | ||
| 161 | &jnc (&label("no_x87")); | ||
| 162 | if ($sse2) { | ||
| 163 | # Check SSE2 and FXSR bits. | ||
| 164 | &and ("ecx", "\$(IA32CAP_MASK0_FXSR | IA32CAP_MASK0_SSE2)"); | ||
| 165 | &cmp ("ecx", "\$(IA32CAP_MASK0_FXSR | IA32CAP_MASK0_SSE2)"); | ||
| 166 | &jne (&label("no_sse2")); | ||
| 167 | &pxor ("xmm0","xmm0"); | ||
| 168 | &pxor ("xmm1","xmm1"); | ||
| 169 | &pxor ("xmm2","xmm2"); | ||
| 170 | &pxor ("xmm3","xmm3"); | ||
| 171 | &pxor ("xmm4","xmm4"); | ||
| 172 | &pxor ("xmm5","xmm5"); | ||
| 173 | &pxor ("xmm6","xmm6"); | ||
| 174 | &pxor ("xmm7","xmm7"); | ||
| 175 | &set_label("no_sse2"); | ||
| 176 | } | ||
| 177 | # just a bunch of fldz to zap the fp/mm bank followed by finit... | ||
| 178 | &data_word(0xeed9eed9,0xeed9eed9,0xeed9eed9,0xeed9eed9,0x90e3db9b); | ||
| 179 | &set_label("no_x87"); | ||
| 180 | &lea ("eax",&DWP(4,"esp")); | ||
| 181 | &ret (); | ||
| 182 | &function_end_B("OPENSSL_wipe_cpu"); | ||
| 183 | |||
| 184 | &function_begin_B("OPENSSL_atomic_add"); | ||
| 185 | &mov ("edx",&DWP(4,"esp")); # fetch the pointer, 1st arg | ||
| 186 | &mov ("ecx",&DWP(8,"esp")); # fetch the increment, 2nd arg | ||
| 187 | &push ("ebx"); | ||
| 188 | &nop (); | ||
| 189 | &mov ("eax",&DWP(0,"edx")); | ||
| 190 | &set_label("spin"); | ||
| 191 | &lea ("ebx",&DWP(0,"eax","ecx")); | ||
| 192 | &nop (); | ||
| 193 | &data_word(0x1ab10ff0); # lock; cmpxchg %ebx,(%edx) # %eax is involved and is always reloaded | ||
| 194 | &jne (&label("spin")); | ||
| 195 | &mov ("eax","ebx"); # OpenSSL expects the new value | ||
| 196 | &pop ("ebx"); | ||
| 197 | &ret (); | ||
| 198 | &function_end_B("OPENSSL_atomic_add"); | ||
| 199 | |||
| 200 | &initseg("OPENSSL_cpuid_setup"); | 155 | &initseg("OPENSSL_cpuid_setup"); |
| 201 | 156 | ||
| 202 | &asm_finish(); | 157 | &asm_finish(); |
