SmmIchnDispatch.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /** @file
  2. Provides the parent dispatch service for a given SMI source generator.
  3. The EFI_SMM_ICHN_DISPATCH_PROTOCOL provides the ability to install child handlers for
  4. the given event types.
  5. Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
  6. SPDX-License-Identifier: BSD-2-Clause-Patent
  7. @par Revision Reference:
  8. This Protocol is defined in Framework of EFI SMM Core Interface Spec
  9. Version 0.9.
  10. **/
  11. #ifndef _EFI_SMM_ICHN_DISPATCH_H_
  12. #define _EFI_SMM_ICHN_DISPATCH_H_
  13. //
  14. // Global ID for the ICH SMI Protocol
  15. //
  16. #define EFI_SMM_ICHN_DISPATCH_PROTOCOL_GUID \
  17. { \
  18. 0xc50b323e, 0x9075, 0x4f2a, {0xac, 0x8e, 0xd2, 0x59, 0x6a, 0x10, 0x85, 0xcc } \
  19. }
  20. typedef struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL EFI_SMM_ICHN_DISPATCH_PROTOCOL;
  21. //
  22. // Related Definitions
  23. //
  24. //
  25. // ICHN Specific SMIs. These are miscellaneous SMI sources that are supported by the
  26. // ICHN specific SMI implementation. These may change over time. TrapNumber is only
  27. // valid if the Type is Trap.
  28. //
  29. typedef enum {
  30. //
  31. // NOTE: NEVER delete items from this list/enumeration! Doing so will prevent other versions
  32. // of the code from compiling. If the ICH version your driver is written for doesn't support
  33. // some of these SMIs, then simply return EFI_UNSUPPORTED when a child/client tries to register
  34. // for them.
  35. //
  36. IchnMch,
  37. IchnPme,
  38. IchnRtcAlarm,
  39. IchnRingIndicate,
  40. IchnAc97Wake,
  41. IchnSerialIrq,
  42. IchnY2KRollover,
  43. IchnTcoTimeout,
  44. IchnOsTco,
  45. IchnNmi,
  46. IchnIntruderDetect,
  47. IchnBiosWp,
  48. IchnMcSmi,
  49. IchnPmeB0,
  50. IchnThrmSts,
  51. IchnSmBus,
  52. IchnIntelUsb2,
  53. IchnMonSmi7,
  54. IchnMonSmi6,
  55. IchnMonSmi5,
  56. IchnMonSmi4,
  57. IchnDevTrap13,
  58. IchnDevTrap12,
  59. IchnDevTrap11,
  60. IchnDevTrap10,
  61. IchnDevTrap9,
  62. IchnDevTrap8,
  63. IchnDevTrap7,
  64. IchnDevTrap6,
  65. IchnDevTrap5,
  66. IchnDevTrap3,
  67. IchnDevTrap2,
  68. IchnDevTrap1,
  69. IchnDevTrap0,
  70. IchnIoTrap3,
  71. IchnIoTrap2,
  72. IchnIoTrap1,
  73. IchnIoTrap0,
  74. IchnPciExpress,
  75. IchnMonitor,
  76. IchnSpi,
  77. IchnQRT,
  78. IchnGpioUnlock,
  79. //
  80. // INSERT NEW ITEMS JUST BEFORE THIS LINE
  81. //
  82. NUM_ICHN_TYPES // the number of items in this enumeration
  83. } EFI_SMM_ICHN_SMI_TYPE;
  84. typedef struct {
  85. EFI_SMM_ICHN_SMI_TYPE Type;
  86. } EFI_SMM_ICHN_DISPATCH_CONTEXT;
  87. //
  88. // Member functions
  89. //
  90. /**
  91. Dispatch function for a ICHN specific SMI handler.
  92. @param DispatchHandle The handle of this dispatch function.
  93. @param DispatchContext The pointer to the dispatch function's context.
  94. The DispatchContext fields are filled in
  95. by the dispatching driver prior to
  96. invoking this dispatch function.
  97. @return None
  98. **/
  99. typedef
  100. VOID
  101. (EFIAPI *EFI_SMM_ICHN_DISPATCH)(
  102. IN EFI_HANDLE DispatchHandle,
  103. IN EFI_SMM_ICHN_DISPATCH_CONTEXT *DispatchContext
  104. );
  105. /**
  106. Register a child SMI source dispatch function with a parent SMM driver.
  107. @param This The pointer to the EFI_SMM_ICHN_DISPATCH_PROTOCOL instance.
  108. @param DispatchFunction The function to install.
  109. @param DispatchContext The pointer to the dispatch function's context.
  110. The caller fills in this context before calling
  111. the register function to indicate to the register
  112. function the ICHN SMI source for which the dispatch
  113. function should be invoked.
  114. @param DispatchHandle The handle generated by the dispatcher to track the function
  115. instance.
  116. @retval EFI_SUCCESS The dispatch function has been successfully
  117. registered and the SMI source has been enabled.
  118. @retval EFI_DEVICE_ERROR The driver could not enable the SMI source.
  119. @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
  120. child.
  121. @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The ICHN input value
  122. is not within valid range.
  123. **/
  124. typedef
  125. EFI_STATUS
  126. (EFIAPI *EFI_SMM_ICHN_REGISTER)(
  127. IN EFI_SMM_ICHN_DISPATCH_PROTOCOL *This,
  128. IN EFI_SMM_ICHN_DISPATCH DispatchFunction,
  129. IN EFI_SMM_ICHN_DISPATCH_CONTEXT *DispatchContext,
  130. OUT EFI_HANDLE *DispatchHandle
  131. );
  132. /**
  133. Unregister a child SMI source dispatch function with a parent SMM driver
  134. @param This The pointer to the EFI_SMM_ICHN_DISPATCH_PROTOCOL instance.
  135. @param DispatchHandle The handle of the service to remove.
  136. @retval EFI_SUCCESS The dispatch function has been successfully
  137. unregistered, and the SMI source has been disabled,
  138. if there are no other registered child dispatch
  139. functions for this SMI source.
  140. @retval EFI_INVALID_PARAMETER The handle is invalid.
  141. **/
  142. typedef
  143. EFI_STATUS
  144. (EFIAPI *EFI_SMM_ICHN_UNREGISTER)(
  145. IN EFI_SMM_ICHN_DISPATCH_PROTOCOL *This,
  146. IN EFI_HANDLE DispatchHandle
  147. );
  148. //
  149. // Interface structure for the SMM ICHN specific SMI Dispatch Protocol
  150. //
  151. /**
  152. Provides the parent dispatch service for a given SMI source generator.
  153. **/
  154. struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL {
  155. EFI_SMM_ICHN_REGISTER Register; ///< Installs a child service to be dispatched by this protocol.
  156. EFI_SMM_ICHN_UNREGISTER UnRegister; ///< Removes a child service dispatched by this protocol.
  157. };
  158. extern EFI_GUID gEfiSmmIchnDispatchProtocolGuid;
  159. #endif