diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-09-21 05:32:32 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-09-21 05:32:32 -0400 |
commit | aba1030a7e529ec9fe47a8cfc06d12a39180fa71 (patch) | |
tree | a28de7f7b89610246fddf488f042b58c66101b95 /include/asm-sh/smp.h | |
parent | f18d533e3cd476aedf41fe1e6e9dc3e0a2446bba (diff) |
sh: Bring SMP support back from the dead.
There was a very preliminary bunch of SMP code scattered around for the
SH7604 microcontrollers from way back when, and it has mostly suffered
bitrot since then. With the tree already having been slowly getting
prepped for SMP, this plugs in most of the remaining platform-independent
bits.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/smp.h')
-rw-r--r-- | include/asm-sh/smp.h | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/include/asm-sh/smp.h b/include/asm-sh/smp.h index b99ca786c0c1..9c8d34b07ebf 100644 --- a/include/asm-sh/smp.h +++ b/include/asm-sh/smp.h | |||
@@ -1,12 +1,3 @@ | |||
1 | /* | ||
2 | * include/asm-sh/smp.h | ||
3 | * | ||
4 | * Copyright (C) 2002, 2003 Paul Mundt | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive for | ||
8 | * more details. | ||
9 | */ | ||
10 | #ifndef __ASM_SH_SMP_H | 1 | #ifndef __ASM_SH_SMP_H |
11 | #define __ASM_SH_SMP_H | 2 | #define __ASM_SH_SMP_H |
12 | 3 | ||
@@ -20,6 +11,15 @@ | |||
20 | #include <asm/current.h> | 11 | #include <asm/current.h> |
21 | 12 | ||
22 | #define raw_smp_processor_id() (current_thread_info()->cpu) | 13 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
14 | #define hard_smp_processor_id() plat_smp_processor_id() | ||
15 | |||
16 | /* Map from cpu id to sequential logical cpu number. */ | ||
17 | extern int __cpu_number_map[NR_CPUS]; | ||
18 | #define cpu_number_map(cpu) __cpu_number_map[cpu] | ||
19 | |||
20 | /* The reverse map from sequential logical cpu number to cpu id. */ | ||
21 | extern int __cpu_logical_map[NR_CPUS]; | ||
22 | #define cpu_logical_map(cpu) __cpu_logical_map[cpu] | ||
23 | 23 | ||
24 | /* I've no idea what the real meaning of this is */ | 24 | /* I've no idea what the real meaning of this is */ |
25 | #define PROC_CHANGE_PENALTY 20 | 25 | #define PROC_CHANGE_PENALTY 20 |
@@ -35,10 +35,22 @@ struct smp_fn_call_struct { | |||
35 | 35 | ||
36 | extern struct smp_fn_call_struct smp_fn_call; | 36 | extern struct smp_fn_call_struct smp_fn_call; |
37 | 37 | ||
38 | #define SMP_MSG_RESCHEDULE 0x0001 | 38 | #define SMP_MSG_FUNCTION 0 |
39 | #define SMP_MSG_RESCHEDULE 1 | ||
40 | #define SMP_MSG_NR 2 | ||
39 | 41 | ||
40 | #endif /* CONFIG_SMP */ | 42 | void plat_smp_setup(void); |
43 | void plat_prepare_cpus(unsigned int max_cpus); | ||
44 | int plat_smp_processor_id(void); | ||
45 | void plat_start_cpu(unsigned int cpu, unsigned long entry_point); | ||
46 | void plat_send_ipi(unsigned int cpu, unsigned int message); | ||
47 | int plat_register_ipi_handler(unsigned int message, | ||
48 | void (*handler)(void *), void *arg); | ||
49 | |||
50 | #else | ||
41 | 51 | ||
42 | #define hard_smp_processor_id() (0) | 52 | #define hard_smp_processor_id() (0) |
43 | 53 | ||
54 | #endif /* CONFIG_SMP */ | ||
55 | |||
44 | #endif /* __ASM_SH_SMP_H */ | 56 | #endif /* __ASM_SH_SMP_H */ |