summaryrefslogtreecommitdiff
path: root/Include/Protocol/Timer.h
blob: d51986f5c6801388fa123b8c34010e1951a1eced (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2005, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**             6145-F Northbelt Pkwy, Norcross, GA 30071            **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************

//**********************************************************************
// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Timer.h 2     3/13/06 1:45a Felixp $
//
// $Revision: 2 $
//
// $Date: 3/13/06 1:45a $
//*****************************************************************************
// Revision History
// ----------------
// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Timer.h $
// 
// 2     3/13/06 1:45a Felixp
// 
// 1     1/28/05 12:44p Felixp
// 
// 2     1/18/05 3:21p Felixp
// PrintDebugMessage renamed to Trace
// 
// 1     12/23/04 9:42a Felixp
// 
// 1     12/23/04 9:29a Felixp
// 
// 2     3/17/04 11:11a Robert
// 
// 1     12/31/03 11:05a Robert
//
//*****************************************************************************
//<AMI_FHDR_START>
//
// Name:	Timer.h
//
// Description:	This file contains Data structures and support values for the
//			Timer Architectural Protocol
//
//<AMI_FHDR_END>
//*****************************************************************************
#ifndef __TIMER_ARCH_PROTOCOL_H__
#define __TIMER_ARCH_PROTOCOL_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <EFI.h>

// GUID for the Timer Architectural Protocol
#define EFI_TIMER_ARCH_PROTOCOL_GUID \
  { 0x26baccb3, 0x6f42, 0x11d4, 0xbc, 0xe7, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81 }

GUID_VARIABLE_DECLARATION(gEfiTimerArchProtocolGuid, EFI_TIMER_ARCH_PROTOCOL_GUID);

// Declare an empty structure for the Timer Architectural Protocol
typedef struct _EFI_TIMER_ARCH_PROTOCOL EFI_TIMER_ARCH_PROTOCOL;


//<AMI_PHDR_START>
//============================================================================
// Procedure Type:	EFI_TIMER_NOTIFY
//
// Description:	  The function of this type is called when a timer interrupt
//		fires.  This function executes at TPL_HIGH_LEVEL.
//
// Input:
//	  Time - Time since the last timer interrupt in 100 ns units.
//
// Output:	None
//
// Referrals:
//
//============================================================================
//<AMI_PHDR_END>
typedef
VOID
(EFIAPI *EFI_TIMER_NOTIFY) (
  IN UINT64  Time
  );


//<AMI_PHDR_START>
//============================================================================
// Procedure Type:	EFI_TIMER_REGISTER_HANDLER
//
// Description:	  The function of this type registers the notify function
//		that will be called if the timer interrupt fires
//
// Input:
//	  This - The instance of the EFI_TIMER_ARCH_PROTOCOL
//
//	  NotifyFunction - The function to call when a timer interrupt fires
//
// Output:	  EFI_SUCCESS           - The timer handler was registered.
//
// Referrals:
//
//============================================================================
//<AMI_PHDR_END>
typedef
EFI_STATUS
(EFIAPI *EFI_TIMER_REGISTER_HANDLER) (
  IN EFI_TIMER_ARCH_PROTOCOL  *This,
  IN EFI_TIMER_NOTIFY         NotifyFunction
);


//<AMI_PHDR_START>
//============================================================================
// Procedure Type:	EFI_TIMER_SET_TIMER_PERIOD
//
// Description:	  The function of this type sets the timer interrupt interval
//		based on the input value in TimerPeriod
//
// Input:
//	  This - The instance of the EFI_TIMER_ARCH_PROTOCOL
//
//		TimerPeriod - The rate to program the timer interrupt in 100 nS units.
//
// Output:	  EFI_SUCCESS           - The timer handler was registered.
//
// Referrals:
//
//============================================================================
//<AMI_PHDR_END>
typedef
EFI_STATUS
(EFIAPI *EFI_TIMER_SET_TIMER_PERIOD) (
  IN EFI_TIMER_ARCH_PROTOCOL  *This,
  IN UINT64                   TimerPeriod
  );


//<AMI_PHDR_START>
//============================================================================
// Procedure Type:	EFI_TIMER_GET_TIMER_PERIOD
//
// Description:	  The function of this type gets the timer interrupt in
//		100ns increments
//
// Input:
//	  This - The instance of the EFI_TIMER_ARCH_PROTOCOL
//
//		TimerPeriod - Pointer to the timer period in 100 nS units.
//
// Output:
//		EFI_SUCCESS           - The timer period was returned in TimerPeriod.
//		EFI_INVALID_PARAMETER - TimerPeriod is NULL.
//
// Referrals:
//
//============================================================================
//<AMI_PHDR_END>
typedef
EFI_STATUS
(EFIAPI *EFI_TIMER_GET_TIMER_PERIOD) (
  IN EFI_TIMER_ARCH_PROTOCOL  *This,
  IN UINT64                   *TimerPeriod
  );


//<AMI_PHDR_START>
//============================================================================
// Procedure Type:	EFI_TIMER_GENERATE_SOFT_INTERRUPT
//
// Description:	  The function of this type generates a soft timer interrupt
//
// Input:
//	  This - The instance of the EFI_TIMER_ARCH_PROTOCOL
//
// Output:
//		EFI_SUCCESS           - The timer period was returned in TimerPeriod.
//
// Referrals:
//
//============================================================================
//<AMI_PHDR_END>
typedef
EFI_STATUS
(EFIAPI *EFI_TIMER_GENERATE_SOFT_INTERRUPT) (
  IN EFI_TIMER_ARCH_PROTOCOL  *This
  );





// Interface for the Timer Architectural Protocol
typedef struct _EFI_TIMER_ARCH_PROTOCOL {
  EFI_TIMER_REGISTER_HANDLER        RegisterHandler;
  EFI_TIMER_SET_TIMER_PERIOD        SetTimerPeriod;
  EFI_TIMER_GET_TIMER_PERIOD        GetTimerPeriod;
  EFI_TIMER_GENERATE_SOFT_INTERRUPT	GenerateSoftInterrupt;
} EFI_TIMER_ARCH_PROTOCOL;

/****** DO NOT WRITE BELOW THIS LINE *******/
#ifdef __cplusplus
}
#endif
#endif
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2005, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**             6145-F Northbelt Pkwy, Norcross, GA 30071            **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************