diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2008-04-02 13:53:56 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-24 17:57:32 -0400 |
commit | e849c3e9e0b786619c451d89ef0c47ac9a28fbc1 (patch) | |
tree | bc3500d40095c2f868e2efca4918b73a6b0a1090 /drivers/xen | |
parent | e04d0d0767a9c272d3c7300fb7a5221c5e3a71eb (diff) |
Xen: make events.c portable for ia64/xen support
Remove x86 dependency in drivers/xen/events.c for ia64/xen support
introducing include/asm/xen/events.h.
Introduce xen_irqs_disabled() to hide regs->flags
Introduce xen_do_IRQ() to hide regs->orig_ax.
make enum ipi_vector definition arch specific. ia64/xen needs four vectors.
Add one rmb() because on ia64 xchg() isn't barrier.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/events.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index c50d499b1e6f..2396b4492f70 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -469,7 +469,7 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id) | |||
469 | for_each_online_cpu(i) { | 469 | for_each_online_cpu(i) { |
470 | struct vcpu_info *v = per_cpu(xen_vcpu, i); | 470 | struct vcpu_info *v = per_cpu(xen_vcpu, i); |
471 | printk("%d: masked=%d pending=%d event_sel %08lx\n ", i, | 471 | printk("%d: masked=%d pending=%d event_sel %08lx\n ", i, |
472 | (get_irq_regs() && i == cpu) ? !(get_irq_regs()->flags & X86_EFLAGS_IF) : v->evtchn_upcall_mask, | 472 | (get_irq_regs() && i == cpu) ? xen_irqs_disabled(get_irq_regs()) : v->evtchn_upcall_mask, |
473 | v->evtchn_upcall_pending, | 473 | v->evtchn_upcall_pending, |
474 | v->evtchn_pending_sel); | 474 | v->evtchn_pending_sel); |
475 | } | 475 | } |
@@ -527,7 +527,10 @@ void xen_evtchn_do_upcall(struct pt_regs *regs) | |||
527 | if (__get_cpu_var(nesting_count)++) | 527 | if (__get_cpu_var(nesting_count)++) |
528 | goto out; | 528 | goto out; |
529 | 529 | ||
530 | /* NB. No need for a barrier here -- XCHG is a barrier on x86. */ | 530 | #ifndef CONFIG_X86 /* No need for a barrier -- XCHG is a barrier on x86. */ |
531 | /* Clear master flag /before/ clearing selector flag. */ | ||
532 | rmb(); | ||
533 | #endif | ||
531 | pending_words = xchg(&vcpu_info->evtchn_pending_sel, 0); | 534 | pending_words = xchg(&vcpu_info->evtchn_pending_sel, 0); |
532 | while (pending_words != 0) { | 535 | while (pending_words != 0) { |
533 | unsigned long pending_bits; | 536 | unsigned long pending_bits; |
@@ -539,10 +542,8 @@ void xen_evtchn_do_upcall(struct pt_regs *regs) | |||
539 | int port = (word_idx * BITS_PER_LONG) + bit_idx; | 542 | int port = (word_idx * BITS_PER_LONG) + bit_idx; |
540 | int irq = evtchn_to_irq[port]; | 543 | int irq = evtchn_to_irq[port]; |
541 | 544 | ||
542 | if (irq != -1) { | 545 | if (irq != -1) |
543 | regs->orig_ax = ~irq; | 546 | xen_do_IRQ(irq, regs); |
544 | do_IRQ(regs); | ||
545 | } | ||
546 | } | 547 | } |
547 | } | 548 | } |
548 | 549 | ||