ArmPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the ArmPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Andrew Fish <afish@apple.com>
This commit is contained in:
committed by
mergify[bot]
parent
7c2a6033c1
commit
429309e0c6
@@ -26,12 +26,12 @@
|
||||
**/
|
||||
VOID
|
||||
DisassembleInstruction (
|
||||
IN UINT8 **OpCodePtr,
|
||||
IN BOOLEAN Thumb,
|
||||
IN BOOLEAN Extended,
|
||||
IN OUT UINT32 *ItBlock,
|
||||
OUT CHAR8 *Buf,
|
||||
OUT UINTN Size
|
||||
IN UINT8 **OpCodePtr,
|
||||
IN BOOLEAN Thumb,
|
||||
IN BOOLEAN Extended,
|
||||
IN OUT UINT32 *ItBlock,
|
||||
OUT CHAR8 *Buf,
|
||||
OUT UINTN Size
|
||||
);
|
||||
|
||||
#endif // ARM_DISASSEMBLER_LIB_H_
|
||||
|
@@ -43,7 +43,7 @@ ArmGenericTimerGetTimerFreq (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGenericTimerSetTimerVal (
|
||||
IN UINTN Value
|
||||
IN UINTN Value
|
||||
);
|
||||
|
||||
UINTN
|
||||
@@ -67,7 +67,7 @@ ArmGenericTimerGetTimerCtrlReg (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGenericTimerSetTimerCtrlReg (
|
||||
UINTN Value
|
||||
UINTN Value
|
||||
);
|
||||
|
||||
UINT64
|
||||
@@ -79,7 +79,7 @@ ArmGenericTimerGetCompareVal (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGenericTimerSetCompareVal (
|
||||
IN UINT64 Value
|
||||
IN UINT64 Value
|
||||
);
|
||||
|
||||
#endif // ARM_GENERIC_TIMER_COUNTER_LIB_H_
|
||||
|
@@ -17,7 +17,6 @@ typedef enum {
|
||||
ARM_GIC_ARCH_REVISION_3
|
||||
} ARM_GIC_ARCH_REVISION;
|
||||
|
||||
|
||||
ARM_GIC_ARCH_REVISION
|
||||
EFIAPI
|
||||
ArmGicGetSupportedArchRevision (
|
||||
|
@@ -12,36 +12,36 @@
|
||||
#include <Library/ArmGicArchLib.h>
|
||||
|
||||
// GIC Distributor
|
||||
#define ARM_GIC_ICDDCR 0x000 // Distributor Control Register
|
||||
#define ARM_GIC_ICDICTR 0x004 // Interrupt Controller Type Register
|
||||
#define ARM_GIC_ICDIIDR 0x008 // Implementer Identification Register
|
||||
#define ARM_GIC_ICDDCR 0x000 // Distributor Control Register
|
||||
#define ARM_GIC_ICDICTR 0x004 // Interrupt Controller Type Register
|
||||
#define ARM_GIC_ICDIIDR 0x008 // Implementer Identification Register
|
||||
|
||||
// Each reg base below repeats for Number of interrupts / 4 (see GIC spec)
|
||||
#define ARM_GIC_ICDISR 0x080 // Interrupt Security Registers
|
||||
#define ARM_GIC_ICDISER 0x100 // Interrupt Set-Enable Registers
|
||||
#define ARM_GIC_ICDICER 0x180 // Interrupt Clear-Enable Registers
|
||||
#define ARM_GIC_ICDSPR 0x200 // Interrupt Set-Pending Registers
|
||||
#define ARM_GIC_ICDICPR 0x280 // Interrupt Clear-Pending Registers
|
||||
#define ARM_GIC_ICDABR 0x300 // Active Bit Registers
|
||||
#define ARM_GIC_ICDISR 0x080 // Interrupt Security Registers
|
||||
#define ARM_GIC_ICDISER 0x100 // Interrupt Set-Enable Registers
|
||||
#define ARM_GIC_ICDICER 0x180 // Interrupt Clear-Enable Registers
|
||||
#define ARM_GIC_ICDSPR 0x200 // Interrupt Set-Pending Registers
|
||||
#define ARM_GIC_ICDICPR 0x280 // Interrupt Clear-Pending Registers
|
||||
#define ARM_GIC_ICDABR 0x300 // Active Bit Registers
|
||||
|
||||
// Each reg base below repeats for Number of interrupts / 4
|
||||
#define ARM_GIC_ICDIPR 0x400 // Interrupt Priority Registers
|
||||
#define ARM_GIC_ICDIPR 0x400 // Interrupt Priority Registers
|
||||
|
||||
// Each reg base below repeats for Number of interrupts
|
||||
#define ARM_GIC_ICDIPTR 0x800 // Interrupt Processor Target Registers
|
||||
#define ARM_GIC_ICDICFR 0xC00 // Interrupt Configuration Registers
|
||||
#define ARM_GIC_ICDIPTR 0x800 // Interrupt Processor Target Registers
|
||||
#define ARM_GIC_ICDICFR 0xC00 // Interrupt Configuration Registers
|
||||
|
||||
#define ARM_GIC_ICDPPISR 0xD00 // PPI Status register
|
||||
#define ARM_GIC_ICDPPISR 0xD00 // PPI Status register
|
||||
|
||||
// just one of these
|
||||
#define ARM_GIC_ICDSGIR 0xF00 // Software Generated Interrupt Register
|
||||
#define ARM_GIC_ICDSGIR 0xF00 // Software Generated Interrupt Register
|
||||
|
||||
// GICv3 specific registers
|
||||
#define ARM_GICD_IROUTER 0x6100 // Interrupt Routing Registers
|
||||
#define ARM_GICD_IROUTER 0x6100 // Interrupt Routing Registers
|
||||
|
||||
// GICD_CTLR bits
|
||||
#define ARM_GIC_ICDDCR_ARE (1 << 4) // Affinity Routing Enable (ARE)
|
||||
#define ARM_GIC_ICDDCR_DS (1 << 6) // Disable Security (DS)
|
||||
#define ARM_GIC_ICDDCR_ARE (1 << 4) // Affinity Routing Enable (ARE)
|
||||
#define ARM_GIC_ICDDCR_DS (1 << 6) // Disable Security (DS)
|
||||
|
||||
// GICD_ICDICFR bits
|
||||
#define ARM_GIC_ICDICFR_WIDTH 32 // ICDICFR is a 32 bit register
|
||||
@@ -52,125 +52,124 @@
|
||||
#define ARM_GIC_ICDICFR_LEVEL_TRIGGERED 0x0 // Level triggered interrupt
|
||||
#define ARM_GIC_ICDICFR_EDGE_TRIGGERED 0x1 // Edge triggered interrupt
|
||||
|
||||
|
||||
// GIC Redistributor
|
||||
#define ARM_GICR_CTLR_FRAME_SIZE SIZE_64KB
|
||||
#define ARM_GICR_SGI_PPI_FRAME_SIZE SIZE_64KB
|
||||
#define ARM_GICR_SGI_VLPI_FRAME_SIZE SIZE_64KB
|
||||
#define ARM_GICR_SGI_RESERVED_FRAME_SIZE SIZE_64KB
|
||||
#define ARM_GICR_CTLR_FRAME_SIZE SIZE_64KB
|
||||
#define ARM_GICR_SGI_PPI_FRAME_SIZE SIZE_64KB
|
||||
#define ARM_GICR_SGI_VLPI_FRAME_SIZE SIZE_64KB
|
||||
#define ARM_GICR_SGI_RESERVED_FRAME_SIZE SIZE_64KB
|
||||
|
||||
// GIC Redistributor Control frame
|
||||
#define ARM_GICR_TYPER 0x0008 // Redistributor Type Register
|
||||
#define ARM_GICR_TYPER 0x0008 // Redistributor Type Register
|
||||
|
||||
// GIC Redistributor TYPER bit assignments
|
||||
#define ARM_GICR_TYPER_PLPIS (1 << 0) // Physical LPIs
|
||||
#define ARM_GICR_TYPER_VLPIS (1 << 1) // Virtual LPIs
|
||||
#define ARM_GICR_TYPER_DIRECTLPI (1 << 3) // Direct LPIs
|
||||
#define ARM_GICR_TYPER_LAST (1 << 4) // Last Redistributor in series
|
||||
#define ARM_GICR_TYPER_DPGS (1 << 5) // Disable Processor Group
|
||||
#define ARM_GICR_TYPER_PLPIS (1 << 0) // Physical LPIs
|
||||
#define ARM_GICR_TYPER_VLPIS (1 << 1) // Virtual LPIs
|
||||
#define ARM_GICR_TYPER_DIRECTLPI (1 << 3) // Direct LPIs
|
||||
#define ARM_GICR_TYPER_LAST (1 << 4) // Last Redistributor in series
|
||||
#define ARM_GICR_TYPER_DPGS (1 << 5) // Disable Processor Group
|
||||
// Selection Support
|
||||
#define ARM_GICR_TYPER_PROCNO (0xFFFF << 8) // Processor Number
|
||||
#define ARM_GICR_TYPER_COMMONLPIAFF (0x3 << 24) // Common LPI Affinity
|
||||
#define ARM_GICR_TYPER_AFFINITY (0xFFFFFFFFULL << 32) // Redistributor Affinity
|
||||
#define ARM_GICR_TYPER_PROCNO (0xFFFF << 8) // Processor Number
|
||||
#define ARM_GICR_TYPER_COMMONLPIAFF (0x3 << 24) // Common LPI Affinity
|
||||
#define ARM_GICR_TYPER_AFFINITY (0xFFFFFFFFULL << 32) // Redistributor Affinity
|
||||
|
||||
#define ARM_GICR_TYPER_GET_AFFINITY(TypeReg) (((TypeReg) & \
|
||||
ARM_GICR_TYPER_AFFINITY) >> 32)
|
||||
|
||||
// GIC SGI & PPI Redistributor frame
|
||||
#define ARM_GICR_ISENABLER 0x0100 // Interrupt Set-Enable Registers
|
||||
#define ARM_GICR_ICENABLER 0x0180 // Interrupt Clear-Enable Registers
|
||||
#define ARM_GICR_ISENABLER 0x0100 // Interrupt Set-Enable Registers
|
||||
#define ARM_GICR_ICENABLER 0x0180 // Interrupt Clear-Enable Registers
|
||||
|
||||
// GIC Cpu interface
|
||||
#define ARM_GIC_ICCICR 0x00 // CPU Interface Control Register
|
||||
#define ARM_GIC_ICCPMR 0x04 // Interrupt Priority Mask Register
|
||||
#define ARM_GIC_ICCBPR 0x08 // Binary Point Register
|
||||
#define ARM_GIC_ICCIAR 0x0C // Interrupt Acknowledge Register
|
||||
#define ARM_GIC_ICCEIOR 0x10 // End Of Interrupt Register
|
||||
#define ARM_GIC_ICCRPR 0x14 // Running Priority Register
|
||||
#define ARM_GIC_ICCPIR 0x18 // Highest Pending Interrupt Register
|
||||
#define ARM_GIC_ICCABPR 0x1C // Aliased Binary Point Register
|
||||
#define ARM_GIC_ICCIIDR 0xFC // Identification Register
|
||||
#define ARM_GIC_ICCICR 0x00 // CPU Interface Control Register
|
||||
#define ARM_GIC_ICCPMR 0x04 // Interrupt Priority Mask Register
|
||||
#define ARM_GIC_ICCBPR 0x08 // Binary Point Register
|
||||
#define ARM_GIC_ICCIAR 0x0C // Interrupt Acknowledge Register
|
||||
#define ARM_GIC_ICCEIOR 0x10 // End Of Interrupt Register
|
||||
#define ARM_GIC_ICCRPR 0x14 // Running Priority Register
|
||||
#define ARM_GIC_ICCPIR 0x18 // Highest Pending Interrupt Register
|
||||
#define ARM_GIC_ICCABPR 0x1C // Aliased Binary Point Register
|
||||
#define ARM_GIC_ICCIIDR 0xFC // Identification Register
|
||||
|
||||
#define ARM_GIC_ICDSGIR_FILTER_TARGETLIST 0x0
|
||||
#define ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE 0x1
|
||||
#define ARM_GIC_ICDSGIR_FILTER_ITSELF 0x2
|
||||
#define ARM_GIC_ICDSGIR_FILTER_TARGETLIST 0x0
|
||||
#define ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE 0x1
|
||||
#define ARM_GIC_ICDSGIR_FILTER_ITSELF 0x2
|
||||
|
||||
// Bit-masks to configure the CPU Interface Control register
|
||||
#define ARM_GIC_ICCICR_ENABLE_SECURE 0x01
|
||||
#define ARM_GIC_ICCICR_ENABLE_NS 0x02
|
||||
#define ARM_GIC_ICCICR_ACK_CTL 0x04
|
||||
#define ARM_GIC_ICCICR_SIGNAL_SECURE_TO_FIQ 0x08
|
||||
#define ARM_GIC_ICCICR_USE_SBPR 0x10
|
||||
#define ARM_GIC_ICCICR_ENABLE_SECURE 0x01
|
||||
#define ARM_GIC_ICCICR_ENABLE_NS 0x02
|
||||
#define ARM_GIC_ICCICR_ACK_CTL 0x04
|
||||
#define ARM_GIC_ICCICR_SIGNAL_SECURE_TO_FIQ 0x08
|
||||
#define ARM_GIC_ICCICR_USE_SBPR 0x10
|
||||
|
||||
// Bit Mask for GICC_IIDR
|
||||
#define ARM_GIC_ICCIIDR_GET_PRODUCT_ID(IccIidr) (((IccIidr) >> 20) & 0xFFF)
|
||||
#define ARM_GIC_ICCIIDR_GET_ARCH_VERSION(IccIidr) (((IccIidr) >> 16) & 0xF)
|
||||
#define ARM_GIC_ICCIIDR_GET_REVISION(IccIidr) (((IccIidr) >> 12) & 0xF)
|
||||
#define ARM_GIC_ICCIIDR_GET_IMPLEMENTER(IccIidr) ((IccIidr) & 0xFFF)
|
||||
#define ARM_GIC_ICCIIDR_GET_PRODUCT_ID(IccIidr) (((IccIidr) >> 20) & 0xFFF)
|
||||
#define ARM_GIC_ICCIIDR_GET_ARCH_VERSION(IccIidr) (((IccIidr) >> 16) & 0xF)
|
||||
#define ARM_GIC_ICCIIDR_GET_REVISION(IccIidr) (((IccIidr) >> 12) & 0xF)
|
||||
#define ARM_GIC_ICCIIDR_GET_IMPLEMENTER(IccIidr) ((IccIidr) & 0xFFF)
|
||||
|
||||
// Bit Mask for
|
||||
#define ARM_GIC_ICCIAR_ACKINTID 0x3FF
|
||||
#define ARM_GIC_ICCIAR_ACKINTID 0x3FF
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmGicGetInterfaceIdentification (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
// GIC Secure interfaces
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicSetupNonSecure (
|
||||
IN UINTN MpId,
|
||||
IN INTN GicDistributorBase,
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN MpId,
|
||||
IN INTN GicDistributorBase,
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicSetSecureInterrupts (
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINTN* GicSecureInterruptMask,
|
||||
IN UINTN GicSecureInterruptMaskSize
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINTN *GicSecureInterruptMask,
|
||||
IN UINTN GicSecureInterruptMaskSize
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicEnableInterruptInterface (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicDisableInterruptInterface (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicEnableDistributor (
|
||||
IN INTN GicDistributorBase
|
||||
IN INTN GicDistributorBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicDisableDistributor (
|
||||
IN INTN GicDistributorBase
|
||||
IN INTN GicDistributorBase
|
||||
);
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmGicGetMaxNumInterrupts (
|
||||
IN INTN GicDistributorBase
|
||||
IN INTN GicDistributorBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicSendSgiTo (
|
||||
IN INTN GicDistributorBase,
|
||||
IN INTN TargetListFilter,
|
||||
IN INTN CPUTargetList,
|
||||
IN INTN SgiId
|
||||
IN INTN GicDistributorBase,
|
||||
IN INTN TargetListFilter,
|
||||
IN INTN CPUTargetList,
|
||||
IN INTN SgiId
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -190,55 +189,55 @@ ArmGicSendSgiTo (
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmGicAcknowledgeInterrupt (
|
||||
IN UINTN GicInterruptInterfaceBase,
|
||||
OUT UINTN *InterruptId
|
||||
IN UINTN GicInterruptInterfaceBase,
|
||||
OUT UINTN *InterruptId
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicEndOfInterrupt (
|
||||
IN UINTN GicInterruptInterfaceBase,
|
||||
IN UINTN Source
|
||||
IN UINTN GicInterruptInterfaceBase,
|
||||
IN UINTN Source
|
||||
);
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmGicSetPriorityMask (
|
||||
IN INTN GicInterruptInterfaceBase,
|
||||
IN INTN PriorityMask
|
||||
IN INTN GicInterruptInterfaceBase,
|
||||
IN INTN PriorityMask
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicSetInterruptPriority (
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINTN GicRedistributorBase,
|
||||
IN UINTN Source,
|
||||
IN UINTN Priority
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINTN GicRedistributorBase,
|
||||
IN UINTN Source,
|
||||
IN UINTN Priority
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicEnableInterrupt (
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINTN GicRedistributorBase,
|
||||
IN UINTN Source
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINTN GicRedistributorBase,
|
||||
IN UINTN Source
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicDisableInterrupt (
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINTN GicRedistributorBase,
|
||||
IN UINTN Source
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINTN GicRedistributorBase,
|
||||
IN UINTN Source
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
ArmGicIsInterruptEnabled (
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINTN GicRedistributorBase,
|
||||
IN UINTN Source
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINTN GicRedistributorBase,
|
||||
IN UINTN Source
|
||||
);
|
||||
|
||||
// GIC revision 2 specific declarations
|
||||
@@ -251,41 +250,41 @@ ArmGicIsInterruptEnabled (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicV2SetupNonSecure (
|
||||
IN UINTN MpId,
|
||||
IN INTN GicDistributorBase,
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN MpId,
|
||||
IN INTN GicDistributorBase,
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicV2EnableInterruptInterface (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicV2DisableInterruptInterface (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmGicV2AcknowledgeInterrupt (
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicV2EndOfInterrupt (
|
||||
IN UINTN GicInterruptInterfaceBase,
|
||||
IN UINTN Source
|
||||
IN UINTN GicInterruptInterfaceBase,
|
||||
IN UINTN Source
|
||||
);
|
||||
|
||||
// GIC revision 3 specific declarations
|
||||
|
||||
#define ICC_SRE_EL2_SRE (1 << 0)
|
||||
#define ICC_SRE_EL2_SRE (1 << 0)
|
||||
|
||||
#define ARM_GICD_IROUTER_IRM BIT31
|
||||
#define ARM_GICD_IROUTER_IRM BIT31
|
||||
|
||||
UINT32
|
||||
EFIAPI
|
||||
@@ -296,7 +295,7 @@ ArmGicV3GetControlSystemRegisterEnable (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicV3SetControlSystemRegisterEnable (
|
||||
IN UINT32 ControlSystemRegisterEnable
|
||||
IN UINT32 ControlSystemRegisterEnable
|
||||
);
|
||||
|
||||
VOID
|
||||
@@ -320,17 +319,17 @@ ArmGicV3AcknowledgeInterrupt (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicV3EndOfInterrupt (
|
||||
IN UINTN Source
|
||||
IN UINTN Source
|
||||
);
|
||||
|
||||
VOID
|
||||
ArmGicV3SetBinaryPointer (
|
||||
IN UINTN BinaryPoint
|
||||
IN UINTN BinaryPoint
|
||||
);
|
||||
|
||||
VOID
|
||||
ArmGicV3SetPriorityMask (
|
||||
IN UINTN Priority
|
||||
IN UINTN Priority
|
||||
);
|
||||
|
||||
#endif // ARMGIC_H_
|
||||
|
@@ -14,14 +14,14 @@
|
||||
* The native size is used for the arguments.
|
||||
*/
|
||||
typedef struct {
|
||||
UINTN Arg0;
|
||||
UINTN Arg1;
|
||||
UINTN Arg2;
|
||||
UINTN Arg3;
|
||||
UINTN Arg4;
|
||||
UINTN Arg5;
|
||||
UINTN Arg6;
|
||||
UINTN Arg7;
|
||||
UINTN Arg0;
|
||||
UINTN Arg1;
|
||||
UINTN Arg2;
|
||||
UINTN Arg3;
|
||||
UINTN Arg4;
|
||||
UINTN Arg5;
|
||||
UINTN Arg6;
|
||||
UINTN Arg7;
|
||||
} ARM_HVC_ARGS;
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ typedef struct {
|
||||
**/
|
||||
VOID
|
||||
ArmCallHvc (
|
||||
IN OUT ARM_HVC_ARGS *Args
|
||||
IN OUT ARM_HVC_ARGS *Args
|
||||
);
|
||||
|
||||
#endif // ARM_HVC_LIB_H_
|
||||
|
@@ -15,13 +15,13 @@
|
||||
|
||||
#ifdef MDE_CPU_ARM
|
||||
#include <Chipset/ArmV7.h>
|
||||
#elif defined(MDE_CPU_AARCH64)
|
||||
#elif defined (MDE_CPU_AARCH64)
|
||||
#include <Chipset/AArch64.h>
|
||||
#else
|
||||
#error "Unknown chipset."
|
||||
#error "Unknown chipset."
|
||||
#endif
|
||||
|
||||
#define EFI_MEMORY_CACHETYPE_MASK (EFI_MEMORY_UC | EFI_MEMORY_WC | \
|
||||
#define EFI_MEMORY_CACHETYPE_MASK (EFI_MEMORY_UC | EFI_MEMORY_WC | \
|
||||
EFI_MEMORY_WT | EFI_MEMORY_WB | \
|
||||
EFI_MEMORY_UCE)
|
||||
|
||||
@@ -50,17 +50,21 @@ typedef enum {
|
||||
ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_DEVICE
|
||||
} ARM_MEMORY_REGION_ATTRIBUTES;
|
||||
|
||||
#define IS_ARM_MEMORY_REGION_ATTRIBUTES_SECURE(attr) ((UINT32)(attr) & 1)
|
||||
#define IS_ARM_MEMORY_REGION_ATTRIBUTES_SECURE(attr) ((UINT32)(attr) & 1)
|
||||
|
||||
typedef struct {
|
||||
EFI_PHYSICAL_ADDRESS PhysicalBase;
|
||||
EFI_VIRTUAL_ADDRESS VirtualBase;
|
||||
UINT64 Length;
|
||||
ARM_MEMORY_REGION_ATTRIBUTES Attributes;
|
||||
EFI_PHYSICAL_ADDRESS PhysicalBase;
|
||||
EFI_VIRTUAL_ADDRESS VirtualBase;
|
||||
UINT64 Length;
|
||||
ARM_MEMORY_REGION_ATTRIBUTES Attributes;
|
||||
} ARM_MEMORY_REGION_DESCRIPTOR;
|
||||
|
||||
typedef VOID (*CACHE_OPERATION)(VOID);
|
||||
typedef VOID (*LINE_OPERATION)(UINTN);
|
||||
typedef VOID (*CACHE_OPERATION)(
|
||||
VOID
|
||||
);
|
||||
typedef VOID (*LINE_OPERATION)(
|
||||
UINTN
|
||||
);
|
||||
|
||||
//
|
||||
// ARM Processor Mode
|
||||
@@ -80,34 +84,34 @@ typedef enum {
|
||||
//
|
||||
// ARM Cpu IDs
|
||||
//
|
||||
#define ARM_CPU_IMPLEMENTER_MASK (0xFFU << 24)
|
||||
#define ARM_CPU_IMPLEMENTER_ARMLTD (0x41U << 24)
|
||||
#define ARM_CPU_IMPLEMENTER_DEC (0x44U << 24)
|
||||
#define ARM_CPU_IMPLEMENTER_MOT (0x4DU << 24)
|
||||
#define ARM_CPU_IMPLEMENTER_QUALCOMM (0x51U << 24)
|
||||
#define ARM_CPU_IMPLEMENTER_MARVELL (0x56U << 24)
|
||||
#define ARM_CPU_IMPLEMENTER_MASK (0xFFU << 24)
|
||||
#define ARM_CPU_IMPLEMENTER_ARMLTD (0x41U << 24)
|
||||
#define ARM_CPU_IMPLEMENTER_DEC (0x44U << 24)
|
||||
#define ARM_CPU_IMPLEMENTER_MOT (0x4DU << 24)
|
||||
#define ARM_CPU_IMPLEMENTER_QUALCOMM (0x51U << 24)
|
||||
#define ARM_CPU_IMPLEMENTER_MARVELL (0x56U << 24)
|
||||
|
||||
#define ARM_CPU_PRIMARY_PART_MASK (0xFFF << 4)
|
||||
#define ARM_CPU_PRIMARY_PART_CORTEXA5 (0xC05 << 4)
|
||||
#define ARM_CPU_PRIMARY_PART_CORTEXA7 (0xC07 << 4)
|
||||
#define ARM_CPU_PRIMARY_PART_CORTEXA8 (0xC08 << 4)
|
||||
#define ARM_CPU_PRIMARY_PART_CORTEXA9 (0xC09 << 4)
|
||||
#define ARM_CPU_PRIMARY_PART_CORTEXA15 (0xC0F << 4)
|
||||
#define ARM_CPU_PRIMARY_PART_MASK (0xFFF << 4)
|
||||
#define ARM_CPU_PRIMARY_PART_CORTEXA5 (0xC05 << 4)
|
||||
#define ARM_CPU_PRIMARY_PART_CORTEXA7 (0xC07 << 4)
|
||||
#define ARM_CPU_PRIMARY_PART_CORTEXA8 (0xC08 << 4)
|
||||
#define ARM_CPU_PRIMARY_PART_CORTEXA9 (0xC09 << 4)
|
||||
#define ARM_CPU_PRIMARY_PART_CORTEXA15 (0xC0F << 4)
|
||||
|
||||
//
|
||||
// ARM MP Core IDs
|
||||
//
|
||||
#define ARM_CORE_AFF0 0xFF
|
||||
#define ARM_CORE_AFF1 (0xFF << 8)
|
||||
#define ARM_CORE_AFF2 (0xFF << 16)
|
||||
#define ARM_CORE_AFF3 (0xFFULL << 32)
|
||||
#define ARM_CORE_AFF0 0xFF
|
||||
#define ARM_CORE_AFF1 (0xFF << 8)
|
||||
#define ARM_CORE_AFF2 (0xFF << 16)
|
||||
#define ARM_CORE_AFF3 (0xFFULL << 32)
|
||||
|
||||
#define ARM_CORE_MASK ARM_CORE_AFF0
|
||||
#define ARM_CLUSTER_MASK ARM_CORE_AFF1
|
||||
#define GET_CORE_ID(MpId) ((MpId) & ARM_CORE_MASK)
|
||||
#define GET_CLUSTER_ID(MpId) (((MpId) & ARM_CLUSTER_MASK) >> 8)
|
||||
#define GET_MPID(ClusterId, CoreId) (((ClusterId) << 8) | (CoreId))
|
||||
#define PRIMARY_CORE_ID (PcdGet32(PcdArmPrimaryCore) & ARM_CORE_MASK)
|
||||
#define ARM_CORE_MASK ARM_CORE_AFF0
|
||||
#define ARM_CLUSTER_MASK ARM_CORE_AFF1
|
||||
#define GET_CORE_ID(MpId) ((MpId) & ARM_CORE_MASK)
|
||||
#define GET_CLUSTER_ID(MpId) (((MpId) & ARM_CLUSTER_MASK) >> 8)
|
||||
#define GET_MPID(ClusterId, CoreId) (((ClusterId) << 8) | (CoreId))
|
||||
#define PRIMARY_CORE_ID (PcdGet32(PcdArmPrimaryCore) & ARM_CORE_MASK)
|
||||
|
||||
/** Reads the CCSIDR register for the specified cache.
|
||||
|
||||
@@ -118,7 +122,7 @@ typedef enum {
|
||||
**/
|
||||
UINTN
|
||||
ReadCCSIDR (
|
||||
IN UINT32 CSSELR
|
||||
IN UINT32 CSSELR
|
||||
);
|
||||
|
||||
/** Reads the CCSIDR2 for the specified cache.
|
||||
@@ -129,7 +133,7 @@ ReadCCSIDR (
|
||||
**/
|
||||
UINT32
|
||||
ReadCCSIDR2 (
|
||||
IN UINT32 CSSELR
|
||||
IN UINT32 CSSELR
|
||||
);
|
||||
|
||||
/** Reads the Cache Level ID (CLIDR) register.
|
||||
@@ -183,7 +187,6 @@ ArmInvalidateDataCache (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmCleanInvalidateDataCache (
|
||||
@@ -205,31 +208,31 @@ ArmInvalidateInstructionCache (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmInvalidateDataCacheEntryByMVA (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmCleanDataCacheEntryToPoUByMVA (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmInvalidateInstructionCacheEntryToPoUByMVA (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmCleanDataCacheEntryByMVA (
|
||||
IN UINTN Address
|
||||
);
|
||||
IN UINTN Address
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmCleanInvalidateDataCacheEntryByMVA (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
);
|
||||
|
||||
VOID
|
||||
@@ -352,8 +355,8 @@ ArmInvalidateTlb (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmUpdateTranslationTableEntry (
|
||||
IN VOID *TranslationTableEntry,
|
||||
IN VOID *Mva
|
||||
IN VOID *TranslationTableEntry,
|
||||
IN VOID *Mva
|
||||
);
|
||||
|
||||
VOID
|
||||
@@ -371,7 +374,7 @@ ArmSetTTBR0 (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmSetTTBCR (
|
||||
IN UINT32 Bits
|
||||
IN UINT32 Bits
|
||||
);
|
||||
|
||||
VOID *
|
||||
@@ -431,7 +434,7 @@ ArmInstructionSynchronizationBarrier (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteVBar (
|
||||
IN UINTN VectorBase
|
||||
IN UINTN VectorBase
|
||||
);
|
||||
|
||||
UINTN
|
||||
@@ -443,7 +446,7 @@ ArmReadVBar (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteAuxCr (
|
||||
IN UINT32 Bit
|
||||
IN UINT32 Bit
|
||||
);
|
||||
|
||||
UINT32
|
||||
@@ -455,13 +458,13 @@ ArmReadAuxCr (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmSetAuxCrBit (
|
||||
IN UINT32 Bits
|
||||
IN UINT32 Bits
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmUnsetAuxCrBit (
|
||||
IN UINT32 Bits
|
||||
IN UINT32 Bits
|
||||
);
|
||||
|
||||
VOID
|
||||
@@ -504,7 +507,7 @@ ArmReadCpacr (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteCpacr (
|
||||
IN UINT32 Access
|
||||
IN UINT32 Access
|
||||
);
|
||||
|
||||
VOID
|
||||
@@ -534,7 +537,7 @@ ArmReadScr (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteScr (
|
||||
IN UINT32 Value
|
||||
IN UINT32 Value
|
||||
);
|
||||
|
||||
UINT32
|
||||
@@ -546,7 +549,7 @@ ArmReadMVBar (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteMVBar (
|
||||
IN UINT32 VectorMonitorBase
|
||||
IN UINT32 VectorMonitorBase
|
||||
);
|
||||
|
||||
UINT32
|
||||
@@ -558,7 +561,7 @@ ArmReadSctlr (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteSctlr (
|
||||
IN UINT32 Value
|
||||
IN UINT32 Value
|
||||
);
|
||||
|
||||
UINTN
|
||||
@@ -570,10 +573,9 @@ ArmReadHVBar (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteHVBar (
|
||||
IN UINTN HypModeVectorBase
|
||||
IN UINTN HypModeVectorBase
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// Helper functions for accessing CPU ACTLR
|
||||
//
|
||||
@@ -587,28 +589,28 @@ ArmReadCpuActlr (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteCpuActlr (
|
||||
IN UINTN Val
|
||||
IN UINTN Val
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmSetCpuActlrBit (
|
||||
IN UINTN Bits
|
||||
IN UINTN Bits
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmUnsetCpuActlrBit (
|
||||
IN UINTN Bits
|
||||
IN UINTN Bits
|
||||
);
|
||||
|
||||
//
|
||||
// Accessors for the architected generic timer registers
|
||||
//
|
||||
|
||||
#define ARM_ARCH_TIMER_ENABLE (1 << 0)
|
||||
#define ARM_ARCH_TIMER_IMASK (1 << 1)
|
||||
#define ARM_ARCH_TIMER_ISTATUS (1 << 2)
|
||||
#define ARM_ARCH_TIMER_ENABLE (1 << 0)
|
||||
#define ARM_ARCH_TIMER_IMASK (1 << 1)
|
||||
#define ARM_ARCH_TIMER_ISTATUS (1 << 2)
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
@@ -619,7 +621,7 @@ ArmReadCntFrq (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteCntFrq (
|
||||
UINTN FreqInHz
|
||||
UINTN FreqInHz
|
||||
);
|
||||
|
||||
UINT64
|
||||
@@ -637,7 +639,7 @@ ArmReadCntkCtl (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteCntkCtl (
|
||||
UINTN Val
|
||||
UINTN Val
|
||||
);
|
||||
|
||||
UINTN
|
||||
@@ -649,7 +651,7 @@ ArmReadCntpTval (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteCntpTval (
|
||||
UINTN Val
|
||||
UINTN Val
|
||||
);
|
||||
|
||||
UINTN
|
||||
@@ -661,7 +663,7 @@ ArmReadCntpCtl (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteCntpCtl (
|
||||
UINTN Val
|
||||
UINTN Val
|
||||
);
|
||||
|
||||
UINTN
|
||||
@@ -673,7 +675,7 @@ ArmReadCntvTval (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteCntvTval (
|
||||
UINTN Val
|
||||
UINTN Val
|
||||
);
|
||||
|
||||
UINTN
|
||||
@@ -685,7 +687,7 @@ ArmReadCntvCtl (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteCntvCtl (
|
||||
UINTN Val
|
||||
UINTN Val
|
||||
);
|
||||
|
||||
UINT64
|
||||
@@ -703,7 +705,7 @@ ArmReadCntpCval (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteCntpCval (
|
||||
UINT64 Val
|
||||
UINT64 Val
|
||||
);
|
||||
|
||||
UINT64
|
||||
@@ -715,7 +717,7 @@ ArmReadCntvCval (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteCntvCval (
|
||||
UINT64 Val
|
||||
UINT64 Val
|
||||
);
|
||||
|
||||
UINT64
|
||||
@@ -727,7 +729,7 @@ ArmReadCntvOff (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteCntvOff (
|
||||
UINT64 Val
|
||||
UINT64 Val
|
||||
);
|
||||
|
||||
UINTN
|
||||
@@ -736,7 +738,6 @@ ArmGetPhysicalAddressBits (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
///
|
||||
/// ID Register Helper functions
|
||||
///
|
||||
@@ -768,6 +769,7 @@ ArmHasCcidx (
|
||||
///
|
||||
/// AArch32-only ID Register Helper functions
|
||||
///
|
||||
|
||||
/**
|
||||
Check whether the CPU supports the Security extensions
|
||||
|
||||
@@ -779,6 +781,7 @@ EFIAPI
|
||||
ArmHasSecurityExtensions (
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif // MDE_CPU_ARM
|
||||
|
||||
#endif // ARM_LIB_H_
|
||||
|
@@ -24,29 +24,29 @@ ArmConfigureMmu (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArmSetMemoryRegionNoExec (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArmClearMemoryRegionNoExec (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArmSetMemoryRegionReadOnly (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArmClearMemoryRegionReadOnly (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
||||
VOID
|
||||
@@ -59,9 +59,9 @@ ArmReplaceLiveTranslationEntry (
|
||||
|
||||
EFI_STATUS
|
||||
ArmSetMemoryAttributes (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Attributes
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Attributes
|
||||
);
|
||||
|
||||
#endif // ARM_MMU_LIB_H_
|
||||
|
@@ -18,37 +18,37 @@
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct {
|
||||
UINT32 Reserved1;
|
||||
UINT32 ChannelStatus;
|
||||
UINT64 Reserved2;
|
||||
UINT32 Flags;
|
||||
UINT32 Length;
|
||||
UINT32 MessageHeader;
|
||||
UINT32 Reserved1;
|
||||
UINT32 ChannelStatus;
|
||||
UINT64 Reserved2;
|
||||
UINT32 Flags;
|
||||
UINT32 Length;
|
||||
UINT32 MessageHeader;
|
||||
|
||||
// NOTE: Since EDK2 does not allow flexible array member [] we declare
|
||||
// here array of 1 element length. However below is used as a variable
|
||||
// length array.
|
||||
UINT32 Payload[1]; // size less object gives offset to payload.
|
||||
UINT32 Payload[1]; // size less object gives offset to payload.
|
||||
} MTL_MAILBOX;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
// Channel Type, Low-priority, and High-priority
|
||||
typedef enum {
|
||||
MTL_CHANNEL_TYPE_LOW = 0,
|
||||
MTL_CHANNEL_TYPE_LOW = 0,
|
||||
MTL_CHANNEL_TYPE_HIGH = 1
|
||||
} MTL_CHANNEL_TYPE;
|
||||
|
||||
typedef struct {
|
||||
UINT64 PhysicalAddress;
|
||||
UINT32 ModifyMask;
|
||||
UINT32 PreserveMask;
|
||||
UINT64 PhysicalAddress;
|
||||
UINT32 ModifyMask;
|
||||
UINT32 PreserveMask;
|
||||
} MTL_DOORBELL;
|
||||
|
||||
typedef struct {
|
||||
MTL_CHANNEL_TYPE ChannelType;
|
||||
MTL_MAILBOX * CONST MailBox;
|
||||
MTL_DOORBELL DoorBell;
|
||||
MTL_CHANNEL_TYPE ChannelType;
|
||||
MTL_MAILBOX *CONST MailBox;
|
||||
MTL_DOORBELL DoorBell;
|
||||
} MTL_CHANNEL;
|
||||
|
||||
/** Wait until channel is free.
|
||||
@@ -71,7 +71,7 @@ MtlWaitUntilChannelFree (
|
||||
|
||||
@retval UINT32* Pointer to the payload.
|
||||
**/
|
||||
UINT32*
|
||||
UINT32 *
|
||||
MtlGetChannelPayload (
|
||||
IN MTL_CHANNEL *Channel
|
||||
);
|
||||
@@ -127,5 +127,4 @@ MtlReceiveMessage (
|
||||
OUT UINT32 *PayloadLength
|
||||
);
|
||||
|
||||
#endif /* ARM_MTL_LIB_H_ */
|
||||
|
||||
#endif /* ARM_MTL_LIB_H_ */
|
||||
|
@@ -14,14 +14,14 @@
|
||||
* The native size is used for the arguments.
|
||||
*/
|
||||
typedef struct {
|
||||
UINTN Arg0;
|
||||
UINTN Arg1;
|
||||
UINTN Arg2;
|
||||
UINTN Arg3;
|
||||
UINTN Arg4;
|
||||
UINTN Arg5;
|
||||
UINTN Arg6;
|
||||
UINTN Arg7;
|
||||
UINTN Arg0;
|
||||
UINTN Arg1;
|
||||
UINTN Arg2;
|
||||
UINTN Arg3;
|
||||
UINTN Arg4;
|
||||
UINTN Arg5;
|
||||
UINTN Arg6;
|
||||
UINTN Arg7;
|
||||
} ARM_SMC_ARGS;
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ typedef struct {
|
||||
**/
|
||||
VOID
|
||||
ArmCallSmc (
|
||||
IN OUT ARM_SMC_ARGS *Args
|
||||
IN OUT ARM_SMC_ARGS *Args
|
||||
);
|
||||
|
||||
#endif // ARM_SMC_LIB_H_
|
||||
|
@@ -14,14 +14,14 @@
|
||||
* The native size is used for the arguments.
|
||||
*/
|
||||
typedef struct {
|
||||
UINTN Arg0;
|
||||
UINTN Arg1;
|
||||
UINTN Arg2;
|
||||
UINTN Arg3;
|
||||
UINTN Arg4;
|
||||
UINTN Arg5;
|
||||
UINTN Arg6;
|
||||
UINTN Arg7;
|
||||
UINTN Arg0;
|
||||
UINTN Arg1;
|
||||
UINTN Arg2;
|
||||
UINTN Arg3;
|
||||
UINTN Arg4;
|
||||
UINTN Arg5;
|
||||
UINTN Arg6;
|
||||
UINTN Arg7;
|
||||
} ARM_SVC_ARGS;
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,7 @@ typedef struct {
|
||||
**/
|
||||
VOID
|
||||
ArmCallSvc (
|
||||
IN OUT ARM_SVC_ARGS *Args
|
||||
IN OUT ARM_SVC_ARGS *Args
|
||||
);
|
||||
|
||||
#endif // ARM_SVC_LIB_H_
|
||||
|
@@ -18,8 +18,8 @@
|
||||
**/
|
||||
VOID
|
||||
DefaultExceptionHandler (
|
||||
IN EFI_EXCEPTION_TYPE ExceptionType,
|
||||
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
||||
IN EFI_EXCEPTION_TYPE ExceptionType,
|
||||
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
||||
);
|
||||
|
||||
#endif // DEFAULT_EXCEPTION_HANDLER_LIB_H_
|
||||
|
@@ -8,15 +8,13 @@
|
||||
*
|
||||
**/
|
||||
|
||||
|
||||
#ifndef OEM_MISC_LIB_H_
|
||||
#define OEM_MISC_LIB_H_
|
||||
|
||||
#include <Uefi.h>
|
||||
#include <IndustryStandard/SmBios.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CpuCacheL1 = 1,
|
||||
CpuCacheL2,
|
||||
CpuCacheL3,
|
||||
@@ -27,37 +25,35 @@ typedef enum
|
||||
CpuCacheLevelMax
|
||||
} OEM_MISC_CPU_CACHE_LEVEL;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 Voltage; ///< Processor voltage
|
||||
UINT16 CurrentSpeed; ///< Current clock speed in MHz
|
||||
UINT16 MaxSpeed; ///< Maximum clock speed in MHz
|
||||
UINT16 ExternalClock; ///< External clock speed in MHz
|
||||
UINT16 CoreCount; ///< Number of cores available
|
||||
UINT16 CoresEnabled; ///< Number of cores enabled
|
||||
UINT16 ThreadCount; ///< Number of threads per processor
|
||||
typedef struct {
|
||||
UINT8 Voltage; ///< Processor voltage
|
||||
UINT16 CurrentSpeed; ///< Current clock speed in MHz
|
||||
UINT16 MaxSpeed; ///< Maximum clock speed in MHz
|
||||
UINT16 ExternalClock; ///< External clock speed in MHz
|
||||
UINT16 CoreCount; ///< Number of cores available
|
||||
UINT16 CoresEnabled; ///< Number of cores enabled
|
||||
UINT16 ThreadCount; ///< Number of threads per processor
|
||||
} OEM_MISC_PROCESSOR_DATA;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ProductNameType01,
|
||||
SerialNumType01,
|
||||
UuidType01,
|
||||
SystemManufacturerType01,
|
||||
SkuNumberType01,
|
||||
FamilyType01,
|
||||
AssertTagType02,
|
||||
SerialNumberType02,
|
||||
BoardManufacturerType02,
|
||||
SkuNumberType02,
|
||||
ChassisLocationType02,
|
||||
AssetTagType03,
|
||||
SerialNumberType03,
|
||||
VersionType03,
|
||||
ChassisTypeType03,
|
||||
ManufacturerType03,
|
||||
SkuNumberType03,
|
||||
SmbiosHiiStringFieldMax
|
||||
typedef enum {
|
||||
ProductNameType01,
|
||||
SerialNumType01,
|
||||
UuidType01,
|
||||
SystemManufacturerType01,
|
||||
SkuNumberType01,
|
||||
FamilyType01,
|
||||
AssertTagType02,
|
||||
SerialNumberType02,
|
||||
BoardManufacturerType02,
|
||||
SkuNumberType02,
|
||||
ChassisLocationType02,
|
||||
AssetTagType03,
|
||||
SerialNumberType03,
|
||||
VersionType03,
|
||||
ChassisTypeType03,
|
||||
ManufacturerType03,
|
||||
SkuNumberType03,
|
||||
SmbiosHiiStringFieldMax
|
||||
} OEM_MISC_SMBIOS_HII_STRING_FIELD;
|
||||
|
||||
/*
|
||||
@@ -74,7 +70,7 @@ typedef enum
|
||||
UINTN
|
||||
EFIAPI
|
||||
OemGetCpuFreq (
|
||||
IN UINT8 ProcessorIndex
|
||||
IN UINT8 ProcessorIndex
|
||||
);
|
||||
|
||||
/** Gets information about the specified processor and stores it in
|
||||
@@ -90,10 +86,10 @@ OemGetCpuFreq (
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
OemGetProcessorInformation (
|
||||
IN UINTN ProcessorIndex,
|
||||
IN OUT PROCESSOR_STATUS_DATA *ProcessorStatus,
|
||||
IN OUT PROCESSOR_CHARACTERISTIC_FLAGS *ProcessorCharacteristics,
|
||||
IN OUT OEM_MISC_PROCESSOR_DATA *MiscProcessorData
|
||||
IN UINTN ProcessorIndex,
|
||||
IN OUT PROCESSOR_STATUS_DATA *ProcessorStatus,
|
||||
IN OUT PROCESSOR_CHARACTERISTIC_FLAGS *ProcessorCharacteristics,
|
||||
IN OUT OEM_MISC_PROCESSOR_DATA *MiscProcessorData
|
||||
);
|
||||
|
||||
/** Gets information about the cache at the specified cache level.
|
||||
@@ -109,11 +105,11 @@ OemGetProcessorInformation (
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
OemGetCacheInformation (
|
||||
IN UINT8 ProcessorIndex,
|
||||
IN UINT8 CacheLevel,
|
||||
IN BOOLEAN DataCache,
|
||||
IN BOOLEAN UnifiedCache,
|
||||
IN OUT SMBIOS_TABLE_TYPE7 *SmbiosCacheTable
|
||||
IN UINT8 ProcessorIndex,
|
||||
IN UINT8 CacheLevel,
|
||||
IN BOOLEAN DataCache,
|
||||
IN BOOLEAN UnifiedCache,
|
||||
IN OUT SMBIOS_TABLE_TYPE7 *SmbiosCacheTable
|
||||
);
|
||||
|
||||
/** Gets the maximum number of processors supported by the platform.
|
||||
@@ -145,7 +141,7 @@ OemGetChassisType (
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
OemIsProcessorPresent (
|
||||
IN UINTN ProcessorIndex
|
||||
IN UINTN ProcessorIndex
|
||||
);
|
||||
|
||||
/** Updates the HII string for the specified field.
|
||||
@@ -157,9 +153,9 @@ OemIsProcessorPresent (
|
||||
VOID
|
||||
EFIAPI
|
||||
OemUpdateSmbiosInfo (
|
||||
IN EFI_HII_HANDLE HiiHandle,
|
||||
IN EFI_STRING_ID TokenToUpdate,
|
||||
IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
|
||||
IN EFI_HII_HANDLE HiiHandle,
|
||||
IN EFI_STRING_ID TokenToUpdate,
|
||||
IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
|
||||
);
|
||||
|
||||
/** Fetches the Type 32 boot information status.
|
||||
|
@@ -15,24 +15,24 @@
|
||||
* The 'Trusted OS Call UID' is supposed to return the following UUID for
|
||||
* OP-TEE OS. This is a 128-bit value.
|
||||
*/
|
||||
#define OPTEE_OS_UID0 0x384fb3e0
|
||||
#define OPTEE_OS_UID1 0xe7f811e3
|
||||
#define OPTEE_OS_UID2 0xaf630002
|
||||
#define OPTEE_OS_UID3 0xa5d5c51b
|
||||
#define OPTEE_OS_UID0 0x384fb3e0
|
||||
#define OPTEE_OS_UID1 0xe7f811e3
|
||||
#define OPTEE_OS_UID2 0xaf630002
|
||||
#define OPTEE_OS_UID3 0xa5d5c51b
|
||||
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_NONE 0x0
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INPUT 0x1
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_OUTPUT 0x2
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INOUT 0x3
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INPUT 0x9
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_OUTPUT 0xa
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INOUT 0xb
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_NONE 0x0
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INPUT 0x1
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_OUTPUT 0x2
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INOUT 0x3
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INPUT 0x9
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_OUTPUT 0xa
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INOUT 0xb
|
||||
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MASK 0xff
|
||||
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MASK 0xff
|
||||
|
||||
#define OPTEE_SUCCESS 0x00000000
|
||||
#define OPTEE_ORIGIN_COMMUNICATION 0x00000002
|
||||
#define OPTEE_ERROR_COMMUNICATION 0xFFFF000E
|
||||
#define OPTEE_SUCCESS 0x00000000
|
||||
#define OPTEE_ORIGIN_COMMUNICATION 0x00000002
|
||||
#define OPTEE_ERROR_COMMUNICATION 0xFFFF000E
|
||||
|
||||
typedef struct {
|
||||
UINT64 BufferAddress;
|
||||
@@ -47,44 +47,44 @@ typedef struct {
|
||||
} OPTEE_MESSAGE_PARAM_VALUE;
|
||||
|
||||
typedef union {
|
||||
OPTEE_MESSAGE_PARAM_MEMORY Memory;
|
||||
OPTEE_MESSAGE_PARAM_VALUE Value;
|
||||
OPTEE_MESSAGE_PARAM_MEMORY Memory;
|
||||
OPTEE_MESSAGE_PARAM_VALUE Value;
|
||||
} OPTEE_MESSAGE_PARAM_UNION;
|
||||
|
||||
typedef struct {
|
||||
UINT64 Attribute;
|
||||
OPTEE_MESSAGE_PARAM_UNION Union;
|
||||
UINT64 Attribute;
|
||||
OPTEE_MESSAGE_PARAM_UNION Union;
|
||||
} OPTEE_MESSAGE_PARAM;
|
||||
|
||||
#define OPTEE_MAX_CALL_PARAMS 4
|
||||
#define OPTEE_MAX_CALL_PARAMS 4
|
||||
|
||||
typedef struct {
|
||||
UINT32 Command;
|
||||
UINT32 Function;
|
||||
UINT32 Session;
|
||||
UINT32 CancelId;
|
||||
UINT32 Pad;
|
||||
UINT32 Return;
|
||||
UINT32 ReturnOrigin;
|
||||
UINT32 NumParams;
|
||||
UINT32 Command;
|
||||
UINT32 Function;
|
||||
UINT32 Session;
|
||||
UINT32 CancelId;
|
||||
UINT32 Pad;
|
||||
UINT32 Return;
|
||||
UINT32 ReturnOrigin;
|
||||
UINT32 NumParams;
|
||||
|
||||
// NumParams tells the actual number of element in Params
|
||||
OPTEE_MESSAGE_PARAM Params[OPTEE_MAX_CALL_PARAMS];
|
||||
OPTEE_MESSAGE_PARAM Params[OPTEE_MAX_CALL_PARAMS];
|
||||
} OPTEE_MESSAGE_ARG;
|
||||
|
||||
typedef struct {
|
||||
EFI_GUID Uuid; // [in] GUID/UUID of the Trusted Application
|
||||
UINT32 Session; // [out] Session id
|
||||
UINT32 Return; // [out] Return value
|
||||
UINT32 ReturnOrigin; // [out] Origin of the return value
|
||||
EFI_GUID Uuid; // [in] GUID/UUID of the Trusted Application
|
||||
UINT32 Session; // [out] Session id
|
||||
UINT32 Return; // [out] Return value
|
||||
UINT32 ReturnOrigin; // [out] Origin of the return value
|
||||
} OPTEE_OPEN_SESSION_ARG;
|
||||
|
||||
typedef struct {
|
||||
UINT32 Function; // [in] Trusted Application function, specific to the TA
|
||||
UINT32 Session; // [in] Session id
|
||||
UINT32 Return; // [out] Return value
|
||||
UINT32 ReturnOrigin; // [out] Origin of the return value
|
||||
OPTEE_MESSAGE_PARAM Params[OPTEE_MAX_CALL_PARAMS]; // Params for function to be invoked
|
||||
UINT32 Function; // [in] Trusted Application function, specific to the TA
|
||||
UINT32 Session; // [in] Session id
|
||||
UINT32 Return; // [out] Return value
|
||||
UINT32 ReturnOrigin; // [out] Origin of the return value
|
||||
OPTEE_MESSAGE_PARAM Params[OPTEE_MAX_CALL_PARAMS]; // Params for function to be invoked
|
||||
} OPTEE_INVOKE_FUNCTION_ARG;
|
||||
|
||||
BOOLEAN
|
||||
@@ -102,19 +102,19 @@ OpteeInit (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
OpteeOpenSession (
|
||||
IN OUT OPTEE_OPEN_SESSION_ARG *OpenSessionArg
|
||||
IN OUT OPTEE_OPEN_SESSION_ARG *OpenSessionArg
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
OpteeCloseSession (
|
||||
IN UINT32 Session
|
||||
IN UINT32 Session
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
OpteeInvokeFunction (
|
||||
IN OUT OPTEE_INVOKE_FUNCTION_ARG *InvokeFunctionArg
|
||||
IN OUT OPTEE_INVOKE_FUNCTION_ARG *InvokeFunctionArg
|
||||
);
|
||||
|
||||
#endif // OPTEE_LIB_H_
|
||||
|
@@ -17,12 +17,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define SEMIHOST_FILE_MODE_READ (0 << 2)
|
||||
#define SEMIHOST_FILE_MODE_WRITE (1 << 2)
|
||||
#define SEMIHOST_FILE_MODE_APPEND (2 << 2)
|
||||
#define SEMIHOST_FILE_MODE_UPDATE (1 << 1)
|
||||
#define SEMIHOST_FILE_MODE_BINARY (1 << 0)
|
||||
#define SEMIHOST_FILE_MODE_ASCII (0 << 0)
|
||||
#define SEMIHOST_FILE_MODE_READ (0 << 2)
|
||||
#define SEMIHOST_FILE_MODE_WRITE (1 << 2)
|
||||
#define SEMIHOST_FILE_MODE_APPEND (2 << 2)
|
||||
#define SEMIHOST_FILE_MODE_UPDATE (1 << 1)
|
||||
#define SEMIHOST_FILE_MODE_BINARY (1 << 0)
|
||||
#define SEMIHOST_FILE_MODE_ASCII (0 << 0)
|
||||
|
||||
BOOLEAN
|
||||
SemihostConnectionSupported (
|
||||
@@ -31,9 +31,9 @@ SemihostConnectionSupported (
|
||||
|
||||
RETURN_STATUS
|
||||
SemihostFileOpen (
|
||||
IN CHAR8 *FileName,
|
||||
IN UINT32 Mode,
|
||||
OUT UINTN *FileHandle
|
||||
IN CHAR8 *FileName,
|
||||
IN UINT32 Mode,
|
||||
OUT UINTN *FileHandle
|
||||
);
|
||||
|
||||
RETURN_STATUS
|
||||
@@ -81,7 +81,7 @@ SemihostFileLength (
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
SemihostFileTmpName(
|
||||
SemihostFileTmpName (
|
||||
OUT VOID *Buffer,
|
||||
IN UINT8 Identifier,
|
||||
IN UINTN Length
|
||||
@@ -89,7 +89,7 @@ SemihostFileTmpName(
|
||||
|
||||
RETURN_STATUS
|
||||
SemihostFileRemove (
|
||||
IN CHAR8 *FileName
|
||||
IN CHAR8 *FileName
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -104,7 +104,7 @@ SemihostFileRemove (
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
SemihostFileRename(
|
||||
SemihostFileRename (
|
||||
IN CHAR8 *FileName,
|
||||
IN CHAR8 *NewFileName
|
||||
);
|
||||
@@ -116,17 +116,17 @@ SemihostReadCharacter (
|
||||
|
||||
VOID
|
||||
SemihostWriteCharacter (
|
||||
IN CHAR8 Character
|
||||
IN CHAR8 Character
|
||||
);
|
||||
|
||||
VOID
|
||||
SemihostWriteString (
|
||||
IN CHAR8 *String
|
||||
IN CHAR8 *String
|
||||
);
|
||||
|
||||
UINT32
|
||||
SemihostSystem (
|
||||
IN CHAR8 *CommandLine
|
||||
IN CHAR8 *CommandLine
|
||||
);
|
||||
|
||||
#endif // SEMIHOSTING_LIB_H_
|
||||
|
@@ -11,26 +11,26 @@
|
||||
|
||||
EFI_STATUS
|
||||
ArmSetMemoryRegionNoExec (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
ArmClearMemoryRegionNoExec (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
ArmSetMemoryRegionReadOnly (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
ArmClearMemoryRegionReadOnly (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
||||
#endif /* STANDALONE_MM_MMU_LIB_ */
|
||||
|
Reference in New Issue
Block a user