summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/cpumask_up.h10
-rw-r--r--include/asm-sparc64/cpudata.h30
-rw-r--r--include/asm-sparc64/delay.h7
-rw-r--r--include/asm-sparc64/irq.h7
-rw-r--r--include/asm-sparc64/oplib.h4
-rw-r--r--include/asm-sparc64/pgalloc.h3
-rw-r--r--include/asm-sparc64/processor.h1
-rw-r--r--include/asm-sparc64/smp.h61
-rw-r--r--include/asm-sparc64/timer.h4
9 files changed, 46 insertions, 81 deletions
diff --git a/include/asm-generic/cpumask_up.h b/include/asm-generic/cpumask_up.h
index 13ef0d83816d..51e3f3d419f2 100644
--- a/include/asm-generic/cpumask_up.h
+++ b/include/asm-generic/cpumask_up.h
@@ -3,10 +3,10 @@
#define cpus_coerce(map) (map)
-#define cpu_set(cpu, map) do { cpus_coerce(map) = 1UL; } while (0)
-#define cpu_clear(cpu, map) do { cpus_coerce(map) = 0UL; } while (0)
-#define cpu_isset(cpu, map) (cpus_coerce(map) != 0UL)
-#define cpu_test_and_set(cpu, map) test_and_set_bit(0, (map).mask)
+#define cpu_set(cpu, map) do { (void)(cpu); cpus_coerce(map) = 1UL; } while (0)
+#define cpu_clear(cpu, map) do { (void)(cpu); cpus_coerce(map) = 0UL; } while (0)
+#define cpu_isset(cpu, map) ((void)(cpu), cpus_coerce(map) != 0UL)
+#define cpu_test_and_set(cpu, map) ((void)(cpu), test_and_set_bit(0, (map).mask))
#define cpus_and(dst, src1, src2) \
do { \
@@ -46,7 +46,7 @@
cpus_coerce(__tmp__) = map; \
__tmp__; \
})
-#define cpumask_of_cpu(cpu) cpus_promote(1)
+#define cpumask_of_cpu(cpu) ((void)(cpu), cpus_promote(1))
#define any_online_cpu(map) (cpus_coerce(map) ? 0 : 1)
/*
diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h
new file mode 100644
index 000000000000..d7625ffc0b85
--- /dev/null
+++ b/include/asm-sparc64/cpudata.h
@@ -0,0 +1,30 @@
+/* cpudata.h: Per-cpu parameters.
+ *
+ * Copyright (C) 2003 David S. Miller (davem@redhat.com)
+ */
+
+#ifndef _SPARC64_CPUDATA_H
+#define _SPARC64_CPUDATA_H
+
+#include <linux/percpu.h>
+
+typedef struct {
+ /* Dcache line 1 */
+ unsigned int __pad0; /* bh_count moved to irq_stat for consistency. KAO */
+ unsigned int multiplier;
+ unsigned int counter;
+ unsigned int idle_volume;
+ unsigned long clock_tick; /* %tick's per second */
+ unsigned long udelay_val;
+
+ /* Dcache line 2 */
+ unsigned int pgcache_size;
+ unsigned int pgdcache_size;
+ unsigned long *pte_cache[2];
+ unsigned long *pgd_cache;
+} cpuinfo_sparc;
+
+DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data);
+#define cpu_data(__cpu) per_cpu(__cpu_data, (__cpu))
+
+#endif /* _SPARC64_CPUDATA_H */
diff --git a/include/asm-sparc64/delay.h b/include/asm-sparc64/delay.h
index 4157717dd736..e6fced5dce1c 100644
--- a/include/asm-sparc64/delay.h
+++ b/include/asm-sparc64/delay.h
@@ -9,6 +9,7 @@
#include <linux/config.h>
#include <linux/param.h>
+#include <asm/cpudata.h>
#ifndef __ASSEMBLY__
@@ -58,11 +59,7 @@ extern __inline__ void __ndelay(unsigned long usecs, unsigned long lps)
__delay(usecs * HZ);
}
-#ifdef CONFIG_SMP
-#define __udelay_val cpu_data[smp_processor_id()].udelay_val
-#else
-#define __udelay_val loops_per_jiffy
-#endif
+#define __udelay_val cpu_data(smp_processor_id()).udelay_val
#define udelay(usecs) __udelay((usecs),__udelay_val)
#define ndelay(usecs) __ndelay((usecs),__udelay_val)
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h
index aa3de3bc9d22..e3ba6bc2cc3e 100644
--- a/include/asm-sparc64/irq.h
+++ b/include/asm-sparc64/irq.h
@@ -121,13 +121,6 @@ extern void disable_irq(unsigned int);
extern void enable_irq(unsigned int);
extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap);
extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);
-extern unsigned int psycho_build_irq(void *psycho, int imap_off, int ino, int need_dma_sync);
-
-#ifdef CONFIG_SMP
-extern void set_cpu_int(int, int);
-extern void clear_cpu_int(int, int);
-extern void set_irq_udt(int);
-#endif
extern int request_fast_irq(unsigned int irq,
irqreturn_t (*handler)(int, void *, struct pt_regs *),
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h
index c2cb33f588f6..a432d9e7daaa 100644
--- a/include/asm-sparc64/oplib.h
+++ b/include/asm-sparc64/oplib.h
@@ -327,6 +327,10 @@ extern int prom_setprop(int node, char *prop_name, char *prop_value,
extern int prom_pathtoinode(char *path);
extern int prom_inst2pkg(int);
+/* CPU probing helpers. */
+int cpu_find_by_instance(int instance, int *prom_node, int *mid);
+int cpu_find_by_mid(int mid, int *prom_node);
+
/* Client interface level routines. */
extern void prom_set_trap_table(unsigned long tba);
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h
index 41673d9f1d5c..8f2ff1dc299d 100644
--- a/include/asm-sparc64/pgalloc.h
+++ b/include/asm-sparc64/pgalloc.h
@@ -10,11 +10,12 @@
#include <asm/page.h>
#include <asm/spitfire.h>
#include <asm/pgtable.h>
+#include <asm/cpudata.h>
/* Page table allocation/freeing. */
#ifdef CONFIG_SMP
/* Sliiiicck */
-#define pgt_quicklists cpu_data[smp_processor_id()]
+#define pgt_quicklists cpu_data(smp_processor_id())
#else
extern struct pgtable_cache_struct {
unsigned long *pgd_cache;
diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h
index a1eb3d00ef43..bec2ef59d771 100644
--- a/include/asm-sparc64/processor.h
+++ b/include/asm-sparc64/processor.h
@@ -20,7 +20,6 @@
#include <asm/ptrace.h>
#include <asm/segment.h>
#include <asm/page.h>
-#include <asm/delay.h>
/* Bus types */
#define EISA_bus 0
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h
index faf98d375f2a..7d8378846e55 100644
--- a/include/asm-sparc64/smp.h
+++ b/include/asm-sparc64/smp.h
@@ -17,49 +17,12 @@
#include <linux/cpumask.h>
#include <linux/cache.h>
-/* PROM provided per-processor information we need
- * to start them all up.
- */
-
-struct prom_cpuinfo {
- int prom_node;
- int mid;
-};
-
-extern int linux_num_cpus; /* number of CPUs probed */
-extern struct prom_cpuinfo linux_cpus[NR_CPUS];
-extern unsigned int prom_cpu_nodes[NR_CPUS];
-
#endif /* !(__ASSEMBLY__) */
#ifdef CONFIG_SMP
#ifndef __ASSEMBLY__
-/* Per processor Sparc parameters we need. */
-
-/* Keep this a multiple of 64-bytes for cache reasons. */
-typedef struct {
- /* Dcache line 1 */
- unsigned int __pad0; /* bh_count moved to irq_stat for consistency. KAO */
- unsigned int multiplier;
- unsigned int counter;
- unsigned int idle_volume;
- unsigned long clock_tick; /* %tick's per second */
- unsigned long udelay_val;
-
- /* Dcache line 2 */
- unsigned int pgcache_size;
- unsigned int pgdcache_size;
- unsigned long *pte_cache[2];
- unsigned long *pgd_cache;
-
- /* Dcache lines 3 and 4 */
- unsigned int irq_worklists[16];
-} ____cacheline_aligned cpuinfo_sparc;
-
-extern cpuinfo_sparc cpu_data[NR_CPUS];
-
/*
* Private routines/data
*/
@@ -110,29 +73,11 @@ static __inline__ int hard_smp_processor_id(void)
#define smp_processor_id() (current_thread_info()->cpu)
-/* This needn't do anything as we do not sleep the cpu
- * inside of the idler task, so an interrupt is not needed
- * to get a clean fast response.
- *
- * XXX Reverify this assumption... -DaveM
- *
- * Addendum: We do want it to do something for the signal
- * delivery case, we detect that by just seeing
- * if we are trying to send this to an idler or not.
- */
-static __inline__ void smp_send_reschedule(int cpu)
-{
- extern void smp_receive_signal(int);
- if (cpu_data[cpu].idle_volume == 0)
- smp_receive_signal(cpu);
-}
+#endif /* !(__ASSEMBLY__) */
-/* This is a nop as well because we capture all other cpus
- * anyways when making the PROM active.
- */
-static __inline__ void smp_send_stop(void) { }
+#else
-#endif /* !(__ASSEMBLY__) */
+#define num_possible_cpus() (1)
#endif /* !(CONFIG_SMP) */
diff --git a/include/asm-sparc64/timer.h b/include/asm-sparc64/timer.h
index 0910e9deea0d..ba33a2b6b7bd 100644
--- a/include/asm-sparc64/timer.h
+++ b/include/asm-sparc64/timer.h
@@ -69,10 +69,6 @@ struct pt_regs;
extern void timer_tick_interrupt(struct pt_regs *);
#endif
-#ifndef CONFIG_SMP
-extern unsigned long up_clock_tick;
-#endif
-
extern unsigned long sparc64_get_clock_tick(unsigned int cpu);
#endif /* _SPARC64_TIMER_H */