Import 2.3.18pre1
[davej-history.git] / include / asm-sparc64 / smp.h
blobd20d9f1b4829ae1df5a5f64873c26fd9488ef791
1 /* smp.h: Sparc64 specific SMP stuff.
3 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
4 */
6 #ifndef _SPARC64_SMP_H
7 #define _SPARC64_SMP_H
9 #include <linux/threads.h>
10 #include <asm/asi.h>
12 #ifndef __ASSEMBLY__
13 /* PROM provided per-processor information we need
14 * to start them all up.
17 struct prom_cpuinfo {
18 int prom_node;
19 int mid;
22 extern int linux_num_cpus; /* number of CPUs probed */
23 extern struct prom_cpuinfo linux_cpus[64];
25 #endif /* !(__ASSEMBLY__) */
27 #ifdef __SMP__
29 #ifndef __ASSEMBLY__
31 /* Per processor Sparc parameters we need. */
33 /* Keep this a multiple of 64-bytes for cache reasons. */
34 struct cpuinfo_sparc {
35 /* Dcache line 1 */
36 unsigned long irq_count;
37 unsigned long bh_count;
38 unsigned int multiplier;
39 unsigned int counter;
40 unsigned long udelay_val;
42 /* Dcache line 2 */
43 unsigned int pgcache_size;
44 unsigned int pgdcache_size;
45 unsigned long *pte_cache;
46 unsigned long *pgd_cache;
47 unsigned int idle_volume;
48 unsigned int __pad;
50 /* Dcache lines 3 and 4 */
51 unsigned int irq_worklists[16];
54 extern struct cpuinfo_sparc cpu_data[NR_CPUS];
57 * Private routines/data
60 extern unsigned char boot_cpu_id;
61 extern unsigned long cpu_present_map;
64 * General functions that each host system must provide.
67 extern void smp_callin(void);
68 extern void smp_boot_cpus(void);
69 extern void smp_store_cpu_info(int id);
71 extern __volatile__ int cpu_number_map[NR_CPUS];
72 extern __volatile__ int __cpu_logical_map[NR_CPUS];
74 extern __inline__ int cpu_logical_map(int cpu)
76 return __cpu_logical_map[cpu];
79 extern __inline__ int hard_smp_processor_id(void)
81 extern int this_is_starfire;
83 if(this_is_starfire != 0) {
84 extern int starfire_hard_smp_processor_id(void);
86 return starfire_hard_smp_processor_id();
87 } else {
88 unsigned long upaconfig;
89 __asm__ __volatile__("ldxa [%%g0] %1, %0"
90 : "=r" (upaconfig)
91 : "i" (ASI_UPA_CONFIG));
92 return ((upaconfig >> 17) & 0x1f);
96 #define smp_processor_id() (current->processor)
98 /* This needn't do anything as we do not sleep the cpu
99 * inside of the idler task, so an interrupt is not needed
100 * to get a clean fast response.
102 * Addendum: We do want it to do something for the signal
103 * delivery case, we detect that by just seeing
104 * if we are trying to send this to an idler or not.
106 extern __inline__ void smp_send_reschedule(int cpu)
108 extern void smp_receive_signal(int);
109 if(cpu_data[cpu].idle_volume == 0)
110 smp_receive_signal(cpu);
113 /* This is a nop as well because we capture all other cpus
114 * anyways when making the PROM active.
116 extern __inline__ void smp_send_stop(void) { }
118 #endif /* !(__ASSEMBLY__) */
120 #define PROC_CHANGE_PENALTY 20
122 #endif /* !(__SMP__) */
124 #define NO_PROC_ID 0xFF
126 #endif /* !(_SPARC64_SMP_H) */