2 SMM Periodic Timer Dispatch Protocol as defined in PI 1.1 Specification
3 Volume 4 System Management Mode Core Interface.
5 This protocol provides the parent dispatch service for the periodical timer SMI source generator.
7 Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 @par Revision Reference:
17 This protocol is from PI Version 1.1.
21 #ifndef _SMM_PERIODIC_TIMER_DISPATCH2_H_
22 #define _SMM_PERIODIC_TIMER_DISPATCH2_H_
24 #include <Pi/PiSmmCis.h>
25 #include <Protocol/MmPeriodicTimerDispatch.h>
27 #define EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL_GUID EFI_MM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID
30 /// Example: A chipset supports periodic SMIs on every 64ms or 2 seconds.
31 /// A child wishes schedule a period SMI to fire on a period of 3 seconds, there
32 /// are several ways to approach the problem:
33 /// 1. The child may accept a 4 second periodic rate, in which case it registers with
35 /// SmiTickInterval = 20000
36 /// The resulting SMI will occur every 2 seconds with the child called back on
38 /// NOTE: the same result would occur if the child set SmiTickInterval = 0.
39 /// 2. The child may choose the finer granularity SMI (64ms):
41 /// SmiTickInterval = 640
42 /// The resulting SMI will occur every 64ms with the child called back on
44 /// NOTE: the child driver should be aware that this will result in more
45 /// SMIs occuring during system runtime which can negatively impact system
50 /// The minimum period of time in 100 nanosecond units that the child gets called. The
51 /// child will be called back after a time greater than the time Period.
55 /// The period of time interval between SMIs. Children of this interface should use this
56 /// field when registering for periodic timer intervals when a finer granularity periodic
59 UINT64 SmiTickInterval
;
60 } EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT
;
63 /// The DispatchFunction will be called with Context set to the same value as was passed into
64 /// Register() in RegisterContext and with CommBuffer pointing to an instance of
65 /// EFI_SMM_PERIODIC_TIMER_CONTEXT and CommBufferSize pointing to its size.
67 typedef EFI_MM_PERIODIC_TIMER_CONTEXT EFI_SMM_PERIODIC_TIMER_CONTEXT
;
69 typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL
;
72 Register a child SMI source dispatch function for SMM periodic timer.
74 This service registers a function (DispatchFunction) which will be called when at least the
75 amount of time specified by RegisterContext has elapsed. On return, DispatchHandle
76 contains a unique handle which may be used later to unregister the function using UnRegister().
77 The DispatchFunction will be called with Context set to the same value as was passed into
78 this function in RegisterContext and with CommBuffer pointing to an instance of
79 EFI_SMM_PERIODIC_TIMER_CONTEXT and CommBufferSize pointing to its size.
81 @param[in] This Pointer to the EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL instance.
82 @param[in] DispatchFunction Function to register for handler when at least the specified amount
84 @param[in] RegisterContext Pointer to the dispatch function's context.
85 The caller fills this context in before calling
86 the register function to indicate to the register
87 function the period at which the dispatch function
89 @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.
91 @retval EFI_SUCCESS The dispatch function has been successfully
92 registered and the SMI source has been enabled.
93 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
94 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The period input value
95 is not within valid range.
96 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this child.
100 (EFIAPI
*EFI_SMM_PERIODIC_TIMER_REGISTER2
)(
101 IN CONST EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL
*This
,
102 IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction
,
103 IN CONST EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT
*RegisterContext
,
104 OUT EFI_HANDLE
*DispatchHandle
108 Unregisters a periodic timer service.
110 This service removes the handler associated with DispatchHandle so that it will no longer be
111 called when the time has elapsed.
113 @param[in] This Pointer to the EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL instance.
114 @param[in] DispatchHandle Handle of the service to remove.
116 @retval EFI_SUCCESS The service has been successfully removed.
117 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
121 (EFIAPI
*EFI_SMM_PERIODIC_TIMER_UNREGISTER2
)(
122 IN CONST EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL
*This
,
123 IN EFI_HANDLE DispatchHandle
127 Returns the next SMI tick period supported by the chipset.
129 The order returned is from longest to shortest interval period.
131 @param[in] This Pointer to the EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL instance.
132 @param[in,out] SmiTickInterval Pointer to pointer of next shorter SMI interval
133 period supported by the child. This parameter works as a get-first,
134 get-next field.The first time this function is called, *SmiTickInterval
135 should be set to NULL to get the longest SMI interval.The returned
136 *SmiTickInterval should be passed in on subsequent calls to get the
137 next shorter interval period until *SmiTickInterval = NULL.
139 @retval EFI_SUCCESS The service returned successfully.
143 (EFIAPI
*EFI_SMM_PERIODIC_TIMER_INTERVAL2
)(
144 IN CONST EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL
*This
,
145 IN OUT UINT64
**SmiTickInterval
149 /// Interface structure for the SMM Periodic Timer Dispatch Protocol
151 /// This protocol provides the parent dispatch service for the periodical timer SMI source generator.
153 struct _EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL
{
154 EFI_SMM_PERIODIC_TIMER_REGISTER2 Register
;
155 EFI_SMM_PERIODIC_TIMER_UNREGISTER2 UnRegister
;
156 EFI_SMM_PERIODIC_TIMER_INTERVAL2 GetNextShorterInterval
;
159 extern EFI_GUID gEfiSmmPeriodicTimerDispatch2ProtocolGuid
;