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