]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/TianoTools/Include/Dxe/ArchProtocol/WatchdogTimer.h
1) Add byte element checking for a PCD who using byte array type datum.
[mirror_edk2.git] / Tools / Source / TianoTools / Include / Dxe / ArchProtocol / WatchdogTimer.h
CommitLineData
21b50a27 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
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
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
65 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
66 \r
67 @param NotifyFunction The function to call when the watchdog timer fires. If this\r
68 is NULL, then the handler will be unregistered.\r
69\r
70 @retval EFI_SUCCESS The watchdog timer handler was registered or\r
71 unregistered.\r
72 \r
73 @retval EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already\r
74 registered.\r
75 \r
76 @retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not\r
77 previously registered.\r
78\r
79**/\r
80typedef \r
81EFI_STATUS\r
82(EFIAPI *EFI_WATCHDOG_TIMER_REGISTER_HANDLER) (\r
83 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
84 IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction\r
85 );\r
86\r
87/**\r
88 This function sets the amount of time to wait before firing the watchdog \r
89 timer to TimerPeriod 100 nS units. If TimerPeriod is 0, then the watchdog \r
90 timer is disabled.\r
91\r
92 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
93 \r
94 @param TimerPeriod The amount of time in 100 nS units to wait before the watchdog\r
95 timer is fired. If TimerPeriod is zero, then the watchdog\r
96 timer is disabled.\r
97\r
98 @retval EFI_SUCCESS The watchdog timer has been programmed to fire in Time\r
99 100 nS units.\r
100 \r
101 @retval EFI_DEVICE_ERROR A watchdog timer could not be programmed due to a device\r
102 error.\r
103\r
104**/\r
105typedef \r
106EFI_STATUS\r
107(EFIAPI *EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD) (\r
108 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
109 IN UINT64 TimerPeriod\r
110 );\r
111\r
112/**\r
113 This function retrieves the amount of time the system will wait before firing \r
114 the watchdog timer. This period is returned in TimerPeriod, and EFI_SUCCESS \r
115 is returned. If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.\r
116\r
117 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
118 \r
119 @param TimerPeriod A pointer to the amount of time in 100 nS units that the system\r
120 will wait before the watchdog timer is fired. If TimerPeriod of\r
121 zero is returned, then the watchdog timer is disabled.\r
122\r
123 @retval EFI_SUCCESS The amount of time that the system will wait before\r
124 firing the watchdog timer was returned in TimerPeriod.\r
125 \r
126 @retval EFI_INVALID_PARAMETER TimerPeriod is NULL.\r
127\r
128**/\r
129typedef \r
130EFI_STATUS\r
131(EFIAPI *EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD) (\r
132 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
133 OUT UINT64 *TimerPeriod\r
134 );\r
135\r
136\r
137/**\r
138 Interface stucture for the Watchdog Timer Architectural Protocol.\r
139\r
140 @par Protocol Description:\r
141 This protocol provides the services required to implement the Boot Service \r
142 SetWatchdogTimer(). It provides a service to set the amount of time to wait \r
143 before firing the watchdog timer, and it also provides a service to register \r
144 a handler that is invoked when the watchdog timer fires. This protocol can \r
145 implement the watchdog timer by using the event and timer Boot Services, or \r
146 it can make use of custom hardware. When the watchdog timer fires, control \r
147 will be passed to a handler if one has been registered. If no handler has \r
148 been registered, or the registered handler returns, then the system will be \r
149 reset by calling the Runtime Service ResetSystem().\r
150\r
151 @param RegisterHandler - Registers a handler that is invoked when the watchdog \r
152 timer fires.\r
153\r
154 @param SetTimerPeriod - Sets the amount of time in 100 ns units to wait before the \r
155 watchdog timer is fired. If this function is supported, \r
156 then the watchdog timer period will be rounded up to the \r
157 nearest supported watchdog timer period.\r
158\r
159 @param GetTimerPeriod - Retrieves the amount of time in 100 ns units that the \r
160 system will wait before the watchdog timer is fired.\r
161\r
162**/\r
163struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL {\r
164 EFI_WATCHDOG_TIMER_REGISTER_HANDLER RegisterHandler;\r
165 EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD SetTimerPeriod;\r
166 EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD GetTimerPeriod;\r
167};\r
168\r
169extern EFI_GUID gEfiWatchdogTimerArchProtocolGuid;\r
170\r
171#endif\r
172\r