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/Haswell/SampleCode/Protocol | |
download | zprj-master.tar.xz |
Diffstat (limited to 'ReferenceCode/Haswell/SampleCode/Protocol')
5 files changed, 198 insertions, 0 deletions
diff --git a/ReferenceCode/Haswell/SampleCode/Protocol/CpuSampleCodeProtocolLib.cif b/ReferenceCode/Haswell/SampleCode/Protocol/CpuSampleCodeProtocolLib.cif new file mode 100644 index 0000000..96d3f7b --- /dev/null +++ b/ReferenceCode/Haswell/SampleCode/Protocol/CpuSampleCodeProtocolLib.cif @@ -0,0 +1,11 @@ +<component> + name = "CpuSampleCodeProtocolLib" + category = ModulePart + LocalRoot = "ReferenceCode\Haswell\SampleCode\Protocol\" + RefName = "CpuSampleCodeProtocolLib" +[files] +"CpuSampleCodeProtocolLib.mak" +"CpuSampleCodeProtocolLib.sdl" +"TxtOneTouchOp\TxtOneTouchOp.c" +"TxtOneTouchOp\TxtOneTouchOp.h" +<endComponent> diff --git a/ReferenceCode/Haswell/SampleCode/Protocol/CpuSampleCodeProtocolLib.mak b/ReferenceCode/Haswell/SampleCode/Protocol/CpuSampleCodeProtocolLib.mak new file mode 100644 index 0000000..f77edb4 --- /dev/null +++ b/ReferenceCode/Haswell/SampleCode/Protocol/CpuSampleCodeProtocolLib.mak @@ -0,0 +1,25 @@ +all : CpuSampleCodeProtocolLib + +$(CpuSampleCodeProtocolLib_LIB) : CpuSampleCodeProtocolLib + +CpuSampleCodeProtocolLib : $(BUILD_DIR)\CpuSampleCodeProtocolLib.mak CpuSampleCodeProtocolLibBin + +$(BUILD_DIR)\CpuSampleCodeProtocolLib.mak : $(CpuSampleCodeProtocolLib_DIR)\$(@B).cif $(CpuSampleCodeProtocolLib_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(CpuSampleCodeProtocolLib_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +CpuSampleCodeProtocolLib_INCLUDES=\ + $(EDK_INCLUDES)\ + $(EdkIIGlueLib_INCLUDES)\ + $(PROJECT_CPU_INCLUDES)\ + +CpuSampleCodeProtocolLibBin : + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\ + /f $(BUILD_DIR)\CpuSampleCodeProtocolLib.mak all\ + "MY_INCLUDES=$(CpuSampleCodeProtocolLib_INCLUDES)" \ + TYPE=LIBRARY +!IF "$(x64_BUILD)"=="1" + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS) BUILD_DIR=$(BUILD_DIR)\IA32\ + /f $(BUILD_DIR)\CpuSampleCodeProtocolLib.mak all\ + "MY_INCLUDES=$(CpuSampleCodeProtocolLib_INCLUDES)" \ + TYPE=PEI_LIBRARY +!ENDIF
\ No newline at end of file diff --git a/ReferenceCode/Haswell/SampleCode/Protocol/CpuSampleCodeProtocolLib.sdl b/ReferenceCode/Haswell/SampleCode/Protocol/CpuSampleCodeProtocolLib.sdl new file mode 100644 index 0000000..6662a1b --- /dev/null +++ b/ReferenceCode/Haswell/SampleCode/Protocol/CpuSampleCodeProtocolLib.sdl @@ -0,0 +1,24 @@ +TOKEN + Name = "CpuSampleCodeProtocolLib_SUPPORT" + Value = "1" + Help = "Main switch to enable CpuSampleCodeProtocolLib support in Project" + TokenType = Boolean + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "CpuSampleCodeProtocolLib_DIR" +End + +MODULE + Help = "Includes CpuSampleCodeProtocolLib.mak to Project" + File = "CpuSampleCodeProtocolLib.mak" +End + +TOKEN + Name = "CpuSampleCodeProtocolLib_LIB" + Value = "$$(LIB_BUILD_DIR)\CpuSampleCodeProtocolLib.lib" + TokenType = Expression + TargetMAK = Yes +End
\ No newline at end of file diff --git a/ReferenceCode/Haswell/SampleCode/Protocol/TxtOneTouchOp/TxtOneTouchOp.c b/ReferenceCode/Haswell/SampleCode/Protocol/TxtOneTouchOp/TxtOneTouchOp.c new file mode 100644 index 0000000..3e6f982 --- /dev/null +++ b/ReferenceCode/Haswell/SampleCode/Protocol/TxtOneTouchOp/TxtOneTouchOp.c @@ -0,0 +1,32 @@ +/** @file + Txt specific PPI operation definition. + +@copyright + Copyright (c) 1999 - 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 +**/ +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +#endif +#include "TxtOneTouchOp.h" + +/// +/// Protocol GUID definition +/// +EFI_GUID gTxtOneTouchOpProtocolGuid = TXT_ONE_TOUCH_OP_PROTOCOL_GUID; + +/// +/// Protocol description +/// +EFI_GUID_STRING(&gTxtOneTouchOpProtocolGuid, "Txt One Touch OP Protocol", "Txt One Touch OP Protocol"); diff --git a/ReferenceCode/Haswell/SampleCode/Protocol/TxtOneTouchOp/TxtOneTouchOp.h b/ReferenceCode/Haswell/SampleCode/Protocol/TxtOneTouchOp/TxtOneTouchOp.h new file mode 100644 index 0000000..aaccb4e --- /dev/null +++ b/ReferenceCode/Haswell/SampleCode/Protocol/TxtOneTouchOp/TxtOneTouchOp.h @@ -0,0 +1,106 @@ +/** @file + Txt specific PPI operation definition. + +@copyright + Copyright (c) 1999 - 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 _TXT_PPI_OPERATION_H_ +#define _TXT_PPI_OPERATION_H_ + +/// +/// EDK and EDKII have different GUID formats +/// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#define TXT_ONE_TOUCH_OP_PROTOCOL_GUID \ + { \ + 0xFA2338AD, 0x80DF, 0x49D0, 0x93, 0x96, 0xCF, 0x71, 0x45, 0xD0, 0x3A, 0x76 \ + } +#else +#define TXT_ONE_TOUCH_OP_PROTOCOL_GUID \ + { \ + 0xFA2338AD, 0x80DF, 0x49D0, \ + { \ + 0x93, 0x96, 0xCF, 0x71, 0x45, 0xD0, 0x3A, 0x76 \ + } \ + } +#endif +/// +/// Extern the GUID for protocol users. +/// +extern EFI_GUID gTxtOneTouchOpProtocolGuid; + +/// +/// Forward reference for ANSI C compatibility +/// +typedef struct _TXT_ONE_TOUCH_OP_PROTOCOL TXT_ONE_TOUCH_OP_PROTOCOL; + +/// +/// Member functions +/// +typedef +EFI_STATUS +(EFIAPI *TXT_PPI_EXEC_OPERATION)( + IN TXT_ONE_TOUCH_OP_PROTOCOL *This, + IN UINT8 Command + ); + +/* + +@brief + Extend PPI operation for TxT. + + @param[in] This - Point of TXT_ONE_TOUCH_OP_PROTOCOL + @param[in] Command - Operation value for TxT + +*/ +typedef +EFI_STATUS +(EFIAPI *TXT_CONFIRMATION_DIALOG)( + IN TXT_ONE_TOUCH_OP_PROTOCOL *This, + IN UINT8 Command, + IN OUT BOOLEAN *Confirm + ); +/* + +@brief + Confirmation dialog for TxT PPI + + @param[in] This - Point of TXT_ONE_TOUCH_OP_PROTOCOL + @param[in] Command - Operation value for TxT + @param[in] Confirm - User confirm + +*/ +typedef +EFI_STATUS +(EFIAPI *TXT_RESET_SYSTEM)( + IN TXT_ONE_TOUCH_OP_PROTOCOL *This, + IN UINT8 Command + ); + +/** + Reset system. + + @param[in] This - Point of TXT_ONE_TOUCH_OP_PROTOCOL + @param[in] Command - Operation value for TxT + + @retval EFI_SUCCESS - Always return EFI_SUCCESS +**/ +struct _TXT_ONE_TOUCH_OP_PROTOCOL { + TXT_PPI_EXEC_OPERATION ExecuteOperation; + TXT_CONFIRMATION_DIALOG ConfirmationDialog; + TXT_RESET_SYSTEM ResetSystem; +}; + +#endif |