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