ia64/xen-unstable

changeset 10205:3be4c8288737

[IA64] Add several missing is_running_on_xen().

Signed-off-by Kevin Tian <kevin.tian@intel.com>
author awilliam@xenbuild.aw
date Wed May 31 11:30:07 2006 -0600 (2006-05-31)
parents 003157eafd66
children acabf4bdec4f
files linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c linux-2.6-xen-sparse/arch/ia64/kernel/setup.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c	Wed May 31 11:29:50 2006 -0600
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c	Wed May 31 11:30:07 2006 -0600
     1.3 @@ -670,7 +670,11 @@ register_intr (unsigned int gsi, int vec
     1.4  	iosapic_intr_info[vector].dmode    = delivery;
     1.5  	iosapic_intr_info[vector].trigger  = trigger;
     1.6  
     1.7 -#ifndef CONFIG_XEN
     1.8 +#ifdef CONFIG_XEN
     1.9 +	if (is_running_on_xen())
    1.10 +		return 0;
    1.11 +#endif
    1.12 +
    1.13  	if (trigger == IOSAPIC_EDGE)
    1.14  		irq_type = &irq_type_iosapic_edge;
    1.15  	else
    1.16 @@ -683,7 +687,6 @@ register_intr (unsigned int gsi, int vec
    1.17  			       __FUNCTION__, vector, idesc->handler->typename, irq_type->typename);
    1.18  		idesc->handler = irq_type;
    1.19  	}
    1.20 -#endif
    1.21  	return 0;
    1.22  }
    1.23  
     2.1 --- a/linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c	Wed May 31 11:29:50 2006 -0600
     2.2 +++ b/linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c	Wed May 31 11:30:07 2006 -0600
     2.3 @@ -254,7 +254,8 @@ static int xen_slab_ready = 0;
     2.4   * it ends up to issue several memory accesses upon percpu data and
     2.5   * thus adds unnecessary traffic to other paths.
     2.6   */
     2.7 -irqreturn_t handle_reschedule(int irq, void *dev_id, struct pt_regs *regs)
     2.8 +static irqreturn_t
     2.9 +handle_reschedule(int irq, void *dev_id, struct pt_regs *regs)
    2.10  {
    2.11  
    2.12  	return IRQ_HANDLED;
    2.13 @@ -328,7 +329,7 @@ xen_register_percpu_irq (unsigned int ir
    2.14  	}
    2.15  }
    2.16  
    2.17 -void
    2.18 +static void
    2.19  xen_bind_early_percpu_irq (void)
    2.20  {
    2.21  	int i;
    2.22 @@ -398,19 +399,20 @@ init_IRQ (void)
    2.23  {
    2.24  #ifdef CONFIG_XEN
    2.25  	/* Maybe put into platform_irq_init later */
    2.26 -	struct callback_register event = {
    2.27 -		.type = CALLBACKTYPE_event,
    2.28 -		.address = (unsigned long)&xen_event_callback,
    2.29 -	};
    2.30 -	xen_init_IRQ();
    2.31 -	BUG_ON(HYPERVISOR_callback_op(CALLBACKOP_register, &event));
    2.32 -	late_time_init = xen_bind_early_percpu_irq;
    2.33 +	if (is_running_on_xen()) {
    2.34 +		struct callback_register event = {
    2.35 +			.type = CALLBACKTYPE_event,
    2.36 +			.address = (unsigned long)&xen_event_callback,
    2.37 +		};
    2.38 +		xen_init_IRQ();
    2.39 +		BUG_ON(HYPERVISOR_callback_op(CALLBACKOP_register, &event));
    2.40 +		late_time_init = xen_bind_early_percpu_irq;
    2.41  #ifdef CONFIG_SMP
    2.42 -	register_percpu_irq(IA64_IPI_RESCHEDULE, &resched_irqaction);
    2.43 -#endif
    2.44 -#else /* CONFIG_XEN */
    2.45 +		register_percpu_irq(IA64_IPI_RESCHEDULE, &resched_irqaction);
    2.46 +#endif /* CONFIG_SMP */
    2.47 +	}
    2.48 +#endif /* CONFIG_XEN */
    2.49  	register_percpu_irq(IA64_SPURIOUS_INT_VECTOR, NULL);
    2.50 -#endif /* CONFIG_XEN */
    2.51  #ifdef CONFIG_SMP
    2.52  	register_percpu_irq(IA64_IPI_VECTOR, &ipi_irqaction);
    2.53  #endif
     3.1 --- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Wed May 31 11:29:50 2006 -0600
     3.2 +++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Wed May 31 11:30:07 2006 -0600
     3.3 @@ -925,7 +925,8 @@ cpu_init (void)
     3.4  	platform_cpu_init();
     3.5  #ifdef CONFIG_XEN
     3.6  	/* Need to be moved into platform_cpu_init later */
     3.7 -	xen_smp_intr_init();
     3.8 +	if (is_running_on_xen())
     3.9 +		xen_smp_intr_init();
    3.10  #endif
    3.11  	pm_idle = default_idle;
    3.12  }