EFIAPI\r
DebugAssert (\r
IN CHAR8 *FileName,\r
- IN INTN LineNumber,\r
+ IN UINTN LineNumber,\r
IN CHAR8 *Description\r
)\r
/*++\r
EFIAPI\r
DebugAssert (\r
IN CHAR8 *FileName,\r
- IN INTN LineNumber,\r
+ IN UINTN LineNumber,\r
IN CHAR8 *Description\r
)\r
/*++\r
EFIAPI\r
DebugAssert (\r
IN CHAR8 *FileName,\r
- IN INTN LineNumber,\r
+ IN UINTN LineNumber,\r
IN CHAR8 *Description\r
)\r
/*++\r
EFIAPI\r
DebugAssert (\r
IN CONST CHAR8 *FileName,\r
- IN INTN LineNumber,\r
+ IN UINTN LineNumber,\r
IN CONST CHAR8 *Description\r
);\r
\r
@param Guid Pointer to a protocol GUID.\r
\r
**/\r
-#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid) \\r
- do { \\r
- if (DebugAssertEnabled ()) { \\r
- VOID *Instance; \\r
- ASSERT (Guid != NULL); \\r
- if (Handle == NULL) { \\r
- if (!EFI_ERROR (gBS->LocateProtocol (Guid, NULL, &Instance))) { \\r
- _ASSERT (Guid already installed in database); \\r
- } \\r
- } else { \\r
- if (!EFI_ERROR (gBS->HandleProtocol (Handle, Guid, &Instance))) { \\r
- _ASSERT (Guid already installed on Handle); \\r
- } \\r
- } \\r
- } \\r
+#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid) \\r
+ do { \\r
+ if (DebugAssertEnabled ()) { \\r
+ VOID *Instance; \\r
+ ASSERT (Guid != NULL); \\r
+ if (Handle == NULL) { \\r
+ if (!EFI_ERROR (gBS->LocateProtocol ((EFI_GUID *)Guid, NULL, &Instance))) { \\r
+ _ASSERT (Guid already installed in database); \\r
+ } \\r
+ } else { \\r
+ if (!EFI_ERROR (gBS->HandleProtocol (Handle, (EFI_GUID *)Guid, &Instance))) { \\r
+ _ASSERT (Guid already installed on Handle); \\r
+ } \\r
+ } \\r
+ } \\r
} while (FALSE)\r
\r
\r
@return Value\r
\r
**/\r
-#define POST_CODE(Value) ReportPostCodeEnabled() ? PostCode(Value) : Value\r
+#define POST_CODE(Value) PostCodeEnabled() ? PostCode(Value) : Value\r
\r
/**\r
Sends an 32-bit value to a POST and associated ASCII string.\r
\r
**/\r
#define POST_CODE_WITH_DESCRIPTION(Value,Description) \\r
- ReportPostCodeEnabled() ? \\r
- (ReportPostCodeDescriptionEnabled() ? \\r
+ PostCodeEnabled() ? \\r
+ (PostCodeDescriptionEnabled() ? \\r
PostCodeWithDescription(Value,Description) : \\r
PostCode(Value)) : \\r
Value\r
EFIAPI\r
DebugAssert (\r
IN CONST CHAR8 *FileName,\r
- IN INTN LineNumber,\r
+ IN UINTN LineNumber,\r
IN CONST CHAR8 *Description\r
)\r
{\r
EFIAPI\r
DebugAssert (\r
IN CONST CHAR8 *FileName,\r
- IN INTN LineNumber,\r
+ IN UINTN LineNumber,\r
IN CONST CHAR8 *Description\r
)\r
{\r
UINTN EndAddress;\r
\r
ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
+ ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);\r
ASSERT (Buffer != NULL);\r
\r
EndAddress = StartAddress + Size;\r
UINTN EndAddress;\r
\r
ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
+ ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);\r
ASSERT (Buffer != NULL);\r
\r
EndAddress = StartAddress + Size;\r
UINTN EndAddress;\r
\r
ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
+ ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
ASSERT (Buffer != NULL);\r
\r
EndAddress = StartAddress + Size;\r
UINTN EndAddress;\r
\r
ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
+ ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
ASSERT (Buffer != NULL);\r
\r
EndAddress = StartAddress + Size;\r
</MsaLibHeader>\r
<LibraryClassDefinitions>\r
<LibraryClass Usage="ALWAYS_PRODUCED">PeCoffGetEntryPointLib</LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">DebugLib</LibraryClass>\r
</LibraryClassDefinitions>\r
<SourceFiles>\r
<Filename>PeCoffGetEntryPoint.c</Filename>\r
\r
\r
/**\r
- Loads a PE/COFF image into memory.\r
+ Retrieves and returns a pointer to the entry point to a PE/COFF image that has been loaded\r
+ into system memory with the PE/COFF Loader Library functions.\r
\r
- @param Pe32Data Pointer to a PE/COFF Image\r
- \r
- @param EntryPoint Pointer to the entry point of the PE/COFF image\r
+ Retrieves the entry point to the PE/COFF image specified by Pe32Data and returns this entry\r
+ point in EntryPoint. If the entry point could not be retrieved from the PE/COFF image, then\r
+ return RETURN_INVALID_PARAMETER. Otherwise return RETURN_SUCCESS.\r
+ If Pe32Data is NULL, then ASSERT().\r
+ If EntryPoint is NULL, then ASSERT().\r
\r
- @retval EFI_SUCCESS if the EntryPoint was returned\r
- @retval EFI_INVALID_PARAMETER if the EntryPoint could not be found from Pe32Data\r
+ @param Pe32Data Pointer to the PE/COFF image that is loaded in system memory.\r
+ @param EntryPoint Pointer to entry point to the PE/COFF image to return.\r
+\r
+ @retval RETURN_SUCCESS EntryPoint was returned.\r
+ @retval RETURN_INVALID_PARAMETER The entry point could not be found in the PE/COFF image.\r
\r
**/\r
RETURN_STATUS\r
EFIAPI\r
PeCoffLoaderGetEntryPoint (\r
- IN VOID *Pe32Data,\r
- IN OUT VOID **EntryPoint\r
+ IN VOID *Pe32Data,\r
+ OUT VOID **EntryPoint\r
)\r
{\r
EFI_IMAGE_DOS_HEADER *DosHeader;\r
EFI_IMAGE_NT_HEADERS *PeHeader;\r
\r
+ ASSERT (Pe32Data != NULL);\r
+ ASSERT (EntryPoint != NULL);\r
+\r
DosHeader = (EFI_IMAGE_DOS_HEADER *)Pe32Data;\r
+\r
if (DosHeader->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
//\r
- // DOS image header is present, so read the PE header after the DOS image header\r
+ // DOS image header is present, so read the PE header after the DOS image header.\r
//\r
PeHeader = (EFI_IMAGE_NT_HEADERS *) ((UINTN) Pe32Data + (UINTN) ((DosHeader->e_lfanew) & 0x0ffff));\r
} else {\r
//\r
- // DOS image header is not present, so PE header is at the image base\r
+ // DOS image header is not present, so PE header is at the image base.\r
//\r
PeHeader = (EFI_IMAGE_NT_HEADERS *) Pe32Data;\r
}\r
+\r
*EntryPoint = (VOID *) ((UINTN) Pe32Data + (UINTN) (PeHeader->OptionalHeader.AddressOfEntryPoint & 0x0ffffffff));\r
return RETURN_SUCCESS;\r
}\r
);\r
\r
STATIC\r
-VOID *\r
+VOID *\r
PeCoffLoaderImageAddress (\r
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,\r
IN UINTN Address\r
/**\r
Retrieves the PE or TE Header from a PE/COFF or TE image.\r
\r
- @param ImageContext The context of the image being loaded.\r
- \r
- @param PeHdr The buffer in which to return the PE header.\r
- \r
- @param TeHdr The buffer in which to return the TE header.\r
+ @param ImageContext The context of the image being loaded.\r
+ @param PeHdr The buffer in which to return the PE header.\r
+ @param TeHdr The buffer in which to return the TE header.\r
\r
- @return\r
- RETURN_SUCCESS if the PE or TE Header is read,\r
- Otherwise, the error status from reading the PE/COFF or TE image using the ImageRead function.\r
+ @retval RETURN_SUCCESS The PE or TE Header is read.\r
+ @retval Other The error status from reading the PE/COFF or TE image using the ImageRead function.\r
\r
**/\r
STATIC\r
OUT EFI_TE_IMAGE_HEADER *TeHdr\r
)\r
{\r
- RETURN_STATUS Status;\r
+ RETURN_STATUS Status;\r
EFI_IMAGE_DOS_HEADER DosHdr;\r
UINTN Size;\r
\r
//\r
Size = sizeof (EFI_IMAGE_DOS_HEADER);\r
Status = ImageContext->ImageRead (\r
- ImageContext->Handle,\r
- 0,\r
- &Size,\r
- &DosHdr\r
- );\r
+ ImageContext->Handle,\r
+ 0,\r
+ &Size,\r
+ &DosHdr\r
+ );\r
if (RETURN_ERROR (Status)) {\r
ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;\r
return Status;\r
//\r
Size = sizeof (EFI_IMAGE_NT_HEADERS);\r
Status = ImageContext->ImageRead (\r
- ImageContext->Handle,\r
- ImageContext->PeCoffHeaderOffset,\r
- &Size,\r
- PeHdr\r
- );\r
+ ImageContext->Handle,\r
+ ImageContext->PeCoffHeaderOffset,\r
+ &Size,\r
+ PeHdr\r
+ );\r
if (RETURN_ERROR (Status)) {\r
ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;\r
return Status;\r
if (PeHdr->Signature != EFI_IMAGE_NT_SIGNATURE) {\r
Size = sizeof (EFI_TE_IMAGE_HEADER);\r
Status = ImageContext->ImageRead (\r
- ImageContext->Handle,\r
- 0,\r
- &Size,\r
- TeHdr\r
- );\r
+ ImageContext->Handle,\r
+ 0,\r
+ &Size,\r
+ TeHdr\r
+ );\r
if (TeHdr->Signature != EFI_TE_IMAGE_HEADER_SIGNATURE) {\r
return RETURN_UNSUPPORTED;\r
}\r
/**\r
Checks the PE or TE header of a PE/COFF or TE image to determine if it supported.\r
\r
- @param ImageContext The context of the image being loaded.\r
- \r
- @param PeHdr The buffer in which to return the PE header.\r
- \r
- @param TeHdr The buffer in which to return the TE header.\r
+ @param ImageContext The context of the image being loaded.\r
+ @param PeHdr The buffer in which to return the PE header.\r
+ @param TeHdr The buffer in which to return the TE header.\r
\r
- @retval RETURN_SUCCESS if the PE/COFF or TE image is supported\r
- @retval RETURN_UNSUPPORTED of the PE/COFF or TE image is not supported.\r
+ @retval RETURN_SUCCESS The PE/COFF or TE image is supported.\r
+ @retval RETURN_UNSUPPORTED The PE/COFF or TE image is not supported.\r
\r
**/\r
STATIC\r
}\r
\r
/**\r
- Retrieves information on a PE/COFF image.\r
+ Retrieves information about a PE/COFF image.\r
\r
- @param This Calling context\r
- @param ImageContext The context of the image being loaded\r
+ Computes the PeCoffHeaderOffset, ImageAddress, ImageSize, DestinationAddress, CodeView,\r
+ PdbPointer, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva\r
+ fields of the ImageContext structure. If ImageContext is NULL, then return RETURN_INVALID_PARAMETER.\r
+ If the PE/COFF image accessed through the ImageRead service in the ImageContext structure is not\r
+ a supported PE/COFF image type, then return RETURN_UNSUPPORTED. If any errors occur while\r
+ computing the fields of ImageContext, then the error status is returned in the ImageError field of\r
+ ImageContext. \r
\r
- @retval RETURN_SUCCESS The information on the PE/COFF image was collected.\r
+ @param ImageContext Pointer to the image context structure that describes the PE/COFF\r
+ image that needs to be examined by this function.\r
+\r
+ @retval RETURN_SUCCESS The information on the PE/COFF image was collected.\r
@retval RETURN_INVALID_PARAMETER ImageContext is NULL.\r
- @retval RETURN_UNSUPPORTED The PE/COFF image is not supported.\r
- @retval Otherwise The error status from reading the PE/COFF image using the\r
- ImageContext->ImageRead() function\r
+ @retval RETURN_UNSUPPORTED The PE/COFF image is not supported.\r
+ @retval Others The error status from reading the PE/COFF image\r
+ using the ImageContext->ImageRead() function.\r
\r
**/\r
RETURN_STATUS\r
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r
)\r
{\r
- RETURN_STATUS Status;\r
+ RETURN_STATUS Status;\r
EFI_IMAGE_NT_HEADERS PeHdr;\r
EFI_TE_IMAGE_HEADER TeHdr;\r
EFI_IMAGE_DATA_DIRECTORY *DebugDirectoryEntry;\r
//\r
// Read section header from file\r
//\r
- Size = sizeof (EFI_IMAGE_SECTION_HEADER);\r
+ Size = sizeof (EFI_IMAGE_SECTION_HEADER);\r
Status = ImageContext->ImageRead (\r
ImageContext->Handle,\r
SectionHeaderOffset,\r
if (DebugDirectoryEntryRva >= SectionHeader.VirtualAddress &&\r
DebugDirectoryEntryRva < SectionHeader.VirtualAddress + SectionHeader.Misc.VirtualSize) {\r
DebugDirectoryEntryFileOffset = DebugDirectoryEntryRva -\r
- SectionHeader.VirtualAddress +\r
- SectionHeader.PointerToRawData +\r
- sizeof (EFI_TE_IMAGE_HEADER) -\r
- TeHdr.StrippedSize;\r
+ SectionHeader.VirtualAddress +\r
+ SectionHeader.PointerToRawData +\r
+ sizeof (EFI_TE_IMAGE_HEADER) -\r
+ TeHdr.StrippedSize;\r
\r
//\r
// File offset of the debug directory was found, if this is not the last\r
/**\r
Converts an image address to the loaded address.\r
\r
- @param ImageContext The context of the image being loaded.\r
- \r
- @param Address The address to be converted to the loaded address.\r
+ @param ImageContext The context of the image being loaded.\r
+ @param Address The address to be converted to the loaded address.\r
\r
- @return NULL if the address can not be converted, otherwise, the converted address\r
+ @return The converted address or NULL if the address can not be converted.\r
\r
**/\r
STATIC\r
}\r
\r
/**\r
- Relocates a PE/COFF image in memory.\r
+ Applies relocation fixups to a PE/COFF image that was loaded with PeCoffLoaderLoadImage().\r
\r
- @param This Calling context.\r
- \r
- @param ImageContext Contains information on the loaded image to relocate.\r
+ If the DestinationAddress field of ImageContext is 0, then use the ImageAddress field of\r
+ ImageContext as the relocation base address. Otherwise, use the DestinationAddress field\r
+ of ImageContext as the relocation base address. The caller must allocate the relocation\r
+ fixup log buffer and fill in the FixupData field of ImageContext prior to calling this function. \r
+ If ImageContext is NULL, then ASSERT().\r
+\r
+ @param ImageContext Pointer to the image context structure that describes the PE/COFF\r
+ image that is being relocated.\r
\r
- @retval RETURN_SUCCESS if the PE/COFF image was relocated.\r
- @retval RETURN_LOAD_ERROR if the image is not a valid PE/COFF image.\r
- @retval RETURN_UNSUPPORTED not support.\r
+ @retval RETURN_SUCCESS The PE/COFF image was relocated.\r
+ Extended status information is in the ImageError field of ImageContext.\r
+ @retval RETURN_LOAD_ERROR The image in not a valid PE/COFF image.\r
+ Extended status information is in the ImageError field of ImageContext.\r
+ @retval RETURN_UNSUPPORTED A relocation record type is not supported.\r
+ Extended status information is in the ImageError field of ImageContext.\r
\r
**/\r
RETURN_STATUS\r
CHAR8 *FixupData;\r
PHYSICAL_ADDRESS BaseAddress;\r
\r
+ ASSERT (ImageContext != NULL);\r
+\r
PeHdr = NULL;\r
TeHdr = NULL;\r
//\r
// If the destination address is not 0, use that rather than the\r
// image address as the relocation target.\r
//\r
- if (ImageContext->DestinationAddress) {\r
+ if (ImageContext->DestinationAddress != 0) {\r
BaseAddress = ImageContext->DestinationAddress;\r
} else {\r
BaseAddress = ImageContext->ImageAddress;\r
if (!(ImageContext->IsTeImage)) {\r
PeHdr = (EFI_IMAGE_NT_HEADERS *)((UINTN)ImageContext->ImageAddress + \r
ImageContext->PeCoffHeaderOffset);\r
+ \r
Adjust = (UINT64) BaseAddress - PeHdr->OptionalHeader.ImageBase;\r
PeHdr->OptionalHeader.ImageBase = (UINTN)BaseAddress;\r
\r
/**\r
Loads a PE/COFF image into memory.\r
\r
- @param This Calling context.\r
- \r
- @param ImageContext Contains information on image to load into memory.\r
+ Loads the PE/COFF image accessed through the ImageRead service of ImageContext into the buffer\r
+ specified by the ImageAddress and ImageSize fields of ImageContext. The caller must allocate\r
+ the load buffer and fill in the ImageAddress and ImageSize fields prior to calling this function.\r
+ The EntryPoint, FixupDataSize, CodeView, and PdbPointer fields of ImageContext are computed.\r
+\r
+ @param ImageContext Pointer to the image context structure that describes the PE/COFF\r
+ image that is being loaded.\r
\r
- @retval RETURN_SUCCESS if the PE/COFF image was loaded.\r
- @retval RETURN_BUFFER_TOO_SMALL if the caller did not provide a large enough buffer.\r
- @retval RETURN_LOAD_ERROR if the image is a runtime driver with no relocations.\r
- @retval RETURN_INVALID_PARAMETER if the image address is invalid.\r
+ @retval RETURN_SUCCESS The PE/COFF image was loaded into the buffer specified by\r
+ the ImageAddress and ImageSize fields of ImageContext.\r
+ Extended status information is in the ImageError field of ImageContext.\r
+ @retval RETURN_BUFFER_TOO_SMALL The caller did not provide a large enough buffer.\r
+ Extended status information is in the ImageError field of ImageContext.\r
+ @retval RETURN_LOAD_ERROR The PE/COFF image is an EFI Runtime image with no relocations.\r
+ Extended status information is in the ImageError field of ImageContext.\r
+ @retval RETURN_INVALID_PARAMETER The image address is invalid.\r
+ Extended status information is in the ImageError field of ImageContext.\r
\r
**/\r
RETURN_STATUS\r
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r
)\r
{\r
- RETURN_STATUS Status;\r
+ RETURN_STATUS Status;\r
EFI_IMAGE_NT_HEADERS *PeHdr;\r
EFI_TE_IMAGE_HEADER *TeHdr;\r
- PE_COFF_LOADER_IMAGE_CONTEXT CheckContext;\r
+ PE_COFF_LOADER_IMAGE_CONTEXT CheckContext;\r
EFI_IMAGE_SECTION_HEADER *FirstSection;\r
EFI_IMAGE_SECTION_HEADER *Section;\r
UINTN NumberOfSections;\r
<LibraryClassDefinitions>\r
<LibraryClass Usage="ALWAYS_PRODUCED">PeCoffLib</LibraryClass>\r
<LibraryClass Usage="ALWAYS_CONSUMED">BaseMemoryLib</LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">DebugLib</LibraryClass>\r
</LibraryClassDefinitions>\r
<SourceFiles>\r
<Filename>BasePeCoff.c</Filename>\r
<Filename>x64/PeCoffLoaderEx.c</Filename>\r
</Arch>\r
<Arch ArchType="IPF">\r
- <Filename>ipf/PeCoffLoaderEx.c</Filename>\r
+ <Filename>Ipf/PeCoffLoaderEx.c</Filename>\r
</Arch>\r
<Arch ArchType="EBC">\r
- <Filename>ebc/PeCoffLoaderEx.c</Filename>\r
+ <Filename>Ebc/PeCoffLoaderEx.c</Filename>\r
</Arch>\r
</SourceFiles>\r
<Includes>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+-->\r
+<LibraryModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0 http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">\r
+ <MbdLibHeader>\r
+ <BaseName>BasePostCodeLibPort80</BaseName>\r
+ <Guid>55c61087-7367-4546-bc32-4937c5e6aff3</Guid>\r
+ <Version>0</Version>\r
+ <Description>FIX ME!</Description>\r
+ <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
+ <License>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ </License>\r
+ <Created>2006-03-09 23:16</Created>\r
+ <Modified>2006-03-19 15:17</Modified>\r
+ </MbdLibHeader>\r
+</LibraryModuleBuildDescription>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+-->\r
+<LibraryModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0 http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">\r
+ <MsaLibHeader>\r
+ <BaseName>BasePostCodeLibPort80</BaseName>\r
+ <ModuleType>BASE</ModuleType>\r
+ <ComponentType>LIBRARY</ComponentType>\r
+ <Guid>55c61087-7367-4546-bc32-4937c5e6aff3</Guid>\r
+ <Version>0</Version>\r
+ <Abstract>Component description file for the entry point to a EFIDXE Drivers</Abstract>\r
+ <Description>FIX ME!</Description>\r
+ <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
+ <License>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ </License>\r
+ <Created>2006-03-09 23:16</Created>\r
+ <Updated>2006-03-19 15:17</Updated>\r
+ <Specification>0</Specification>\r
+ </MsaLibHeader>\r
+ <LibraryClassDefinitions>\r
+ <LibraryClass Usage="ALWAYS_PRODUCED">PostCodeLib</LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">PcdLib</LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">IoLib</LibraryClass>\r
+ </LibraryClassDefinitions>\r
+ <SourceFiles>\r
+ <Filename>PostCode.c</Filename>\r
+ </SourceFiles>\r
+ <Includes>\r
+ <PackageName>MdePkg</PackageName>\r
+ </Includes>\r
+ <PcdCoded>\r
+ <PcdEntry PcdItemType="FIXED_AT_BUILD">\r
+ <C_Name>PcdPostCodePropertyMask</C_Name>\r
+ </PcdEntry>\r
+ </PcdCoded>\r
+</LibraryModuleSurfaceArea>\r
--- /dev/null
+/** @file\r
+ Report Status Code Library Post Code functions for DXE Phase.\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials \r
+ are licensed and made available under the terms and conditions of the BSD License \r
+ which accompanies this distribution. The full text of the license may be found at \r
+ http://opensource.org/licenses/bsd-license.php \r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+**/\r
+\r
+\r
+/**\r
+ Sends an 32-bit value to a POST card.\r
+\r
+ Sends the 32-bit value specified by Value to a POST card, and returns Value. \r
+ Some implementations of this library function may perform I/O operations \r
+ directly to a POST card device. Other implementations may send Value to \r
+ ReportStatusCode(), and the status code reporting mechanism will eventually \r
+ display the 32-bit value on the status reporting device.\r
+ \r
+ PostCode() must actively prevent recursion. If PostCode() is called while \r
+ processing another any other Report Status Code Library function, then \r
+ PostCode() must return Value immediately.\r
+\r
+ @param Value The 32-bit value to write to the POST card.\r
+\r
+ @return Value\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+PostCode (\r
+ IN UINT32 Value\r
+ )\r
+{\r
+ IoWrite8 (0x80, (UINT8)(Value));\r
+ return Value;\r
+}\r
+\r
+\r
+/**\r
+ Sends an 32-bit value to a POST and associated ASCII string.\r
+\r
+ Sends the 32-bit value specified by Value to a POST card, and returns Value.\r
+ If Description is not NULL, then the ASCII string specified by Description is \r
+ also passed to the handler that displays the POST card value. Some \r
+ implementations of this library function may perform I/O operations directly \r
+ to a POST card device. Other implementations may send Value to ReportStatusCode(), \r
+ and the status code reporting mechanism will eventually display the 32-bit \r
+ value on the status reporting device. \r
+\r
+ PostCodeWithDescription()must actively prevent recursion. If \r
+ PostCodeWithDescription() is called while processing another any other Report \r
+ Status Code Library function, then PostCodeWithDescription() must return Value \r
+ immediately.\r
+\r
+ @param Value The 32-bit value to write to the POST card.\r
+ @param Description Pointer to an ASCII string that is a description of the \r
+ POST code value. This is an optional parameter that may \r
+ be NULL.\r
+\r
+ @return Value\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+PostCodeWithDescription (\r
+ IN UINT32 Value,\r
+ IN CONST CHAR8 *Description OPTIONAL\r
+ )\r
+{\r
+ IoWrite8 (0x80, (UINT8)(Value));\r
+ return Value;\r
+}\r
+\r
+\r
+/**\r
+ Returns TRUE if POST Codes are enabled.\r
+\r
+ This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED \r
+ bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.\r
+\r
+ @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of \r
+ PcdPostCodeProperyMask is set.\r
+ @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of \r
+ PcdPostCodeProperyMask is clear.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+PostCodeEnabled (\r
+ VOID\r
+ )\r
+{\r
+ return ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);\r
+}\r
+\r
+\r
+/**\r
+ Returns TRUE if POST code descriptions are enabled.\r
+\r
+ This function returns TRUE if the \r
+ POST_CODE_PROPERTY_POST_CODE_ENABLED bit of \r
+ PcdPostCodePropertyMask is set. Otherwise FALSE is returned.\r
+\r
+ @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED \r
+ bit of PcdPostCodeProperyMask is set.\r
+ @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED \r
+ bit of PcdPostCodeProperyMask is clear.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+PostCodeDescriptionEnabled (\r
+ VOID\r
+ )\r
+{\r
+ return ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);\r
+}\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?><!-- Copyright (c) 2006, Intel Corporation \r
+All rights reserved. This program and the accompanying materials \r
+are licensed and made available under the terms and conditions of the BSD License \r
+which accompanies this distribution. The full text of the license may be found at \r
+http://opensource.org/licenses/bsd-license.php \r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->\r
+<project basedir="." default="BasePostCodeLibPort80"><!--Apply external ANT tasks-->\r
+ <taskdef resource="GenBuild.tasks"/>\r
+ <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
+ <property environment="env"/>\r
+ <property name="WORKSPACE_DIR" value="${env.WORKSPACE}"/>\r
+ <import file="${WORKSPACE_DIR}/Tools/Conf/BuildMacro.xml"/><!--MODULE_RELATIVE PATH is relative to PACKAGE_DIR-->\r
+ <property name="MODULE_RELATIVE_PATH" value="Library/BasePostCodeLibPort80"/>\r
+ <property name="MODULE_DIR" value="${PACKAGE_DIR}/${MODULE_RELATIVE_PATH}"/>\r
+ <property name="COMMON_FILE" value="${WORKSPACE_DIR}/Tools/Conf/Common.xml"/>\r
+ <target name="BasePostCodeLibPort80">\r
+ <GenBuild baseName="BasePostCodeLibPort80" mbdFilename="${MODULE_DIR}/BasePostCodeLibPort80.mbd" msaFilename="${MODULE_DIR}/BasePostCodeLibPort80.msa"/>\r
+ </target>\r
+ <target depends="BasePostCodeLib80_clean" name="clean"/>\r
+ <target depends="BasePostCodeLib80_cleanall" name="cleanall"/>\r
+ <target name="BasePostCodeLib80_clean">\r
+ <OutputDirSetup baseName="BasePostCodeLibPort80" mbdFilename="${MODULE_DIR}/BasePostCodeLibPort80.mbd" msaFilename="${MODULE_DIR}/BasePostCodeLibPort80.msa"/>\r
+ <if>\r
+ <available file="${DEST_DIR_OUTPUT}/BasePostCodeLib80_build.xml"/>\r
+ <then>\r
+ <ant antfile="${DEST_DIR_OUTPUT}/BasePostCodeLib80_build.xml" target="clean"/>\r
+ </then>\r
+ </if>\r
+ <delete dir="${DEST_DIR_OUTPUT}" excludes="*.xml"/>\r
+ </target>\r
+ <target name="BasePostCodeLib80_cleanall">\r
+ <OutputDirSetup baseName="BasePostCodeLibPort80" mbdFilename="${MODULE_DIR}/BasePostCodeLibPort80.mbd" msaFilename="${MODULE_DIR}/BasePostCodeLibPort80.msa"/>\r
+ <if>\r
+ <available file="${DEST_DIR_OUTPUT}/BasePostCodeLib80_build.xml"/>\r
+ <then>\r
+ <ant antfile="${DEST_DIR_OUTPUT}/BasePostCodeLib80_build.xml" target="cleanall"/>\r
+ </then>\r
+ </if>\r
+ <delete dir="${DEST_DIR_OUTPUT}"/>\r
+ <delete dir="${DEST_DIR_DEBUG}"/>\r
+ <delete>\r
+ <fileset dir="${BIN_DIR}" includes="**BasePostCodeLibPort80*"/>\r
+ </delete>\r
+ </target>\r
+</project>
\ No newline at end of file
EFIAPI\r
DebugAssert (\r
IN CONST CHAR8 *FileName,\r
- IN INTN LineNumber,\r
+ IN UINTN LineNumber,\r
IN CONST CHAR8 *Description\r
)\r
{\r
EFIAPI\r
DebugAssert (\r
IN CONST CHAR8 *FileName,\r
- IN INTN LineNumber,\r
+ IN UINTN LineNumber,\r
IN CONST CHAR8 *Description\r
)\r
{\r
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="DxeReportStatusCodeLib" />\r
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BaseReportStatusCodeLibNull" />\r
\r
- <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLib80" />\r
+ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" />\r
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibDebug" />\r
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" />\r
\r
<ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="DxeReportStatusCodeLib" />\r
<ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="BaseReportStatusCodeLibNull" />\r
\r
- <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="BasePostCodeLib80" />\r
+ <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" />\r
<ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="BasePostCodeLibDebug" />\r
<ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" />\r
\r
<ModuleSA Arch="X64" FvBinding="NULL" ModuleName="DxeReportStatusCodeLib" />\r
<ModuleSA Arch="X64" FvBinding="NULL" ModuleName="BaseReportStatusCodeLibNull" />\r
\r
- <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="BasePostCodeLib80" />\r
+ <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" />\r
<ModuleSA Arch="X64" FvBinding="NULL" ModuleName="BasePostCodeLibDebug" />\r
<ModuleSA Arch="X64" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" />\r
\r
<ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="DxeReportStatusCodeLib" />\r
<ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="BaseReportStatusCodeLibNull" />\r
\r
- <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="BasePostCodeLib80" />\r
+ <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" />\r
<ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="BasePostCodeLibDebug" />\r
<ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" />\r
\r
</PcdData>\r
</PcdBuildDefinition>\r
</ModuleSA>\r
- <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLib80" >\r
+ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" >\r
<PcdBuildDefinition>\r
<PcdData ItemType="FIXED_AT_BUILD">\r
<C_Name>PcdPostCodePropertyMask</C_Name>\r
</PcdData>\r
</PcdBuildDefinition>\r
</ModuleSA>\r
- <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="BasePostCodeLib80" >\r
+ <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" >\r
<PcdBuildDefinition>\r
<PcdData ItemType="FIXED_AT_BUILD">\r
<C_Name>PcdPostCodePropertyMask</C_Name>\r
</PcdData>\r
</PcdBuildDefinition>\r
</ModuleSA> \r
- <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="BasePostCodeLib80" >\r
+ <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" >\r
<PcdBuildDefinition>\r
<PcdData ItemType="FIXED_AT_BUILD">\r
<C_Name>PcdPostCodePropertyMask</C_Name>\r
</PcdData>\r
</PcdBuildDefinition>\r
</ModuleSA> \r
- <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="BasePostCodeLib80" >\r
+ <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" >\r
<PcdBuildDefinition>\r
<PcdData ItemType="FIXED_AT_BUILD">\r
<C_Name>PcdPostCodePropertyMask</C_Name>\r
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiIoLibCpuIo" />\r
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="DxeReportStatusCodeLib" />\r
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BaseReportStatusCodeLibNull" />\r
- <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLib80" />\r
+ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" />\r
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibDebug" />\r
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" />\r
\r
</PcdData>\r
</PcdBuildDefinition>\r
</ModuleSA> \r
- <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLib80" >\r
+ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" >\r
<PcdBuildDefinition>\r
<PcdData ItemType="FIXED_AT_BUILD">\r
<C_Name>PcdPostCodePropertyMask</C_Name>\r
<Filename>Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.msa</Filename>\r
</MsaFile>\r
<MsaFile>\r
- <Filename>Library/BasePostCodeLib80/BasePostCodeLib80.msa</Filename>\r
+ <Filename>Library/BasePostCodeLibPort80/BasePostCodeLibPort80.msa</Filename>\r
</MsaFile>\r
<MsaFile>\r
<Filename>Library/BasePostCodeLibDebug/BasePostCodeLibDebug.msa</Filename>\r