]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Drivers/ArmGic/ArmGicDxe.h
ArmPkg/PlatformBootManagerLib: fall back to the UiApp on boot failure
[mirror_edk2.git] / ArmPkg / Drivers / ArmGic / ArmGicDxe.h
index af33aa90b00c6775e10a831d63ed707394862362..bf067ae03e08c615d72dceefca2827a9e02b059f 100644 (file)
@@ -1,14 +1,8 @@
 /*++\r
 \r
-Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>\r
+Copyright (c) 2013-2017, ARM Ltd. All rights reserved.<BR>\r
 \r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 --*/\r
 \r
@@ -21,19 +15,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/IoLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiLib.h>\r
 \r
 #include <Protocol/Cpu.h>\r
 #include <Protocol/HardwareInterrupt.h>\r
+#include <Protocol/HardwareInterrupt2.h>\r
 \r
 extern UINTN                        mGicNumInterrupts;\r
 extern HARDWARE_INTERRUPT_HANDLER  *gRegisteredInterruptHandlers;\r
 \r
-//\r
 // Common API\r
-//\r
 EFI_STATUS\r
 InstallAndRegisterInterruptService (\r
   IN EFI_HARDWARE_INTERRUPT_PROTOCOL   *InterruptProtocol,\r
+  IN EFI_HARDWARE_INTERRUPT2_PROTOCOL  *Interrupt2Protocol,\r
   IN EFI_CPU_INTERRUPT_HANDLER          InterruptHandler,\r
   IN EFI_EVENT_NOTIFY                   ExitBootServicesEvent\r
   );\r
@@ -46,22 +41,39 @@ RegisterInterruptSource (
   IN HARDWARE_INTERRUPT_HANDLER         Handler\r
   );\r
 \r
-//\r
 // GicV2 API\r
-//\r
 EFI_STATUS\r
 GicV2DxeInitialize (\r
   IN EFI_HANDLE         ImageHandle,\r
   IN EFI_SYSTEM_TABLE   *SystemTable\r
   );\r
 \r
-//\r
 // GicV3 API\r
-//\r
 EFI_STATUS\r
 GicV3DxeInitialize (\r
   IN EFI_HANDLE         ImageHandle,\r
   IN EFI_SYSTEM_TABLE   *SystemTable\r
   );\r
 \r
+\r
+// Shared code\r
+\r
+/**\r
+  Calculate GICD_ICFGRn base address and corresponding bit\r
+  field Int_config[1] of the GIC distributor register.\r
+\r
+  @param Source       Hardware source of the interrupt.\r
+  @param RegAddress   Corresponding GICD_ICFGRn base address.\r
+  @param Config1Bit   Bit number of F Int_config[1] bit in the register.\r
+\r
+  @retval EFI_SUCCESS       Source interrupt supported.\r
+  @retval EFI_UNSUPPORTED   Source interrupt is not supported.\r
+**/\r
+EFI_STATUS\r
+GicGetDistributorIcfgBaseAndBit (\r
+  IN HARDWARE_INTERRUPT_SOURCE             Source,\r
+  OUT UINTN                               *RegAddress,\r
+  OUT UINTN                               *Config1Bit\r
+  );\r
+\r
 #endif\r