Hi Vijay,
On 26/05/14 11:26, vijay.kilari@xxxxxxxxx wrote:
From: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx>
move all the hw specific sgi handling functionality
to one function and use it.
Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx>
---
xen/arch/arm/gic.c | 37 ++++++++++++++++++++++++++++---------
xen/include/asm-arm/gic.h | 8 ++++++++
2 files changed, 36 insertions(+), 9 deletions(-)
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index efcd785..f8e49df 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -483,21 +483,40 @@ void __init gic_init(void)
spin_unlock(&gic.lock);
}
-void send_SGI_mask(const cpumask_t *cpumask, enum gic_sgi sgi)
+static void send_SGI(const cpumask_t *cpu_mask, enum gic_sgi sgi,
+ uint8_t irqmode)
You define the enum gic_sgi_mode below, you should use it here rather
than uint8_t.
{
unsigned int mask = 0;
+
+ switch ( irqmode )
+ {
+ case SGI_TARGET_OTHERS:
+ GICD[GICD_SGIR] = GICD_SGI_TARGET_OTHERS | sgi;
+ break;
+ case SGI_TARGET_SELF:
+ GICD[GICD_SGIR] = GICD_SGI_TARGET_SELF | sgi;
+ break;
+ case SGI_TARGET_LIST:
+ mask = gic_cpu_mask(cpu_mask);
+ GICD[GICD_SGIR] = GICD_SGI_TARGET_LIST |
+ (mask<<GICD_SGI_TARGET_SHIFT) | sgi;
+ break;
+ default:
+ BUG_ON(1);
You can directly use BUG() here.