]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/SmmPeriodicTimerDispatch.h
Clarify @pram b in Base.h. Accepted and edited in Qing Huang changes for @retval...
[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
358e78ed 4 Copyright (c) 2007 - 2009, Intel Corporation\r
79964ac8 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
79964ac8 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
b80fbe85 22\r
79964ac8 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
358e78ed 36\r
79964ac8 37typedef struct {\r
358e78ed 38 ///\r
5259c97d 39 /// The minimum period of time that child gets called, in 100 nanosecond units.\r
358e78ed 40 /// The child will be called back after a time greater than the time Period.\r
41 ///\r
79964ac8 42 UINT64 Period;\r
358e78ed 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
79964ac8 50 UINT64 SmiTickInterval;\r
358e78ed 51 ///\r
5259c97d 52 /// The actual time in 100 nanosecond units elapsed since last called. A\r
358e78ed 53 /// value of 0 indicates an unknown amount of time.\r
54 ///\r
79964ac8 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
700a7869 70 @return None\r
79964ac8 71\r
72**/\r
73typedef\r
74VOID\r
69686d56 75(EFIAPI *EFI_SMM_PERIODIC_TIMER_DISPATCH)(\r
700a7869 76 IN EFI_HANDLE DispatchHandle,\r
77 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT *DispatchContext\r
79964ac8 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
5259c97d 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
79964ac8 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
69686d56 97(EFIAPI *EFI_SMM_PERIODIC_TIMER_INTERVAL)(\r
79964ac8 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
700a7869 105 @param This Pointer to the EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL instance.\r
106 @param DispatchFunction Function to install.\r
79964ac8 107 @param DispatchContext Pointer to the dispatch function's context.\r
5259c97d 108 Indicates to the register\r
79964ac8 109 function the period at which the dispatch function\r
110 should be invoked.\r
700a7869 111 @param DispatchHandle Handle generated by the dispatcher to track the function instance.\r
79964ac8 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
69686d56 124(EFIAPI *EFI_SMM_PERIODIC_TIMER_REGISTER)(\r
700a7869 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
79964ac8 129 );\r
130\r
131/**\r
700a7869 132 Unregisters a periodic timer service.\r
79964ac8 133\r
700a7869 134 @param This Pointer to the EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL instance.\r
135 @param DispatchHandle Handle of the service to remove.\r
79964ac8 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
69686d56 146(EFIAPI *EFI_SMM_PERIODIC_TIMER_UNREGISTER)(\r
700a7869 147 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,\r
148 IN EFI_HANDLE DispatchHandle\r
79964ac8 149 );\r
150\r
151//\r
152// Interface structure for the SMM Periodic Timer Dispatch Protocol\r
153//\r
154/**\r
79964ac8 155 Provides the parent dispatch service for the periodical timer SMI source generator.\r
79964ac8 156**/\r
157struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL {\r
2bbaeb0d 158 ///\r
159 /// Installs a child service to be dispatched by this protocol.\r
160 ///\r
79964ac8 161 EFI_SMM_PERIODIC_TIMER_REGISTER Register;\r
2bbaeb0d 162 \r
163 ///\r
164 /// Removes a child service dispatched by this protocol.\r
165 ///\r
79964ac8 166 EFI_SMM_PERIODIC_TIMER_UNREGISTER UnRegister;\r
2bbaeb0d 167 \r
168 ///\r
169 /// Returns the next SMI tick period that is supported by the chipset.\r
170 ///\r
79964ac8 171 EFI_SMM_PERIODIC_TIMER_INTERVAL GetNextShorterInterval;\r
172};\r
173\r
174extern EFI_GUID gEfiSmmPeriodicTimerDispatchProtocolGuid;\r
175\r
176#endif\r