]>
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 |
2b3687db | 4 | Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r |
f22f941e | 5 | This program and the accompanying materials are licensed and made available under \r |
6 | the terms and conditions of the BSD License that accompanies this distribution. \r | |
7 | 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 | |
79964ac8 | 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 | |
a2bb197e | 22 | //\r |
23 | // Share some common definitions with PI SMM\r | |
24 | //\r | |
25 | #include <Protocol/SmmSxDispatch2.h>\r | |
b80fbe85 | 26 | \r |
79964ac8 | 27 | //\r |
28 | // Global ID for the Sx SMI Protocol\r | |
29 | //\r | |
30 | #define EFI_SMM_SX_DISPATCH_PROTOCOL_GUID \\r | |
31 | { \\r | |
32 | 0x14fc52be, 0x1dc, 0x426c, {0x91, 0xae, 0xa2, 0x3c, 0x3e, 0x22, 0xa, 0xe8 } \\r | |
33 | }\r | |
34 | \r | |
35 | typedef struct _EFI_SMM_SX_DISPATCH_PROTOCOL EFI_SMM_SX_DISPATCH_PROTOCOL;\r | |
79964ac8 | 36 | \r |
37 | typedef struct {\r | |
38 | EFI_SLEEP_TYPE Type;\r | |
39 | EFI_SLEEP_PHASE Phase;\r | |
40 | } EFI_SMM_SX_DISPATCH_CONTEXT;\r | |
41 | \r | |
42 | //\r | |
43 | // Member functions\r | |
44 | //\r | |
45 | /**\r | |
46 | Dispatch function for a Sx state SMI handler.\r | |
47 | \r | |
f22f941e | 48 | @param DispatchHandle The handle of this dispatch function.\r |
49 | @param DispatchContext The pointer to the dispatch function's context.\r | |
79964ac8 | 50 | The Type and Phase fields are filled in by the Sx dispatch driver\r |
51 | prior to invoking this dispatch function. For this interface,\r | |
52 | the Sx driver will call the dispatch function for all Sx type\r | |
53 | and phases, so the Sx state handler(s) must check the Type and\r | |
f22f941e | 54 | Phase field of EFI_SMM_SX_DISPATCH_CONTEXT, and act accordingly.\r |
79964ac8 | 55 | \r |
700a7869 | 56 | @return None\r |
79964ac8 | 57 | \r |
58 | **/\r | |
59 | typedef\r | |
60 | VOID\r | |
69686d56 | 61 | (EFIAPI *EFI_SMM_SX_DISPATCH)(\r |
79964ac8 | 62 | IN EFI_HANDLE DispatchHandle,\r |
63 | IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext\r | |
64 | );\r | |
65 | \r | |
66 | /**\r | |
f22f941e | 67 | Register a child SMI source dispatch function with a parent SMM driver.\r |
79964ac8 | 68 | \r |
f22f941e | 69 | @param This The pointer to the EFI_SMM_SX_DISPATCH_PROTOCOL instance.\r |
70 | @param DispatchFunction The function to install.\r | |
71 | @param DispatchContext The pointer to the dispatch function's context.\r | |
5259c97d | 72 | The caller fills in this context before calling\r |
73 | the register function to indicates to the register\r | |
79964ac8 | 74 | function which Sx state type and phase the caller\r |
5259c97d | 75 | wishes to be called back on. For this interface,\r |
79964ac8 | 76 | the Sx driver will call the registered handlers for\r |
77 | all Sx type and phases, so the Sx state handler(s)\r | |
78 | must check the Type and Phase field of the Dispatch\r | |
f22f941e | 79 | context, and act accordingly.\r |
80 | @param DispatchHandle The handle of dispatch function, for interfacing\r | |
79964ac8 | 81 | with the parent Sx state SMM driver.\r |
82 | \r | |
83 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
84 | registered and the SMI source has been enabled.\r | |
85 | @retval EFI_UNSUPPORTED The Sx driver or hardware does not support that\r | |
86 | Sx Type/Phase.\r | |
87 | @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the SMI source.\r | |
88 | @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r | |
89 | child.\r | |
90 | @retval EFI_INVALID_PARAMETER DispatchContext is invalid. Type & Phase are not\r | |
f22f941e | 91 | within a valid range.\r |
79964ac8 | 92 | \r |
93 | **/\r | |
94 | typedef\r | |
95 | EFI_STATUS\r | |
69686d56 | 96 | (EFIAPI *EFI_SMM_SX_REGISTER)(\r |
700a7869 | 97 | IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,\r |
98 | IN EFI_SMM_SX_DISPATCH DispatchFunction,\r | |
99 | IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext,\r | |
100 | OUT EFI_HANDLE *DispatchHandle\r | |
79964ac8 | 101 | );\r |
102 | \r | |
103 | /**\r | |
700a7869 | 104 | Unregisters an Sx-state service\r |
79964ac8 | 105 | \r |
f22f941e | 106 | @param This The pointer to the EFI_SMM_SX_DISPATCH_PROTOCOL instance.\r |
107 | @param DispatchHandle The handle of the service to remove.\r | |
79964ac8 | 108 | \r |
f22f941e | 109 | @retval EFI_SUCCESS The dispatch function has been successfully unregistered, and the\r |
110 | SMI source has been disabled, if there are no other registered child\r | |
79964ac8 | 111 | dispatch functions for this SMI source.\r |
112 | @retval EFI_INVALID_PARAMETER Handle is invalid.\r | |
79964ac8 | 113 | \r |
114 | **/\r | |
115 | typedef\r | |
116 | EFI_STATUS\r | |
5593fdd8 | 117 | (EFIAPI *EFI_SMM_SX_UNREGISTER)(\r |
700a7869 | 118 | IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,\r |
119 | IN EFI_HANDLE DispatchHandle\r | |
79964ac8 | 120 | );\r |
121 | \r | |
122 | //\r | |
123 | // Interface structure for the SMM Child Dispatch Protocol\r | |
124 | //\r | |
125 | /**\r | |
79964ac8 | 126 | Provides the parent dispatch service for a given Sx-state source generator.\r |
79964ac8 | 127 | **/\r |
128 | struct _EFI_SMM_SX_DISPATCH_PROTOCOL {\r | |
2bbaeb0d | 129 | EFI_SMM_SX_REGISTER Register; ///< Installs a child service to be dispatched by this protocol.\r |
130 | EFI_SMM_SX_UNREGISTER UnRegister; ///< Removes a child service dispatched by this protocol.\r | |
79964ac8 | 131 | };\r |
132 | \r | |
133 | extern EFI_GUID gEfiSmmSxDispatchProtocolGuid;\r | |
134 | \r | |
135 | #endif\r |