]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/Include/Protocol/SmMonitorInit.h
UefiCpuPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / UefiCpuPkg / Include / Protocol / SmMonitorInit.h
CommitLineData
f7c11c53
MK
1/** @file\r
2 STM service protocol definition\r
3\r
4 Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
0acd8697 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
f7c11c53
MK
6\r
7**/\r
8\r
9#ifndef _SM_MONITOR_INIT_PROTOCOL_H_\r
10#define _SM_MONITOR_INIT_PROTOCOL_H_\r
11\r
12#include <PiSmm.h>\r
13#include <Register/StmApi.h>\r
14\r
15#define EFI_SM_MONITOR_INIT_PROTOCOL_GUID \\r
16 { 0x228f344d, 0xb3de, 0x43bb, 0xa4, 0xd7, 0xea, 0x20, 0xb, 0x1b, 0x14, 0x82}\r
17\r
18//\r
19// STM service\r
20//\r
21\r
22/**\r
23\r
24 Load STM image to MSEG.\r
25\r
26 @param StmImage STM image\r
27 @param StmImageSize STM image size\r
28\r
29 @retval EFI_SUCCESS Load STM to MSEG successfully\r
30 @retval EFI_ALREADY_STARTED STM image is already loaded to MSEG\r
31 @retval EFI_BUFFER_TOO_SMALL MSEG is smaller than minimal requirement of STM image\r
32 @retval EFI_UNSUPPORTED MSEG is not enabled\r
33\r
34**/\r
35typedef\r
36EFI_STATUS\r
37(EFIAPI *EFI_SM_MONITOR_LOAD_MONITOR) (\r
38 IN EFI_PHYSICAL_ADDRESS StmImage,\r
39 IN UINTN StmImageSize\r
40 );\r
41\r
42/**\r
43\r
44 Add resources in list to database.\r
45\r
46 @param ResourceList A pointer to resource list to be added\r
47 @param NumEntries Optional number of entries.\r
48 If 0, list must be terminated by END_OF_RESOURCES.\r
49\r
50 @retval EFI_SUCCESS If resources are added\r
51 @retval EFI_INVALID_PARAMETER If nested procedure detected resource failer\r
52 @retval EFI_OUT_OF_RESOURCES If nested procedure returned it and we cannot allocate more areas.\r
53\r
54**/\r
55typedef\r
56EFI_STATUS\r
57(EFIAPI *EFI_SM_MONITOR_ADD_PI_RESOURCE) (\r
58 IN STM_RSC *ResourceList,\r
59 IN UINT32 NumEntries OPTIONAL\r
60 );\r
61\r
62/**\r
63\r
64 Delete resources in list to database.\r
65\r
66 @param ResourceList A pointer to resource list to be deleted\r
67 NULL means delete all resources.\r
68 @param NumEntries Optional number of entries.\r
69 If 0, list must be terminated by END_OF_RESOURCES.\r
70\r
71 @retval EFI_SUCCESS If resources are deleted\r
72 @retval EFI_INVALID_PARAMETER If nested procedure detected resource failer\r
73\r
74**/\r
75typedef\r
76EFI_STATUS\r
77(EFIAPI *EFI_SM_MONITOR_DELETE_PI_RESOURCE) (\r
78 IN STM_RSC *ResourceList OPTIONAL,\r
79 IN UINT32 NumEntries OPTIONAL\r
80 );\r
81\r
82/**\r
83\r
84 Get BIOS resources.\r
85\r
86 @param ResourceList A pointer to resource list to be filled\r
87 @param ResourceSize On input it means size of resource list input.\r
88 On output it means size of resource list filled,\r
89 or the size of resource list to be filled if size of too small.\r
90\r
91 @retval EFI_SUCCESS If resources are returned.\r
92 @retval EFI_BUFFER_TOO_SMALL If resource list buffer is too small to hold the whole resources.\r
93\r
94**/\r
95typedef\r
96EFI_STATUS\r
97(EFIAPI *EFI_SM_MONITOR_GET_PI_RESOURCE) (\r
98 OUT STM_RSC *ResourceList,\r
99 IN OUT UINT32 *ResourceSize\r
100 );\r
101\r
102typedef UINT32 EFI_SM_MONITOR_STATE;\r
103#define EFI_SM_MONITOR_STATE_ENABLED 0x1\r
104#define EFI_SM_MONITOR_STATE_ACTIVATED 0x2\r
105\r
106/**\r
107\r
108 Get STM state\r
109\r
110 @return STM state\r
111\r
112**/\r
113typedef\r
114EFI_SM_MONITOR_STATE\r
115(EFIAPI *EFI_SM_MONITOR_GET_MONITOR_STATE) (\r
116 VOID\r
117 );\r
118\r
119typedef struct _EFI_SM_MONITOR_INIT_PROTOCOL {\r
120 //\r
121 // Valid at boot-time only\r
122 //\r
123 EFI_SM_MONITOR_LOAD_MONITOR LoadMonitor;\r
124 EFI_SM_MONITOR_ADD_PI_RESOURCE AddPiResource;\r
125 EFI_SM_MONITOR_DELETE_PI_RESOURCE DeletePiResource;\r
126 EFI_SM_MONITOR_GET_PI_RESOURCE GetPiResource;\r
127 //\r
128 // Valid at runtime\r
129 //\r
130 EFI_SM_MONITOR_GET_MONITOR_STATE GetMonitorState;\r
131} EFI_SM_MONITOR_INIT_PROTOCOL;\r
132\r
133extern EFI_GUID gEfiSmMonitorInitProtocolGuid;\r
134\r
135#endif\r