]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmPowerButtonDispatch.h
Change FRAMEWORK_EFI_HII_CALLBACK_PACKET back to EFI_HII_CALLBACK_PACKET to match...
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmPowerButtonDispatch.h
1 /** @file
2 Provides the parent dispatch service for the power button SMI source generator.
3
4 @par Revision Reference:
5 This Protocol is defined in Framework of EFI SMM Core Interface Spec
6 Version 0.9.
7
8 Copyright (c) 2007, Intel Corporation
9 All rights reserved. This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
13
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16
17 **/
18
19 #ifndef _EFI_SMM_POWER_BUTTON_DISPATCH_H_
20 #define _EFI_SMM_POWER_BUTTON_DISPATCH_H_
21
22 #include <PiDxe.h>
23
24 //
25 // Global ID for the Power Button SMI Protocol
26 //
27 #define EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID \
28 { \
29 0xb709efa0, 0x47a6, 0x4b41, {0xb9, 0x31, 0x12, 0xec, 0xe7, 0xa8, 0xee, 0x56 } \
30 }
31
32 typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL;
33
34 //
35 // Related Definitions
36 //
37 //
38 // Power Button. Example, Use for changing LEDs before ACPI OS is on.
39 // - DXE/BDS Phase
40 // - OS Install Phase
41 //
42 typedef enum {
43 PowerButtonEntry,
44 PowerButtonExit
45 } EFI_POWER_BUTTON_PHASE;
46
47 typedef struct {
48 EFI_POWER_BUTTON_PHASE Phase;
49 } EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT;
50
51 //
52 // Member functions
53 //
54 /**
55 Dispatch function for a Power Button SMI handler.
56
57 @param[in] DispatchHandle Handle of this dispatch function.
58 @param[in] DispatchContext Pointer to the dispatch function's context.
59 The DispatchContext fields are filled in
60 by the dispatching driver prior to
61 invoking this dispatch function.
62
63 **/
64 typedef
65 VOID
66 (EFIAPI *EFI_SMM_POWER_BUTTON_DISPATCH)(
67 IN EFI_HANDLE DispatchHandle,
68 IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext
69 );
70
71 /**
72 Provides the parent dispatch service for a given SMI source generator
73
74 @param[in] This Pointer to the EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL instance.
75 @param[in] DispatchFunction Function to install.
76 @param[in] DispatchContext Pointer to the dispatch function's context.
77 The caller fills this context in before calling
78 the register function to indicate to the register
79 function the Power Button SMI phase for which the dispatch
80 function should be invoked.
81 @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.
82
83 @retval EFI_SUCCESS The dispatch function has been successfully
84 registered and the SMI source has been enabled.
85 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
86 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
87 child.
88 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Power Button SMI
89 phase is not within valid range.
90
91 **/
92 typedef
93 EFI_STATUS
94 (EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER)(
95 IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,
96 IN EFI_SMM_POWER_BUTTON_DISPATCH DispatchFunction,
97 IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext,
98 OUT EFI_HANDLE *DispatchHandle
99 );
100
101 /**
102 Unregisters a power-button service.
103
104 @param[in] This Pointer to the EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL instance.
105 @param[in] DispatchHandle Handle of the service to remove.
106
107 @retval EFI_SUCCESS The dispatch function has been successfully
108 unregistered and the SMI source has been
109 disabled if there are no other registered
110 child dispatch functions for this SMI
111 source.
112 @retval EFI_INVALID_PARAMETER Handle is invalid.
113
114 **/
115 typedef
116 EFI_STATUS
117 (EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER)(
118 IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,
119 IN EFI_HANDLE DispatchHandle
120 );
121
122 /**
123 @par Protocol Description:
124 Provides the parent dispatch service for the SMM power button SMI source generator.
125
126 **/
127 struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL {
128 ///
129 /// Installs a child service to be dispatched by this protocol.
130 ///
131 EFI_SMM_POWER_BUTTON_REGISTER Register;
132
133 ///
134 /// Removes a child service dispatched by this protocol.
135 ///
136 EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister;
137 };
138
139 extern EFI_GUID gEfiSmmPowerButtonDispatchProtocolGuid;
140
141 #endif