]>
Commit | Line | Data |
---|---|---|
504214c4 | 1 | /** @file\r |
de4c8a30 | 2 | \r |
504214c4 LG |
3 | The internal header file includes the common header files, defines\r |
4 | internal functions used by WatchDogTimer module. \r | |
5 | \r | |
6 | Copyright (c) 2006 - 2008, Intel Corporation \r | |
de4c8a30 | 7 | All rights reserved. This program and the accompanying materials \r |
8 | are licensed and made available under the terms and conditions of the BSD License \r | |
9 | which accompanies this distribution. The full text of the license may be found at \r | |
10 | http://opensource.org/licenses/bsd-license.php \r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
14 | \r | |
504214c4 | 15 | **/\r |
de4c8a30 | 16 | \r |
17 | #ifndef _WATCHDOG_TIMER_H_\r | |
18 | #define _WATCHDOG_TIMER_H_\r | |
19 | \r | |
ba237732 | 20 | \r |
ed7748fe | 21 | \r |
60c93673 | 22 | #include <Uefi.h>\r |
ba237732 A |
23 | #include <Library/DebugLib.h>\r |
24 | #include <Library/UefiDriverEntryPoint.h>\r | |
25 | #include <Library/ReportStatusCodeLib.h>\r | |
26 | #include <Library/UefiBootServicesTableLib.h>\r | |
27 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
28 | #include <Library/PcdLib.h>\r | |
c0d17d24 | 29 | #include <Protocol/WatchdogTimer.h>\r |
ba237732 A |
30 | \r |
31 | \r | |
36093af9 | 32 | /**\r |
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 | |
48 | @return EFI_SUCCESS The watchdog timer handler was registered or unregistered.\r | |
49 | @return EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already registered.\r | |
50 | @return EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not previously registered.\r | |
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 |
61 | This function sets the amount of time to wait before firing the watchdog\r | |
62 | timer to TimerPeriod 100 nS units. If TimerPeriod is 0, then the watchdog\r | |
63 | timer is disabled.\r | |
64 | \r | |
65 | @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r | |
66 | @param TimerPeriod The amount of time in 100 nS units to wait before the watchdog\r | |
67 | timer is fired. If TimerPeriod is zero, then the watchdog\r | |
68 | timer is disabled.\r | |
69 | \r | |
70 | @return EFI_SUCCESS The watchdog timer has been programmed to fire in Time\r | |
71 | 100 nS units.\r | |
72 | @return EFI_DEVICE_ERROR A watchdog timer could not be programmed due to a device\r | |
73 | error.\r | |
74 | \r | |
75 | **/\r | |
de4c8a30 | 76 | EFI_STATUS\r |
77 | EFIAPI\r | |
78 | WatchdogTimerDriverSetTimerPeriod (\r | |
79 | IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r | |
80 | IN UINT64 TimerPeriod\r | |
ba237732 | 81 | );\r |
de4c8a30 | 82 | \r |
36093af9 | 83 | /**\r |
84 | This function retrieves the amount of time the system will wait before firing\r | |
85 | the watchdog timer. This period is returned in TimerPeriod, and EFI_SUCCESS\r | |
86 | is returned. If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.\r | |
87 | \r | |
88 | @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r | |
89 | @param TimerPeriod A pointer to the amount of time in 100 nS units that the system\r | |
90 | will wait before the watchdog timer is fired. If TimerPeriod of\r | |
91 | zero is returned, then the watchdog timer is disabled.\r | |
92 | \r | |
93 | @return EFI_SUCCESS The amount of time that the system will wait before\r | |
94 | firing the watchdog timer was returned in TimerPeriod.\r | |
95 | @return EFI_INVALID_PARAMETER TimerPeriod is NULL.\r | |
96 | \r | |
97 | **/\r | |
de4c8a30 | 98 | EFI_STATUS\r |
99 | EFIAPI\r | |
100 | WatchdogTimerDriverGetTimerPeriod (\r | |
101 | IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r | |
102 | IN UINT64 *TimerPeriod\r | |
ba237732 | 103 | );\r |
de4c8a30 | 104 | \r |
36093af9 | 105 | /**\r |
106 | Initialize the Watchdog Timer Architectural Protocol driver.\r | |
107 | \r | |
108 | @param ImageHandle ImageHandle of the loaded driver.\r | |
109 | @param SystemTable Pointer to the System Table.\r | |
110 | \r | |
111 | @return EFI_SUCCESS Timer Architectural Protocol created.\r | |
112 | \r | |
113 | **/\r | |
de4c8a30 | 114 | EFI_STATUS\r |
115 | EFIAPI\r | |
116 | WatchdogTimerDriverInitialize (\r | |
117 | IN EFI_HANDLE ImageHandle,\r | |
118 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
ba237732 | 119 | );\r |
de4c8a30 | 120 | \r |
121 | #endif\r |