- // Register for an ExitBootServicesEvent\r
- Status = gBS->CreateEvent (\r
- EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
- TPL_NOTIFY,\r
- WatchdogExitBootServicesEvent,\r
- NULL,\r
- &EfiExitBootServicesEvent\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- // Install interrupt handler\r
- Status = gBS->LocateProtocol (\r
- &gHardwareInterrupt2ProtocolGuid,\r
- NULL,\r
- (VOID **)&mInterruptProtocol\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- Status = mInterruptProtocol->RegisterInterruptSource (\r
- mInterruptProtocol,\r
- FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),\r
- WatchdogInterruptHandler\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- Status = mInterruptProtocol->SetTriggerType (\r
- mInterruptProtocol,\r
- FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),\r
- EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- // Install the Timer Architectural Protocol onto a new handle\r
- Handle = NULL;\r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &Handle,\r
- &gEfiWatchdogTimerArchProtocolGuid,\r
- &gWatchdogTimer,\r
- NULL\r
- );\r
- }\r
- }\r
- }\r
+ // Install interrupt handler\r
+ Status = mInterruptProtocol->RegisterInterruptSource (mInterruptProtocol,\r
+ FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),\r
+ WatchdogInterruptHandler);\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+\r
+ Status = mInterruptProtocol->SetTriggerType (mInterruptProtocol,\r
+ FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),\r
+ EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING);\r
+ if (EFI_ERROR (Status)) {\r
+ goto UnregisterHandler;\r