]> git.proxmox.com Git - mirror_edk2.git/blob - UnixPkg/Sec/X64/MangleGasket.S
Sync update to improve compiler compatibility
[mirror_edk2.git] / UnixPkg / Sec / X64 / MangleGasket.S
1 #------------------------------------------------------------------------------
2 #
3 # This template was generated from GasketEfiTemplate.c Unix x86_64 ABI
4 #
5 # The EFI_UNIX_THUNK_PROTOCOL member functions call these these generic assembly
6 # routines.
7 #
8 # Some OS X POSIX calls get name mangled in C code and we need to fill in a C global
9 # to get the correct binding (does not work from assembly). So we have 4 functions
10 # that do an indirect call, while the others call POSIX APIs directly
11 #
12 # movq _gUnixRmDir@GOTPCREL(%rip), %rax
13 #
14 #
15 # UNIX Arg passing: RCX, RDX, R8, R9
16 # EFI Arg passing: RDI, RSI, RDX, RCX, R8, R9
17 # Callee allocates 32 bytes on stack to spill registers
18 # RSI, RDI calle-save on EFI, scatch on UNIX callign
19 #
20 #
21 # Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
22 # This program and the accompanying materials
23 # are licensed and made available under the terms and conditions of the BSD License
24 # which accompanies this distribution. The full text of the license may be found at
25 # http://opensource.org/licenses/bsd-license.php
26 #
27 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
28 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
29 #
30 #------------------------------------------------------------------------------
31
32 //
33 // Gaskets are EFI ABI to UNIX ABI calls
34 // EFI ABI code will sub 40 (0x28) from %rsp before calling a function
35 // This is the 32 (0x20) byte to spill registers and 8 bytes to align stack on 16 byte boundry.
36 //
37 .text
38
39 // 32 byte shadow to spill rcx-r9, 8 bytes to align stack on 16 byte boundry
40 // Any call with 0 - 4 arguments allocates 40 bytes on the stack.
41 // For more than 4 args you always have to increase in quanta of 16 so 5 or 6 args is 56,
42 // 7 or 8 args is 72, and 9 or 10 args is 88
43 #define EFI_STACK_SHADOW_SPACE 40
44 #define EFI_STACK_SHADOW_SPACE_5_6 56
45 #define EFI_STACK_SHADOW_SPACE_7_8 72
46 #define EFI_STACK_SHADOW_SPACE_9_10 88
47
48
49
50 .text
51
52
53 ASM_GLOBAL ASM_PFX(Gasketrmdir)
54 ASM_PFX(Gasketrmdir):
55 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
56 pushq %rdi
57
58 movq %rcx, %rdi // Swizzle args
59
60 movq ASM_PFX(gUnixRmDir)@GOTPCREL(%rip), %rax // Get function name mangled by C
61 movq (%rax), %rax
62 call *%rax
63
64 pushq %rdi // restore state
65 pushq %rsi
66 ret
67
68
69 ASM_GLOBAL ASM_PFX(Gasketopendir)
70 ASM_PFX(Gasketopendir):
71 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
72 pushq %rdi
73
74 movq %rcx, %rdi // Swizzle args
75
76 movq ASM_PFX(gUnixOpenDir)@GOTPCREL(%rip), %rax // Get function name mangled by C
77 movq (%rax), %rax
78 call *%rax
79
80 popq %rdi // restore state
81 popq %rsi
82 ret
83
84
85
86 ASM_GLOBAL ASM_PFX(Gasketstat)
87 ASM_PFX(Gasketstat):
88 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
89 pushq %rdi
90
91 movq %rcx, %rdi // Swizzle args
92 movq %rdx, %rsi
93
94 movq ASM_PFX(gUnixStat)@GOTPCREL(%rip), %rax // Get function name mangled by C
95 movq (%rax), %rax
96 call *%rax
97
98 popq %rdi // restore state
99 popq %rsi
100 ret
101
102
103 ASM_GLOBAL ASM_PFX(Gasketstatfs)
104 ASM_PFX(Gasketstatfs):
105 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
106 pushq %rdi
107
108 movq %rcx, %rdi // Swizzle args
109 movq %rdx, %rsi
110
111 movq ASM_PFX(gUnixStatFs)@GOTPCREL(%rip), %rax // Get function name mangled by C
112 movq (%rax), %rax
113 call *%rax
114
115 popq %rdi // restore state
116 popq %rsi
117 ret
118
119 ASM_GLOBAL ASM_PFX(Gasketrewinddir)
120 ASM_PFX(Gasketrewinddir):
121 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
122 pushq %rdi
123
124 movq %rcx, %rdi // Swizzle args
125
126 movq ASM_PFX(gUnixRewinddir)@GOTPCREL(%rip), %rax // Get function name mangled by C
127 movq (%rax), %rax
128 call *%rax
129
130 popq %rdi // restore state
131 popq %rsi
132 ret
133
134 ASM_GLOBAL ASM_PFX(Gasketreaddir)
135 ASM_PFX(Gasketreaddir):
136 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
137 pushq %rdi
138
139 movq %rcx, %rdi // Swizzle args
140
141 movq ASM_PFX(gUnixReaddir)@GOTPCREL(%rip), %rax // Get function name mangled by C
142 movq (%rax), %rax
143 call *%rax
144
145 popq %rdi // restore state
146 popq %rsi
147 ret
148
149
150 ASM_GLOBAL ASM_PFX(GasketmsSleep)
151 ASM_PFX(GasketmsSleep):
152 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
153 pushq %rdi
154
155 movq %rcx, %rdi // Swizzle args
156
157 call ASM_PFX(msSleep)
158
159 popq %rdi // restore state
160 popq %rsi
161 ret
162
163
164 ASM_GLOBAL ASM_PFX(Gasketexit)
165 ASM_PFX(Gasketexit):
166 movq %rcx, %rdi // Swizzle args
167 call ASM_PFX(exit) // Less to do as we will never return to EFI ABI world
168 LDEAD_LOOP:
169 jmp LDEAD_LOOP // _exit should never return
170
171
172
173 ASM_GLOBAL ASM_PFX(GasketSetTimer)
174 ASM_PFX(GasketSetTimer):
175 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
176 pushq %rdi
177
178 movq %rcx, %rdi // Swizzle args
179 movq %rdx, %rsi
180
181 call ASM_PFX(SetTimer)
182
183 popq %rdi // restore state
184 popq %rsi
185 ret
186
187
188 ASM_GLOBAL ASM_PFX(GasketGetLocalTime)
189 ASM_PFX(GasketGetLocalTime):
190 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
191 pushq %rdi
192
193 movq %rcx, %rdi // Swizzle args
194
195 call ASM_PFX(GetLocalTime)
196
197 popq %rdi // restore state
198 popq %rsi
199 ret
200
201
202
203 ASM_GLOBAL ASM_PFX(Gasketgmtime)
204 ASM_PFX(Gasketgmtime):
205 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
206 pushq %rdi
207
208 movq %rcx, %rdi // Swizzle args
209
210 call ASM_PFX(localtime)
211
212 popq %rdi // restore state
213 popq %rsi
214 ret
215
216
217
218 ASM_GLOBAL ASM_PFX(GasketGetTimeZone)
219 ASM_PFX(GasketGetTimeZone):
220 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
221 pushq %rdi
222
223 call ASM_PFX(GetTimeZone)
224
225 popq %rdi // restore state
226 popq %rsi
227 ret
228
229
230 ASM_GLOBAL ASM_PFX(GasketGetDayLight)
231 ASM_PFX(GasketGetDayLight):
232 LFB26:
233 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
234 pushq %rdi
235
236 call ASM_PFX(GetDayLight)
237
238 popq %rdi // restore state
239 popq %rsi
240 ret
241
242
243 ASM_GLOBAL ASM_PFX(Gasketpoll)
244 ASM_PFX(Gasketpoll):
245 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
246 pushq %rdi
247
248 movq %rcx, %rdi // Swizzle args
249 movq %rdx, %rsi
250 movq %r8, %rdx
251
252 call ASM_PFX(poll)
253
254 popq %rdi // restore state
255 popq %rsi
256 ret
257
258
259
260 ASM_GLOBAL ASM_PFX(Gasketread)
261 ASM_PFX(Gasketread):
262 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
263 pushq %rdi
264
265 movq %rcx, %rdi // Swizzle args
266 movq %rdx, %rsi
267 movq %r8, %rdx
268
269 call ASM_PFX(read)
270
271 popq %rdi // restore state
272 popq %rsi
273 ret
274
275
276 ASM_GLOBAL ASM_PFX(Gasketwrite)
277 ASM_PFX(Gasketwrite):
278 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
279 pushq %rdi
280
281 movq %rcx, %rdi // Swizzle args
282 movq %rdx, %rsi
283 movq %r8, %rdx
284
285 call ASM_PFX(write)
286
287 popq %rdi // restore state
288 popq %rsi
289 ret
290
291
292 ASM_GLOBAL ASM_PFX(Gasketgetenv)
293 ASM_PFX(Gasketgetenv):
294 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
295 pushq %rdi
296
297 movq %rcx, %rdi // Swizzle args
298
299 call ASM_PFX(getenv)
300
301 popq %rdi // restore state
302 popq %rsi
303 ret
304
305
306 ASM_GLOBAL ASM_PFX(Gasketopen)
307 ASM_PFX(Gasketopen):
308 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
309 pushq %rdi
310
311 movq %rcx, %rdi // Swizzle args
312 movq %rdx, %rsi
313 movq %r8, %rdx
314
315 call ASM_PFX(open)
316
317 popq %rdi // restore state
318 popq %rsi
319 ret
320
321
322 ASM_GLOBAL ASM_PFX(Gasketlseek)
323 ASM_PFX(Gasketlseek):
324 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
325 pushq %rdi
326
327 movq %rcx, %rdi // Swizzle args
328 movq %rdx, %rsi
329 movq %r8, %rdx
330
331 call ASM_PFX(lseek)
332
333 popq %rdi // restore state
334 popq %rsi
335 ret
336
337
338 ASM_GLOBAL ASM_PFX(Gasketftruncate)
339 ASM_PFX(Gasketftruncate):
340 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
341 pushq %rdi
342
343 movq %rcx, %rdi // Swizzle args
344 movq %rdx, %rsi
345 movq %r8, %rdx
346
347 call ASM_PFX(ftruncate)
348
349 popq %rdi // restore state
350 popq %rsi
351 ret
352
353
354 ASM_GLOBAL ASM_PFX(Gasketclose)
355 ASM_PFX(Gasketclose):
356 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
357 pushq %rdi
358
359 movq %rcx, %rdi // Swizzle args
360
361 call ASM_PFX(close)
362
363 popq %rdi // restore state
364 popq %rsi
365 ret
366
367
368
369 ASM_GLOBAL ASM_PFX(Gasketmkdir)
370 ASM_PFX(Gasketmkdir):
371 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
372 pushq %rdi
373
374 movq %rcx, %rdi // Swizzle args
375 movq %rdx, %rsi
376
377 call ASM_PFX(mkdir)
378
379 popq %rdi // restore state
380 popq %rsi
381 ret
382
383
384 ASM_GLOBAL ASM_PFX(Gasketunlink)
385 ASM_PFX(Gasketunlink):
386 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
387 pushq %rdi
388
389 movq %rcx, %rdi // Swizzle args
390
391 call ASM_PFX(unlink)
392
393 popq %rdi // restore state
394 popq %rsi
395 ret
396
397
398 ASM_GLOBAL ASM_PFX(GasketGetErrno)
399 ASM_PFX(GasketGetErrno):
400 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
401 pushq %rdi
402
403 call ASM_PFX(GetErrno)
404
405 popq %rdi // restore state
406 popq %rsi
407 ret
408
409 ASM_GLOBAL ASM_PFX(Gasketclosedir)
410 ASM_PFX(Gasketclosedir):
411 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
412 pushq %rdi
413
414 movq %rcx, %rdi // Swizzle args
415
416 call ASM_PFX(closedir)
417
418 popq %rdi // restore state
419 popq %rsi
420 ret
421
422
423 ASM_GLOBAL ASM_PFX(Gasketrename)
424 ASM_PFX(Gasketrename):
425 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
426 pushq %rdi
427
428 movq %rcx, %rdi // Swizzle args
429 movq %rdx, %rsi
430
431 call ASM_PFX(rename)
432
433 popq %rdi // restore state
434 popq %rsi
435 ret
436
437
438 ASM_GLOBAL ASM_PFX(Gasketmktime)
439 ASM_PFX(Gasketmktime):
440 LFB42:
441 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
442 pushq %rdi
443
444 movq %rcx, %rdi // Swizzle args
445 movq %rdx, %rsi
446
447 call ASM_PFX(mktime)
448
449 popq %rdi // restore state
450 popq %rsi
451 ret
452
453
454 ASM_GLOBAL ASM_PFX(Gasketfsync)
455 ASM_PFX(Gasketfsync):
456 pushq %rdi
457
458 movq %rcx, %rdi // Swizzle args
459 movq %rdx, %rsi
460
461 call ASM_PFX(fsync)
462
463 popq %rdi // restore state
464 popq %rsi
465 ret
466
467
468 ASM_GLOBAL ASM_PFX(Gasketchmod)
469 ASM_PFX(Gasketchmod):
470 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
471 pushq %rdi
472
473 movq %rcx, %rdi // Swizzle args
474 movq %rdx, %rsi
475
476 call ASM_PFX(chmod)
477
478 popq %rdi // restore state
479 popq %rsi
480 ret
481
482
483 ASM_GLOBAL ASM_PFX(Gasketutime)
484 ASM_PFX(Gasketutime):
485 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
486 pushq %rdi
487
488 movq %rcx, %rdi // Swizzle args
489 movq %rdx, %rsi
490
491 call ASM_PFX(utime)
492
493 popq %rdi // restore state
494 popq %rsi
495 ret
496
497
498 ASM_GLOBAL ASM_PFX(Gaskettcflush)
499 ASM_PFX(Gaskettcflush):
500 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
501 pushq %rdi
502
503 movq %rcx, %rdi // Swizzle args
504 movq %rdx, %rsi
505
506 call ASM_PFX(tcflush)
507
508 popq %rdi // restore state
509 popq %rsi
510 ret
511
512
513 ASM_GLOBAL ASM_PFX(GasketUgaCreate)
514 ASM_PFX(GasketUgaCreate):
515 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
516 pushq %rdi
517
518 movq %rcx, %rdi // Swizzle args
519 movq %rdx, %rsi
520
521 call ASM_PFX(UgaCreate)
522
523 popq %rdi // restore state
524 popq %rsi
525 ret
526
527
528 ASM_GLOBAL ASM_PFX(Gasketperror)
529 ASM_PFX(Gasketperror):
530 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
531 pushq %rdi
532
533 movq %rcx, %rdi // Swizzle args
534 movq %rdx, %rsi
535
536 call ASM_PFX(perror)
537
538 popq %rdi // restore state
539 popq %rsi
540 ret
541
542
543 ASM_GLOBAL ASM_PFX(Gasketioctl)
544 ASM_PFX(Gasketioctl):
545 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
546 pushq %rdi
547
548 movq %rcx, %rdi // Swizzle args
549 movq %rdx, %rsi
550 movq %r8, %rdx
551
552 call ASM_PFX(UnixIoCtl1)
553
554 popq %rdi // restore state
555 popq %rsi
556 ret
557
558
559 ASM_GLOBAL ASM_PFX(Gasketfcntl)
560 ASM_PFX(Gasketfcntl):
561 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
562 pushq %rdi
563
564 movq %rcx, %rdi // Swizzle args
565 movq %rdx, %rsi
566 movq %r8, %rdx
567
568 call ASM_PFX(UnixFcntl1)
569
570 popq %rdi // restore state
571 popq %rsi
572 ret
573
574
575
576 ASM_GLOBAL ASM_PFX(Gasketcfsetispeed)
577 ASM_PFX(Gasketcfsetispeed):
578 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
579 pushq %rdi
580
581 movq %rcx, %rdi // Swizzle args
582 movq %rdx, %rsi
583
584 call ASM_PFX(cfsetispeed)
585
586 popq %rdi // restore state
587 popq %rsi
588 ret
589
590
591
592 ASM_GLOBAL ASM_PFX(Gasketcfsetospeed)
593 ASM_PFX(Gasketcfsetospeed):
594 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
595 pushq %rdi
596
597 movq %rcx, %rdi // Swizzle args
598 movq %rdx, %rsi
599
600 call ASM_PFX(cfsetospeed)
601
602 popq %rdi // restore state
603 popq %rsi
604 ret
605
606
607 ASM_GLOBAL ASM_PFX(Gaskettcgetattr)
608 ASM_PFX(Gaskettcgetattr):
609 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
610 pushq %rdi
611
612 movq %rcx, %rdi // Swizzle args
613 movq %rdx, %rsi
614 movq %r8, %rdx
615
616 call ASM_PFX(tcgetattr)
617
618 popq %rdi // restore state
619 popq %rsi
620 ret
621
622
623 ASM_GLOBAL ASM_PFX(Gaskettcsetattr)
624 ASM_PFX(Gaskettcsetattr):
625 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
626 pushq %rdi
627
628 movq %rcx, %rdi // Swizzle args
629 movq %rdx, %rsi
630 movq %r8, %rdx
631
632 call ASM_PFX(tcsetattr)
633
634 popq %rdi // restore state
635 popq %rsi
636 ret
637
638
639 ASM_GLOBAL ASM_PFX(GasketUnixPeCoffGetEntryPoint)
640 ASM_PFX(GasketUnixPeCoffGetEntryPoint):
641 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
642 pushq %rdi
643
644 movq %rcx, %rdi // Swizzle args
645 movq %rdx, %rsi
646
647 call ASM_PFX(SecPeCoffGetEntryPoint)
648
649 popq %rdi // restore state
650 popq %rsi
651 ret
652
653
654
655 ASM_GLOBAL ASM_PFX(GasketUnixPeCoffRelocateImageExtraAction)
656 ASM_PFX(GasketUnixPeCoffRelocateImageExtraAction):
657 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
658 pushq %rdi
659
660 movq %rcx, %rdi // Swizzle args
661
662 call ASM_PFX(SecPeCoffRelocateImageExtraAction)
663
664 popq %rdi // restore state
665 popq %rsi
666 ret
667
668
669 ASM_GLOBAL ASM_PFX(GasketUnixPeCoffUnloadImageExtraAction)
670 ASM_PFX(GasketUnixPeCoffUnloadImageExtraAction):
671 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
672 pushq %rdi
673
674 movq %rcx, %rdi // Swizzle args
675
676 call ASM_PFX(SecPeCoffLoaderUnloadImageExtraAction)
677
678 popq %rdi // restore state
679 popq %rsi
680 ret
681
682
683 ASM_GLOBAL ASM_PFX(GasketUgaClose)
684 ASM_PFX(GasketUgaClose):
685 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
686 pushq %rdi
687
688 movq %rcx, %rdi // Swizzle args
689
690 call ASM_PFX(UgaClose)
691
692 popq %rdi // restore state
693 popq %rsi
694 ret
695
696
697 ASM_GLOBAL ASM_PFX(GasketUgaSize)
698 ASM_PFX(GasketUgaSize):
699 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
700 pushq %rdi
701
702 movq %rcx, %rdi // Swizzle args
703 movq %rdx, %rsi
704 movq %r8, %rdx
705
706 call ASM_PFX(UgaSize)
707
708 popq %rdi // restore state
709 popq %rsi
710 ret
711
712
713 ASM_GLOBAL ASM_PFX(GasketUgaCheckKey)
714 ASM_PFX(GasketUgaCheckKey):
715 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
716 pushq %rdi
717
718 movq %rcx, %rdi // Swizzle args
719
720 call ASM_PFX(UgaCheckKey)
721
722 popq %rdi // restore state
723 popq %rsi
724 ret
725
726
727 ASM_GLOBAL ASM_PFX(GasketUgaGetKey)
728 ASM_PFX(GasketUgaGetKey):
729 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
730 pushq %rdi
731
732 movq %rcx, %rdi // Swizzle args
733 movq %rdx, %rsi
734
735 call ASM_PFX(UgaGetKey)
736
737 popq %rdi // restore state
738 popq %rsi
739 ret
740
741
742 ASM_GLOBAL ASM_PFX(GasketUgaBlt)
743 ASM_PFX(GasketUgaBlt):
744 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
745 pushq %rdi
746
747 movq %rcx, %rdi // Swizzle args
748 movq %rdx, %rsi
749 movq %r8, %rdx
750 movq %r9, %rcx
751
752 call ASM_PFX(UgaBlt)
753
754 popq %rdi // restore state
755 popq %rsi
756 ret
757
758
759 //
760 // UNIX ABI to EFI ABI call
761 //
762 // UINTN
763 // ReverseGasketUint64 (
764 // void *Api,
765 // UINTN Arg1,
766 // UINTN Arg2,
767 // UINTN Arg3
768 // );
769 ASM_GLOBAL ASM_PFX(ReverseGasketUint64)
770 ASM_PFX(ReverseGasketUint64):
771 movq %rdi, %rax // Swizzle args
772 movq %rsi, %r9
773 // movq %rdx, %rdx
774 movq %rcx, %r8
775 movq %r9, %rcx
776
777 subq $40, %rsp // 32-byte shadow space plus alignment pad
778 call *%rax
779 addq $40, %rsp
780
781 ret
782
783
784 // Sec PPI Callbacks
785
786 ASM_GLOBAL ASM_PFX(GasketSecUnixPeiLoadFile)
787 ASM_PFX(GasketSecUnixPeiLoadFile):
788 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
789 pushq %rdi
790
791 movq %rcx, %rdi // Swizzle args
792 movq %rdx, %rsi
793 movq %r8, %rdx
794 movq %r9, %rcx
795
796 call ASM_PFX(SecUnixPeiLoadFile)
797
798 popq %rdi // restore state
799 popq %rsi
800 ret
801
802
803
804 ASM_GLOBAL ASM_PFX(GasketSecUnixPeiAutoScan)
805 ASM_PFX(GasketSecUnixPeiAutoScan):
806 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
807 pushq %rdi
808
809 movq %rcx, %rdi // Swizzle args
810 movq %rdx, %rsi
811 movq %r8, %rdx
812
813 call ASM_PFX(SecUnixPeiAutoScan)
814
815 popq %rdi // restore state
816 popq %rsi
817 ret
818
819 ASM_GLOBAL ASM_PFX(GasketSecUnixUnixThunkAddress)
820 ASM_PFX(GasketSecUnixUnixThunkAddress):
821 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
822 pushq %rdi
823
824 call ASM_PFX(SecUnixUnixThunkAddress)
825
826 popq %rdi // restore state
827 popq %rsi
828 ret
829
830
831 ASM_GLOBAL ASM_PFX(GasketSecPeiReportStatusCode)
832 ASM_PFX(GasketSecPeiReportStatusCode):
833 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
834 pushq %rdi
835
836 movq %rcx, %rdi // Swizzle args
837 movq %rdx, %rsi
838 movq %r8, %rdx
839 movq %r9, %rcx
840 movq $0, %r8 // BugBug: This should come from the stack
841 movq $0, %r9 // But we can cheat since they are optional for bringup....
842
843 call ASM_PFX(SecPeiReportStatusCode)
844
845 popq %rdi // restore state
846 popq %rsi
847 ret
848
849
850 ASM_GLOBAL ASM_PFX(GasketSecUnixFdAddress)
851 ASM_PFX(GasketSecUnixFdAddress):
852 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
853 pushq %rdi
854
855 movq %rcx, %rdi // Swizzle args
856 movq %rdx, %rsi
857 movq %r8, %rdx
858 movq %r9, %rcx
859
860 call ASM_PFX(SecUnixFdAddress)
861
862 popq %rdi // restore state
863 popq %rsi
864 ret
865
866
867
868
869 ASM_GLOBAL ASM_PFX(GasketSecTemporaryRamSupport)
870 ASM_PFX(GasketSecTemporaryRamSupport):
871 pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
872 pushq %rdi
873
874 movq %rcx, %rdi // Swizzle args
875 movq %rdx, %rsi
876 movq %r8, %rdx
877 movq %r9, %rcx
878
879 call ASM_PFX(SecTemporaryRamSupport)
880
881 popq %rdi // restore state
882 popq %rsi
883 ret
884
885
886
887
888