]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmControl.h
2d0884cbe76f563520d3ba78fdaa6d7ea2b913fc
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmControl.h
1 /** @file
2 This file declares the SMM Control abstraction protocol.
3 This protocol is used to initiate SMI/PMI activations. This protocol could be published by either:
4 - A processor driver to abstract the SMI/PMI IPI
5 - The driver that abstracts the ASIC that is supporting the APM port, such as the ICH in an
6 Intel chipset
7 Because of the possibility of performing SMI or PMI IPI transactions, the ability to generate this
8 event from a platform chipset agent is an optional capability for both IA-32 and Itanium-based
9 systems.
10
11 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
12 SPDX-License-Identifier: BSD-2-Clause-Patent
13
14 @par Revision Reference:
15 This Protocol is defined in Framework of EFI SMM Core Interface Spec
16 Version 0.9.
17
18 **/
19
20 #ifndef _SMM_CONTROL_H_
21 #define _SMM_CONTROL_H_
22
23
24 typedef struct _EFI_SMM_CONTROL_PROTOCOL EFI_SMM_CONTROL_PROTOCOL;
25
26 #define EFI_SMM_CONTROL_PROTOCOL_GUID \
27 { \
28 0x8d12e231, 0xc667, 0x4fd1, {0x98, 0xf2, 0x24, 0x49, 0xa7, 0xe7, 0xb2, 0xe5 } \
29 }
30 //
31 // SMM Access specification Data Structures
32 //
33 typedef struct {
34 ///
35 /// Describes the I/O location of the particular port that engendered the synchronous
36 /// SMI. For example, this location can include but is not limited to the traditional
37 /// PCAT* APM port of 0B2h.
38 ///
39 UINT8 SmiTriggerRegister;
40 ///
41 /// Describes the value that was written to the respective activation port.
42 ///
43 UINT8 SmiDataRegister;
44 } EFI_SMM_CONTROL_REGISTER;
45
46 //
47 // SMM Control specification member function
48 //
49 /**
50 Invokes SMI activation from either the preboot or runtime environment.
51
52 @param This The EFI_SMM_CONTROL_PROTOCOL instance.
53 @param ArgumentBuffer The optional sized data to pass into the protocol activation.
54 @param ArgumentBufferSize The optional size of the data.
55 @param Periodic An optional mechanism to periodically repeat activation.
56 @param ActivationInterval An optional parameter to repeat at this period one
57 time or, if the Periodic Boolean is set, periodically.
58
59 @retval EFI_SUCCESS The SMI/PMI has been engendered.
60 @retval EFI_DEVICE_ERROR The timing is unsupported.
61 @retval EFI_INVALID_PARAMETER The activation period is unsupported.
62 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
63
64 **/
65 typedef
66 EFI_STATUS
67 (EFIAPI *EFI_SMM_ACTIVATE)(
68 IN EFI_SMM_CONTROL_PROTOCOL *This,
69 IN OUT INT8 *ArgumentBuffer OPTIONAL,
70 IN OUT UINTN *ArgumentBufferSize OPTIONAL,
71 IN BOOLEAN Periodic OPTIONAL,
72 IN UINTN ActivationInterval OPTIONAL
73 );
74
75 /**
76 Clears any system state that was created in response to the Active call.
77
78 @param This The EFI_SMM_CONTROL_PROTOCOL instance.
79 @param Periodic Optional parameter to repeat at this period one
80 time or, if the Periodic Boolean is set, periodically.
81
82 @retval EFI_SUCCESS The SMI/PMI has been engendered.
83 @retval EFI_DEVICE_ERROR The source could not be cleared.
84 @retval EFI_INVALID_PARAMETER The service did not support the Periodic input argument.
85
86 **/
87 typedef
88 EFI_STATUS
89 (EFIAPI *EFI_SMM_DEACTIVATE)(
90 IN EFI_SMM_CONTROL_PROTOCOL *This,
91 IN BOOLEAN Periodic OPTIONAL
92 );
93
94 /**
95 Provides information on the source register used to generate the SMI.
96
97 @param This The EFI_SMM_CONTROL_PROTOCOL instance.
98 @param SmiRegister A pointer to the SMI register description structure.
99
100 @retval EFI_SUCCESS The register structure has been returned.
101 @retval EFI_DEVICE_ERROR The source could not be cleared.
102 @retval EFI_INVALID_PARAMETER The service did not support the Periodic input argument.
103
104 **/
105 typedef
106 EFI_STATUS
107 (EFIAPI *EFI_SMM_GET_REGISTER_INFO)(
108 IN EFI_SMM_CONTROL_PROTOCOL *This,
109 IN OUT EFI_SMM_CONTROL_REGISTER *SmiRegister
110 );
111
112 /**
113 @par Protocol Description:
114 This protocol is used to initiate SMI/PMI activations.
115
116 @param Trigger
117 Initiates the SMI/PMI activation.
118
119 @param Clear
120 Quiesces the SMI/PMI activation.
121
122 @param GetRegisterInfo
123 Provides data on the register used as the source of the SMI.
124
125 @param MinimumTriggerPeriod
126 Minimum interval at which the platform can set the period.
127
128 @retval EFI_SUCCESS The register structure has been returned.
129 **/
130
131 //
132 // SMM Control Protocol
133 //
134 /**
135 This protocol is used to initiate SMI/PMI activations.
136 This protocol could be published by either:
137 - A processor driver to abstract the SMI/PMI IPI.
138 - The driver that abstracts the ASIC that is supporting the APM port, such as the ICH in an Intel chipset.
139 Because of the possibility of performing SMI or PMI IPI transactions, the ability to generate this.
140
141 The EFI_SMM_CONTROL_PROTOCOL is used by the platform chipset or processor driver. This
142 protocol is usable both in boot services and at runtime. The runtime aspect enables an
143 implementation of EFI_SMM_BASE_PROTOCOL.Communicate() to layer upon this service
144 and provide an SMI callback from a general EFI runtime driver.
145 This protocol provides an abstraction to the platform hardware that generates an
146 SMI or PMI. There are often I/O ports that, when accessed, will engender the SMI or PMI.
147 Also, this hardware optionally supports the periodic genearation of these signals.
148
149 **/
150 struct _EFI_SMM_CONTROL_PROTOCOL {
151 ///
152 /// Initiates the SMI/PMI activation.
153 ///
154 EFI_SMM_ACTIVATE Trigger;
155 ///
156 /// Quiesces the SMI/PMI activation.
157 ///
158 EFI_SMM_DEACTIVATE Clear;
159 ///
160 /// Provides data on the register used as the source of the SMI.
161 ///
162 EFI_SMM_GET_REGISTER_INFO GetRegisterInfo;
163 ///
164 /// Minimum interval at which the platform can set the period. A maximum is not
165 /// specified in that the SMM infrastructure code can emulate a maximum interval that is
166 /// greater than the hardware capabilities by using software emulation in the SMM
167 /// infrastructure code.
168 ///
169 UINTN MinimumTriggerPeriod;
170 };
171
172 extern EFI_GUID gEfiSmmControlProtocolGuid;
173
174 #endif