# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID b550a93c6459c4f0f2a86b61a08768d040482d88
# Parent 0094c4c8c22174d88e0bd9b1ae5e64d5f97e4f1b
This patch defines a test_and_clear bitop for cpumask_t pointers.
Also fixes "wrong pointer type" for type specific bitops by using
&foo[0] instead of &foo.
Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
diff -r 0094c4c8c221 -r b550a93c6459 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c Wed Apr 19 15:08:41 2006
+++ b/xen/arch/x86/irq.c Wed Apr 19 17:24:49 2006
@@ -198,7 +198,7 @@
{
d = action->guest[i];
if ( (action->ack_type != ACKTYPE_NONE) &&
- !test_and_set_bit(irq, &d->pirq_mask) )
+ !test_and_set_bit(irq, &d->pirq_mask[0]) )
action->in_flight++;
send_guest_pirq(d, irq);
}
@@ -235,7 +235,7 @@
if ( !(desc->status & IRQ_GUEST) ||
(action->in_flight != 0) ||
- !test_and_clear_bit(cpu, &action->cpu_eoi_map) )
+ !cpu_test_and_clear(cpu, action->cpu_eoi_map) )
return;
sp = pending_eoi_sp(cpu);
@@ -285,7 +285,7 @@
ASSERT(action->ack_type == ACKTYPE_EOI);
ASSERT(desc->status & IRQ_GUEST);
for ( i = 0; i < action->nr_guests; i++ )
- clear_bit(vector_to_irq(vector), &action->guest[i]->pirq_mask);
+ clear_bit(vector_to_irq(vector), &action->guest[i]->pirq_mask[0]);
action->in_flight = 0;
spin_unlock(&desc->lock);
}
@@ -311,7 +311,7 @@
spin_lock_irq(&desc->lock);
if ( !test_bit(d->pirq_to_evtchn[pirq], &s->evtchn_mask[0]) &&
- test_and_clear_bit(pirq, &d->pirq_mask) )
+ test_and_clear_bit(pirq, &d->pirq_mask[0]) )
{
ASSERT(action->ack_type != ACKTYPE_NONE);
if ( --action->in_flight == 0 )
@@ -322,7 +322,7 @@
}
}
- if ( __test_and_clear_bit(cpu, &cpu_eoi_map) )
+ if ( cpu_test_and_clear(cpu, cpu_eoi_map) )
{
__set_eoi_ready(desc);
spin_unlock(&desc->lock);
@@ -493,13 +493,13 @@
switch ( action->ack_type )
{
case ACKTYPE_UNMASK:
- if ( test_and_clear_bit(irq, &d->pirq_mask) &&
+ if ( test_and_clear_bit(irq, &d->pirq_mask[0]) &&
(--action->in_flight == 0) )
desc->handler->end(vector);
break;
case ACKTYPE_EOI:
/* NB. If #guests == 0 then we clear the eoi_map later on. */
- if ( test_and_clear_bit(irq, &d->pirq_mask) &&
+ if ( test_and_clear_bit(irq, &d->pirq_mask[0]) &&
(--action->in_flight == 0) &&
(action->nr_guests != 0) )
{
@@ -511,7 +511,7 @@
break;
}
- BUG_ON(test_bit(irq, &d->pirq_mask));
+ BUG_ON(test_bit(irq, &d->pirq_mask[0]));
if ( action->nr_guests != 0 )
goto out;
diff -r 0094c4c8c221 -r b550a93c6459 xen/include/xen/cpumask.h
--- a/xen/include/xen/cpumask.h Wed Apr 19 15:08:41 2006
+++ b/xen/include/xen/cpumask.h Wed Apr 19 17:24:49 2006
@@ -111,6 +111,12 @@
static inline int __cpu_test_and_set(int cpu, cpumask_t *addr)
{
return test_and_set_bit(cpu, addr->bits);
+}
+
+#define cpu_test_and_clear(cpu, cpumask) __cpu_test_and_clear((cpu),
&(cpumask))
+static inline int __cpu_test_and_clear(int cpu, cpumask_t *addr)
+{
+ return test_and_clear_bit(cpu, addr->bits);
}
#define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS)
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|