diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/x86cpuid.pl | 70 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/x86cpuid.pl | 70 | 
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"); | 
