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