aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/smp.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-mips/smp.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-mips/smp.h')
-rw-r--r--include/asm-mips/smp.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/include/asm-mips/smp.h b/include/asm-mips/smp.h
new file mode 100644
index 000000000000..8ba370ecfd4c
--- /dev/null
+++ b/include/asm-mips/smp.h
@@ -0,0 +1,111 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General
3 * Public License. See the file "COPYING" in the main directory of this
4 * archive for more details.
5 *
6 * Copyright (C) 2000 - 2001 by Kanoj Sarcar (kanoj@sgi.com)
7 * Copyright (C) 2000 - 2001 by Silicon Graphics, Inc.
8 * Copyright (C) 2000, 2001, 2002 Ralf Baechle
9 * Copyright (C) 2000, 2001 Broadcom Corporation
10 */
11#ifndef __ASM_SMP_H
12#define __ASM_SMP_H
13
14#include <linux/config.h>
15
16#ifdef CONFIG_SMP
17
18#include <linux/bitops.h>
19#include <linux/linkage.h>
20#include <linux/threads.h>
21#include <linux/cpumask.h>
22#include <asm/atomic.h>
23
24#define smp_processor_id() (current_thread_info()->cpu)
25
26/* Map from cpu id to sequential logical cpu number. This will only
27 not be idempotent when cpus failed to come on-line. */
28extern int __cpu_number_map[NR_CPUS];
29#define cpu_number_map(cpu) __cpu_number_map[cpu]
30
31/* The reverse map from sequential logical cpu number to cpu id. */
32extern int __cpu_logical_map[NR_CPUS];
33#define cpu_logical_map(cpu) __cpu_logical_map[cpu]
34
35#define NO_PROC_ID (-1)
36
37struct call_data_struct {
38 void (*func)(void *);
39 void *info;
40 atomic_t started;
41 atomic_t finished;
42 int wait;
43};
44
45extern struct call_data_struct *call_data;
46
47#define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */
48#define SMP_CALL_FUNCTION 0x2
49
50extern cpumask_t phys_cpu_present_map;
51extern cpumask_t cpu_online_map;
52#define cpu_possible_map phys_cpu_present_map
53
54extern cpumask_t cpu_callout_map;
55/* We don't mark CPUs online until __cpu_up(), so we need another measure */
56static inline int num_booting_cpus(void)
57{
58 return cpus_weight(cpu_callout_map);
59}
60
61/* These are defined by the board-specific code. */
62
63/*
64 * Cause the function described by call_data to be executed on the passed
65 * cpu. When the function has finished, increment the finished field of
66 * call_data.
67 */
68extern void core_send_ipi(int cpu, unsigned int action);
69
70/*
71 * Firmware CPU startup hook
72 */
73extern void prom_boot_secondary(int cpu, struct task_struct *idle);
74
75/*
76 * After we've done initial boot, this function is called to allow the
77 * board code to clean up state, if needed
78 */
79extern void prom_init_secondary(void);
80
81/*
82 * Detect available CPUs, populate phys_cpu_present_map before smp_init
83 */
84extern void prom_prepare_cpus(unsigned int max_cpus);
85
86/*
87 * Last chance for the board code to finish SMP initialization before
88 * the CPU is "online".
89 */
90extern void prom_smp_finish(void);
91
92/* Hook for after all CPUs are online */
93extern void prom_cpus_done(void);
94
95extern void asmlinkage smp_bootstrap(void);
96
97/*
98 * this function sends a 'reschedule' IPI to another CPU.
99 * it goes straight through and wastes no time serializing
100 * anything. Worst case is that we lose a reschedule ...
101 */
102static inline void smp_send_reschedule(int cpu)
103{
104 core_send_ipi(cpu, SMP_RESCHEDULE_YOURSELF);
105}
106
107extern asmlinkage void smp_call_function_interrupt(void);
108
109#endif /* CONFIG_SMP */
110
111#endif /* __ASM_SMP_H */