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