summaryrefslogtreecommitdiff
path: root/UnixPkg/Include
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
parent7f22d35110e43be45a0e16a2e944feebbf51e4ed (diff)
downloadedk2-platforms-ccd55824e79865a04b1c872bda4af0f1de1f50be.tar.xz
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')
-rw-r--r--UnixPkg/Include/Common/UnixInclude.h30
-rw-r--r--UnixPkg/Include/Ppi/UnixAutoScan.h2
-rw-r--r--UnixPkg/Include/Ppi/UnixFwh.h2
-rw-r--r--UnixPkg/Include/Ppi/UnixPeiLoadFile.h2
-rw-r--r--UnixPkg/Include/Ppi/UnixThunk.h2
-rw-r--r--UnixPkg/Include/Protocol/UnixIo.h20
-rw-r--r--UnixPkg/Include/Protocol/UnixThunk.h55
-rw-r--r--UnixPkg/Include/UnixDxe.h2
8 files changed, 86 insertions, 29 deletions
diff --git a/UnixPkg/Include/Common/UnixInclude.h b/UnixPkg/Include/Common/UnixInclude.h
index 922964672c..487386f9cb 100644
--- a/UnixPkg/Include/Common/UnixInclude.h
+++ b/UnixPkg/Include/Common/UnixInclude.h
@@ -1,6 +1,7 @@
/*++
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2009, Intel Corporation
+Portions copyright (c) 2008-2009 Apple Inc.
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
@@ -19,14 +20,21 @@ Abstract:
#ifndef __UNIX_INCLUDE_H__
#define __UNIX_INCLUDE_H__
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/vfs.h>
-#include <sys/poll.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <time.h>
-#include <utime.h>
-#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef __APPLE__
+#include <sys/param.h>
+#include <sys/mount.h>
+#else
+#include <sys/vfs.h>
+#endif
+
+#include <sys/poll.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <time.h>
+#include <utime.h>
+#include <unistd.h>
#endif
diff --git a/UnixPkg/Include/Ppi/UnixAutoScan.h b/UnixPkg/Include/Ppi/UnixAutoScan.h
index 0c04d8202e..9660796eff 100644
--- a/UnixPkg/Include/Ppi/UnixAutoScan.h
+++ b/UnixPkg/Include/Ppi/UnixAutoScan.h
@@ -26,7 +26,7 @@ Unix Autoscan PPI
#define PEI_UNIX_AUTOSCAN_PPI_GUID \
{ \
- 0xf2ed3d14, 0x8985, 0x11db, {0xb0, 0x57, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xf2ed3d14, 0x8985, 0x11db, {0xb0, 0x57, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
typedef
diff --git a/UnixPkg/Include/Ppi/UnixFwh.h b/UnixPkg/Include/Ppi/UnixFwh.h
index a9885a57bf..1deed11454 100644
--- a/UnixPkg/Include/Ppi/UnixFwh.h
+++ b/UnixPkg/Include/Ppi/UnixFwh.h
@@ -26,7 +26,7 @@ Abstract:
#define UNIX_FWH_PPI_GUID \
{ \
- 0xf2f0dc30, 0x8985, 0x11db, {0xa1, 0x5b, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xf2f0dc30, 0x8985, 0x11db, {0xa1, 0x5b, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
typedef
diff --git a/UnixPkg/Include/Ppi/UnixPeiLoadFile.h b/UnixPkg/Include/Ppi/UnixPeiLoadFile.h
index b91c630b5a..cfd58fdb35 100644
--- a/UnixPkg/Include/Ppi/UnixPeiLoadFile.h
+++ b/UnixPkg/Include/Ppi/UnixPeiLoadFile.h
@@ -28,7 +28,7 @@ Abstract:
#define UNIX_PEI_LOAD_FILE_GUID \
{ \
- 0xf2f48768, 0x8985, 0x11db, {0xb8, 0xda, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xf2f48768, 0x8985, 0x11db, {0xb8, 0xda, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
typedef
diff --git a/UnixPkg/Include/Ppi/UnixThunk.h b/UnixPkg/Include/Ppi/UnixThunk.h
index 866bd61398..ba4d413131 100644
--- a/UnixPkg/Include/Ppi/UnixThunk.h
+++ b/UnixPkg/Include/Ppi/UnixThunk.h
@@ -26,7 +26,7 @@ Abstract:
#define PEI_UNIX_THUNK_PPI_GUID \
{ \
- 0xf2f830f2, 0x8985, 0x11db, {0x80, 0x6b, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xf2f830f2, 0x8985, 0x11db, {0x80, 0x6b, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
typedef
diff --git a/UnixPkg/Include/Protocol/UnixIo.h b/UnixPkg/Include/Protocol/UnixIo.h
index 1758ecb7c4..c25b06f071 100644
--- a/UnixPkg/Include/Protocol/UnixIo.h
+++ b/UnixPkg/Include/Protocol/UnixIo.h
@@ -22,7 +22,7 @@ Abstract:
#define EFI_UNIX_IO_PROTOCOL_GUID \
{ \
- 0xf2e23f54, 0x8985, 0x11db, {0xac, 0x79, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xf2e23f54, 0x8985, 0x11db, {0xac, 0x79, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
typedef struct {
@@ -44,7 +44,7 @@ extern EFI_GUID gEfiUnixIoProtocolGuid;
//
#define EFI_UNIX_VIRTUAL_DISKS_GUID \
{ \
- 0xf2ba331a, 0x8985, 0x11db, {0xa4, 0x06, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xf2ba331a, 0x8985, 0x11db, {0xa4, 0x06, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
extern EFI_GUID gEfiUnixVirtualDisksGuid;
@@ -54,7 +54,7 @@ extern EFI_GUID gEfiUnixVirtualDisksGuid;
//
#define EFI_UNIX_PHYSICAL_DISKS_GUID \
{ \
- 0xf2bdcc96, 0x8985, 0x11db, {0x87, 0x19, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xf2bdcc96, 0x8985, 0x11db, {0x87, 0x19, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
extern EFI_GUID gEfiUnixPhysicalDisksGuid;
@@ -64,7 +64,7 @@ extern EFI_GUID gEfiUnixPhysicalDisksGuid;
//
#define EFI_UNIX_FILE_SYSTEM_GUID \
{ \
- 0xf2c16b9e, 0x8985, 0x11db, {0x92, 0xc8, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xf2c16b9e, 0x8985, 0x11db, {0x92, 0xc8, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
extern EFI_GUID gEfiUnixFileSystemGuid;
@@ -84,7 +84,7 @@ extern EFI_GUID gEfiUnixSerialPortGuid;
//
#define EFI_UNIX_UGA_GUID \
{ \
- 0xf2c8b80e, 0x8985, 0x11db, {0x93, 0xf1, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xf2c8b80e, 0x8985, 0x11db, {0x93, 0xf1, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
extern EFI_GUID gEfiUnixUgaGuid;
@@ -94,7 +94,7 @@ extern EFI_GUID gEfiUnixUgaGuid;
//
#define EFI_UNIX_GOP_GUID \
{ \
- 0xbace07c2, 0x8987, 0x11db, {0xa5, 0x9a, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xbace07c2, 0x8987, 0x11db, {0xa5, 0x9a, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
extern EFI_GUID gEfiUnixGopGuid;
@@ -104,7 +104,7 @@ extern EFI_GUID gEfiUnixGopGuid;
//
#define EFI_UNIX_CONSOLE_GUID \
{ \
- 0xf2cc5d06, 0x8985, 0x11db, {0xbb, 0x19, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xf2cc5d06, 0x8985, 0x11db, {0xbb, 0x19, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
extern EFI_GUID gEfiUnixConsoleGuid;
@@ -114,7 +114,7 @@ extern EFI_GUID gEfiUnixConsoleGuid;
//
#define EFI_UNIX_MEMORY_GUID \
{ \
- 0xf2d006cc, 0x8985, 0x11db, {0xa4, 0x72, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xf2d006cc, 0x8985, 0x11db, {0xa4, 0x72, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
extern EFI_GUID gEfiUnixMemoryGuid;
@@ -124,7 +124,7 @@ extern EFI_GUID gEfiUnixMemoryGuid;
//
#define EFI_UNIX_CPU_MODEL_GUID \
{ \
- 0xf2d3b330, 0x8985, 0x11db, {0x8a, 0xa3, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xf2d3b330, 0x8985, 0x11db, {0x8a, 0xa3, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
extern EFI_GUID gEfiUnixCPUModelGuid;
@@ -134,7 +134,7 @@ extern EFI_GUID gEfiUnixCPUModelGuid;
//
#define EFI_UNIX_CPU_SPEED_GUID \
{ \
- 0xf2d74e5a, 0x8985, 0x11db, {0x97, 0x05, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
+ 0xf2d74e5a, 0x8985, 0x11db, {0x97, 0x05, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
}
extern EFI_GUID gEfiUnixCPUSpeedGuid;
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;
diff --git a/UnixPkg/Include/UnixDxe.h b/UnixPkg/Include/UnixDxe.h
index 29a0c16e0f..7ab91b900d 100644
--- a/UnixPkg/Include/UnixDxe.h
+++ b/UnixPkg/Include/UnixDxe.h
@@ -29,7 +29,7 @@ Abstract:
// UnixIo.h depends on UnixThunk.h
//
-#include <Common/UnixInclude.h>
+#include <Common/UnixInclude.h>
#include <Protocol/UnixThunk.h>
#include <Protocol/UnixIo.h>