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