]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmPowerButtonDispatch.h
Comment update.
[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 @return None
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 Provides the parent dispatch service for a given SMI source generator
77
78 @param This Pointer to the EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL instance.
79 @param DispatchFunction Function to install.
80 @param DispatchContext Pointer to the dispatch function's context.
81 The caller fills this context in before calling
82 the register function to indicate to the register
83 function the Power Button SMI phase for which the dispatch
84 function should be invoked.
85 @param DispatchHandle Handle generated by the dispatcher to track the function instance.
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 Unregisters a power-button service.
107
108 @param This Pointer to the EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL instance.
109 @param DispatchHandle Handle of the service to remove.
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
117 **/
118 typedef
119 EFI_STATUS
120 (EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER)(
121 IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,
122 IN EFI_HANDLE DispatchHandle
123 );
124
125 //
126 // Interface structure for the SMM Power Button SMI Dispatch Protocol
127 //
128 /**
129 @par Protocol Description:
130 Provides the parent dispatch service for the SMM power button SMI source generator.
131
132 @param Register
133 Installs a child service to be dispatched by this protocol.
134
135 @param UnRegister
136 Removes a child service dispatched by this protocol.
137
138 **/
139 struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL {
140 EFI_SMM_POWER_BUTTON_REGISTER Register;
141 EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister;
142 };
143
144 extern EFI_GUID gEfiSmmPowerButtonDispatchProtocolGuid;
145
146 #endif