]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - IntelFrameworkPkg/Include/Protocol/SmmSwDispatch.h
Minor code enhancement.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmSwDispatch.h
... / ...
CommitLineData
1/** @file\r
2 Provides the parent dispatch service for a given SMI source generator.\r
3\r
4 Copyright (c) 2007 - 2009, Intel Corporation\r
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 @par Revision Reference:\r
14 This Protocol is defined in Framework for EFI SMM Core Interface Spec\r
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
22\r
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
31typedef 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
41typedef 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
59 @return None\r
60\r
61**/\r
62typedef\r
63VOID\r
64(EFIAPI *EFI_SMM_SW_DISPATCH)(\r
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
72 @param This Pointer to the EFI_SMM_SW_DISPATCH_PROTOCOL instance.\r
73 @param DispatchFunction Function to install.\r
74 @param DispatchContext Pointer to the dispatch function's context.\r
75 Indicates to the register\r
76 function the Software SMI input value for which to invoke the\r
77 dispatch function.\r
78 @param DispatchHandle Handle generated by the dispatcher to track the function instance.\r
79\r
80 @retval EFI_SUCCESS The dispatch function has been successfully\r
81 registered and the SMI source has been enabled.\r
82 @retval EFI_DEVICE_ERROR The SW driver could not enable the SMI source.\r
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
89typedef\r
90EFI_STATUS\r
91(EFIAPI *EFI_SMM_SW_REGISTER)(\r
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
96 );\r
97\r
98/**\r
99 Unregister a child SMI source dispatch function with a parent SMM driver\r
100\r
101 @param This Pointer to the EFI_SMM_SW_DISPATCH_PROTOCOL instance.\r
102 @param DispatchHandle Handle of the service to remove.\r
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
109\r
110**/\r
111typedef\r
112EFI_STATUS\r
113(EFIAPI *EFI_SMM_SW_UNREGISTER)(\r
114 IN EFI_SMM_SW_DISPATCH_PROTOCOL *This,\r
115 IN EFI_HANDLE DispatchHandle\r
116 );\r
117\r
118\r
119//\r
120// Interface structure for the SMM Software SMI Dispatch Protocol\r
121//\r
122/**\r
123 Provides the parent dispatch service for a given SMI source generator.\r
124**/\r
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
129struct _EFI_SMM_SW_DISPATCH_PROTOCOL {\r
130 ///\r
131 /// Installs a child service to be dispatched by this protocol.\r
132 ///\r
133 EFI_SMM_SW_REGISTER Register;\r
134\r
135 ///\r
136 /// Removes a child service dispatched by this protocol.\r
137 ///\r
138 EFI_SMM_SW_UNREGISTER UnRegister;\r
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
145};\r
146\r
147extern EFI_GUID gEfiSmmSwDispatchProtocolGuid;\r
148\r
149#endif\r