2 Provides the parent dispatch service for the periodical timer SMI source generator.
4 Copyright (c) 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 Module Name: SmmPeriodicTimerDispatch.h
15 @par Revision Reference:
16 This Protocol is defined in Framework of EFI SMM Core Interface Spec
21 #ifndef _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_
22 #define _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_
27 // Global ID for the Periodic Timer SMI Protocol
29 #define EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID \
31 0x9cca03fc, 0x4c9e, 0x4a19, {0x9b, 0x6, 0xed, 0x7b, 0x47, 0x9b, 0xde, 0x55 } \
34 typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
;
37 // Related Definitions
40 // Period is the minimum period of time in 100 nanosecond units that child gets called.
41 // The child will be called back after a time greater than the time Period.
43 // SmiTickInterval is the period of time interval between SMIs. Children of this interface
44 // should use this field when registering for periodic timer intervals when a finer
45 // granularity periodic SMI is desired. Valid values for this field are those returned
46 // by GetNextInterval. A value of 0 indicates the parent is allowed to use any SMI
47 // interval period to satisfy the requested period.
48 // Example: A chipset supports periodic SMIs on every 64ms or 2 seconds.
49 // A child wishes schedule a period SMI to fire on a period of 3 seconds, there
50 // are several ways to approach the problem:
51 // 1. The child may accept a 4 second periodic rate, in which case it registers with
53 // SmiTickInterval = 20000
54 // The resulting SMI will occur every 2 seconds with the child called back on
56 // NOTE: the same result would occur if the child set SmiTickInterval = 0.
57 // 2. The child may choose the finer granularity SMI (64ms):
59 // SmiTickInterval = 640
60 // The resulting SMI will occur every 64ms with the child called back on
62 // NOTE: the child driver should be aware that this will result in more
63 // SMIs occuring during system runtime which can negatively impact system
66 // ElapsedTime is the actual time in 100 nanosecond units elapsed since last called, a
67 // value of 0 indicates an unknown amount of time.
71 UINT64 SmiTickInterval
;
73 } EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT
;
79 Dispatch function for a Periodic Timer SMI handler.
81 @param DispatchHandle Handle of this dispatch function.
82 @param DispatchContext Pointer to the dispatch function's context.
83 The DispatchContext fields are filled in
84 by the dispatching driver prior to
85 invoking this dispatch function.
92 (EFIAPI
*EFI_SMM_PERIODIC_TIMER_DISPATCH
)(
93 IN EFI_HANDLE DispatchHandle
,
94 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT
*DispatchContext
98 Returns the next SMI tick period supported by the chipset. The order
99 returned is from longest to shortest interval period.
101 @param This Protocol instance pointer.
102 @param SmiTickInterval Pointer to pointer of next shorter SMI interval
103 period supported by the child. This parameter works as a get-first,
104 get-next field.The first time this function is called, *SmiTickInterval
105 should be set to NULL to get the longest SMI interval.The returned
106 *SmiTickInterval should be passed in on subsequent calls to get the
107 next shorter interval period until *SmiTickInterval = NULL.
109 @retval EFI_SUCCESS The service returned successfully.
114 (EFIAPI
*EFI_SMM_PERIODIC_TIMER_INTERVAL
)(
115 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
*This
,
116 IN OUT UINT64
**SmiTickInterval
120 Register a child SMI source dispatch function with a parent SMM driver
122 @param This Pointer to the EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL instance.
123 @param DispatchFunction Function to install.
124 @param DispatchContext Pointer to the dispatch function's context.
125 The caller fills this context in before calling
126 the register function to indicate to the register
127 function the period at which the dispatch function
129 @param DispatchHandle Handle generated by the dispatcher to track the function instance.
131 @retval EFI_SUCCESS The dispatch function has been successfully
132 registered and the SMI source has been enabled.
133 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
134 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
136 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The period input value
137 is not within valid range.
142 (EFIAPI
*EFI_SMM_PERIODIC_TIMER_REGISTER
)(
143 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
*This
,
144 IN EFI_SMM_PERIODIC_TIMER_DISPATCH DispatchFunction
,
145 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT
*DispatchContext
,
146 OUT EFI_HANDLE
*DispatchHandle
150 Unregisters a periodic timer service.
152 @param This Pointer to the EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL instance.
153 @param DispatchHandle Handle of the service to remove.
155 @retval EFI_SUCCESS The dispatch function has been successfully
156 unregistered and the SMI source has been disabled
157 if there are no other registered child dispatch
158 functions for this SMI source.
159 @retval EFI_INVALID_PARAMETER Handle is invalid.
164 (EFIAPI
*EFI_SMM_PERIODIC_TIMER_UNREGISTER
)(
165 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
*This
,
166 IN EFI_HANDLE DispatchHandle
170 // Interface structure for the SMM Periodic Timer Dispatch Protocol
173 @par Protocol Description:
174 Provides the parent dispatch service for the periodical timer SMI source generator.
177 Installs a child service to be dispatched by this protocol.
180 Removes a child service dispatched by this protocol.
182 @param GetNextShorterInterval
183 Returns the next SMI tick period that is supported by the chipset.
186 struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
{
187 EFI_SMM_PERIODIC_TIMER_REGISTER Register
;
188 EFI_SMM_PERIODIC_TIMER_UNREGISTER UnRegister
;
189 EFI_SMM_PERIODIC_TIMER_INTERVAL GetNextShorterInterval
;
192 extern EFI_GUID gEfiSmmPeriodicTimerDispatchProtocolGuid
;