]>
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 | |
79964ac8 | 13 | @par Revision Reference:\r |
14 | This Protocol is defined in Framework of EFI SMM Core Interface Spec\r | |
15 | Version 0.9.\r | |
16 | \r | |
17 | **/\r | |
18 | \r | |
19 | #ifndef _EFI_SMM_SX_DISPATCH_H_\r | |
20 | #define _EFI_SMM_SX_DISPATCH_H_\r | |
21 | \r | |
b80fbe85 | 22 | \r |
79964ac8 | 23 | //\r |
24 | // Global ID for the Sx SMI Protocol\r | |
25 | //\r | |
26 | #define EFI_SMM_SX_DISPATCH_PROTOCOL_GUID \\r | |
27 | { \\r | |
28 | 0x14fc52be, 0x1dc, 0x426c, {0x91, 0xae, 0xa2, 0x3c, 0x3e, 0x22, 0xa, 0xe8 } \\r | |
29 | }\r | |
30 | \r | |
31 | typedef struct _EFI_SMM_SX_DISPATCH_PROTOCOL EFI_SMM_SX_DISPATCH_PROTOCOL;\r | |
32 | //\r | |
33 | // Related Definitions\r | |
34 | //\r | |
35 | typedef enum {\r | |
36 | SxS0,\r | |
37 | SxS1,\r | |
38 | SxS2,\r | |
39 | SxS3,\r | |
40 | SxS4,\r | |
41 | SxS5,\r | |
42 | EfiMaximumSleepType\r | |
43 | } EFI_SLEEP_TYPE;\r | |
44 | \r | |
45 | typedef enum {\r | |
46 | SxEntry,\r | |
47 | SxExit,\r | |
48 | EfiMaximumPhase\r | |
49 | } EFI_SLEEP_PHASE;\r | |
50 | \r | |
51 | typedef struct {\r | |
52 | EFI_SLEEP_TYPE Type;\r | |
53 | EFI_SLEEP_PHASE Phase;\r | |
54 | } EFI_SMM_SX_DISPATCH_CONTEXT;\r | |
55 | \r | |
56 | //\r | |
57 | // Member functions\r | |
58 | //\r | |
59 | /**\r | |
60 | Dispatch function for a Sx state SMI handler.\r | |
61 | \r | |
62 | @param DispatchHandle Handle of this dispatch function.\r | |
63 | @param DispatchContext Pointer to the dispatch function's context.\r | |
64 | The Type and Phase fields are filled in by the Sx dispatch driver\r | |
65 | prior to invoking this dispatch function. For this interface,\r | |
66 | the Sx driver will call the dispatch function for all Sx type\r | |
67 | and phases, so the Sx state handler(s) must check the Type and\r | |
68 | Phase field of EFI_SMM_SX_DISPATCH_CONTEXT and act accordingly.\r | |
69 | \r | |
700a7869 | 70 | @return None\r |
79964ac8 | 71 | \r |
72 | **/\r | |
73 | typedef\r | |
74 | VOID\r | |
69686d56 | 75 | (EFIAPI *EFI_SMM_SX_DISPATCH)(\r |
79964ac8 | 76 | IN EFI_HANDLE DispatchHandle,\r |
77 | IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext\r | |
78 | );\r | |
79 | \r | |
80 | /**\r | |
81 | Register a child SMI source dispatch function with a parent SMM driver\r | |
82 | \r | |
700a7869 | 83 | @param This Pointer to the EFI_SMM_SX_DISPATCH_PROTOCOL instance.\r |
84 | @param DispatchFunction Function to install.\r | |
79964ac8 | 85 | @param DispatchContext Pointer to the dispatch function's context.\r |
5259c97d | 86 | The caller fills in this context before calling\r |
87 | the register function to indicates to the register\r | |
79964ac8 | 88 | function which Sx state type and phase the caller\r |
5259c97d | 89 | wishes to be called back on. For this interface,\r |
79964ac8 | 90 | the Sx driver will call the registered handlers for\r |
91 | all Sx type and phases, so the Sx state handler(s)\r | |
92 | must check the Type and Phase field of the Dispatch\r | |
93 | context and act accordingly.\r | |
5259c97d | 94 | @param DispatchHandle Handle of dispatch function, for interfacing\r |
79964ac8 | 95 | with the parent Sx state SMM driver.\r |
96 | \r | |
97 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
98 | registered and the SMI source has been enabled.\r | |
99 | @retval EFI_UNSUPPORTED The Sx driver or hardware does not support that\r | |
100 | Sx Type/Phase.\r | |
101 | @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the SMI source.\r | |
102 | @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r | |
103 | child.\r | |
104 | @retval EFI_INVALID_PARAMETER DispatchContext is invalid. Type & Phase are not\r | |
105 | within valid range.\r | |
106 | \r | |
107 | **/\r | |
108 | typedef\r | |
109 | EFI_STATUS\r | |
69686d56 | 110 | (EFIAPI *EFI_SMM_SX_REGISTER)(\r |
700a7869 | 111 | IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,\r |
112 | IN EFI_SMM_SX_DISPATCH DispatchFunction,\r | |
113 | IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext,\r | |
114 | OUT EFI_HANDLE *DispatchHandle\r | |
79964ac8 | 115 | );\r |
116 | \r | |
117 | /**\r | |
700a7869 | 118 | Unregisters an Sx-state service\r |
79964ac8 | 119 | \r |
700a7869 | 120 | @param This Pointer to the EFI_SMM_SX_DISPATCH_PROTOCOL instance.\r |
121 | @param DispatchHandle Handle of the service to remove.\r | |
79964ac8 | 122 | \r |
123 | @retval EFI_SUCCESS The dispatch function has been successfully unregistered and the\r | |
124 | SMI source has been disabled if there are no other registered child\r | |
125 | dispatch functions for this SMI source.\r | |
126 | @retval EFI_INVALID_PARAMETER Handle is invalid.\r | |
79964ac8 | 127 | \r |
128 | **/\r | |
129 | typedef\r | |
130 | EFI_STATUS\r | |
5593fdd8 | 131 | (EFIAPI *EFI_SMM_SX_UNREGISTER)(\r |
700a7869 | 132 | IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,\r |
133 | IN EFI_HANDLE DispatchHandle\r | |
79964ac8 | 134 | );\r |
135 | \r | |
136 | //\r | |
137 | // Interface structure for the SMM Child Dispatch Protocol\r | |
138 | //\r | |
139 | /**\r | |
79964ac8 | 140 | Provides the parent dispatch service for a given Sx-state source generator.\r |
79964ac8 | 141 | **/\r |
142 | struct _EFI_SMM_SX_DISPATCH_PROTOCOL {\r | |
2bbaeb0d | 143 | EFI_SMM_SX_REGISTER Register; ///< Installs a child service to be dispatched by this protocol.\r |
144 | EFI_SMM_SX_UNREGISTER UnRegister; ///< Removes a child service dispatched by this protocol.\r | |
79964ac8 | 145 | };\r |
146 | \r | |
147 | extern EFI_GUID gEfiSmmSxDispatchProtocolGuid;\r | |
148 | \r | |
149 | #endif\r |