]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/WatchdogTimer.h
Updated headers to follow coding standard
[mirror_edk2.git] / MdePkg / Include / Protocol / WatchdogTimer.h
CommitLineData
d1f95000 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
d1f95000 15 @par Revision Reference:\r
16 Version 0.91B.\r
17\r
18**/\r
19\r
20#ifndef __ARCH_PROTOCOL_WATCHDOG_TIMER_H__\r
21#define __ARCH_PROTOCOL_WATCHDOG_TIMER_H__\r
22\r
23//\r
24// Global ID for the Watchdog Timer Architectural Protocol\r
25//\r
26#define EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID \\r
27 { 0x665E3FF5, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }\r
28\r
29//\r
30// Declare forward reference for the Timer Architectural Protocol\r
31//\r
32typedef struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL EFI_WATCHDOG_TIMER_ARCH_PROTOCOL;\r
33\r
34/**\r
35 A function of this type is called when the watchdog timer fires if a \r
36 handler has been registered.\r
37\r
38 @param Time The time in 100 ns units that has passed since the watchdog\r
39 timer was armed. For the notify function to be called, this\r
40 must be greater than TimerPeriod.\r
41\r
42 @return None.\r
43\r
44**/\r
45typedef\r
46VOID\r
47(EFIAPI *EFI_WATCHDOG_TIMER_NOTIFY) (\r
48 IN UINT64 Time\r
49 );\r
50\r
51/**\r
52 This function registers a handler that is to be invoked when the watchdog \r
53 timer fires. By default, the EFI_WATCHDOG_TIMER protocol will call the \r
54 Runtime Service ResetSystem() when the watchdog timer fires. If a \r
55 NotifyFunction is registered, then the NotifyFunction will be called before \r
56 the Runtime Service ResetSystem() is called. If NotifyFunction is NULL, then \r
57 the watchdog handler is unregistered. If a watchdog handler is registered, \r
58 then EFI_SUCCESS is returned. If an attempt is made to register a handler \r
59 when a handler is already registered, then EFI_ALREADY_STARTED is returned. \r
60 If an attempt is made to uninstall a handler when a handler is not installed, \r
61 then return EFI_INVALID_PARAMETER.\r
62\r
63 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
64 @param NotifyFunction The function to call when the watchdog timer fires. If this\r
65 is NULL, then the handler will be unregistered.\r
66\r
67 @retval EFI_SUCCESS The watchdog timer handler was registered or\r
68 unregistered.\r
69 @retval EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already\r
70 registered.\r
71 @retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not\r
72 previously registered.\r
73\r
74**/\r
75typedef \r
76EFI_STATUS\r
77(EFIAPI *EFI_WATCHDOG_TIMER_REGISTER_HANDLER) (\r
78 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
79 IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction\r
80 );\r
81\r
82/**\r
83 This function sets the amount of time to wait before firing the watchdog \r
84 timer to TimerPeriod 100 nS units. If TimerPeriod is 0, then the watchdog \r
85 timer is disabled.\r
86\r
87 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
88 @param TimerPeriod The amount of time in 100 nS units to wait before the watchdog\r
89 timer is fired. If TimerPeriod is zero, then the watchdog\r
90 timer is disabled.\r
91\r
92 @retval EFI_SUCCESS The watchdog timer has been programmed to fire in Time\r
93 100 nS units.\r
94 @retval EFI_DEVICE_ERROR A watchdog timer could not be programmed due to a device\r
95 error.\r
96\r
97**/\r
98typedef \r
99EFI_STATUS\r
100(EFIAPI *EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD) (\r
101 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
102 IN UINT64 TimerPeriod\r
103 );\r
104\r
105/**\r
106 This function retrieves the amount of time the system will wait before firing \r
107 the watchdog timer. This period is returned in TimerPeriod, and EFI_SUCCESS \r
108 is returned. If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.\r
109\r
110 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
111 @param TimerPeriod A pointer to the amount of time in 100 nS units that the system\r
112 will wait before the watchdog timer is fired. If TimerPeriod of\r
113 zero is returned, then the watchdog timer is disabled.\r
114\r
115 @retval EFI_SUCCESS The amount of time that the system will wait before\r
116 firing the watchdog timer was returned in TimerPeriod.\r
117 @retval EFI_INVALID_PARAMETER TimerPeriod is NULL.\r
118\r
119**/\r
120typedef \r
121EFI_STATUS\r
122(EFIAPI *EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD) (\r
123 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
124 OUT UINT64 *TimerPeriod\r
125 );\r
126\r
127\r
128/**\r
129 Interface stucture for the Watchdog Timer Architectural Protocol.\r
130\r
131 @par Protocol Description:\r
132 This protocol provides the services required to implement the Boot Service \r
133 SetWatchdogTimer(). It provides a service to set the amount of time to wait \r
134 before firing the watchdog timer, and it also provides a service to register \r
135 a handler that is invoked when the watchdog timer fires. This protocol can \r
136 implement the watchdog timer by using the event and timer Boot Services, or \r
137 it can make use of custom hardware. When the watchdog timer fires, control \r
138 will be passed to a handler if one has been registered. If no handler has \r
139 been registered, or the registered handler returns, then the system will be \r
140 reset by calling the Runtime Service ResetSystem().\r
141\r
142 @param RegisterHandler Registers a handler that is invoked when the watchdog\r
143 timer fires.\r
144\r
145 @param SetTimerPeriod Sets the amount of time in 100 ns units to wait before the\r
146 watchdog timer is fired. If this function is supported,\r
147 then the watchdog timer period will be rounded up to the\r
148 nearest supported watchdog timer period.\r
149\r
150 @param GetTimerPeriod Retrieves the amount of time in 100 ns units that the\r
151 system will wait before the watchdog timer is fired.\r
152\r
153**/\r
154struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL {\r
155 EFI_WATCHDOG_TIMER_REGISTER_HANDLER RegisterHandler;\r
156 EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD SetTimerPeriod;\r
157 EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD GetTimerPeriod;\r
158};\r
159\r
160extern EFI_GUID gEfiWatchdogTimerArchProtocolGuid;\r
161\r
162#endif\r
163\r