]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.h
UefiCpuPkg/Smm: Fix various typos
[mirror_edk2.git] / UefiCpuPkg / Library / SmmCpuFeaturesLib / SmmStm.h
CommitLineData
09119a00
MK
1/** @file\r
2 SMM STM support\r
3\r
1c7a65eb 4 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
0acd8697 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
09119a00
MK
6\r
7**/\r
8\r
9#ifndef _SMM_STM_H_\r
10#define _SMM_STM_H_\r
11\r
12#include <Protocol/SmMonitorInit.h>\r
13\r
14/**\r
15\r
16 Create 4G page table for STM.\r
17 2M PAE page table in X64 version.\r
18\r
19 @param PageTableBase The page table base in MSEG\r
20\r
21**/\r
22VOID\r
23StmGen4GPageTable (\r
24 IN UINTN PageTableBase\r
25 );\r
26\r
27/**\r
28 This is SMM exception handle.\r
29 Consumed by STM when exception happen.\r
30\r
31 @param Context STM protection exception stack frame\r
32\r
33 @return the EBX value for STM reference.\r
34 EBX = 0: resume SMM guest using register state found on exception stack.\r
35 EBX = 1 to 0x0F: EBX contains a BIOS error code which the STM must record in the\r
36 TXT.ERRORCODE register and subsequently reset the system via\r
37 TXT.CMD.SYS_RESET. The value of the TXT.ERRORCODE register is calculated as\r
38 follows: TXT.ERRORCODE = (EBX & 0x0F) | STM_CRASH_BIOS_PANIC\r
39 EBX = 0x10 to 0xFFFFFFFF - reserved, do not use.\r
40\r
41**/\r
42UINT32\r
43EFIAPI\r
44SmmStmExceptionHandler (\r
45 IN OUT STM_PROTECTION_EXCEPTION_STACK_FRAME Context\r
46 );\r
47\r
48\r
49/**\r
50\r
51 Get STM state.\r
52\r
53 @return STM state\r
54\r
55**/\r
56EFI_SM_MONITOR_STATE\r
57EFIAPI\r
58GetMonitorState (\r
59 VOID\r
60 );\r
61\r
62/**\r
63\r
64 Load STM image to MSEG.\r
65\r
66 @param StmImage STM image\r
67 @param StmImageSize STM image size\r
68\r
69 @retval EFI_SUCCESS Load STM to MSEG successfully\r
70 @retval EFI_BUFFER_TOO_SMALL MSEG is smaller than minimal requirement of STM image\r
71\r
72**/\r
73EFI_STATUS\r
74EFIAPI\r
75LoadMonitor (\r
76 IN EFI_PHYSICAL_ADDRESS StmImage,\r
77 IN UINTN StmImageSize\r
78 );\r
79\r
80/**\r
81\r
82 Add resources in list to database. Allocate new memory areas as needed.\r
83\r
84 @param ResourceList A pointer to resource list to be added\r
85 @param NumEntries Optional number of entries.\r
86 If 0, list must be terminated by END_OF_RESOURCES.\r
87\r
88 @retval EFI_SUCCESS If resources are added\r
89 @retval EFI_INVALID_PARAMETER If nested procedure detected resource failer\r
90 @retval EFI_OUT_OF_RESOURCES If nested procedure returned it and we cannot allocate more areas.\r
91\r
92**/\r
93EFI_STATUS\r
94EFIAPI\r
95AddPiResource (\r
96 IN STM_RSC *ResourceList,\r
97 IN UINT32 NumEntries OPTIONAL\r
98 );\r
99\r
100/**\r
101\r
102 Delete resources in list to database.\r
103\r
104 @param ResourceList A pointer to resource list to be deleted\r
105 NULL means delete all resources.\r
106 @param NumEntries Optional number of entries.\r
107 If 0, list must be terminated by END_OF_RESOURCES.\r
108\r
109 @retval EFI_SUCCESS If resources are deleted\r
110 @retval EFI_INVALID_PARAMETER If nested procedure detected resource failer\r
111\r
112**/\r
113EFI_STATUS\r
114EFIAPI\r
115DeletePiResource (\r
116 IN STM_RSC *ResourceList,\r
117 IN UINT32 NumEntries OPTIONAL\r
118 );\r
119\r
120/**\r
121\r
122 Get BIOS resources.\r
123\r
124 @param ResourceList A pointer to resource list to be filled\r
125 @param ResourceSize On input it means size of resource list input.\r
126 On output it means size of resource list filled,\r
127 or the size of resource list to be filled if size of too small.\r
128\r
129 @retval EFI_SUCCESS If resources are returned.\r
130 @retval EFI_BUFFER_TOO_SMALL If resource list buffer is too small to hold the whole resources.\r
131\r
132**/\r
133EFI_STATUS\r
134EFIAPI\r
135GetPiResource (\r
136 OUT STM_RSC *ResourceList,\r
137 IN OUT UINT32 *ResourceSize\r
138 );\r
139\r
140/**\r
418aded9 141 This function initialize STM configuration table.\r
09119a00
MK
142**/\r
143VOID\r
144StmSmmConfigurationTableInit (\r
145 VOID\r
146 );\r
147\r
148/**\r
149 This function notify STM resource change.\r
150\r
151 @param StmResource BIOS STM resource\r
152\r
153**/\r
154VOID\r
155NotifyStmResourceChange (\r
156 IN VOID *StmResource\r
157 );\r
158\r
159/**\r
160 This function return BIOS STM resource.\r
161\r
162 @return BIOS STM resource\r
163\r
164**/\r
165VOID *\r
166GetStmResource (\r
167 VOID\r
168 );\r
169\r
1c7a65eb
LG
170/**\r
171 This function fixes up the address of the global variable or function\r
418aded9 172 referred in SmiEntry assembly files to be the absolute address.\r
1c7a65eb
LG
173**/\r
174VOID\r
175EFIAPI\r
176SmmCpuFeaturesLibStmSmiEntryFixupAddress (\r
177 );\r
178\r
09119a00 179#endif\r