diff options
Diffstat (limited to 'EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80')
5 files changed, 335 insertions, 0 deletions
diff --git a/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf b/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf new file mode 100644 index 0000000..921483e --- /dev/null +++ b/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf @@ -0,0 +1,79 @@ +#/*++ +# +# 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: +# +# BasePostCodeLibPort80.inf +# +# Abstract: +# +# Component description file for BasePostCodeLibPort80 +# +#--*/ + +[defines] +BASE_NAME = EdkIIGlueBasePostCodeLibPort80 +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\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\Cpu\Pentium\Include + $(EDK_SOURCE)\Foundation\Guid\PeiPeCoffLoader + + +[libraries.common] + EdkIIGlueBaseIoLibIntrinsic + +[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/BasePostCodeLibPort80/EdkIIGlueBasePostCodeLibPort80.cif b/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/EdkIIGlueBasePostCodeLibPort80.cif new file mode 100644 index 0000000..341bf9d --- /dev/null +++ b/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/EdkIIGlueBasePostCodeLibPort80.cif @@ -0,0 +1,11 @@ +<component> + name = "EdkIIGlueBasePostCodeLibPort80" + category = ModulePart + LocalRoot = "Edk\Foundation\Library\EdkIIGlueLib\Library\BasePostCodeLibPort80" + RefName = "EdkIIGlueBasePostCodeLibPort80" +[files] +"EdkIIGlueBasePostCodeLibPort80.sdl" +"EdkIIGlueBasePostCodeLibPort80.mak" +"BasePostCodeLibPort80.inf" +"PostCode.c" +<endComponent> diff --git a/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/EdkIIGlueBasePostCodeLibPort80.mak b/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/EdkIIGlueBasePostCodeLibPort80.mak new file mode 100644 index 0000000..7689553 --- /dev/null +++ b/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/EdkIIGlueBasePostCodeLibPort80.mak @@ -0,0 +1,87 @@ +#********************************************************************** +#********************************************************************** +#** ** +#** (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/EdkIIGlueBasePostCodeLibPort80/EdkIIGlueBasePostCodeLibPort80.mak 1 1/20/12 3:54a Jeffch $ +# +# $Revision: 1 $ +# +# $Date: 1/20/12 3:54a $ +#********************************************************************** +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/IntelEDK/EdkIIGlue/EdkIIGlueBasePostCodeLibPort80/EdkIIGlueBasePostCodeLibPort80.mak $ +# +# 1 1/20/12 3:54a Jeffch +# Create Intel EDK 1117 Patch 7. +# +# 1 9/27/11 6:16a Wesleychen +# Intel EDK initially releases. +# +# 1 9/18/09 1:53a Iminglin +# +#********************************************************************** +#<AMI_FHDR_START> +# +# Name: EdkIIGlueBasePostCodeLibPort80.mak +# +# Description: +# +#<AMI_FHDR_END> +#********************************************************************** + + +$(EdkIIGlueBasePostCodeLibPort80_LIB) : EdkIIGlueBasePostCodeLibPort80 + +EdkIIGlueBasePostCodeLibPort80 : $(BUILD_DIR)\EdkIIGlueBasePostCodeLibPort80.mak EdkIIGlueBasePostCodeLibPort80Bin + +$(BUILD_DIR)\EdkIIGlueBasePostCodeLibPort80.mak : $(EdkIIGlueBasePostCodeLibPort80_DIR)\$(@B).cif $(EdkIIGlueBasePostCodeLibPort80_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(EdkIIGlueBasePostCodeLibPort80_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +EdkIIGlueBasePostCodeLibPort80_LIB_LINKS=\ +!IF "$(PROCESSOR)"=="IA32" || "$(PROCESSOR)"=="x64" +$(EdkIIGlueBaseIoLibIntrinsic_LIB) +!ELSEIF "$(PROCESSOR)"=="EBC" +$(EdkIIGlueDxeIoLibCpuIo_LIB) +!ENDIF + +EdkIIGlueBasePostCodeLibPort80Bin : $(EdkIIGlueBasePostCodeLibPort80_LIB_LINKS) +!IF "$(x64_BUILD)"=="1" + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\ + BUILD_DIR=$(BUILD_DIR)\ + /f $(BUILD_DIR)\EdkIIGlueBasePostCodeLibPort80.mak all\ + TYPE=LIBRARY "PARAMETERS=LIBRARY_NAME=$$(EdkIIGlueBasePostCodeLibPort80_LIB)" + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\ + BUILD_DIR=$(BUILD_DIR)\IA32\ + /f $(BUILD_DIR)\EdkIIGlueBasePostCodeLibPort80.mak all\ + TYPE=PEI_LIBRARY "PARAMETERS=LIBRARY_NAME=$$(EdkIIGlueBasePostCodeLibPort80_LIB)" +!ELSE + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\ + BUILD_DIR=$(BUILD_DIR)\ + /f $(BUILD_DIR)\EdkIIGlueBasePostCodeLibPort80.mak all\ + TYPE=LIBRARY "PARAMETERS=LIBRARY_NAME=$$(EdkIIGlueBasePostCodeLibPort80_LIB)" +!ENDIF +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2009, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#**********************************************************************
\ No newline at end of file diff --git a/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/EdkIIGlueBasePostCodeLibPort80.sdl b/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/EdkIIGlueBasePostCodeLibPort80.sdl new file mode 100644 index 0000000..27db987 --- /dev/null +++ b/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/EdkIIGlueBasePostCodeLibPort80.sdl @@ -0,0 +1,26 @@ +TOKEN + Name = "EdkIIGlueBasePostCodeLibPort80_SUPPORT" + Value = "1" + Help = "Main switch to enable EdkIIGlueBasePostCodeLibPort80 support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +TOKEN + Name = "EdkIIGlueBasePostCodeLibPort80_LIB" + Value = "$$(LIB_BUILD_DIR)\EdkIIGlueBasePostCodeLibPort80.lib" + TokenType = Expression + TargetMAK = Yes +End + +PATH + Name = "EdkIIGlueBasePostCodeLibPort80_DIR" +End + +MODULE + Help = "Includes EdkIIGlueBasePostCodeLibPort80.mak to Project" + File = "EdkIIGlueBasePostCodeLibPort80.mak" +End + diff --git a/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/PostCode.c b/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/PostCode.c new file mode 100644 index 0000000..e2aec10 --- /dev/null +++ b/EDK/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/PostCode.c @@ -0,0 +1,132 @@ +/*++ + +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 functions + +--*/ + +#include "EdkIIGlueBase.h" +#include "Pcd\EdkIIGluePcdPostCodeLib.h" + +/** + 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 + ) +{ + IoWrite8 (0x80, (UINT8)(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 + ) +{ + IoWrite8 (0x80, (UINT8)(Value)); + 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); +} |