From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v4 03/16] xen/arm: make sgi handling generic Date: Mon, 26 May 2014 13:45:44 +0100 Message-ID: <53833778.20801@linaro.org> References: <1401100009-7326-1-git-send-email-vijay.kilari@gmail.com> <1401100009-7326-4-git-send-email-vijay.kilari@gmail.com> <53833664.1030304@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53833664.1030304@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: vijay.kilari@gmail.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, stefano.stabellini@citrix.com, xen-devel@lists.xen.org Cc: Prasun.Kapoor@caviumnetworks.com, vijaya.kumar@caviumnetworks.com List-Id: xen-devel@lists.xenproject.org On 26/05/14 13:41, Julien Grall wrote: > Hi Vijay, > > On 26/05/14 11:26, vijay.kilari@gmail.com wrote: >> From: Vijaya Kumar K >> >> move all the hw specific sgi handling functionality >> to one function and use it. >> >> Signed-off-by: Vijaya Kumar K >> --- >> 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<> + break; >> + default: >> + BUG_ON(1); > > You can directly use BUG() here. Just noticed the BUG_ON was asked by me before. Sorry to mislead you. -- Julien Grall