Remove FlashMap Ppi that has been replaced by Flash related PCDs.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmSxDispatch.h
CommitLineData
79964ac8 1/** @file\r
8411f1c0 2 Provides the parent dispatch service for a given Sx-state source generator.\r
79964ac8 3\r
4 Copyright (c) 2007, Intel Corporation\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13 Module Name: SmmSxDispatch.h\r
14\r
15 @par Revision Reference:\r
16 This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
17 Version 0.9.\r
18\r
19**/\r
20\r
21#ifndef _EFI_SMM_SX_DISPATCH_H_\r
22#define _EFI_SMM_SX_DISPATCH_H_\r
23\r
b80fbe85 24#include <PiDxe.h>\r
25\r
79964ac8 26//\r
27// Global ID for the Sx SMI Protocol\r
28//\r
29#define EFI_SMM_SX_DISPATCH_PROTOCOL_GUID \\r
30 { \\r
31 0x14fc52be, 0x1dc, 0x426c, {0x91, 0xae, 0xa2, 0x3c, 0x3e, 0x22, 0xa, 0xe8 } \\r
32 }\r
33\r
34typedef struct _EFI_SMM_SX_DISPATCH_PROTOCOL EFI_SMM_SX_DISPATCH_PROTOCOL;\r
35//\r
36// Related Definitions\r
37//\r
38typedef enum {\r
39 SxS0,\r
40 SxS1,\r
41 SxS2,\r
42 SxS3,\r
43 SxS4,\r
44 SxS5,\r
45 EfiMaximumSleepType\r
46} EFI_SLEEP_TYPE;\r
47\r
48typedef enum {\r
49 SxEntry,\r
50 SxExit,\r
51 EfiMaximumPhase\r
52} EFI_SLEEP_PHASE;\r
53\r
54typedef struct {\r
55 EFI_SLEEP_TYPE Type;\r
56 EFI_SLEEP_PHASE Phase;\r
57} EFI_SMM_SX_DISPATCH_CONTEXT;\r
58\r
59//\r
60// Member functions\r
61//\r
62/**\r
63 Dispatch function for a Sx state SMI handler.\r
64\r
65 @param DispatchHandle Handle of this dispatch function.\r
66 @param DispatchContext Pointer to the dispatch function's context.\r
67 The Type and Phase fields are filled in by the Sx dispatch driver\r
68 prior to invoking this dispatch function. For this interface,\r
69 the Sx driver will call the dispatch function for all Sx type\r
70 and phases, so the Sx state handler(s) must check the Type and\r
71 Phase field of EFI_SMM_SX_DISPATCH_CONTEXT and act accordingly.\r
72\r
73 Nothing\r
74\r
75**/\r
76typedef\r
77VOID\r
69686d56 78(EFIAPI *EFI_SMM_SX_DISPATCH)(\r
79964ac8 79 IN EFI_HANDLE DispatchHandle,\r
80 IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext\r
81 );\r
82\r
83/**\r
84 Register a child SMI source dispatch function with a parent SMM driver\r
85\r
86 @param This Protocol instance pointer.\r
87 @param DispatchFunction Pointer to dispatch function to be invoked for\r
88 this SMI source\r
89 @param DispatchContext Pointer to the dispatch function's context.\r
90 The caller fills this context in before calling\r
91 the register function to indicate to the register\r
92 function which Sx state type and phase the caller\r
93 wishes to be called back on. For this intertace,\r
94 the Sx driver will call the registered handlers for\r
95 all Sx type and phases, so the Sx state handler(s)\r
96 must check the Type and Phase field of the Dispatch\r
97 context and act accordingly.\r
98 @param DispatchHandle Handle of dispatch function, for when interfacing\r
99 with the parent Sx state SMM driver.\r
100\r
101 @retval EFI_SUCCESS The dispatch function has been successfully\r
102 registered and the SMI source has been enabled.\r
103 @retval EFI_UNSUPPORTED The Sx driver or hardware does not support that\r
104 Sx Type/Phase.\r
105 @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the SMI source.\r
106 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
107 child.\r
108 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. Type & Phase are not\r
109 within valid range.\r
110\r
111**/\r
112typedef\r
113EFI_STATUS\r
69686d56 114(EFIAPI *EFI_SMM_SX_REGISTER)(\r
79964ac8 115 IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,\r
116 IN EFI_SMM_SX_DISPATCH DispatchFunction,\r
117 IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext,\r
118 OUT EFI_HANDLE *DispatchHandle\r
119 );\r
120\r
121/**\r
122 Unregister a child SMI source dispatch function with a parent SMM driver\r
123\r
124 @param This Protocol instance pointer.\r
125 @param DispatchHandle Handle of dispatch function to deregister.\r
126\r
127 @retval EFI_SUCCESS The dispatch function has been successfully unregistered and the\r
128 SMI source has been disabled if there are no other registered child\r
129 dispatch functions for this SMI source.\r
130 @retval EFI_INVALID_PARAMETER Handle is invalid.\r
131 @retval other TBD\r
132\r
133**/\r
134typedef\r
135EFI_STATUS\r
5593fdd8 136(EFIAPI *EFI_SMM_SX_UNREGISTER)(\r
79964ac8 137 IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,\r
138 IN EFI_HANDLE DispatchHandle\r
139 );\r
140\r
141//\r
142// Interface structure for the SMM Child Dispatch Protocol\r
143//\r
144/**\r
145 @par Protocol Description:\r
146 Provides the parent dispatch service for a given Sx-state source generator.\r
147\r
148 @param Register\r
149 Installs a child service to be dispatched by this protocol.\r
150\r
151 @param UnRegister\r
152 Removes a child service dispatched by this protocol.\r
153\r
154**/\r
155struct _EFI_SMM_SX_DISPATCH_PROTOCOL {\r
156 EFI_SMM_SX_REGISTER Register;\r
157 EFI_SMM_SX_UNREGISTER UnRegister;\r
158};\r
159\r
160extern EFI_GUID gEfiSmmSxDispatchProtocolGuid;\r
161\r
162#endif\r