From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH ARM v6 12/14] mini-os: arm: interrupt controller Date: Mon, 21 Jul 2014 18:56:22 +0100 Message-ID: <53CD5446.1010508@linaro.org> References: <1405508874-3921-1-git-send-email-talex5@gmail.com> <1405508874-3921-13-git-send-email-talex5@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X9Hp6-0004Mk-Di for xen-devel@lists.xenproject.org; Mon, 21 Jul 2014 17:56:28 +0000 Received: by mail-wg0-f49.google.com with SMTP id k14so6759283wgh.20 for ; Mon, 21 Jul 2014 10:56:26 -0700 (PDT) In-Reply-To: <1405508874-3921-13-git-send-email-talex5@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Thomas Leonard , xen-devel@lists.xenproject.org Cc: samuel.thibault@ens-lyon.org, stefano.stabellini@eu.citrix.com, Dave.Scott@eu.citrix.com, anil@recoil.org List-Id: xen-devel@lists.xenproject.org Hi Thomas, On 07/16/2014 12:07 PM, Thomas Leonard wrote: > +/* Note: not thread safe (but we only support one CPU for now anyway) */ > +static void gic_enable_interrupt(struct gic *gic, int irq_number, > + unsigned char cpu_set, unsigned char level_sensitive, unsigned char ppi) > +{ > + void *set_enable_reg; > + void *cfg_reg; > + > + // set priority > + gic_set_priority(gic, irq_number, 0x0); > + > + // set target cpus for this interrupt > + gic_route_interrupt(gic, irq_number, cpu_set); > + > + // set level/edge triggered > + cfg_reg = (void *)gicd(gic, GICD_ICFGR); > + level_sensitive ? clear_bit_non_atomic((irq_number * 2) + 1, cfg_reg) : set_bit_non_atomic((irq_number * 2) + 1, cfg_reg); I didn't spot this before. Why didn't you use if (level_sensitive)...? I found this line very hard to read. [..] > +//FIXME Get event_irq from dt > +#define EVENTS_IRQ 31 > +#define VIRTUALTIMER_IRQ 27 Any plan to get this from the DT soon? The rest of the patch looks good to me. Regards, -- Julien Grall