]>
Commit | Line | Data |
---|---|---|
79964ac8 | 1 | /** @file\r |
8411f1c0 | 2 | Provides the parent dispatch service for a given Sx-state source generator.\r |
79964ac8 | 3 | \r |
2bbaeb0d | 4 | Copyright (c) 2007 - 2009, Intel Corporation\r |
79964ac8 | 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 | |
34 | typedef struct _EFI_SMM_SX_DISPATCH_PROTOCOL EFI_SMM_SX_DISPATCH_PROTOCOL;\r | |
35 | //\r | |
36 | // Related Definitions\r | |
37 | //\r | |
38 | typedef 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 | |
48 | typedef enum {\r | |
49 | SxEntry,\r | |
50 | SxExit,\r | |
51 | EfiMaximumPhase\r | |
52 | } EFI_SLEEP_PHASE;\r | |
53 | \r | |
54 | typedef 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 | |
700a7869 | 73 | @return None\r |
79964ac8 | 74 | \r |
75 | **/\r | |
76 | typedef\r | |
77 | VOID\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 | |
700a7869 | 86 | @param This Pointer to the EFI_SMM_SX_DISPATCH_PROTOCOL instance.\r |
87 | @param DispatchFunction Function to install.\r | |
79964ac8 | 88 | @param DispatchContext Pointer to the dispatch function's context.\r |
89 | The caller fills this context in before calling\r | |
90 | the register function to indicate to the register\r | |
91 | function which Sx state type and phase the caller\r | |
92 | wishes to be called back on. For this intertace,\r | |
93 | the Sx driver will call the registered handlers for\r | |
94 | all Sx type and phases, so the Sx state handler(s)\r | |
95 | must check the Type and Phase field of the Dispatch\r | |
96 | context and act accordingly.\r | |
97 | @param DispatchHandle Handle of dispatch function, for when interfacing\r | |
98 | with the parent Sx state SMM driver.\r | |
99 | \r | |
100 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
101 | registered and the SMI source has been enabled.\r | |
102 | @retval EFI_UNSUPPORTED The Sx driver or hardware does not support that\r | |
103 | Sx Type/Phase.\r | |
104 | @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the SMI source.\r | |
105 | @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r | |
106 | child.\r | |
107 | @retval EFI_INVALID_PARAMETER DispatchContext is invalid. Type & Phase are not\r | |
108 | within valid range.\r | |
109 | \r | |
110 | **/\r | |
111 | typedef\r | |
112 | EFI_STATUS\r | |
69686d56 | 113 | (EFIAPI *EFI_SMM_SX_REGISTER)(\r |
700a7869 | 114 | IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,\r |
115 | IN EFI_SMM_SX_DISPATCH DispatchFunction,\r | |
116 | IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext,\r | |
117 | OUT EFI_HANDLE *DispatchHandle\r | |
79964ac8 | 118 | );\r |
119 | \r | |
120 | /**\r | |
700a7869 | 121 | Unregisters an Sx-state service\r |
79964ac8 | 122 | \r |
700a7869 | 123 | @param This Pointer to the EFI_SMM_SX_DISPATCH_PROTOCOL instance.\r |
124 | @param DispatchHandle Handle of the service to remove.\r | |
79964ac8 | 125 | \r |
126 | @retval EFI_SUCCESS The dispatch function has been successfully unregistered and the\r | |
127 | SMI source has been disabled if there are no other registered child\r | |
128 | dispatch functions for this SMI source.\r | |
129 | @retval EFI_INVALID_PARAMETER Handle is invalid.\r | |
79964ac8 | 130 | \r |
131 | **/\r | |
132 | typedef\r | |
133 | EFI_STATUS\r | |
5593fdd8 | 134 | (EFIAPI *EFI_SMM_SX_UNREGISTER)(\r |
700a7869 | 135 | IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,\r |
136 | IN EFI_HANDLE DispatchHandle\r | |
79964ac8 | 137 | );\r |
138 | \r | |
139 | //\r | |
140 | // Interface structure for the SMM Child Dispatch Protocol\r | |
141 | //\r | |
142 | /**\r | |
79964ac8 | 143 | Provides the parent dispatch service for a given Sx-state source generator.\r |
79964ac8 | 144 | **/\r |
145 | struct _EFI_SMM_SX_DISPATCH_PROTOCOL {\r | |
2bbaeb0d | 146 | EFI_SMM_SX_REGISTER Register; ///< Installs a child service to be dispatched by this protocol.\r |
147 | EFI_SMM_SX_UNREGISTER UnRegister; ///< Removes a child service dispatched by this protocol.\r | |
79964ac8 | 148 | };\r |
149 | \r | |
150 | extern EFI_GUID gEfiSmmSxDispatchProtocolGuid;\r | |
151 | \r | |
152 | #endif\r |