2 SMM Sx Dispatch Protocol as defined in PI 1.2 Specification
3 Volume 4 System Management Mode Core Interface.
5 Provides the parent dispatch service for a given Sx-state source generator.
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
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.
18 #ifndef _SMM_SX_DISPATCH2_H_
19 #define _SMM_SX_DISPATCH2_H_
21 #include <Pi/PiSmmCis.h>
25 /// To avoid name conflict between PI and Framework SMM spec, the following names defined
26 /// in PI 1.2 SMM spec are renamed. These renamings are not yet in a public PI spec and errta.
28 /// EFI_SMM_SX_REGISTER -> EFI_SMM_SX_REGISTER2
29 /// EFI_SMM_SX_UNREGISTER -> EFI_SMM_SX_UNREGISTER2
32 #define EFI_SMM_SX_DISPATCH2_PROTOCOL_GUID \
34 0x456d2859, 0xa84b, 0x4e47, {0xa2, 0xee, 0x32, 0x76, 0xd8, 0x86, 0x99, 0x7d } \
38 /// Sleep states S0-S5
51 /// Sleep state phase: entry or exit
60 /// The dispatch function's context
64 EFI_SLEEP_PHASE Phase
;
65 } EFI_SMM_SX_REGISTER_CONTEXT
;
67 typedef struct _EFI_SMM_SX_DISPATCH2_PROTOCOL EFI_SMM_SX_DISPATCH2_PROTOCOL
;
70 Provides the parent dispatch service for a given Sx source generator.
72 This service registers a function (DispatchFunction) which will be called when the sleep state
73 event specified by RegisterContext is detected. On return, DispatchHandle contains a
74 unique handle which may be used later to unregister the function using UnRegister().
75 The DispatchFunction will be called with Context set to the same value as was passed into
76 this function in RegisterContext and with CommBuffer and CommBufferSize set to
77 NULL and 0 respectively.
79 @param[in] This Pointer to the EFI_SMM_SX_DISPATCH2_PROTOCOL instance.
80 @param[in] DispatchFunction Function to register for handler when the specified sleep state event occurs.
81 @param[in] RegisterContext 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 which Sx state type and phase the caller
85 wishes to be called back on. For this intertace,
86 the Sx driver will call the registered handlers for
87 all Sx type and phases, so the Sx state handler(s)
88 must check the Type and Phase field of the Dispatch
89 context and act accordingly.
90 @param[out] DispatchHandle Handle of dispatch function, for when interfacing
91 with the parent Sx state SMM driver.
93 @retval EFI_SUCCESS The dispatch function has been successfully
94 registered and the SMI source has been enabled.
95 @retval EFI_UNSUPPORTED The Sx driver or hardware does not support that
97 @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the SMI source.
98 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. Type & Phase are not
100 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this
105 (EFIAPI
*EFI_SMM_SX_REGISTER2
)(
106 IN CONST EFI_SMM_SX_DISPATCH2_PROTOCOL
*This
,
107 IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction
,
108 IN CONST EFI_SMM_SX_REGISTER_CONTEXT
*RegisterContext
,
109 OUT EFI_HANDLE
*DispatchHandle
113 Unregisters an Sx-state service.
115 This service removes the handler associated with DispatchHandle so that it will no longer be
116 called in response to sleep event.
118 @param[in] This Pointer to the EFI_SMM_SX_DISPATCH2_PROTOCOL instance.
119 @param[in] DispatchHandle Handle of the service to remove.
121 @retval EFI_SUCCESS The service has been successfully removed.
122 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
126 (EFIAPI
*EFI_SMM_SX_UNREGISTER2
)(
127 IN CONST EFI_SMM_SX_DISPATCH2_PROTOCOL
*This
,
128 IN EFI_HANDLE DispatchHandle
132 /// Interface structure for the SMM Sx Dispatch Protocol
134 /// The EFI_SMM_SX_DISPATCH2_PROTOCOL provides the ability to install child handlers to
135 /// respond to sleep state related events.
137 struct _EFI_SMM_SX_DISPATCH2_PROTOCOL
{
138 EFI_SMM_SX_REGISTER2 Register
;
139 EFI_SMM_SX_UNREGISTER2 UnRegister
;
142 extern EFI_GUID gEfiSmmSxDispatch2ProtocolGuid
;