mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-24 05:54:08 +00:00

This patch provides separation of GICD, GICR accessor functions and adds new macros for GICv3 registers access as a preparation for GICv3.1 and GICv4 support. NOTE: Platforms need to modify to include both 'gicdv3_helpers.c' and 'gicrv3_helpers.c' instead of the single helper file previously. Change-Id: I1641bd6d217d6eb7d1228be3c4177b2d556da60a Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
58 lines
1.4 KiB
C
58 lines
1.4 KiB
C
/*
|
|
* Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "gicv3_private.h"
|
|
|
|
/*******************************************************************************
|
|
* GIC Distributor interface accessors for bit operations
|
|
******************************************************************************/
|
|
|
|
/*
|
|
* Accessor to read the GIC Distributor IGRPMODR corresponding to the
|
|
* interrupt `id`, 32 interrupt IDs at a time.
|
|
*/
|
|
uint32_t gicd_read_igrpmodr(uintptr_t base, unsigned int id)
|
|
{
|
|
return GICD_READ(IGRPMODR, base, id);
|
|
}
|
|
|
|
/*
|
|
* Accessor to write the GIC Distributor IGRPMODR corresponding to the
|
|
* interrupt `id`, 32 interrupt IDs at a time.
|
|
*/
|
|
void gicd_write_igrpmodr(uintptr_t base, unsigned int id, uint32_t val)
|
|
{
|
|
GICD_WRITE(IGRPMODR, base, id, val);
|
|
}
|
|
|
|
/*
|
|
* Accessor to get the bit corresponding to interrupt ID
|
|
* in GIC Distributor IGRPMODR.
|
|
*/
|
|
unsigned int gicd_get_igrpmodr(uintptr_t base, unsigned int id)
|
|
{
|
|
return GICD_GET_BIT(IGRPMODR, base, id);
|
|
}
|
|
|
|
/*
|
|
* Accessor to set the bit corresponding to interrupt ID
|
|
* in GIC Distributor IGRPMODR.
|
|
*/
|
|
void gicd_set_igrpmodr(uintptr_t base, unsigned int id)
|
|
{
|
|
GICD_SET_BIT(IGRPMODR, base, id);
|
|
}
|
|
|
|
/*
|
|
* Accessor to clear the bit corresponding to interrupt ID
|
|
* in GIC Distributor IGRPMODR.
|
|
*/
|
|
void gicd_clr_igrpmodr(uintptr_t base, unsigned int id)
|
|
{
|
|
GICD_CLR_BIT(IGRPMODR, base, id);
|
|
}
|