]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Drivers/ArmGic/ArmGicDxe.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / ArmPkg / Drivers / ArmGic / ArmGicDxe.h
1 /*++
2
3 Copyright (c) 2013-2017, ARM Ltd. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 --*/
8
9 #ifndef __ARM_GIC_DXE_H__
10 #define __ARM_GIC_DXE_H__
11
12 #include <Library/ArmGicLib.h>
13 #include <Library/ArmLib.h>
14 #include <Library/DebugLib.h>
15 #include <Library/IoLib.h>
16 #include <Library/MemoryAllocationLib.h>
17 #include <Library/UefiBootServicesTableLib.h>
18 #include <Library/UefiLib.h>
19
20 #include <Protocol/Cpu.h>
21 #include <Protocol/HardwareInterrupt.h>
22 #include <Protocol/HardwareInterrupt2.h>
23
24 extern UINTN mGicNumInterrupts;
25 extern HARDWARE_INTERRUPT_HANDLER *gRegisteredInterruptHandlers;
26
27 // Common API
28 EFI_STATUS
29 InstallAndRegisterInterruptService (
30 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *InterruptProtocol,
31 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *Interrupt2Protocol,
32 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler,
33 IN EFI_EVENT_NOTIFY ExitBootServicesEvent
34 );
35
36 EFI_STATUS
37 EFIAPI
38 RegisterInterruptSource (
39 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,
40 IN HARDWARE_INTERRUPT_SOURCE Source,
41 IN HARDWARE_INTERRUPT_HANDLER Handler
42 );
43
44 // GicV2 API
45 EFI_STATUS
46 GicV2DxeInitialize (
47 IN EFI_HANDLE ImageHandle,
48 IN EFI_SYSTEM_TABLE *SystemTable
49 );
50
51 // GicV3 API
52 EFI_STATUS
53 GicV3DxeInitialize (
54 IN EFI_HANDLE ImageHandle,
55 IN EFI_SYSTEM_TABLE *SystemTable
56 );
57
58
59 // Shared code
60
61 /**
62 Calculate GICD_ICFGRn base address and corresponding bit
63 field Int_config[1] of the GIC distributor register.
64
65 @param Source Hardware source of the interrupt.
66 @param RegAddress Corresponding GICD_ICFGRn base address.
67 @param Config1Bit Bit number of F Int_config[1] bit in the register.
68
69 @retval EFI_SUCCESS Source interrupt supported.
70 @retval EFI_UNSUPPORTED Source interrupt is not supported.
71 **/
72 EFI_STATUS
73 GicGetDistributorIcfgBaseAndBit (
74 IN HARDWARE_INTERRUPT_SOURCE Source,
75 OUT UINTN *RegAddress,
76 OUT UINTN *Config1Bit
77 );
78
79 #endif