]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmIchnDispatch.h
IntelFrameworkPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmIchnDispatch.h
1 /** @file
2 Provides the parent dispatch service for a given SMI source generator.
3 The EFI_SMM_ICHN_DISPATCH_PROTOCOL provides the ability to install child handlers for
4 the given event types.
5
6 Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 @par Revision Reference:
10 This Protocol is defined in Framework of EFI SMM Core Interface Spec
11 Version 0.9.
12
13 **/
14
15 #ifndef _EFI_SMM_ICHN_DISPATCH_H_
16 #define _EFI_SMM_ICHN_DISPATCH_H_
17
18
19 //
20 // Global ID for the ICH SMI Protocol
21 //
22 #define EFI_SMM_ICHN_DISPATCH_PROTOCOL_GUID \
23 { \
24 0xc50b323e, 0x9075, 0x4f2a, {0xac, 0x8e, 0xd2, 0x59, 0x6a, 0x10, 0x85, 0xcc } \
25 }
26
27 typedef struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL EFI_SMM_ICHN_DISPATCH_PROTOCOL;
28
29 //
30 // Related Definitions
31 //
32 //
33 // ICHN Specific SMIs. These are miscellaneous SMI sources that are supported by the
34 // ICHN specific SMI implementation. These may change over time. TrapNumber is only
35 // valid if the Type is Trap.
36 //
37 typedef enum {
38 //
39 // NOTE: NEVER delete items from this list/enumeration! Doing so will prevent other versions
40 // of the code from compiling. If the ICH version your driver is written for doesn't support
41 // some of these SMIs, then simply return EFI_UNSUPPORTED when a child/client tries to register
42 // for them.
43 //
44 IchnMch,
45 IchnPme,
46 IchnRtcAlarm,
47 IchnRingIndicate,
48 IchnAc97Wake,
49 IchnSerialIrq,
50 IchnY2KRollover,
51 IchnTcoTimeout,
52 IchnOsTco,
53 IchnNmi,
54 IchnIntruderDetect,
55 IchnBiosWp,
56 IchnMcSmi,
57 IchnPmeB0,
58 IchnThrmSts,
59 IchnSmBus,
60 IchnIntelUsb2,
61 IchnMonSmi7,
62 IchnMonSmi6,
63 IchnMonSmi5,
64 IchnMonSmi4,
65 IchnDevTrap13,
66 IchnDevTrap12,
67 IchnDevTrap11,
68 IchnDevTrap10,
69 IchnDevTrap9,
70 IchnDevTrap8,
71 IchnDevTrap7,
72 IchnDevTrap6,
73 IchnDevTrap5,
74 IchnDevTrap3,
75 IchnDevTrap2,
76 IchnDevTrap1,
77 IchnDevTrap0,
78 IchnIoTrap3,
79 IchnIoTrap2,
80 IchnIoTrap1,
81 IchnIoTrap0,
82 IchnPciExpress,
83 IchnMonitor,
84 IchnSpi,
85 IchnQRT,
86 IchnGpioUnlock,
87 //
88 // INSERT NEW ITEMS JUST BEFORE THIS LINE
89 //
90 NUM_ICHN_TYPES // the number of items in this enumeration
91 } EFI_SMM_ICHN_SMI_TYPE;
92
93 typedef struct {
94 EFI_SMM_ICHN_SMI_TYPE Type;
95 } EFI_SMM_ICHN_DISPATCH_CONTEXT;
96
97 //
98 // Member functions
99 //
100 /**
101 Dispatch function for a ICHN specific SMI handler.
102
103 @param DispatchHandle The handle of this dispatch function.
104 @param DispatchContext The pointer to the dispatch function's context.
105 The DispatchContext fields are filled in
106 by the dispatching driver prior to
107 invoking this dispatch function.
108
109 @return None
110
111 **/
112 typedef
113 VOID
114 (EFIAPI *EFI_SMM_ICHN_DISPATCH)(
115 IN EFI_HANDLE DispatchHandle,
116 IN EFI_SMM_ICHN_DISPATCH_CONTEXT *DispatchContext
117 );
118
119 /**
120 Register a child SMI source dispatch function with a parent SMM driver.
121
122 @param This The pointer to the EFI_SMM_ICHN_DISPATCH_PROTOCOL instance.
123 @param DispatchFunction The function to install.
124 @param DispatchContext The pointer to the dispatch function's context.
125 The caller fills in this context before calling
126 the register function to indicate to the register
127 function the ICHN SMI source for which the dispatch
128 function should be invoked.
129 @param DispatchHandle The handle generated by the dispatcher to track the function
130 instance.
131
132 @retval EFI_SUCCESS The dispatch function has been successfully
133 registered and the SMI source has been enabled.
134 @retval EFI_DEVICE_ERROR The driver could not enable the SMI source.
135 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
136 child.
137 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The ICHN input value
138 is not within valid range.
139
140 **/
141 typedef
142 EFI_STATUS
143 (EFIAPI *EFI_SMM_ICHN_REGISTER)(
144 IN EFI_SMM_ICHN_DISPATCH_PROTOCOL *This,
145 IN EFI_SMM_ICHN_DISPATCH DispatchFunction,
146 IN EFI_SMM_ICHN_DISPATCH_CONTEXT *DispatchContext,
147 OUT EFI_HANDLE *DispatchHandle
148 );
149
150 /**
151 Unregister a child SMI source dispatch function with a parent SMM driver
152
153 @param This The pointer to the EFI_SMM_ICHN_DISPATCH_PROTOCOL instance.
154 @param DispatchHandle The handle of the service to remove.
155
156 @retval EFI_SUCCESS The dispatch function has been successfully
157 unregistered, and the SMI source has been disabled,
158 if there are no other registered child dispatch
159 functions for this SMI source.
160 @retval EFI_INVALID_PARAMETER The handle is invalid.
161
162 **/
163 typedef
164 EFI_STATUS
165 (EFIAPI *EFI_SMM_ICHN_UNREGISTER)(
166 IN EFI_SMM_ICHN_DISPATCH_PROTOCOL *This,
167 IN EFI_HANDLE DispatchHandle
168 );
169
170 //
171 // Interface structure for the SMM ICHN specific SMI Dispatch Protocol
172 //
173 /**
174 Provides the parent dispatch service for a given SMI source generator.
175 **/
176 struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL {
177 EFI_SMM_ICHN_REGISTER Register; ///< Installs a child service to be dispatched by this protocol.
178 EFI_SMM_ICHN_UNREGISTER UnRegister; ///< Removes a child service dispatched by this protocol.
179 };
180
181 extern EFI_GUID gEfiSmmIchnDispatchProtocolGuid;
182
183 #endif