diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-25 07:29:13 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-25 07:29:13 +0000 |
commit | ccd55824e79865a04b1c872bda4af0f1de1f50be (patch) | |
tree | e67acf21c32a61eeaebf1f28d87df97732b80187 /UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c | |
parent | 7f22d35110e43be45a0e16a2e944feebbf51e4ed (diff) | |
download | edk2-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/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c')
-rw-r--r-- | UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c b/UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c index be9cba831c..ef0d6c17cb 100644 --- a/UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c +++ b/UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c @@ -1,6 +1,7 @@ /*++
-Copyright (c) 2006 - 2008, Intel Corporation
+Copyright (c) 2006 - 2009, Intel Corporation
+Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.
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
@@ -54,38 +55,24 @@ Returns: --*/
{
+ PEI_UNIX_THUNK_PPI *UnixThunkPpi;
EFI_STATUS Status;
- EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;
- UNIX_PEI_LOAD_FILE_PPI *PeiUnixService;
- EFI_PHYSICAL_ADDRESS ImageAddress;
- UINT64 ImageSize;
- EFI_PHYSICAL_ADDRESS ImageEntryPoint;
-
- ASSERT (Pe32Data != NULL);
- ASSERT (EntryPoint != NULL);
+ EFI_UNIX_THUNK_PROTOCOL *Unix;
+ //
+ // Locate Unix ThunkPpi for retrieving standard output handle
+ //
Status = PeiServicesLocatePpi (
- &gUnixPeiLoadFilePpiGuid,
+ &gPeiUnixThunkPpiGuid,
0,
- &PpiDescriptor,
- (void **)&PeiUnixService
+ NULL,
+ (VOID **) &UnixThunkPpi
);
-
ASSERT_EFI_ERROR (Status);
- Status = PeiUnixService->PeiLoadFileService (
- Pe32Data,
- &ImageAddress,
- &ImageSize,
- &ImageEntryPoint
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
+ Unix = (EFI_UNIX_THUNK_PROTOCOL *)UnixThunkPpi->UnixThunk ();
- *EntryPoint = (VOID*)(UINTN)ImageEntryPoint;
- return Status;
+ return Unix->PeCoffGetEntryPoint (Pe32Data, EntryPoint);
}
/**
@@ -255,6 +242,8 @@ PeCoffLoaderGetPdbPointer ( return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY));
case CODEVIEW_SIGNATURE_RSDS:
return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY));
+ case CODEVIEW_SIGNATURE_MTOC:
+ return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY));
default:
break;
}
|