summaryrefslogtreecommitdiff
path: root/ReferenceCode/ME/SampleCode/Protocol
diff options
context:
space:
mode:
authorraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
committerraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
commitb7c51c9cf4864df6aabb99a1ae843becd577237c (patch)
treeeebe9b0d0ca03062955223097e57da84dd618b9a /ReferenceCode/ME/SampleCode/Protocol
downloadzprj-master.tar.xz
init. 1AQQW051HEADmaster
Diffstat (limited to 'ReferenceCode/ME/SampleCode/Protocol')
-rw-r--r--ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetType.c42
-rw-r--r--ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetType.h57
-rw-r--r--ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetTypeProtocolLib.cif11
-rw-r--r--ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetTypeProtocolLib.mak67
-rw-r--r--ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetTypeProtocolLib.sdl34
-rw-r--r--ReferenceCode/ME/SampleCode/Protocol/SmmVariable/SmmVariable.h52
6 files changed, 263 insertions, 0 deletions
diff --git a/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetType.c b/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetType.c
new file mode 100644
index 0000000..43b748a
--- /dev/null
+++ b/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetType.c
@@ -0,0 +1,42 @@
+/** @file
+ This file defines the EFI ME Platform Get Reset Type Protocol
+
+@copyright
+ Copyright (c) 2011 - 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"
+//
+// Include the protocol header file
+//
+#include EFI_PROTOCOL_DEFINITION (MePlatformGetResetType)
+#endif
+//
+// Protocol GUID definition
+//
+EFI_GUID gMePlatformGetResetTypeGuid = ME_PLATFORM_GET_RESET_TYPE_GUID;
+
+//
+// Protocol description
+//
+EFI_GUID_STRING(&gMePlatformGetResetTypeGuid, "MePlatformGetResetType Protocol", "Intel(R) ME Platform Reset Protocol");
diff --git a/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetType.h b/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetType.h
new file mode 100644
index 0000000..5134b55
--- /dev/null
+++ b/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetType.h
@@ -0,0 +1,57 @@
+/** @file
+ Interface definition Me Platform Get Reset Type.
+
+@copyright
+ Copyright (c) 2011 - 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
+**/
+#ifndef _ME_PLATFORM_GET_RESET_TYPE_H_
+#define _ME_PLATFORM_GET_RESET_TYPE_H_
+
+#define ME_PLATFORM_GET_RESET_TYPE_GUID \
+ { \
+ 0xb8cdced7, 0xbdc4, 0x4464, 0x9a, 0x1a, 0xff, 0x3f, 0xbd, 0xf7, 0x48, 0x69 \
+ }
+
+#define ME_PLATFORM_GET_RESET_TYPE_PROTOCOL_REVISION 1
+extern EFI_GUID gMePlatformGetResetTypeGuid;
+
+///
+/// ME_SPEICAL_RESET_TYPES must be aligned with PCH_EXTENDED_RESET_TYPES
+///
+typedef enum {
+ PowerCycleResetReq = 3,
+ GlobalResetReq,
+ GlobalResetWithEcReq,
+ MaxRestReq
+} ME_SPEICAL_RESET_TYPES;
+
+/**
+ Get Platform requested reset type
+
+ @param[in] Type UEFI defined reset type
+
+ @retval ME_SPEICAL_RESET_TYPES ME reset type aligned with PCH_EXTENDED_RESET_TYPES
+**/
+typedef
+ME_SPEICAL_RESET_TYPES
+(EFIAPI *GET_RESET_TYPE) (
+ IN EFI_RESET_TYPE Type
+ );
+
+typedef struct _ME_PLATFORM_GET_RESET_TYPE_PROTOCOL {
+ GET_RESET_TYPE GetResetType;
+} ME_PLATFORM_GET_RESET_TYPE_PROTOCOL;
+
+#endif
diff --git a/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetTypeProtocolLib.cif b/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetTypeProtocolLib.cif
new file mode 100644
index 0000000..2e4412e
--- /dev/null
+++ b/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetTypeProtocolLib.cif
@@ -0,0 +1,11 @@
+<component>
+ name = "MePlatformGetResetTypeProtocolLib"
+ category = ModulePart
+ LocalRoot = "\ReferenceCode\ME\SampleCode\Protocol\MePlatformGetResetType\"
+ RefName = "MePlatformGetResetTypeProtocolLib"
+[files]
+"MePlatformGetResetTypeProtocolLib.sdl"
+"MePlatformGetResetTypeProtocolLib.mak"
+"MePlatformGetResetType.h"
+"MePlatformGetResetType.c"
+<endComponent>
diff --git a/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetTypeProtocolLib.mak b/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetTypeProtocolLib.mak
new file mode 100644
index 0000000..504290e
--- /dev/null
+++ b/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetTypeProtocolLib.mak
@@ -0,0 +1,67 @@
+#**********************************************************************
+#**********************************************************************
+#** **
+#** (C)Copyright 1985-2010, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#**********************************************************************
+#**********************************************************************
+#**********************************************************************
+# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeSampleCode/MePlatformGetResetTypeProtocolLib/MePlatformGetResetTypeProtocolLib.mak 1 2/08/12 12:55a Klzhan $
+#
+# $Revision: 1 $
+#
+# $Date: 2/08/12 12:55a $
+#**********************************************************************
+# Revision History
+# ----------------
+#
+#**********************************************************************
+#<AMI_FHDR_START>
+#
+# Name: AmtWrapperProtocolLib.mak
+#
+# Description:
+#
+#<AMI_FHDR_END>
+#**********************************************************************
+all : MePlatformGetResetTypeProtocolLib
+
+$(BUILD_DIR)\MePlatformGetResetTypeProtocolLib.lib : MePlatformGetResetTypeProtocolLib
+
+MePlatformGetResetTypeProtocolLib : $(BUILD_DIR)\MePlatformGetResetTypeProtocolLib.mak MePlatformGetResetTypeProtocolLibBin
+
+$(BUILD_DIR)\MePlatformGetResetTypeProtocolLib.mak : $(MePlatformGetResetTypeProtocolLib_DIR)\$(@B).cif $(MePlatformGetResetTypeProtocolLib_DIR)\$(@B).mak $(BUILD_RULES)
+ $(CIF2MAK) $(MePlatformGetResetTypeProtocolLib_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS)
+
+MePlatformGetResetTypeProtocolLib_INCLUDES=\
+ $(EDK_INCLUDES) \
+ $(EdkIIGlueLib_INCLUDES)\
+ $(ME_INCLUDES) \
+ $(MISCFRAMEWORK_INCLUDES) \
+ -I ReferenceCode\ME\SampleCode
+
+MePlatformGetResetTypeProtocolLibBin :
+ $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\
+ /f $(BUILD_DIR)\MePlatformGetResetTypeProtocolLib.mak all\
+ "MY_INCLUDES=$(MePlatformGetResetTypeProtocolLib_INCLUDES)" \
+ TYPE=LIBRARY \
+
+#**********************************************************************
+#**********************************************************************
+#** **
+#** (C)Copyright 1985-2010, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#**********************************************************************
+#********************************************************************** \ No newline at end of file
diff --git a/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetTypeProtocolLib.sdl b/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetTypeProtocolLib.sdl
new file mode 100644
index 0000000..1c0cc7d
--- /dev/null
+++ b/ReferenceCode/ME/SampleCode/Protocol/MePlatformGetResetType/MePlatformGetResetTypeProtocolLib.sdl
@@ -0,0 +1,34 @@
+TOKEN
+ Name = "MePlatformGetResetTypeProtocolLib_SUPPORT"
+ Value = "1"
+ Help = "Main switch to enable AmtWrapperProtocolLib support in Project"
+ TokenType = Boolean
+ TargetMAK = Yes
+ Master = Yes
+End
+
+PATH
+ Name = "MePlatformGetResetTypeProtocolLib_DIR"
+End
+
+ELINK
+ Name = "/I$(MePlatformGetResetTypeProtocolLib_DIR)"
+ Parent = "ME_INCLUDES"
+ InvokeOrder = AfterParent
+End
+
+MODULE
+ Help = "Includes AmtWrapperProtocolLib.mak to Project"
+ File = "MePlatformGetResetTypeProtocolLib.mak"
+End
+
+ELINK
+ Name = "MePlatformGetResetTypeProtocolLib_LIB"
+ InvokeOrder = ReplaceParent
+End
+
+ELINK
+ Name = "$(BUILD_DIR)\MePlatformGetResetTypeProtocolLib.lib"
+ Parent = "MePlatformGetResetTypeProtocolLib_LIB"
+ InvokeOrder = AfterParent
+End
diff --git a/ReferenceCode/ME/SampleCode/Protocol/SmmVariable/SmmVariable.h b/ReferenceCode/ME/SampleCode/Protocol/SmmVariable/SmmVariable.h
new file mode 100644
index 0000000..06c7762
--- /dev/null
+++ b/ReferenceCode/ME/SampleCode/Protocol/SmmVariable/SmmVariable.h
@@ -0,0 +1,52 @@
+/*++ @file
+ SMM Variable Protocol
+
+@copyright
+ Copyright (c) 2010 - 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 'Framework Code' and is licensed as such
+ under the terms of your license agreement with Intel or your
+ vendor. This file may not be modified, except as allowed by
+ additional terms of your license agreement.
+--*/
+
+#ifndef _SMM_VARIABLE_H_
+#define _SMM_VARIABLE_H_
+
+//
+// SmmVariable Protocol GUID value
+//
+// Note: The GUID value is the same as the protocol produced in EDKII.
+#define EFI_SMM_VARIABLE_PROTOCOL_GUID \
+ { \
+ 0xed32d533, 0x99e6, 0x4209, 0x9c, 0xc0, 0x2d, 0x72, 0xcd, 0xd9, 0x98, 0xa7 \
+ }
+
+EFI_FORWARD_DECLARATION (EFI_SMM_VARIABLE_PROTOCOL);
+
+typedef struct _EFI_SMM_VARIABLE_PROTOCOL EFI_SMM_VARIABLE_PROTOCOL;
+
+///
+/// EFI SMM Variable Protocol is intended for use as a means
+/// to store data in the EFI SMM environment.
+///
+struct _EFI_SMM_VARIABLE_PROTOCOL {
+ EFI_GET_VARIABLE SmmGetVariable;
+ EFI_GET_NEXT_VARIABLE_NAME SmmGetNextVariableName;
+ EFI_SET_VARIABLE SmmSetVariable;
+ EFI_QUERY_VARIABLE_INFO SmmQueryVariableInfo;
+};
+
+///
+/// SmmVariable Protocol GUID variable.
+///
+extern EFI_GUID gEfiSmmVariableProtocolGuid;
+
+#endif