Code scrub for DxeCore

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5520 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8
2008-07-18 09:50:09 +00:00
parent ff61847ddc
commit e94a9ff727
25 changed files with 327 additions and 567 deletions

View File

@@ -416,8 +416,8 @@ CoreLoadPeImage (
Status = Image->Ebc->CreateThunk (
Image->Ebc,
Image->Handle,
(VOID *)(UINTN)Image->ImageContext.EntryPoint,
(VOID **)&Image->EntryPoint
(VOID *)(UINTN) Image->ImageContext.EntryPoint,
(VOID **) &Image->EntryPoint
);
if (EFI_ERROR(Status)) {
goto Done;
@@ -466,20 +466,12 @@ CoreLoadPeImage (
UINTN StartIndex;
CHAR8 EfiFileName[256];
if (Image->ImageContext.Machine != IMAGE_FILE_MACHINE_IA64) {
DEBUG ((DEBUG_INFO | DEBUG_LOAD,
"Loading driver at 0x%10p EntryPoint=0x%10p ",
(VOID *)(UINTN)Image->ImageContext.ImageAddress,
(VOID *)(UINTN)Image->ImageContext.EntryPoint));
} else {
//
// For IPF Image, the real entry point should be print.
//
DEBUG ((DEBUG_INFO | DEBUG_LOAD,
"Loading driver at 0x%10p EntryPoint=0x%10p ",
(VOID *)(UINTN)Image->ImageContext.ImageAddress,
(VOID *)(UINTN)(*(UINT64 *)(UINTN)Image->ImageContext.EntryPoint)));
}
DEBUG ((DEBUG_INFO | DEBUG_LOAD,
"Loading driver at 0x%10p EntryPoint=0x%10p ",
(VOID *)(UINTN) Image->ImageContext.ImageAddress,
FUNCTION_ENTRY_POINT ((UINTN) Image->ImageContext.EntryPoint)));
//
// Print Module Name by Pdb file path
@@ -559,7 +551,7 @@ CoreLoadedImageInfo (
if (!EFI_ERROR (Status)) {
Image = LOADED_IMAGE_PRIVATE_DATA_FROM_THIS (LoadedImage);
} else {
DEBUG ((DEBUG_LOAD, "CoreLoadedImageInfo: Not an ImageHandle %x\n", ImageHandle));
DEBUG ((DEBUG_LOAD, "CoreLoadedImageInfo: Not an ImageHandle %p\n", ImageHandle));
Image = NULL;
}
@@ -698,7 +690,7 @@ CoreLoadImageCommon (
Status = CoreHandleProtocol (DeviceHandle, &gEfiDevicePathProtocolGuid, (VOID **)&HandleFilePath);
if (!EFI_ERROR (Status)) {
FilePathSize = CoreDevicePathSize (HandleFilePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);
FilePath = (EFI_DEVICE_PATH_PROTOCOL *) ( ((UINT8 *)FilePath) + FilePathSize );
FilePath = (EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *)FilePath) + FilePathSize );
}
//
@@ -1061,12 +1053,7 @@ CoreStartImage (
DEBUG_CODE_BEGIN ();
if (Image->ExitDataSize != 0 || Image->ExitData != NULL) {
DEBUG (
(DEBUG_LOAD,
"StartImage: ExitDataSize %d, ExitData %x",
Image->ExitDataSize,
Image->ExitData)
);
DEBUG ((DEBUG_LOAD, "StartImage: ExitDataSize %d, ExitData %x", Image->ExitDataSize, Image->ExitData));
if (Image->ExitData != NULL) {
DEBUG ((DEBUG_LOAD, " (%hs)", Image->ExitData));
}

View File

@@ -79,7 +79,7 @@ CoreOpenImageFile (
if (SourceBuffer != NULL) {
ImageFileHandle->Source = SourceBuffer;
ImageFileHandle->SourceSize = SourceSize;
*DeviceHandle = NULL;
*DeviceHandle = NULL;
CoreLocateDevicePath (&gEfiDevicePathProtocolGuid, FilePath, DeviceHandle);
if (SourceSize > 0) {
Status = EFI_SUCCESS;
@@ -252,7 +252,7 @@ CoreOpenImageFile (
//
// Read the file into the buffer we allocated
//
ImageFileHandle->SourceSize = (UINTN)FileInfo->FileSize;
ImageFileHandle->SourceSize = (UINTN) FileInfo->FileSize;
ImageFileHandle->FreeBuffer = TRUE;
Status = FileHandle->Read (FileHandle, &ImageFileHandle->SourceSize, ImageFileHandle->Source);
@@ -277,11 +277,11 @@ CoreOpenImageFile (
TempFilePath = *FilePath;
Status = CoreDevicePathToInterface (
&gEfiLoadFileProtocolGuid,
&TempFilePath,
(VOID*)&LoadFile,
DeviceHandle
);
&gEfiLoadFileProtocolGuid,
&TempFilePath,
(VOID*) &LoadFile,
DeviceHandle
);
if (!EFI_ERROR (Status)) {
//
// Call LoadFile with the correct buffer size
@@ -333,7 +333,6 @@ Done:
/**
Read image file (specified by UserHandle) into user specified buffer with specified offset
and length.
@@ -449,7 +448,6 @@ CoreGrowBuffer (
//
// If the status code is "buffer too small", resize the buffer
//
if (*Status == EFI_BUFFER_TOO_SMALL) {
if (*Buffer != NULL) {
CoreFreePool (*Buffer);