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