aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-09-21 05:32:32 -0400
committerPaul Mundt <lethal@linux-sh.org>2007-09-21 05:32:32 -0400
commitaba1030a7e529ec9fe47a8cfc06d12a39180fa71 (patch)
treea28de7f7b89610246fddf488f042b58c66101b95 /include/asm-sh
parentf18d533e3cd476aedf41fe1e6e9dc3e0a2446bba (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')
-rw-r--r--include/asm-sh/smp.h34
-rw-r--r--include/asm-sh/system.h1
2 files changed, 24 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. */
17extern 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. */
21extern 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
36extern struct smp_fn_call_struct smp_fn_call; 36extern 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 */ 42void plat_smp_setup(void);
43void plat_prepare_cpus(unsigned int max_cpus);
44int plat_smp_processor_id(void);
45void plat_start_cpu(unsigned int cpu, unsigned long entry_point);
46void plat_send_ipi(unsigned int cpu, unsigned int message);
47int 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 */
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index 245042537205..9d849e6df268 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -266,6 +266,7 @@ void disable_hlt(void);
266void enable_hlt(void); 266void enable_hlt(void);
267 267
268void default_idle(void); 268void default_idle(void);
269void per_cpu_trap_init(void);
269 270
270asmlinkage void break_point_trap(void); 271asmlinkage void break_point_trap(void);
271asmlinkage void debug_trap_handler(unsigned long r4, unsigned long r5, 272asmlinkage void debug_trap_handler(unsigned long r4, unsigned long r5,