[XEN] Abstract setting of master event-pending flag into asm/event.h.

Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kfraser@dhcp93.uk.xensource.com committed 2006-06-14 13:48:04 +01:00
1 parent e8ef894fec
commit a5e28e588e
4 files changed
+19 -9

No files matched your search

+1 -1
View File
@@ -1279,7 +1279,7 @@ asmlinkage int do_general_protection(struct cpu_user_regs *regs)
static void nmi_softirq(void)
{
/* Only used to defer wakeup of dom0,vcpu0 to a safe (non-NMI) context. */
evtchn_notify(dom0->vcpu[0]);
vcpu_kick(dom0->vcpu[0]);
}
static void nmi_dom0_report(unsigned int reason_idx)
+4 -6
View File
@@ -493,10 +493,9 @@ void evtchn_set_pending(struct vcpu *v, int port)
if ( !test_bit (port, s->evtchn_mask) &&
!test_and_set_bit(port / BITS_PER_LONG,
&v->vcpu_info->evtchn_pending_sel) &&
!test_and_set_bit(0, &v->vcpu_info->evtchn_upcall_pending) )
&v->vcpu_info->evtchn_pending_sel) )
{
evtchn_notify(v);
vcpu_mark_events_pending(v);
}
/* Check if some VCPU might be polling for this event. */
@@ -682,10 +681,9 @@ static long evtchn_unmask(evtchn_unmask_t *unmask)
if ( test_and_clear_bit(port, s->evtchn_mask) &&
test_bit (port, s->evtchn_pending) &&
!test_and_set_bit (port / BITS_PER_LONG,
&v->vcpu_info->evtchn_pending_sel) &&
!test_and_set_bit (0, &v->vcpu_info->evtchn_upcall_pending) )
&v->vcpu_info->evtchn_pending_sel) )
{
evtchn_notify(v);
vcpu_mark_events_pending(v);
}
spin_unlock(&d->evtchn_lock);
+7 -1
View File
@@ -12,7 +12,7 @@
#include <public/arch-ia64.h>
#include <asm/vcpu.h>
static inline void evtchn_notify(struct vcpu *v)
static inline void vcpu_kick(struct vcpu *v)
{
/*
* NB1. 'vcpu_flags' and 'processor' must be checked /after/ update of
@@ -32,6 +32,12 @@ static inline void evtchn_notify(struct vcpu *v)
vcpu_pend_interrupt(v, v->domain->shared_info->arch.evtchn_vector);
}
static inline void vcpu_mark_events_pending(struct vcpu *v)
{
if ( !test_and_set_bit(0, &v->vcpu_info->evtchn_upcall_pending) )
vcpu_kick(v);
}
/* Note: Bitwise operations result in fast code with no branches. */
#define event_pending(v) \
(!!(v)->vcpu_info->evtchn_upcall_pending & \
+7 -1
View File
@@ -9,7 +9,7 @@
#ifndef __ASM_EVENT_H__
#define __ASM_EVENT_H__
static inline void evtchn_notify(struct vcpu *v)
static inline void vcpu_kick(struct vcpu *v)
{
/*
* NB1. 'vcpu_flags' and 'processor' must be checked /after/ update of
@@ -26,6 +26,12 @@ static inline void evtchn_notify(struct vcpu *v)
smp_send_event_check_cpu(v->processor);
}
static inline void vcpu_mark_events_pending(struct vcpu *v)
{
if ( !test_and_set_bit(0, &v->vcpu_info->evtchn_upcall_pending) )
vcpu_kick(v);
}
static inline int local_events_need_delivery(void)
{
struct vcpu *v = current;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.