]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/SmmStandbyButtonDispatch2.h
Rename PI SMM definitions which has same name with those of Framework SMM spec but...
[mirror_edk2.git] / MdePkg / Include / Protocol / SmmStandbyButtonDispatch2.h
1 /** @file
2 SMM Standby Button Dispatch2 Protocol as defined in PI 1.1 Specification
3 Volume 4 System Management Mode Core Interface.
4
5 This protocol provides the parent dispatch service for the standby button SMI source generator.
6
7 Copyright (c) 2009, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 @par Revision Reference:
17 This protocol is from PI Version 1.1.
18
19 **/
20
21 #ifndef _SMM_STANDBY_BUTTON_DISPATCH2_H_
22 #define _SMM_STANDBY_BUTTON_DISPATCH2_H_
23
24 #include <Pi/PiSmmCis.h>
25
26 ///
27 /// Note:
28 /// To avoid name conflict between PI and Framework SMM spec, the following names defined
29 /// in PI 1.2 SMM spec are renamed. These renamings are not yet in a public PI spec and errta.
30 ///
31 /// EFI_SMM_STANDBY_BUTTON_REGISTER -> EFI_SMM_STANDBY_BUTTON_REGISTER2
32 /// EFI_SMM_STANDBY_BUTTON_UNREGISTER -> EFI_SMM_STANDBY_BUTTON_UNREGISTER2
33 ///
34
35 #define EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL_GUID \
36 { \
37 0x7300c4a1, 0x43f2, 0x4017, {0xa5, 0x1b, 0xc8, 0x1a, 0x7f, 0x40, 0x58, 0x5b } \
38 }
39
40 ///
41 /// Standby Button phases
42 ///
43 typedef enum {
44 EfiStandbyButtonEntry,
45 EfiStandbyButtonExit,
46 EfiStandbyButtonMax
47 } EFI_STANDBY_BUTTON_PHASE;
48
49 ///
50 /// The dispatch function's context.
51 ///
52 typedef struct {
53 ///
54 /// Describes whether the child handler should be invoked upon the entry to the button
55 /// activation or upon exit.
56 ///
57 EFI_STANDBY_BUTTON_PHASE Phase;
58 } EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT;
59
60 typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL;
61
62 /**
63 Provides the parent dispatch service for a standby button event.
64
65 This service registers a function (DispatchFunction) which will be called when an SMI is
66 generated because the standby button was pressed or released, as specified by
67 RegisterContext. On return, DispatchHandle contains a unique handle which may be used
68 later to unregister the function using UnRegister().
69 The DispatchFunction will be called with Context set to the same value as was passed into
70 this function in RegisterContext and with CommBuffer and CommBufferSize set to NULL.
71
72 @param[in] This Pointer to the EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL instance.
73 @param[in] DispatchFunction Function to register for handler when the standby button is pressed or released.
74 @param[in] RegisterContext Pointer to the dispatch function's context. The caller fills in this context
75 before calling the register function to indicate to the register function the
76 standby button SMI source for which the dispatch function should be invoked.
77 @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.
78
79 @retval EFI_SUCCESS The dispatch function has been successfully
80 registered and the SMI source has been enabled.
81 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
82 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The standby button input value
83 is not within valid range.
84 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this child.
85 **/
86 typedef
87 EFI_STATUS
88 (EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER2)(
89 IN CONST EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL *This,
90 IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,
91 IN EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT *RegisterContext,
92 OUT EFI_HANDLE *DispatchHandle
93 );
94
95 /**
96 Unregisters a child SMI source dispatch function with a parent SMM driver.
97
98 This service removes the handler associated with DispatchHandle so that it will no longer be
99 called when the standby button is pressed or released.
100
101 @param[in] This Pointer to the EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL instance.
102 @param[in] DispatchHandle Handle of the service to remove.
103
104 @retval EFI_SUCCESS The service has been successfully removed.
105 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
106 **/
107 typedef
108 EFI_STATUS
109 (EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER2)(
110 IN CONST EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL *This,
111 IN EFI_HANDLE DispatchHandle
112 );
113
114 ///
115 /// Interface structure for the SMM Standby Button Dispatch2 Protocol.
116 ///
117 /// This protocol provides the parent dispatch service for the standby
118 /// button SMI source generator.
119 ///
120 struct _EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL {
121 EFI_SMM_STANDBY_BUTTON_REGISTER2 Register;
122 EFI_SMM_STANDBY_BUTTON_UNREGISTER2 UnRegister;
123 };
124
125 extern EFI_GUID gEfiSmmStandbyButtonDispatch2ProtocolGuid;
126
127 #endif
128