Optimize andes_clear_page() and andes_copy_page() with prefetch
[linux-2.6/linux-mips.git] / include / asm-sparc64 / smp.h
blobc70b95dad84203f226e9d65e045b53aac4ff9202
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/config.h>
10 #include <linux/threads.h>
11 #include <asm/asi.h>
13 #ifndef __ASSEMBLY__
14 /* PROM provided per-processor information we need
15 * to start them all up.
18 struct prom_cpuinfo {
19 int prom_node;
20 int mid;
23 extern int linux_num_cpus; /* number of CPUs probed */
24 extern struct prom_cpuinfo linux_cpus[64];
26 #endif /* !(__ASSEMBLY__) */
28 #ifdef CONFIG_SMP
30 #ifndef __ASSEMBLY__
32 /* Per processor Sparc parameters we need. */
34 /* Keep this a multiple of 64-bytes for cache reasons. */
35 struct cpuinfo_sparc {
36 /* Dcache line 1 */
37 unsigned int bh_count;
38 unsigned int multiplier;
39 unsigned int counter;
40 unsigned int idle_volume;
41 unsigned int __pad[2];
42 unsigned long udelay_val;
44 /* Dcache line 2 */
45 unsigned int pgcache_size;
46 unsigned int pgdcache_size;
47 unsigned long *pte_cache[2];
48 unsigned long *pgd_cache;
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];
78 extern __inline__ int cpu_number_map(int cpu)
80 return __cpu_number_map[cpu];
83 extern __inline__ int hard_smp_processor_id(void)
85 extern int this_is_starfire;
87 if(this_is_starfire != 0) {
88 extern int starfire_hard_smp_processor_id(void);
90 return starfire_hard_smp_processor_id();
91 } else {
92 unsigned long upaconfig;
93 __asm__ __volatile__("ldxa [%%g0] %1, %0"
94 : "=r" (upaconfig)
95 : "i" (ASI_UPA_CONFIG));
96 return ((upaconfig >> 17) & 0x1f);
100 #define smp_processor_id() (current->processor)
102 /* This needn't do anything as we do not sleep the cpu
103 * inside of the idler task, so an interrupt is not needed
104 * to get a clean fast response.
106 * Addendum: We do want it to do something for the signal
107 * delivery case, we detect that by just seeing
108 * if we are trying to send this to an idler or not.
110 extern __inline__ void smp_send_reschedule(int cpu)
112 extern void smp_receive_signal(int);
113 if(cpu_data[cpu].idle_volume == 0)
114 smp_receive_signal(cpu);
117 /* This is a nop as well because we capture all other cpus
118 * anyways when making the PROM active.
120 extern __inline__ void smp_send_stop(void) { }
122 #endif /* !(__ASSEMBLY__) */
124 #define PROC_CHANGE_PENALTY 20
126 #endif /* !(CONFIG_SMP) */
128 #define NO_PROC_ID 0xFF
130 #endif /* !(_SPARC64_SMP_H) */