summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x86cpuid.pl
diff options
context:
space:
mode:
authormiod <>2023-01-17 15:04:27 +0000
committermiod <>2023-01-17 15:04:27 +0000
commit21a2d4cbfbe44f35adc4655aee0378ef3d06b022 (patch)
treeac2322b4572c0a9fa82ebffd1356547b8f6f6d3f /src/lib/libcrypto/x86cpuid.pl
parent09a139d6e2957a9f591459638b42ee548e5201dd (diff)
downloadopenbsd-21a2d4cbfbe44f35adc4655aee0378ef3d06b022.tar.gz
openbsd-21a2d4cbfbe44f35adc4655aee0378ef3d06b022.tar.bz2
openbsd-21a2d4cbfbe44f35adc4655aee0378ef3d06b022.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.pl45
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();