TianoCore EDK2 master
Loading...
Searching...
No Matches
ArmGicLib.c File Reference
#include <Base.h>
#include <Library/ArmGicLib.h>
#include <Library/ArmLib.h>
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
#include <Library/PcdLib.h>

Go to the source code of this file.

Macros

#define GIC_V3_REDISTRIBUTOR_GRANULARITY
 
#define GIC_V4_REDISTRIBUTOR_GRANULARITY
 
#define ISENABLER_ADDRESS(base, offset)
 
#define ICENABLER_ADDRESS(base, offset)
 
#define IPRIORITY_ADDRESS(base, offset)
 

Functions

STATIC BOOLEAN SourceIsSpi (IN UINTN Source)
 
STATIC UINTN GicGetCpuRedistributorBase (IN UINTN GicRedistributorBase, IN ARM_GIC_ARCH_REVISION Revision)
 
UINT32 EFIAPI ArmGicGetInterfaceIdentification (IN UINTN GicInterruptInterfaceBase)
 
UINTN EFIAPI ArmGicGetMaxNumInterrupts (IN UINTN GicDistributorBase)
 
VOID EFIAPI ArmGicSendSgiTo (IN UINTN GicDistributorBase, IN UINT8 TargetListFilter, IN UINT8 CPUTargetList, IN UINT8 SgiId)
 
UINTN EFIAPI ArmGicAcknowledgeInterrupt (IN UINTN GicInterruptInterfaceBase, OUT UINTN *InterruptId)
 
VOID EFIAPI ArmGicEndOfInterrupt (IN UINTN GicInterruptInterfaceBase, IN UINTN Source)
 
VOID EFIAPI ArmGicSetInterruptPriority (IN UINTN GicDistributorBase, IN UINTN GicRedistributorBase, IN UINTN Source, IN UINT32 Priority)
 
VOID EFIAPI ArmGicEnableInterrupt (IN UINTN GicDistributorBase, IN UINTN GicRedistributorBase, IN UINTN Source)
 
VOID EFIAPI ArmGicDisableInterrupt (IN UINTN GicDistributorBase, IN UINTN GicRedistributorBase, IN UINTN Source)
 
BOOLEAN EFIAPI ArmGicIsInterruptEnabled (IN UINTN GicDistributorBase, IN UINTN GicRedistributorBase, IN UINTN Source)
 
VOID EFIAPI ArmGicDisableDistributor (IN UINTN GicDistributorBase)
 
VOID EFIAPI ArmGicEnableInterruptInterface (IN UINTN GicInterruptInterfaceBase)
 
VOID EFIAPI ArmGicDisableInterruptInterface (IN UINTN GicInterruptInterfaceBase)
 

Detailed Description

Copyright (c) 2011-2023, Arm Limited. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file ArmGicLib.c.

Macro Definition Documentation

◆ GIC_V3_REDISTRIBUTOR_GRANULARITY

#define GIC_V3_REDISTRIBUTOR_GRANULARITY
Value:
(ARM_GICR_CTLR_FRAME_SIZE \
+ ARM_GICR_SGI_PPI_FRAME_SIZE)

Definition at line 18 of file ArmGicLib.c.

◆ GIC_V4_REDISTRIBUTOR_GRANULARITY

#define GIC_V4_REDISTRIBUTOR_GRANULARITY
Value:
(GIC_V3_REDISTRIBUTOR_GRANULARITY \
+ ARM_GICR_SGI_VLPI_FRAME_SIZE \
+ ARM_GICR_SGI_RESERVED_FRAME_SIZE)

Definition at line 23 of file ArmGicLib.c.

◆ ICENABLER_ADDRESS

#define ICENABLER_ADDRESS (   base,
  offset 
)
Value:
((base) +\
ARM_GICR_CTLR_FRAME_SIZE + ARM_GICR_ICENABLER + 4 * (offset))

Definition at line 30 of file ArmGicLib.c.

◆ IPRIORITY_ADDRESS

#define IPRIORITY_ADDRESS (   base,
  offset 
)
Value:
((base) +\
ARM_GICR_CTLR_FRAME_SIZE + ARM_GIC_ICDIPR + 4 * (offset))

Definition at line 33 of file ArmGicLib.c.

◆ ISENABLER_ADDRESS

#define ISENABLER_ADDRESS (   base,
  offset 
)
Value:
((base) +\
ARM_GICR_CTLR_FRAME_SIZE + ARM_GICR_ISENABLER + 4 * (offset))

Definition at line 27 of file ArmGicLib.c.

Function Documentation

◆ ArmGicAcknowledgeInterrupt()

UINTN EFIAPI ArmGicAcknowledgeInterrupt ( IN UINTN  GicInterruptInterfaceBase,
OUT UINTN InterruptId 
)

Definition at line 173 of file ArmGicLib.c.

◆ ArmGicDisableDistributor()

VOID EFIAPI ArmGicDisableDistributor ( IN UINTN  GicDistributorBase)

Definition at line 405 of file ArmGicLib.c.

◆ ArmGicDisableInterrupt()

VOID EFIAPI ArmGicDisableInterrupt ( IN UINTN  GicDistributorBase,
IN UINTN  GicRedistributorBase,
IN UINTN  Source 
)

Definition at line 317 of file ArmGicLib.c.

◆ ArmGicDisableInterruptInterface()

VOID EFIAPI ArmGicDisableInterruptInterface ( IN UINTN  GicInterruptInterfaceBase)

Definition at line 433 of file ArmGicLib.c.

◆ ArmGicEnableInterrupt()

VOID EFIAPI ArmGicEnableInterrupt ( IN UINTN  GicDistributorBase,
IN UINTN  GicRedistributorBase,
IN UINTN  Source 
)

Definition at line 272 of file ArmGicLib.c.

◆ ArmGicEnableInterruptInterface()

VOID EFIAPI ArmGicEnableInterruptInterface ( IN UINTN  GicInterruptInterfaceBase)

Definition at line 415 of file ArmGicLib.c.

◆ ArmGicEndOfInterrupt()

VOID EFIAPI ArmGicEndOfInterrupt ( IN UINTN  GicInterruptInterfaceBase,
IN UINTN  Source 
)

Definition at line 208 of file ArmGicLib.c.

◆ ArmGicGetInterfaceIdentification()

UINT32 EFIAPI ArmGicGetInterfaceIdentification ( IN UINTN  GicInterruptInterfaceBase)

Return the GIC CPU Interrupt Interface ID.

Parameters
GicInterruptInterfaceBaseBase address of the GIC Interrupt Interface.
Return values
CPUInterface Identification information.

Definition at line 116 of file ArmGicLib.c.

◆ ArmGicGetMaxNumInterrupts()

UINTN EFIAPI ArmGicGetMaxNumInterrupts ( IN UINTN  GicDistributorBase)

Definition at line 126 of file ArmGicLib.c.

◆ ArmGicIsInterruptEnabled()

BOOLEAN EFIAPI ArmGicIsInterruptEnabled ( IN UINTN  GicDistributorBase,
IN UINTN  GicRedistributorBase,
IN UINTN  Source 
)

Definition at line 361 of file ArmGicLib.c.

◆ ArmGicSendSgiTo()

VOID EFIAPI ArmGicSendSgiTo ( IN UINTN  GicDistributorBase,
IN UINT8  TargetListFilter,
IN UINT8  CPUTargetList,
IN UINT8  SgiId 
)

Definition at line 142 of file ArmGicLib.c.

◆ ArmGicSetInterruptPriority()

VOID EFIAPI ArmGicSetInterruptPriority ( IN UINTN  GicDistributorBase,
IN UINTN  GicRedistributorBase,
IN UINTN  Source,
IN UINT32  Priority 
)

Definition at line 227 of file ArmGicLib.c.

◆ GicGetCpuRedistributorBase()

STATIC UINTN GicGetCpuRedistributorBase ( IN UINTN  GicRedistributorBase,
IN ARM_GIC_ARCH_REVISION  Revision 
)

Return the base address of the GIC redistributor for the current CPU

Parameters
RevisionGIC Revision. The GIC redistributor might have a different granularity following the GIC revision.
Return values
Baseaddress of the associated GIC Redistributor

Definition at line 59 of file ArmGicLib.c.

◆ SourceIsSpi()

STATIC BOOLEAN SourceIsSpi ( IN UINTN  Source)

Return whether the Source interrupt index refers to a shared interrupt (SPI)

Definition at line 42 of file ArmGicLib.c.