diff options
Diffstat (limited to 'EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode')
5 files changed, 359 insertions, 0 deletions
diff --git a/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/EdkIIGluePeiDxePostCodeLibReportStatusCode.cif b/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/EdkIIGluePeiDxePostCodeLibReportStatusCode.cif new file mode 100644 index 0000000..ada48e4 --- /dev/null +++ b/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/EdkIIGluePeiDxePostCodeLibReportStatusCode.cif @@ -0,0 +1,11 @@ +<component> + name = "EdkIIGluePeiDxePostCodeLibReportStatusCode" + category = ModulePart + LocalRoot = "Edk\Foundation\Library\EdkIIGlueLib\Library\PeiDxePostCodeLibReportStatusCode" + RefName = "EdkIIGluePeiDxePostCodeLibReportStatusCode" +[files] +"EdkIIGluePeiDxePostCodeLibReportStatusCode.sdl" +"EdkIIGluePeiDxePostCodeLibReportStatusCode.mak" +"PeiDxePostCodeLibReportStatusCode.inf" +"PostCode.c" +<endComponent> diff --git a/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/EdkIIGluePeiDxePostCodeLibReportStatusCode.mak b/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/EdkIIGluePeiDxePostCodeLibReportStatusCode.mak new file mode 100644 index 0000000..92a03b3 --- /dev/null +++ b/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/EdkIIGluePeiDxePostCodeLibReportStatusCode.mak @@ -0,0 +1,80 @@ +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2009, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** + +#********************************************************************** +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/IntelEDK/EdkIIGlue/EdkIIGluePeiDxePostCodeLibReportStatusCode/EdkIIGluePeiDxePostCodeLibReportStatusCode.mak 1 1/20/12 3:56a Jeffch $ +# +# $Revision: 1 $ +# +# $Date: 1/20/12 3:56a $ +#********************************************************************** +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/IntelEDK/EdkIIGlue/EdkIIGluePeiDxePostCodeLibReportStatusCode/EdkIIGluePeiDxePostCodeLibReportStatusCode.mak $ +# +# 1 1/20/12 3:56a Jeffch +# Create Intel EDK 1117 Patch 7. +# +# 1 9/27/11 6:18a Wesleychen +# Intel EDK initially releases. +# +# 1 9/18/09 1:56a Iminglin +# +#********************************************************************** +#<AMI_FHDR_START> +# +# Name: EdkIIGluePeiDxePostCodeLibReportStatusCode.mak +# +# Description: +# +#<AMI_FHDR_END> +#********************************************************************** + + +$(EdkIIGluePeiDxePostCodeLibReportStatusCode_LIB) : EdkIIGluePeiDxePostCodeLibReportStatusCode + +EdkIIGluePeiDxePostCodeLibReportStatusCode : $(BUILD_DIR)\EdkIIGluePeiDxePostCodeLibReportStatusCode.mak EdkIIGluePeiDxePostCodeLibReportStatusCodeBin + +$(BUILD_DIR)\EdkIIGluePeiDxePostCodeLibReportStatusCode.mak : $(EdkIIGluePeiDxePostCodeLibReportStatusCode_DIR)\$(@B).cif $(EdkIIGluePeiDxePostCodeLibReportStatusCode_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(EdkIIGluePeiDxePostCodeLibReportStatusCode_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +EdkIIGluePeiDxePostCodeLibReportStatusCodeBin : +!IF "$(x64_BUILD)"=="1" + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\ + BUILD_DIR=$(BUILD_DIR)\ + /f $(BUILD_DIR)\EdkIIGluePeiDxePostCodeLibReportStatusCode.mak all\ + TYPE=LIBRARY "PARAMETERS=LIBRARY_NAME=$$(EdkIIGluePeiDxePostCodeLibReportStatusCode_LIB)" + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\ + BUILD_DIR=$(BUILD_DIR)\IA32\ + /f $(BUILD_DIR)\EdkIIGluePeiDxePostCodeLibReportStatusCode.mak all\ + TYPE=PEI_LIBRARY "PARAMETERS=LIBRARY_NAME=$$(EdkIIGluePeiDxePostCodeLibReportStatusCode_LIB)" +!ELSE + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\ + BUILD_DIR=$(BUILD_DIR)\ + /f $(BUILD_DIR)\EdkIIGluePeiDxePostCodeLibReportStatusCode.mak all\ + TYPE=LIBRARY "PARAMETERS=LIBRARY_NAME=$$(EdkIIGluePeiDxePostCodeLibReportStatusCode_LIB)" +!ENDIF +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2009, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** diff --git a/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/EdkIIGluePeiDxePostCodeLibReportStatusCode.sdl b/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/EdkIIGluePeiDxePostCodeLibReportStatusCode.sdl new file mode 100644 index 0000000..386b4b6 --- /dev/null +++ b/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/EdkIIGluePeiDxePostCodeLibReportStatusCode.sdl @@ -0,0 +1,26 @@ +TOKEN + Name = "EdkIIGluePeiDxePostCodeLibReportStatusCode_SUPPORT" + Value = "1" + Help = "Main switch to enable EdkIIGluePeiDxePostCodeLibReportStatusCode support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +TOKEN + Name = "EdkIIGluePeiDxePostCodeLibReportStatusCode_LIB" + Value = "$$(LIB_BUILD_DIR)\EdkIIGluePeiDxePostCodeLibReportStatusCode.lib" + TokenType = Expression + TargetMAK = Yes +End + +PATH + Name = "EdkIIGluePeiDxePostCodeLibReportStatusCode_DIR" +End + +MODULE + Help = "Includes EdkIIGluePeiDxePostCodeLibReportStatusCode.mak to Project" + File = "EdkIIGluePeiDxePostCodeLibReportStatusCode.mak" +End + diff --git a/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.inf b/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.inf new file mode 100644 index 0000000..8916894 --- /dev/null +++ b/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.inf @@ -0,0 +1,81 @@ +#/*++ +# +# Copyright (c) 2004 - 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# PeiDxePostCodeLibReportStatusCode.inf +# +# Abstract: +# +# Component description file for PeiDxePostCodeLibReportStatusCode. +# +#--*/ + +[defines] +BASE_NAME = EdkIIGluePeiDxePostCodeLibReportStatusCode +COMPONENT_TYPE = LIBRARY + +[sources.common] + PostCode.c + +[sources.ia32] + +[sources.x64] + +[sources.ipf] + +[sources.ebc] + + +[includes.common] + . + ..\..\Include + ..\..\include\Library + $(EDK_SOURCE)\Foundation + $(EDK_SOURCE)\Foundation\Framework + $(EDK_SOURCE)\Foundation\Framework\Protocol\Hii + $(EDK_SOURCE)\Foundation\Efi + $(EDK_SOURCE)\Foundation\Include + $(EDK_SOURCE)\Foundation\Efi\Include + $(EDK_SOURCE)\Foundation\Framework\Include + $(EDK_SOURCE)\Foundation\Include\IndustryStandard + $(EDK_SOURCE)\Foundation\Core\Dxe + $(EDK_SOURCE)\Foundation\Library\Dxe\Include + $(EDK_SOURCE)\Foundation\Library\Dxe\EfiIfrSupportLib + $(EDK_SOURCE)\Foundation\Cpu\Pentium\Include + +[libraries.common] +# +# An user must specify a PEI or DXE ReportStatusCodeLib instance in module's .inf +# + EfiProtocolLib + +[libraries.ia32] + + +[libraries.x64] + + +[nmake.common] + C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION + LIB_STD_FLAGS = /NOLOGO /IGNORE:4006 + +[nmake.ia32] + C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32 + +[nmake.x64] + C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64 + +[nmake.ipf] + C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF + +[nmake.ebc] + C_FLAGS = $(C_FLAGS) /D MDE_CPU_EBC
\ No newline at end of file diff --git a/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PostCode.c b/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PostCode.c new file mode 100644 index 0000000..6fcb711 --- /dev/null +++ b/EDK/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PostCode.c @@ -0,0 +1,161 @@ +/*++ + +Copyright (c) 2004 - 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + + +Module Name: + + PostCode.c + +Abstract: + + Post Code Lib + +--*/ + +#include "EdkIIGlueDxe.h" +#include "Pcd\EdkIIGluePcdPostCodeLib.h" + +/** + Converts POST code value to status code value. + + This macro converts the post code to status code value. Bits 0..4 of PostCode + are mapped to bits 16..20 of status code value, and bits 5..7 of PostCode are mapped to bits + 24..26 of status code value. + + @param PostCode POST code value. + + @return The converted status code value. + +**/ +#define POST_CODE_TO_STATUS_CODE_VALUE(PostCode) \ + ((EFI_STATUS_CODE_VALUE) (((PostCode & 0x1f) << 16) | ((PostCode & 0x3) << 19))) + +/** + Sends an 32-bit value to a POST card. + + Sends the 32-bit value specified by Value to a POST card, and returns Value. + Some implementations of this library function may perform I/O operations + directly to a POST card device. Other implementations may send Value to + ReportStatusCode(), and the status code reporting mechanism will eventually + display the 32-bit value on the status reporting device. + + PostCode() must actively prevent recursion. If PostCode() is called while + processing another any other Report Status Code Library function, then + PostCode() must return Value immediately. + + @param Value The 32-bit value to write to the POST card. + + @return Value + +**/ +UINT32 +EFIAPI +GluePostCode ( + IN UINT32 Value + ) +{ + REPORT_STATUS_CODE (EFI_PROGRESS_CODE, POST_CODE_TO_STATUS_CODE_VALUE (Value)); + return Value; +} + + +/** + Sends an 32-bit value to a POST and associated ASCII string. + + Sends the 32-bit value specified by Value to a POST card, and returns Value. + If Description is not NULL, then the ASCII string specified by Description is + also passed to the handler that displays the POST card value. Some + implementations of this library function may perform I/O operations directly + to a POST card device. Other implementations may send Value to ReportStatusCode(), + and the status code reporting mechanism will eventually display the 32-bit + value on the status reporting device. + + PostCodeWithDescription()must actively prevent recursion. If + PostCodeWithDescription() is called while processing another any other Report + Status Code Library function, then PostCodeWithDescription() must return Value + immediately. + + @param Value The 32-bit value to write to the POST card. + @param Description Pointer to an ASCII string that is a description of the + POST code value. This is an optional parameter that may + be NULL. + + @return Value + +**/ +UINT32 +EFIAPI +GluePostCodeWithDescription ( + IN UINT32 Value, + IN CONST CHAR8 *Description OPTIONAL + ) +{ + if (Description == NULL) { + REPORT_STATUS_CODE ( + EFI_PROGRESS_CODE, + POST_CODE_TO_STATUS_CODE_VALUE (Value) + ); + } else { + REPORT_STATUS_CODE_WITH_EXTENDED_DATA ( + EFI_PROGRESS_CODE, + POST_CODE_TO_STATUS_CODE_VALUE (Value), + Description, + AsciiStrSize (Description) + ); + } + + return Value; +} + + +/** + Returns TRUE if POST Codes are enabled. + + This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED + bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned. + + @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of + PcdPostCodeProperyMask is set. + @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of + PcdPostCodeProperyMask is clear. + +**/ +BOOLEAN +EFIAPI +GluePostCodeEnabled ( + VOID + ) +{ + return ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0); +} + + +/** + Returns TRUE if POST code descriptions are enabled. + + This function returns TRUE if the + POST_CODE_PROPERTY_POST_CODE_ENABLED bit of + PcdPostCodePropertyMask is set. Otherwise FALSE is returned. + + @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED + bit of PcdPostCodeProperyMask is set. + @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED + bit of PcdPostCodeProperyMask is clear. + +**/ +BOOLEAN +EFIAPI +GluePostCodeDescriptionEnabled ( + VOID + ) +{ + return ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0); +} |