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