• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.text
2.globl	_OPENSSL_ia32_cpuid
3.align	4
4_OPENSSL_ia32_cpuid:
5L_OPENSSL_ia32_cpuid_begin:
6	%ifdef __CET__
7
8.byte	243,15,30,251
9	%endif
10
11	pushl	%ebp
12	pushl	%ebx
13	pushl	%esi
14	pushl	%edi
15	xorl	%edx,%edx
16	pushfl
17	popl	%eax
18	movl	%eax,%ecx
19	xorl	$2097152,%eax
20	pushl	%eax
21	popfl
22	pushfl
23	popl	%eax
24	xorl	%eax,%ecx
25	xorl	%eax,%eax
26	movl	20(%esp),%esi
27	movl	%eax,8(%esi)
28	btl	$21,%ecx
29	jnc	L000nocpuid
30	.byte	0x0f,0xa2
31	movl	%eax,%edi
32	xorl	%eax,%eax
33	cmpl	$1970169159,%ebx
34	setne	%al
35	movl	%eax,%ebp
36	cmpl	$1231384169,%edx
37	setne	%al
38	orl	%eax,%ebp
39	cmpl	$1818588270,%ecx
40	setne	%al
41	orl	%eax,%ebp
42	jz	L001intel
43	cmpl	$1752462657,%ebx
44	setne	%al
45	movl	%eax,%esi
46	cmpl	$1769238117,%edx
47	setne	%al
48	orl	%eax,%esi
49	cmpl	$1145913699,%ecx
50	setne	%al
51	orl	%eax,%esi
52	jnz	L001intel
53	movl	$2147483648,%eax
54	.byte	0x0f,0xa2
55	cmpl	$2147483649,%eax
56	jb	L001intel
57	movl	%eax,%esi
58	movl	$2147483649,%eax
59	.byte	0x0f,0xa2
60	orl	%ecx,%ebp
61	andl	$2049,%ebp
62	cmpl	$2147483656,%esi
63	jb	L001intel
64	movl	$2147483656,%eax
65	.byte	0x0f,0xa2
66	movzbl	%cl,%esi
67	incl	%esi
68	movl	$1,%eax
69	xorl	%ecx,%ecx
70	.byte	0x0f,0xa2
71	btl	$28,%edx
72	jnc	L002generic
73	shrl	$16,%ebx
74	andl	$255,%ebx
75	cmpl	%esi,%ebx
76	ja	L002generic
77	andl	$4026531839,%edx
78	jmp	L002generic
79L001intel:
80	cmpl	$4,%edi
81	movl	$-1,%esi
82	jb	L003nocacheinfo
83	movl	$4,%eax
84	movl	$0,%ecx
85	.byte	0x0f,0xa2
86	movl	%eax,%esi
87	shrl	$14,%esi
88	andl	$4095,%esi
89L003nocacheinfo:
90	movl	$1,%eax
91	xorl	%ecx,%ecx
92	.byte	0x0f,0xa2
93	andl	$3220176895,%edx
94	cmpl	$0,%ebp
95	jne	L004notintel
96	orl	$1073741824,%edx
97	andb	$15,%ah
98	cmpb	$15,%ah
99	jne	L004notintel
100	orl	$1048576,%edx
101L004notintel:
102	btl	$28,%edx
103	jnc	L002generic
104	andl	$4026531839,%edx
105	cmpl	$0,%esi
106	je	L002generic
107	orl	$268435456,%edx
108	shrl	$16,%ebx
109	cmpb	$1,%bl
110	ja	L002generic
111	andl	$4026531839,%edx
112L002generic:
113	andl	$2048,%ebp
114	andl	$4294965247,%ecx
115	movl	%edx,%esi
116	orl	%ecx,%ebp
117	cmpl	$7,%edi
118	movl	20(%esp),%edi
119	jb	L005no_extended_info
120	movl	$7,%eax
121	xorl	%ecx,%ecx
122	.byte	0x0f,0xa2
123	movl	%ebx,8(%edi)
124L005no_extended_info:
125	btl	$27,%ebp
126	jnc	L006clear_avx
127	xorl	%ecx,%ecx
128.byte	15,1,208
129	andl	$6,%eax
130	cmpl	$6,%eax
131	je	L007done
132	cmpl	$2,%eax
133	je	L006clear_avx
134L008clear_xmm:
135	andl	$4261412861,%ebp
136	andl	$4278190079,%esi
137L006clear_avx:
138	andl	$4026525695,%ebp
139	andl	$4294967263,8(%edi)
140L007done:
141	movl	%esi,%eax
142	movl	%ebp,%edx
143L000nocpuid:
144	popl	%edi
145	popl	%esi
146	popl	%ebx
147	popl	%ebp
148	ret
149.globl	_OPENSSL_rdtsc
150.align	4
151_OPENSSL_rdtsc:
152L_OPENSSL_rdtsc_begin:
153	%ifdef __CET__
154
155.byte	243,15,30,251
156	%endif
157
158	xorl	%eax,%eax
159	xorl	%edx,%edx
160	call	L009PIC_me_up
161L009PIC_me_up:
162	popl	%ecx
163	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L009PIC_me_up(%ecx),%ecx
164	btl	$4,(%ecx)
165	jnc	L010notsc
166	.byte	0x0f,0x31
167L010notsc:
168	ret
169.globl	_OPENSSL_instrument_halt
170.align	4
171_OPENSSL_instrument_halt:
172L_OPENSSL_instrument_halt_begin:
173	%ifdef __CET__
174
175.byte	243,15,30,251
176	%endif
177
178	call	L011PIC_me_up
179L011PIC_me_up:
180	popl	%ecx
181	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L011PIC_me_up(%ecx),%ecx
182	btl	$4,(%ecx)
183	jnc	L012nohalt
184.long	2421723150
185	andl	$3,%eax
186	jnz	L012nohalt
187	pushfl
188	popl	%eax
189	btl	$9,%eax
190	jnc	L012nohalt
191	.byte	0x0f,0x31
192	pushl	%edx
193	pushl	%eax
194	hlt
195	.byte	0x0f,0x31
196	subl	(%esp),%eax
197	sbbl	4(%esp),%edx
198	addl	$8,%esp
199	ret
200L012nohalt:
201	xorl	%eax,%eax
202	xorl	%edx,%edx
203	ret
204.globl	_OPENSSL_far_spin
205.align	4
206_OPENSSL_far_spin:
207L_OPENSSL_far_spin_begin:
208	%ifdef __CET__
209
210.byte	243,15,30,251
211	%endif
212
213	pushfl
214	popl	%eax
215	btl	$9,%eax
216	jnc	L013nospin
217	movl	4(%esp),%eax
218	movl	8(%esp),%ecx
219.long	2430111262
220	xorl	%eax,%eax
221	movl	(%ecx),%edx
222	jmp	L014spin
223.align	4,0x90
224L014spin:
225	incl	%eax
226	cmpl	(%ecx),%edx
227	je	L014spin
228.long	529567888
229	ret
230L013nospin:
231	xorl	%eax,%eax
232	xorl	%edx,%edx
233	ret
234.globl	_OPENSSL_wipe_cpu
235.align	4
236_OPENSSL_wipe_cpu:
237L_OPENSSL_wipe_cpu_begin:
238	%ifdef __CET__
239
240.byte	243,15,30,251
241	%endif
242
243	xorl	%eax,%eax
244	xorl	%edx,%edx
245	call	L015PIC_me_up
246L015PIC_me_up:
247	popl	%ecx
248	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L015PIC_me_up(%ecx),%ecx
249	movl	(%ecx),%ecx
250	btl	$1,(%ecx)
251	jnc	L016no_x87
252	andl	$83886080,%ecx
253	cmpl	$83886080,%ecx
254	jne	L017no_sse2
255	pxor	%xmm0,%xmm0
256	pxor	%xmm1,%xmm1
257	pxor	%xmm2,%xmm2
258	pxor	%xmm3,%xmm3
259	pxor	%xmm4,%xmm4
260	pxor	%xmm5,%xmm5
261	pxor	%xmm6,%xmm6
262	pxor	%xmm7,%xmm7
263L017no_sse2:
264.long	4007259865,4007259865,4007259865,4007259865,2430851995
265L016no_x87:
266	leal	4(%esp),%eax
267	ret
268.globl	_OPENSSL_atomic_add
269.align	4
270_OPENSSL_atomic_add:
271L_OPENSSL_atomic_add_begin:
272	%ifdef __CET__
273
274.byte	243,15,30,251
275	%endif
276
277	movl	4(%esp),%edx
278	movl	8(%esp),%ecx
279	pushl	%ebx
280	nop
281	movl	(%edx),%eax
282L018spin:
283	leal	(%eax,%ecx,1),%ebx
284	nop
285.long	447811568
286	jne	L018spin
287	movl	%ebx,%eax
288	popl	%ebx
289	ret
290.globl	_OPENSSL_cleanse
291.align	4
292_OPENSSL_cleanse:
293L_OPENSSL_cleanse_begin:
294	%ifdef __CET__
295
296.byte	243,15,30,251
297	%endif
298
299	movl	4(%esp),%edx
300	movl	8(%esp),%ecx
301	xorl	%eax,%eax
302	cmpl	$7,%ecx
303	jae	L019lot
304	cmpl	$0,%ecx
305	je	L020ret
306L021little:
307	movb	%al,(%edx)
308	subl	$1,%ecx
309	leal	1(%edx),%edx
310	jnz	L021little
311L020ret:
312	ret
313.align	4,0x90
314L019lot:
315	testl	$3,%edx
316	jz	L022aligned
317	movb	%al,(%edx)
318	leal	-1(%ecx),%ecx
319	leal	1(%edx),%edx
320	jmp	L019lot
321L022aligned:
322	movl	%eax,(%edx)
323	leal	-4(%ecx),%ecx
324	testl	$-4,%ecx
325	leal	4(%edx),%edx
326	jnz	L022aligned
327	cmpl	$0,%ecx
328	jne	L021little
329	ret
330.globl	_CRYPTO_memcmp
331.align	4
332_CRYPTO_memcmp:
333L_CRYPTO_memcmp_begin:
334	%ifdef __CET__
335
336.byte	243,15,30,251
337	%endif
338
339	pushl	%esi
340	pushl	%edi
341	movl	12(%esp),%esi
342	movl	16(%esp),%edi
343	movl	20(%esp),%ecx
344	xorl	%eax,%eax
345	xorl	%edx,%edx
346	cmpl	$0,%ecx
347	je	L023no_data
348L024loop:
349	movb	(%esi),%dl
350	leal	1(%esi),%esi
351	xorb	(%edi),%dl
352	leal	1(%edi),%edi
353	orb	%dl,%al
354	decl	%ecx
355	jnz	L024loop
356	negl	%eax
357	shrl	$31,%eax
358L023no_data:
359	popl	%edi
360	popl	%esi
361	ret
362.globl	_OPENSSL_instrument_bus
363.align	4
364_OPENSSL_instrument_bus:
365L_OPENSSL_instrument_bus_begin:
366	%ifdef __CET__
367
368.byte	243,15,30,251
369	%endif
370
371	pushl	%ebp
372	pushl	%ebx
373	pushl	%esi
374	pushl	%edi
375	movl	$0,%eax
376	call	L025PIC_me_up
377L025PIC_me_up:
378	popl	%edx
379	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L025PIC_me_up(%edx),%edx
380	btl	$4,(%edx)
381	jnc	L026nogo
382	btl	$19,(%edx)
383	jnc	L026nogo
384	movl	20(%esp),%edi
385	movl	24(%esp),%ecx
386	.byte	0x0f,0x31
387	movl	%eax,%esi
388	movl	$0,%ebx
389	clflush	(%edi)
390.byte	240
391	addl	%ebx,(%edi)
392	jmp	L027loop
393.align	4,0x90
394L027loop:
395	.byte	0x0f,0x31
396	movl	%eax,%edx
397	subl	%esi,%eax
398	movl	%edx,%esi
399	movl	%eax,%ebx
400	clflush	(%edi)
401.byte	240
402	addl	%eax,(%edi)
403	leal	4(%edi),%edi
404	subl	$1,%ecx
405	jnz	L027loop
406	movl	24(%esp),%eax
407L026nogo:
408	popl	%edi
409	popl	%esi
410	popl	%ebx
411	popl	%ebp
412	ret
413.globl	_OPENSSL_instrument_bus2
414.align	4
415_OPENSSL_instrument_bus2:
416L_OPENSSL_instrument_bus2_begin:
417	%ifdef __CET__
418
419.byte	243,15,30,251
420	%endif
421
422	pushl	%ebp
423	pushl	%ebx
424	pushl	%esi
425	pushl	%edi
426	movl	$0,%eax
427	call	L028PIC_me_up
428L028PIC_me_up:
429	popl	%edx
430	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L028PIC_me_up(%edx),%edx
431	btl	$4,(%edx)
432	jnc	L029nogo
433	btl	$19,(%edx)
434	jnc	L029nogo
435	movl	20(%esp),%edi
436	movl	24(%esp),%ecx
437	movl	28(%esp),%ebp
438	.byte	0x0f,0x31
439	movl	%eax,%esi
440	movl	$0,%ebx
441	clflush	(%edi)
442.byte	240
443	addl	%ebx,(%edi)
444	.byte	0x0f,0x31
445	movl	%eax,%edx
446	subl	%esi,%eax
447	movl	%edx,%esi
448	movl	%eax,%ebx
449	jmp	L030loop2
450.align	4,0x90
451L030loop2:
452	clflush	(%edi)
453.byte	240
454	addl	%eax,(%edi)
455	subl	$1,%ebp
456	jz	L031done2
457	.byte	0x0f,0x31
458	movl	%eax,%edx
459	subl	%esi,%eax
460	movl	%edx,%esi
461	cmpl	%ebx,%eax
462	movl	%eax,%ebx
463	movl	$0,%edx
464	setne	%dl
465	subl	%edx,%ecx
466	leal	(%edi,%edx,4),%edi
467	jnz	L030loop2
468L031done2:
469	movl	24(%esp),%eax
470	subl	%ecx,%eax
471L029nogo:
472	popl	%edi
473	popl	%esi
474	popl	%ebx
475	popl	%ebp
476	ret
477.globl	_OPENSSL_ia32_rdrand_bytes
478.align	4
479_OPENSSL_ia32_rdrand_bytes:
480L_OPENSSL_ia32_rdrand_bytes_begin:
481	%ifdef __CET__
482
483.byte	243,15,30,251
484	%endif
485
486	pushl	%edi
487	pushl	%ebx
488	xorl	%eax,%eax
489	movl	12(%esp),%edi
490	movl	16(%esp),%ebx
491	cmpl	$0,%ebx
492	je	L032done
493	movl	$8,%ecx
494L033loop:
495.byte	15,199,242
496	jc	L034break
497	loop	L033loop
498	jmp	L032done
499.align	4,0x90
500L034break:
501	cmpl	$4,%ebx
502	jb	L035tail
503	movl	%edx,(%edi)
504	leal	4(%edi),%edi
505	addl	$4,%eax
506	subl	$4,%ebx
507	jz	L032done
508	movl	$8,%ecx
509	jmp	L033loop
510.align	4,0x90
511L035tail:
512	movb	%dl,(%edi)
513	leal	1(%edi),%edi
514	incl	%eax
515	shrl	$8,%edx
516	decl	%ebx
517	jnz	L035tail
518L032done:
519	xorl	%edx,%edx
520	popl	%ebx
521	popl	%edi
522	ret
523.globl	_OPENSSL_ia32_rdseed_bytes
524.align	4
525_OPENSSL_ia32_rdseed_bytes:
526L_OPENSSL_ia32_rdseed_bytes_begin:
527	%ifdef __CET__
528
529.byte	243,15,30,251
530	%endif
531
532	pushl	%edi
533	pushl	%ebx
534	xorl	%eax,%eax
535	movl	12(%esp),%edi
536	movl	16(%esp),%ebx
537	cmpl	$0,%ebx
538	je	L036done
539	movl	$8,%ecx
540L037loop:
541.byte	15,199,250
542	jc	L038break
543	loop	L037loop
544	jmp	L036done
545.align	4,0x90
546L038break:
547	cmpl	$4,%ebx
548	jb	L039tail
549	movl	%edx,(%edi)
550	leal	4(%edi),%edi
551	addl	$4,%eax
552	subl	$4,%ebx
553	jz	L036done
554	movl	$8,%ecx
555	jmp	L037loop
556.align	4,0x90
557L039tail:
558	movb	%dl,(%edi)
559	leal	1(%edi),%edi
560	incl	%eax
561	shrl	$8,%edx
562	decl	%ebx
563	jnz	L039tail
564L036done:
565	xorl	%edx,%edx
566	popl	%ebx
567	popl	%edi
568	ret
569.section __IMPORT,__pointers,non_lazy_symbol_pointers
570L_OPENSSL_ia32cap_P$non_lazy_ptr:
571.indirect_symbol	_OPENSSL_ia32cap_P
572.long	0
573.comm	_OPENSSL_ia32cap_P,16,2
574.mod_init_func
575.align 2
576.long   _OPENSSL_cpuid_setup
577