From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Leonard Subject: [PATCH 7/7] mini-os: Moved force_evtchn_callback to header Date: Wed, 4 Jun 2014 17:06:38 +0100 Message-ID: <1401897998-29569-8-git-send-email-talex5@gmail.com> References: <538D9161.6090402@linaro.org> <1401897998-29569-1-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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WsDjY-0005RF-Tl for xen-devel@lists.xenproject.org; Wed, 04 Jun 2014 16:08:13 +0000 Received: by mail-wi0-f175.google.com with SMTP id f8so8837232wiw.2 for ; Wed, 04 Jun 2014 09:08:09 -0700 (PDT) In-Reply-To: <1401897998-29569-1-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: xen-devel@lists.xenproject.org Cc: Thomas Leonard List-Id: xen-devel@lists.xenproject.org From: Karim Raslan Signed-off-by: Karim Allah Ahmed [talex5@gmail.com: separated from big ARM commit] Signed-off-by: Thomas Leonard --- extras/mini-os/hypervisor.c | 20 +------------------- extras/mini-os/include/hypervisor.h | 1 - extras/mini-os/include/x86/os.h | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/extras/mini-os/hypervisor.c b/extras/mini-os/hypervisor.c index b4688a0..9c79d5d 100644 --- a/extras/mini-os/hypervisor.c +++ b/extras/mini-os/hypervisor.c @@ -71,23 +71,6 @@ void do_hypervisor_callback(struct pt_regs *regs) in_callback = 0; } -void force_evtchn_callback(void) -{ - int save; - vcpu_info_t *vcpu; - vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; - save = vcpu->evtchn_upcall_mask; - - while (vcpu->evtchn_upcall_pending) { - vcpu->evtchn_upcall_mask = 1; - barrier(); - do_hypervisor_callback(NULL); - barrier(); - vcpu->evtchn_upcall_mask = save; - barrier(); - }; -} - inline void mask_evtchn(uint32_t port) { shared_info_t *s = HYPERVISOR_shared_info; @@ -110,8 +93,7 @@ inline void unmask_evtchn(uint32_t port) &vcpu_info->evtchn_pending_sel) ) { vcpu_info->evtchn_upcall_pending = 1; - if ( !vcpu_info->evtchn_upcall_mask ) - force_evtchn_callback(); + force_evtchn_callback(); } } diff --git a/extras/mini-os/include/hypervisor.h b/extras/mini-os/include/hypervisor.h index a62cb78..9e9cac8 100644 --- a/extras/mini-os/include/hypervisor.h +++ b/extras/mini-os/include/hypervisor.h @@ -35,7 +35,6 @@ extern union start_info_union start_info_union; #define start_info (start_info_union.start_info) /* hypervisor.c */ -void force_evtchn_callback(void); void do_hypervisor_callback(struct pt_regs *regs); void mask_evtchn(uint32_t port); void unmask_evtchn(uint32_t port); diff --git a/extras/mini-os/include/x86/os.h b/extras/mini-os/include/x86/os.h index 73b8297..8eea1be 100644 --- a/extras/mini-os/include/x86/os.h +++ b/extras/mini-os/include/x86/os.h @@ -160,6 +160,23 @@ do { \ */ typedef struct { volatile int counter; } atomic_t; +static inline void force_evtchn_callback(void) +{ + int save; + vcpu_info_t *vcpu; + vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; + save = vcpu->evtchn_upcall_mask; + + while (vcpu->evtchn_upcall_pending) { + vcpu->evtchn_upcall_mask = 1; + barrier(); + do_hypervisor_callback(NULL); + barrier(); + vcpu->evtchn_upcall_mask = save; + barrier(); + }; +} + /************************** i386 *******************************/ #ifdef __INSIDE_MINIOS__ -- 2.0.0