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