summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormiod <>2014-06-20 15:49:42 +0000
committermiod <>2014-06-20 15:49:42 +0000
commit3085a35c6ea406286fecd14593319ca34cf66ad1 (patch)
treeb124ee30798b2694e5de7bef4973f14167e7e695 /src
parent0c3728bc47ef9dec7437f0f8ab3a508fcde43b05 (diff)
downloadopenbsd-3085a35c6ea406286fecd14593319ca34cf66ad1.tar.gz
openbsd-3085a35c6ea406286fecd14593319ca34cf66ad1.tar.bz2
openbsd-3085a35c6ea406286fecd14593319ca34cf66ad1.zip
Remove OPENSSL_instrument_halt and OPENSSL_far_spin, which both might
have been used under DJGPP in the previous century (if at all).
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/x86cpuid.pl70
-rw-r--r--src/lib/libssl/src/crypto/x86cpuid.pl70
2 files changed, 0 insertions, 140 deletions
diff --git a/src/lib/libcrypto/x86cpuid.pl b/src/lib/libcrypto/x86cpuid.pl
index 47df147a83..8a96cda6e6 100644
--- a/src/lib/libcrypto/x86cpuid.pl
+++ b/src/lib/libcrypto/x86cpuid.pl
@@ -143,76 +143,6 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
143 143
144&external_label("OPENSSL_ia32cap_P"); 144&external_label("OPENSSL_ia32cap_P");
145 145
146# This works in Ring 0 only [read DJGPP+MS-DOS+privileged DPMI host],
147# but it's safe to call it on any [supported] 32-bit platform...
148# Just check for [non-]zero return value...
149&function_begin_B("OPENSSL_instrument_halt","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
150 &picmeup("ecx","OPENSSL_ia32cap_P");
151 &bt (&DWP(0,"ecx"),4);
152 &jnc (&label("nohalt")); # no TSC
153
154 &data_word(0x9058900e); # push %cs; pop %eax
155 &and ("eax",3);
156 &jnz (&label("nohalt")); # not enough privileges
157
158 &pushf ();
159 &pop ("eax");
160 &bt ("eax",9);
161 &jnc (&label("nohalt")); # interrupts are disabled
162
163 &rdtsc ();
164 &push ("edx");
165 &push ("eax");
166 &halt ();
167 &rdtsc ();
168
169 &sub ("eax",&DWP(0,"esp"));
170 &sbb ("edx",&DWP(4,"esp"));
171 &add ("esp",8);
172 &ret ();
173
174&set_label("nohalt");
175 &xor ("eax","eax");
176 &xor ("edx","edx");
177 &ret ();
178&function_end_B("OPENSSL_instrument_halt");
179
180# Essentially there is only one use for this function. Under DJGPP:
181#
182# #include <go32.h>
183# ...
184# i=OPENSSL_far_spin(_dos_ds,0x46c);
185# ...
186# to obtain the number of spins till closest timer interrupt.
187
188&function_begin_B("OPENSSL_far_spin");
189 &pushf ();
190 &pop ("eax")
191 &bt ("eax",9);
192 &jnc (&label("nospin")); # interrupts are disabled
193
194 &mov ("eax",&DWP(4,"esp"));
195 &mov ("ecx",&DWP(8,"esp"));
196 &data_word (0x90d88e1e); # push %ds, mov %eax,%ds
197 &xor ("eax","eax");
198 &mov ("edx",&DWP(0,"ecx"));
199 &jmp (&label("spin"));
200
201 &align (16);
202&set_label("spin");
203 &inc ("eax");
204 &cmp ("edx",&DWP(0,"ecx"));
205 &je (&label("spin"));
206
207 &data_word (0x1f909090); # pop %ds
208 &ret ();
209
210&set_label("nospin");
211 &xor ("eax","eax");
212 &xor ("edx","edx");
213 &ret ();
214&function_end_B("OPENSSL_far_spin");
215
216&function_begin_B("OPENSSL_wipe_cpu","EXTRN\t_OPENSSL_ia32cap_P:DWORD"); 146&function_begin_B("OPENSSL_wipe_cpu","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
217 &xor ("eax","eax"); 147 &xor ("eax","eax");
218 &xor ("edx","edx"); 148 &xor ("edx","edx");
diff --git a/src/lib/libssl/src/crypto/x86cpuid.pl b/src/lib/libssl/src/crypto/x86cpuid.pl
index 47df147a83..8a96cda6e6 100644
--- a/src/lib/libssl/src/crypto/x86cpuid.pl
+++ b/src/lib/libssl/src/crypto/x86cpuid.pl
@@ -143,76 +143,6 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
143 143
144&external_label("OPENSSL_ia32cap_P"); 144&external_label("OPENSSL_ia32cap_P");
145 145
146# This works in Ring 0 only [read DJGPP+MS-DOS+privileged DPMI host],
147# but it's safe to call it on any [supported] 32-bit platform...
148# Just check for [non-]zero return value...
149&function_begin_B("OPENSSL_instrument_halt","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
150 &picmeup("ecx","OPENSSL_ia32cap_P");
151 &bt (&DWP(0,"ecx"),4);
152 &jnc (&label("nohalt")); # no TSC
153
154 &data_word(0x9058900e); # push %cs; pop %eax
155 &and ("eax",3);
156 &jnz (&label("nohalt")); # not enough privileges
157
158 &pushf ();
159 &pop ("eax");
160 &bt ("eax",9);
161 &jnc (&label("nohalt")); # interrupts are disabled
162
163 &rdtsc ();
164 &push ("edx");
165 &push ("eax");
166 &halt ();
167 &rdtsc ();
168
169 &sub ("eax",&DWP(0,"esp"));
170 &sbb ("edx",&DWP(4,"esp"));
171 &add ("esp",8);
172 &ret ();
173
174&set_label("nohalt");
175 &xor ("eax","eax");
176 &xor ("edx","edx");
177 &ret ();
178&function_end_B("OPENSSL_instrument_halt");
179
180# Essentially there is only one use for this function. Under DJGPP:
181#
182# #include <go32.h>
183# ...
184# i=OPENSSL_far_spin(_dos_ds,0x46c);
185# ...
186# to obtain the number of spins till closest timer interrupt.
187
188&function_begin_B("OPENSSL_far_spin");
189 &pushf ();
190 &pop ("eax")
191 &bt ("eax",9);
192 &jnc (&label("nospin")); # interrupts are disabled
193
194 &mov ("eax",&DWP(4,"esp"));
195 &mov ("ecx",&DWP(8,"esp"));
196 &data_word (0x90d88e1e); # push %ds, mov %eax,%ds
197 &xor ("eax","eax");
198 &mov ("edx",&DWP(0,"ecx"));
199 &jmp (&label("spin"));
200
201 &align (16);
202&set_label("spin");
203 &inc ("eax");
204 &cmp ("edx",&DWP(0,"ecx"));
205 &je (&label("spin"));
206
207 &data_word (0x1f909090); # pop %ds
208 &ret ();
209
210&set_label("nospin");
211 &xor ("eax","eax");
212 &xor ("edx","edx");
213 &ret ();
214&function_end_B("OPENSSL_far_spin");
215
216&function_begin_B("OPENSSL_wipe_cpu","EXTRN\t_OPENSSL_ia32cap_P:DWORD"); 146&function_begin_B("OPENSSL_wipe_cpu","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
217 &xor ("eax","eax"); 147 &xor ("eax","eax");
218 &xor ("edx","edx"); 148 &xor ("edx","edx");