1 | .file "x86cpuid.s"
|
---|
2 | .text
|
---|
3 | .globl _OPENSSL_ia32_cpuid
|
---|
4 | .align 4
|
---|
5 | _OPENSSL_ia32_cpuid:
|
---|
6 | L_OPENSSL_ia32_cpuid_begin:
|
---|
7 | pushl %ebp
|
---|
8 | pushl %ebx
|
---|
9 | pushl %esi
|
---|
10 | pushl %edi
|
---|
11 | xorl %edx,%edx
|
---|
12 | pushfl
|
---|
13 | popl %eax
|
---|
14 | movl %eax,%ecx
|
---|
15 | xorl $2097152,%eax
|
---|
16 | pushl %eax
|
---|
17 | popfl
|
---|
18 | pushfl
|
---|
19 | popl %eax
|
---|
20 | xorl %eax,%ecx
|
---|
21 | xorl %eax,%eax
|
---|
22 | movl 20(%esp),%esi
|
---|
23 | movl %eax,8(%esi)
|
---|
24 | btl $21,%ecx
|
---|
25 | jnc L000nocpuid
|
---|
26 | .byte 0x0f,0xa2
|
---|
27 | movl %eax,%edi
|
---|
28 | xorl %eax,%eax
|
---|
29 | cmpl $1970169159,%ebx
|
---|
30 | setne %al
|
---|
31 | movl %eax,%ebp
|
---|
32 | cmpl $1231384169,%edx
|
---|
33 | setne %al
|
---|
34 | orl %eax,%ebp
|
---|
35 | cmpl $1818588270,%ecx
|
---|
36 | setne %al
|
---|
37 | orl %eax,%ebp
|
---|
38 | jz L001intel
|
---|
39 | cmpl $1752462657,%ebx
|
---|
40 | setne %al
|
---|
41 | movl %eax,%esi
|
---|
42 | cmpl $1769238117,%edx
|
---|
43 | setne %al
|
---|
44 | orl %eax,%esi
|
---|
45 | cmpl $1145913699,%ecx
|
---|
46 | setne %al
|
---|
47 | orl %eax,%esi
|
---|
48 | jnz L001intel
|
---|
49 | movl $2147483648,%eax
|
---|
50 | .byte 0x0f,0xa2
|
---|
51 | cmpl $2147483649,%eax
|
---|
52 | jb L001intel
|
---|
53 | movl %eax,%esi
|
---|
54 | movl $2147483649,%eax
|
---|
55 | .byte 0x0f,0xa2
|
---|
56 | orl %ecx,%ebp
|
---|
57 | andl $2049,%ebp
|
---|
58 | cmpl $2147483656,%esi
|
---|
59 | jb L001intel
|
---|
60 | movl $2147483656,%eax
|
---|
61 | .byte 0x0f,0xa2
|
---|
62 | movzbl %cl,%esi
|
---|
63 | incl %esi
|
---|
64 | movl $1,%eax
|
---|
65 | xorl %ecx,%ecx
|
---|
66 | .byte 0x0f,0xa2
|
---|
67 | btl $28,%edx
|
---|
68 | jnc L002generic
|
---|
69 | shrl $16,%ebx
|
---|
70 | andl $255,%ebx
|
---|
71 | cmpl %esi,%ebx
|
---|
72 | ja L002generic
|
---|
73 | andl $4026531839,%edx
|
---|
74 | jmp L002generic
|
---|
75 | L001intel:
|
---|
76 | cmpl $4,%edi
|
---|
77 | movl $-1,%esi
|
---|
78 | jb L003nocacheinfo
|
---|
79 | movl $4,%eax
|
---|
80 | movl $0,%ecx
|
---|
81 | .byte 0x0f,0xa2
|
---|
82 | movl %eax,%esi
|
---|
83 | shrl $14,%esi
|
---|
84 | andl $4095,%esi
|
---|
85 | L003nocacheinfo:
|
---|
86 | movl $1,%eax
|
---|
87 | xorl %ecx,%ecx
|
---|
88 | .byte 0x0f,0xa2
|
---|
89 | andl $3220176895,%edx
|
---|
90 | cmpl $0,%ebp
|
---|
91 | jne L004notintel
|
---|
92 | orl $1073741824,%edx
|
---|
93 | andb $15,%ah
|
---|
94 | cmpb $15,%ah
|
---|
95 | jne L004notintel
|
---|
96 | orl $1048576,%edx
|
---|
97 | L004notintel:
|
---|
98 | btl $28,%edx
|
---|
99 | jnc L002generic
|
---|
100 | andl $4026531839,%edx
|
---|
101 | cmpl $0,%esi
|
---|
102 | je L002generic
|
---|
103 | orl $268435456,%edx
|
---|
104 | shrl $16,%ebx
|
---|
105 | cmpb $1,%bl
|
---|
106 | ja L002generic
|
---|
107 | andl $4026531839,%edx
|
---|
108 | L002generic:
|
---|
109 | andl $2048,%ebp
|
---|
110 | andl $4294965247,%ecx
|
---|
111 | movl %edx,%esi
|
---|
112 | orl %ecx,%ebp
|
---|
113 | cmpl $7,%edi
|
---|
114 | movl 20(%esp),%edi
|
---|
115 | jb L005no_extended_info
|
---|
116 | movl $7,%eax
|
---|
117 | xorl %ecx,%ecx
|
---|
118 | .byte 0x0f,0xa2
|
---|
119 | movl %ebx,8(%edi)
|
---|
120 | L005no_extended_info:
|
---|
121 | btl $27,%ebp
|
---|
122 | jnc L006clear_avx
|
---|
123 | xorl %ecx,%ecx
|
---|
124 | .byte 15,1,208
|
---|
125 | andl $6,%eax
|
---|
126 | cmpl $6,%eax
|
---|
127 | je L007done
|
---|
128 | cmpl $2,%eax
|
---|
129 | je L006clear_avx
|
---|
130 | L008clear_xmm:
|
---|
131 | andl $4261412861,%ebp
|
---|
132 | andl $4278190079,%esi
|
---|
133 | L006clear_avx:
|
---|
134 | andl $4026525695,%ebp
|
---|
135 | andl $4294967263,8(%edi)
|
---|
136 | L007done:
|
---|
137 | movl %esi,%eax
|
---|
138 | movl %ebp,%edx
|
---|
139 | L000nocpuid:
|
---|
140 | popl %edi
|
---|
141 | popl %esi
|
---|
142 | popl %ebx
|
---|
143 | popl %ebp
|
---|
144 | ret
|
---|
145 | .globl _OPENSSL_rdtsc
|
---|
146 | .align 4
|
---|
147 | _OPENSSL_rdtsc:
|
---|
148 | L_OPENSSL_rdtsc_begin:
|
---|
149 | xorl %eax,%eax
|
---|
150 | xorl %edx,%edx
|
---|
151 | call L009PIC_me_up
|
---|
152 | L009PIC_me_up:
|
---|
153 | popl %ecx
|
---|
154 | movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L009PIC_me_up(%ecx),%ecx
|
---|
155 | btl $4,(%ecx)
|
---|
156 | jnc L010notsc
|
---|
157 | .byte 0x0f,0x31
|
---|
158 | L010notsc:
|
---|
159 | ret
|
---|
160 | .globl _OPENSSL_instrument_halt
|
---|
161 | .align 4
|
---|
162 | _OPENSSL_instrument_halt:
|
---|
163 | L_OPENSSL_instrument_halt_begin:
|
---|
164 | call L011PIC_me_up
|
---|
165 | L011PIC_me_up:
|
---|
166 | popl %ecx
|
---|
167 | movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L011PIC_me_up(%ecx),%ecx
|
---|
168 | btl $4,(%ecx)
|
---|
169 | jnc L012nohalt
|
---|
170 | .long 2421723150
|
---|
171 | andl $3,%eax
|
---|
172 | jnz L012nohalt
|
---|
173 | pushfl
|
---|
174 | popl %eax
|
---|
175 | btl $9,%eax
|
---|
176 | jnc L012nohalt
|
---|
177 | .byte 0x0f,0x31
|
---|
178 | pushl %edx
|
---|
179 | pushl %eax
|
---|
180 | hlt
|
---|
181 | .byte 0x0f,0x31
|
---|
182 | subl (%esp),%eax
|
---|
183 | sbbl 4(%esp),%edx
|
---|
184 | addl $8,%esp
|
---|
185 | ret
|
---|
186 | L012nohalt:
|
---|
187 | xorl %eax,%eax
|
---|
188 | xorl %edx,%edx
|
---|
189 | ret
|
---|
190 | .globl _OPENSSL_far_spin
|
---|
191 | .align 4
|
---|
192 | _OPENSSL_far_spin:
|
---|
193 | L_OPENSSL_far_spin_begin:
|
---|
194 | pushfl
|
---|
195 | popl %eax
|
---|
196 | btl $9,%eax
|
---|
197 | jnc L013nospin
|
---|
198 | movl 4(%esp),%eax
|
---|
199 | movl 8(%esp),%ecx
|
---|
200 | .long 2430111262
|
---|
201 | xorl %eax,%eax
|
---|
202 | movl (%ecx),%edx
|
---|
203 | jmp L014spin
|
---|
204 | .align 4,0x90
|
---|
205 | L014spin:
|
---|
206 | incl %eax
|
---|
207 | cmpl (%ecx),%edx
|
---|
208 | je L014spin
|
---|
209 | .long 529567888
|
---|
210 | ret
|
---|
211 | L013nospin:
|
---|
212 | xorl %eax,%eax
|
---|
213 | xorl %edx,%edx
|
---|
214 | ret
|
---|
215 | .globl _OPENSSL_wipe_cpu
|
---|
216 | .align 4
|
---|
217 | _OPENSSL_wipe_cpu:
|
---|
218 | L_OPENSSL_wipe_cpu_begin:
|
---|
219 | xorl %eax,%eax
|
---|
220 | xorl %edx,%edx
|
---|
221 | call L015PIC_me_up
|
---|
222 | L015PIC_me_up:
|
---|
223 | popl %ecx
|
---|
224 | movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L015PIC_me_up(%ecx),%ecx
|
---|
225 | movl (%ecx),%ecx
|
---|
226 | btl $1,(%ecx)
|
---|
227 | jnc L016no_x87
|
---|
228 | .long 4007259865,4007259865,4007259865,4007259865,2430851995
|
---|
229 | L016no_x87:
|
---|
230 | leal 4(%esp),%eax
|
---|
231 | ret
|
---|
232 | .globl _OPENSSL_atomic_add
|
---|
233 | .align 4
|
---|
234 | _OPENSSL_atomic_add:
|
---|
235 | L_OPENSSL_atomic_add_begin:
|
---|
236 | movl 4(%esp),%edx
|
---|
237 | movl 8(%esp),%ecx
|
---|
238 | pushl %ebx
|
---|
239 | nop
|
---|
240 | movl (%edx),%eax
|
---|
241 | L017spin:
|
---|
242 | leal (%eax,%ecx,1),%ebx
|
---|
243 | nop
|
---|
244 | .long 447811568
|
---|
245 | jne L017spin
|
---|
246 | movl %ebx,%eax
|
---|
247 | popl %ebx
|
---|
248 | ret
|
---|
249 | .globl _OPENSSL_indirect_call
|
---|
250 | .align 4
|
---|
251 | _OPENSSL_indirect_call:
|
---|
252 | L_OPENSSL_indirect_call_begin:
|
---|
253 | pushl %ebp
|
---|
254 | movl %esp,%ebp
|
---|
255 | subl $28,%esp
|
---|
256 | movl 12(%ebp),%ecx
|
---|
257 | movl %ecx,(%esp)
|
---|
258 | movl 16(%ebp),%edx
|
---|
259 | movl %edx,4(%esp)
|
---|
260 | movl 20(%ebp),%eax
|
---|
261 | movl %eax,8(%esp)
|
---|
262 | movl 24(%ebp),%eax
|
---|
263 | movl %eax,12(%esp)
|
---|
264 | movl 28(%ebp),%eax
|
---|
265 | movl %eax,16(%esp)
|
---|
266 | movl 32(%ebp),%eax
|
---|
267 | movl %eax,20(%esp)
|
---|
268 | movl 36(%ebp),%eax
|
---|
269 | movl %eax,24(%esp)
|
---|
270 | call *8(%ebp)
|
---|
271 | movl %ebp,%esp
|
---|
272 | popl %ebp
|
---|
273 | ret
|
---|
274 | .globl _OPENSSL_cleanse
|
---|
275 | .align 4
|
---|
276 | _OPENSSL_cleanse:
|
---|
277 | L_OPENSSL_cleanse_begin:
|
---|
278 | movl 4(%esp),%edx
|
---|
279 | movl 8(%esp),%ecx
|
---|
280 | xorl %eax,%eax
|
---|
281 | cmpl $7,%ecx
|
---|
282 | jae L018lot
|
---|
283 | cmpl $0,%ecx
|
---|
284 | je L019ret
|
---|
285 | L020little:
|
---|
286 | movb %al,(%edx)
|
---|
287 | subl $1,%ecx
|
---|
288 | leal 1(%edx),%edx
|
---|
289 | jnz L020little
|
---|
290 | L019ret:
|
---|
291 | ret
|
---|
292 | .align 4,0x90
|
---|
293 | L018lot:
|
---|
294 | testl $3,%edx
|
---|
295 | jz L021aligned
|
---|
296 | movb %al,(%edx)
|
---|
297 | leal -1(%ecx),%ecx
|
---|
298 | leal 1(%edx),%edx
|
---|
299 | jmp L018lot
|
---|
300 | L021aligned:
|
---|
301 | movl %eax,(%edx)
|
---|
302 | leal -4(%ecx),%ecx
|
---|
303 | testl $-4,%ecx
|
---|
304 | leal 4(%edx),%edx
|
---|
305 | jnz L021aligned
|
---|
306 | cmpl $0,%ecx
|
---|
307 | jne L020little
|
---|
308 | ret
|
---|
309 | .globl _CRYPTO_memcmp
|
---|
310 | .align 4
|
---|
311 | _CRYPTO_memcmp:
|
---|
312 | L_CRYPTO_memcmp_begin:
|
---|
313 | pushl %esi
|
---|
314 | pushl %edi
|
---|
315 | movl 12(%esp),%esi
|
---|
316 | movl 16(%esp),%edi
|
---|
317 | movl 20(%esp),%ecx
|
---|
318 | xorl %eax,%eax
|
---|
319 | xorl %edx,%edx
|
---|
320 | cmpl $0,%ecx
|
---|
321 | je L022no_data
|
---|
322 | L023loop:
|
---|
323 | movb (%esi),%dl
|
---|
324 | leal 1(%esi),%esi
|
---|
325 | xorb (%edi),%dl
|
---|
326 | leal 1(%edi),%edi
|
---|
327 | orb %dl,%al
|
---|
328 | decl %ecx
|
---|
329 | jnz L023loop
|
---|
330 | negl %eax
|
---|
331 | shrl $31,%eax
|
---|
332 | L022no_data:
|
---|
333 | popl %edi
|
---|
334 | popl %esi
|
---|
335 | ret
|
---|
336 | .globl _OPENSSL_instrument_bus
|
---|
337 | .align 4
|
---|
338 | _OPENSSL_instrument_bus:
|
---|
339 | L_OPENSSL_instrument_bus_begin:
|
---|
340 | pushl %ebp
|
---|
341 | pushl %ebx
|
---|
342 | pushl %esi
|
---|
343 | pushl %edi
|
---|
344 | movl $0,%eax
|
---|
345 | popl %edi
|
---|
346 | popl %esi
|
---|
347 | popl %ebx
|
---|
348 | popl %ebp
|
---|
349 | ret
|
---|
350 | .globl _OPENSSL_instrument_bus2
|
---|
351 | .align 4
|
---|
352 | _OPENSSL_instrument_bus2:
|
---|
353 | L_OPENSSL_instrument_bus2_begin:
|
---|
354 | pushl %ebp
|
---|
355 | pushl %ebx
|
---|
356 | pushl %esi
|
---|
357 | pushl %edi
|
---|
358 | movl $0,%eax
|
---|
359 | popl %edi
|
---|
360 | popl %esi
|
---|
361 | popl %ebx
|
---|
362 | popl %ebp
|
---|
363 | ret
|
---|
364 | .globl _OPENSSL_ia32_rdrand
|
---|
365 | .align 4
|
---|
366 | _OPENSSL_ia32_rdrand:
|
---|
367 | L_OPENSSL_ia32_rdrand_begin:
|
---|
368 | movl $8,%ecx
|
---|
369 | L024loop:
|
---|
370 | .byte 15,199,240
|
---|
371 | jc L025break
|
---|
372 | loop L024loop
|
---|
373 | L025break:
|
---|
374 | cmpl $0,%eax
|
---|
375 | cmovel %ecx,%eax
|
---|
376 | ret
|
---|
377 | .globl _OPENSSL_ia32_rdrand_bytes
|
---|
378 | .align 4
|
---|
379 | _OPENSSL_ia32_rdrand_bytes:
|
---|
380 | L_OPENSSL_ia32_rdrand_bytes_begin:
|
---|
381 | pushl %edi
|
---|
382 | pushl %ebx
|
---|
383 | xorl %eax,%eax
|
---|
384 | movl 12(%esp),%edi
|
---|
385 | movl 16(%esp),%ebx
|
---|
386 | cmpl $0,%ebx
|
---|
387 | je L026done
|
---|
388 | movl $8,%ecx
|
---|
389 | L027loop:
|
---|
390 | .byte 15,199,242
|
---|
391 | jc L028break
|
---|
392 | loop L027loop
|
---|
393 | jmp L026done
|
---|
394 | .align 4,0x90
|
---|
395 | L028break:
|
---|
396 | cmpl $4,%ebx
|
---|
397 | jb L029tail
|
---|
398 | movl %edx,(%edi)
|
---|
399 | leal 4(%edi),%edi
|
---|
400 | addl $4,%eax
|
---|
401 | subl $4,%ebx
|
---|
402 | jz L026done
|
---|
403 | movl $8,%ecx
|
---|
404 | jmp L027loop
|
---|
405 | .align 4,0x90
|
---|
406 | L029tail:
|
---|
407 | movb %dl,(%edi)
|
---|
408 | leal 1(%edi),%edi
|
---|
409 | incl %eax
|
---|
410 | shrl $8,%edx
|
---|
411 | decl %ebx
|
---|
412 | jnz L029tail
|
---|
413 | L026done:
|
---|
414 | popl %ebx
|
---|
415 | popl %edi
|
---|
416 | ret
|
---|
417 | .globl _OPENSSL_ia32_rdseed
|
---|
418 | .align 4
|
---|
419 | _OPENSSL_ia32_rdseed:
|
---|
420 | L_OPENSSL_ia32_rdseed_begin:
|
---|
421 | movl $8,%ecx
|
---|
422 | L030loop:
|
---|
423 | .byte 15,199,248
|
---|
424 | jc L031break
|
---|
425 | loop L030loop
|
---|
426 | L031break:
|
---|
427 | cmpl $0,%eax
|
---|
428 | cmovel %ecx,%eax
|
---|
429 | ret
|
---|
430 | .globl _OPENSSL_ia32_rdseed_bytes
|
---|
431 | .align 4
|
---|
432 | _OPENSSL_ia32_rdseed_bytes:
|
---|
433 | L_OPENSSL_ia32_rdseed_bytes_begin:
|
---|
434 | pushl %edi
|
---|
435 | pushl %ebx
|
---|
436 | xorl %eax,%eax
|
---|
437 | movl 12(%esp),%edi
|
---|
438 | movl 16(%esp),%ebx
|
---|
439 | cmpl $0,%ebx
|
---|
440 | je L032done
|
---|
441 | movl $8,%ecx
|
---|
442 | L033loop:
|
---|
443 | .byte 15,199,250
|
---|
444 | jc L034break
|
---|
445 | loop L033loop
|
---|
446 | jmp L032done
|
---|
447 | .align 4,0x90
|
---|
448 | L034break:
|
---|
449 | cmpl $4,%ebx
|
---|
450 | jb L035tail
|
---|
451 | movl %edx,(%edi)
|
---|
452 | leal 4(%edi),%edi
|
---|
453 | addl $4,%eax
|
---|
454 | subl $4,%ebx
|
---|
455 | jz L032done
|
---|
456 | movl $8,%ecx
|
---|
457 | jmp L033loop
|
---|
458 | .align 4,0x90
|
---|
459 | L035tail:
|
---|
460 | movb %dl,(%edi)
|
---|
461 | leal 1(%edi),%edi
|
---|
462 | incl %eax
|
---|
463 | shrl $8,%edx
|
---|
464 | decl %ebx
|
---|
465 | jnz L035tail
|
---|
466 | L032done:
|
---|
467 | popl %ebx
|
---|
468 | popl %edi
|
---|
469 | ret
|
---|
470 | .section __IMPORT,__pointers,non_lazy_symbol_pointers
|
---|
471 | L_OPENSSL_ia32cap_P$non_lazy_ptr:
|
---|
472 | .indirect_symbol _OPENSSL_ia32cap_P
|
---|
473 | .long 0
|
---|
474 | .comm _OPENSSL_ia32cap_P,16,2
|
---|
475 | .mod_init_func
|
---|
476 | .align 2
|
---|
477 | .long _OPENSSL_cpuid_setup
|
---|