Update HobLib and PeCoffLib according to MDE Lib Spec 0.61c

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6100 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2008-10-10 06:20:50 +00:00
parent eecd469b10
commit 3ecdcd1146
9 changed files with 31 additions and 22 deletions

View File

@ -17,9 +17,10 @@
/** /**
Returns the pointer to the HOB list. Returns the pointer to the HOB list.
ASSERT() if the HOB list returned by GetHobList() is NULL.
This function returns the pointer to first HOB in the list. This function returns the pointer to first HOB in the list.
@return The pointer to the HOB list. @return The pointer to the HOB list.
**/ **/

View File

@ -85,6 +85,7 @@ typedef struct {
VOID *FixupData; VOID *FixupData;
/// ///
/// Is set by PeCoffLoaderGetImageInfo() to the Section Alignment in the PE/COFF header /// Is set by PeCoffLoaderGetImageInfo() to the Section Alignment in the PE/COFF header
/// If the image is a TE image, then this field is set to 0.
/// ///
UINT32 SectionAlignment; UINT32 SectionAlignment;
/// ///
@ -159,13 +160,15 @@ typedef struct {
/** /**
Retrieves information about a PE/COFF image. Retrieves information about a PE/COFF image.
Computes the PeCoffHeaderOffset, ImageAddress, ImageSize, DestinationAddress, CodeView, Computes the PeCoffHeaderOffset, IsTeImage, ImageType, ImageAddress, ImageSize,
PdbPointer, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and
fields of the ImageContext structure. If ImageContext is NULL, then return RETURN_INVALID_PARAMETER. DebugDirectoryEntryRva fields of the ImageContext structure.
If the PE/COFF image accessed through the ImageRead service in the ImageContext structure is not If ImageContext is NULL, then return RETURN_INVALID_PARAMETER.
a supported PE/COFF image type, then return RETURN_UNSUPPORTED. If any errors occur while If the PE/COFF image accessed through the ImageRead service in the ImageContext
computing the fields of ImageContext, then the error status is returned in the ImageError field of structure is not a supported PE/COFF image type, then return RETURN_UNSUPPORTED.
ImageContext. If any errors occur while computing the fields of ImageContext,
then the error status is returned in the ImageError field of ImageContext.
If the image is a TE image, then SectionAlignment is set to 0.
@param ImageContext Pointer to the image context structure that describes the PE/COFF @param ImageContext Pointer to the image context structure that describes the PE/COFF
image that needs to be examined by this function. image that needs to be examined by this function.

View File

@ -1,8 +1,8 @@
#/** @file #/** @file
# Component description file for Base Memory Optimization Dxe Library. # Component description file for Base Memory Optimization Dxe Library.
# #
# Base Memory Library that uses MMX registers for high performance. # Base Memory Library that is optimized for use in DXE phase.
# Optimized for use in DXE. # Uses REP, MMX, XMM registers as required for best performance.
# Copyright (c) 2007 - 2008, Intel Corporation # Copyright (c) 2007 - 2008, Intel Corporation
# #
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials

View File

@ -1,8 +1,8 @@
#/** @file #/** @file
# Component description file for Base Memory Optimization Pei Library # Component description file for Base Memory Optimization Pei Library
# #
# Base Memory Library that uses REP string instructions for # Base Memory Library that is optimized for use in PEI phase.
# high performance and small size. Optimized for use in PEI. # Uses REP, MMX, XMM registers as required for best performance.
# Copyright (c) 2007 - 2008, Intel Corporation # Copyright (c) 2007 - 2008, Intel Corporation
# #
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials

View File

@ -172,13 +172,15 @@ PeCoffLoaderGetPeHeader (
/** /**
Retrieves information about a PE/COFF image. Retrieves information about a PE/COFF image.
Computes the PeCoffHeaderOffset, ImageAddress, ImageSize, DestinationAddress, RelocationsStripped, Computes the PeCoffHeaderOffset, IsTeImage, ImageType, ImageAddress, ImageSize,
SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva fields of the ImageContext structure. DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and
If ImageContext is NULL, then return RETURN_INVALID_PARAMETER. DebugDirectoryEntryRva fields of the ImageContext structure.
If the PE/COFF image accessed through the ImageRead service in the ImageContext structure is not If ImageContext is NULL, then return RETURN_INVALID_PARAMETER.
a supported PE/COFF image type, then return RETURN_UNSUPPORTED. If any errors occur while If the PE/COFF image accessed through the ImageRead service in the ImageContext
computing the fields of ImageContext, then the error status is returned in the ImageError field of structure is not a supported PE/COFF image type, then return RETURN_UNSUPPORTED.
ImageContext. If any errors occur while computing the fields of ImageContext,
then the error status is returned in the ImageError field of ImageContext.
If the image is a TE image, then SectionAlignment is set to 0.
@param ImageContext Pointer to the image context structure that describes the PE/COFF @param ImageContext Pointer to the image context structure that describes the PE/COFF
image that needs to be examined by this function. image that needs to be examined by this function.

View File

@ -1,5 +1,5 @@
#/** @file #/** @file
# Component description file for Base Library # Component description file for Base Cpu Library
# #
# Base Library implementation. # Base Library implementation.
# Copyright (c) 2007, Intel Corporation. # Copyright (c) 2007, Intel Corporation.

View File

@ -23,6 +23,7 @@
/** /**
Returns the pointer to the HOB list. Returns the pointer to the HOB list.
ASSERT() if the HOB list returned by GetHobList() is NULL.
This function returns the pointer to first HOB in the list. This function returns the pointer to first HOB in the list.
@ -35,6 +36,7 @@ GetHobList (
VOID VOID
) )
{ {
ASSERT (gHobList != NULL);
return gHobList; return gHobList;
} }
@ -185,7 +187,6 @@ GetBootModeHob (
EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob; EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;
HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *) GetHobList (); HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *) GetHobList ();
ASSERT (HandOffHob != NULL);
return HandOffHob->BootMode; return HandOffHob->BootMode;
} }

View File

@ -56,6 +56,7 @@ HobLibConstructor (
/** /**
Returns the pointer to the HOB list. Returns the pointer to the HOB list.
ASSERT() if the HOB list returned by GetHobList() is NULL.
This function returns the pointer to first HOB in the list. This function returns the pointer to first HOB in the list.
@ -68,6 +69,7 @@ GetHobList (
VOID VOID
) )
{ {
ASSERT (mHobList != NULL);
return mHobList; return mHobList;
} }
@ -218,7 +220,6 @@ GetBootModeHob (
EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob; EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;
HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *) GetHobList (); HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *) GetHobList ();
ASSERT (HandOffHob != NULL);
return HandOffHob->BootMode; return HandOffHob->BootMode;
} }

View File

@ -24,6 +24,7 @@
/** /**
Returns the pointer to the HOB list. Returns the pointer to the HOB list.
ASSERT() if the HOB list returned by GetHobList() is NULL.
This function returns the pointer to first HOB in the list. This function returns the pointer to first HOB in the list.