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