X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-ia64%2Fsmp.h;h=60fd4ae014f6fbe8a3fe19b8e9171a7e277f609e;hb=refs%2Fheads%2Fvserver;hp=deeccd4f8f35b327e07c4c27db81aef6a792a579;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h index deeccd4f8..60fd4ae01 100644 --- a/include/asm-ia64/smp.h +++ b/include/asm-ia64/smp.h @@ -3,16 +3,13 @@ * * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond - * Copyright (C) 2001-2003 Hewlett-Packard Co + * (c) Copyright 2001-2003, 2005 Hewlett-Packard Development Company, L.P. * David Mosberger-Tang + * Bjorn Helgaas */ #ifndef _ASM_IA64_SMP_H #define _ASM_IA64_SMP_H -#include - -#ifdef CONFIG_SMP - #include #include #include @@ -24,23 +21,45 @@ #include #include +static inline unsigned int +ia64_get_lid (void) +{ + union { + struct { + unsigned long reserved : 16; + unsigned long eid : 8; + unsigned long id : 8; + unsigned long ignored : 32; + } f; + unsigned long bits; + } lid; + + lid.bits = ia64_getreg(_IA64_REG_CR_LID); + return lid.f.id << 8 | lid.f.eid; +} + +#ifdef CONFIG_SMP + #define XTP_OFFSET 0x1e0008 #define SMP_IRQ_REDIRECTION (1 << 0) #define SMP_IPI_REDIRECTION (1 << 1) -#define smp_processor_id() (current_thread_info()->cpu) +#define raw_smp_processor_id() (current_thread_info()->cpu) extern struct smp_boot_data { int cpu_count; int cpu_phys_id[NR_CPUS]; } smp_boot_data __initdata; -extern char no_int_routing __initdata; +extern char no_int_routing __devinitdata; -extern cpumask_t phys_cpu_present_map; extern cpumask_t cpu_online_map; -extern unsigned long ipi_base_addr; +extern cpumask_t cpu_core_map[NR_CPUS]; +extern cpumask_t cpu_sibling_map[NR_CPUS]; +extern int smp_num_siblings; +extern int smp_num_cpucores; +extern void __iomem *ipi_base_addr; extern unsigned char smp_int_redirect; extern volatile int ia64_cpu_to_sapicid[]; @@ -48,8 +67,6 @@ extern volatile int ia64_cpu_to_sapicid[]; extern unsigned long ap_wakeup_vector; -#define cpu_possible_map phys_cpu_present_map - /* * Function to map hard smp processor id to logical id. Slow, so don't use this in * performance-critical code. @@ -76,52 +93,45 @@ static inline void min_xtp (void) { if (smp_int_redirect & SMP_IRQ_REDIRECTION) - writeb(0x00, ipi_base_addr | XTP_OFFSET); /* XTP to min */ + writeb(0x00, ipi_base_addr + XTP_OFFSET); /* XTP to min */ } static inline void normal_xtp (void) { if (smp_int_redirect & SMP_IRQ_REDIRECTION) - writeb(0x08, ipi_base_addr | XTP_OFFSET); /* XTP normal */ + writeb(0x08, ipi_base_addr + XTP_OFFSET); /* XTP normal */ } static inline void max_xtp (void) { if (smp_int_redirect & SMP_IRQ_REDIRECTION) - writeb(0x0f, ipi_base_addr | XTP_OFFSET); /* Set XTP to max */ + writeb(0x0f, ipi_base_addr + XTP_OFFSET); /* Set XTP to max */ } -static inline unsigned int -hard_smp_processor_id (void) -{ - union { - struct { - unsigned long reserved : 16; - unsigned long eid : 8; - unsigned long id : 8; - unsigned long ignored : 32; - } f; - unsigned long bits; - } lid; - - lid.bits = ia64_getreg(_IA64_REG_CR_LID); - return lid.f.id << 8 | lid.f.eid; -} +#define hard_smp_processor_id() ia64_get_lid() /* Upping and downing of CPUs */ extern int __cpu_disable (void); extern void __cpu_die (unsigned int cpu); +extern void cpu_die (void) __attribute__ ((noreturn)); extern int __cpu_up (unsigned int cpu); extern void __init smp_build_cpu_map(void); extern void __init init_smp_config (void); extern void smp_do_timer (struct pt_regs *regs); -extern int smp_call_function_single (int cpuid, void (*func) (void *info), void *info, - int retry, int wait); extern void smp_send_reschedule (int cpu); +extern void lock_ipi_calllock(void); +extern void unlock_ipi_calllock(void); +extern void identify_siblings (struct cpuinfo_ia64 *); +extern int is_multithreading_enabled(void); + +#else + +#define cpu_logical_id(i) 0 +#define cpu_physical_id(i) ia64_get_lid() #endif /* CONFIG_SMP */ #endif /* _ASM_IA64_SMP_H */