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