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