Port UnixPkg to also support X64. Currently only supports Unix x86_64 ABI. In the future we can make Sec support x86_64 ABI and the rest of the code support X64 EFI ABI. This will require assembly gaskets to fix the calling convention differences. I currently have noop gaskets in place for x86_64 ABI. This has only been tested on OS X 10.6.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10685 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -74,20 +74,20 @@ GasketGetDayLight (void)
|
||||
|
||||
|
||||
int
|
||||
Gasketpoll (struct pollfd *pfd, int nfds, int timeout)
|
||||
Gasketpoll (struct pollfd *pfd, unsigned int nfds, int timeout)
|
||||
{
|
||||
return GasketUintnUintnUintn (poll, (UINTN)pfd, nfds, timeout);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
long
|
||||
Gasketread (int fd, void *buf, int count)
|
||||
{
|
||||
return GasketUintnUintnUintn (read, fd, (UINTN)buf, count);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
long
|
||||
Gasketwrite (int fd, const void *buf, int count)
|
||||
{
|
||||
return GasketUintnUintnUintn (write, fd, (UINTN)buf, count);
|
||||
@@ -168,10 +168,11 @@ Gasketopendir (const char *pathname)
|
||||
}
|
||||
|
||||
|
||||
void *
|
||||
void
|
||||
Gasketrewinddir (DIR *dir)
|
||||
{
|
||||
return (void *)(UINTN)GasketUintn (rewinddir, (UINTN)dir);
|
||||
GasketUintn (rewinddir, (UINTN)dir);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -372,7 +373,7 @@ GasketUnixPeCoffRelocateImageExtraAction (
|
||||
|
||||
|
||||
VOID
|
||||
GasketPeCoffLoaderUnloadImageExtraAction (
|
||||
GasketUnixPeCoffUnloadImageExtraAction (
|
||||
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||
)
|
||||
{
|
||||
|
@@ -33,9 +33,9 @@ void GasketGetLocalTime (EFI_TIME *Time);
|
||||
struct tm *Gasketgmtime (const time_t *clock);
|
||||
long GasketGetTimeZone (void);
|
||||
int GasketGetDayLight (void);
|
||||
int Gasketpoll (struct pollfd *pfd, int nfds, int timeout);
|
||||
int Gasketread (int fd, void *buf, int count);
|
||||
int Gasketwrite (int fd, const void *buf, int count);
|
||||
int Gasketpoll (struct pollfd *pfd, unsigned int nfds, int timeout);
|
||||
long Gasketread (int fd, void *buf, int count);
|
||||
long Gasketwrite (int fd, const void *buf, int count);
|
||||
char *Gasketgetenv (const char *name);
|
||||
int Gasketopen (const char *name, int flags, int mode);
|
||||
off_t Gasketlseek (int fd, off_t off, int whence);
|
||||
@@ -46,7 +46,7 @@ int Gasketrmdir (const char *pathname);
|
||||
int Gasketunlink (const char *pathname);
|
||||
int GasketGetErrno (void);
|
||||
DIR *Gasketopendir (const char *pathname);
|
||||
void *Gasketrewinddir (DIR *dir);
|
||||
void Gasketrewinddir (DIR *dir);
|
||||
struct dirent *Gasketreaddir (DIR *dir);
|
||||
int Gasketclosedir (DIR *dir);
|
||||
int Gasketstat (const char *path, STAT_FIX *buf);
|
||||
@@ -88,21 +88,22 @@ GasketUnixPeCoffRelocateImageExtraAction (
|
||||
);
|
||||
|
||||
VOID
|
||||
GasketPeCoffLoaderUnloadImageExtraAction (
|
||||
GasketUnixPeCoffUnloadImageExtraAction (
|
||||
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||
);
|
||||
|
||||
|
||||
int GasketVoid (void *api);
|
||||
int GasketUintn (void *api, UINTN a);
|
||||
int GasketUintnUintn (void *api, UINTN a, UINTN b);
|
||||
int GasketUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c);
|
||||
int GasketUintnUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c, UINTN d);
|
||||
int GasketUintn10Args (void *api, UINTN a, UINTN b, UINTN c, UINTN d, UINTN e, UINTN f, UINTN g, UINTN h, UINTN i, UINTN j);
|
||||
int GasketUint64Uintn (void *api, UINT64 a, UINTN b);
|
||||
UINTN GasketVoid (void *api);
|
||||
UINTN GasketUintn (void *api, UINTN a);
|
||||
UINTN GasketUintnUintn (void *api, UINTN a, UINTN b);
|
||||
UINTN GasketUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c);
|
||||
UINTN GasketUintnUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c, UINTN d);
|
||||
UINTN GasketUintn10Args (void *api, UINTN a, UINTN b, UINTN c, UINTN d, UINTN e, UINTN f, UINTN g, UINTN h, UINTN i, UINTN j);
|
||||
UINTN GasketUint64Uintn (void *api, UINT64 a, UINTN b);
|
||||
UINT64 GasketUintnUint64Uintn (void *api, UINTN a, UINT64 b, UINTN c);
|
||||
int GasketUintnUint16 (void *api, UINTN a, UINT16 b);
|
||||
UINTN GasketUintnUint16 (void *api, UINTN a, UINT16 b);
|
||||
|
||||
UINTN ReverseGasketUint64 (void *api, UINT64 a);
|
||||
|
||||
//
|
||||
// Gasket functions for EFI_UNIX_UGA_IO_PROTOCOL
|
||||
|
@@ -16,7 +16,7 @@
|
||||
# on Leopard and _stat$INDOE64 on Snow Leopard. That is why we pass stat()
|
||||
# into one of these gaskets from C code.
|
||||
#
|
||||
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -235,7 +235,23 @@ _GasketUintnUint16:
|
||||
call *%eax
|
||||
leave
|
||||
ret
|
||||
|
||||
.globl _ReverseGasketUint64
|
||||
_ReverseGasketUint64:
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
subl $56, %esp
|
||||
movl 12(%ebp), %eax
|
||||
movl %eax, -32(%ebp)
|
||||
movl 16(%ebp), %eax
|
||||
movl %eax, -28(%ebp)
|
||||
movl 8(%ebp), %eax
|
||||
movl %eax, -12(%ebp)
|
||||
movl -32(%ebp), %eax
|
||||
movl %eax, (%esp)
|
||||
movl -12(%ebp), %eax
|
||||
call *%eax
|
||||
leave
|
||||
ret
|
||||
.subsections_via_symbols
|
||||
|
||||
#endif
|
||||
|
@@ -138,5 +138,14 @@ GasketUintnUint16 (void *api, UINTN a, UINT16 b)
|
||||
return func (a, b);
|
||||
}
|
||||
|
||||
void
|
||||
ReverseGasketUint64 (void *api, UINT64 a)
|
||||
{
|
||||
GASKET_UINTN func;
|
||||
|
||||
func = (GASKET_UINTN)api;
|
||||
func (a);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -827,7 +827,7 @@ Returns:
|
||||
// If the memory buffer could not be allocated at the FD build address
|
||||
// the Fixup is the difference.
|
||||
//
|
||||
*FixUp = *FdBase - PcdGet32 (PcdUnixFdBaseAddress);
|
||||
*FixUp = *FdBase - PcdGet64 (PcdUnixFdBaseAddress);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
@@ -373,9 +373,10 @@ UgaCheckKey(EFI_UNIX_UGA_IO_PROTOCOL *UgaIo)
|
||||
{
|
||||
UGA_IO_PRIVATE *drv = (UGA_IO_PRIVATE *)UgaIo;
|
||||
HandleEvents(drv);
|
||||
if (drv->key_count != 0)
|
||||
|
||||
if (drv->key_count != 0) {
|
||||
return EFI_SUCCESS;
|
||||
else {
|
||||
} else {
|
||||
/* EFI is certainly polling. Be CPU-friendly. */
|
||||
msSleep (20);
|
||||
return EFI_NOT_READY;
|
||||
@@ -631,8 +632,8 @@ EFI_STATUS EFIAPI GasketUgaBlt (
|
||||
XStoreName (drv->display, drv->win, title);
|
||||
}
|
||||
|
||||
XSelectInput (drv->display, drv->win,
|
||||
ExposureMask | KeyPressMask);
|
||||
XSelectInput (drv->display, drv->win, ExposureMask | KeyPressMask);
|
||||
|
||||
drv->gc = DefaultGC (drv->display, drv->screen);
|
||||
|
||||
*Uga = (EFI_UNIX_UGA_IO_PROTOCOL *)drv;
|
||||
|
@@ -55,8 +55,14 @@ settimer_handler (int sig)
|
||||
- ((UINT64)settimer_timeval.tv_sec * 1000)
|
||||
- (settimer_timeval.tv_usec / 1000);
|
||||
settimer_timeval = timeval;
|
||||
if (settimer_callback)
|
||||
(*settimer_callback)(delta);
|
||||
|
||||
if (settimer_callback) {
|
||||
#ifdef __APPLE__
|
||||
ReverseGasketUint64 (settimer_callback, delta);
|
||||
#else
|
||||
(*settimer_callback)(delta);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
@@ -94,13 +100,18 @@ SetTimer (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs))
|
||||
void
|
||||
msSleep (unsigned long Milliseconds)
|
||||
{
|
||||
struct timespec ts;
|
||||
struct timespec rq, rm;
|
||||
|
||||
ts.tv_sec = Milliseconds / 1000;
|
||||
ts.tv_nsec = (Milliseconds % 1000) * 1000000;
|
||||
rq.tv_sec = Milliseconds / 1000;
|
||||
rq.tv_nsec = (Milliseconds % 1000) * 1000000;
|
||||
|
||||
while (nanosleep (&ts, &ts) != 0 && errno == EINTR)
|
||||
;
|
||||
while (nanosleep (&rq, &rm) != -1) {
|
||||
if (errno != EINTR) {
|
||||
break;
|
||||
}
|
||||
rq = rm;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
@@ -174,20 +185,20 @@ EFI_UNIX_THUNK_PROTOCOL mUnixThunkTable = {
|
||||
Gasketgmtime,
|
||||
GasketGetTimeZone,
|
||||
GasketGetDayLight,
|
||||
(UnixPoll)Gasketpoll,
|
||||
(UnixRead)Gasketread,
|
||||
(UnixWrite)Gasketwrite,
|
||||
Gasketpoll,
|
||||
Gasketread,
|
||||
Gasketwrite,
|
||||
Gasketgetenv,
|
||||
(UnixOpen)Gasketopen,
|
||||
(UnixSeek)Gasketlseek,
|
||||
(UnixFtruncate)Gasketftruncate,
|
||||
Gasketopen,
|
||||
Gasketlseek,
|
||||
Gasketftruncate,
|
||||
Gasketclose,
|
||||
Gasketmkdir,
|
||||
Gasketrmdir,
|
||||
Gasketunlink,
|
||||
GasketGetErrno,
|
||||
Gasketopendir,
|
||||
(UnixRewindDir)Gasketrewinddir,
|
||||
Gasketrewinddir,
|
||||
Gasketreaddir,
|
||||
Gasketclosedir,
|
||||
Gasketstat,
|
||||
@@ -206,14 +217,9 @@ EFI_UNIX_THUNK_PROTOCOL mUnixThunkTable = {
|
||||
Gasketcfsetospeed,
|
||||
Gaskettcgetattr,
|
||||
Gaskettcsetattr,
|
||||
|
||||
dlopen, // Update me with a gasket
|
||||
dlerror, // Update me with a gasket
|
||||
dlsym, // Update me with a gasket
|
||||
|
||||
SecPeCoffGetEntryPoint, // Update me with a gasket
|
||||
SecPeCoffRelocateImageExtraAction, // Update me with a gasket
|
||||
SecPeCoffLoaderUnloadImageExtraAction // Update me with a gasket
|
||||
GasketUnixPeCoffGetEntryPoint,
|
||||
GasketUnixPeCoffRelocateImageExtraAction,
|
||||
GasketUnixPeCoffUnloadImageExtraAction
|
||||
|
||||
#else
|
||||
msSleep, /* Sleep */
|
||||
@@ -255,9 +261,6 @@ EFI_UNIX_THUNK_PROTOCOL mUnixThunkTable = {
|
||||
cfsetospeed,
|
||||
tcgetattr,
|
||||
tcsetattr,
|
||||
dlopen,
|
||||
dlerror,
|
||||
dlsym,
|
||||
SecPeCoffGetEntryPoint,
|
||||
SecPeCoffRelocateImageExtraAction,
|
||||
SecPeCoffLoaderUnloadImageExtraAction
|
||||
|
@@ -27,10 +27,10 @@ LCFI4:
|
||||
subq $32, %rsp
|
||||
LCFI5:
|
||||
movq %rdi, -24(%rbp)
|
||||
movl %esi, -28(%rbp)
|
||||
movq %rsi, -32(%rbp)
|
||||
movq -24(%rbp), %rax
|
||||
movq %rax, -8(%rbp)
|
||||
movl -28(%rbp), %edi
|
||||
movq -32(%rbp), %rdi
|
||||
movq -8(%rbp), %rax
|
||||
call *%rax
|
||||
leave
|
||||
@@ -43,15 +43,15 @@ LFB4:
|
||||
LCFI6:
|
||||
movq %rsp, %rbp
|
||||
LCFI7:
|
||||
subq $32, %rsp
|
||||
subq $48, %rsp
|
||||
LCFI8:
|
||||
movq %rdi, -24(%rbp)
|
||||
movl %esi, -28(%rbp)
|
||||
movl %edx, -32(%rbp)
|
||||
movq %rsi, -32(%rbp)
|
||||
movq %rdx, -40(%rbp)
|
||||
movq -24(%rbp), %rax
|
||||
movq %rax, -8(%rbp)
|
||||
movl -32(%rbp), %esi
|
||||
movl -28(%rbp), %edi
|
||||
movq -40(%rbp), %rsi
|
||||
movq -32(%rbp), %rdi
|
||||
movq -8(%rbp), %rax
|
||||
call *%rax
|
||||
leave
|
||||
@@ -67,14 +67,14 @@ LCFI10:
|
||||
subq $48, %rsp
|
||||
LCFI11:
|
||||
movq %rdi, -24(%rbp)
|
||||
movl %esi, -28(%rbp)
|
||||
movl %edx, -32(%rbp)
|
||||
movl %ecx, -36(%rbp)
|
||||
movq %rsi, -32(%rbp)
|
||||
movq %rdx, -40(%rbp)
|
||||
movq %rcx, -48(%rbp)
|
||||
movq -24(%rbp), %rax
|
||||
movq %rax, -8(%rbp)
|
||||
movl -36(%rbp), %edx
|
||||
movl -32(%rbp), %esi
|
||||
movl -28(%rbp), %edi
|
||||
movq -48(%rbp), %rdx
|
||||
movq -40(%rbp), %rsi
|
||||
movq -32(%rbp), %rdi
|
||||
movq -8(%rbp), %rax
|
||||
call *%rax
|
||||
leave
|
||||
@@ -87,19 +87,19 @@ LFB6:
|
||||
LCFI12:
|
||||
movq %rsp, %rbp
|
||||
LCFI13:
|
||||
subq $48, %rsp
|
||||
subq $64, %rsp
|
||||
LCFI14:
|
||||
movq %rdi, -24(%rbp)
|
||||
movl %esi, -28(%rbp)
|
||||
movl %edx, -32(%rbp)
|
||||
movl %ecx, -36(%rbp)
|
||||
movl %r8d, -40(%rbp)
|
||||
movq %rsi, -32(%rbp)
|
||||
movq %rdx, -40(%rbp)
|
||||
movq %rcx, -48(%rbp)
|
||||
movq %r8, -56(%rbp)
|
||||
movq -24(%rbp), %rax
|
||||
movq %rax, -8(%rbp)
|
||||
movl -40(%rbp), %ecx
|
||||
movl -36(%rbp), %edx
|
||||
movl -32(%rbp), %esi
|
||||
movl -28(%rbp), %edi
|
||||
movq -56(%rbp), %rcx
|
||||
movq -48(%rbp), %rdx
|
||||
movq -40(%rbp), %rsi
|
||||
movq -32(%rbp), %rdi
|
||||
movq -8(%rbp), %rax
|
||||
call *%rax
|
||||
leave
|
||||
@@ -112,35 +112,35 @@ LFB7:
|
||||
LCFI15:
|
||||
movq %rsp, %rbp
|
||||
LCFI16:
|
||||
subq $80, %rsp
|
||||
subq $96, %rsp
|
||||
LCFI17:
|
||||
movq %rdi, -24(%rbp)
|
||||
movl %esi, -28(%rbp)
|
||||
movl %edx, -32(%rbp)
|
||||
movl %ecx, -36(%rbp)
|
||||
movl %r8d, -40(%rbp)
|
||||
movl %r9d, -44(%rbp)
|
||||
movq %rsi, -32(%rbp)
|
||||
movq %rdx, -40(%rbp)
|
||||
movq %rcx, -48(%rbp)
|
||||
movq %r8, -56(%rbp)
|
||||
movq %r9, -64(%rbp)
|
||||
movq -24(%rbp), %rax
|
||||
movq %rax, -8(%rbp)
|
||||
movl -44(%rbp), %edx
|
||||
movl -40(%rbp), %ecx
|
||||
movl -36(%rbp), %esi
|
||||
movl -32(%rbp), %edi
|
||||
movl -28(%rbp), %r10d
|
||||
movl 48(%rbp), %eax
|
||||
movl %eax, 24(%rsp)
|
||||
movl 40(%rbp), %eax
|
||||
movl %eax, 16(%rsp)
|
||||
movl 32(%rbp), %eax
|
||||
movl %eax, 8(%rsp)
|
||||
movl 24(%rbp), %eax
|
||||
movl %eax, (%rsp)
|
||||
movq -64(%rbp), %rdx
|
||||
movq -56(%rbp), %rcx
|
||||
movq -48(%rbp), %rsi
|
||||
movq -40(%rbp), %rdi
|
||||
movq -32(%rbp), %r10
|
||||
movq 48(%rbp), %rax
|
||||
movq %rax, 24(%rsp)
|
||||
movq 40(%rbp), %rax
|
||||
movq %rax, 16(%rsp)
|
||||
movq 32(%rbp), %rax
|
||||
movq %rax, 8(%rsp)
|
||||
movq 24(%rbp), %rax
|
||||
movq %rax, (%rsp)
|
||||
movq -8(%rbp), %rax
|
||||
movl 16(%rbp), %r9d
|
||||
movl %edx, %r8d
|
||||
movl %esi, %edx
|
||||
movl %edi, %esi
|
||||
movl %r10d, %edi
|
||||
movq 16(%rbp), %r9
|
||||
movq %rdx, %r8
|
||||
movq %rsi, %rdx
|
||||
movq %rdi, %rsi
|
||||
movq %r10, %rdi
|
||||
call *%rax
|
||||
leave
|
||||
ret
|
||||
@@ -156,10 +156,10 @@ LCFI19:
|
||||
LCFI20:
|
||||
movq %rdi, -24(%rbp)
|
||||
movq %rsi, -32(%rbp)
|
||||
movl %edx, -36(%rbp)
|
||||
movq %rdx, -40(%rbp)
|
||||
movq -24(%rbp), %rax
|
||||
movq %rax, -8(%rbp)
|
||||
movl -36(%rbp), %esi
|
||||
movq -40(%rbp), %rsi
|
||||
movq -32(%rbp), %rdi
|
||||
movq -8(%rbp), %rax
|
||||
call *%rax
|
||||
@@ -176,14 +176,14 @@ LCFI22:
|
||||
subq $48, %rsp
|
||||
LCFI23:
|
||||
movq %rdi, -24(%rbp)
|
||||
movl %esi, -28(%rbp)
|
||||
movq %rsi, -32(%rbp)
|
||||
movq %rdx, -40(%rbp)
|
||||
movl %ecx, -44(%rbp)
|
||||
movq %rcx, -48(%rbp)
|
||||
movq -24(%rbp), %rax
|
||||
movq %rax, -8(%rbp)
|
||||
movl -44(%rbp), %edx
|
||||
movq -48(%rbp), %rdx
|
||||
movq -40(%rbp), %rsi
|
||||
movl -28(%rbp), %edi
|
||||
movq -32(%rbp), %rdi
|
||||
movq -8(%rbp), %rax
|
||||
call *%rax
|
||||
leave
|
||||
@@ -196,20 +196,39 @@ LFB10:
|
||||
LCFI24:
|
||||
movq %rsp, %rbp
|
||||
LCFI25:
|
||||
subq $32, %rsp
|
||||
subq $48, %rsp
|
||||
LCFI26:
|
||||
movq %rdi, -24(%rbp)
|
||||
movl %esi, -28(%rbp)
|
||||
movw %dx, -32(%rbp)
|
||||
movq %rsi, -32(%rbp)
|
||||
movw %dx, -36(%rbp)
|
||||
movq -24(%rbp), %rax
|
||||
movq %rax, -8(%rbp)
|
||||
movzwl -32(%rbp), %esi
|
||||
movl -28(%rbp), %edi
|
||||
movzwl -36(%rbp), %esi
|
||||
movq -32(%rbp), %rdi
|
||||
movq -8(%rbp), %rax
|
||||
call *%rax
|
||||
leave
|
||||
ret
|
||||
LFE10:
|
||||
.globl _ReverseGasketUint64
|
||||
_ReverseGasketUint64:
|
||||
LFB11:
|
||||
pushq %rbp
|
||||
LCFI27:
|
||||
movq %rsp, %rbp
|
||||
LCFI28:
|
||||
subq $32, %rsp
|
||||
LCFI29:
|
||||
movq %rdi, -24(%rbp)
|
||||
movq %rsi, -32(%rbp)
|
||||
movq -24(%rbp), %rax
|
||||
movq %rax, -8(%rbp)
|
||||
movq -32(%rbp), %rdi
|
||||
movq -8(%rbp), %rax
|
||||
call *%rax
|
||||
leave
|
||||
ret
|
||||
LFE11:
|
||||
.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
|
||||
EH_frame1:
|
||||
.set L$set$0,LECIE1-LSCIE1
|
||||
@@ -455,4 +474,29 @@ LASFDE17:
|
||||
.byte 0x6
|
||||
.align 3
|
||||
LEFDE17:
|
||||
.globl _ReverseGasketUint64.eh
|
||||
_ReverseGasketUint64.eh:
|
||||
LSFDE19:
|
||||
.set L$set$37,LEFDE19-LASFDE19
|
||||
.long L$set$37
|
||||
LASFDE19:
|
||||
.long LASFDE19-EH_frame1
|
||||
.quad LFB11-.
|
||||
.set L$set$38,LFE11-LFB11
|
||||
.quad L$set$38
|
||||
.byte 0x0
|
||||
.byte 0x4
|
||||
.set L$set$39,LCFI27-LFB11
|
||||
.long L$set$39
|
||||
.byte 0xe
|
||||
.byte 0x10
|
||||
.byte 0x86
|
||||
.byte 0x2
|
||||
.byte 0x4
|
||||
.set L$set$40,LCFI28-LCFI27
|
||||
.long L$set$40
|
||||
.byte 0xd
|
||||
.byte 0x6
|
||||
.align 3
|
||||
LEFDE19:
|
||||
.subsections_via_symbols
|
||||
|
153
UnixPkg/Sec/X64/GasketTemplate.c
Normal file
153
UnixPkg/Sec/X64/GasketTemplate.c
Normal file
@@ -0,0 +1,153 @@
|
||||
/** @file
|
||||
Template file used to create Gasket.S
|
||||
|
||||
This file is built on the command line via gcc GasketTemplate.c -S
|
||||
and it will create GasketTemplate.s and this was used to create
|
||||
Gasket.S. This builds code for Unix ABI on both sides. To convert
|
||||
to EFI ABI will require changing the code by hand
|
||||
|
||||
Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
|
||||
Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
typedef int8_t INT8;
|
||||
typedef uint8_t UINT8;
|
||||
typedef int16_t INT16;
|
||||
typedef uint16_t UINT16;
|
||||
typedef int32_t INT32;
|
||||
typedef uint32_t UINT32;
|
||||
typedef int64_t INT64;
|
||||
typedef uint64_t UINT64;
|
||||
typedef UINT64 UINTN;
|
||||
|
||||
|
||||
typedef UINTN (*GASKET_VOID) ();
|
||||
typedef UINTN (*GASKET_UINTN) (UINTN);
|
||||
typedef UINTN (*GASKET_UINTN_UINTN) (UINTN, UINTN);
|
||||
typedef UINTN (*GASKET_UINTN_UINTN_UINTN) (UINTN, UINTN, UINTN);
|
||||
typedef UINTN (*GASKET_UINTN_UINTN_UINTN_UINTN) (UINTN, UINTN, UINTN, UINTN);
|
||||
typedef UINTN (*GASKET_UINTN_10ARGS) (UINTN, UINTN, UINTN, UINTN, UINTN, UINTN, UINTN, UINTN, UINTN, UINTN);
|
||||
typedef UINTN (*GASKET_UINT64_UINTN) (UINT64, UINTN);
|
||||
typedef UINT64 (*GASKET_UINTN_UINT64_UINTN) (UINTN, UINT64, UINTN);
|
||||
typedef UINTN (*GASKET_UINTN_UINT16) (UINTN, UINT16);
|
||||
|
||||
UINTN GasketVoid (void *api);
|
||||
UINTN GasketUintn (void *api, UINTN a);
|
||||
UINTN GasketUintnUintn (void *api, UINTN a, UINTN b);
|
||||
UINTN GasketUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c);
|
||||
UINTN GasketUintnUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c, UINTN d);
|
||||
UINTN GasketUintn10Args (void *api, UINTN a, UINTN b, UINTN c, UINTN d, UINTN e, UINTN f, UINTN g, UINTN h, UINTN i, UINTN j);
|
||||
UINTN GasketUint64Uintn (void *api, UINT64 a, UINTN b);
|
||||
UINT64 GasketUintnUiny64Uintn (void *api, UINTN a, UINT64 b, UINTN c);
|
||||
UINTN GasketUintnUint16 (void *api, UINTN a, UINT16 b);
|
||||
|
||||
|
||||
|
||||
UINTN
|
||||
GasketVoid (void *api)
|
||||
{
|
||||
GASKET_VOID func;
|
||||
|
||||
func = (GASKET_VOID)api;
|
||||
return func ();
|
||||
}
|
||||
|
||||
UINTN
|
||||
GasketUintn (void *api, UINTN a)
|
||||
{
|
||||
GASKET_UINTN func;
|
||||
|
||||
func = (GASKET_UINTN)api;
|
||||
return func (a);
|
||||
}
|
||||
|
||||
UINTN
|
||||
GasketUintnUintn (void *api, UINTN a, UINTN b)
|
||||
{
|
||||
GASKET_UINTN_UINTN func;
|
||||
|
||||
func = (GASKET_UINTN_UINTN)api;
|
||||
return func (a, b);
|
||||
}
|
||||
|
||||
|
||||
UINTN
|
||||
GasketUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c)
|
||||
{
|
||||
GASKET_UINTN_UINTN_UINTN func;
|
||||
|
||||
func = (GASKET_UINTN_UINTN_UINTN)api;
|
||||
return func (a, b, c);
|
||||
}
|
||||
|
||||
UINTN
|
||||
GasketUintnUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c, UINTN d)
|
||||
{
|
||||
GASKET_UINTN_UINTN_UINTN_UINTN func;
|
||||
|
||||
func = (GASKET_UINTN_UINTN_UINTN_UINTN)api;
|
||||
return func (a, b, c, d);
|
||||
}
|
||||
|
||||
UINTN
|
||||
GasketUintn10Args (void *api, UINTN a, UINTN b, UINTN c, UINTN d, UINTN e, UINTN f, UINTN g, UINTN h, UINTN i, UINTN j)
|
||||
{
|
||||
GASKET_UINTN_10ARGS func;
|
||||
|
||||
func = (GASKET_UINTN_10ARGS)api;
|
||||
return func (a, b, c, d, e, f, g, h, i, j);
|
||||
}
|
||||
|
||||
|
||||
UINTN
|
||||
GasketUint64Uintn (void *api, UINT64 a, UINTN b)
|
||||
{
|
||||
GASKET_UINT64_UINTN func;
|
||||
|
||||
func = (GASKET_UINT64_UINTN)api;
|
||||
return func (a, b);
|
||||
}
|
||||
|
||||
UINT64
|
||||
GasketUintnUint64Uintn (void *api, UINTN a, UINT64 b, UINTN c)
|
||||
{
|
||||
GASKET_UINTN_UINT64_UINTN func;
|
||||
|
||||
func = (GASKET_UINTN_UINT64_UINTN)api;
|
||||
return func (a, b, c);
|
||||
}
|
||||
|
||||
UINTN
|
||||
GasketUintnUint16 (void *api, UINTN a, UINT16 b)
|
||||
{
|
||||
GASKET_UINTN_UINT16 func;
|
||||
|
||||
func = (GASKET_UINTN_UINT16)api;
|
||||
return func (a, b);
|
||||
}
|
||||
|
||||
void
|
||||
ReverseGasketUint64 (void *api, UINT64 a)
|
||||
{
|
||||
GASKET_UINTN func;
|
||||
|
||||
func = (GASKET_UINTN)api;
|
||||
func (a);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user