]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/TianoTools/Include/Protocol/SmmPowerButtonDispatch.h
Remove the dependence to MdePkg
[mirror_edk2.git] / Tools / Source / TianoTools / Include / Protocol / SmmPowerButtonDispatch.h
1 /** @file
2 This file declares EFI Smm Power Button Smi Child Protocol
3
4 Copyright (c) 2006, 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 //
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 DispatchHandle Handle of this dispatch function.
58 @param 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 Nothing
64
65 **/
66 typedef
67 VOID
68 (EFIAPI *EFI_SMM_POWER_BUTTON_DISPATCH) (
69 IN EFI_HANDLE DispatchHandle,
70 IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext
71 );
72
73 /**
74 Register a child SMI source dispatch function with a parent SMM driver
75
76 @param This Protocol instance pointer.
77 @param DispatchFunction Pointer to dispatch function to be invoked for
78 this SMI source
79 @param DispatchContext Pointer to the dispatch function's context.
80 The caller fills this context in before calling
81 the register function to indicate to the register
82 function the Power Button SMI phase for which the dispatch
83 function should be invoked.
84 @param DispatchHandle Handle of dispatch function, for when interfacing
85 with the parent Sx state SMM driver.
86
87 @retval EFI_SUCCESS The dispatch function has been successfully
88 registered and the SMI source has been enabled.
89 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
90 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
91 child.
92 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Power Button SMI
93 phase is not within valid range.
94
95 **/
96 typedef
97 EFI_STATUS
98 (EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER) (
99 IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,
100 IN EFI_SMM_POWER_BUTTON_DISPATCH DispatchFunction,
101 IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext,
102 OUT EFI_HANDLE *DispatchHandle
103 );
104
105 /**
106 Unregister a child SMI source dispatch function with a parent SMM driver
107
108 @param This Protocol instance pointer.
109 @param DispatchHandle Handle of dispatch function to deregister.
110
111 @retval EFI_SUCCESS The dispatch function has been successfully
112 unregistered and the SMI source has been disabled
113 if there are no other registered child dispatch
114 functions for this SMI source.
115 @retval EFI_INVALID_PARAMETER Handle is invalid.
116 @retval other TBD
117
118 **/
119 typedef
120 EFI_STATUS
121 (EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER) (
122 IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,
123 IN EFI_HANDLE DispatchHandle
124 );
125
126 //
127 // Interface structure for the SMM Power Button SMI Dispatch Protocol
128 //
129 /**
130 @par Protocol Description:
131 Provides the parent dispatch service for the SMM power button SMI source generator.
132
133 @param Register
134 Installs a child service to be dispatched by this protocol.
135
136 @param UnRegister
137 Removes a child service dispatched by this protocol.
138
139 **/
140 struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL {
141 EFI_SMM_POWER_BUTTON_REGISTER Register;
142 EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister;
143 };
144
145 extern EFI_GUID gEfiSmmPowerButtonDispatchProtocolGuid;
146
147 #endif