1 #------------------------------------------------------------------------------
3 # Manage differenced between UNIX ABI and EFI/Windows ABI
5 # EFI Arg passing: RCX, RDX, R8, R9
6 # Callee allocates 32 bytes on stack to spill registers
7 # UNIX Arg passing: RDI, RSI, RDX, RCX, R8, R9
8 # RSI, RDI calle-save on EFI, scatch on UNIX callign
10 # Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
11 # This program and the accompanying materials
12 # are licensed and made available under the terms and conditions of the BSD License
13 # which accompanies this distribution. The full text of the license may be found at
14 # http://opensource.org/licenses/bsd-license.php
16 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #------------------------------------------------------------------------------
22 // Gaskets are EFI ABI to UNIX ABI calls
23 // EFI ABI code will sub 40 (0x28) from %rsp before calling a function
24 // This is the 32 (0x20) byte to spill registers and 8 bytes to align stack on 16 byte boundry.
28 // 32 byte shadow to spill rcx-r9, 8 bytes to align stack on 16 byte boundry
29 // Any call with 0 - 4 arguments allocates 40 bytes on the stack.
30 // For more than 4 args you always have to increase in quanta of 16 so 5 or 6 args is 56,
31 // 7 or 8 args is 72, and 9 or 10 args is 88
38 // EMU_THUNK_PROTOCOL gaskets (EFIAPI to UNIX ABI)
44 ASM_GLOBAL ASM_PFX(GasketSecWriteStdErr)
45 ASM_PFX(GasketSecWriteStdErr):
46 pushq %rbp // stack frame is for the debugger
49 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
52 movq %rcx, %rdi // Swizzle args
55 call ASM_PFX(SecWriteStdErr)
57 popq %rdi // restore state
63 ASM_GLOBAL ASM_PFX(GasketSecConfigStdIn)
64 ASM_PFX(GasketSecConfigStdIn):
65 pushq %rbp // stack frame is for the debugger
68 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
71 call ASM_PFX(SecConfigStdIn)
73 popq %rdi // restore state
78 ASM_GLOBAL ASM_PFX(GasketSecWriteStdOut)
79 ASM_PFX(GasketSecWriteStdOut):
80 pushq %rbp // stack frame is for the debugger
83 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
86 movq %rcx, %rdi // Swizzle args
89 call ASM_PFX(SecWriteStdOut)
91 popq %rdi // restore state
96 ASM_GLOBAL ASM_PFX(GasketSecReadStdIn)
97 ASM_PFX(GasketSecReadStdIn):
98 pushq %rbp // stack frame is for the debugger
101 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
104 movq %rcx, %rdi // Swizzle args
107 call ASM_PFX(SecReadStdIn)
109 popq %rdi // restore state
114 ASM_GLOBAL ASM_PFX(GasketSecPollStdIn)
115 ASM_PFX(GasketSecPollStdIn):
116 pushq %rbp // stack frame is for the debugger
119 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
122 call ASM_PFX(SecPollStdIn)
124 popq %rdi // restore state
129 ASM_GLOBAL ASM_PFX(GasketSecMalloc)
130 ASM_PFX(GasketSecMalloc):
131 pushq %rbp // stack frame is for the debugger
134 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
136 call ASM_PFX(SecMalloc)
138 popq %rdi // restore state
143 ASM_GLOBAL ASM_PFX(GasketSecFree)
144 ASM_PFX(GasketSecFree):
145 pushq %rbp // stack frame is for the debugger
148 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
150 call ASM_PFX(SecFree)
152 popq %rdi // restore state
158 ASM_GLOBAL ASM_PFX(GasketSecSetTimer)
159 ASM_PFX(GasketSecSetTimer):
160 pushq %rbp // stack frame is for the debugger
163 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
166 movq %rcx, %rdi // Swizzle args
169 call ASM_PFX(SecSetTimer)
171 popq %rdi // restore state
177 ASM_GLOBAL ASM_PFX(GasketSecEnableInterrupt)
178 ASM_PFX(GasketSecEnableInterrupt):
179 pushq %rbp // stack frame is for the debugger
182 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
185 call ASM_PFX(SecEnableInterrupt)
187 popq %rdi // restore state
193 ASM_GLOBAL ASM_PFX(GasketSecDisableInterrupt)
194 ASM_PFX(GasketSecDisableInterrupt):
195 pushq %rbp // stack frame is for the debugger
198 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
201 call ASM_PFX(SecDisableInterrupt)
203 popq %rdi // restore state
208 ASM_GLOBAL ASM_PFX(GasketQueryPerformanceFrequency)
209 ASM_PFX(GasketQueryPerformanceFrequency):
210 pushq %rbp // stack frame is for the debugger
213 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
216 call ASM_PFX(QueryPerformanceFrequency)
218 popq %rdi // restore state
224 ASM_GLOBAL ASM_PFX(GasketQueryPerformanceCounter)
225 ASM_PFX(GasketQueryPerformanceCounter):
226 pushq %rbp // stack frame is for the debugger
229 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
232 call ASM_PFX(QueryPerformanceCounter)
234 popq %rdi // restore state
240 ASM_GLOBAL ASM_PFX(GasketSecSleep)
241 ASM_PFX(GasketSecSleep):
242 pushq %rbp // stack frame is for the debugger
245 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
248 movq %rcx, %rdi // Swizzle args
250 call ASM_PFX(SecSleep)
252 popq %rdi // restore state
258 ASM_GLOBAL ASM_PFX(GasketSecCpuSleep)
259 ASM_PFX(GasketSecCpuSleep):
260 pushq %rbp // stack frame is for the debugger
263 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
266 call ASM_PFX(SecCpuSleep)
268 popq %rdi // restore state
274 ASM_GLOBAL ASM_PFX(GasketSecExit)
275 ASM_PFX(GasketSecExit):
276 pushq %rbp // stack frame is for the debugger
279 movq %rcx, %rdi // Swizzle args
280 call ASM_PFX(SecExit) // Less to do as we will never return to EFI ABI world
282 jmp LDEAD_LOOP // _exit should never return
285 ASM_GLOBAL ASM_PFX(GasketSecGetTime)
286 ASM_PFX(GasketSecGetTime):
287 pushq %rbp // stack frame is for the debugger
290 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
293 movq %rcx, %rdi // Swizzle args
296 call ASM_PFX(SecGetTime)
298 popq %rdi // restore state
303 ASM_GLOBAL ASM_PFX(GasketSecSetTime)
304 ASM_PFX(GasketSecSetTime):
305 pushq %rbp // stack frame is for the debugger
308 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
311 movq %rcx, %rdi // Swizzle args
314 call ASM_PFX(SecSetTime)
316 popq %rdi // restore state
322 ASM_GLOBAL ASM_PFX(GasketSecGetNextProtocol)
323 ASM_PFX(GasketSecGetNextProtocol):
324 pushq %rbp // stack frame is for the debugger
327 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
330 movq %rcx, %rdi // Swizzle args
335 call ASM_PFX(SecGetNextProtocol)
337 popq %rdi // restore state
342 // PPIs produced by SEC
344 ASM_GLOBAL ASM_PFX(GasketSecPeCoffGetEntryPoint)
345 ASM_PFX(GasketSecPeCoffGetEntryPoint):
346 pushq %rbp // stack frame is for the debugger
349 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
352 movq %rcx, %rdi // Swizzle args
355 call ASM_PFX(SecPeCoffGetEntryPoint)
357 popq %rdi // restore state
362 ASM_GLOBAL ASM_PFX(GasketSecPeCoffRelocateImageExtraAction)
363 ASM_PFX(GasketSecPeCoffRelocateImageExtraAction):
364 pushq %rbp // stack frame is for the debugger
367 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
370 movq %rcx, %rdi // Swizzle args
372 call ASM_PFX(SecPeCoffRelocateImageExtraAction)
374 popq %rdi // restore state
379 ASM_GLOBAL ASM_PFX(GasketSecPeCoffUnloadImageExtraAction)
380 ASM_PFX(GasketSecPeCoffUnloadImageExtraAction):
381 pushq %rbp // stack frame is for the debugger
384 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
387 movq %rcx, %rdi // Swizzle args
389 call ASM_PFX(SecPeCoffUnloadImageExtraAction)
391 popq %rdi // restore state
397 ASM_GLOBAL ASM_PFX(GasketSecEmuThunkAddress)
398 ASM_PFX(GasketSecEmuThunkAddress):
399 pushq %rbp // stack frame is for the debugger
402 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
405 call ASM_PFX(SecEmuThunkAddress)
407 popq %rdi // restore state
413 // Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
416 ASM_GLOBAL ASM_PFX(GasketX11Size)
417 ASM_PFX(GasketX11Size):
418 pushq %rbp // stack frame is for the debugger
421 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
424 movq %rcx, %rdi // Swizzle args
429 call ASM_PFX(X11Size)
431 popq %rdi // restore state
437 ASM_GLOBAL ASM_PFX(GasketX11CheckKey)
438 ASM_PFX(GasketX11CheckKey):
439 pushq %rbp // stack frame is for the debugger
442 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
445 movq %rcx, %rdi // Swizzle args
447 call ASM_PFX(X11CheckKey)
449 popq %rdi // restore state
454 ASM_GLOBAL ASM_PFX(GasketX11GetKey)
455 ASM_PFX(GasketX11GetKey):
456 pushq %rbp // stack frame is for the debugger
459 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
462 movq %rcx, %rdi // Swizzle args
465 call ASM_PFX(X11GetKey)
467 popq %rdi // restore state
473 ASM_GLOBAL ASM_PFX(GasketX11KeySetState)
474 ASM_PFX(GasketX11KeySetState):
475 pushq %rbp // stack frame is for the debugger
478 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
481 movq %rcx, %rdi // Swizzle args
484 call ASM_PFX(X11KeySetState)
486 popq %rdi // restore state
492 ASM_GLOBAL ASM_PFX(GasketX11RegisterKeyNotify)
493 ASM_PFX(GasketX11RegisterKeyNotify):
494 pushq %rbp // stack frame is for the debugger
497 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
500 movq %rcx, %rdi // Swizzle args
505 call ASM_PFX(X11RegisterKeyNotify)
507 popq %rdi // restore state
513 ASM_GLOBAL ASM_PFX(GasketX11Blt)
514 ASM_PFX(GasketX11Blt):
515 pushq %rbp // stack frame is for the debugger
518 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
521 movq %rcx, %rdi // Swizzle args
528 popq %rdi // restore state
534 ASM_GLOBAL ASM_PFX(GasketX11CheckPointer)
535 ASM_PFX(GasketX11CheckPointer):
536 pushq %rbp // stack frame is for the debugger
539 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
542 movq %rcx, %rdi // Swizzle args
544 call ASM_PFX(X11CheckPointer)
546 popq %rdi // restore state
552 ASM_GLOBAL ASM_PFX(GasketX11GetPointerState)
553 ASM_PFX(GasketX11GetPointerState):
554 pushq %rbp // stack frame is for the debugger
557 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
560 movq %rcx, %rdi // Swizzle args
563 call ASM_PFX(X11GetPointerState)
565 popq %rdi // restore state
571 ASM_GLOBAL ASM_PFX(GasketX11GraphicsWindowOpen)
572 ASM_PFX(GasketX11GraphicsWindowOpen):
573 pushq %rbp // stack frame is for the debugger
576 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
579 movq %rcx, %rdi // Swizzle args
581 call ASM_PFX(X11GraphicsWindowOpen)
583 popq %rdi // restore state
589 ASM_GLOBAL ASM_PFX(GasketX11GraphicsWindowClose)
590 ASM_PFX(GasketX11GraphicsWindowClose):
591 pushq %rbp // stack frame is for the debugger
594 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
597 movq %rcx, %rdi // Swizzle args
600 call ASM_PFX(X11GraphicsWindowClose)
602 popq %rdi // restore state
610 ASM_GLOBAL ASM_PFX(GasketPthreadMutexLock)
611 ASM_PFX(GasketPthreadMutexLock):
612 pushq %rbp // stack frame is for the debugger
615 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
618 movq %rcx, %rdi // Swizzle args
620 call ASM_PFX(PthreadMutexLock)
622 popq %rdi // restore state
628 ASM_GLOBAL ASM_PFX(GasketPthreadMutexUnLock)
629 ASM_PFX(GasketPthreadMutexUnLock):
630 pushq %rbp // stack frame is for the debugger
633 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
636 movq %rcx, %rdi // Swizzle args
638 call ASM_PFX(PthreadMutexUnLock)
640 popq %rdi // restore state
645 ASM_GLOBAL ASM_PFX(GasketPthreadMutexTryLock)
646 ASM_PFX(GasketPthreadMutexTryLock):
647 pushq %rbp // stack frame is for the debugger
650 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
653 movq %rcx, %rdi // Swizzle args
655 call ASM_PFX(PthreadMutexTryLock)
657 popq %rdi // restore state
662 ASM_GLOBAL ASM_PFX(GasketPthreadMutexInit)
663 ASM_PFX(GasketPthreadMutexInit):
664 pushq %rbp // stack frame is for the debugger
667 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
671 call ASM_PFX(PthreadMutexInit)
673 popq %rdi // restore state
680 ASM_GLOBAL ASM_PFX(GasketPthreadMutexDestroy)
681 ASM_PFX(GasketPthreadMutexDestroy):
682 pushq %rbp // stack frame is for the debugger
685 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
688 movq %rcx, %rdi // Swizzle args
690 call ASM_PFX(PthreadMutexDestroy)
692 popq %rdi // restore state
698 ASM_GLOBAL ASM_PFX(GasketPthreadCreate)
699 ASM_PFX(GasketPthreadCreate):
700 pushq %rbp // stack frame is for the debugger
703 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
706 movq %rcx, %rdi // Swizzle args
711 call ASM_PFX(PthreadCreate)
713 popq %rdi // restore state
719 ASM_GLOBAL ASM_PFX(GasketPthreadExit)
720 ASM_PFX(GasketPthreadExit):
721 pushq %rbp // stack frame is for the debugger
724 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
727 movq %rcx, %rdi // Swizzle args
729 call ASM_PFX(PthreadExit)
731 popq %rdi // restore state
738 ASM_GLOBAL ASM_PFX(GasketPthreadSelf)
739 ASM_PFX(GasketPthreadSelf):
740 pushq %rbp // stack frame is for the debugger
743 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
747 call ASM_PFX(PthreadSelf)
749 popq %rdi // restore state
755 ASM_GLOBAL ASM_PFX(GasketPthreadOpen)
756 ASM_PFX(GasketPthreadOpen):
757 pushq %rbp // stack frame is for the debugger
760 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
763 movq %rcx, %rdi // Swizzle args
765 call ASM_PFX(PthreadOpen)
767 popq %rdi // restore state
773 ASM_GLOBAL ASM_PFX(GasketPthreadClose)
774 ASM_PFX(GasketPthreadClose):
775 pushq %rbp // stack frame is for the debugger
778 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
781 movq %rcx, %rdi // Swizzle args
783 call ASM_PFX(PthreadClose)
785 popq %rdi // restore state
794 // UNIX ABI to EFI ABI call
797 // ReverseGasketUint64 (
801 ASM_GLOBAL ASM_PFX(ReverseGasketUint64)
802 ASM_PFX(ReverseGasketUint64):
803 pushq %rbp // stack frame is for the debugger
806 movq %rdi, %rax // Swizzle args
809 subq $32, %rsp // 32-byte shadow space
817 // UNIX ABI to EFI ABI call
820 // ReverseGasketUint64Uint64 (
825 ASM_GLOBAL ASM_PFX(ReverseGasketUint64Uint64)
826 ASM_PFX(ReverseGasketUint64Uint64):
827 pushq %rbp // stack frame is for the debugger
830 movq %rdi, %rax // Swizzle args
833 subq $32, %rsp // 32-byte shadow space
841 ASM_GLOBAL ASM_PFX(GasketSecUnixPeiAutoScan)
842 ASM_PFX(GasketSecUnixPeiAutoScan):
843 pushq %rbp // stack frame is for the debugger
846 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
849 movq %rcx, %rdi // Swizzle args
853 call ASM_PFX(SecUnixPeiAutoScan)
855 popq %rdi // restore state
861 ASM_GLOBAL ASM_PFX(GasketSecUnixFdAddress)
862 ASM_PFX(GasketSecUnixFdAddress):
863 pushq %rbp // stack frame is for the debugger
866 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
869 movq %rcx, %rdi // Swizzle args
874 call ASM_PFX(SecUnixFdAddress)
876 popq %rdi // restore state
882 // EmuIoThunk SimpleFileSystem
884 ASM_GLOBAL ASM_PFX(GasketPosixOpenVolume)
885 ASM_PFX(GasketPosixOpenVolume):
886 pushq %rbp // stack frame is for the debugger
889 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
892 movq %rcx, %rdi // Swizzle args
897 call ASM_PFX(PosixOpenVolume)
899 popq %rdi // restore state
905 ASM_GLOBAL ASM_PFX(GasketPosixFileOpen)
906 ASM_PFX(GasketPosixFileOpen):
907 pushq %rbp // stack frame is for the debugger
910 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
913 movq %rcx, %rdi // Swizzle args
919 call ASM_PFX(PosixFileOpen)
921 popq %rdi // restore state
927 ASM_GLOBAL ASM_PFX(GasketPosixFileCLose)
928 ASM_PFX(GasketPosixFileCLose):
929 pushq %rbp // stack frame is for the debugger
932 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
935 movq %rcx, %rdi // Swizzle args
937 call ASM_PFX(PosixFileCLose)
939 popq %rdi // restore state
945 ASM_GLOBAL ASM_PFX(GasketPosixFileDelete)
946 ASM_PFX(GasketPosixFileDelete):
947 pushq %rbp // stack frame is for the debugger
950 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
953 movq %rcx, %rdi // Swizzle args
955 call ASM_PFX(PosixFileDelete)
957 popq %rdi // restore state
963 ASM_GLOBAL ASM_PFX(GasketPosixFileRead)
964 ASM_PFX(GasketPosixFileRead):
965 pushq %rbp // stack frame is for the debugger
968 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
971 movq %rcx, %rdi // Swizzle args
975 call ASM_PFX(PosixFileRead)
977 popq %rdi // restore state
983 ASM_GLOBAL ASM_PFX(GasketPosixFileWrite)
984 ASM_PFX(GasketPosixFileWrite):
985 pushq %rbp // stack frame is for the debugger
988 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
991 movq %rcx, %rdi // Swizzle args
995 call ASM_PFX(PosixFileWrite)
997 popq %rdi // restore state
1003 ASM_GLOBAL ASM_PFX(GasketPosixFileSetPossition)
1004 ASM_PFX(GasketPosixFileSetPossition):
1005 pushq %rbp // stack frame is for the debugger
1008 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1011 movq %rcx, %rdi // Swizzle args
1014 call ASM_PFX(PosixFileSetPossition)
1016 popq %rdi // restore state
1022 ASM_GLOBAL ASM_PFX(GasketPosixFileGetPossition)
1023 ASM_PFX(GasketPosixFileGetPossition):
1024 pushq %rbp // stack frame is for the debugger
1027 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1030 movq %rcx, %rdi // Swizzle args
1033 call ASM_PFX(PosixFileGetPossition)
1035 popq %rdi // restore state
1041 ASM_GLOBAL ASM_PFX(GasketPosixFileGetInfo)
1042 ASM_PFX(GasketPosixFileGetInfo):
1043 pushq %rbp // stack frame is for the debugger
1046 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1049 movq %rcx, %rdi // Swizzle args
1054 call ASM_PFX(PosixFileGetInfo)
1056 popq %rdi // restore state
1062 ASM_GLOBAL ASM_PFX(GasketPosixFileSetInfo)
1063 ASM_PFX(GasketPosixFileSetInfo):
1064 pushq %rbp // stack frame is for the debugger
1067 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1070 movq %rcx, %rdi // Swizzle args
1075 call ASM_PFX(PosixFileSetInfo)
1077 popq %rdi // restore state
1083 ASM_GLOBAL ASM_PFX(GasketPosixFileFlush)
1084 ASM_PFX(GasketPosixFileFlush):
1085 pushq %rbp // stack frame is for the debugger
1088 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1091 movq %rcx, %rdi // Swizzle args
1093 call ASM_PFX(PosixFileFlush)
1095 popq %rdi // restore state
1101 ASM_GLOBAL ASM_PFX(GasketPosixFileSystmeThunkOpen)
1102 ASM_PFX(GasketPosixFileSystmeThunkOpen):
1103 pushq %rbp // stack frame is for the debugger
1106 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1109 movq %rcx, %rdi // Swizzle args
1111 call ASM_PFX(PosixFileSystmeThunkOpen)
1113 popq %rdi // restore state
1119 ASM_GLOBAL ASM_PFX(GasketPosixFileSystmeThunkClose)
1120 ASM_PFX(GasketPosixFileSystmeThunkClose):
1121 pushq %rbp // stack frame is for the debugger
1124 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1127 movq %rcx, %rdi // Swizzle args
1129 call ASM_PFX(PosixFileSystmeThunkClose)
1131 popq %rdi // restore state
1136 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoReset)
1137 ASM_PFX(GasketEmuBlockIoReset):
1138 pushq %rbp // stack frame is for the debugger
1141 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1144 movq %rcx, %rdi // Swizzle args
1147 call ASM_PFX(EmuBlockIoReset)
1149 popq %rdi // restore state
1155 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoReadBlocks)
1156 ASM_PFX(GasketEmuBlockIoReadBlocks):
1157 pushq %rbp // stack frame is for the debugger
1160 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1163 movq %rcx, %rdi // Swizzle args
1170 call ASM_PFX(EmuBlockIoReadBlocks)
1172 popq %rdi // restore state
1178 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoWriteBlocks)
1179 ASM_PFX(GasketEmuBlockIoWriteBlocks):
1180 pushq %rbp // stack frame is for the debugger
1183 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1186 movq %rcx, %rdi // Swizzle args
1193 call ASM_PFX(EmuBlockIoWriteBlocks)
1195 popq %rdi // restore state
1201 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoFlushBlocks)
1202 ASM_PFX(GasketEmuBlockIoFlushBlocks):
1203 pushq %rbp // stack frame is for the debugger
1206 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1209 movq %rcx, %rdi // Swizzle args
1212 call ASM_PFX(EmuBlockIoFlushBlocks)
1214 popq %rdi // restore state
1220 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoCreateMapping)
1221 ASM_PFX(GasketEmuBlockIoCreateMapping):
1222 pushq %rbp // stack frame is for the debugger
1225 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1228 movq %rcx, %rdi // Swizzle args
1231 call ASM_PFX(EmuBlockIoCreateMapping)
1233 popq %rdi // restore state
1239 ASM_GLOBAL ASM_PFX(GasketBlockIoThunkOpen)
1240 ASM_PFX(GasketBlockIoThunkOpen):
1241 pushq %rbp // stack frame is for the debugger
1244 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1247 movq %rcx, %rdi // Swizzle args
1249 call ASM_PFX(EmuBlockIoThunkOpen)
1251 popq %rdi // restore state
1257 ASM_GLOBAL ASM_PFX(GasketBlockIoThunkClose)
1258 ASM_PFX(GasketBlockIoThunkClose):
1259 pushq %rbp // stack frame is for the debugger
1262 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1265 movq %rcx, %rdi // Swizzle args
1267 call ASM_PFX(EmuBlockIoThunkClose)
1269 popq %rdi // restore state
1276 ASM_GLOBAL ASM_PFX(GasketSnpCreateMapping)
1277 ASM_PFX(GasketSnpCreateMapping):
1278 pushq %rbp // stack frame is for the debugger
1281 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1284 movq %rcx, %rdi // Swizzle args
1287 call ASM_PFX(EmuSnpCreateMapping)
1289 popq %rdi // restore state
1295 ASM_GLOBAL ASM_PFX(GasketSnpStart)
1296 ASM_PFX(GasketSnpStart):
1297 pushq %rbp // stack frame is for the debugger
1300 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1303 movq %rcx, %rdi // Swizzle args
1305 call ASM_PFX(EmuSnpStart)
1307 popq %rdi // restore state
1313 ASM_GLOBAL ASM_PFX(GasketSnpStop)
1314 ASM_PFX(GasketSnpStop):
1315 pushq %rbp // stack frame is for the debugger
1318 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1321 movq %rcx, %rdi // Swizzle args
1323 call ASM_PFX(EmuSnpStop)
1325 popq %rdi // restore state
1331 ASM_GLOBAL ASM_PFX(GasketSnpInitialize)
1332 ASM_PFX(GasketSnpInitialize):
1333 pushq %rbp // stack frame is for the debugger
1336 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1339 movq %rcx, %rdi // Swizzle args
1343 call ASM_PFX(EmuSnpInitialize)
1345 popq %rdi // restore state
1352 ASM_GLOBAL ASM_PFX(GasketSnpReset)
1353 ASM_PFX(GasketSnpReset):
1354 pushq %rbp // stack frame is for the debugger
1357 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1360 movq %rcx, %rdi // Swizzle args
1363 call ASM_PFX(EmuSnpReset)
1365 popq %rdi // restore state
1371 ASM_GLOBAL ASM_PFX(GasketSnpShutdown)
1372 ASM_PFX(GasketSnpShutdown):
1373 pushq %rbp // stack frame is for the debugger
1376 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1379 movq %rcx, %rdi // Swizzle args
1381 call ASM_PFX(EmuSnpShutdown)
1383 popq %rdi // restore state
1389 ASM_GLOBAL ASM_PFX(GasketSnpReceiveFilters)
1390 ASM_PFX(GasketSnpReceiveFilters):
1391 pushq %rbp // stack frame is for the debugger
1394 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1397 movq %rcx, %rdi // Swizzle args
1404 call ASM_PFX(EmuSnpReceiveFilters)
1406 popq %rdi // restore state
1412 ASM_GLOBAL ASM_PFX(GasketSnpStationAddress)
1413 ASM_PFX(GasketSnpStationAddress):
1414 pushq %rbp // stack frame is for the debugger
1417 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1420 movq %rcx, %rdi // Swizzle args
1424 call ASM_PFX(EmuSnpStationAddress)
1426 popq %rdi // restore state
1433 ASM_GLOBAL ASM_PFX(GasketSnpStatistics)
1434 ASM_PFX(GasketSnpStatistics):
1435 pushq %rbp // stack frame is for the debugger
1438 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1441 movq %rcx, %rdi // Swizzle args
1446 call ASM_PFX(EmuSnpStatistics)
1448 popq %rdi // restore state
1454 ASM_GLOBAL ASM_PFX(GasketSnpMCastIpToMac)
1455 ASM_PFX(GasketSnpMCastIpToMac):
1456 pushq %rbp // stack frame is for the debugger
1459 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1462 movq %rcx, %rdi // Swizzle args
1467 call ASM_PFX(EmuSnpMCastIpToMac)
1469 popq %rdi // restore state
1475 ASM_GLOBAL ASM_PFX(GasketSnpNvData)
1476 ASM_PFX(GasketSnpNvData):
1477 pushq %rbp // stack frame is for the debugger
1480 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1483 movq %rcx, %rdi // Swizzle args
1489 call ASM_PFX(EmuSnpNvData)
1491 popq %rdi // restore state
1497 ASM_GLOBAL ASM_PFX(GasketSnpGetStatus)
1498 ASM_PFX(GasketSnpGetStatus):
1499 pushq %rbp // stack frame is for the debugger
1502 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1505 movq %rcx, %rdi // Swizzle args
1509 call ASM_PFX(EmuSnpGetStatus)
1511 popq %rdi // restore state
1518 ASM_GLOBAL ASM_PFX(GasketSnpTransmit)
1519 ASM_PFX(GasketSnpTransmit):
1520 pushq %rbp // stack frame is for the debugger
1522 subq $16, %rsp // Allocate space for args on the stack
1524 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1527 movq %rcx, %rdi // Swizzle args
1536 call ASM_PFX(EmuSnpTransmit)
1539 popq %rdi // restore state
1546 ASM_GLOBAL ASM_PFX(GasketSnpReceive)
1547 ASM_PFX(GasketSnpReceive):
1548 pushq %rbp // stack frame is for the debugger
1550 subq $16, %rsp // Allocate space for args on the stack
1552 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1555 movq %rcx, %rdi // Swizzle args
1564 call ASM_PFX(EmuSnpReceive)
1567 popq %rdi // restore state
1573 ASM_GLOBAL ASM_PFX(GasketSnpThunkOpen)
1574 ASM_PFX(GasketSnpThunkOpen):
1575 pushq %rbp // stack frame is for the debugger
1578 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1581 movq %rcx, %rdi // Swizzle args
1583 call ASM_PFX(EmuSnpThunkOpen)
1585 popq %rdi // restore state
1591 ASM_GLOBAL ASM_PFX(GasketSnpThunkClose)
1592 ASM_PFX(GasketSnpThunkClose):
1593 pushq %rbp // stack frame is for the debugger
1596 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1599 movq %rcx, %rdi // Swizzle args
1601 call ASM_PFX(EmuSnpThunkClose)
1603 popq %rdi // restore state