add debug information.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5266 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2008-05-21 08:32:06 +00:00
parent 7e1230b6a1
commit 57d6f36db6

View File

@ -76,7 +76,7 @@ LOADED_IMAGE_PRIVATE_DATA mCorePrivateImage = {
Add the Image Services to EFI Boot Services Table and install the protocol Add the Image Services to EFI Boot Services Table and install the protocol
interfaces for this image. interfaces for this image.
@param HobStart The HOB to initialize @param HobStart The HOB to initialize
@return Status code. @return Status code.
@ -158,27 +158,27 @@ CoreInitializeImageServices (
/** /**
Loads, relocates, and invokes a PE/COFF image Loads, relocates, and invokes a PE/COFF image
@param BootPolicy If TRUE, indicates that the request originates @param BootPolicy If TRUE, indicates that the request originates
from the boot manager, and that the boot from the boot manager, and that the boot
manager is attempting to load FilePath as a manager is attempting to load FilePath as a
boot selection. boot selection.
@param Pe32Handle The handle of PE32 image @param Pe32Handle The handle of PE32 image
@param Image PE image to be loaded @param Image PE image to be loaded
@param DstBuffer The buffer to store the image @param DstBuffer The buffer to store the image
@param EntryPoint A pointer to the entry point @param EntryPoint A pointer to the entry point
@param Attribute The bit mask of attributes to set for the load @param Attribute The bit mask of attributes to set for the load
PE image PE image
@retval EFI_SUCCESS The file was loaded, relocated, and invoked @retval EFI_SUCCESS The file was loaded, relocated, and invoked
@retval EFI_OUT_OF_RESOURCES There was not enough memory to load and @retval EFI_OUT_OF_RESOURCES There was not enough memory to load and
relocate the PE/COFF file relocate the PE/COFF file
@retval EFI_INVALID_PARAMETER Invalid parameter @retval EFI_INVALID_PARAMETER Invalid parameter
@retval EFI_BUFFER_TOO_SMALL Buffer for image is too small @retval EFI_BUFFER_TOO_SMALL Buffer for image is too small
**/ **/
EFI_STATUS EFI_STATUS
CoreLoadPeImage ( CoreLoadPeImage (
IN BOOLEAN BootPolicy, IN BOOLEAN BootPolicy,
IN VOID *Pe32Handle, IN VOID *Pe32Handle,
IN LOADED_IMAGE_PRIVATE_DATA *Image, IN LOADED_IMAGE_PRIVATE_DATA *Image,
IN EFI_PHYSICAL_ADDRESS DstBuffer OPTIONAL, IN EFI_PHYSICAL_ADDRESS DstBuffer OPTIONAL,
@ -216,7 +216,7 @@ CoreLoadPeImage (
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
} }
// //
// Set EFI memory type based on ImageType // Set EFI memory type based on ImageType
// //
@ -396,6 +396,7 @@ CoreLoadPeImage (
// //
Status = CoreLocateProtocol (&gEfiEbcProtocolGuid, NULL, (VOID **)&Image->Ebc); Status = CoreLocateProtocol (&gEfiEbcProtocolGuid, NULL, (VOID **)&Image->Ebc);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
DEBUG ((DEBUG_LOAD | DEBUG_ERROR, "CoreLoadPeImage: There is no EBC interpreter for an EBC image.\n"));
goto Done; goto Done;
} }
@ -464,22 +465,22 @@ CoreLoadPeImage (
UINTN Index; UINTN Index;
UINTN StartIndex; UINTN StartIndex;
CHAR8 EfiFileName[256]; CHAR8 EfiFileName[256];
if (Image->ImageContext.Machine != IMAGE_FILE_MACHINE_IA64) { if (Image->ImageContext.Machine != IMAGE_FILE_MACHINE_IA64) {
DEBUG ((DEBUG_INFO | DEBUG_LOAD, DEBUG ((DEBUG_INFO | DEBUG_LOAD,
"Loading driver at 0x%10p EntryPoint=0x%10p ", "Loading driver at 0x%10p EntryPoint=0x%10p ",
(VOID *)(UINTN)Image->ImageContext.ImageAddress, (VOID *)(UINTN)Image->ImageContext.ImageAddress,
(VOID *)(UINTN)Image->ImageContext.EntryPoint)); (VOID *)(UINTN)Image->ImageContext.EntryPoint));
} else { } else {
// //
// For IPF Image, the real entry point should be print. // For IPF Image, the real entry point should be print.
// //
DEBUG ((DEBUG_INFO | DEBUG_LOAD, DEBUG ((DEBUG_INFO | DEBUG_LOAD,
"Loading driver at 0x%10p EntryPoint=0x%10p ", "Loading driver at 0x%10p EntryPoint=0x%10p ",
(VOID *)(UINTN)Image->ImageContext.ImageAddress, (VOID *)(UINTN)Image->ImageContext.ImageAddress,
(VOID *)(UINTN)(*(UINT64 *)(UINTN)Image->ImageContext.EntryPoint))); (VOID *)(UINTN)(*(UINT64 *)(UINTN)Image->ImageContext.EntryPoint)));
} }
// //
// Print Module Name by Pdb file path // Print Module Name by Pdb file path
// //
@ -536,7 +537,7 @@ Done:
/** /**
Get the image's private data from its handle. Get the image's private data from its handle.
@param ImageHandle The image handle @param ImageHandle The image handle
@return Return the image private data associated with ImageHandle. @return Return the image private data associated with ImageHandle.
@ -569,36 +570,36 @@ CoreLoadedImageInfo (
/** /**
Loads an EFI image into memory and returns a handle to the image. Loads an EFI image into memory and returns a handle to the image.
@param BootPolicy If TRUE, indicates that the request originates @param BootPolicy If TRUE, indicates that the request originates
from the boot manager, and that the boot from the boot manager, and that the boot
manager is attempting to load FilePath as a manager is attempting to load FilePath as a
boot selection. boot selection.
@param ParentImageHandle The caller's image handle. @param ParentImageHandle The caller's image handle.
@param FilePath The specific file path from which the image is @param FilePath The specific file path from which the image is
loaded. loaded.
@param SourceBuffer If not NULL, a pointer to the memory location @param SourceBuffer If not NULL, a pointer to the memory location
containing a copy of the image to be loaded. containing a copy of the image to be loaded.
@param SourceSize The size in bytes of SourceBuffer. @param SourceSize The size in bytes of SourceBuffer.
@param DstBuffer The buffer to store the image @param DstBuffer The buffer to store the image
@param NumberOfPages If not NULL, it inputs a pointer to the page @param NumberOfPages If not NULL, it inputs a pointer to the page
number of DstBuffer and outputs a pointer to number of DstBuffer and outputs a pointer to
the page number of the image. If this number is the page number of the image. If this number is
not enough, return EFI_BUFFER_TOO_SMALL and not enough, return EFI_BUFFER_TOO_SMALL and
this parameter contains the required number. this parameter contains the required number.
@param ImageHandle Pointer to the returned image handle that is @param ImageHandle Pointer to the returned image handle that is
created when the image is successfully loaded. created when the image is successfully loaded.
@param EntryPoint A pointer to the entry point @param EntryPoint A pointer to the entry point
@param Attribute The bit mask of attributes to set for the load @param Attribute The bit mask of attributes to set for the load
PE image PE image
@retval EFI_SUCCESS The image was loaded into memory. @retval EFI_SUCCESS The image was loaded into memory.
@retval EFI_NOT_FOUND The FilePath was not found. @retval EFI_NOT_FOUND The FilePath was not found.
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value. @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
@retval EFI_BUFFER_TOO_SMALL The buffer is too small @retval EFI_BUFFER_TOO_SMALL The buffer is too small
@retval EFI_UNSUPPORTED The image type is not supported, or the device @retval EFI_UNSUPPORTED The image type is not supported, or the device
path cannot be parsed to locate the proper path cannot be parsed to locate the proper
protocol for loading the file. protocol for loading the file.
@retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient
resources. resources.
**/ **/
@ -747,7 +748,7 @@ CoreLoadImageCommon (
if (NumberOfPages != NULL) { if (NumberOfPages != NULL) {
*NumberOfPages = Image->NumberOfPages; *NumberOfPages = Image->NumberOfPages;
} }
// //
// Register the image in the Debug Image Info Table if the attribute is set // Register the image in the Debug Image Info Table if the attribute is set
@ -825,26 +826,26 @@ Done:
/** /**
Loads an EFI image into memory and returns a handle to the image. Loads an EFI image into memory and returns a handle to the image.
@param BootPolicy If TRUE, indicates that the request originates @param BootPolicy If TRUE, indicates that the request originates
from the boot manager, and that the boot from the boot manager, and that the boot
manager is attempting to load FilePath as a manager is attempting to load FilePath as a
boot selection. boot selection.
@param ParentImageHandle The caller's image handle. @param ParentImageHandle The caller's image handle.
@param FilePath The specific file path from which the image is @param FilePath The specific file path from which the image is
loaded. loaded.
@param SourceBuffer If not NULL, a pointer to the memory location @param SourceBuffer If not NULL, a pointer to the memory location
containing a copy of the image to be loaded. containing a copy of the image to be loaded.
@param SourceSize The size in bytes of SourceBuffer. @param SourceSize The size in bytes of SourceBuffer.
@param ImageHandle Pointer to the returned image handle that is @param ImageHandle Pointer to the returned image handle that is
created when the image is successfully loaded. created when the image is successfully loaded.
@retval EFI_SUCCESS The image was loaded into memory. @retval EFI_SUCCESS The image was loaded into memory.
@retval EFI_NOT_FOUND The FilePath was not found. @retval EFI_NOT_FOUND The FilePath was not found.
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value. @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
@retval EFI_UNSUPPORTED The image type is not supported, or the device @retval EFI_UNSUPPORTED The image type is not supported, or the device
path cannot be parsed to locate the proper path cannot be parsed to locate the proper
protocol for loading the file. protocol for loading the file.
@retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient
resources. resources.
**/ **/
@ -886,29 +887,29 @@ CoreLoadImage (
/** /**
Loads an EFI image into memory and returns a handle to the image with extended parameters. Loads an EFI image into memory and returns a handle to the image with extended parameters.
@param This Calling context @param This Calling context
@param ParentImageHandle The caller's image handle. @param ParentImageHandle The caller's image handle.
@param FilePath The specific file path from which the image is @param FilePath The specific file path from which the image is
loaded. loaded.
@param SourceBuffer If not NULL, a pointer to the memory location @param SourceBuffer If not NULL, a pointer to the memory location
containing a copy of the image to be loaded. containing a copy of the image to be loaded.
@param SourceSize The size in bytes of SourceBuffer. @param SourceSize The size in bytes of SourceBuffer.
@param DstBuffer The buffer to store the image. @param DstBuffer The buffer to store the image.
@param NumberOfPages For input, specifies the space size of the @param NumberOfPages For input, specifies the space size of the
image by caller if not NULL. For output, image by caller if not NULL. For output,
specifies the actual space size needed. specifies the actual space size needed.
@param ImageHandle Image handle for output. @param ImageHandle Image handle for output.
@param EntryPoint Image entry point for output. @param EntryPoint Image entry point for output.
@param Attribute The bit mask of attributes to set for the load @param Attribute The bit mask of attributes to set for the load
PE image. PE image.
@retval EFI_SUCCESS The image was loaded into memory. @retval EFI_SUCCESS The image was loaded into memory.
@retval EFI_NOT_FOUND The FilePath was not found. @retval EFI_NOT_FOUND The FilePath was not found.
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value. @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
@retval EFI_UNSUPPORTED The image type is not supported, or the device @retval EFI_UNSUPPORTED The image type is not supported, or the device
path cannot be parsed to locate the proper path cannot be parsed to locate the proper
protocol for loading the file. protocol for loading the file.
@retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient
resources. resources.
**/ **/
@ -945,18 +946,18 @@ CoreLoadImageEx (
/** /**
Transfer control to a loaded image's entry point. Transfer control to a loaded image's entry point.
@param ImageHandle Handle of image to be started. @param ImageHandle Handle of image to be started.
@param ExitDataSize Pointer of the size to ExitData @param ExitDataSize Pointer of the size to ExitData
@param ExitData Pointer to a pointer to a data buffer that @param ExitData Pointer to a pointer to a data buffer that
includes a Null-terminated Unicode string, includes a Null-terminated Unicode string,
optionally followed by additional binary data. optionally followed by additional binary data.
The string is a description that the caller may The string is a description that the caller may
use to further indicate the reason for the use to further indicate the reason for the
image's exit. image's exit.
@retval EFI_INVALID_PARAMETER Invalid parameter @retval EFI_INVALID_PARAMETER Invalid parameter
@retval EFI_OUT_OF_RESOURCES No enough buffer to allocate @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
@retval EFI_SUCCESS Successfully transfer control to the image's @retval EFI_SUCCESS Successfully transfer control to the image's
entry point. entry point.
**/ **/
@ -1112,7 +1113,7 @@ CoreStartImage (
/** /**
Unloads EFI image from memory. Unloads EFI image from memory.
@param Image EFI image @param Image EFI image
@param FreePage Free allocated pages @param FreePage Free allocated pages
**/ **/
@ -1255,23 +1256,23 @@ CoreUnloadAndCloseImage (
/** /**
Terminates the currently loaded EFI image and returns control to boot services. Terminates the currently loaded EFI image and returns control to boot services.
@param ImageHandle Handle that identifies the image. This @param ImageHandle Handle that identifies the image. This
parameter is passed to the image on entry. parameter is passed to the image on entry.
@param Status The image's exit code. @param Status The image's exit code.
@param ExitDataSize The size, in bytes, of ExitData. Ignored if @param ExitDataSize The size, in bytes, of ExitData. Ignored if
ExitStatus is EFI_SUCCESS. ExitStatus is EFI_SUCCESS.
@param ExitData Pointer to a data buffer that includes a @param ExitData Pointer to a data buffer that includes a
Null-terminated Unicode string, optionally Null-terminated Unicode string, optionally
followed by additional binary data. The string followed by additional binary data. The string
is a description that the caller may use to is a description that the caller may use to
further indicate the reason for the image's further indicate the reason for the image's
exit. exit.
@retval EFI_INVALID_PARAMETER Image handle is NULL or it is not current @retval EFI_INVALID_PARAMETER Image handle is NULL or it is not current
image. image.
@retval EFI_SUCCESS Successfully terminates the currently loaded @retval EFI_SUCCESS Successfully terminates the currently loaded
EFI image. EFI image.
@retval EFI_ACCESS_DENIED Should never reach there. @retval EFI_ACCESS_DENIED Should never reach there.
@retval EFI_OUT_OF_RESOURCES Could not allocate pool @retval EFI_OUT_OF_RESOURCES Could not allocate pool
**/ **/
@ -1290,9 +1291,9 @@ CoreExit (
// //
// Prevent possible reentrance to this function // Prevent possible reentrance to this function
// for the same ImageHandle // for the same ImageHandle
// //
OldTpl = CoreRaiseTpl (TPL_NOTIFY); OldTpl = CoreRaiseTpl (TPL_NOTIFY);
Image = CoreLoadedImageInfo (ImageHandle); Image = CoreLoadedImageInfo (ImageHandle);
if (Image == NULL_HANDLE) { if (Image == NULL_HANDLE) {
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
@ -1357,12 +1358,12 @@ Done:
/** /**
Unloads an image. Unloads an image.
@param ImageHandle Handle that identifies the image to be @param ImageHandle Handle that identifies the image to be
unloaded. unloaded.
@retval EFI_SUCCESS The image has been unloaded. @retval EFI_SUCCESS The image has been unloaded.
@retval EFI_UNSUPPORTED The image has been sarted, and does not support @retval EFI_UNSUPPORTED The image has been sarted, and does not support
unload. unload.
@retval EFI_INVALID_PARAMPETER ImageHandle is not a valid image handle. @retval EFI_INVALID_PARAMPETER ImageHandle is not a valid image handle.
**/ **/
@ -1379,9 +1380,9 @@ CoreUnloadImage (
// //
// Prevent possible reentrance to this function // Prevent possible reentrance to this function
// for the same ImageHandle // for the same ImageHandle
// //
OldTpl = CoreRaiseTpl (TPL_NOTIFY); OldTpl = CoreRaiseTpl (TPL_NOTIFY);
Image = CoreLoadedImageInfo (ImageHandle); Image = CoreLoadedImageInfo (ImageHandle);
if (Image == NULL ) { if (Image == NULL ) {
// //
@ -1425,11 +1426,11 @@ Done:
/** /**
Unload the specified image. Unload the specified image.
@param This Indicates the calling context. @param This Indicates the calling context.
@param ImageHandle The specified image handle. @param ImageHandle The specified image handle.
@retval EFI_INVALID_PARAMETER Image handle is NULL. @retval EFI_INVALID_PARAMETER Image handle is NULL.
@retval EFI_UNSUPPORTED Attempt to unload an unsupported image. @retval EFI_UNSUPPORTED Attempt to unload an unsupported image.
@retval EFI_SUCCESS Image successfully unloaded. @retval EFI_SUCCESS Image successfully unloaded.
**/ **/