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