]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/ArmGic: Move RegisterInterruptSource() to the common GicDxe file
authorOlivier Martin <olivier.martin@arm.com>
Fri, 4 Jul 2014 11:26:33 +0000 (11:26 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 4 Jul 2014 11:26:33 +0000 (11:26 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15624 6f19259b-4bc3-4df7-8a09-765794883524

ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c
ArmPkg/Drivers/ArmGic/ArmGicDxe.c
ArmPkg/Drivers/ArmGic/ArmGicDxe.h

index 346d0bc7c95aec0812d049f62af1deadb886de5f..a9ccef5e1c9a1dde987b9ed8112f34b210606bf7 100644 (file)
@@ -43,6 +43,48 @@ UINTN mGicNumInterrupts                 = 0;
 \r
 HARDWARE_INTERRUPT_HANDLER  *gRegisteredInterruptHandlers = NULL;\r
 \r
+/**\r
+  Register Handler for the specified interrupt source.\r
+\r
+  @param This     Instance pointer for this protocol\r
+  @param Source   Hardware source of the interrupt\r
+  @param Handler  Callback for interrupt. NULL to unregister\r
+\r
+  @retval EFI_SUCCESS Source was updated to support Handler.\r
+  @retval EFI_DEVICE_ERROR  Hardware could not be programmed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+RegisterInterruptSource (\r
+  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
+  IN HARDWARE_INTERRUPT_SOURCE          Source,\r
+  IN HARDWARE_INTERRUPT_HANDLER         Handler\r
+  )\r
+{\r
+  if (Source > mGicNumInterrupts) {\r
+    ASSERT(FALSE);\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  if ((Handler == NULL) && (gRegisteredInterruptHandlers[Source] == NULL)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  if ((Handler != NULL) && (gRegisteredInterruptHandlers[Source] != NULL)) {\r
+    return EFI_ALREADY_STARTED;\r
+  }\r
+\r
+  gRegisteredInterruptHandlers[Source] = Handler;\r
+\r
+  // If the interrupt handler is unregistered then disable the interrupt\r
+  if (NULL == Handler){\r
+    return This->DisableInterruptSource (This, Source);\r
+  } else {\r
+    return This->EnableInterruptSource (This, Source);\r
+  }\r
+}\r
+\r
 EFI_STATUS\r
 InstallAndRegisterInterruptService (\r
   IN EFI_HARDWARE_INTERRUPT_PROTOCOL   *InterruptProtocol,\r
index ab912d79be4f8d8053246554af1b2ab3da9adf39..d57ae5d8ac84cc20640a9b41195b1fe6fbe0306d 100644 (file)
@@ -37,48 +37,6 @@ Abstract:
 \r
 extern EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptProtocol;\r
 \r
-/**\r
-  Register Handler for the specified interrupt source.\r
-\r
-  @param This     Instance pointer for this protocol\r
-  @param Source   Hardware source of the interrupt\r
-  @param Handler  Callback for interrupt. NULL to unregister\r
-\r
-  @retval EFI_SUCCESS Source was updated to support Handler.\r
-  @retval EFI_DEVICE_ERROR  Hardware could not be programmed.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-RegisterInterruptSource (\r
-  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
-  IN HARDWARE_INTERRUPT_SOURCE          Source,\r
-  IN HARDWARE_INTERRUPT_HANDLER         Handler\r
-  )\r
-{\r
-  if (Source > mGicNumInterrupts) {\r
-    ASSERT(FALSE);\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  \r
-  if ((Handler == NULL) && (gRegisteredInterruptHandlers[Source] == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if ((Handler != NULL) && (gRegisteredInterruptHandlers[Source] != NULL)) {\r
-    return EFI_ALREADY_STARTED;\r
-  }\r
-\r
-  gRegisteredInterruptHandlers[Source] = Handler;\r
-\r
-  // If the interrupt handler is unregistered then disable the interrupt\r
-  if (NULL == Handler){\r
-       return This->DisableInterruptSource (This, Source);\r
-  } else {\r
-       return This->EnableInterruptSource (This, Source);\r
-  }\r
-}\r
-\r
 /**\r
   Enable interrupt source Source.\r
 \r
index 4fc65b158432f565f2dde0b62044324e77fc9d74..4d22451cb56794e46aae87816e5e423127f25b8a 100644 (file)
@@ -36,4 +36,12 @@ InstallAndRegisterInterruptService (
   IN EFI_EVENT_NOTIFY                   ExitBootServicesEvent\r
   );\r
 \r
+EFI_STATUS\r
+EFIAPI\r
+RegisterInterruptSource (\r
+  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
+  IN HARDWARE_INTERRUPT_SOURCE          Source,\r
+  IN HARDWARE_INTERRUPT_HANDLER         Handler\r
+  );\r
+\r
 #endif\r