--- /dev/null
+/** @file\r
+ STM service protocol definition\r
+\r
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php.\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _SM_MONITOR_INIT_PROTOCOL_H_\r
+#define _SM_MONITOR_INIT_PROTOCOL_H_\r
+\r
+#include <PiSmm.h>\r
+#include <Register/StmApi.h>\r
+\r
+#define EFI_SM_MONITOR_INIT_PROTOCOL_GUID \\r
+ { 0x228f344d, 0xb3de, 0x43bb, 0xa4, 0xd7, 0xea, 0x20, 0xb, 0x1b, 0x14, 0x82}\r
+\r
+//\r
+// STM service\r
+//\r
+\r
+/**\r
+\r
+ Load STM image to MSEG.\r
+\r
+ @param StmImage STM image\r
+ @param StmImageSize STM image size\r
+\r
+ @retval EFI_SUCCESS Load STM to MSEG successfully\r
+ @retval EFI_ALREADY_STARTED STM image is already loaded to MSEG\r
+ @retval EFI_BUFFER_TOO_SMALL MSEG is smaller than minimal requirement of STM image\r
+ @retval EFI_UNSUPPORTED MSEG is not enabled\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SM_MONITOR_LOAD_MONITOR) (\r
+ IN EFI_PHYSICAL_ADDRESS StmImage,\r
+ IN UINTN StmImageSize\r
+ );\r
+\r
+/**\r
+\r
+ Add resources in list to database.\r
+\r
+ @param ResourceList A pointer to resource list to be added\r
+ @param NumEntries Optional number of entries.\r
+ If 0, list must be terminated by END_OF_RESOURCES.\r
+\r
+ @retval EFI_SUCCESS If resources are added\r
+ @retval EFI_INVALID_PARAMETER If nested procedure detected resource failer\r
+ @retval EFI_OUT_OF_RESOURCES If nested procedure returned it and we cannot allocate more areas.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SM_MONITOR_ADD_PI_RESOURCE) (\r
+ IN STM_RSC *ResourceList,\r
+ IN UINT32 NumEntries OPTIONAL\r
+ );\r
+\r
+/**\r
+\r
+ Delete resources in list to database.\r
+\r
+ @param ResourceList A pointer to resource list to be deleted\r
+ NULL means delete all resources.\r
+ @param NumEntries Optional number of entries.\r
+ If 0, list must be terminated by END_OF_RESOURCES.\r
+\r
+ @retval EFI_SUCCESS If resources are deleted\r
+ @retval EFI_INVALID_PARAMETER If nested procedure detected resource failer\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SM_MONITOR_DELETE_PI_RESOURCE) (\r
+ IN STM_RSC *ResourceList OPTIONAL,\r
+ IN UINT32 NumEntries OPTIONAL\r
+ );\r
+\r
+/**\r
+\r
+ Get BIOS resources.\r
+\r
+ @param ResourceList A pointer to resource list to be filled\r
+ @param ResourceSize On input it means size of resource list input.\r
+ On output it means size of resource list filled,\r
+ or the size of resource list to be filled if size of too small.\r
+\r
+ @retval EFI_SUCCESS If resources are returned.\r
+ @retval EFI_BUFFER_TOO_SMALL If resource list buffer is too small to hold the whole resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SM_MONITOR_GET_PI_RESOURCE) (\r
+ OUT STM_RSC *ResourceList,\r
+ IN OUT UINT32 *ResourceSize\r
+ );\r
+\r
+typedef UINT32 EFI_SM_MONITOR_STATE;\r
+#define EFI_SM_MONITOR_STATE_ENABLED 0x1\r
+#define EFI_SM_MONITOR_STATE_ACTIVATED 0x2\r
+\r
+/**\r
+\r
+ Get STM state\r
+\r
+ @return STM state\r
+\r
+**/\r
+typedef\r
+EFI_SM_MONITOR_STATE\r
+(EFIAPI *EFI_SM_MONITOR_GET_MONITOR_STATE) (\r
+ VOID\r
+ );\r
+\r
+typedef struct _EFI_SM_MONITOR_INIT_PROTOCOL {\r
+ //\r
+ // Valid at boot-time only\r
+ //\r
+ EFI_SM_MONITOR_LOAD_MONITOR LoadMonitor;\r
+ EFI_SM_MONITOR_ADD_PI_RESOURCE AddPiResource;\r
+ EFI_SM_MONITOR_DELETE_PI_RESOURCE DeletePiResource;\r
+ EFI_SM_MONITOR_GET_PI_RESOURCE GetPiResource;\r
+ //\r
+ // Valid at runtime\r
+ //\r
+ EFI_SM_MONITOR_GET_MONITOR_STATE GetMonitorState;\r
+} EFI_SM_MONITOR_INIT_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiSmMonitorInitProtocolGuid;\r
+\r
+#endif\r