2 Provides the parent dispatch service for the power button SMI source generator.
4 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
7 @par Revision Reference:
8 This Protocol is defined in Framework of EFI SMM Core Interface Spec
13 #ifndef _EFI_SMM_POWER_BUTTON_DISPATCH_H_
14 #define _EFI_SMM_POWER_BUTTON_DISPATCH_H_
18 // Global ID for the Power Button SMI Protocol
20 #define EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID \
22 0xb709efa0, 0x47a6, 0x4b41, {0xb9, 0x31, 0x12, 0xec, 0xe7, 0xa8, 0xee, 0x56 } \
25 typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL
;
28 // Related Definitions
31 // Power Button. Example, Use for changing LEDs before ACPI OS is on.
38 } EFI_POWER_BUTTON_PHASE
;
41 EFI_POWER_BUTTON_PHASE Phase
;
42 } EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT
;
48 Dispatch function for a Power Button SMI handler.
50 @param[in] DispatchHandle The handle of this dispatch function.
51 @param[in] DispatchContext The pointer to the dispatch function's context.
52 The DispatchContext fields are filled in
53 by the dispatching driver prior to
54 invoking this dispatch function.
59 (EFIAPI
*EFI_SMM_POWER_BUTTON_DISPATCH
)(
60 IN EFI_HANDLE DispatchHandle
,
61 IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT
*DispatchContext
65 Provides the parent dispatch service for a given SMI source generator
67 @param[in] This The pointer to the
68 EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL instance.
69 @param[in] DispatchFunction The function to install.
70 @param[in] DispatchContext The pointer to the dispatch function's context.
71 Indicates to the register
72 function the Power Button SMI phase for which
73 to invoke the dispatch function.
74 @param[out] DispatchHandle Handle generated by the dispatcher to track
75 the function instance.
77 @retval EFI_SUCCESS The dispatch function has been successfully
78 registered and the SMI source has been enabled.
79 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
80 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
82 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Power Button SMI
83 phase is not within valid range.
88 (EFIAPI
*EFI_SMM_POWER_BUTTON_REGISTER
)(
89 IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL
*This
,
90 IN EFI_SMM_POWER_BUTTON_DISPATCH DispatchFunction
,
91 IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT
*DispatchContext
,
92 OUT EFI_HANDLE
*DispatchHandle
96 Unregisters a power-button service.
98 @param[in] This The pointer to the EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL instance.
99 @param[in] DispatchHandle The handle of the service to remove.
101 @retval EFI_SUCCESS The dispatch function has been successfully
102 unregistered, and the SMI source has been
103 disabled, if there are no other registered
104 child dispatch functions for this SMI
106 @retval EFI_INVALID_PARAMETER The handle is invalid.
111 (EFIAPI
*EFI_SMM_POWER_BUTTON_UNREGISTER
)(
112 IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL
*This
,
113 IN EFI_HANDLE DispatchHandle
117 @par Protocol Description:
118 Provides the parent dispatch service for the SMM power button SMI source generator.
121 struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL
{
123 /// Installs a child service to be dispatched by this protocol.
125 EFI_SMM_POWER_BUTTON_REGISTER Register
;
128 /// Removes a child service dispatched by this protocol.
130 EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister
;
133 extern EFI_GUID gEfiSmmPowerButtonDispatchProtocolGuid
;