ia64/xen-unstable

changeset 8915:d44e8ace51a3

[IA64] redefine raw_smp_processor_id()

There are two definitions of raw_smp_processor_id()
One is in file xen/include/asm-ia64/linux/asm/smp.h
#define raw_smp_processor_id() (current_thread_info()->cpu)
The other is in file /xen/include/asm-ia64/config.h
#define raw_smp_processor_id() current->processor
In fact, the first one takes effect, that's not correct.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
author awilliam@xenbuild.aw
date Fri Feb 24 11:08:51 2006 -0700 (2006-02-24)
parents a2bb5a3242a1
children 0f59ace5442c
files xen/include/asm-ia64/config.h xen/include/asm-ia64/linux-xen/asm/README.origin xen/include/asm-ia64/linux-xen/asm/smp.h xen/include/asm-ia64/linux/asm/README.origin xen/include/asm-ia64/linux/asm/smp.h
line diff
     1.1 --- a/xen/include/asm-ia64/config.h	Fri Feb 24 10:50:27 2006 -0700
     1.2 +++ b/xen/include/asm-ia64/config.h	Fri Feb 24 11:08:51 2006 -0700
     1.3 @@ -293,11 +293,11 @@ extern int ht_per_core;
     1.4  #endif /* __XEN_IA64_CONFIG_H__ */
     1.5  
     1.6  // needed for include/xen/smp.h
     1.7 -#ifdef CONFIG_SMP
     1.8 -#define raw_smp_processor_id()	current->processor
     1.9 -#else
    1.10 -#define raw_smp_processor_id()	0
    1.11 -#endif
    1.12 +//#ifdef CONFIG_SMP
    1.13 +//#define raw_smp_processor_id()	current->processor
    1.14 +//#else
    1.15 +//#define raw_smp_processor_id()	0
    1.16 +//#endif
    1.17  
    1.18  
    1.19  #ifndef __ASSEMBLY__
     2.1 --- a/xen/include/asm-ia64/linux-xen/asm/README.origin	Fri Feb 24 10:50:27 2006 -0700
     2.2 +++ b/xen/include/asm-ia64/linux-xen/asm/README.origin	Fri Feb 24 11:08:51 2006 -0700
     2.3 @@ -17,6 +17,7 @@ pgalloc.h		-> linux/include/asm-ia64/pga
     2.4  pgtable.h		-> linux/include/asm-ia64/pgtable.h
     2.5  processor.h		-> linux/include/asm-ia64/processor.h
     2.6  ptrace.h		-> linux/include/asm-ia64/ptrace.h
     2.7 +smp.h			-> linux/include/asm-ia64/smp.h
     2.8  spinlock.h		-> linux/include/asm-ia64/spinlock.h
     2.9  system.h		-> linux/include/asm-ia64/system.h
    2.10  tlbflush.h		-> linux/include/asm-ia64/tlbflush.h
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/xen/include/asm-ia64/linux-xen/asm/smp.h	Fri Feb 24 11:08:51 2006 -0700
     3.3 @@ -0,0 +1,143 @@
     3.4 +/*
     3.5 + * SMP Support
     3.6 + *
     3.7 + * Copyright (C) 1999 VA Linux Systems
     3.8 + * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
     3.9 + * (c) Copyright 2001-2003, 2005 Hewlett-Packard Development Company, L.P.
    3.10 + *	David Mosberger-Tang <davidm@hpl.hp.com>
    3.11 + *	Bjorn Helgaas <bjorn.helgaas@hp.com>
    3.12 + */
    3.13 +#ifndef _ASM_IA64_SMP_H
    3.14 +#define _ASM_IA64_SMP_H
    3.15 +
    3.16 +#include <linux/config.h>
    3.17 +#include <linux/init.h>
    3.18 +#include <linux/threads.h>
    3.19 +#include <linux/kernel.h>
    3.20 +#include <linux/cpumask.h>
    3.21 +
    3.22 +#include <asm/bitops.h>
    3.23 +#include <asm/io.h>
    3.24 +#include <asm/param.h>
    3.25 +#include <asm/processor.h>
    3.26 +#include <asm/ptrace.h>
    3.27 +
    3.28 +static inline unsigned int
    3.29 +ia64_get_lid (void)
    3.30 +{
    3.31 +	union {
    3.32 +		struct {
    3.33 +			unsigned long reserved : 16;
    3.34 +			unsigned long eid : 8;
    3.35 +			unsigned long id : 8;
    3.36 +			unsigned long ignored : 32;
    3.37 +		} f;
    3.38 +		unsigned long bits;
    3.39 +	} lid;
    3.40 +
    3.41 +	lid.bits = ia64_getreg(_IA64_REG_CR_LID);
    3.42 +	return lid.f.id << 8 | lid.f.eid;
    3.43 +}
    3.44 +
    3.45 +#ifdef CONFIG_SMP
    3.46 +
    3.47 +#define XTP_OFFSET		0x1e0008
    3.48 +
    3.49 +#define SMP_IRQ_REDIRECTION	(1 << 0)
    3.50 +#define SMP_IPI_REDIRECTION	(1 << 1)
    3.51 +
    3.52 +#ifdef XEN
    3.53 +#define raw_smp_processor_id() (current->processor)
    3.54 +#else
    3.55 +#define raw_smp_processor_id() (current_thread_info()->cpu)
    3.56 +#endif
    3.57 +
    3.58 +extern struct smp_boot_data {
    3.59 +	int cpu_count;
    3.60 +	int cpu_phys_id[NR_CPUS];
    3.61 +} smp_boot_data __initdata;
    3.62 +
    3.63 +extern char no_int_routing __devinitdata;
    3.64 +
    3.65 +extern cpumask_t cpu_online_map;
    3.66 +extern cpumask_t cpu_core_map[NR_CPUS];
    3.67 +extern cpumask_t cpu_sibling_map[NR_CPUS];
    3.68 +extern int smp_num_siblings;
    3.69 +extern int smp_num_cpucores;
    3.70 +extern void __iomem *ipi_base_addr;
    3.71 +extern unsigned char smp_int_redirect;
    3.72 +
    3.73 +extern volatile int ia64_cpu_to_sapicid[];
    3.74 +#define cpu_physical_id(i)	ia64_cpu_to_sapicid[i]
    3.75 +
    3.76 +extern unsigned long ap_wakeup_vector;
    3.77 +
    3.78 +/*
    3.79 + * Function to map hard smp processor id to logical id.  Slow, so don't use this in
    3.80 + * performance-critical code.
    3.81 + */
    3.82 +static inline int
    3.83 +cpu_logical_id (int cpuid)
    3.84 +{
    3.85 +	int i;
    3.86 +
    3.87 +	for (i = 0; i < NR_CPUS; ++i)
    3.88 +		if (cpu_physical_id(i) == cpuid)
    3.89 +			break;
    3.90 +	return i;
    3.91 +}
    3.92 +
    3.93 +/*
    3.94 + * XTP control functions:
    3.95 + *	min_xtp   : route all interrupts to this CPU
    3.96 + *	normal_xtp: nominal XTP value
    3.97 + *	max_xtp   : never deliver interrupts to this CPU.
    3.98 + */
    3.99 +
   3.100 +static inline void
   3.101 +min_xtp (void)
   3.102 +{
   3.103 +	if (smp_int_redirect & SMP_IRQ_REDIRECTION)
   3.104 +		writeb(0x00, ipi_base_addr + XTP_OFFSET); /* XTP to min */
   3.105 +}
   3.106 +
   3.107 +static inline void
   3.108 +normal_xtp (void)
   3.109 +{
   3.110 +	if (smp_int_redirect & SMP_IRQ_REDIRECTION)
   3.111 +		writeb(0x08, ipi_base_addr + XTP_OFFSET); /* XTP normal */
   3.112 +}
   3.113 +
   3.114 +static inline void
   3.115 +max_xtp (void)
   3.116 +{
   3.117 +	if (smp_int_redirect & SMP_IRQ_REDIRECTION)
   3.118 +		writeb(0x0f, ipi_base_addr + XTP_OFFSET); /* Set XTP to max */
   3.119 +}
   3.120 +
   3.121 +#define hard_smp_processor_id()		ia64_get_lid()
   3.122 +
   3.123 +/* Upping and downing of CPUs */
   3.124 +extern int __cpu_disable (void);
   3.125 +extern void __cpu_die (unsigned int cpu);
   3.126 +extern void cpu_die (void) __attribute__ ((noreturn));
   3.127 +extern int __cpu_up (unsigned int cpu);
   3.128 +extern void __init smp_build_cpu_map(void);
   3.129 +
   3.130 +extern void __init init_smp_config (void);
   3.131 +extern void smp_do_timer (struct pt_regs *regs);
   3.132 +
   3.133 +extern int smp_call_function_single (int cpuid, void (*func) (void *info), void *info,
   3.134 +				     int retry, int wait);
   3.135 +extern void smp_send_reschedule (int cpu);
   3.136 +extern void lock_ipi_calllock(void);
   3.137 +extern void unlock_ipi_calllock(void);
   3.138 +extern void identify_siblings (struct cpuinfo_ia64 *);
   3.139 +
   3.140 +#else
   3.141 +
   3.142 +#define cpu_logical_id(i)		0
   3.143 +#define cpu_physical_id(i)		ia64_get_lid()
   3.144 +
   3.145 +#endif /* CONFIG_SMP */
   3.146 +#endif /* _ASM_IA64_SMP_H */
     4.1 --- a/xen/include/asm-ia64/linux/asm/README.origin	Fri Feb 24 10:50:27 2006 -0700
     4.2 +++ b/xen/include/asm-ia64/linux/asm/README.origin	Fri Feb 24 11:08:51 2006 -0700
     4.3 @@ -46,7 +46,6 @@ scatterlist.h		-> linux/include/asm-ia64
     4.4  sections.h		-> linux/include/asm-ia64/sections.h
     4.5  semaphore.h		-> linux/include/asm-ia64/semaphore.h
     4.6  setup.h			-> linux/include/asm-ia64/setup.h
     4.7 -smp.h			-> linux/include/asm-ia64/smp.h
     4.8  string.h		-> linux/include/asm-ia64/string.h
     4.9  thread_info.h		-> linux/include/asm-ia64/thread_info.h
    4.10  timex.h			-> linux/include/asm-ia64/timex.h
     5.1 --- a/xen/include/asm-ia64/linux/asm/smp.h	Fri Feb 24 10:50:27 2006 -0700
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,139 +0,0 @@
     5.4 -/*
     5.5 - * SMP Support
     5.6 - *
     5.7 - * Copyright (C) 1999 VA Linux Systems
     5.8 - * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
     5.9 - * (c) Copyright 2001-2003, 2005 Hewlett-Packard Development Company, L.P.
    5.10 - *	David Mosberger-Tang <davidm@hpl.hp.com>
    5.11 - *	Bjorn Helgaas <bjorn.helgaas@hp.com>
    5.12 - */
    5.13 -#ifndef _ASM_IA64_SMP_H
    5.14 -#define _ASM_IA64_SMP_H
    5.15 -
    5.16 -#include <linux/config.h>
    5.17 -#include <linux/init.h>
    5.18 -#include <linux/threads.h>
    5.19 -#include <linux/kernel.h>
    5.20 -#include <linux/cpumask.h>
    5.21 -
    5.22 -#include <asm/bitops.h>
    5.23 -#include <asm/io.h>
    5.24 -#include <asm/param.h>
    5.25 -#include <asm/processor.h>
    5.26 -#include <asm/ptrace.h>
    5.27 -
    5.28 -static inline unsigned int
    5.29 -ia64_get_lid (void)
    5.30 -{
    5.31 -	union {
    5.32 -		struct {
    5.33 -			unsigned long reserved : 16;
    5.34 -			unsigned long eid : 8;
    5.35 -			unsigned long id : 8;
    5.36 -			unsigned long ignored : 32;
    5.37 -		} f;
    5.38 -		unsigned long bits;
    5.39 -	} lid;
    5.40 -
    5.41 -	lid.bits = ia64_getreg(_IA64_REG_CR_LID);
    5.42 -	return lid.f.id << 8 | lid.f.eid;
    5.43 -}
    5.44 -
    5.45 -#ifdef CONFIG_SMP
    5.46 -
    5.47 -#define XTP_OFFSET		0x1e0008
    5.48 -
    5.49 -#define SMP_IRQ_REDIRECTION	(1 << 0)
    5.50 -#define SMP_IPI_REDIRECTION	(1 << 1)
    5.51 -
    5.52 -#define raw_smp_processor_id() (current_thread_info()->cpu)
    5.53 -
    5.54 -extern struct smp_boot_data {
    5.55 -	int cpu_count;
    5.56 -	int cpu_phys_id[NR_CPUS];
    5.57 -} smp_boot_data __initdata;
    5.58 -
    5.59 -extern char no_int_routing __devinitdata;
    5.60 -
    5.61 -extern cpumask_t cpu_online_map;
    5.62 -extern cpumask_t cpu_core_map[NR_CPUS];
    5.63 -extern cpumask_t cpu_sibling_map[NR_CPUS];
    5.64 -extern int smp_num_siblings;
    5.65 -extern int smp_num_cpucores;
    5.66 -extern void __iomem *ipi_base_addr;
    5.67 -extern unsigned char smp_int_redirect;
    5.68 -
    5.69 -extern volatile int ia64_cpu_to_sapicid[];
    5.70 -#define cpu_physical_id(i)	ia64_cpu_to_sapicid[i]
    5.71 -
    5.72 -extern unsigned long ap_wakeup_vector;
    5.73 -
    5.74 -/*
    5.75 - * Function to map hard smp processor id to logical id.  Slow, so don't use this in
    5.76 - * performance-critical code.
    5.77 - */
    5.78 -static inline int
    5.79 -cpu_logical_id (int cpuid)
    5.80 -{
    5.81 -	int i;
    5.82 -
    5.83 -	for (i = 0; i < NR_CPUS; ++i)
    5.84 -		if (cpu_physical_id(i) == cpuid)
    5.85 -			break;
    5.86 -	return i;
    5.87 -}
    5.88 -
    5.89 -/*
    5.90 - * XTP control functions:
    5.91 - *	min_xtp   : route all interrupts to this CPU
    5.92 - *	normal_xtp: nominal XTP value
    5.93 - *	max_xtp   : never deliver interrupts to this CPU.
    5.94 - */
    5.95 -
    5.96 -static inline void
    5.97 -min_xtp (void)
    5.98 -{
    5.99 -	if (smp_int_redirect & SMP_IRQ_REDIRECTION)
   5.100 -		writeb(0x00, ipi_base_addr + XTP_OFFSET); /* XTP to min */
   5.101 -}
   5.102 -
   5.103 -static inline void
   5.104 -normal_xtp (void)
   5.105 -{
   5.106 -	if (smp_int_redirect & SMP_IRQ_REDIRECTION)
   5.107 -		writeb(0x08, ipi_base_addr + XTP_OFFSET); /* XTP normal */
   5.108 -}
   5.109 -
   5.110 -static inline void
   5.111 -max_xtp (void)
   5.112 -{
   5.113 -	if (smp_int_redirect & SMP_IRQ_REDIRECTION)
   5.114 -		writeb(0x0f, ipi_base_addr + XTP_OFFSET); /* Set XTP to max */
   5.115 -}
   5.116 -
   5.117 -#define hard_smp_processor_id()		ia64_get_lid()
   5.118 -
   5.119 -/* Upping and downing of CPUs */
   5.120 -extern int __cpu_disable (void);
   5.121 -extern void __cpu_die (unsigned int cpu);
   5.122 -extern void cpu_die (void) __attribute__ ((noreturn));
   5.123 -extern int __cpu_up (unsigned int cpu);
   5.124 -extern void __init smp_build_cpu_map(void);
   5.125 -
   5.126 -extern void __init init_smp_config (void);
   5.127 -extern void smp_do_timer (struct pt_regs *regs);
   5.128 -
   5.129 -extern int smp_call_function_single (int cpuid, void (*func) (void *info), void *info,
   5.130 -				     int retry, int wait);
   5.131 -extern void smp_send_reschedule (int cpu);
   5.132 -extern void lock_ipi_calllock(void);
   5.133 -extern void unlock_ipi_calllock(void);
   5.134 -extern void identify_siblings (struct cpuinfo_ia64 *);
   5.135 -
   5.136 -#else
   5.137 -
   5.138 -#define cpu_logical_id(i)		0
   5.139 -#define cpu_physical_id(i)		ia64_get_lid()
   5.140 -
   5.141 -#endif /* CONFIG_SMP */
   5.142 -#endif /* _ASM_IA64_SMP_H */