irqchip: gic: add support to return pending interrupt on particular cpu

gic_is_any_irq_pending() returns true if any interrupt is pending on the
particular cpu on which this function is executed.

Change-Id: Ibea5cb2342bad745e7712430951c8be531475c90
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
This commit is contained in:
Anji Jonnala 2015-02-10 12:48:20 +05:30
parent dc75cd31d6
commit e5cd40480e
2 changed files with 19 additions and 2 deletions

View file

@ -2,7 +2,7 @@
* linux/arch/arm/common/gic.c
*
* Copyright (C) 2002 ARM Limited, All Rights Reserved.
* Copyright (c) 2014, The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@ -268,6 +268,21 @@ void gic_show_pending_irq(void)
}
}
bool gic_is_any_irq_pending(void)
{
struct gic_chip_data *gic = &gic_data[0];
void __iomem *cpu_base = gic_data_cpu_base(gic);
int val;
val = readl_relaxed_no_log(cpu_base + GIC_CPU_HIGHPRI);
val &= GIC_INVL_INTERRUPT_MASK;
if (val == GIC_INVL_INTERRUPT_MASK)
return 0;
else
return 1;
}
EXPORT_SYMBOL(gic_is_any_irq_pending);
static void gic_show_resume_irq(struct gic_chip_data *gic)
{
unsigned int i;

View file

@ -2,7 +2,7 @@
* include/linux/irqchip/arm-gic.h
*
* Copyright (C) 2002 ARM Limited, All Rights Reserved.
* Copyright (c) 2014, The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@ -32,6 +32,7 @@
#define GIC_DIST_TARGET 0x800
#define GIC_DIST_CONFIG 0xc00
#define GIC_DIST_SOFTINT 0xf00
#define GIC_INVL_INTERRUPT_MASK 0x3ff
#define GICH_HCR 0x0
#define GICH_VTR 0x4
@ -69,6 +70,7 @@ void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *,
void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
bool gic_is_irq_pending(unsigned int irq);
void gic_clear_irq_pending(unsigned int irq);
bool gic_is_any_irq_pending(void);
#ifdef CONFIG_ARM_GIC
void gic_set_irq_secure(unsigned int irq);
#else