]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/SmmPeriodicTimerDispatch.h
Update comment in SMM Library class include file.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmPeriodicTimerDispatch.h
CommitLineData
79964ac8 1/** @file\r
8411f1c0 2 Provides the parent dispatch service for the periodical timer SMI source generator.\r
79964ac8 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
700a7869 87 @return None\r
79964ac8 88\r
89**/\r
90typedef\r
91VOID\r
69686d56 92(EFIAPI *EFI_SMM_PERIODIC_TIMER_DISPATCH)(\r
700a7869 93 IN EFI_HANDLE DispatchHandle,\r
94 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT *DispatchContext\r
79964ac8 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
69686d56 114(EFIAPI *EFI_SMM_PERIODIC_TIMER_INTERVAL)(\r
79964ac8 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
700a7869 122 @param This Pointer to the EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL instance.\r
123 @param DispatchFunction Function to install.\r
79964ac8 124 @param DispatchContext Pointer to the dispatch function's context.\r
125 The caller fills this context in before calling\r
126 the register function to indicate to the register\r
127 function the period at which the dispatch function\r
128 should be invoked.\r
700a7869 129 @param DispatchHandle Handle generated by the dispatcher to track the function instance.\r
79964ac8 130\r
131 @retval EFI_SUCCESS The dispatch function has been successfully\r
132 registered and the SMI source has been enabled.\r
133 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
134 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
135 child.\r
136 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The period input value\r
137 is not within valid range.\r
138\r
139**/\r
140typedef\r
141EFI_STATUS\r
69686d56 142(EFIAPI *EFI_SMM_PERIODIC_TIMER_REGISTER)(\r
700a7869 143 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,\r
144 IN EFI_SMM_PERIODIC_TIMER_DISPATCH DispatchFunction,\r
145 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT *DispatchContext,\r
146 OUT EFI_HANDLE *DispatchHandle\r
79964ac8 147 );\r
148\r
149/**\r
700a7869 150 Unregisters a periodic timer service.\r
79964ac8 151\r
700a7869 152 @param This Pointer to the EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL instance.\r
153 @param DispatchHandle Handle of the service to remove.\r
79964ac8 154\r
155 @retval EFI_SUCCESS The dispatch function has been successfully\r
156 unregistered and the SMI source has been disabled\r
157 if there are no other registered child dispatch\r
158 functions for this SMI source.\r
159 @retval EFI_INVALID_PARAMETER Handle is invalid.\r
160\r
161**/\r
162typedef\r
163EFI_STATUS\r
69686d56 164(EFIAPI *EFI_SMM_PERIODIC_TIMER_UNREGISTER)(\r
700a7869 165 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,\r
166 IN EFI_HANDLE DispatchHandle\r
79964ac8 167 );\r
168\r
169//\r
170// Interface structure for the SMM Periodic Timer Dispatch Protocol\r
171//\r
172/**\r
173 @par Protocol Description:\r
174 Provides the parent dispatch service for the periodical timer SMI source generator.\r
175\r
176 @param Register\r
177 Installs a child service to be dispatched by this protocol.\r
178\r
179 @param UnRegister\r
180 Removes a child service dispatched by this protocol.\r
181\r
182 @param GetNextShorterInterval\r
183 Returns the next SMI tick period that is supported by the chipset.\r
184\r
185**/\r
186struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL {\r
187 EFI_SMM_PERIODIC_TIMER_REGISTER Register;\r
188 EFI_SMM_PERIODIC_TIMER_UNREGISTER UnRegister;\r
189 EFI_SMM_PERIODIC_TIMER_INTERVAL GetNextShorterInterval;\r
190};\r
191\r
192extern EFI_GUID gEfiSmmPeriodicTimerDispatchProtocolGuid;\r
193\r
194#endif\r