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