]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Framework/Protocol/SmmPeriodicTimerDispatch/SmmPeriodicTimerDispatch.h
Maintainers.txt: Remove EdkCompatibilityPkg information
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Framework / Protocol / SmmPeriodicTimerDispatch / SmmPeriodicTimerDispatch.h
CommitLineData
3eb9473e 1/*++\r
2\r
f57387d5
HT
3Copyright (c) 1999 - 2002, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials\r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12\r
13Module Name:\r
14\r
15 SmmPeriodicTimerDispatch.h\r
16\r
17Abstract:\r
18\r
19 EFI Smm Periodic Timer Smi Child Protocol\r
20\r
21Revision History\r
22\r
23--*/\r
24\r
25#ifndef _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_\r
26#define _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_\r
27\r
28//\r
29// Global ID for the Periodic Timer SMI Protocol\r
30//\r
31#define EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID \\r
32 { \\r
7ccf38a3 33 0x9cca03fc, 0x4c9e, 0x4a19, {0x9b, 0x6, 0xed, 0x7b, 0x47, 0x9b, 0xde, 0x55} \\r
3eb9473e 34 }\r
35\r
36EFI_FORWARD_DECLARATION (EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL);\r
37\r
38//\r
39// Related Definitions\r
40//\r
41//\r
42// Period is the minimum period of time in 100 nanosecond units that child gets called.\r
43// The child will be called back after a time greater than the time Period.\r
44//\r
45// SmiTickInterval is the period of time interval between SMIs. Children of this interface\r
46// should use this field when registering for periodic timer intervals when a finer\r
47// granularity periodic SMI is desired. Valid values for this field are those returned\r
48// by GetNextInterval. A value of 0 indicates the parent is allowed to use any SMI\r
49// interval period to satisfy the requested period.\r
50// Example: A chipset supports periodic SMIs on every 64ms or 2 seconds.\r
51// A child wishes schedule a period SMI to fire on a period of 3 seconds, there\r
52// are several ways to approach the problem:\r
53// 1. The child may accept a 4 second periodic rate, in which case it registers with\r
54// Period = 40000\r
55// SmiTickInterval = 20000\r
56// The resulting SMI will occur every 2 seconds with the child called back on\r
57// every 2nd SMI.\r
58// NOTE: the same result would occur if the child set SmiTickInterval = 0.\r
59// 2. The child may choose the finer granularity SMI (64ms):\r
60// Period = 30000\r
61// SmiTickInterval = 640\r
62// The resulting SMI will occur every 64ms with the child called back on\r
63// every 47th SMI.\r
64// NOTE: the child driver should be aware that this will result in more\r
65// SMIs occuring during system runtime which can negatively impact system\r
66// performance.\r
67//\r
68// ElapsedTime is the actual time in 100 nanosecond units elapsed since last called, a\r
69// value of 0 indicates an unknown amount of time.\r
70//\r
71typedef struct {\r
72 UINT64 Period;\r
73 UINT64 SmiTickInterval;\r
74 UINT64 ElapsedTime;\r
75} EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT;\r
76\r
77//\r
78// Member functions\r
79//\r
80typedef\r
81VOID\r
82(EFIAPI *EFI_SMM_PERIODIC_TIMER_DISPATCH) (\r
83 IN EFI_HANDLE DispatchHandle,\r
84 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT * DispatchContext\r
85 );\r
86\r
87/*++\r
88\r
89 Routine Description:\r
90 Dispatch function for a Periodic Timer SMI handler.\r
91\r
92 Arguments:\r
93 DispatchHandle - Handle of this dispatch function.\r
94 DispatchContext - Pointer to the dispatch function's context.\r
95 The DispatchContext fields are filled in\r
96 by the dispatching driver prior to\r
97 invoking this dispatch function.\r
98\r
99 Returns:\r
100 Nothing\r
101\r
102--*/\r
103typedef\r
104EFI_STATUS\r
105(EFIAPI *EFI_SMM_PERIODIC_TIMER_INTERVAL) (\r
106 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL * This,\r
107 IN OUT UINT64 **SmiTickInterval\r
108 );\r
109\r
110/*++\r
111\r
112 Routine Description:\r
113 Returns the next SMI tick period supported by the chipset. The order\r
114 returned is from longest to shortest interval period.\r
115\r
116 Arguments:\r
117 This - Protocol instance pointer.\r
118 SmiTickInterval - Pointer to pointer of next shorter SMI interval\r
119 period supported by the child. This parameter\r
120 works as a get-first, get-next field. The first\r
121 time this function is called, *SmiTickInterval\r
122 should be set to NULL to get the longest SMI\r
123 interval. The returned *SmiTickInterval should\r
124 be passed in on subsequent calls to get\r
125 the next shorter interval period until\r
126 *SmiTickInterval = NULL.\r
127\r
128 Returns:\r
129 EFI_SUCCESS\r
130\r
131--*/\r
132typedef\r
133EFI_STATUS\r
134(EFIAPI *EFI_SMM_PERIODIC_TIMER_REGISTER) (\r
135 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL * This,\r
136 IN EFI_SMM_PERIODIC_TIMER_DISPATCH DispatchFunction,\r
137 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT * DispatchContext,\r
138 OUT EFI_HANDLE * DispatchHandle\r
139 );\r
140\r
141/*++\r
142\r
143 Routine Description:\r
144 Register a child SMI source dispatch function with a parent SMM driver\r
145\r
146 Arguments:\r
147 This - Protocol instance pointer.\r
148 DispatchFunction - Pointer to dispatch function to be invoked for\r
149 this SMI source\r
150 DispatchContext - Pointer to the dispatch function's context.\r
151 The caller fills this context in before calling\r
152 the register function to indicate to the register\r
153 function the period at which the dispatch function\r
154 should be invoked.\r
155 DispatchHandle - Handle of dispatch function, for when interfacing\r
156 with the parent Sx state SMM driver.\r
157\r
158 Returns:\r
159 EFI_SUCCESS - The dispatch function has been successfully\r
160 registered and the SMI source has been enabled.\r
161 EFI_DEVICE_ERROR - The driver was unable to enable the SMI source.\r
162 EFI_OUT_OF_RESOURCES - Not enough memory (system or SMM) to manage this\r
163 child.\r
164 EFI_INVALID_PARAMETER - DispatchContext is invalid. The period input value\r
165 is not within valid range.\r
166\r
167--*/\r
168typedef\r
169EFI_STATUS\r
170(EFIAPI *EFI_SMM_PERIODIC_TIMER_UNREGISTER) (\r
171 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL * This,\r
172 IN EFI_HANDLE DispatchHandle\r
173 );\r
174\r
175/*++\r
176\r
177 Routine Description:\r
178 Unregister a child SMI source dispatch function with a parent SMM driver\r
179\r
180 Arguments:\r
181 This - Protocol instance pointer.\r
182 DispatchHandle - Handle of dispatch function to deregister.\r
183\r
184 Returns:\r
185 EFI_SUCCESS - The dispatch function has been successfully \r
186 unregistered and the SMI source has been disabled\r
187 if there are no other registered child dispatch\r
188 functions for this SMI source.\r
189 EFI_INVALID_PARAMETER - Handle is invalid.\r
190 other - TBD\r
191\r
192--*/\r
193\r
194//\r
195// Interface structure for the SMM Periodic Timer Dispatch Protocol\r
196//\r
5d46191d 197struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL {\r
3eb9473e 198 EFI_SMM_PERIODIC_TIMER_REGISTER Register;\r
199 EFI_SMM_PERIODIC_TIMER_UNREGISTER UnRegister;\r
200 EFI_SMM_PERIODIC_TIMER_INTERVAL GetNextShorterInterval;\r
5d46191d 201};\r
3eb9473e 202\r
203extern EFI_GUID gEfiSmmPeriodicTimerDispatchProtocolGuid;\r
204\r
205#endif\r