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