diff options
author | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
---|---|---|
committer | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
commit | b7c51c9cf4864df6aabb99a1ae843becd577237c (patch) | |
tree | eebe9b0d0ca03062955223097e57da84dd618b9a /ReferenceCode/AcpiTables/Protocol | |
download | zprj-master.tar.xz |
Diffstat (limited to 'ReferenceCode/AcpiTables/Protocol')
8 files changed, 368 insertions, 0 deletions
diff --git a/ReferenceCode/AcpiTables/Protocol/AcpiInfo/AcpiInfo.c b/ReferenceCode/AcpiTables/Protocol/AcpiInfo/AcpiInfo.c new file mode 100644 index 0000000..615e5cc --- /dev/null +++ b/ReferenceCode/AcpiTables/Protocol/AcpiInfo/AcpiInfo.c @@ -0,0 +1,42 @@ +/** @file + +@brief + This file defines the Acpi Info Protocol. + +@copyright + Copyright (c) 2012 Intel Corporation. All rights reserved + This software and associated documentation (if any) is furnished + under a license and may only be used or copied in accordance + with the terms of the license. Except as permitted by such + license, no part of this software or documentation may be + reproduced, stored in a retrieval system, or transmitted in any + form or by any means without the express written consent of + Intel Corporation. + + This file contains a 'Sample Driver' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may be modified by the user, subject to + the additional terms of the license agreement +**/ + +/// +/// Statements that include other files +/// +/// +/// External include files do NOT need to be explicitly specified in real EDKII environment +/// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +#endif + +#include "AcpiInfo.h" + +/// +/// Protocol GUID definition +/// +EFI_GUID gEfiAcpiInfoProtocolGuid = EFI_ACPI_INFO_PROTOCOL_GUID; + +/// +/// Protocol description string +/// +EFI_GUID_STRING(&gEfiAcpiInfoProtocolGuid, "Acpi Info Protocol", "Acpi Information Protocol"); diff --git a/ReferenceCode/AcpiTables/Protocol/AcpiInfo/AcpiInfo.h b/ReferenceCode/AcpiTables/Protocol/AcpiInfo/AcpiInfo.h new file mode 100644 index 0000000..9454f7d --- /dev/null +++ b/ReferenceCode/AcpiTables/Protocol/AcpiInfo/AcpiInfo.h @@ -0,0 +1,68 @@ +/** @file + This file defines the ACPI Info Protocol. + +@copyright + Copyright (c) 2012 - 2014 Intel Corporation. All rights reserved + This software and associated documentation (if any) is furnished + under a license and may only be used or copied in accordance + with the terms of the license. Except as permitted by such + license, no part of this software or documentation may be + reproduced, stored in a retrieval system, or transmitted in any + form or by any means without the express written consent of + Intel Corporation. + + This file contains a 'Sample Driver' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may be modified by the user, subject to + the additional terms of the license agreement +**/ +#ifndef _ACPI_INFO_H_ +#define _ACPI_INFO_H_ + +/// +/// Define ACPI INFO protocol GUID (EDK and EDKII have different GUID formats) +/// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#define EFI_ACPI_INFO_PROTOCOL_GUID \ + { \ + 0xfcdc1aa3, 0x1f1e, 0x4d47, 0xbf, 0x61, 0x3c, 0x3b, 0xd2, 0x65, 0x5d, 0x1e \ + } +#else +#define EFI_ACPI_INFO_PROTOCOL_GUID \ + { \ + 0xfcdc1aa3, 0x1f1e, 0x4d47, \ + { \ + 0xbf, 0x61, 0x3c, 0x3b, 0xd2, 0x65, 0x5d, 0x1e \ + } \ + } +#endif + +/// +/// Extern the GUID for protocol users. +/// +extern EFI_GUID gEfiAcpiInfoProtocolGuid; + +// +// Forward reference for ANSI C compatibility +// +typedef struct _EFI_ACPI_INFO_PROTOCOL EFI_ACPI_INFO_PROTOCOL; + +/// +/// Protocol revision number +/// Any backwards compatible changes to this protocol will result in an update in the revision number +/// Major changes will require publication of a new protocol +/// +/// Revision 1: Original version +/// +#define ACPI_INFO_PROTOCOL_REVISION_1 1 +#define ACPI_RC_VERSION 0x01090000 + +/// +/// Protocol definition +/// +struct _EFI_ACPI_INFO_PROTOCOL { + UINT8 Revision; + UINT32 RCVersion; +}; + +#endif diff --git a/ReferenceCode/AcpiTables/Protocol/AcpiPlatformPolicy/AcpiPlatformPolicy.c b/ReferenceCode/AcpiTables/Protocol/AcpiPlatformPolicy/AcpiPlatformPolicy.c new file mode 100644 index 0000000..8a9b683 --- /dev/null +++ b/ReferenceCode/AcpiTables/Protocol/AcpiPlatformPolicy/AcpiPlatformPolicy.c @@ -0,0 +1,38 @@ +/** @file + +@brief + This file defines the ACPI Policy Protocol. + +@copyright + Copyright (c) 2012 Intel Corporation. All rights reserved + This software and associated documentation (if any) is furnished + under a license and may only be used or copied in accordance + with the terms of the license. Except as permitted by such + license, no part of this software or documentation may be + reproduced, stored in a retrieval system, or transmitted in any + form or by any means without the express written consent of + Intel Corporation. + + This file contains an 'Intel Peripheral Driver' and uniquely + identified as "Intel Reference Module" and is + licensed for Intel CPUs and chipsets under the terms of your + license agreement with Intel or your vendor. This file may + be modified by the user, subject to additional terms of the + license agreement +**/ + +/// +/// Statements that include other files +/// +#include "EdkIIGlueDxe.h" +#include "AcpiPlatformPolicy.h" + +/// +/// Protocol GUID definition +/// +EFI_GUID gAcpiPlatformPolicyProtocolGuid = ACPI_PLATFORM_POLICY_PROTOCOL_GUID; + +/// +/// Protocol description string +/// +EFI_GUID_STRING (&gAcpiPlatformPolicyProtocolGuid, "AcpiPlatformPolicy Protocol", "Intel(R) DXE Phase ACPI Platform Policy Protocol"); diff --git a/ReferenceCode/AcpiTables/Protocol/AcpiPlatformPolicy/AcpiPlatformPolicy.h b/ReferenceCode/AcpiTables/Protocol/AcpiPlatformPolicy/AcpiPlatformPolicy.h new file mode 100644 index 0000000..5dc7727 --- /dev/null +++ b/ReferenceCode/AcpiTables/Protocol/AcpiPlatformPolicy/AcpiPlatformPolicy.h @@ -0,0 +1,59 @@ +/** @file + Interface definition details between ACPI and platform drivers during DXE phase. + +@copyright + Copyright (c) 2012 Intel Corporation. All rights reserved + This software and associated documentation (if any) is furnished + under a license and may only be used or copied in accordance + with the terms of the license. Except as permitted by such + license, no part of this software or documentation may be + reproduced, stored in a retrieval system, or transmitted in any + form or by any means without the express written consent of + Intel Corporation. + + This file contains an 'Intel Peripheral Driver' and uniquely + identified as "Intel Reference Module" and is + licensed for Intel CPUs and chipsets under the terms of your + license agreement with Intel or your vendor. This file may + be modified by the user, subject to additional terms of the + license agreement +**/ + +#ifndef _ACPI_PLATFORM_POLICY_H_ +#define _ACPI_PLATFORM_POLICY_H_ + +/// +/// ACPI policy provided by platform for DXE phase +/// +#define ACPI_PLATFORM_POLICY_PROTOCOL_GUID \ + { 0xe9a6ca5a, 0x85bc, 0x4840, 0x87, 0x84, 0x94, 0xcf, 0xc9, 0xed, 0x67, 0x66 } + +/// +/// Extern the GUID for protocol users. +/// +extern EFI_GUID gAcpiPlatformPolicyProtocolGuid; + +// +// Forward reference for ANSI C compatibility +// +EFI_FORWARD_DECLARATION (ACPI_PLATFORM_POLICY_PROTOCOL); + +/// +/// Protocol revision number +/// +#define ACPI_PLATFORM_POLICY_PROTOCOL_REVISION_1 1 + +/// +/// ACPI DXE Platform Policy +/// +struct _ACPI_PLATFORM_POLICY_PROTOCOL { + UINT8 Revision; + UINT16 BoardId; + UINT8 EnableDptf; ///< 0=Disable; 1=Enable; DEFAULT=0 + UINT8 EnableCppc; ///< 0=Disable; 1=Enable; DEFAULT=0 + UINT8 EnableCppcPlatformSCI; ///< 0=Disable; 1=Enable; DEFAULT=0 + UINT8 EnableRtD3; ///< 0=Disable; 1=Enable; DEFAULT=0 + UINT8 EnableAcpiDebug; ///< 0=Disable; 1=Enable; DEFAULT=0 +}; + +#endif diff --git a/ReferenceCode/AcpiTables/Protocol/AcpiProtocolLib.cif b/ReferenceCode/AcpiTables/Protocol/AcpiProtocolLib.cif new file mode 100644 index 0000000..59b6e4e --- /dev/null +++ b/ReferenceCode/AcpiTables/Protocol/AcpiProtocolLib.cif @@ -0,0 +1,14 @@ +<component> + name = "AcpiProtocolLib" + category = ModulePart + LocalRoot = "ReferenceCode\AcpiTables\Protocol\" + RefName = "AcpiProtocolLib" +[files] +"AcpiProtocolLib.sdl" +"AcpiProtocolLib.mak" +"AcpiProtocolLib.inf" +"AcpiInfo\AcpiInfo.c" +"AcpiInfo\AcpiInfo.h" +"AcpiPlatformPolicy\AcpiPlatformPolicy.c" +"AcpiPlatformPolicy\AcpiPlatformPolicy.h" +<endComponent> diff --git a/ReferenceCode/AcpiTables/Protocol/AcpiProtocolLib.inf b/ReferenceCode/AcpiTables/Protocol/AcpiProtocolLib.inf new file mode 100644 index 0000000..a4ed178 --- /dev/null +++ b/ReferenceCode/AcpiTables/Protocol/AcpiProtocolLib.inf @@ -0,0 +1,56 @@ +## @file +# Component description file for Acpi protocol module +# +#@copyright +# Copyright (c) 2012 Intel Corporation. All rights reserved +# This software and associated documentation (if any) is furnished +# under a license and may only be used or copied in accordance +# with the terms of the license. Except as permitted by such +# license, no part of this software or documentation may be +# reproduced, stored in a retrieval system, or transmitted in any +# form or by any means without the express written consent of +# Intel Corporation. +# +# This file contains an 'Intel Peripheral Driver' and uniquely +# identified as "Intel Reference Module" and is +# licensed for Intel CPUs and chipsets under the terms of your +# license agreement with Intel or your vendor. This file may +# be modified by the user, subject to additional terms of the +# license agreement +# + + +[defines] +BASE_NAME = AcpiProtocolLib +COMPONENT_TYPE = LIBRARY + +[sources.common] + AcpiPlatformPolicy/AcpiPlatformPolicy.h + AcpiPlatformPolicy/AcpiPlatformPolicy.c + AcpiInfo/AcpiInfo.h + AcpiInfo/AcpiInfo.c + +[includes.common] + $(EDK_SOURCE)/Foundation/Efi + $(EDK_SOURCE)/Foundation/Include + $(EDK_SOURCE)/Foundation/Efi/Include + $(EDK_SOURCE)/Foundation/Framework/Include + $(EFI_SOURCE)/$(PROJECT_ACPI_ROOT) + +# +# Edk II Glue Library, some header are included by R9 header so have to include +# + $(EFI_SOURCE) + $(EDK_SOURCE)/Foundation + $(EDK_SOURCE)/Foundation/Framework + $(EDK_SOURCE)/Foundation/Include/IndustryStandard + $(EDK_SOURCE)/Foundation/Core/Dxe + $(EDK_SOURCE)/Foundation/Include/Pei + $(EDK_SOURCE)/Foundation/Library/Dxe/Include + $(EDK_SOURCE)/Foundation/Library/EdkIIGlueLib/Include + +[libraries.common] + EdkFrameworkProtocolLib + +[nmake.common] +C_STD_INCLUDE= diff --git a/ReferenceCode/AcpiTables/Protocol/AcpiProtocolLib.mak b/ReferenceCode/AcpiTables/Protocol/AcpiProtocolLib.mak new file mode 100644 index 0000000..5e84a5e --- /dev/null +++ b/ReferenceCode/AcpiTables/Protocol/AcpiProtocolLib.mak @@ -0,0 +1,55 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +#<AMI_FHDR_START> +# +# Name: AcpiProtocolLib.mak +# +# Description: +# +#<AMI_FHDR_END> +#************************************************************************* +all : AcpiProtocolLib + +$(AcpiProtocolLib_LIB) : AcpiProtocolLib + +AcpiProtocolLib : $(BUILD_DIR)\AcpiProtocolLib.mak AcpiProtocolLibBin + +$(BUILD_DIR)\AcpiProtocolLib.mak : $(AcpiProtocolLib_DIR)\$(@B).cif $(AcpiProtocolLib_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(AcpiProtocolLib_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +AcpiProtocolLib_INCLUDES =\ + $(EDK_INCLUDES) \ + $(EdkIIGlueLib_INCLUDES) + +AcpiProtocolLibBin : + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\ + /f $(BUILD_DIR)\AcpiProtocolLib.mak all\ + "MY_INCLUDES=$(AcpiProtocolLib_INCLUDES)" \ + TYPE=LIBRARY + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* diff --git a/ReferenceCode/AcpiTables/Protocol/AcpiProtocolLib.sdl b/ReferenceCode/AcpiTables/Protocol/AcpiProtocolLib.sdl new file mode 100644 index 0000000..14f9503 --- /dev/null +++ b/ReferenceCode/AcpiTables/Protocol/AcpiProtocolLib.sdl @@ -0,0 +1,36 @@ +TOKEN + Name = "AcpiProtocolLib_SUPPORT" + Value = "1" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes + Help = "Main switch to enable AcpiProtocolLib support in Project" +End + +MODULE + Help = "Includes AcpiProtocolLib.mak to Project" + File = "AcpiProtocolLib.mak" +End + +PATH + Name = "AcpiProtocolLib_DIR" +End + +TOKEN + Name = "AcpiProtocolLib_LIB" + Value = "$(BUILD_DIR)\AcpiProtocolLib.lib" + TokenType = Expression + TargetMAK = Yes +End + +ELINK + Name = "AcpiProtocolLib_INCLUDES" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "/I$(AcpiProtocolLib_DIR)" + Parent = "AcpiProtocolLib_INCLUDES" + InvokeOrder = AfterParent +End
\ No newline at end of file |