2 Watchdog Timer Architectural Protocol as defined in the DXE CIS
4 Used to provide system watchdog timer services
6 Copyright (c) 2006, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 Module Name: WatchdogTimer.h
17 @par Revision Reference:
22 #ifndef __ARCH_PROTOCOL_WATCHDOG_TIMER_H__
23 #define __ARCH_PROTOCOL_WATCHDOG_TIMER_H__
26 // Global ID for the Watchdog Timer Architectural Protocol
28 #define EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID \
29 { 0x665E3FF5, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }
32 // Declare forward reference for the Timer Architectural Protocol
34 typedef struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
;
37 A function of this type is called when the watchdog timer fires if a
38 handler has been registered.
40 @param Time The time in 100 ns units that has passed since the watchdog
41 timer was armed. For the notify function to be called, this
42 must be greater than TimerPeriod.
49 (EFIAPI
*EFI_WATCHDOG_TIMER_NOTIFY
) (
54 This function registers a handler that is to be invoked when the watchdog
55 timer fires. By default, the EFI_WATCHDOG_TIMER protocol will call the
56 Runtime Service ResetSystem() when the watchdog timer fires. If a
57 NotifyFunction is registered, then the NotifyFunction will be called before
58 the Runtime Service ResetSystem() is called. If NotifyFunction is NULL, then
59 the watchdog handler is unregistered. If a watchdog handler is registered,
60 then EFI_SUCCESS is returned. If an attempt is made to register a handler
61 when a handler is already registered, then EFI_ALREADY_STARTED is returned.
62 If an attempt is made to uninstall a handler when a handler is not installed,
63 then return EFI_INVALID_PARAMETER.
65 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
66 @param NotifyFunction The function to call when the watchdog timer fires. If this
67 is NULL, then the handler will be unregistered.
69 @retval EFI_SUCCESS The watchdog timer handler was registered or
71 @retval EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already
73 @retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not
74 previously registered.
79 (EFIAPI
*EFI_WATCHDOG_TIMER_REGISTER_HANDLER
) (
80 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
*This
,
81 IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction
85 This function sets the amount of time to wait before firing the watchdog
86 timer to TimerPeriod 100 nS units. If TimerPeriod is 0, then the watchdog
89 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
90 @param TimerPeriod The amount of time in 100 nS units to wait before the watchdog
91 timer is fired. If TimerPeriod is zero, then the watchdog
94 @retval EFI_SUCCESS The watchdog timer has been programmed to fire in Time
96 @retval EFI_DEVICE_ERROR A watchdog timer could not be programmed due to a device
102 (EFIAPI
*EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD
) (
103 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
*This
,
104 IN UINT64 TimerPeriod
108 This function retrieves the amount of time the system will wait before firing
109 the watchdog timer. This period is returned in TimerPeriod, and EFI_SUCCESS
110 is returned. If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.
112 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
113 @param TimerPeriod A pointer to the amount of time in 100 nS units that the system
114 will wait before the watchdog timer is fired. If TimerPeriod of
115 zero is returned, then the watchdog timer is disabled.
117 @retval EFI_SUCCESS The amount of time that the system will wait before
118 firing the watchdog timer was returned in TimerPeriod.
119 @retval EFI_INVALID_PARAMETER TimerPeriod is NULL.
124 (EFIAPI
*EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD
) (
125 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
*This
,
126 OUT UINT64
*TimerPeriod
131 Interface stucture for the Watchdog Timer Architectural Protocol.
133 @par Protocol Description:
134 This protocol provides the services required to implement the Boot Service
135 SetWatchdogTimer(). It provides a service to set the amount of time to wait
136 before firing the watchdog timer, and it also provides a service to register
137 a handler that is invoked when the watchdog timer fires. This protocol can
138 implement the watchdog timer by using the event and timer Boot Services, or
139 it can make use of custom hardware. When the watchdog timer fires, control
140 will be passed to a handler if one has been registered. If no handler has
141 been registered, or the registered handler returns, then the system will be
142 reset by calling the Runtime Service ResetSystem().
144 @param RegisterHandler Registers a handler that is invoked when the watchdog
147 @param SetTimerPeriod Sets the amount of time in 100 ns units to wait before the
148 watchdog timer is fired. If this function is supported,
149 then the watchdog timer period will be rounded up to the
150 nearest supported watchdog timer period.
152 @param GetTimerPeriod Retrieves the amount of time in 100 ns units that the
153 system will wait before the watchdog timer is fired.
156 struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
{
157 EFI_WATCHDOG_TIMER_REGISTER_HANDLER RegisterHandler
;
158 EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD SetTimerPeriod
;
159 EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD GetTimerPeriod
;
162 extern EFI_GUID gEfiWatchdogTimerArchProtocolGuid
;