VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.h@ 99404

Last change on this file since 99404 was 99404, checked in by vboxsync, 2 years ago

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette