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(GasketSecSetTimer)
64 ASM_PFX(GasketSecSetTimer):
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 movq %rcx, %rdi // Swizzle args
74 call ASM_PFX(SecSetTimer)
76 popq %rdi // restore state
82 ASM_GLOBAL ASM_PFX(GasketSecEnableInterrupt)
83 ASM_PFX(GasketSecEnableInterrupt):
84 pushq %rbp // stack frame is for the debugger
87 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
90 call ASM_PFX(SecEnableInterrupt)
92 popq %rdi // restore state
98 ASM_GLOBAL ASM_PFX(GasketSecDisableInterrupt)
99 ASM_PFX(GasketSecDisableInterrupt):
100 pushq %rbp // stack frame is for the debugger
103 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
106 call ASM_PFX(SecDisableInterrupt)
108 popq %rdi // restore state
113 ASM_GLOBAL ASM_PFX(GasketQueryPerformanceFrequency)
114 ASM_PFX(GasketQueryPerformanceFrequency):
115 pushq %rbp // stack frame is for the debugger
118 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
121 call ASM_PFX(QueryPerformanceFrequency)
123 popq %rdi // restore state
129 ASM_GLOBAL ASM_PFX(GasketQueryPerformanceCounter)
130 ASM_PFX(GasketQueryPerformanceCounter):
131 pushq %rbp // stack frame is for the debugger
134 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
137 call ASM_PFX(QueryPerformanceCounter)
139 popq %rdi // restore state
145 ASM_GLOBAL ASM_PFX(GasketSecSleep)
146 ASM_PFX(GasketSecSleep):
147 pushq %rbp // stack frame is for the debugger
150 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
153 movq %rcx, %rdi // Swizzle args
155 call ASM_PFX(SecSleep)
157 popq %rdi // restore state
163 ASM_GLOBAL ASM_PFX(GasketSecExit)
164 ASM_PFX(GasketSecExit):
165 pushq %rbp // stack frame is for the debugger
168 movq %rcx, %rdi // Swizzle args
169 call ASM_PFX(SecExit) // Less to do as we will never return to EFI ABI world
171 jmp LDEAD_LOOP // _exit should never return
174 ASM_GLOBAL ASM_PFX(GasketSecGetTime)
175 ASM_PFX(GasketSecGetTime):
176 pushq %rbp // stack frame is for the debugger
179 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
182 movq %rcx, %rdi // Swizzle args
185 call ASM_PFX(SecGetTime)
187 popq %rdi // restore state
192 ASM_GLOBAL ASM_PFX(GasketSecSetTime)
193 ASM_PFX(GasketSecSetTime):
194 pushq %rbp // stack frame is for the debugger
197 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
200 movq %rcx, %rdi // Swizzle args
203 call ASM_PFX(SecSetTime)
205 popq %rdi // restore state
211 ASM_GLOBAL ASM_PFX(GasketSecGetNextProtocol)
212 ASM_PFX(GasketSecGetNextProtocol):
213 pushq %rbp // stack frame is for the debugger
216 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
219 movq %rcx, %rdi // Swizzle args
224 call ASM_PFX(SecGetNextProtocol)
226 popq %rdi // restore state
231 // PPIs produced by SEC
233 ASM_GLOBAL ASM_PFX(GasketSecPeCoffGetEntryPoint)
234 ASM_PFX(GasketSecPeCoffGetEntryPoint):
235 pushq %rbp // stack frame is for the debugger
238 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
241 movq %rcx, %rdi // Swizzle args
244 call ASM_PFX(SecPeCoffGetEntryPoint)
246 popq %rdi // restore state
251 ASM_GLOBAL ASM_PFX(GasketSecPeCoffRelocateImageExtraAction)
252 ASM_PFX(GasketSecPeCoffRelocateImageExtraAction):
253 pushq %rbp // stack frame is for the debugger
256 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
259 movq %rcx, %rdi // Swizzle args
261 call ASM_PFX(SecPeCoffRelocateImageExtraAction)
263 popq %rdi // restore state
268 ASM_GLOBAL ASM_PFX(GasketSecPeCoffUnloadImageExtraAction)
269 ASM_PFX(GasketSecPeCoffUnloadImageExtraAction):
270 pushq %rbp // stack frame is for the debugger
273 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
276 movq %rcx, %rdi // Swizzle args
278 call ASM_PFX(SecPeCoffUnloadImageExtraAction)
280 popq %rdi // restore state
286 ASM_GLOBAL ASM_PFX(GasketSecEmuThunkAddress)
287 ASM_PFX(GasketSecEmuThunkAddress):
288 pushq %rbp // stack frame is for the debugger
291 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
294 call ASM_PFX(SecEmuThunkAddress)
296 popq %rdi // restore state
302 // Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
305 ASM_GLOBAL ASM_PFX(GasketX11Size)
306 ASM_PFX(GasketX11Size):
307 pushq %rbp // stack frame is for the debugger
310 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
313 movq %rcx, %rdi // Swizzle args
318 call ASM_PFX(X11Size)
320 popq %rdi // restore state
326 ASM_GLOBAL ASM_PFX(GasketX11CheckKey)
327 ASM_PFX(GasketX11CheckKey):
328 pushq %rbp // stack frame is for the debugger
331 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
334 movq %rcx, %rdi // Swizzle args
336 call ASM_PFX(X11CheckKey)
338 popq %rdi // restore state
343 ASM_GLOBAL ASM_PFX(GasketX11GetKey)
344 ASM_PFX(GasketX11GetKey):
345 pushq %rbp // stack frame is for the debugger
348 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
351 movq %rcx, %rdi // Swizzle args
354 call ASM_PFX(X11GetKey)
356 popq %rdi // restore state
362 ASM_GLOBAL ASM_PFX(GasketX11KeySetState)
363 ASM_PFX(GasketX11KeySetState):
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
373 call ASM_PFX(X11KeySetState)
375 popq %rdi // restore state
381 ASM_GLOBAL ASM_PFX(GasketX11RegisterKeyNotify)
382 ASM_PFX(GasketX11RegisterKeyNotify):
383 pushq %rbp // stack frame is for the debugger
386 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
389 movq %rcx, %rdi // Swizzle args
394 call ASM_PFX(X11RegisterKeyNotify)
396 popq %rdi // restore state
402 ASM_GLOBAL ASM_PFX(GasketX11Blt)
403 ASM_PFX(GasketX11Blt):
404 pushq %rbp // stack frame is for the debugger
407 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
410 movq %rcx, %rdi // Swizzle args
417 popq %rdi // restore state
423 ASM_GLOBAL ASM_PFX(GasketX11CheckPointer)
424 ASM_PFX(GasketX11CheckPointer):
425 pushq %rbp // stack frame is for the debugger
428 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
431 movq %rcx, %rdi // Swizzle args
433 call ASM_PFX(X11CheckPointer)
435 popq %rdi // restore state
441 ASM_GLOBAL ASM_PFX(GasketX11GetPointerState)
442 ASM_PFX(GasketX11GetPointerState):
443 pushq %rbp // stack frame is for the debugger
446 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
449 movq %rcx, %rdi // Swizzle args
452 call ASM_PFX(X11GetPointerState)
454 popq %rdi // restore state
460 ASM_GLOBAL ASM_PFX(GasketX11GraphicsWindowOpen)
461 ASM_PFX(GasketX11GraphicsWindowOpen):
462 pushq %rbp // stack frame is for the debugger
465 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
468 movq %rcx, %rdi // Swizzle args
470 call ASM_PFX(X11GraphicsWindowOpen)
472 popq %rdi // restore state
478 ASM_GLOBAL ASM_PFX(GasketX11GraphicsWindowClose)
479 ASM_PFX(GasketX11GraphicsWindowClose):
480 pushq %rbp // stack frame is for the debugger
483 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
486 movq %rcx, %rdi // Swizzle args
489 call ASM_PFX(X11GraphicsWindowClose)
491 popq %rdi // restore state
499 ASM_GLOBAL ASM_PFX(GasketPthreadMutexLock)
500 ASM_PFX(GasketPthreadMutexLock):
501 pushq %rbp // stack frame is for the debugger
504 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
507 movq %rcx, %rdi // Swizzle args
509 call ASM_PFX(PthreadMutexLock)
511 popq %rdi // restore state
517 ASM_GLOBAL ASM_PFX(GasketPthreadMutexUnLock)
518 ASM_PFX(GasketPthreadMutexUnLock):
519 pushq %rbp // stack frame is for the debugger
522 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
525 movq %rcx, %rdi // Swizzle args
527 call ASM_PFX(PthreadMutexUnLock)
529 popq %rdi // restore state
534 ASM_GLOBAL ASM_PFX(GasketPthreadMutexTryLock)
535 ASM_PFX(GasketPthreadMutexTryLock):
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(PthreadMutexTryLock)
546 popq %rdi // restore state
551 ASM_GLOBAL ASM_PFX(GasketPthreadMutexInit)
552 ASM_PFX(GasketPthreadMutexInit):
553 pushq %rbp // stack frame is for the debugger
556 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
560 call ASM_PFX(PthreadMutexInit)
562 popq %rdi // restore state
569 ASM_GLOBAL ASM_PFX(GasketPthreadMutexDestroy)
570 ASM_PFX(GasketPthreadMutexDestroy):
571 pushq %rbp // stack frame is for the debugger
574 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
577 movq %rcx, %rdi // Swizzle args
579 call ASM_PFX(PthreadMutexDestroy)
581 popq %rdi // restore state
587 ASM_GLOBAL ASM_PFX(GasketPthreadCreate)
588 ASM_PFX(GasketPthreadCreate):
589 pushq %rbp // stack frame is for the debugger
592 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
595 movq %rcx, %rdi // Swizzle args
600 call ASM_PFX(PthreadCreate)
602 popq %rdi // restore state
608 ASM_GLOBAL ASM_PFX(GasketPthreadExit)
609 ASM_PFX(GasketPthreadExit):
610 pushq %rbp // stack frame is for the debugger
613 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
616 movq %rcx, %rdi // Swizzle args
618 call ASM_PFX(PthreadExit)
620 popq %rdi // restore state
627 ASM_GLOBAL ASM_PFX(GasketPthreadSelf)
628 ASM_PFX(GasketPthreadSelf):
629 pushq %rbp // stack frame is for the debugger
632 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
636 call ASM_PFX(PthreadSelf)
638 popq %rdi // restore state
644 ASM_GLOBAL ASM_PFX(GasketPthreadOpen)
645 ASM_PFX(GasketPthreadOpen):
646 pushq %rbp // stack frame is for the debugger
649 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
652 movq %rcx, %rdi // Swizzle args
654 call ASM_PFX(PthreadOpen)
656 popq %rdi // restore state
662 ASM_GLOBAL ASM_PFX(GasketPthreadClose)
663 ASM_PFX(GasketPthreadClose):
664 pushq %rbp // stack frame is for the debugger
667 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
670 movq %rcx, %rdi // Swizzle args
672 call ASM_PFX(PthreadClose)
674 popq %rdi // restore state
683 // UNIX ABI to EFI ABI call
686 // ReverseGasketUint64 (
690 ASM_GLOBAL ASM_PFX(ReverseGasketUint64)
691 ASM_PFX(ReverseGasketUint64):
692 pushq %rbp // stack frame is for the debugger
695 movq %rdi, %rax // Swizzle args
698 subq $32, %rsp // 32-byte shadow space
706 // UNIX ABI to EFI ABI call
709 // ReverseGasketUint64Uint64 (
714 ASM_GLOBAL ASM_PFX(ReverseGasketUint64Uint64)
715 ASM_PFX(ReverseGasketUint64Uint64):
716 pushq %rbp // stack frame is for the debugger
719 movq %rdi, %rax // Swizzle args
722 subq $32, %rsp // 32-byte shadow space
730 ASM_GLOBAL ASM_PFX(GasketSecUnixPeiAutoScan)
731 ASM_PFX(GasketSecUnixPeiAutoScan):
732 pushq %rbp // stack frame is for the debugger
735 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
738 movq %rcx, %rdi // Swizzle args
742 call ASM_PFX(SecUnixPeiAutoScan)
744 popq %rdi // restore state
750 ASM_GLOBAL ASM_PFX(GasketSecUnixFdAddress)
751 ASM_PFX(GasketSecUnixFdAddress):
752 pushq %rbp // stack frame is for the debugger
755 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
758 movq %rcx, %rdi // Swizzle args
763 call ASM_PFX(SecUnixFdAddress)
765 popq %rdi // restore state
771 // EmuIoThunk SimpleFileSystem
773 ASM_GLOBAL ASM_PFX(GasketPosixOpenVolume)
774 ASM_PFX(GasketPosixOpenVolume):
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
786 call ASM_PFX(PosixOpenVolume)
788 popq %rdi // restore state
794 ASM_GLOBAL ASM_PFX(GasketPosixFileOpen)
795 ASM_PFX(GasketPosixFileOpen):
796 pushq %rbp // stack frame is for the debugger
799 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
802 movq %rcx, %rdi // Swizzle args
808 call ASM_PFX(PosixFileOpen)
810 popq %rdi // restore state
816 ASM_GLOBAL ASM_PFX(GasketPosixFileCLose)
817 ASM_PFX(GasketPosixFileCLose):
818 pushq %rbp // stack frame is for the debugger
821 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
824 movq %rcx, %rdi // Swizzle args
826 call ASM_PFX(PosixFileCLose)
828 popq %rdi // restore state
834 ASM_GLOBAL ASM_PFX(GasketPosixFileDelete)
835 ASM_PFX(GasketPosixFileDelete):
836 pushq %rbp // stack frame is for the debugger
839 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
842 movq %rcx, %rdi // Swizzle args
844 call ASM_PFX(PosixFileDelete)
846 popq %rdi // restore state
852 ASM_GLOBAL ASM_PFX(GasketPosixFileRead)
853 ASM_PFX(GasketPosixFileRead):
854 pushq %rbp // stack frame is for the debugger
857 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
860 movq %rcx, %rdi // Swizzle args
864 call ASM_PFX(PosixFileRead)
866 popq %rdi // restore state
872 ASM_GLOBAL ASM_PFX(GasketPosixFileWrite)
873 ASM_PFX(GasketPosixFileWrite):
874 pushq %rbp // stack frame is for the debugger
877 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
880 movq %rcx, %rdi // Swizzle args
884 call ASM_PFX(PosixFileWrite)
886 popq %rdi // restore state
892 ASM_GLOBAL ASM_PFX(GasketPosixFileSetPossition)
893 ASM_PFX(GasketPosixFileSetPossition):
894 pushq %rbp // stack frame is for the debugger
897 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
900 movq %rcx, %rdi // Swizzle args
903 call ASM_PFX(PosixFileSetPossition)
905 popq %rdi // restore state
911 ASM_GLOBAL ASM_PFX(GasketPosixFileGetPossition)
912 ASM_PFX(GasketPosixFileGetPossition):
913 pushq %rbp // stack frame is for the debugger
916 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
919 movq %rcx, %rdi // Swizzle args
922 call ASM_PFX(PosixFileGetPossition)
924 popq %rdi // restore state
930 ASM_GLOBAL ASM_PFX(GasketPosixFileGetInfo)
931 ASM_PFX(GasketPosixFileGetInfo):
932 pushq %rbp // stack frame is for the debugger
935 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
938 movq %rcx, %rdi // Swizzle args
943 call ASM_PFX(PosixFileGetInfo)
945 popq %rdi // restore state
951 ASM_GLOBAL ASM_PFX(GasketPosixFileSetInfo)
952 ASM_PFX(GasketPosixFileSetInfo):
953 pushq %rbp // stack frame is for the debugger
956 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
959 movq %rcx, %rdi // Swizzle args
964 call ASM_PFX(PosixFileSetInfo)
966 popq %rdi // restore state
972 ASM_GLOBAL ASM_PFX(GasketPosixFileFlush)
973 ASM_PFX(GasketPosixFileFlush):
974 pushq %rbp // stack frame is for the debugger
977 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
980 movq %rcx, %rdi // Swizzle args
982 call ASM_PFX(PosixFileFlush)
984 popq %rdi // restore state
990 ASM_GLOBAL ASM_PFX(GasketPosixFileSystmeThunkOpen)
991 ASM_PFX(GasketPosixFileSystmeThunkOpen):
992 pushq %rbp // stack frame is for the debugger
995 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
998 movq %rcx, %rdi // Swizzle args
1000 call ASM_PFX(PosixFileSystmeThunkOpen)
1002 popq %rdi // restore state
1008 ASM_GLOBAL ASM_PFX(GasketPosixFileSystmeThunkClose)
1009 ASM_PFX(GasketPosixFileSystmeThunkClose):
1010 pushq %rbp // stack frame is for the debugger
1013 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1016 movq %rcx, %rdi // Swizzle args
1018 call ASM_PFX(PosixFileSystmeThunkClose)
1020 popq %rdi // restore state
1025 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoReset)
1026 ASM_PFX(GasketEmuBlockIoReset):
1027 pushq %rbp // stack frame is for the debugger
1030 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1033 movq %rcx, %rdi // Swizzle args
1036 call ASM_PFX(EmuBlockIoReset)
1038 popq %rdi // restore state
1044 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoReadBlocks)
1045 ASM_PFX(GasketEmuBlockIoReadBlocks):
1046 pushq %rbp // stack frame is for the debugger
1049 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1052 movq %rcx, %rdi // Swizzle args
1056 movq 0x30(%rbp), %r8
1057 movq 0x38(%rbp), %r9
1059 call ASM_PFX(EmuBlockIoReadBlocks)
1061 popq %rdi // restore state
1067 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoWriteBlocks)
1068 ASM_PFX(GasketEmuBlockIoWriteBlocks):
1069 pushq %rbp // stack frame is for the debugger
1072 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1075 movq %rcx, %rdi // Swizzle args
1079 movq 0x30(%rbp), %r8
1080 movq 0x38(%rbp), %r9
1082 call ASM_PFX(EmuBlockIoWriteBlocks)
1084 popq %rdi // restore state
1090 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoFlushBlocks)
1091 ASM_PFX(GasketEmuBlockIoFlushBlocks):
1092 pushq %rbp // stack frame is for the debugger
1095 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1098 movq %rcx, %rdi // Swizzle args
1101 call ASM_PFX(EmuBlockIoFlushBlocks)
1103 popq %rdi // restore state
1109 ASM_GLOBAL ASM_PFX(GasketEmuBlockIoCreateMapping)
1110 ASM_PFX(GasketEmuBlockIoCreateMapping):
1111 pushq %rbp // stack frame is for the debugger
1114 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1117 movq %rcx, %rdi // Swizzle args
1120 call ASM_PFX(EmuBlockIoCreateMapping)
1122 popq %rdi // restore state
1128 ASM_GLOBAL ASM_PFX(GasketBlockIoThunkOpen)
1129 ASM_PFX(GasketBlockIoThunkOpen):
1130 pushq %rbp // stack frame is for the debugger
1133 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1136 movq %rcx, %rdi // Swizzle args
1138 call ASM_PFX(EmuBlockIoThunkOpen)
1140 popq %rdi // restore state
1146 ASM_GLOBAL ASM_PFX(GasketBlockIoThunkClose)
1147 ASM_PFX(GasketBlockIoThunkClose):
1148 pushq %rbp // stack frame is for the debugger
1151 pushq %rsi // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
1154 movq %rcx, %rdi // Swizzle args
1156 call ASM_PFX(EmuBlockIoThunkClose)
1158 popq %rdi // restore state