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