]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/MmSxDispatch.h
MdePkg FirmwareManagement.h: Fix typo EFI_SECURITY_VIOLATIO
[mirror_edk2.git] / MdePkg / Include / Protocol / MmSxDispatch.h
CommitLineData
07c6a47e
ED
1/** @file\r
2 MM Sx Dispatch Protocol as defined in PI 1.5 Specification\r
3 Volume 4 Management Mode Core Interface.\r
4\r
5 Provides the parent dispatch service for a given Sx-state source generator.\r
6\r
7 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
8 This program and the accompanying materials\r
9 are licensed and made available under the terms and conditions of the BSD License\r
10 which accompanies this distribution. The full text of the license may be found at\r
11 http://opensource.org/licenses/bsd-license.php\r
12\r
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
15\r
16**/\r
17\r
18#ifndef _MM_SX_DISPATCH_H_\r
19#define _MM_SX_DISPATCH_H_\r
20\r
21#include <Pi/PiMmCis.h>\r
22\r
23#define EFI_MM_SX_DISPATCH_PROTOCOL_GUID \\r
24 { \\r
25 0x456d2859, 0xa84b, 0x4e47, {0xa2, 0xee, 0x32, 0x76, 0xd8, 0x86, 0x99, 0x7d } \\r
26 }\r
27\r
28///\r
29/// Sleep states S0-S5\r
30///\r
31typedef enum {\r
32 SxS0,\r
33 SxS1,\r
34 SxS2,\r
35 SxS3,\r
36 SxS4,\r
37 SxS5,\r
38 EfiMaximumSleepType\r
39} EFI_SLEEP_TYPE;\r
40\r
41///\r
42/// Sleep state phase: entry or exit\r
43///\r
44typedef enum {\r
45 SxEntry,\r
46 SxExit,\r
47 EfiMaximumPhase\r
48} EFI_SLEEP_PHASE;\r
49\r
50///\r
51/// The dispatch function's context\r
52///\r
53typedef struct {\r
54 EFI_SLEEP_TYPE Type;\r
55 EFI_SLEEP_PHASE Phase;\r
56} EFI_MM_SX_REGISTER_CONTEXT;\r
57\r
58typedef struct _EFI_MM_SX_DISPATCH_PROTOCOL EFI_MM_SX_DISPATCH_PROTOCOL;\r
59\r
60/**\r
61 Provides the parent dispatch service for a given Sx source generator.\r
62\r
63 This service registers a function (DispatchFunction) which will be called when the sleep state\r
64 event specified by RegisterContext is detected. On return, DispatchHandle contains a\r
65 unique handle which may be used later to unregister the function using UnRegister().\r
66 The DispatchFunction will be called with Context set to the same value as was passed into\r
67 this function in RegisterContext and with CommBuffer and CommBufferSize set to\r
68 NULL and 0 respectively.\r
69\r
70 @param[in] This Pointer to the EFI_MM_SX_DISPATCH_PROTOCOL instance.\r
71 @param[in] DispatchFunction Function to register for handler when the specified sleep state event occurs.\r
72 @param[in] RegisterContext Pointer to the dispatch function's context.\r
73 The caller fills this context in before calling\r
74 the register function to indicate to the register\r
75 function which Sx state type and phase the caller\r
76 wishes to be called back on. For this intertace,\r
77 the Sx driver will call the registered handlers for\r
78 all Sx type and phases, so the Sx state handler(s)\r
79 must check the Type and Phase field of the Dispatch\r
80 context and act accordingly.\r
81 @param[out] DispatchHandle Handle of dispatch function, for when interfacing\r
82 with the parent Sx state MM driver.\r
83\r
84 @retval EFI_SUCCESS The dispatch function has been successfully\r
85 registered and the MMI source has been enabled.\r
86 @retval EFI_UNSUPPORTED The Sx driver or hardware does not support that\r
87 Sx Type/Phase.\r
88 @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the MMI source.\r
89 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. Type & Phase are not\r
90 within valid range.\r
91 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this\r
92 child.\r
93**/\r
94typedef\r
95EFI_STATUS\r
96(EFIAPI *EFI_MM_SX_REGISTER)(\r
97 IN CONST EFI_MM_SX_DISPATCH_PROTOCOL *This,\r
98 IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,\r
99 IN CONST EFI_MM_SX_REGISTER_CONTEXT *RegisterContext,\r
100 OUT EFI_HANDLE *DispatchHandle\r
101 );\r
102\r
103/**\r
104 Unregisters an Sx-state service.\r
105\r
106 This service removes the handler associated with DispatchHandle so that it will no longer be\r
107 called in response to sleep event.\r
108\r
109 @param[in] This Pointer to the EFI_MM_SX_DISPATCH_PROTOCOL instance.\r
110 @param[in] DispatchHandle Handle of the service to remove.\r
111\r
112 @retval EFI_SUCCESS The service has been successfully removed.\r
113 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.\r
114**/\r
115typedef\r
116EFI_STATUS\r
117(EFIAPI *EFI_MM_SX_UNREGISTER)(\r
118 IN CONST EFI_MM_SX_DISPATCH_PROTOCOL *This,\r
119 IN EFI_HANDLE DispatchHandle\r
120 );\r
121\r
122///\r
123/// Interface structure for the MM Sx Dispatch Protocol\r
124///\r
125/// The EFI_MM_SX_DISPATCH_PROTOCOL provides the ability to install child handlers to\r
126/// respond to sleep state related events.\r
127///\r
128struct _EFI_MM_SX_DISPATCH_PROTOCOL {\r
129 EFI_MM_SX_REGISTER Register;\r
130 EFI_MM_SX_UNREGISTER UnRegister;\r
131};\r
132\r
133extern EFI_GUID gEfiMmSxDispatchProtocolGuid;\r
134\r
135#endif\r