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