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