2 This file declares EFI Smm Periodic Timer Smi Child Protocol
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 Protocol instance pointer.
123 @param DispatchFunction Pointer to dispatch function to be invoked for
125 @param DispatchContext Pointer to the dispatch function's context.
126 The caller fills this context in before calling
127 the register function to indicate to the register
128 function the period at which the dispatch function
130 @param DispatchHandle Handle of dispatch function, for when interfacing
131 with the parent Sx state SMM driver.
133 @retval EFI_SUCCESS The dispatch function has been successfully
134 registered and the SMI source has been enabled.
135 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
136 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
138 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The period input value
139 is not within valid range.
144 (EFIAPI
*EFI_SMM_PERIODIC_TIMER_REGISTER
) (
145 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
*This
,
146 IN EFI_SMM_PERIODIC_TIMER_DISPATCH DispatchFunction
,
147 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT
*DispatchContext
,
148 OUT EFI_HANDLE
*DispatchHandle
152 Unregister a child SMI source dispatch function with a parent SMM driver
154 @param This Protocol instance pointer.
155 @param DispatchHandle Handle of dispatch function to deregister.
157 @retval EFI_SUCCESS The dispatch function has been successfully
158 unregistered and the SMI source has been disabled
159 if there are no other registered child dispatch
160 functions for this SMI source.
161 @retval EFI_INVALID_PARAMETER Handle is invalid.
166 (EFIAPI
*EFI_SMM_PERIODIC_TIMER_UNREGISTER
) (
167 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
*This
,
168 IN EFI_HANDLE DispatchHandle
172 // Interface structure for the SMM Periodic Timer Dispatch Protocol
175 @par Protocol Description:
176 Provides the parent dispatch service for the periodical timer SMI source generator.
179 Installs a child service to be dispatched by this protocol.
182 Removes a child service dispatched by this protocol.
184 @param GetNextShorterInterval
185 Returns the next SMI tick period that is supported by the chipset.
188 struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
{
189 EFI_SMM_PERIODIC_TIMER_REGISTER Register
;
190 EFI_SMM_PERIODIC_TIMER_UNREGISTER UnRegister
;
191 EFI_SMM_PERIODIC_TIMER_INTERVAL GetNextShorterInterval
;
194 extern EFI_GUID gEfiSmmPeriodicTimerDispatchProtocolGuid
;