]>
Commit | Line | Data |
---|---|---|
79964ac8 | 1 | /** @file\r |
8411f1c0 | 2 | Provides the parent dispatch service for a given SMI 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 |
05ef5a88 | 14 | This Protocol is defined in Framework for EFI SMM Core Interface Spec\r |
79964ac8 | 15 | Version 0.9.\r |
16 | \r | |
17 | **/\r | |
18 | \r | |
19 | #ifndef _EFI_SMM_SW_DISPATCH_H_\r | |
20 | #define _EFI_SMM_SW_DISPATCH_H_\r | |
21 | \r | |
b80fbe85 | 22 | \r |
79964ac8 | 23 | //\r |
24 | // Global ID for the SW SMI Protocol\r | |
25 | //\r | |
26 | #define EFI_SMM_SW_DISPATCH_PROTOCOL_GUID \\r | |
27 | { \\r | |
28 | 0xe541b773, 0xdd11, 0x420c, {0xb0, 0x26, 0xdf, 0x99, 0x36, 0x53, 0xf8, 0xbf } \\r | |
29 | }\r | |
30 | \r | |
31 | typedef struct _EFI_SMM_SW_DISPATCH_PROTOCOL EFI_SMM_SW_DISPATCH_PROTOCOL;\r | |
32 | \r | |
33 | //\r | |
34 | // Related Definitions\r | |
35 | //\r | |
36 | //\r | |
37 | // A particular chipset may not support all possible software SMI input values.\r | |
38 | // For example, the ICH supports only values 00h to 0FFh. The parent only allows a single\r | |
39 | // child registration for each SwSmiInputValue.\r | |
40 | //\r | |
41 | typedef struct {\r | |
42 | UINTN SwSmiInputValue;\r | |
43 | } EFI_SMM_SW_DISPATCH_CONTEXT;\r | |
44 | \r | |
45 | //\r | |
46 | // Member functions\r | |
47 | //\r | |
48 | /**\r | |
49 | Dispatch function for a Software SMI handler.\r | |
50 | \r | |
51 | @param DispatchHandle Handle of this dispatch function.\r | |
52 | @param DispatchContext Pointer to the dispatch function's context.\r | |
53 | The SwSmiInputValue field is filled in\r | |
54 | by the software dispatch driver prior to\r | |
55 | invoking this dispatch function.\r | |
56 | The dispatch function will only be called\r | |
57 | for input values for which it is registered.\r | |
58 | \r | |
700a7869 | 59 | @return None\r |
79964ac8 | 60 | \r |
61 | **/\r | |
62 | typedef\r | |
63 | VOID\r | |
69686d56 | 64 | (EFIAPI *EFI_SMM_SW_DISPATCH)(\r |
79964ac8 | 65 | IN EFI_HANDLE DispatchHandle,\r |
66 | IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext\r | |
67 | );\r | |
68 | \r | |
69 | /**\r | |
70 | Register a child SMI source dispatch function with a parent SMM driver\r | |
71 | \r | |
700a7869 | 72 | @param This Pointer to the EFI_SMM_SW_DISPATCH_PROTOCOL instance.\r |
73 | @param DispatchFunction Function to install.\r | |
79964ac8 | 74 | @param DispatchContext Pointer to the dispatch function's context.\r |
5259c97d | 75 | Indicates to the register\r |
76 | function the Software SMI input value for which to invoke the\r | |
77 | dispatch function.\r | |
700a7869 | 78 | @param DispatchHandle Handle generated by the dispatcher to track the function instance.\r |
79964ac8 | 79 | \r |
80 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
81 | registered and the SMI source has been enabled.\r | |
5259c97d | 82 | @retval EFI_DEVICE_ERROR The SW driver could not enable the SMI source.\r |
79964ac8 | 83 | @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r |
84 | child.\r | |
85 | @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The SW SMI input value\r | |
86 | is not within valid range.\r | |
87 | \r | |
88 | **/\r | |
89 | typedef\r | |
90 | EFI_STATUS\r | |
69686d56 | 91 | (EFIAPI *EFI_SMM_SW_REGISTER)(\r |
700a7869 | 92 | IN EFI_SMM_SW_DISPATCH_PROTOCOL *This,\r |
93 | IN EFI_SMM_SW_DISPATCH DispatchFunction,\r | |
94 | IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext,\r | |
95 | OUT EFI_HANDLE *DispatchHandle\r | |
79964ac8 | 96 | );\r |
97 | \r | |
98 | /**\r | |
99 | Unregister a child SMI source dispatch function with a parent SMM driver\r | |
100 | \r | |
700a7869 | 101 | @param This Pointer to the EFI_SMM_SW_DISPATCH_PROTOCOL instance.\r |
102 | @param DispatchHandle Handle of the service to remove.\r | |
79964ac8 | 103 | \r |
104 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
105 | unregistered and the SMI source has been disabled\r | |
106 | if there are no other registered child dispatch\r | |
107 | functions for this SMI source.\r | |
108 | @retval EFI_INVALID_PARAMETER Handle is invalid.\r | |
79964ac8 | 109 | \r |
110 | **/\r | |
111 | typedef\r | |
112 | EFI_STATUS\r | |
69686d56 | 113 | (EFIAPI *EFI_SMM_SW_UNREGISTER)(\r |
700a7869 | 114 | IN EFI_SMM_SW_DISPATCH_PROTOCOL *This,\r |
115 | IN EFI_HANDLE DispatchHandle\r | |
79964ac8 | 116 | );\r |
117 | \r | |
da879e3f | 118 | \r |
79964ac8 | 119 | //\r |
120 | // Interface structure for the SMM Software SMI Dispatch Protocol\r | |
121 | //\r | |
122 | /**\r | |
79964ac8 | 123 | Provides the parent dispatch service for a given SMI source generator.\r |
79964ac8 | 124 | **/\r |
da879e3f | 125 | ///\r |
126 | /// Inconsistent with specification here:\r | |
127 | /// In framework spec SmmCis, this definition is named as _EFI_SMM_ICHN_DISPATCH_PROTOCOL by mistake.\r | |
128 | ///\r | |
79964ac8 | 129 | struct _EFI_SMM_SW_DISPATCH_PROTOCOL {\r |
2bbaeb0d | 130 | ///\r |
131 | /// Installs a child service to be dispatched by this protocol.\r | |
132 | ///\r | |
79964ac8 | 133 | EFI_SMM_SW_REGISTER Register;\r |
2bbaeb0d | 134 | \r |
135 | ///\r | |
136 | /// Removes a child service dispatched by this protocol.\r | |
137 | ///\r | |
79964ac8 | 138 | EFI_SMM_SW_UNREGISTER UnRegister;\r |
2bbaeb0d | 139 | \r |
140 | ///\r | |
141 | /// A read-only field that describes the maximum value that can be used\r | |
142 | /// in the EFI_SMM_SW_DISPATCH_PROTOCOL.Register() service.\r | |
143 | ///\r | |
144 | UINTN MaximumSwiValue;\r | |
79964ac8 | 145 | };\r |
146 | \r | |
147 | extern EFI_GUID gEfiSmmSwDispatchProtocolGuid;\r | |
148 | \r | |
149 | #endif\r |