3 Copyright (c) 1999 - 2002, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 SmmPeriodicTimerDispatch.h
19 EFI Smm Periodic Timer Smi Child Protocol
25 #ifndef _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_
26 #define _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_
29 // Global ID for the Periodic Timer SMI Protocol
31 #define EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID \
33 0x9cca03fc, 0x4c9e, 0x4a19, 0x9b, 0x6, 0xed, 0x7b, 0x47, 0x9b, 0xde, 0x55 \
36 EFI_FORWARD_DECLARATION (EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
);
39 // Related Definitions
42 // Period is the minimum period of time in 100 nanosecond units that child gets called.
43 // The child will be called back after a time greater than the time Period.
45 // SmiTickInterval is the period of time interval between SMIs. Children of this interface
46 // should use this field when registering for periodic timer intervals when a finer
47 // granularity periodic SMI is desired. Valid values for this field are those returned
48 // by GetNextInterval. A value of 0 indicates the parent is allowed to use any SMI
49 // interval period to satisfy the requested period.
50 // Example: A chipset supports periodic SMIs on every 64ms or 2 seconds.
51 // A child wishes schedule a period SMI to fire on a period of 3 seconds, there
52 // are several ways to approach the problem:
53 // 1. The child may accept a 4 second periodic rate, in which case it registers with
55 // SmiTickInterval = 20000
56 // The resulting SMI will occur every 2 seconds with the child called back on
58 // NOTE: the same result would occur if the child set SmiTickInterval = 0.
59 // 2. The child may choose the finer granularity SMI (64ms):
61 // SmiTickInterval = 640
62 // The resulting SMI will occur every 64ms with the child called back on
64 // NOTE: the child driver should be aware that this will result in more
65 // SMIs occuring during system runtime which can negatively impact system
68 // ElapsedTime is the actual time in 100 nanosecond units elapsed since last called, a
69 // value of 0 indicates an unknown amount of time.
73 UINT64 SmiTickInterval
;
75 } EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT
;
82 (EFIAPI
*EFI_SMM_PERIODIC_TIMER_DISPATCH
) (
83 IN EFI_HANDLE DispatchHandle
,
84 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT
* DispatchContext
90 Dispatch function for a Periodic Timer SMI handler.
93 DispatchHandle - Handle of this dispatch function.
94 DispatchContext - Pointer to the dispatch function's context.
95 The DispatchContext fields are filled in
96 by the dispatching driver prior to
97 invoking this dispatch function.
105 (EFIAPI
*EFI_SMM_PERIODIC_TIMER_INTERVAL
) (
106 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
* This
,
107 IN OUT UINT64
**SmiTickInterval
113 Returns the next SMI tick period supported by the chipset. The order
114 returned is from longest to shortest interval period.
117 This - Protocol instance pointer.
118 SmiTickInterval - Pointer to pointer of next shorter SMI interval
119 period supported by the child. This parameter
120 works as a get-first, get-next field. The first
121 time this function is called, *SmiTickInterval
122 should be set to NULL to get the longest SMI
123 interval. The returned *SmiTickInterval should
124 be passed in on subsequent calls to get
125 the next shorter interval period until
126 *SmiTickInterval = NULL.
134 (EFIAPI
*EFI_SMM_PERIODIC_TIMER_REGISTER
) (
135 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
* This
,
136 IN EFI_SMM_PERIODIC_TIMER_DISPATCH DispatchFunction
,
137 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT
* DispatchContext
,
138 OUT EFI_HANDLE
* DispatchHandle
144 Register a child SMI source dispatch function with a parent SMM driver
147 This - Protocol instance pointer.
148 DispatchFunction - Pointer to dispatch function to be invoked for
150 DispatchContext - Pointer to the dispatch function's context.
151 The caller fills this context in before calling
152 the register function to indicate to the register
153 function the period at which the dispatch function
155 DispatchHandle - Handle of dispatch function, for when interfacing
156 with the parent Sx state SMM driver.
159 EFI_SUCCESS - The dispatch function has been successfully
160 registered and the SMI source has been enabled.
161 EFI_DEVICE_ERROR - The driver was unable to enable the SMI source.
162 EFI_OUT_OF_RESOURCES - Not enough memory (system or SMM) to manage this
164 EFI_INVALID_PARAMETER - DispatchContext is invalid. The period input value
165 is not within valid range.
170 (EFIAPI
*EFI_SMM_PERIODIC_TIMER_UNREGISTER
) (
171 IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
* This
,
172 IN EFI_HANDLE DispatchHandle
178 Unregister a child SMI source dispatch function with a parent SMM driver
181 This - Protocol instance pointer.
182 DispatchHandle - Handle of dispatch function to deregister.
185 EFI_SUCCESS - The dispatch function has been successfully
186 unregistered and the SMI source has been disabled
187 if there are no other registered child dispatch
188 functions for this SMI source.
189 EFI_INVALID_PARAMETER - Handle is invalid.
195 // Interface structure for the SMM Periodic Timer Dispatch Protocol
197 typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
{
198 EFI_SMM_PERIODIC_TIMER_REGISTER Register
;
199 EFI_SMM_PERIODIC_TIMER_UNREGISTER UnRegister
;
200 EFI_SMM_PERIODIC_TIMER_INTERVAL GetNextShorterInterval
;
201 } EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL
;
203 extern EFI_GUID gEfiSmmPeriodicTimerDispatchProtocolGuid
;