]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.h
MdeModulePkg/Ip4Dxe: Clean up IP4 interface if failed to open ARP protocol.
[mirror_edk2.git] / MdeModulePkg / Universal / WatchdogTimerDxe / WatchdogTimer.h
... / ...
CommitLineData
1/** @file\r
2 The internal include file for WatchDogTimer module. \r
3\r
4Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials \r
6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php \r
9 \r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
13**/\r
14\r
15#ifndef _WATCHDOG_TIMER_H_\r
16#define _WATCHDOG_TIMER_H_\r
17\r
18\r
19\r
20#include <Uefi.h>\r
21#include <Library/DebugLib.h>\r
22#include <Library/UefiDriverEntryPoint.h>\r
23#include <Library/ReportStatusCodeLib.h>\r
24#include <Library/UefiBootServicesTableLib.h>\r
25#include <Library/UefiRuntimeServicesTableLib.h>\r
26#include <Protocol/WatchdogTimer.h>\r
27\r
28\r
29/**\r
30 Registers a handler that is to be invoked when the watchdog timer fires.\r
31\r
32 This function registers a handler that is to be invoked when the watchdog\r
33 timer fires. By default, the EFI_WATCHDOG_TIMER protocol will call the\r
34 Runtime Service ResetSystem() when the watchdog timer fires. If a\r
35 NotifyFunction is registered, then the NotifyFunction will be called before\r
36 the Runtime Service ResetSystem() is called. If NotifyFunction is NULL, then\r
37 the watchdog handler is unregistered. If a watchdog handler is registered,\r
38 then EFI_SUCCESS is returned. If an attempt is made to register a handler\r
39 when a handler is already registered, then EFI_ALREADY_STARTED is returned.\r
40 If an attempt is made to uninstall a handler when a handler is not installed,\r
41 then return EFI_INVALID_PARAMETER.\r
42\r
43 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
44 @param NotifyFunction The function to call when the watchdog timer fires. If this\r
45 is NULL, then the handler will be unregistered.\r
46\r
47 @retval EFI_SUCCESS The watchdog timer handler was registered or unregistered.\r
48 @retval EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already registered.\r
49 @retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not previously registered.\r
50\r
51**/\r
52EFI_STATUS\r
53EFIAPI\r
54WatchdogTimerDriverRegisterHandler (\r
55 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
56 IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction\r
57 );\r
58\r
59/**\r
60 Sets the amount of time in the future to fire the watchdog timer.\r
61\r
62 This function sets the amount of time to wait before firing the watchdog\r
63 timer to TimerPeriod 100 ns units. If TimerPeriod is 0, then the watchdog\r
64 timer is disabled.\r
65\r
66 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
67 @param TimerPeriod The amount of time in 100 ns units to wait before the watchdog\r
68 timer is fired. If TimerPeriod is zero, then the watchdog\r
69 timer is disabled.\r
70\r
71 @retval EFI_SUCCESS The watchdog timer has been programmed to fire in Time\r
72 100 ns units.\r
73 @retval EFI_DEVICE_ERROR A watchdog timer could not be programmed due to a device\r
74 error.\r
75\r
76**/\r
77EFI_STATUS\r
78EFIAPI\r
79WatchdogTimerDriverSetTimerPeriod (\r
80 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
81 IN UINT64 TimerPeriod\r
82 );\r
83\r
84/**\r
85 Retrieves the amount of time in 100 ns units that the system will wait before firing the watchdog timer.\r
86\r
87 This function retrieves the amount of time the system will wait before firing\r
88 the watchdog timer. This period is returned in TimerPeriod, and EFI_SUCCESS\r
89 is returned. If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.\r
90\r
91 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
92 @param TimerPeriod A pointer to the amount of time in 100 ns units that the system\r
93 will wait before the watchdog timer is fired. If TimerPeriod of\r
94 zero is returned, then the watchdog timer is disabled.\r
95\r
96 @retval EFI_SUCCESS The amount of time that the system will wait before\r
97 firing the watchdog timer was returned in TimerPeriod.\r
98 @retval EFI_INVALID_PARAMETER TimerPeriod is NULL.\r
99\r
100**/\r
101EFI_STATUS\r
102EFIAPI\r
103WatchdogTimerDriverGetTimerPeriod (\r
104 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
105 IN UINT64 *TimerPeriod\r
106 );\r
107\r
108#endif\r