TianoCore EDK2 master
Loading...
Searching...
No Matches
SetWatchdogTimer.c
Go to the documentation of this file.
1
9#include "DxeMain.h"
10
11#define WATCHDOG_TIMER_CALIBRATE_PER_SECOND 10000000
12
36EFIAPI
38 IN UINTN Timeout,
39 IN UINT64 WatchdogCode,
40 IN UINTN DataSize,
41 IN CHAR16 *WatchdogData OPTIONAL
42 )
43{
44 EFI_STATUS Status;
45
46 //
47 // Check our architectural protocol
48 //
49 if (gWatchdogTimer == NULL) {
51 }
52
53 //
54 // Attempt to set the timeout
55 //
56 Status = gWatchdogTimer->SetTimerPeriod (gWatchdogTimer, MultU64x32 (Timeout, WATCHDOG_TIMER_CALIBRATE_PER_SECOND));
57
58 //
59 // Check for errors
60 //
61 if (EFI_ERROR (Status)) {
62 return EFI_DEVICE_ERROR;
63 }
64
65 return EFI_SUCCESS;
66}
UINT64 UINTN
UINT64 EFIAPI MultU64x32(IN UINT64 Multiplicand, IN UINT32 Multiplier)
Definition: MultU64x32.c:27
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
#define EFI_NOT_AVAILABLE_YET
Definition: PiMultiPhase.h:54
EFI_STATUS EFIAPI CoreSetWatchdogTimer(IN UINTN Timeout, IN UINT64 WatchdogCode, IN UINTN DataSize, IN CHAR16 *WatchdogData OPTIONAL)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112