2 MM Sx Dispatch Protocol as defined in PI 1.5 Specification
3 Volume 4 Management Mode Core Interface.
5 Provides the parent dispatch service for a given Sx-state source generator.
7 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef _MM_SX_DISPATCH_H_
13 #define _MM_SX_DISPATCH_H_
15 #include <Pi/PiMmCis.h>
17 #define EFI_MM_SX_DISPATCH_PROTOCOL_GUID \
19 0x456d2859, 0xa84b, 0x4e47, {0xa2, 0xee, 0x32, 0x76, 0xd8, 0x86, 0x99, 0x7d } \
23 /// Sleep states S0-S5
36 /// Sleep state phase: entry or exit
45 /// The dispatch function's context
49 EFI_SLEEP_PHASE Phase
;
50 } EFI_MM_SX_REGISTER_CONTEXT
;
52 typedef struct _EFI_MM_SX_DISPATCH_PROTOCOL EFI_MM_SX_DISPATCH_PROTOCOL
;
55 Provides the parent dispatch service for a given Sx source generator.
57 This service registers a function (DispatchFunction) which will be called when the sleep state
58 event specified by RegisterContext is detected. On return, DispatchHandle contains a
59 unique handle which may be used later to unregister the function using UnRegister().
60 The DispatchFunction will be called with Context set to the same value as was passed into
61 this function in RegisterContext and with CommBuffer and CommBufferSize set to
62 NULL and 0 respectively.
64 @param[in] This Pointer to the EFI_MM_SX_DISPATCH_PROTOCOL instance.
65 @param[in] DispatchFunction Function to register for handler when the specified sleep state event occurs.
66 @param[in] RegisterContext Pointer to the dispatch function's context.
67 The caller fills this context in before calling
68 the register function to indicate to the register
69 function which Sx state type and phase the caller
70 wishes to be called back on. For this intertace,
71 the Sx driver will call the registered handlers for
72 all Sx type and phases, so the Sx state handler(s)
73 must check the Type and Phase field of the Dispatch
74 context and act accordingly.
75 @param[out] DispatchHandle Handle of dispatch function, for when interfacing
76 with the parent Sx state MM driver.
78 @retval EFI_SUCCESS The dispatch function has been successfully
79 registered and the MMI source has been enabled.
80 @retval EFI_UNSUPPORTED The Sx driver or hardware does not support that
82 @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the MMI source.
83 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. Type & Phase are not
85 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this
90 (EFIAPI
*EFI_MM_SX_REGISTER
)(
91 IN CONST EFI_MM_SX_DISPATCH_PROTOCOL
*This
,
92 IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction
,
93 IN CONST EFI_MM_SX_REGISTER_CONTEXT
*RegisterContext
,
94 OUT EFI_HANDLE
*DispatchHandle
98 Unregisters an Sx-state service.
100 This service removes the handler associated with DispatchHandle so that it will no longer be
101 called in response to sleep event.
103 @param[in] This Pointer to the EFI_MM_SX_DISPATCH_PROTOCOL instance.
104 @param[in] DispatchHandle Handle of the service to remove.
106 @retval EFI_SUCCESS The service has been successfully removed.
107 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
111 (EFIAPI
*EFI_MM_SX_UNREGISTER
)(
112 IN CONST EFI_MM_SX_DISPATCH_PROTOCOL
*This
,
113 IN EFI_HANDLE DispatchHandle
117 /// Interface structure for the MM Sx Dispatch Protocol
119 /// The EFI_MM_SX_DISPATCH_PROTOCOL provides the ability to install child handlers to
120 /// respond to sleep state related events.
122 struct _EFI_MM_SX_DISPATCH_PROTOCOL
{
123 EFI_MM_SX_REGISTER Register
;
124 EFI_MM_SX_UNREGISTER UnRegister
;
127 extern EFI_GUID gEfiMmSxDispatchProtocolGuid
;