From ccd55824e79865a04b1c872bda4af0f1de1f50be Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Tue, 25 Aug 2009 07:29:13 +0000 Subject: 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 --- UnixPkg/Include/Protocol/UnixThunk.h | 55 ++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 3 deletions(-) (limited to 'UnixPkg/Include/Protocol/UnixThunk.h') 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.
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 #include #include + +#if __CYGWIN__ +#include +#else #include +#endif + #include #include #include @@ -42,12 +49,24 @@ Abstract: #include #include #include -#include #include + +#ifdef __APPLE__ +#include +#include +#define _XOPEN_SOURCE +#else +#include #include +#endif + #include #include +#include +#include + + #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; -- cgit v1.2.3