mirror of https://github.com/acidanthera/audk.git
ArmPkg: split off ArmGicArchLib from ArmGicLib
The current implementation of ArmGicGetSupportedArchRevision () that is used by all ARM platforms is entirely stateless (in order to support being executed from flash) so it needs to interrogate the hardware for the supported GIC revision upon each invocation. However, this statelessness is only needed for SEC type modules; in all other cases, we could easily determine the GIC revision once, and store the result in a global variable. In preparation of having separate early and normal versions, this patch introduces the ArmGicArchLib library class and default implementation, and moves the existing ArmGicGetSupportedArchRevision () into it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18098 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
bce29e3059
commit
8d13298b80
|
@ -38,6 +38,7 @@
|
||||||
UncachedMemoryAllocationLib|Include/Library/UncachedMemoryAllocationLib.h
|
UncachedMemoryAllocationLib|Include/Library/UncachedMemoryAllocationLib.h
|
||||||
DefaultExceptionHandlerLib|Include/Library/DefaultExceptionHandlerLib.h
|
DefaultExceptionHandlerLib|Include/Library/DefaultExceptionHandlerLib.h
|
||||||
ArmDisassemblerLib|Include/Library/ArmDisassemblerLib.h
|
ArmDisassemblerLib|Include/Library/ArmDisassemblerLib.h
|
||||||
|
ArmGicArchLib|Include/Library/ArmGicArchLib.h
|
||||||
|
|
||||||
[Guids.common]
|
[Guids.common]
|
||||||
gArmTokenSpaceGuid = { 0xBB11ECFE, 0x820F, 0x4968, { 0xBB, 0xA6, 0xF7, 0x6A, 0xFE, 0x30, 0x25, 0x96 } }
|
gArmTokenSpaceGuid = { 0xBB11ECFE, 0x820F, 0x4968, { 0xBB, 0xA6, 0xF7, 0x6A, 0xFE, 0x30, 0x25, 0x96 } }
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
|
|
||||||
CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
|
CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
|
||||||
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
||||||
|
ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf
|
||||||
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
|
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
|
||||||
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
||||||
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
|
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
|
||||||
|
|
|
@ -27,18 +27,17 @@
|
||||||
GicV2/ArmGicV2NonSecLib.c
|
GicV2/ArmGicV2NonSecLib.c
|
||||||
|
|
||||||
[Sources.ARM]
|
[Sources.ARM]
|
||||||
Arm/ArmGicArchLib.c
|
|
||||||
GicV3/Arm/ArmGicV3.S | GCC
|
GicV3/Arm/ArmGicV3.S | GCC
|
||||||
GicV3/Arm/ArmGicV3.asm | RVCT
|
GicV3/Arm/ArmGicV3.asm | RVCT
|
||||||
|
|
||||||
[Sources.AARCH64]
|
[Sources.AARCH64]
|
||||||
AArch64/ArmGicArchLib.c
|
|
||||||
GicV3/AArch64/ArmGicV3.S
|
GicV3/AArch64/ArmGicV3.S
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
ArmLib
|
ArmLib
|
||||||
DebugLib
|
DebugLib
|
||||||
IoLib
|
IoLib
|
||||||
|
ArmGicArchLib
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
ArmPkg/ArmPkg.dec
|
ArmPkg/ArmPkg.dec
|
||||||
|
|
|
@ -27,12 +27,10 @@
|
||||||
GicV2/ArmGicV2SecLib.c
|
GicV2/ArmGicV2SecLib.c
|
||||||
|
|
||||||
[Sources.ARM]
|
[Sources.ARM]
|
||||||
Arm/ArmGicArchLib.c
|
|
||||||
GicV3/Arm/ArmGicV3.S | GCC
|
GicV3/Arm/ArmGicV3.S | GCC
|
||||||
GicV3/Arm/ArmGicV3.asm | RVCT
|
GicV3/Arm/ArmGicV3.asm | RVCT
|
||||||
|
|
||||||
[Sources.AARCH64]
|
[Sources.AARCH64]
|
||||||
AArch64/ArmGicArchLib.c
|
|
||||||
GicV3/AArch64/ArmGicV3.S
|
GicV3/AArch64/ArmGicV3.S
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
|
@ -45,6 +43,7 @@
|
||||||
ArmLib
|
ArmLib
|
||||||
DebugLib
|
DebugLib
|
||||||
IoLib
|
IoLib
|
||||||
|
ArmGicArchLib
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gArmPlatformTokenSpaceGuid.PcdCoreCount
|
gArmPlatformTokenSpaceGuid.PcdCoreCount
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
/** @file
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015, Linaro Ltd. All rights reserved.
|
||||||
|
*
|
||||||
|
* This program and the accompanying materials are licensed and made available
|
||||||
|
* under the terms and conditions of the BSD License which accompanies this
|
||||||
|
* distribution. The full text of the license may be found at
|
||||||
|
* http://opensource.org/licenses/bsd-license.php
|
||||||
|
*
|
||||||
|
* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
#ifndef __ARM_GIC_ARCH_LIB_H__
|
||||||
|
#define __ARM_GIC_ARCH_LIB_H__
|
||||||
|
|
||||||
|
//
|
||||||
|
// GIC definitions
|
||||||
|
//
|
||||||
|
typedef enum {
|
||||||
|
ARM_GIC_ARCH_REVISION_2,
|
||||||
|
ARM_GIC_ARCH_REVISION_3
|
||||||
|
} ARM_GIC_ARCH_REVISION;
|
||||||
|
|
||||||
|
|
||||||
|
ARM_GIC_ARCH_REVISION
|
||||||
|
EFIAPI
|
||||||
|
ArmGicGetSupportedArchRevision (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
|
#endif
|
|
@ -15,13 +15,7 @@
|
||||||
#ifndef __ARMGIC_H
|
#ifndef __ARMGIC_H
|
||||||
#define __ARMGIC_H
|
#define __ARMGIC_H
|
||||||
|
|
||||||
//
|
#include <Library/ArmGicArchLib.h>
|
||||||
// GIC definitions
|
|
||||||
//
|
|
||||||
typedef enum {
|
|
||||||
ARM_GIC_ARCH_REVISION_2,
|
|
||||||
ARM_GIC_ARCH_REVISION_3
|
|
||||||
} ARM_GIC_ARCH_REVISION;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// GIC Distributor
|
// GIC Distributor
|
||||||
|
@ -103,12 +97,6 @@ typedef enum {
|
||||||
// Bit Mask for
|
// Bit Mask for
|
||||||
#define ARM_GIC_ICCIAR_ACKINTID 0x3FF
|
#define ARM_GIC_ICCIAR_ACKINTID 0x3FF
|
||||||
|
|
||||||
ARM_GIC_ARCH_REVISION
|
|
||||||
EFIAPI
|
|
||||||
ArmGicGetSupportedArchRevision (
|
|
||||||
VOID
|
|
||||||
);
|
|
||||||
|
|
||||||
UINTN
|
UINTN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicGetInterfaceIdentification (
|
ArmGicGetInterfaceIdentification (
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
#/* @file
|
||||||
|
# Copyright (c) 2015, Linaro Ltd. All rights reserved.
|
||||||
|
#
|
||||||
|
# This program and the accompanying materials
|
||||||
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
|
# http://opensource.org/licenses/bsd-license.php
|
||||||
|
#
|
||||||
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
#
|
||||||
|
#*/
|
||||||
|
|
||||||
|
[Defines]
|
||||||
|
INF_VERSION = 0x00010005
|
||||||
|
BASE_NAME = ArmGicArchLib
|
||||||
|
FILE_GUID = cd67f41a-26e9-4482-90c9-a9aff803382a
|
||||||
|
MODULE_TYPE = BASE
|
||||||
|
VERSION_STRING = 1.0
|
||||||
|
LIBRARY_CLASS = ArmGicArchLib
|
||||||
|
|
||||||
|
[Sources.ARM]
|
||||||
|
Arm/ArmGicArchLib.c
|
||||||
|
|
||||||
|
[Sources.AARCH64]
|
||||||
|
AArch64/ArmGicArchLib.c
|
||||||
|
|
||||||
|
[Packages]
|
||||||
|
MdePkg/MdePkg.dec
|
||||||
|
ArmPkg/ArmPkg.dec
|
||||||
|
|
||||||
|
[LibraryClasses]
|
||||||
|
ArmGicLib
|
|
@ -78,6 +78,7 @@
|
||||||
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
|
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
|
||||||
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
|
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
|
||||||
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
||||||
|
ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf
|
||||||
ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf
|
ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf
|
||||||
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,7 @@
|
||||||
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
|
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
|
||||||
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
|
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
|
||||||
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
||||||
|
ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf
|
||||||
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
||||||
|
|
||||||
SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
|
SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
|
||||||
|
|
|
@ -62,6 +62,7 @@
|
||||||
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
|
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
|
||||||
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
|
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
|
||||||
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
||||||
|
ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf
|
||||||
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
||||||
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
|
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,7 @@
|
||||||
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
|
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
|
||||||
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
|
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
|
||||||
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
||||||
|
ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf
|
||||||
ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf
|
ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf
|
||||||
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
||||||
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
|
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
|
||||||
|
|
|
@ -76,6 +76,7 @@
|
||||||
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
|
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
|
||||||
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
|
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
|
||||||
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
||||||
|
ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf
|
||||||
ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf
|
ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf
|
||||||
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
||||||
ArmHvcLib|ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
|
ArmHvcLib|ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
|
||||||
|
|
Loading…
Reference in New Issue