]> git.proxmox.com Git - mirror_edk2.git/blob - EmulatorPkg/Unix/Host/Ia32/Gasket.S
EmulatorPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / EmulatorPkg / Unix / Host / Ia32 / Gasket.S
1 #------------------------------------------------------------------------------
2 #
3 # Manage differenced between UNIX ABI and EFI/Windows ABI
4 #
5 # For IA-32 the only difference is Mac OS X requires a 16-byte aligned stack.
6 # For Linux this stack adjustment is a no-op, but we may as well make the
7 # the code common.
8 #
9 # Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
10 # SPDX-License-Identifier: BSD-2-Clause-Patent
11 #
12 #------------------------------------------------------------------------------
13
14
15
16 .text
17
18 //
19 // EMU_THUNK_PROTOCOL gaskets (EFIAPI to UNIX ABI)
20 //
21
22
23 ASM_GLOBAL ASM_PFX(GasketSecWriteStdErr)
24 ASM_PFX(GasketSecWriteStdErr):
25 pushl %ebp
26 movl %esp, %ebp
27 subl $24, %esp // sub extra 16 from the stack for alignment
28 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
29 movl 12(%ebp), %eax
30 movl %eax, 4(%esp)
31 movl 8(%ebp), %eax
32 movl %eax, (%esp)
33
34 call ASM_PFX(SecWriteStdErr)
35
36 leave
37 ret
38
39
40 ASM_GLOBAL ASM_PFX(GasketSecConfigStdIn)
41 ASM_PFX(GasketSecConfigStdIn):
42 pushl %ebp
43 movl %esp, %ebp
44 subl $24, %esp // sub extra 16 from the stack for alignment
45 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
46 movl 12(%ebp), %eax
47 movl %eax, 4(%esp)
48 movl 8(%ebp), %eax
49 movl %eax, (%esp)
50
51 call ASM_PFX(SecConfigStdIn)
52
53 leave
54 ret
55
56 ASM_GLOBAL ASM_PFX(GasketSecWriteStdOut)
57 ASM_PFX(GasketSecWriteStdOut):
58 pushl %ebp
59 movl %esp, %ebp
60 subl $24, %esp // sub extra 16 from the stack for alignment
61 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
62 movl 12(%ebp), %eax
63 movl %eax, 4(%esp)
64 movl 8(%ebp), %eax
65 movl %eax, (%esp)
66
67 call ASM_PFX(SecWriteStdOut)
68
69 leave
70 ret
71
72 ASM_GLOBAL ASM_PFX(GasketSecReadStdIn)
73 ASM_PFX(GasketSecReadStdIn):
74 pushl %ebp
75 movl %esp, %ebp
76 subl $24, %esp // sub extra 16 from the stack for alignment
77 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
78 movl 12(%ebp), %eax
79 movl %eax, 4(%esp)
80 movl 8(%ebp), %eax
81 movl %eax, (%esp)
82
83 call ASM_PFX(SecReadStdIn)
84
85 leave
86 ret
87
88 ASM_GLOBAL ASM_PFX(GasketSecPollStdIn)
89 ASM_PFX(GasketSecPollStdIn):
90 pushl %ebp
91 movl %esp, %ebp
92 subl $24, %esp // sub extra 16 from the stack for alignment
93 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
94 movl 12(%ebp), %eax
95 movl %eax, 4(%esp)
96 movl 8(%ebp), %eax
97 movl %eax, (%esp)
98
99 call ASM_PFX(SecPollStdIn)
100
101 leave
102 ret
103
104 ASM_GLOBAL ASM_PFX(GasketSecMalloc)
105 ASM_PFX(GasketSecMalloc):
106 pushl %ebp
107 movl %esp, %ebp
108 subl $24, %esp // sub extra 16 from the stack for alignment
109 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
110 movl 8(%ebp), %eax
111 movl %eax, (%esp)
112
113 call ASM_PFX(SecMalloc)
114
115 leave
116 ret
117
118 ASM_GLOBAL ASM_PFX(GasketSecValloc)
119 ASM_PFX(GasketSecValloc):
120 pushl %ebp
121 movl %esp, %ebp
122 subl $24, %esp // sub extra 16 from the stack for alignment
123 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
124 movl 8(%ebp), %eax
125 movl %eax, (%esp)
126
127 call ASM_PFX(SecValloc)
128
129 leave
130 ret
131
132 ASM_GLOBAL ASM_PFX(GasketSecFree)
133 ASM_PFX(GasketSecFree):
134 pushl %ebp
135 movl %esp, %ebp
136 subl $24, %esp // sub extra 16 from the stack for alignment
137 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
138 movl 8(%ebp), %eax
139 movl %eax, (%esp)
140
141 call ASM_PFX(SecFree)
142
143 leave
144 ret
145
146
147 ASM_GLOBAL ASM_PFX(GasketSecSetTimer)
148 ASM_PFX(GasketSecSetTimer):
149 pushl %ebp
150 movl %esp, %ebp
151 subl $40, %esp // sub extra 16 from the stack for alignment
152 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
153 movl 16(%ebp), %eax
154 movl %eax, 8(%esp)
155 movl 8(%ebp), %eax
156 movl 12(%ebp), %edx
157 movl %edx, 4(%esp)
158 movl %eax, (%esp)
159
160 call ASM_PFX(SecSetTimer)
161
162 leave
163 ret
164
165
166 ASM_GLOBAL ASM_PFX(GasketSecEnableInterrupt)
167 ASM_PFX(GasketSecEnableInterrupt):
168 pushl %ebp
169 movl %esp, %ebp
170 subl $24, %esp // sub extra 16 from the stack for alignment
171 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
172
173 call ASM_PFX(SecEnableInterrupt)
174
175 leave
176 ret
177
178
179 ASM_GLOBAL ASM_PFX(GasketSecDisableInterrupt)
180 ASM_PFX(GasketSecDisableInterrupt):
181 pushl %ebp
182 movl %esp, %ebp
183 subl $24, %esp // sub extra 16 from the stack for alignment
184 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
185
186 call ASM_PFX(SecDisableInterrupt)
187
188 leave
189 ret
190
191 ASM_GLOBAL ASM_PFX(GasketQueryPerformanceFrequency)
192 ASM_PFX(GasketQueryPerformanceFrequency):
193 pushl %ebp
194 movl %esp, %ebp
195 subl $24, %esp // sub extra 16 from the stack for alignment
196 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
197
198 call ASM_PFX(QueryPerformanceFrequency)
199
200 leave
201 ret
202
203
204 ASM_GLOBAL ASM_PFX(GasketQueryPerformanceCounter)
205 ASM_PFX(GasketQueryPerformanceCounter):
206 pushl %ebp
207 movl %esp, %ebp
208 subl $24, %esp // sub extra 16 from the stack for alignment
209 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
210
211 call ASM_PFX(QueryPerformanceCounter)
212
213 leave
214 ret
215
216
217 ASM_GLOBAL ASM_PFX(GasketSecSleep)
218 ASM_PFX(GasketSecSleep):
219 pushl %ebp
220 movl %esp, %ebp
221 subl $24, %esp // sub extra 16 from the stack for alignment
222 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
223 movl 8(%ebp), %eax
224 movl 12(%ebp), %ecx
225 movl %ecx, 4(%esp)
226 movl %eax, (%esp)
227
228 call ASM_PFX(SecSleep)
229
230 leave
231 ret
232
233
234 ASM_GLOBAL ASM_PFX(GasketSecCpuSleep)
235 ASM_PFX(GasketSecCpuSleep):
236 pushl %ebp
237 movl %esp, %ebp
238 subl $24, %esp // sub extra 16 from the stack for alignment
239 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
240
241 call ASM_PFX(SecCpuSleep)
242
243 leave
244 ret
245
246
247 ASM_GLOBAL ASM_PFX(GasketSecExit)
248 ASM_PFX(GasketSecExit):
249 pushl %ebp
250 movl %esp, %ebp
251 subl $24, %esp // sub extra 16 from the stack for alignment
252 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
253 movl 8(%ebp), %eax
254 movl %eax, (%esp)
255
256 call ASM_PFX(SecExit) // Less to do as we will never return to EFI ABI world
257 LDEAD_LOOP:
258 jmp LDEAD_LOOP // _exit should never return
259
260
261 ASM_GLOBAL ASM_PFX(GasketSecGetTime)
262 ASM_PFX(GasketSecGetTime):
263 pushl %ebp
264 movl %esp, %ebp
265 subl $24, %esp // sub extra 16 from the stack for alignment
266 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
267 movl 12(%ebp), %eax
268 movl %eax, 4(%esp)
269 movl 8(%ebp), %eax
270 movl %eax, (%esp)
271
272 call ASM_PFX(SecGetTime)
273
274 leave
275 ret
276
277 ASM_GLOBAL ASM_PFX(GasketSecSetTime)
278 ASM_PFX(GasketSecSetTime):
279 pushl %ebp
280 movl %esp, %ebp
281 subl $24, %esp // sub extra 16 from the stack for alignment
282 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
283 movl 12(%ebp), %eax
284 movl %eax, 4(%esp)
285 movl 8(%ebp), %eax
286 movl %eax, (%esp)
287
288 call ASM_PFX(SecSetTime)
289
290 leave
291 ret
292
293
294 ASM_GLOBAL ASM_PFX(GasketSecGetNextProtocol)
295 ASM_PFX(GasketSecGetNextProtocol):
296 pushl %ebp
297 movl %esp, %ebp
298 subl $40, %esp // sub extra 16 from the stack for alignment
299 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
300 movl 20(%ebp), %eax
301 movl %eax, 12(%esp)
302 movl 16(%ebp), %eax
303 movl %eax, 8(%esp)
304 movl 12(%ebp), %eax
305 movl %eax, 4(%esp)
306 movl 8(%ebp), %eax
307 movl %eax, (%esp)
308
309 call ASM_PFX(SecGetNextProtocol)
310
311 leave
312 ret
313
314 // PPIs produced by SEC
315
316 ASM_GLOBAL ASM_PFX(GasketSecPeCoffGetEntryPoint)
317 ASM_PFX(GasketSecPeCoffGetEntryPoint):
318 pushl %ebp
319 movl %esp, %ebp
320 subl $24, %esp // sub extra 16 from the stack for alignment
321 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
322 movl 12(%ebp), %eax
323 movl %eax, 4(%esp)
324 movl 8(%ebp), %eax
325 movl %eax, (%esp)
326
327 call ASM_PFX(SecPeCoffGetEntryPoint)
328
329 leave
330 ret
331
332 ASM_GLOBAL ASM_PFX(GasketSecPeCoffRelocateImageExtraAction)
333 ASM_PFX(GasketSecPeCoffRelocateImageExtraAction):
334 pushl %ebp
335 movl %esp, %ebp
336 subl $24, %esp // sub extra 16 from the stack for alignment
337 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
338 movl 8(%ebp), %eax
339 movl %eax, (%esp)
340
341 call ASM_PFX(SecPeCoffRelocateImageExtraAction)
342
343 leave
344 ret
345
346 ASM_GLOBAL ASM_PFX(GasketSecPeCoffUnloadImageExtraAction)
347 ASM_PFX(GasketSecPeCoffUnloadImageExtraAction):
348 pushl %ebp
349 movl %esp, %ebp
350 subl $24, %esp // sub extra 16 from the stack for alignment
351 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
352 movl 8(%ebp), %eax
353 movl %eax, (%esp)
354
355 call ASM_PFX(SecPeCoffUnloadImageExtraAction)
356
357 leave
358 ret
359
360
361 ASM_GLOBAL ASM_PFX(GasketSecEmuThunkAddress)
362 ASM_PFX(GasketSecEmuThunkAddress):
363 pushl %ebp
364 movl %esp, %ebp
365 subl $24, %esp // sub extra 16 from the stack for alignment
366 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
367
368 call ASM_PFX(SecEmuThunkAddress)
369
370 leave
371 ret
372
373 //
374 // Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
375 //
376
377 ASM_GLOBAL ASM_PFX(GasketX11Size)
378 ASM_PFX(GasketX11Size):
379 pushl %ebp
380 movl %esp, %ebp
381 subl $40, %esp // sub extra 16 from the stack for alignment
382 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
383 movl 20(%ebp), %eax
384 movl %eax, 12(%esp)
385 movl 16(%ebp), %eax
386 movl %eax, 8(%esp)
387 movl 12(%ebp), %eax
388 movl %eax, 4(%esp)
389 movl 8(%ebp), %eax
390 movl %eax, (%esp)
391
392 call ASM_PFX(X11Size)
393
394 leave
395 ret
396
397
398 ASM_GLOBAL ASM_PFX(GasketX11CheckKey)
399 ASM_PFX(GasketX11CheckKey):
400 pushl %ebp
401 movl %esp, %ebp
402 subl $24, %esp // sub extra 16 from the stack for alignment
403 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
404 movl 8(%ebp), %eax
405 movl %eax, (%esp)
406
407 call ASM_PFX(X11CheckKey)
408
409 leave
410 ret
411
412 ASM_GLOBAL ASM_PFX(GasketX11GetKey)
413 ASM_PFX(GasketX11GetKey):
414 pushl %ebp
415 movl %esp, %ebp
416 subl $24, %esp // sub extra 16 from the stack for alignment
417 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
418 movl 12(%ebp), %eax
419 movl %eax, 4(%esp)
420 movl 8(%ebp), %eax
421 movl %eax, (%esp)
422
423 call ASM_PFX(X11GetKey)
424
425 leave
426 ret
427
428
429 ASM_GLOBAL ASM_PFX(GasketX11KeySetState)
430 ASM_PFX(GasketX11KeySetState):
431 pushl %ebp
432 movl %esp, %ebp
433 subl $24, %esp // sub extra 16 from the stack for alignment
434 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
435 movl 12(%ebp), %eax
436 movl %eax, 4(%esp)
437 movl 8(%ebp), %eax
438 movl %eax, (%esp)
439
440 call ASM_PFX(X11KeySetState)
441
442 leave
443 ret
444
445
446 ASM_GLOBAL ASM_PFX(GasketX11RegisterKeyNotify)
447 ASM_PFX(GasketX11RegisterKeyNotify):
448 pushl %ebp
449 movl %esp, %ebp
450 subl $40, %esp // sub extra 16 from the stack for alignment
451 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
452 movl 20(%ebp), %eax
453 movl %eax, 12(%esp)
454 movl 16(%ebp), %eax
455 movl %eax, 8(%esp)
456 movl 12(%ebp), %eax
457 movl %eax, 4(%esp)
458 movl 8(%ebp), %eax
459 movl %eax, (%esp)
460
461 call ASM_PFX(X11RegisterKeyNotify)
462
463 leave
464 ret
465
466
467 ASM_GLOBAL ASM_PFX(GasketX11Blt)
468 ASM_PFX(GasketX11Blt):
469 pushl %ebp
470 movl %esp, %ebp
471 subl $40, %esp // sub extra 16 from the stack for alignment
472 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
473 movl 20(%ebp), %eax
474 movl %eax, 12(%esp)
475 movl 16(%ebp), %eax
476 movl %eax, 8(%esp)
477 movl 12(%ebp), %eax
478 movl %eax, 4(%esp)
479 movl 8(%ebp), %eax
480 movl %eax, (%esp)
481
482 call ASM_PFX(X11Blt)
483
484 leave
485 ret
486
487
488 ASM_GLOBAL ASM_PFX(GasketX11CheckPointer)
489 ASM_PFX(GasketX11CheckPointer):
490 pushl %ebp
491 movl %esp, %ebp
492 subl $24, %esp // sub extra 16 from the stack for alignment
493 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
494 movl 8(%ebp), %eax
495 movl %eax, (%esp)
496
497 call ASM_PFX(X11CheckPointer)
498
499 leave
500 ret
501
502
503 ASM_GLOBAL ASM_PFX(GasketX11GetPointerState)
504 ASM_PFX(GasketX11GetPointerState):
505 pushl %ebp
506 movl %esp, %ebp
507 subl $24, %esp // sub extra 16 from the stack for alignment
508 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
509 movl 12(%ebp), %eax
510 movl %eax, 4(%esp)
511 movl 8(%ebp), %eax
512 movl %eax, (%esp)
513
514 call ASM_PFX(X11GetPointerState)
515
516 leave
517 ret
518
519
520 ASM_GLOBAL ASM_PFX(GasketX11GraphicsWindowOpen)
521 ASM_PFX(GasketX11GraphicsWindowOpen):
522 pushl %ebp
523 movl %esp, %ebp
524 subl $24, %esp // sub extra 16 from the stack for alignment
525 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
526 movl 8(%ebp), %eax
527 movl %eax, (%esp)
528
529 call ASM_PFX(X11GraphicsWindowOpen)
530
531 leave
532 ret
533
534
535 ASM_GLOBAL ASM_PFX(GasketX11GraphicsWindowClose)
536 ASM_PFX(GasketX11GraphicsWindowClose):
537 pushl %ebp
538 movl %esp, %ebp
539 subl $24, %esp // sub extra 16 from the stack for alignment
540 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
541 movl 12(%ebp), %eax
542 movl %eax, 4(%esp)
543 movl 8(%ebp), %eax
544 movl %eax, (%esp)
545
546 call ASM_PFX(X11GraphicsWindowClose)
547
548 leave
549 ret
550
551
552 // Pthreads
553
554 ASM_GLOBAL ASM_PFX(GasketPthreadMutexLock)
555 ASM_PFX(GasketPthreadMutexLock):
556 pushl %ebp
557 movl %esp, %ebp
558 subl $24, %esp // sub extra 16 from the stack for alignment
559 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
560 movl 8(%ebp), %eax
561 movl %eax, (%esp)
562
563 call ASM_PFX(PthreadMutexLock)
564
565 leave
566 ret
567
568
569 ASM_GLOBAL ASM_PFX(GasketPthreadMutexUnLock)
570 ASM_PFX(GasketPthreadMutexUnLock):
571 pushl %ebp
572 movl %esp, %ebp
573 subl $24, %esp // sub extra 16 from the stack for alignment
574 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
575 movl 8(%ebp), %eax
576 movl %eax, (%esp)
577
578 call ASM_PFX(PthreadMutexUnLock)
579
580 leave
581 ret
582
583 ASM_GLOBAL ASM_PFX(GasketPthreadMutexTryLock)
584 ASM_PFX(GasketPthreadMutexTryLock):
585 pushl %ebp
586 movl %esp, %ebp
587 subl $24, %esp // sub extra 16 from the stack for alignment
588 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
589 movl 8(%ebp), %eax
590 movl %eax, (%esp)
591
592 call ASM_PFX(PthreadMutexTryLock)
593
594 leave
595 ret
596
597 ASM_GLOBAL ASM_PFX(GasketPthreadMutexInit)
598 ASM_PFX(GasketPthreadMutexInit):
599 pushl %ebp
600 movl %esp, %ebp
601 subl $24, %esp // sub extra 16 from the stack for alignment
602 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
603
604 call ASM_PFX(PthreadMutexInit)
605
606 leave
607 ret
608
609
610
611 ASM_GLOBAL ASM_PFX(GasketPthreadMutexDestroy)
612 ASM_PFX(GasketPthreadMutexDestroy):
613 pushl %ebp
614 movl %esp, %ebp
615 subl $24, %esp // sub extra 16 from the stack for alignment
616 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
617 movl 8(%ebp), %eax
618 movl %eax, (%esp)
619
620 call ASM_PFX(PthreadMutexDestroy)
621
622 leave
623 ret
624
625
626 ASM_GLOBAL ASM_PFX(GasketPthreadCreate)
627 ASM_PFX(GasketPthreadCreate):
628 pushl %ebp
629 movl %esp, %ebp
630 subl $40, %esp // sub extra 16 from the stack for alignment
631 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
632 movl 20(%ebp), %eax
633 movl %eax, 12(%esp)
634 movl 16(%ebp), %eax
635 movl %eax, 8(%esp)
636 movl 12(%ebp), %eax
637 movl %eax, 4(%esp)
638 movl 8(%ebp), %eax
639 movl %eax, (%esp)
640
641 call ASM_PFX(PthreadCreate)
642
643 leave
644 ret
645
646
647 ASM_GLOBAL ASM_PFX(GasketPthreadExit)
648 ASM_PFX(GasketPthreadExit):
649 pushl %ebp
650 movl %esp, %ebp
651 subl $24, %esp // sub extra 16 from the stack for alignment
652 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
653 movl 8(%ebp), %eax
654 movl %eax, (%esp)
655
656 call ASM_PFX(PthreadExit)
657
658 leave
659 ret
660
661
662
663 ASM_GLOBAL ASM_PFX(GasketPthreadSelf)
664 ASM_PFX(GasketPthreadSelf):
665 pushl %ebp
666 movl %esp, %ebp
667 subl $24, %esp // sub extra 16 from the stack for alignment
668 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
669
670 call ASM_PFX(PthreadSelf)
671
672 leave
673 ret
674
675
676 ASM_GLOBAL ASM_PFX(GasketPthreadOpen)
677 ASM_PFX(GasketPthreadOpen):
678 pushl %ebp
679 movl %esp, %ebp
680 subl $24, %esp // sub extra 16 from the stack for alignment
681 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
682 movl 8(%ebp), %eax
683 movl %eax, (%esp)
684
685 call ASM_PFX(PthreadOpen)
686
687 leave
688 ret
689
690
691 ASM_GLOBAL ASM_PFX(GasketPthreadClose)
692 ASM_PFX(GasketPthreadClose):
693 pushl %ebp
694 movl %esp, %ebp
695 subl $24, %esp // sub extra 16 from the stack for alignment
696 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
697 movl 8(%ebp), %eax
698 movl %eax, (%esp)
699
700 call ASM_PFX(PthreadClose)
701
702 leave
703 ret
704
705
706
707
708 //
709 // UNIX ABI to EFI ABI call
710 //
711 // UINTN
712 // ReverseGasketUint64 (
713 // void *Api,
714 // UINTN Arg1
715 // );
716 ASM_GLOBAL ASM_PFX(ReverseGasketUint64)
717 ASM_PFX(ReverseGasketUint64):
718 pushl %ebp
719 movl %esp, %ebp
720 subl $8, %esp
721 movl 16(%ebp), %eax
722 movl %eax, 4(%esp)
723 movl 12(%ebp), %eax
724 movl %eax, (%esp)
725 calll *8(%ebp)
726 addl $8, %esp
727 popl %ebp
728 ret
729
730
731
732 //
733 // UNIX ABI to EFI ABI call
734 //
735 // UINTN
736 // ReverseGasketUint64Uint64 (
737 // void *Api,
738 // UINTN Arg1
739 // UINTN Arg2
740 // );
741 ASM_GLOBAL ASM_PFX(ReverseGasketUint64Uint64)
742 ASM_PFX(ReverseGasketUint64Uint64):
743 pushl %ebp
744 movl %esp, %ebp
745 subl $24, %esp
746 movl 24(%ebp), %eax
747 movl %eax, 12(%esp)
748 movl 20(%ebp), %eax
749 movl %eax, 8(%esp)
750 movl 16(%ebp), %eax
751 movl %eax, 4(%esp)
752 movl 12(%ebp), %eax
753 movl %eax, (%esp)
754 calll *8(%ebp)
755 addl $24, %esp
756 popl %ebp
757 ret
758
759
760 ASM_GLOBAL ASM_PFX(GasketSecUnixPeiAutoScan)
761 ASM_PFX(GasketSecUnixPeiAutoScan):
762 pushl %ebp
763 movl %esp, %ebp
764 subl $40, %esp // sub extra 16 from the stack for alignment
765 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
766 movl 16(%ebp), %eax
767 movl %eax, 8(%esp)
768 movl 12(%ebp), %eax
769 movl %eax, 4(%esp)
770 movl 8(%ebp), %eax
771 movl %eax, (%esp)
772
773 call ASM_PFX(SecUnixPeiAutoScan)
774
775 leave
776 ret
777
778
779 ASM_GLOBAL ASM_PFX(GasketSecUnixFdAddress)
780 ASM_PFX(GasketSecUnixFdAddress):
781 pushl %ebp
782 movl %esp, %ebp
783 subl $40, %esp // sub extra 16 from the stack for alignment
784 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
785 movl 20(%ebp), %eax
786 movl %eax, 12(%esp)
787 movl 16(%ebp), %eax
788 movl %eax, 8(%esp)
789 movl 12(%ebp), %eax
790 movl %eax, 4(%esp)
791 movl 8(%ebp), %eax
792 movl %eax, (%esp)
793
794 call ASM_PFX(SecUnixFdAddress)
795
796 leave
797 ret
798
799
800 // EmuIoThunk SimpleFileSystem
801
802 ASM_GLOBAL ASM_PFX(GasketPosixOpenVolume)
803 ASM_PFX(GasketPosixOpenVolume):
804 pushl %ebp
805 movl %esp, %ebp
806 subl $40, %esp // sub extra 16 from the stack for alignment
807 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
808 movl 20(%ebp), %eax
809 movl %eax, 12(%esp)
810 movl 16(%ebp), %eax
811 movl %eax, 8(%esp)
812 movl 12(%ebp), %eax
813 movl %eax, 4(%esp)
814 movl 8(%ebp), %eax
815 movl %eax, (%esp)
816
817 call ASM_PFX(PosixOpenVolume)
818
819 leave
820 ret
821
822
823 ASM_GLOBAL ASM_PFX(GasketPosixFileOpen)
824 ASM_PFX(GasketPosixFileOpen):
825 pushl %ebp
826 movl %esp, %ebp
827 subl $56, %esp // sub extra 16 from the stack for alignment
828 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
829 movl 28(%ebp), %eax
830 movl 32(%ebp), %ecx
831 movl %ecx, 24(%esp)
832 movl %eax, 20(%esp)
833 movl 20(%ebp), %eax
834 movl 24(%ebp), %ecx
835 movl %ecx, 16(%esp)
836 movl %eax, 12(%esp)
837 movl 16(%ebp), %eax
838 movl %eax, 8(%esp)
839 movl 12(%ebp), %eax
840 movl %eax, 4(%esp)
841 movl 8(%ebp), %eax
842 movl %eax, (%esp)
843
844 call ASM_PFX(PosixFileOpen)
845
846 leave
847 ret
848
849
850 ASM_GLOBAL ASM_PFX(GasketPosixFileCLose)
851 ASM_PFX(GasketPosixFileCLose):
852 pushl %ebp
853 movl %esp, %ebp
854 subl $24, %esp // sub extra 16 from the stack for alignment
855 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
856 movl 8(%ebp), %eax
857 movl %eax, (%esp)
858
859 call ASM_PFX(PosixFileCLose)
860
861 leave
862 ret
863
864
865 ASM_GLOBAL ASM_PFX(GasketPosixFileDelete)
866 ASM_PFX(GasketPosixFileDelete):
867 pushl %ebp
868 movl %esp, %ebp
869 subl $24, %esp // sub extra 16 from the stack for alignment
870 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
871 movl 8(%ebp), %eax
872 movl %eax, (%esp)
873
874 call ASM_PFX(PosixFileDelete)
875
876 leave
877 ret
878
879
880 ASM_GLOBAL ASM_PFX(GasketPosixFileRead)
881 ASM_PFX(GasketPosixFileRead):
882 pushl %ebp
883 movl %esp, %ebp
884 subl $40, %esp // sub extra 16 from the stack for alignment
885 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
886 movl 16(%ebp), %eax
887 movl %eax, 8(%esp)
888 movl 12(%ebp), %eax
889 movl %eax, 4(%esp)
890 movl 8(%ebp), %eax
891 movl %eax, (%esp)
892
893 call ASM_PFX(PosixFileRead)
894
895 leave
896 ret
897
898
899 ASM_GLOBAL ASM_PFX(GasketPosixFileWrite)
900 ASM_PFX(GasketPosixFileWrite):
901 pushl %ebp
902 movl %esp, %ebp
903 subl $40, %esp // sub extra 16 from the stack for alignment
904 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
905 movl 16(%ebp), %eax
906 movl %eax, 8(%esp)
907 movl 12(%ebp), %eax
908 movl %eax, 4(%esp)
909 movl 8(%ebp), %eax
910 movl %eax, (%esp)
911
912 call ASM_PFX(PosixFileWrite)
913
914 leave
915 ret
916
917
918 ASM_GLOBAL ASM_PFX(GasketPosixFileSetPossition)
919 ASM_PFX(GasketPosixFileSetPossition):
920 pushl %ebp
921 movl %esp, %ebp
922 subl $40, %esp // sub extra 16 from the stack for alignment
923 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
924 movl 12(%ebp), %eax
925 movl 16(%ebp), %ecx
926 movl %ecx, 8(%esp)
927 movl %eax, 4(%esp)
928 movl 8(%ebp), %eax
929 movl %eax, (%esp)
930
931 call ASM_PFX(PosixFileSetPossition)
932
933 leave
934 ret
935
936
937 ASM_GLOBAL ASM_PFX(GasketPosixFileGetPossition)
938 ASM_PFX(GasketPosixFileGetPossition):
939 pushl %ebp
940 movl %esp, %ebp
941 subl $24, %esp // sub extra 16 from the stack for alignment
942 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
943 movl 12(%ebp), %eax
944 movl %eax, 4(%esp)
945 movl 8(%ebp), %eax
946 movl %eax, (%esp)
947
948 call ASM_PFX(PosixFileGetPossition)
949
950 leave
951 ret
952
953
954 ASM_GLOBAL ASM_PFX(GasketPosixFileGetInfo)
955 ASM_PFX(GasketPosixFileGetInfo):
956 pushl %ebp
957 movl %esp, %ebp
958 subl $40, %esp // sub extra 16 from the stack for alignment
959 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
960 movl 20(%ebp), %eax
961 movl %eax, 12(%esp)
962 movl 16(%ebp), %eax
963 movl %eax, 8(%esp)
964 movl 12(%ebp), %eax
965 movl %eax, 4(%esp)
966 movl 8(%ebp), %eax
967 movl %eax, (%esp)
968
969 call ASM_PFX(PosixFileGetInfo)
970
971 leave
972 ret
973
974
975 ASM_GLOBAL ASM_PFX(GasketPosixFileSetInfo)
976 ASM_PFX(GasketPosixFileSetInfo):
977 pushl %ebp
978 movl %esp, %ebp
979 subl $40, %esp // sub extra 16 from the stack for alignment
980 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
981 movl 20(%ebp), %eax
982 movl %eax, 12(%esp)
983 movl 16(%ebp), %eax
984 movl %eax, 8(%esp)
985 movl 12(%ebp), %eax
986 movl %eax, 4(%esp)
987 movl 8(%ebp), %eax
988 movl %eax, (%esp)
989
990 call ASM_PFX(PosixFileSetInfo)
991
992 leave
993 ret
994
995
996 ASM_GLOBAL ASM_PFX(GasketPosixFileFlush)
997 ASM_PFX(GasketPosixFileFlush):
998 pushl %ebp
999 movl %esp, %ebp
1000 subl $24, %esp // sub extra 16 from the stack for alignment
1001 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1002 movl 8(%ebp), %eax
1003 movl %eax, (%esp)
1004
1005 call ASM_PFX(PosixFileFlush)
1006
1007 leave
1008 ret
1009
1010
1011 ASM_GLOBAL ASM_PFX(GasketPosixFileSystmeThunkOpen)
1012 ASM_PFX(GasketPosixFileSystmeThunkOpen):
1013 pushl %ebp
1014 movl %esp, %ebp
1015 subl $24, %esp // sub extra 16 from the stack for alignment
1016 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1017 movl 8(%ebp), %eax
1018 movl %eax, (%esp)
1019
1020 call ASM_PFX(PosixFileSystmeThunkOpen)
1021
1022 leave
1023 ret
1024
1025
1026 ASM_GLOBAL ASM_PFX(GasketPosixFileSystmeThunkClose)
1027 ASM_PFX(GasketPosixFileSystmeThunkClose):
1028 pushl %ebp
1029 movl %esp, %ebp
1030 subl $24, %esp // sub extra 16 from the stack for alignment
1031 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1032 movl 8(%ebp), %eax
1033 movl %eax, (%esp)
1034
1035 call ASM_PFX(PosixFileSystmeThunkClose)
1036
1037 leave
1038 ret
1039
1040 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoReset)
1041 ASM_PFX(GasketEmuBlockIoReset):
1042 pushl %ebp
1043 movl %esp, %ebp
1044 subl $24, %esp // sub extra 16 from the stack for alignment
1045 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1046 movl 12(%ebp), %eax
1047 movl %eax, 4(%esp)
1048 movl 8(%ebp), %eax
1049 movl %eax, (%esp)
1050
1051 call ASM_PFX(EmuBlockIoReset)
1052
1053 leave
1054 ret
1055
1056
1057 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoReadBlocks)
1058 ASM_PFX(GasketEmuBlockIoReadBlocks):
1059 pushl %ebp
1060 movl %esp, %ebp
1061 subl $56, %esp // sub extra 16 from the stack for alignment
1062 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1063 movl 32(%ebp), %eax
1064 movl %eax, 24(%esp)
1065 movl 28(%ebp), %eax
1066 movl %eax, 20(%esp)
1067 movl 24(%ebp), %eax
1068 movl %eax, 16(%esp)
1069 movl 16(%ebp), %eax
1070 movl 20(%ebp), %edx
1071 movl %edx, 12(%esp)
1072 movl %eax, 8(%esp)
1073 movl 12(%ebp), %eax
1074 movl %eax, 4(%esp)
1075 movl 8(%ebp), %eax
1076 movl %eax, (%esp)
1077
1078 call ASM_PFX(EmuBlockIoReadBlocks)
1079
1080 leave
1081 ret
1082
1083
1084 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoWriteBlocks)
1085 ASM_PFX(GasketEmuBlockIoWriteBlocks):
1086 pushl %ebp
1087 movl %esp, %ebp
1088 subl $56, %esp // sub extra 16 from the stack for alignment
1089 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1090 movl 32(%ebp), %eax
1091 movl %eax, 24(%esp)
1092 movl 28(%ebp), %eax
1093 movl %eax, 20(%esp)
1094 movl 24(%ebp), %eax
1095 movl %eax, 16(%esp)
1096 movl 16(%ebp), %eax
1097 movl 20(%ebp), %edx
1098 movl %edx, 12(%esp)
1099 movl %eax, 8(%esp)
1100 movl 12(%ebp), %eax
1101 movl %eax, 4(%esp)
1102 movl 8(%ebp), %eax
1103 movl %eax, (%esp)
1104
1105 call ASM_PFX(EmuBlockIoWriteBlocks)
1106
1107 leave
1108 ret
1109
1110
1111 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoFlushBlocks)
1112 ASM_PFX(GasketEmuBlockIoFlushBlocks): pushl %ebp
1113 movl %esp, %ebp
1114 subl $24, %esp // sub extra 16 from the stack for alignment
1115 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1116 movl 12(%ebp), %eax
1117 movl %eax, 4(%esp)
1118 movl 8(%ebp), %eax
1119 movl %eax, (%esp)
1120
1121
1122 call ASM_PFX(EmuBlockIoFlushBlocks)
1123
1124 leave
1125 ret
1126
1127
1128 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoCreateMapping)
1129 ASM_PFX(GasketEmuBlockIoCreateMapping):
1130 pushl %ebp
1131 movl %esp, %ebp
1132 subl $24, %esp // sub extra 16 from the stack for alignment
1133 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1134 movl 12(%ebp), %eax
1135 movl %eax, 4(%esp)
1136 movl 8(%ebp), %eax
1137 movl %eax, (%esp)
1138
1139 call ASM_PFX(EmuBlockIoCreateMapping)
1140
1141 leave
1142 ret
1143
1144
1145 ASM_GLOBAL ASM_PFX(GasketBlockIoThunkOpen)
1146 ASM_PFX(GasketBlockIoThunkOpen):
1147 pushl %ebp
1148 movl %esp, %ebp
1149 subl $24, %esp // sub extra 16 from the stack for alignment
1150 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1151 movl 8(%ebp), %eax
1152 movl %eax, (%esp)
1153
1154 call ASM_PFX(EmuBlockIoThunkOpen)
1155
1156 leave
1157 ret
1158
1159
1160 ASM_GLOBAL ASM_PFX(GasketBlockIoThunkClose)
1161 ASM_PFX(GasketBlockIoThunkClose):
1162 pushl %ebp
1163 movl %esp, %ebp
1164 subl $24, %esp // sub extra 16 from the stack for alignment
1165 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1166 movl 8(%ebp), %eax
1167 movl %eax, (%esp)
1168
1169 call ASM_PFX(EmuBlockIoThunkClose)
1170
1171 leave
1172 ret
1173
1174
1175
1176 ASM_GLOBAL ASM_PFX(GasketSnpCreateMapping)
1177 ASM_PFX(GasketSnpCreateMapping):
1178 pushl %ebp
1179 movl %esp, %ebp
1180 subl $24, %esp // sub extra 16 from the stack for alignment
1181 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1182 movl 12(%ebp), %eax
1183 movl %eax, 4(%esp)
1184 movl 8(%ebp), %eax
1185 movl %eax, (%esp)
1186
1187 call ASM_PFX(EmuSnpCreateMapping)
1188
1189 leave
1190 ret
1191
1192
1193 ASM_GLOBAL ASM_PFX(GasketSnpStart)
1194 ASM_PFX(GasketSnpStart):
1195 pushl %ebp
1196 movl %esp, %ebp
1197 subl $24, %esp // sub extra 16 from the stack for alignment
1198 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1199 movl 8(%ebp), %eax
1200 movl %eax, (%esp)
1201
1202 call ASM_PFX(EmuSnpStart)
1203
1204 leave
1205 ret
1206
1207
1208 ASM_GLOBAL ASM_PFX(GasketSnpStop)
1209 ASM_PFX(GasketSnpStop):
1210 pushl %ebp
1211 movl %esp, %ebp
1212 subl $24, %esp // sub extra 16 from the stack for alignment
1213 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1214 movl 8(%ebp), %eax
1215 movl %eax, (%esp)
1216
1217 call ASM_PFX(EmuSnpStop)
1218
1219 leave
1220 ret
1221
1222
1223 ASM_GLOBAL ASM_PFX(GasketSnpInitialize)
1224 ASM_PFX(GasketSnpInitialize):
1225 pushl %ebp
1226 movl %esp, %ebp
1227 subl $40, %esp // sub extra 16 from the stack for alignment
1228 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1229 movl 16(%ebp), %eax
1230 movl %eax, 8(%esp)
1231 movl 12(%ebp), %eax
1232 movl %eax, 4(%esp)
1233 movl 8(%ebp), %eax
1234 movl %eax, (%esp)
1235
1236 call ASM_PFX(EmuSnpInitialize)
1237
1238 leave
1239 ret
1240
1241
1242 ASM_GLOBAL ASM_PFX(GasketSnpReset)
1243 ASM_PFX(GasketSnpReset):
1244 pushl %ebp
1245 movl %esp, %ebp
1246 subl $24, %esp // sub extra 16 from the stack for alignment
1247 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1248 movl 12(%ebp), %eax
1249 movl %eax, 4(%esp)
1250 movl 8(%ebp), %eax
1251 movl %eax, (%esp)
1252
1253 call ASM_PFX(EmuSnpReset)
1254
1255 leave
1256 ret
1257
1258
1259 ASM_GLOBAL ASM_PFX(GasketSnpShutdown)
1260 ASM_PFX(GasketSnpShutdown):
1261 pushl %ebp
1262 movl %esp, %ebp
1263 subl $24, %esp // sub extra 16 from the stack for alignment
1264 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1265 movl 8(%ebp), %eax
1266 movl %eax, (%esp)
1267
1268 call ASM_PFX(EmuSnpShutdown)
1269
1270 leave
1271 ret
1272
1273
1274 ASM_GLOBAL ASM_PFX(GasketSnpReceiveFilters)
1275 ASM_PFX(GasketSnpReceiveFilters):
1276 pushl %ebp
1277 movl %esp, %ebp
1278 subl $40, %esp // sub extra 16 from the stack for alignment
1279 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1280 movl 28(%ebp), %eax
1281 movl %eax, 20(%esp)
1282 movl 24(%ebp), %eax
1283 movl %eax, 16(%esp)
1284 movl 20(%ebp), %eax
1285 movl %eax, 12(%esp)
1286 movl 16(%ebp), %eax
1287 movl %eax, 8(%esp)
1288 movl 12(%ebp), %eax
1289 movl %eax, 4(%esp)
1290 movl 8(%ebp), %eax
1291 movl %eax, (%esp)
1292
1293 call ASM_PFX(EmuSnpReceiveFilters)
1294
1295 leave
1296 ret
1297
1298
1299 ASM_GLOBAL ASM_PFX(GasketSnpStationAddress)
1300 ASM_PFX(GasketSnpStationAddress):
1301 pushl %ebp
1302 movl %esp, %ebp
1303 subl $40, %esp // sub extra 16 from the stack for alignment
1304 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1305 movl 16(%ebp), %eax
1306 movl %eax, 8(%esp)
1307 movl 12(%ebp), %eax
1308 movl %eax, 4(%esp)
1309 movl 8(%ebp), %eax
1310 movl %eax, (%esp)
1311
1312 leave
1313 ret
1314
1315
1316
1317 ASM_GLOBAL ASM_PFX(GasketSnpStatistics)
1318 ASM_PFX(GasketSnpStatistics):
1319 pushl %ebp
1320 movl %esp, %ebp
1321 subl $40, %esp // sub extra 16 from the stack for alignment
1322 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1323 movl 20(%ebp), %eax
1324 movl %eax, 12(%esp)
1325 movl 16(%ebp), %eax
1326 movl %eax, 8(%esp)
1327 movl 12(%ebp), %eax
1328 movl %eax, 4(%esp)
1329 movl 8(%ebp), %eax
1330 movl %eax, (%esp)
1331
1332 call ASM_PFX(EmuSnpStatistics)
1333
1334 leave
1335 ret
1336
1337
1338 ASM_GLOBAL ASM_PFX(GasketSnpMCastIpToMac)
1339 ASM_PFX(GasketSnpMCastIpToMac):
1340 pushl %ebp
1341 movl %esp, %ebp
1342 subl $40, %esp // sub extra 16 from the stack for alignment
1343 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1344 movl 20(%ebp), %eax
1345 movl %eax, 12(%esp)
1346 movl 16(%ebp), %eax
1347 movl %eax, 8(%esp)
1348 movl 12(%ebp), %eax
1349 movl %eax, 4(%esp)
1350 movl 8(%ebp), %eax
1351 movl %eax, (%esp)
1352
1353 call ASM_PFX(EmuSnpMCastIpToMac)
1354
1355 leave
1356 ret
1357
1358
1359 ASM_GLOBAL ASM_PFX(GasketSnpNvData)
1360 ASM_PFX(GasketSnpNvData):
1361 pushl %ebp
1362 movl %esp, %ebp
1363 subl $40, %esp // sub extra 16 from the stack for alignment
1364 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1365 movl 24(%ebp), %eax
1366 movl %eax, 16(%esp)
1367 movl 20(%ebp), %eax
1368 movl %eax, 12(%esp)
1369 movl 16(%ebp), %eax
1370 movl %eax, 8(%esp)
1371 movl 12(%ebp), %eax
1372 movl %eax, 4(%esp)
1373 movl 8(%ebp), %eax
1374 movl %eax, (%esp)
1375
1376 call ASM_PFX(EmuSnpNvData)
1377
1378 leave
1379 ret
1380
1381
1382 ASM_GLOBAL ASM_PFX(GasketSnpGetStatus)
1383 ASM_PFX(GasketSnpGetStatus):
1384 pushl %ebp
1385 movl %esp, %ebp
1386 subl $40, %esp // sub extra 16 from the stack for alignment
1387 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1388 movl 16(%ebp), %eax
1389 movl %eax, 8(%esp)
1390 movl 12(%ebp), %eax
1391 movl %eax, 4(%esp)
1392 movl 8(%ebp), %eax
1393 movl %eax, (%esp)
1394
1395 call ASM_PFX(EmuSnpGetStatus)
1396
1397 leave
1398 ret
1399
1400
1401
1402 ASM_GLOBAL ASM_PFX(GasketSnpTransmit)
1403 ASM_PFX(GasketSnpTransmit):
1404 pushl %ebp
1405 movl %esp, %ebp
1406 subl $56, %esp // sub extra 16 from the stack for alignment
1407 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1408 movl 32(%ebp), %eax
1409 movl %eax, 24(%esp)
1410 movl 28(%ebp), %eax
1411 movl %eax, 20(%esp)
1412 movl 24(%ebp), %eax
1413 movl %eax, 16(%esp)
1414 movl 20(%ebp), %eax
1415 movl %eax, 12(%esp)
1416 movl 16(%ebp), %eax
1417 movl %eax, 8(%esp)
1418 movl 12(%ebp), %eax
1419 movl %eax, 4(%esp)
1420 movl 8(%ebp), %eax
1421 movl %eax, (%esp)
1422
1423 call ASM_PFX(EmuSnpTransmit)
1424
1425 leave
1426 ret
1427
1428
1429
1430 ASM_GLOBAL ASM_PFX(GasketSnpReceive)
1431 ASM_PFX(GasketSnpReceive):
1432 pushl %ebp
1433 movl %esp, %ebp
1434 subl $56, %esp // sub extra 16 from the stack for alignment
1435 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1436 movl 32(%ebp), %eax
1437 movl %eax, 24(%esp)
1438 movl 28(%ebp), %eax
1439 movl %eax, 20(%esp)
1440 movl 24(%ebp), %eax
1441 movl %eax, 16(%esp)
1442 movl 20(%ebp), %eax
1443 movl %eax, 12(%esp)
1444 movl 16(%ebp), %eax
1445 movl %eax, 8(%esp)
1446 movl 12(%ebp), %eax
1447 movl %eax, 4(%esp)
1448 movl 8(%ebp), %eax
1449 movl %eax, (%esp)
1450
1451 call ASM_PFX(EmuSnpReceive)
1452
1453 leave
1454 ret
1455
1456
1457 ASM_GLOBAL ASM_PFX(GasketSnpThunkOpen)
1458 ASM_PFX(GasketSnpThunkOpen):
1459 pushl %ebp
1460 movl %esp, %ebp
1461 subl $24, %esp // sub extra 16 from the stack for alignment
1462 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1463 movl 8(%ebp), %eax
1464 movl %eax, (%esp)
1465
1466 call ASM_PFX(EmuSnpThunkOpen)
1467
1468 leave
1469 ret
1470
1471
1472 ASM_GLOBAL ASM_PFX(GasketSnpThunkClose)
1473 ASM_PFX(GasketSnpThunkClose):
1474 pushl %ebp
1475 movl %esp, %ebp
1476 subl $24, %esp // sub extra 16 from the stack for alignment
1477 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call
1478 movl 8(%ebp), %eax
1479 movl %eax, (%esp)
1480
1481 call ASM_PFX(EmuSnpThunkClose)
1482
1483 leave
1484 ret
1485
1486