]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmIchnDispatch.h
[Description]
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmIchnDispatch.h
1 /** @file
2 This file declares EFI Smm ICH [N] Specific Smi Child Protocol
3
4 Copyright (c) 2008, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 Module Name: SmmIchnDispatch.h
14
15 @par Revision Reference:
16 This Protocol is defined in Framework of EFI SMM Core Interface Spec
17 Version 0.9.
18
19 **/
20
21 #ifndef _EFI_SMM_ICHN_DISPATCH_H_
22 #define _EFI_SMM_ICHN_DISPATCH_H_
23
24 #include <PiDxe.h>
25
26 //
27 // Global ID for the ICH SMI Protocol
28 //
29 #define EFI_SMM_ICHN_DISPATCH_PROTOCOL_GUID \
30 { \
31 0xc50b323e, 0x9075, 0x4f2a, {0xac, 0x8e, 0xd2, 0x59, 0x6a, 0x10, 0x85, 0xcc } \
32 }
33
34 typedef struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL EFI_SMM_ICHN_DISPATCH_PROTOCOL;
35
36 //
37 // Related Definitions
38 //
39 //
40 // ICHN Specific SMIs. These are miscellaneous SMI sources that are supported by the
41 // ICHN specific SMI implementation. These may change over time. TrapNumber is only
42 // valid if the Type is Trap.
43 //
44 typedef enum {
45 //
46 // NOTE: NEVER delete items from this list/enumeration! Doing so will prevent other versions
47 // of the code from compiling. If the ICH version your driver is written for doesn't support
48 // some of these SMIs, then simply return EFI_UNSUPPORTED when a child/client tries to register
49 // for them.
50 //
51 IchnMch,
52 IchnPme,
53 IchnRtcAlarm,
54 IchnRingIndicate,
55 IchnAc97Wake,
56 IchnSerialIrq,
57 IchnY2KRollover,
58 IchnTcoTimeout,
59 IchnOsTco,
60 IchnNmi,
61 IchnIntruderDetect,
62 IchnBiosWp,
63 IchnMcSmi,
64 IchnPmeB0,
65 IchnThrmSts,
66 IchnSmBus,
67 IchnIntelUsb2,
68 IchnMonSmi7,
69 IchnMonSmi6,
70 IchnMonSmi5,
71 IchnMonSmi4,
72 IchnDevTrap13,
73 IchnDevTrap12,
74 IchnDevTrap11,
75 IchnDevTrap10,
76 IchnDevTrap9,
77 IchnDevTrap8,
78 IchnDevTrap7,
79 IchnDevTrap6,
80 IchnDevTrap5,
81 IchnDevTrap3,
82 IchnDevTrap2,
83 IchnDevTrap1,
84 IchnDevTrap0,
85 IchnIoTrap3,
86 IchnIoTrap2,
87 IchnIoTrap1,
88 IchnIoTrap0,
89 IchnPciExpress,
90 IchnMonitor,
91 IchnSpi,
92 IchnQRT,
93 IchnGpioUnlock,
94 //
95 // INSERT NEW ITEMS JUST BEFORE THIS LINE
96 //
97 NUM_ICHN_TYPES // the number of items in this enumeration
98 } EFI_SMM_ICHN_SMI_TYPE;
99
100 typedef struct {
101 EFI_SMM_ICHN_SMI_TYPE Type;
102 } EFI_SMM_ICHN_DISPATCH_CONTEXT;
103
104 //
105 // Member functions
106 //
107 /**
108 Dispatch function for a ICH n specific SMI handler.
109
110 @param DispatchHandle Handle of this dispatch function.
111 @param DispatchContext Pointer to the dispatch function's context.
112 The DispatchContext fields are filled in
113 by the dispatching driver prior to
114 invoking this dispatch function.
115
116 Nothing
117
118 **/
119 typedef
120 VOID
121 (EFIAPI *EFI_SMM_ICHN_DISPATCH) (
122 IN EFI_HANDLE DispatchHandle,
123 IN EFI_SMM_ICHN_DISPATCH_CONTEXT *DispatchContext
124 );
125
126 /**
127 Register a child SMI source dispatch function with a parent SMM driver
128
129 @param This Protocol instance pointer.
130 @param DispatchFunction Pointer to dispatch function to be invoked for
131 this SMI source
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 of dispatch function, for when interfacing
138 with the parent Sx state SMM driver.
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 Protocol instance pointer.
162 @param DispatchHandle Handle of dispatch function to deregister.
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 @retval other TBD
170
171 **/
172 typedef
173 EFI_STATUS
174 (EFIAPI *EFI_SMM_ICHN_UNREGISTER) (
175 IN EFI_SMM_ICHN_DISPATCH_PROTOCOL *This,
176 IN EFI_HANDLE DispatchHandle
177 );
178
179 //
180 // Interface structure for the SMM Ich n specific SMI Dispatch Protocol
181 //
182 /**
183 @par Protocol Description:
184 Provides the parent dispatch service for a given SMI source generator.
185
186 @param Register
187 Installs a child service to be dispatched by this protocol.
188
189 @param UnRegister
190 Removes a child service dispatched by this protocol.
191
192 **/
193 struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL {
194 EFI_SMM_ICHN_REGISTER Register;
195 EFI_SMM_ICHN_UNREGISTER UnRegister;
196 };
197
198 extern EFI_GUID gEfiSmmIchnDispatchProtocolGuid;
199
200 #endif