SmmStandbyButtonDispatch.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /** @file
  2. Provides the parent dispatch service for the standby button SMI source generator.
  3. The SMM Standby Button Dispatch Protocol is defined in
  4. the Intel Platform Innovation Framework for EFI SMM Core Interface Specification
  5. (SMM CIS) Version 0.9.
  6. Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
  7. SPDX-License-Identifier: BSD-2-Clause-Patent
  8. @par Revision Reference:
  9. This Protocol is defined in Framework of EFI SMM Core Interface Spec
  10. Version 0.9.
  11. **/
  12. #ifndef _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_
  13. #define _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_
  14. //
  15. // Share some common definitions with PI SMM
  16. //
  17. #include <Protocol/SmmStandbyButtonDispatch2.h>
  18. //
  19. // Global ID for the Standby Button SMI Protocol
  20. //
  21. #define EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID \
  22. { \
  23. 0x78965b98, 0xb0bf, 0x449e, {0x8b, 0x22, 0xd2, 0x91, 0x4e, 0x49, 0x8a, 0x98 } \
  24. }
  25. typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL;
  26. //
  27. // Related Definitions
  28. //
  29. typedef struct {
  30. /// Describes whether the child handler should be invoked upon the entry to the button
  31. /// activation or upon exit (i.e., upon receipt of the button press event or upon release of
  32. /// the event).
  33. EFI_STANDBY_BUTTON_PHASE Phase;
  34. } EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT;
  35. //
  36. // Member functions
  37. //
  38. /**
  39. Dispatch function for a Standby Button SMI handler.
  40. @param DispatchHandle The handle of this dispatch function.
  41. @param DispatchContext The pointer to the dispatch function's context.
  42. The DispatchContext fields are filled in
  43. by the dispatching driver prior to
  44. invoking this dispatch function.
  45. **/
  46. typedef
  47. VOID
  48. (EFIAPI *EFI_SMM_STANDBY_BUTTON_DISPATCH)(
  49. IN EFI_HANDLE DispatchHandle,
  50. IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext
  51. );
  52. /**
  53. Provides the parent dispatch service for a given SMI source generator
  54. @param This The pointer to the EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.
  55. @param DispatchFunction The function to install.
  56. @param DispatchContext The pointer to the dispatch function's context.
  57. Indicates to the register function the Standby
  58. Button SMI phase for which to invoke the dispatch
  59. function.
  60. @param DispatchHandle The handle generated by the dispatcher to track the
  61. function instance.
  62. @retval EFI_SUCCESS The dispatch function has been successfully
  63. registered, and the SMI source has been enabled.
  64. @retval EFI_DEVICE_ERROR The driver could not enable the SMI source.
  65. @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
  66. child.
  67. @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Standby Button SMI
  68. phase is not within valid range.
  69. **/
  70. typedef
  71. EFI_STATUS
  72. (EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER)(
  73. IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
  74. IN EFI_SMM_STANDBY_BUTTON_DISPATCH DispatchFunction,
  75. IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext,
  76. OUT EFI_HANDLE *DispatchHandle
  77. );
  78. /**
  79. Unregister a child SMI source dispatch function with a parent SMM driver.
  80. @param This The pointer to the EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.
  81. @param DispatchHandle The handle of the service to remove.
  82. @retval EFI_SUCCESS The dispatch function has been successfully
  83. unregistered, and the SMI source has been disabled,
  84. if there are no other registered child dispatch
  85. functions for this SMI source.
  86. @retval EFI_INVALID_PARAMETER The handle is invalid.
  87. **/
  88. typedef
  89. EFI_STATUS
  90. (EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER)(
  91. IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
  92. IN EFI_HANDLE DispatchHandle
  93. );
  94. //
  95. // Interface structure for the SMM Standby Button SMI Dispatch Protocol
  96. //
  97. /**
  98. This protocol provices the parent dispatch service for the standby button SMI source generator.
  99. Provides the ability to install child handlers for the given event types.
  100. **/
  101. struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL {
  102. ///
  103. /// Installs a child service to be dispatched by this protocol.
  104. ///
  105. EFI_SMM_STANDBY_BUTTON_REGISTER Register;\
  106. ///
  107. /// Removes a child service dispatched by this protocol.
  108. ///
  109. EFI_SMM_STANDBY_BUTTON_UNREGISTER UnRegister;
  110. };
  111. extern EFI_GUID gEfiSmmStandbyButtonDispatchProtocolGuid;
  112. #endif