]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.h
sync comments, fix function header, rename variable name to follow coding style.
[mirror_edk2.git] / MdeModulePkg / Universal / WatchdogTimerDxe / WatchdogTimer.h
1 /** @file
2
3 The internal header file includes the common header files, defines
4 internal functions used by WatchDogTimer module.
5
6 Copyright (c) 2006 - 2008, 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
11
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.
14
15 **/
16
17 #ifndef _WATCHDOG_TIMER_H_
18 #define _WATCHDOG_TIMER_H_
19
20
21
22 #include <Uefi.h>
23 #include <Library/DebugLib.h>
24 #include <Library/UefiDriverEntryPoint.h>
25 #include <Library/ReportStatusCodeLib.h>
26 #include <Library/UefiBootServicesTableLib.h>
27 #include <Library/UefiRuntimeServicesTableLib.h>
28 #include <Library/PcdLib.h>
29 #include <Protocol/WatchdogTimer.h>
30
31
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 @return EFI_SUCCESS The watchdog timer handler was registered or unregistered.
49 @return EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already registered.
50 @return 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 This function sets the amount of time to wait before firing the watchdog
62 timer to TimerPeriod 100 nS units. If TimerPeriod is 0, then the watchdog
63 timer is disabled.
64
65 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
66 @param TimerPeriod The amount of time in 100 nS units to wait before the watchdog
67 timer is fired. If TimerPeriod is zero, then the watchdog
68 timer is disabled.
69
70 @return EFI_SUCCESS The watchdog timer has been programmed to fire in Time
71 100 nS units.
72 @return EFI_DEVICE_ERROR A watchdog timer could not be programmed due to a device
73 error.
74
75 **/
76 EFI_STATUS
77 EFIAPI
78 WatchdogTimerDriverSetTimerPeriod (
79 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
80 IN UINT64 TimerPeriod
81 );
82
83 /**
84 This function retrieves the amount of time the system will wait before firing
85 the watchdog timer. This period is returned in TimerPeriod, and EFI_SUCCESS
86 is returned. If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.
87
88 @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
89 @param TimerPeriod A pointer to the amount of time in 100 nS units that the system
90 will wait before the watchdog timer is fired. If TimerPeriod of
91 zero is returned, then the watchdog timer is disabled.
92
93 @return EFI_SUCCESS The amount of time that the system will wait before
94 firing the watchdog timer was returned in TimerPeriod.
95 @return EFI_INVALID_PARAMETER TimerPeriod is NULL.
96
97 **/
98 EFI_STATUS
99 EFIAPI
100 WatchdogTimerDriverGetTimerPeriod (
101 IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
102 IN UINT64 *TimerPeriod
103 );
104
105 /**
106 Initialize the Watchdog Timer Architectural Protocol driver.
107
108 @param ImageHandle ImageHandle of the loaded driver.
109 @param SystemTable Pointer to the System Table.
110
111 @return EFI_SUCCESS Timer Architectural Protocol created.
112
113 **/
114 EFI_STATUS
115 EFIAPI
116 WatchdogTimerDriverInitialize (
117 IN EFI_HANDLE ImageHandle,
118 IN EFI_SYSTEM_TABLE *SystemTable
119 );
120
121 #endif