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