From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [RFC PATCH 1/3] Xen: generalized event channel operations. Date: Wed, 2 Jan 2013 14:13:29 +0000 Message-ID: <50E44089.4030602@citrix.com> References: <1356979137-18484-1-git-send-email-wei.liu2@citrix.com> <1356979137-18484-2-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1356979137-18484-2-git-send-email-wei.liu2@citrix.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: Wei Liu Cc: konrad.wilk@oracle.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 31/12/12 18:38, Wei Liu wrote: > Changeset description is too brief. Why is this change needed? > Signed-off-by: Wei Liu > --- > drivers/xen/events.c | 110 ++++++++++++++++++++++++++++++++++---------------- > 1 file changed, 76 insertions(+), 34 deletions(-) > > diff --git a/drivers/xen/events.c b/drivers/xen/events.c > index 7595581..835101f 100644 > --- a/drivers/xen/events.c > +++ b/drivers/xen/events.c > @@ -51,6 +51,23 @@ > #include > #include > > +/* N-level event channel, starting from 2 */ > +static unsigned int evtchn_level = 2; > + > +struct evtchn_ops { > + unsigned long (*active_evtchns)(unsigned int, > + struct shared_info*, unsigned int); > + void (*clear_evtchn)(int); > + void (*set_evtchn)(int); > + int (*test_evtchn)(int); > + void (*mask_evtchn)(int); > + void (*unmask_evtchn)(int); > + int (*is_masked)(int); > + void (*xen_evtchn_do_upcall)(void); > + irqreturn_t (*xen_debug_interrupt)(int, void*); > +}; > +static struct evtchn_ops *eops; Suggest not using a pointer here to avoid the indirection. > + > /* > * This lock protects updates to the following mapping and reference-count > * arrays. The lock does not need to be acquired to read the mapping tables. > @@ -285,9 +302,9 @@ static bool pirq_needs_eoi_flag(unsigned irq) [...] > @@ -1783,12 +1809,28 @@ void xen_callback_vector(void) > void xen_callback_vector(void) {} > #endif > > +static struct evtchn_ops evtchn_ops_l2 __read_mostly = { const > + .active_evtchns = __active_evtchns_l2, > + .clear_evtchn = __clear_evtchn_l2, > + .set_evtchn = __set_evtchn_l2, > + .test_evtchn = __test_evtchn_l2, > + .mask_evtchn = __mask_evtchn_l2, > + .unmask_evtchn = __unmask_evtchn_l2, > + .is_masked = __is_masked_l2, > + .xen_evtchn_do_upcall = __xen_evtchn_do_upcall_l2, > + .xen_debug_interrupt = __xen_debug_interrupt_l2, > +}; David