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 @par Revision Reference:
20 #ifndef __ARCH_PROTOCOL_WATCHDOG_TIMER_H__
21 #define __ARCH_PROTOCOL_WATCHDOG_TIMER_H__
24 // Global ID for the Watchdog Timer Architectural Protocol
26 #define EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID \
27 { 0x665E3FF5, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }
30 // Declare forward reference for the Timer Architectural Protocol
32 typedef struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
;
35 A function of this type is called when the watchdog timer fires if a
36 handler has been registered.
38 @param Time The time in 100 ns units that has passed since the watchdog
39 timer was armed. For the notify function to be called, this
40 must be greater than TimerPeriod.
47 (EFIAPI
*EFI_WATCHDOG_TIMER_NOTIFY
) (
52 This function registers a handler that is to be invoked when the watchdog
53 timer fires. By default, the EFI_WATCHDOG_TIMER protocol will call the
54 Runtime Service ResetSystem() when the watchdog timer fires. If a
55 NotifyFunction is registered, then the NotifyFunction will be called before
56 the Runtime Service ResetSystem() is called. If NotifyFunction is NULL, then
57 the watchdog handler is unregistered. If a watchdog handler is registered,
58 then EFI_SUCCESS is returned. If an attempt is made to register a handler
59 when a handler is already registered, then EFI_ALREADY_STARTED is returned.
60 If an attempt is made to uninstall a handler when a handler is not installed,
61 then return EFI_INVALID_PARAMETER.
63 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
64 @param NotifyFunction The function to call when the watchdog timer fires. If this
65 is NULL, then the handler will be unregistered.
67 @retval EFI_SUCCESS The watchdog timer handler was registered or
69 @retval EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already
71 @retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not
72 previously registered.
77 (EFIAPI
*EFI_WATCHDOG_TIMER_REGISTER_HANDLER
) (
78 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
*This
,
79 IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction
83 This function sets the amount of time to wait before firing the watchdog
84 timer to TimerPeriod 100 nS units. If TimerPeriod is 0, then the watchdog
87 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
88 @param TimerPeriod The amount of time in 100 nS units to wait before the watchdog
89 timer is fired. If TimerPeriod is zero, then the watchdog
92 @retval EFI_SUCCESS The watchdog timer has been programmed to fire in Time
94 @retval EFI_DEVICE_ERROR A watchdog timer could not be programmed due to a device
100 (EFIAPI
*EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD
) (
101 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
*This
,
102 IN UINT64 TimerPeriod
106 This function retrieves the amount of time the system will wait before firing
107 the watchdog timer. This period is returned in TimerPeriod, and EFI_SUCCESS
108 is returned. If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.
110 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
111 @param TimerPeriod A pointer to the amount of time in 100 nS units that the system
112 will wait before the watchdog timer is fired. If TimerPeriod of
113 zero is returned, then the watchdog timer is disabled.
115 @retval EFI_SUCCESS The amount of time that the system will wait before
116 firing the watchdog timer was returned in TimerPeriod.
117 @retval EFI_INVALID_PARAMETER TimerPeriod is NULL.
122 (EFIAPI
*EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD
) (
123 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
*This
,
124 OUT UINT64
*TimerPeriod
129 Interface stucture for the Watchdog Timer Architectural Protocol.
131 @par Protocol Description:
132 This protocol provides the services required to implement the Boot Service
133 SetWatchdogTimer(). It provides a service to set the amount of time to wait
134 before firing the watchdog timer, and it also provides a service to register
135 a handler that is invoked when the watchdog timer fires. This protocol can
136 implement the watchdog timer by using the event and timer Boot Services, or
137 it can make use of custom hardware. When the watchdog timer fires, control
138 will be passed to a handler if one has been registered. If no handler has
139 been registered, or the registered handler returns, then the system will be
140 reset by calling the Runtime Service ResetSystem().
142 @param RegisterHandler Registers a handler that is invoked when the watchdog
145 @param SetTimerPeriod Sets the amount of time in 100 ns units to wait before the
146 watchdog timer is fired. If this function is supported,
147 then the watchdog timer period will be rounded up to the
148 nearest supported watchdog timer period.
150 @param GetTimerPeriod Retrieves the amount of time in 100 ns units that the
151 system will wait before the watchdog timer is fired.
154 struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
{
155 EFI_WATCHDOG_TIMER_REGISTER_HANDLER RegisterHandler
;
156 EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD SetTimerPeriod
;
157 EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD GetTimerPeriod
;
160 extern EFI_GUID gEfiWatchdogTimerArchProtocolGuid
;