]>
Commit | Line | Data |
---|---|---|
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 | |
31 | typedef 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 | 37 | typedef struct {\r |
358e78ed | 38 | ///\r |
39 | /// The minimum period of time in 100 nanosecond units that child gets called.\r | |
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 |
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 | |
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 | |
73 | typedef\r | |
74 | VOID\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 | |
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 | |
95 | typedef\r | |
96 | EFI_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 |
108 | The caller fills this context in before calling\r | |
109 | the register function to indicate to the register\r | |
110 | function the period at which the dispatch function\r | |
111 | should be invoked.\r | |
700a7869 | 112 | @param DispatchHandle Handle generated by the dispatcher to track the function instance.\r |
79964ac8 | 113 | \r |
114 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
115 | registered and the SMI source has been enabled.\r | |
116 | @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r | |
117 | @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r | |
118 | child.\r | |
119 | @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The period input value\r | |
120 | is not within valid range.\r | |
121 | \r | |
122 | **/\r | |
123 | typedef\r | |
124 | EFI_STATUS\r | |
69686d56 | 125 | (EFIAPI *EFI_SMM_PERIODIC_TIMER_REGISTER)(\r |
700a7869 | 126 | IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,\r |
127 | IN EFI_SMM_PERIODIC_TIMER_DISPATCH DispatchFunction,\r | |
128 | IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT *DispatchContext,\r | |
129 | OUT EFI_HANDLE *DispatchHandle\r | |
79964ac8 | 130 | );\r |
131 | \r | |
132 | /**\r | |
700a7869 | 133 | Unregisters a periodic timer service.\r |
79964ac8 | 134 | \r |
700a7869 | 135 | @param This Pointer to the EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL instance.\r |
136 | @param DispatchHandle Handle of the service to remove.\r | |
79964ac8 | 137 | \r |
138 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
139 | unregistered and the SMI source has been disabled\r | |
140 | if there are no other registered child dispatch\r | |
141 | functions for this SMI source.\r | |
142 | @retval EFI_INVALID_PARAMETER Handle is invalid.\r | |
143 | \r | |
144 | **/\r | |
145 | typedef\r | |
146 | EFI_STATUS\r | |
69686d56 | 147 | (EFIAPI *EFI_SMM_PERIODIC_TIMER_UNREGISTER)(\r |
700a7869 | 148 | IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,\r |
149 | IN EFI_HANDLE DispatchHandle\r | |
79964ac8 | 150 | );\r |
151 | \r | |
152 | //\r | |
153 | // Interface structure for the SMM Periodic Timer Dispatch Protocol\r | |
154 | //\r | |
155 | /**\r | |
79964ac8 | 156 | Provides the parent dispatch service for the periodical timer SMI source generator.\r |
79964ac8 | 157 | **/\r |
158 | struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL {\r | |
2bbaeb0d | 159 | ///\r |
160 | /// Installs a child service to be dispatched by this protocol.\r | |
161 | ///\r | |
79964ac8 | 162 | EFI_SMM_PERIODIC_TIMER_REGISTER Register;\r |
2bbaeb0d | 163 | \r |
164 | ///\r | |
165 | /// Removes a child service dispatched by this protocol.\r | |
166 | ///\r | |
79964ac8 | 167 | EFI_SMM_PERIODIC_TIMER_UNREGISTER UnRegister;\r |
2bbaeb0d | 168 | \r |
169 | ///\r | |
170 | /// Returns the next SMI tick period that is supported by the chipset.\r | |
171 | ///\r | |
79964ac8 | 172 | EFI_SMM_PERIODIC_TIMER_INTERVAL GetNextShorterInterval;\r |
173 | };\r | |
174 | \r | |
175 | extern EFI_GUID gEfiSmmPeriodicTimerDispatchProtocolGuid;\r | |
176 | \r | |
177 | #endif\r |