SmmControl.h 6.4 KB

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