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