summaryrefslogtreecommitdiffstats
path: root/UnixPkg/Include/Protocol/UnixThunk.h
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-25 07:29:13 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-25 07:29:13 +0000
commitccd55824e79865a04b1c872bda4af0f1de1f50be (patch)
treee67acf21c32a61eeaebf1f28d87df97732b80187 /UnixPkg/Include/Protocol/UnixThunk.h
parent7f22d35110e43be45a0e16a2e944feebbf51e4ed (diff)
downloadedk2-ccd55824e79865a04b1c872bda4af0f1de1f50be.tar.gz
edk2-ccd55824e79865a04b1c872bda4af0f1de1f50be.tar.bz2
edk2-ccd55824e79865a04b1c872bda4af0f1de1f50be.zip
Integrate patch from Andrew Fish to make it run on OS X.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9194 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UnixPkg/Include/Protocol/UnixThunk.h')
-rw-r--r--UnixPkg/Include/Protocol/UnixThunk.h55
1 files changed, 52 insertions, 3 deletions
diff --git a/UnixPkg/Include/Protocol/UnixThunk.h b/UnixPkg/Include/Protocol/UnixThunk.h
index ba325bff87..29a9791292 100644
--- a/UnixPkg/Include/Protocol/UnixThunk.h
+++ b/UnixPkg/Include/Protocol/UnixThunk.h
@@ -1,6 +1,7 @@
/*++
-Copyright (c) 2004, Intel Corporation
+Copyright (c) 2004 - 2009, Intel Corporation
+Portions copyright (c) 2008-2009 Apple Inc.<BR>
All rights reserved. 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
@@ -31,7 +32,13 @@ Abstract:
#include <sys/termios.h>
#include <stdio.h>
#include <sys/time.h>
+
+#if __CYGWIN__
+#include <sys/dirent.h>
+#else
#include <sys/dir.h>
+#endif
+
#include <unistd.h>
#include <poll.h>
#include <sys/types.h>
@@ -42,12 +49,24 @@ Abstract:
#include <errno.h>
#include <string.h>
#include <stdlib.h>
-#include <termio.h>
#include <sys/ioctl.h>
+
+#ifdef __APPLE__
+#include <sys/param.h>
+#include <sys/mount.h>
+#define _XOPEN_SOURCE
+#else
+#include <termio.h>
#include <sys/vfs.h>
+#endif
+
#include <utime.h>
#include <dlfcn.h>
+#include <Base.h>
+#include <Library/PeCoffLib.h>
+
+
#define EFI_UNIX_THUNK_PROTOCOL_GUID \
{ \
0xf2e98868, 0x8985, 0x11db, {0x9a, 0x59, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
@@ -167,7 +186,11 @@ void
typedef
int
+#if __CYGWIN__
+(*UnixIoCtl) (int fd, int __request, ...);
+#else
(*UnixIoCtl) (int fd, unsigned long int __request, ...);
+#endif
typedef
int
@@ -204,8 +227,29 @@ VOID *
//
+// Work functions to enable source level debug in the emulator
//
-//
+
+typedef
+RETURN_STATUS
+(EFIAPI *UnixPeCoffGetEntryPoint) (
+ IN VOID *Pe32Data,
+ IN OUT VOID **EntryPoint
+ );
+
+typedef
+VOID
+(EFIAPI *UnixPeCoffRelocateImageExtraAction) (
+ IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
+ );
+
+typedef
+VOID
+(EFIAPI *UnixPeCoffLoaderUnloadImageExtraAction) (
+ IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
+ );
+
+
#define EFI_UNIX_THUNK_PROTOCOL_SIGNATURE SIGNATURE_32 ('L', 'N', 'X', 'T')
@@ -254,6 +298,11 @@ typedef struct _EFI_UNIX_THUNK_PROTOCOL {
UnixDlopen Dlopen;
UnixDlerror Dlerror;
UnixDlsym Dlsym;
+ UnixPeCoffGetEntryPoint PeCoffGetEntryPoint;
+ UnixPeCoffRelocateImageExtraAction PeCoffRelocateImageExtraAction;
+ UnixPeCoffLoaderUnloadImageExtraAction PeCoffUnloadImageExtraAction;
+
+
} EFI_UNIX_THUNK_PROTOCOL;
extern EFI_GUID gEfiUnixThunkProtocolGuid;