\r
**/\r
\r
-\r
#include <PiDxe.h>\r
\r
#include <Library/BaseLib.h>\r
VOID\r
EFIAPI\r
SP805InterruptHandler (\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
SP805Unlock ();\r
EFI_STATUS\r
EFIAPI\r
SP805RegisterHandler (\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
SP805SetTimerPeriod (\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
EFI_STATUS Status;\r
EFI_STATUS\r
EFIAPI\r
SP805GetTimerPeriod (\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 100 nS units.\r
\r
**/\r
-STATIC EFI_WATCHDOG_TIMER_ARCH_PROTOCOL mWatchdogTimer = {\r
+STATIC EFI_WATCHDOG_TIMER_ARCH_PROTOCOL mWatchdogTimer = {\r
SP805RegisterHandler,\r
SP805SetTimerPeriod,\r
SP805GetTimerPeriod\r
EFI_STATUS\r
EFIAPI\r
SP805Initialize (\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
// Find the interrupt controller protocol. ASSERT if not found.\r
- Status = gBS->LocateProtocol (&gHardwareInterruptProtocolGuid, NULL,\r
- (VOID **)&mInterrupt);\r
+ Status = gBS->LocateProtocol (\r
+ &gHardwareInterruptProtocolGuid,\r
+ NULL,\r
+ (VOID **)&mInterrupt\r
+ );\r
ASSERT_EFI_ERROR (Status);\r
\r
// Unlock access to the SP805 registers\r
SP805Lock ();\r
\r
if (PcdGet32 (PcdSP805WatchdogInterrupt) > 0) {\r
- Status = mInterrupt->RegisterInterruptSource (mInterrupt,\r
+ Status = mInterrupt->RegisterInterruptSource (\r
+ mInterrupt,\r
PcdGet32 (PcdSP805WatchdogInterrupt),\r
- SP805InterruptHandler);\r
+ SP805InterruptHandler\r
+ );\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((DEBUG_ERROR, "%a: failed to register watchdog interrupt - %r\n",\r
- __FUNCTION__, Status));\r
+ DEBUG ((\r
+ DEBUG_ERROR,\r
+ "%a: failed to register watchdog interrupt - %r\n",\r
+ __FUNCTION__,\r
+ Status\r
+ ));\r
return Status;\r
}\r
} else {\r
- DEBUG ((DEBUG_WARN, "%a: no interrupt specified, running in RESET mode only\n",\r
- __FUNCTION__));\r
+ DEBUG ((\r
+ DEBUG_WARN,\r
+ "%a: no interrupt specified, running in RESET mode only\n",\r
+ __FUNCTION__\r
+ ));\r
}\r
\r
//\r
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiWatchdogTimerArchProtocolGuid);\r
\r
// Register for an ExitBootServicesEvent\r
- Status = gBS->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY,\r
- ExitBootServicesEvent, NULL, &mEfiExitBootServicesEvent);\r
+ Status = gBS->CreateEvent (\r
+ EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
+ TPL_NOTIFY,\r
+ ExitBootServicesEvent,\r
+ NULL,\r
+ &mEfiExitBootServicesEvent\r
+ );\r
if (EFI_ERROR (Status)) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto EXIT;\r
Handle = NULL;\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
&Handle,\r
- &gEfiWatchdogTimerArchProtocolGuid, &mWatchdogTimer,\r
+ &gEfiWatchdogTimerArchProtocolGuid,\r
+ &mWatchdogTimer,\r
NULL\r
);\r
if (EFI_ERROR (Status)) {\r