]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Core/Dxe/ArchProtocol/WatchdogTimer/WatchdogTimer.h
Maintainers.txt: Remove EdkCompatibilityPkg information
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Core / Dxe / ArchProtocol / WatchdogTimer / WatchdogTimer.h
CommitLineData
3eb9473e 1/*++\r
2\r
f57387d5
HT
3Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 WatchdogTimer.h\r
15\r
16Abstract:\r
17\r
18 Watchdog Timer Architectural Protocol as defined in the DXE CIS\r
19\r
20 Used to provide system watchdog timer services\r
21\r
22--*/\r
23\r
24#ifndef _ARCH_PROTOCOL_WATCHDOG_TIMER_H_\r
25#define _ARCH_PROTOCOL_WATCHDOG_TIMER_H_\r
26\r
27//\r
28// Global ID for the Watchdog Timer Architectural Protocol\r
29//\r
30#define EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID \\r
7ccf38a3 31 { 0x665E3FF5, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }\r
3eb9473e 32\r
33//\r
34// Declare forward reference for the Timer Architectural Protocol\r
35//\r
36EFI_FORWARD_DECLARATION (EFI_WATCHDOG_TIMER_ARCH_PROTOCOL);\r
37\r
38typedef\r
39VOID\r
40(EFIAPI *EFI_WATCHDOG_TIMER_NOTIFY) (\r
41 IN UINT64 Time\r
42 );\r
43/*++\r
44\r
45Routine Description:\r
46\r
47 A function of this type is called when the watchdog timer fires if a \r
48 handler has been registered.\r
49\r
50Arguments:\r
51\r
52 Time - The time in 100 ns units that has passed since the watchdog \r
53 timer was armed. For the notify function to be called, this \r
54 must be greater than TimerPeriod.\r
55 \r
56Returns: \r
57\r
58 None.\r
59\r
60--*/\r
61\r
62typedef \r
63EFI_STATUS\r
64(EFIAPI *EFI_WATCHDOG_TIMER_REGISTER_HANDLER) (\r
65 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
66 IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction\r
67 );\r
68/*++\r
69\r
70Routine Description:\r
71\r
72 This function registers a handler that is to be invoked when the watchdog \r
73 timer fires. By default, the EFI_WATCHDOG_TIMER protocol will call the \r
74 Runtime Service ResetSystem() when the watchdog timer fires. If a \r
75 NotifyFunction is registered, then the NotifyFunction will be called before \r
76 the Runtime Service ResetSystem() is called. If NotifyFunction is NULL, then \r
77 the watchdog handler is unregistered. If a watchdog handler is registered, \r
78 then EFI_SUCCESS is returned. If an attempt is made to register a handler \r
79 when a handler is already registered, then EFI_ALREADY_STARTED is returned. \r
80 If an attempt is made to uninstall a handler when a handler is not installed, \r
81 then return EFI_INVALID_PARAMETER.\r
82\r
83Arguments:\r
84\r
85 This - The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
86\r
87 NotifyFunction - The function to call when the watchdog timer fires. If this\r
88 is NULL, then the handler will be unregistered.\r
89\r
90Returns: \r
91\r
92 EFI_SUCCESS - The watchdog timer handler was registered or \r
93 unregistered.\r
94\r
95 EFI_ALREADY_STARTED - NotifyFunction is not NULL, and a handler is already \r
96 registered.\r
97\r
98 EFI_INVALID_PARAMETER - NotifyFunction is NULL, and a handler was not \r
99 previously registered.\r
100\r
101--*/\r
102\r
103typedef \r
104EFI_STATUS\r
105(EFIAPI *EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD) (\r
106 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
107 IN UINT64 TimerPeriod\r
108 );\r
109/*++\r
110\r
111Routine Description:\r
112\r
113 This function sets the amount of time to wait before firing the watchdog \r
114 timer to TimerPeriod 100 nS units. If TimerPeriod is 0, then the watchdog \r
115 timer is disabled.\r
116\r
117Arguments:\r
118\r
119 This - The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
120\r
121 TimerPeriod - The amount of time in 100 nS units to wait before the watchdog \r
122 timer is fired. If TimerPeriod is zero, then the watchdog \r
123 timer is disabled.\r
124 \r
125Returns: \r
126\r
127 EFI_SUCCESS - The watchdog timer has been programmed to fire in Time \r
128 100 nS units.\r
129\r
130 EFI_DEVICE_ERROR - A watchdog timer could not be programmed due to a device \r
131 error.\r
132\r
133--*/\r
134\r
135typedef \r
136EFI_STATUS\r
137(EFIAPI *EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD) (\r
138 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
139 OUT UINT64 *TimerPeriod\r
140 );\r
141/*++\r
142\r
143Routine Description:\r
144\r
145 This function retrieves the amount of time the system will wait before firing \r
146 the watchdog timer. This period is returned in TimerPeriod, and EFI_SUCCESS \r
147 is returned. If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.\r
148\r
149Arguments:\r
150\r
151 This - The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
152\r
153 TimerPeriod - A pointer to the amount of time in 100 nS units that the system \r
154 will wait before the watchdog timer is fired. If TimerPeriod of\r
155 zero is returned, then the watchdog timer is disabled.\r
156 \r
157Returns: \r
158\r
159 EFI_SUCCESS - The amount of time that the system will wait before \r
160 firing the watchdog timer was returned in TimerPeriod.\r
161\r
162 EFI_INVALID_PARAMETER - TimerPeriod is NULL.\r
163\r
164--*/\r
165\r
166//\r
167// Interface stucture for the Watchdog Timer Architectural Protocol\r
168//\r
6f80bb86 169struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL {\r
3eb9473e 170 EFI_WATCHDOG_TIMER_REGISTER_HANDLER RegisterHandler;\r
171 EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD SetTimerPeriod;\r
172 EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD GetTimerPeriod;\r
6f80bb86 173};\r
3eb9473e 174\r
175/*++\r
176\r
177 Protocol Description:\r
178 This protocol provides the services required to implement the Boot Service \r
179 SetWatchdogTimer(). It provides a service to set the amount of time to wait \r
180 before firing the watchdog timer, and it also provides a service to register \r
181 a handler that is invoked when the watchdog timer fires. This protocol can \r
182 implement the watchdog timer by using the event and timer Boot Services, or \r
183 it can make use of custom hardware. When the watchdog timer fires, control \r
184 will be passed to a handler if one has been registered. If no handler has \r
185 been registered, or the registered handler returns, then the system will be \r
186 reset by calling the Runtime Service ResetSystem().\r
187 \r
188 Parameters:\r
189\r
190 RegisterHandler - Registers a handler that is invoked when the watchdog \r
191 timer fires.\r
192\r
193 SetTimerPeriod - Sets the amount of time in 100 ns units to wait before the \r
194 watchdog timer is fired. If this function is supported, \r
195 then the watchdog timer period will be rounded up to the \r
196 nearest supported watchdog timer period.\r
197\r
198 GetTimerPeriod - Retrieves the amount of time in 100 ns units that the \r
199 system will wait before the watchdog timer is fired.\r
200\r
201--*/\r
202\r
203extern EFI_GUID gEfiWatchdogTimerArchProtocolGuid;\r
204\r
205#endif\r
206\r