mirror of https://github.com/acidanthera/audk.git
Removed #ifdef NT32 as we don't need them for tools
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@368 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
6e11a8e96e
commit
dfd3f9ce4d
|
@ -26,11 +26,6 @@ Revision History
|
||||||
#include "PeiLib.h"
|
#include "PeiLib.h"
|
||||||
#include "PeCoffLoaderEx.h"
|
#include "PeCoffLoaderEx.h"
|
||||||
|
|
||||||
#ifdef EFI_NT_EMULATOR
|
|
||||||
#include "peilib.h"
|
|
||||||
#include "EfiHobLib.h"
|
|
||||||
#include EFI_PPI_DEFINITION (NtLoadAsDll)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
STATIC
|
STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -89,9 +84,6 @@ EFI_PEI_PE_COFF_LOADER_PROTOCOL mPeCoffLoader = {
|
||||||
PeCoffLoaderUnloadImage
|
PeCoffLoaderUnloadImage
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef EFI_NT_EMULATOR
|
|
||||||
EFI_NT_LOAD_AS_DLL_PPI *mPeCoffLoaderWinNtLoadAsDll = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
InstallEfiPeiPeCoffLoader (
|
InstallEfiPeiPeCoffLoader (
|
||||||
|
@ -119,38 +111,11 @@ Returns:
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
|
||||||
|
|
||||||
Status = EFI_SUCCESS;
|
|
||||||
|
|
||||||
#ifdef EFI_NT_EMULATOR
|
|
||||||
//
|
|
||||||
// For use by PEI Core and Modules
|
|
||||||
//
|
|
||||||
if (NULL != PeiServices) {
|
|
||||||
Status = (**PeiServices).LocatePpi (
|
|
||||||
PeiServices,
|
|
||||||
&gEfiNtLoadAsDllPpiGuid,
|
|
||||||
0,
|
|
||||||
NULL,
|
|
||||||
&mPeCoffLoaderWinNtLoadAsDll
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
//
|
|
||||||
// Now in SecMain or ERM usage, bind appropriately
|
|
||||||
//
|
|
||||||
PEI_ASSERT (PeiServices, (NULL != ThisPpi));
|
|
||||||
|
|
||||||
mPeCoffLoaderWinNtLoadAsDll = (EFI_NT_LOAD_AS_DLL_PPI *) ThisPpi;
|
|
||||||
PEI_ASSERT (PeiServices, (NULL != mPeCoffLoaderWinNtLoadAsDll));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (NULL != This) {
|
if (NULL != This) {
|
||||||
*This = &mPeCoffLoader;
|
*This = &mPeCoffLoader;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Status;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC
|
STATIC
|
||||||
|
@ -664,11 +629,6 @@ Returns:
|
||||||
UINT32 *F32;
|
UINT32 *F32;
|
||||||
CHAR8 *FixupData;
|
CHAR8 *FixupData;
|
||||||
EFI_PHYSICAL_ADDRESS BaseAddress;
|
EFI_PHYSICAL_ADDRESS BaseAddress;
|
||||||
#ifdef EFI_NT_EMULATOR
|
|
||||||
VOID *DllEntryPoint;
|
|
||||||
VOID *ModHandle;
|
|
||||||
ModHandle = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
PeHdr = NULL;
|
PeHdr = NULL;
|
||||||
TeHdr = NULL;
|
TeHdr = NULL;
|
||||||
|
@ -830,27 +790,6 @@ Returns:
|
||||||
RelocBase = (EFI_IMAGE_BASE_RELOCATION *) RelocEnd;
|
RelocBase = (EFI_IMAGE_BASE_RELOCATION *) RelocEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EFI_NT_EMULATOR
|
|
||||||
DllEntryPoint = NULL;
|
|
||||||
ImageContext->ModHandle = NULL;
|
|
||||||
//
|
|
||||||
// Load the DLL if it's not an EBC image.
|
|
||||||
//
|
|
||||||
if ((ImageContext->PdbPointer != NULL) &&
|
|
||||||
(ImageContext->Machine != EFI_IMAGE_MACHINE_EBC)) {
|
|
||||||
Status = mPeCoffLoaderWinNtLoadAsDll->Entry (
|
|
||||||
ImageContext->PdbPointer,
|
|
||||||
&DllEntryPoint,
|
|
||||||
&ModHandle
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!EFI_ERROR (Status) && DllEntryPoint != NULL) {
|
|
||||||
ImageContext->EntryPoint = (EFI_PHYSICAL_ADDRESS) (UINTN) DllEntryPoint;
|
|
||||||
ImageContext->ModHandle = ModHandle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1237,13 +1176,5 @@ Returns:
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
#ifdef EFI_NT_EMULATOR
|
|
||||||
//
|
|
||||||
// Calling Win32 API free library
|
|
||||||
//
|
|
||||||
mPeCoffLoaderWinNtLoadAsDll->FreeLibrary (ImageContext->ModHandle);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,42 +259,6 @@ Returns:
|
||||||
#define PEI_PERF_END(Ps, Token, FileHeader, Value)
|
#define PEI_PERF_END(Ps, Token, FileHeader, Value)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EFI_NT_EMULATOR
|
|
||||||
EFI_STATUS
|
|
||||||
PeCoffLoaderWinNtLoadAsDll (
|
|
||||||
IN CHAR8 *PdbFileName,
|
|
||||||
IN VOID **ImageEntryPoint,
|
|
||||||
OUT VOID **ModHandle
|
|
||||||
)
|
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Loads the .DLL file is present when a PE/COFF file is loaded. This provides source level
|
|
||||||
debugging for drivers that have cooresponding .DLL files on the local system.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
PdbFileName - The name of the .PDB file. This was found from the PE/COFF
|
|
||||||
file's debug directory entry.
|
|
||||||
|
|
||||||
ImageEntryPoint - A pointer to the DLL entry point of the .DLL file was loaded.
|
|
||||||
|
|
||||||
ModHandle - Pointer to loaded library.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
EFI_SUCCESS - The .DLL file was loaded, and the DLL entry point is returned in ImageEntryPoint
|
|
||||||
|
|
||||||
EFI_NOT_FOUND - The .DLL file could not be found
|
|
||||||
|
|
||||||
EFI_UNSUPPORTED - The .DLL file was loaded, but the entry point to the .DLL file could not
|
|
||||||
determined.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
//
|
//
|
||||||
// hob.c
|
// hob.c
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue