\r
/* The number of 100ns periods (the unit of time passed to these functions)\r
in a second */\r
-#define TIME_UNITS_PER_SECOND 10000000\r
+#define TIME_UNITS_PER_SECOND 10000000\r
\r
// Tick frequency of the generic timer basis of the generic watchdog.\r
-STATIC UINTN mTimerFrequencyHz = 0;\r
+STATIC UINTN mTimerFrequencyHz = 0;\r
\r
/* In cases where the compare register was set manually, information about\r
how long the watchdog was asked to wait cannot be retrieved from hardware.\r
It is therefore stored here. 0 means the timer is not running. */\r
-STATIC UINT64 mNumTimerTicks = 0;\r
+STATIC UINT64 mNumTimerTicks = 0;\r
\r
-STATIC EFI_HARDWARE_INTERRUPT2_PROTOCOL *mInterruptProtocol;\r
-STATIC EFI_WATCHDOG_TIMER_NOTIFY mWatchdogNotify;\r
+STATIC EFI_HARDWARE_INTERRUPT2_PROTOCOL *mInterruptProtocol;\r
+STATIC EFI_WATCHDOG_TIMER_NOTIFY mWatchdogNotify;\r
\r
STATIC\r
VOID\r
VOID\r
EFIAPI\r
WatchdogInterruptHandler (\r
- IN HARDWARE_INTERRUPT_SOURCE Source,\r
- IN EFI_SYSTEM_CONTEXT SystemContext\r
+ IN HARDWARE_INTERRUPT_SOURCE Source,\r
+ IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
- STATIC CONST CHAR16 ResetString[]= L"The generic watchdog timer ran out.";\r
- UINT64 TimerPeriod;\r
+ STATIC CONST CHAR16 ResetString[] = L"The generic watchdog timer ran out.";\r
+ UINT64 TimerPeriod;\r
\r
WatchdogDisable ();\r
\r
mWatchdogNotify (TimerPeriod + 1);\r
}\r
\r
- gRT->ResetSystem (EfiResetCold, EFI_TIMEOUT, StrSize (ResetString),\r
- (CHAR16 *)ResetString);\r
+ gRT->ResetSystem (\r
+ EfiResetCold,\r
+ EFI_TIMEOUT,\r
+ StrSize (ResetString),\r
+ (CHAR16 *)ResetString\r
+ );\r
\r
// If we got here then the reset didn't work\r
ASSERT (FALSE);\r
EFI_STATUS\r
EFIAPI\r
WatchdogRegisterHandler (\r
- IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
- IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction\r
+ IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
+ IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction\r
)\r
{\r
- if (mWatchdogNotify == NULL && NotifyFunction == NULL) {\r
+ if ((mWatchdogNotify == NULL) && (NotifyFunction == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if (mWatchdogNotify != NULL && NotifyFunction != NULL) {\r
+ if ((mWatchdogNotify != NULL) && (NotifyFunction != NULL)) {\r
return EFI_ALREADY_STARTED;\r
}\r
\r
EFI_STATUS\r
EFIAPI\r
WatchdogSetTimerPeriod (\r
- IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
- IN UINT64 TimerPeriod // In 100ns units\r
+ IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
+ IN UINT64 TimerPeriod // In 100ns units\r
)\r
{\r
- UINTN SystemCount;\r
+ UINTN SystemCount;\r
\r
// if TimerPeriod is 0, this is a request to stop the watchdog.\r
if (TimerPeriod == 0) {\r
EFI_STATUS\r
EFIAPI\r
WatchdogGetTimerPeriod (\r
- IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
- OUT UINT64 *TimerPeriod\r
+ IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,\r
+ OUT UINT64 *TimerPeriod\r
)\r
{\r
if (TimerPeriod == NULL) {\r
Retrieves the period of the timer interrupt in 100ns units.\r
\r
**/\r
-STATIC EFI_WATCHDOG_TIMER_ARCH_PROTOCOL mWatchdogTimer = {\r
+STATIC EFI_WATCHDOG_TIMER_ARCH_PROTOCOL mWatchdogTimer = {\r
WatchdogRegisterHandler,\r
WatchdogSetTimerPeriod,\r
WatchdogGetTimerPeriod\r
};\r
\r
-STATIC EFI_EVENT mEfiExitBootServicesEvent;\r
+STATIC EFI_EVENT mEfiExitBootServicesEvent;\r
\r
EFI_STATUS\r
EFIAPI\r
GenericWatchdogEntry (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_HANDLE Handle;\r
-\r
- Status = gBS->LocateProtocol (&gHardwareInterrupt2ProtocolGuid, NULL,\r
- (VOID **)&mInterruptProtocol);\r
+ EFI_STATUS Status;\r
+ EFI_HANDLE Handle;\r
+\r
+ Status = gBS->LocateProtocol (\r
+ &gHardwareInterrupt2ProtocolGuid,\r
+ NULL,\r
+ (VOID **)&mInterruptProtocol\r
+ );\r
ASSERT_EFI_ERROR (Status);\r
\r
/* Make sure the Watchdog Timer Architectural Protocol has not been installed\r
ASSERT (mTimerFrequencyHz != 0);\r
\r
// Install interrupt handler\r
- Status = mInterruptProtocol->RegisterInterruptSource (mInterruptProtocol,\r
+ Status = mInterruptProtocol->RegisterInterruptSource (\r
+ mInterruptProtocol,\r
FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),\r
- WatchdogInterruptHandler);\r
+ WatchdogInterruptHandler\r
+ );\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
\r
- Status = mInterruptProtocol->SetTriggerType (mInterruptProtocol,\r
+ Status = mInterruptProtocol->SetTriggerType (\r
+ mInterruptProtocol,\r
FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),\r
- EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING);\r
+ EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING\r
+ );\r
if (EFI_ERROR (Status)) {\r
goto UnregisterHandler;\r
}\r
\r
// Install the Timer Architectural Protocol onto a new handle\r
Handle = NULL;\r
- Status = gBS->InstallMultipleProtocolInterfaces (&Handle,\r
- &gEfiWatchdogTimerArchProtocolGuid, &mWatchdogTimer,\r
- NULL);\r
+ Status = gBS->InstallMultipleProtocolInterfaces (\r
+ &Handle,\r
+ &gEfiWatchdogTimerArchProtocolGuid,\r
+ &mWatchdogTimer,\r
+ NULL\r
+ );\r
if (EFI_ERROR (Status)) {\r
goto UnregisterHandler;\r
}\r
\r
// Register for an ExitBootServicesEvent\r
- Status = gBS->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY,\r
- WatchdogExitBootServicesEvent, NULL,\r
- &mEfiExitBootServicesEvent);\r
+ Status = gBS->CreateEvent (\r
+ EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
+ TPL_NOTIFY,\r
+ WatchdogExitBootServicesEvent,\r
+ NULL,\r
+ &mEfiExitBootServicesEvent\r
+ );\r
ASSERT_EFI_ERROR (Status);\r
\r
mNumTimerTicks = 0;\r
\r
UnregisterHandler:\r
// Unregister the handler\r
- mInterruptProtocol->RegisterInterruptSource (mInterruptProtocol,\r
+ mInterruptProtocol->RegisterInterruptSource (\r
+ mInterruptProtocol,\r
FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),\r
- NULL);\r
+ NULL\r
+ );\r
return Status;\r
}\r