]>
Commit | Line | Data |
---|---|---|
504214c4 | 1 | /** @file\r |
d1102dba LG |
2 | The internal include file for WatchDogTimer module.\r |
3 | \r | |
4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
9d510e61 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
de4c8a30 | 6 | \r |
504214c4 | 7 | **/\r |
de4c8a30 | 8 | \r |
9 | #ifndef _WATCHDOG_TIMER_H_\r | |
10 | #define _WATCHDOG_TIMER_H_\r | |
11 | \r | |
ba237732 | 12 | \r |
ed7748fe | 13 | \r |
60c93673 | 14 | #include <Uefi.h>\r |
ba237732 A |
15 | #include <Library/DebugLib.h>\r |
16 | #include <Library/UefiDriverEntryPoint.h>\r | |
17 | #include <Library/ReportStatusCodeLib.h>\r | |
18 | #include <Library/UefiBootServicesTableLib.h>\r | |
19 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
c0d17d24 | 20 | #include <Protocol/WatchdogTimer.h>\r |
ba237732 A |
21 | \r |
22 | \r | |
36093af9 | 23 | /**\r |
96437c90 | 24 | Registers a handler that is to be invoked when the watchdog timer fires.\r |
25 | \r | |
36093af9 | 26 | This function registers a handler that is to be invoked when the watchdog\r |
27 | timer fires. By default, the EFI_WATCHDOG_TIMER protocol will call the\r | |
28 | Runtime Service ResetSystem() when the watchdog timer fires. If a\r | |
29 | NotifyFunction is registered, then the NotifyFunction will be called before\r | |
30 | the Runtime Service ResetSystem() is called. If NotifyFunction is NULL, then\r | |
31 | the watchdog handler is unregistered. If a watchdog handler is registered,\r | |
32 | then EFI_SUCCESS is returned. If an attempt is made to register a handler\r | |
33 | when a handler is already registered, then EFI_ALREADY_STARTED is returned.\r | |
34 | If an attempt is made to uninstall a handler when a handler is not installed,\r | |
35 | then return EFI_INVALID_PARAMETER.\r | |
36 | \r | |
37 | @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r | |
38 | @param NotifyFunction The function to call when the watchdog timer fires. If this\r | |
39 | is NULL, then the handler will be unregistered.\r | |
40 | \r | |
96437c90 | 41 | @retval EFI_SUCCESS The watchdog timer handler was registered or unregistered.\r |
42 | @retval EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already registered.\r | |
43 | @retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not previously registered.\r | |
36093af9 | 44 | \r |
45 | **/\r | |
de4c8a30 | 46 | EFI_STATUS\r |
47 | EFIAPI\r | |
48 | WatchdogTimerDriverRegisterHandler (\r | |
49 | IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r | |
50 | IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction\r | |
ba237732 | 51 | );\r |
de4c8a30 | 52 | \r |
36093af9 | 53 | /**\r |
96437c90 | 54 | Sets the amount of time in the future to fire the watchdog timer.\r |
55 | \r | |
36093af9 | 56 | This function sets the amount of time to wait before firing the watchdog\r |
96437c90 | 57 | timer to TimerPeriod 100 ns units. If TimerPeriod is 0, then the watchdog\r |
36093af9 | 58 | timer is disabled.\r |
59 | \r | |
60 | @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r | |
96437c90 | 61 | @param TimerPeriod The amount of time in 100 ns units to wait before the watchdog\r |
36093af9 | 62 | timer is fired. If TimerPeriod is zero, then the watchdog\r |
63 | timer is disabled.\r | |
64 | \r | |
96437c90 | 65 | @retval EFI_SUCCESS The watchdog timer has been programmed to fire in Time\r |
66 | 100 ns units.\r | |
67 | @retval EFI_DEVICE_ERROR A watchdog timer could not be programmed due to a device\r | |
36093af9 | 68 | error.\r |
69 | \r | |
70 | **/\r | |
de4c8a30 | 71 | EFI_STATUS\r |
72 | EFIAPI\r | |
73 | WatchdogTimerDriverSetTimerPeriod (\r | |
74 | IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r | |
75 | IN UINT64 TimerPeriod\r | |
ba237732 | 76 | );\r |
de4c8a30 | 77 | \r |
36093af9 | 78 | /**\r |
96437c90 | 79 | Retrieves the amount of time in 100 ns units that the system will wait before firing the watchdog timer.\r |
80 | \r | |
36093af9 | 81 | This function retrieves the amount of time the system will wait before firing\r |
82 | the watchdog timer. This period is returned in TimerPeriod, and EFI_SUCCESS\r | |
83 | is returned. If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.\r | |
84 | \r | |
85 | @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r | |
96437c90 | 86 | @param TimerPeriod A pointer to the amount of time in 100 ns units that the system\r |
36093af9 | 87 | will wait before the watchdog timer is fired. If TimerPeriod of\r |
88 | zero is returned, then the watchdog timer is disabled.\r | |
89 | \r | |
96437c90 | 90 | @retval EFI_SUCCESS The amount of time that the system will wait before\r |
36093af9 | 91 | firing the watchdog timer was returned in TimerPeriod.\r |
96437c90 | 92 | @retval EFI_INVALID_PARAMETER TimerPeriod is NULL.\r |
36093af9 | 93 | \r |
94 | **/\r | |
de4c8a30 | 95 | EFI_STATUS\r |
96 | EFIAPI\r | |
97 | WatchdogTimerDriverGetTimerPeriod (\r | |
98 | IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r | |
99 | IN UINT64 *TimerPeriod\r | |
ba237732 | 100 | );\r |
de4c8a30 | 101 | \r |
de4c8a30 | 102 | #endif\r |