1 /* smp.h: Sparc64 specific SMP stuff.
2 *
3 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
4 */
5
6 #ifndef _SPARC64_SMP_H
7 #define _SPARC64_SMP_H
8
9 #include <linux/config.h>
10 #include <linux/threads.h>
11 #include <asm/asi.h>
12 #include <asm/starfire.h>
13
14 #ifndef __ASSEMBLY__
15 /* PROM provided per-processor information we need
16 * to start them all up.
17 */
18
19 struct prom_cpuinfo {
20 int prom_node;
21 int mid;
22 };
23
24 extern int linux_num_cpus; /* number of CPUs probed */
25 extern struct prom_cpuinfo linux_cpus[64];
26
27 #endif /* !(__ASSEMBLY__) */
28
29 #ifdef CONFIG_SMP
30
31 #ifndef __ASSEMBLY__
32
33 /* Per processor Sparc parameters we need. */
34
35 /* Keep this a multiple of 64-bytes for cache reasons. */
36 struct cpuinfo_sparc {
37 /* Dcache line 1 */
38 unsigned int __pad0; /* bh_count moved to irq_stat for consistency. KAO */
39 unsigned int multiplier;
40 unsigned int counter;
41 unsigned int idle_volume;
42 unsigned int __pad[2];
43 unsigned long udelay_val;
44
45 /* Dcache line 2 */
46 unsigned int pgcache_size;
47 unsigned int pgdcache_size;
48 unsigned long *pte_cache[2];
49 unsigned long *pgd_cache;
50
51 /* Dcache lines 3 and 4 */
52 unsigned int irq_worklists[16];
53 };
54
55 extern struct cpuinfo_sparc cpu_data[NR_CPUS];
56
57 /*
58 * Private routines/data
59 */
60
61 extern unsigned char boot_cpu_id;
62 extern unsigned long cpu_present_map;
63
64 /*
65 * General functions that each host system must provide.
66 */
67
68 extern void smp_callin(void);
69 extern void smp_boot_cpus(void);
70 extern void smp_store_cpu_info(int id);
71
72 extern __volatile__ int __cpu_number_map[NR_CPUS];
73 extern __volatile__ int __cpu_logical_map[NR_CPUS];
74
75 extern __inline__ int cpu_logical_map(int cpu)
76 {
77 return __cpu_logical_map[cpu];
78 }
79 extern __inline__ int cpu_number_map(int cpu)
80 {
81 return __cpu_number_map[cpu];
82 }
83
84 extern __inline__ int hard_smp_processor_id(void)
85 {
86 if(this_is_starfire != 0) {
87 return starfire_hard_smp_processor_id();
88 } else {
89 unsigned long upaconfig;
90 __asm__ __volatile__("ldxa [%%g0] %1, %0"
91 : "=r" (upaconfig)
92 : "i" (ASI_UPA_CONFIG));
93 return ((upaconfig >> 17) & 0x1f);
94 }
95 }
96
97 #define smp_processor_id() (current->processor)
98
99 /* This needn't do anything as we do not sleep the cpu
100 * inside of the idler task, so an interrupt is not needed
101 * to get a clean fast response.
102 *
103 * Addendum: We do want it to do something for the signal
104 * delivery case, we detect that by just seeing
105 * if we are trying to send this to an idler or not.
106 */
107 extern __inline__ void smp_send_reschedule(int cpu)
108 {
109 extern void smp_receive_signal(int);
110 if(cpu_data[cpu].idle_volume == 0)
111 smp_receive_signal(cpu);
112 }
113
114 /* This is a nop as well because we capture all other cpus
115 * anyways when making the PROM active.
116 */
117 extern __inline__ void smp_send_stop(void) { }
118
119 #endif /* !(__ASSEMBLY__) */
120
121 #define PROC_CHANGE_PENALTY 20
122
123 #endif /* !(CONFIG_SMP) */
124
125 #define NO_PROC_ID 0xFF
126
127 #endif /* !(_SPARC64_SMP_H) */
128
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.