]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Drivers/ArmGic/ArmGicDxe.h
ArmPkg/ArmGicDxe: Expose HardwareInterrupt2 protocol
[mirror_edk2.git] / ArmPkg / Drivers / ArmGic / ArmGicDxe.h
CommitLineData
69b5dc9f
OM
1/*++\r
2\r
b0393756 3Copyright (c) 2013-2017, ARM Ltd. All rights reserved.<BR>\r
69b5dc9f
OM
4\r
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13--*/\r
14\r
15#ifndef __ARM_GIC_DXE_H__\r
16#define __ARM_GIC_DXE_H__\r
17\r
f5241b57 18#include <Library/ArmGicLib.h>\r
69b5dc9f
OM
19#include <Library/ArmLib.h>\r
20#include <Library/DebugLib.h>\r
f5241b57 21#include <Library/IoLib.h>\r
69b5dc9f
OM
22#include <Library/MemoryAllocationLib.h>\r
23#include <Library/UefiBootServicesTableLib.h>\r
24\r
25#include <Protocol/Cpu.h>\r
26#include <Protocol/HardwareInterrupt.h>\r
8659306a 27#include <Protocol/HardwareInterrupt2.h>\r
69b5dc9f
OM
28\r
29extern UINTN mGicNumInterrupts;\r
30extern HARDWARE_INTERRUPT_HANDLER *gRegisteredInterruptHandlers;\r
31\r
69b5dc9f 32// Common API\r
69b5dc9f
OM
33EFI_STATUS\r
34InstallAndRegisterInterruptService (\r
35 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *InterruptProtocol,\r
8659306a 36 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *Interrupt2Protocol,\r
69b5dc9f
OM
37 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler,\r
38 IN EFI_EVENT_NOTIFY ExitBootServicesEvent\r
39 );\r
40\r
0458b423
OM
41EFI_STATUS\r
42EFIAPI\r
43RegisterInterruptSource (\r
44 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,\r
45 IN HARDWARE_INTERRUPT_SOURCE Source,\r
46 IN HARDWARE_INTERRUPT_HANDLER Handler\r
47 );\r
48\r
f5241b57 49// GicV2 API\r
f5241b57
OM
50EFI_STATUS\r
51GicV2DxeInitialize (\r
52 IN EFI_HANDLE ImageHandle,\r
53 IN EFI_SYSTEM_TABLE *SystemTable\r
54 );\r
55\r
5f81082e 56// GicV3 API\r
5f81082e
OM
57EFI_STATUS\r
58GicV3DxeInitialize (\r
59 IN EFI_HANDLE ImageHandle,\r
60 IN EFI_SYSTEM_TABLE *SystemTable\r
61 );\r
62\r
8659306a
AB
63\r
64// Shared code\r
65\r
66/**\r
67 Calculate GICD_ICFGRn base address and corresponding bit\r
68 field Int_config[1] of the GIC distributor register.\r
69\r
70 @param Source Hardware source of the interrupt.\r
71 @param RegAddress Corresponding GICD_ICFGRn base address.\r
72 @param Config1Bit Bit number of F Int_config[1] bit in the register.\r
73\r
74 @retval EFI_SUCCESS Source interrupt supported.\r
75 @retval EFI_UNSUPPORTED Source interrupt is not supported.\r
76**/\r
77EFI_STATUS\r
78GicGetDistributorIcfgBaseAndBit (\r
79 IN HARDWARE_INTERRUPT_SOURCE Source,\r
80 OUT UINTN *RegAddress,\r
81 OUT UINTN *Config1Bit\r
82 );\r
83\r
69b5dc9f 84#endif\r