ia64/xen-unstable
changeset 11492:f9cff9148068
[POWERPC][XEN] Make MPIC sharing between Xen and Dom0 optional
Tho right now it is the only option.
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Tho right now it is the only option.
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author | Jimi Xenidis <jimix@watson.ibm.com> |
---|---|
date | Thu Aug 31 17:47:11 2006 -0400 (2006-08-31) |
parents | 4fdf5151b187 |
children | ae7a722b7241 |
files | xen/arch/powerpc/mpic_init.c |
line diff
1.1 --- a/xen/arch/powerpc/mpic_init.c Mon Sep 18 12:48:56 2006 -0500 1.2 +++ b/xen/arch/powerpc/mpic_init.c Thu Aug 31 17:47:11 2006 -0400 1.3 @@ -27,6 +27,8 @@ 1.4 #include "of-devtree.h" 1.5 1.6 #undef DEBUG 1.7 +#define CONFIG_SHARE_MPIC 1.8 + 1.9 #ifdef DEBUG 1.10 #define DBG(fmt...) printk(fmt) 1.11 #else 1.12 @@ -319,8 +321,43 @@ static int find_mpic(void) 1.13 return rc; 1.14 } 1.15 1.16 +#ifdef CONFIG_SHARE_MPIC 1.17 static struct hw_interrupt_type hc_irq; 1.18 1.19 +static struct hw_interrupt_type *share_mpic( 1.20 + struct hw_interrupt_type *mpic_irq, 1.21 + struct hw_interrupt_type *xen_irq) 1.22 +{ 1.23 + hc_irq.startup = mpic_irq->startup; 1.24 + mpic_irq->startup = xen_irq->startup; 1.25 + 1.26 + hc_irq.enable = mpic_irq->enable; 1.27 + mpic_irq->enable = xen_irq->enable; 1.28 + 1.29 + hc_irq.disable = mpic_irq->disable; 1.30 + mpic_irq->disable = xen_irq->disable; 1.31 + 1.32 + hc_irq.shutdown = mpic_irq->shutdown; 1.33 + mpic_irq->shutdown = xen_irq->shutdown; 1.34 + 1.35 + hc_irq.ack = mpic_irq->ack; 1.36 + mpic_irq->ack = xen_irq->ack; 1.37 + 1.38 + hc_irq.end = mpic_irq->end; 1.39 + mpic_irq->end = xen_irq->end; 1.40 + 1.41 + hc_irq.set_affinity = mpic_irq->set_affinity; 1.42 + mpic_irq->set_affinity = xen_irq->set_affinity; 1.43 + 1.44 + return &hc_irq; 1.45 +} 1.46 + 1.47 +#else /* CONFIG_SHARE_MPIC */ 1.48 + 1.49 +#define share_mpic(M,X) (M) 1.50 + 1.51 +#endif 1.52 + 1.53 struct hw_interrupt_type *xen_mpic_init(struct hw_interrupt_type *xen_irq) 1.54 { 1.55 unsigned int isu_size; 1.56 @@ -329,6 +366,7 @@ struct hw_interrupt_type *xen_mpic_init( 1.57 unsigned int ipi_offset; 1.58 unsigned char *senses; 1.59 unsigned int senses_count; 1.60 + struct hw_interrupt_type *hit; 1.61 1.62 printk("%s: start\n", __func__); 1.63 1.64 @@ -356,29 +394,10 @@ struct hw_interrupt_type *xen_mpic_init( 1.65 BUG_ON(mpic == NULL); 1.66 mpic_init(mpic); 1.67 1.68 - hc_irq.startup = mpic->hc_irq.startup; 1.69 - mpic->hc_irq.startup = xen_irq->startup; 1.70 - 1.71 - hc_irq.enable = mpic->hc_irq.enable; 1.72 - mpic->hc_irq.enable = xen_irq->enable; 1.73 - 1.74 - hc_irq.disable = mpic->hc_irq.disable; 1.75 - mpic->hc_irq.disable = xen_irq->disable; 1.76 - 1.77 - hc_irq.shutdown = mpic->hc_irq.shutdown; 1.78 - mpic->hc_irq.shutdown = xen_irq->shutdown; 1.79 - 1.80 - hc_irq.ack = mpic->hc_irq.ack; 1.81 - mpic->hc_irq.ack = xen_irq->ack; 1.82 - 1.83 - hc_irq.end = mpic->hc_irq.end; 1.84 - mpic->hc_irq.end = xen_irq->end; 1.85 - 1.86 - hc_irq.set_affinity = mpic->hc_irq.set_affinity; 1.87 - mpic->hc_irq.set_affinity = xen_irq->set_affinity; 1.88 + hit = share_mpic(&mpic->hc_irq, xen_irq); 1.89 1.90 printk("%s: success\n", __func__); 1.91 - return &hc_irq; 1.92 + return hit; 1.93 } 1.94 1.95 int xen_mpic_get_irq(struct cpu_user_regs *regs)