From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v2 05/15] xen/arm: segregate GIC low level functionality Date: Wed, 9 Apr 2014 16:55:26 +0100 Message-ID: <1397058926.6275.134.camel@kazak.uk.xensource.com> References: <1396612593-443-1-git-send-email-vijay.kilari@gmail.com> <1396612593-443-6-git-send-email-vijay.kilari@gmail.com> <533EB9C4.3020709@linaro.org> <53450697.8040506@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53450697.8040506@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: Julien Grall Cc: Vijay Kilari , Stefano Stabellini , Prasun Kapoor , Vijaya Kumar K , xen-devel@lists.xen.org, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Wed, 2014-04-09 at 09:36 +0100, Julien Grall wrote: > >> [..] > >> > >>> + void (*enable_irq)(int); > >>> + void (*disable_irq)(int); > >>> + void (*eoi_irq)(int); > >>> + void (*deactivate_irq)(int); > >>> + unsigned int (*ack_irq)(void); > >> > >> I would prefer to introduce a new hw_irq_controller here rather than > >> adding another abstraction. > >> > > hw_irq_controller can be used only for enable_irq, disable_irq & eoi_irq. > > other callbacks in hw_irq_controller cannot be used. > > > > Ex: ack_irq in our case returns the irq where as 'ack' callback in > > hw_irq_controller > > does not return a value. So not suitable here. > > Hmmm... rigth for deactivate_irq and ack_irq. For the others you can > definitely use the hw_irq_controller. Perhaps struct gic_irq_controller { struct hw_irq_controller hw_irq; unsigned int (*ack_irq)(void) } And use container_of to go fom a hw_Irq to a gic_irq_controller when needed? Ian.