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>
23 #define EFI_SMM_SX_DISPATCH2_PROTOCOL_GUID \
25 0x456d2859, 0xa84b, 0x4e47, {0xa2, 0xee, 0x32, 0x76, 0xd8, 0x86, 0x99, 0x7d } \
29 /// Sleep states S0-S5
42 /// Sleep state phase: entry or exit
51 /// The dispatch function's context
55 EFI_SLEEP_PHASE Phase
;
56 } EFI_SMM_SX_REGISTER_CONTEXT
;
58 typedef struct _EFI_SMM_SX_DISPATCH2_PROTOCOL EFI_SMM_SX_DISPATCH2_PROTOCOL
;
61 Provides the parent dispatch service for a given Sx source generator.
63 This service registers a function (DispatchFunction) which will be called when the sleep state
64 event specified by RegisterContext is detected. On return, DispatchHandle contains a
65 unique handle which may be used later to unregister the function using UnRegister().
66 The DispatchFunction will be called with Context set to the same value as was passed into
67 this function in RegisterContext and with CommBuffer and CommBufferSize set to
68 NULL and 0 respectively.
70 @param[in] This Pointer to the EFI_SMM_SX_DISPATCH2_PROTOCOL instance.
71 @param[in] DispatchFunction Function to register for handler when the specified sleep state event occurs.
72 @param[in] RegisterContext Pointer to the dispatch function's context.
73 The caller fills this context in before calling
74 the register function to indicate to the register
75 function which Sx state type and phase the caller
76 wishes to be called back on. For this intertace,
77 the Sx driver will call the registered handlers for
78 all Sx type and phases, so the Sx state handler(s)
79 must check the Type and Phase field of the Dispatch
80 context and act accordingly.
81 @param[out] DispatchHandle Handle of dispatch function, for when interfacing
82 with the parent Sx state SMM driver.
84 @retval EFI_SUCCESS The dispatch function has been successfully
85 registered and the SMI source has been enabled.
86 @retval EFI_UNSUPPORTED The Sx driver or hardware does not support that
88 @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the SMI source.
89 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. Type & Phase are not
91 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this
96 (EFIAPI
*EFI_SMM_SX_REGISTER
)(
97 IN CONST EFI_SMM_SX_DISPATCH2_PROTOCOL
*This
,
98 IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction
,
99 IN CONST EFI_SMM_SX_REGISTER_CONTEXT
*RegisterContext
,
100 OUT EFI_HANDLE
*DispatchHandle
104 Unregisters an Sx-state service.
106 This service removes the handler associated with DispatchHandle so that it will no longer be
107 called in response to sleep event.
109 @param[in] This Pointer to the EFI_SMM_SX_DISPATCH2_PROTOCOL instance.
110 @param[in] DispatchHandle Handle of the service to remove.
112 @retval EFI_SUCCESS The service has been successfully removed.
113 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
117 (EFIAPI
*EFI_SMM_SX_UNREGISTER
)(
118 IN CONST EFI_SMM_SX_DISPATCH2_PROTOCOL
*This
,
119 IN EFI_HANDLE DispatchHandle
123 /// Interface structure for the SMM Sx Dispatch Protocol
125 /// The EFI_SMM_SX_DISPATCH2_PROTOCOL provides the ability to install child handlers to
126 /// respond to sleep state related events.
128 struct _EFI_SMM_SX_DISPATCH2_PROTOCOL
{
129 EFI_SMM_SX_REGISTER Register
;
130 EFI_SMM_SX_UNREGISTER UnRegister
;
133 extern EFI_GUID gEfiSmmSxDispatch2ProtocolGuid
;