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