From f10c551f546b116f964dc917fc325856cb212bed Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 14 Mar 2022 15:09:04 +0100 Subject: bsps: Add gicv3_sgi_ppi_is_pending() --- bsps/include/dev/irq/arm-gicv3.h | 11 +++++++++++ bsps/shared/dev/irq/arm-gicv3.c | 5 +---- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'bsps') diff --git a/bsps/include/dev/irq/arm-gicv3.h b/bsps/include/dev/irq/arm-gicv3.h index 60bc315962..0583fded0a 100644 --- a/bsps/include/dev/irq/arm-gicv3.h +++ b/bsps/include/dev/irq/arm-gicv3.h @@ -9,6 +9,7 @@ */ /* + * Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de) * Copyright (C) 2019 On-Line Applications Research Corporation (OAR) * * Redistribution and use in source and binary forms, with or without @@ -155,6 +156,16 @@ static inline volatile gic_sgi_ppi *gicv3_get_sgi_ppi(uint32_t cpu_index) ((uintptr_t)BSP_ARM_GIC_REDIST_BASE + cpu_index * 0x20000 + 0x10000); } +static inline bool gicv3_sgi_ppi_is_pending( + rtems_vector_number vector, + uint32_t cpu_index +) +{ + volatile gic_sgi_ppi *sgi_ppi = gicv3_get_sgi_ppi(cpu_index); + + return (sgi_ppi->icspispendr[0] & (1U << vector)) != 0; +} + #ifdef __cplusplus } #endif diff --git a/bsps/shared/dev/irq/arm-gicv3.c b/bsps/shared/dev/irq/arm-gicv3.c index 58f97c4f43..682af67b21 100644 --- a/bsps/shared/dev/irq/arm-gicv3.c +++ b/bsps/shared/dev/irq/arm-gicv3.c @@ -87,10 +87,7 @@ rtems_status_code bsp_interrupt_is_pending( bsp_interrupt_assert(pending != NULL); if (vector <= ARM_GIC_IRQ_PPI_LAST) { - volatile gic_sgi_ppi *sgi_ppi = - gicv3_get_sgi_ppi(_SMP_Get_current_processor()); - - *pending = (sgi_ppi->icspispendr[0] & (1U << vector)) != 0; + *pending = gicv3_sgi_ppi_is_pending(vector, _SMP_Get_current_processor()); } else { volatile gic_dist *dist = ARM_GIC_DIST; -- cgit v1.2.3