aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-05-14 02:59:09 -0400
committerPaul Mundt <lethal@hera.kernel.org>2007-06-07 22:43:37 -0400
commit9655ad03af2d232c3b26e7562ab4f8c29b107e49 (patch)
tree6a76057e969ca072e7ca9bdf253219e759054d3f /include/asm-sh
parente08f457c7c0cc7720f28349f8780ea752c063441 (diff)
sh: Fixup machvec support.
This fixes up much of the machvec handling, allowing for it to be overloaded on boot. Making practical use of this still requires some Kconfig munging, however. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh')
-rw-r--r--include/asm-sh/machvec_init.h34
-rw-r--r--include/asm-sh/sections.h2
-rw-r--r--include/asm-sh/setup.h1
3 files changed, 3 insertions, 34 deletions
diff --git a/include/asm-sh/machvec_init.h b/include/asm-sh/machvec_init.h
index e397798ebd94..88a973edcf15 100644
--- a/include/asm-sh/machvec_init.h
+++ b/include/asm-sh/machvec_init.h
@@ -12,42 +12,8 @@
12#ifndef __SH_MACHVEC_INIT_H 12#ifndef __SH_MACHVEC_INIT_H
13#define __SH_MACHVEC_INIT_H 13#define __SH_MACHVEC_INIT_H
14 14
15
16/*
17 * In a GENERIC kernel, we have lots of these vectors floating about,
18 * all but one of which we want to go away. In a non-GENERIC kernel,
19 * we want only one, ever.
20 *
21 * Accomplish this in the GENERIC kernel by puting all of the vectors
22 * in the .init.data section where they'll go away. We'll copy the
23 * one we want to the real alpha_mv vector in setup_arch.
24 *
25 * Accomplish this in a non-GENERIC kernel by ifdef'ing out all but
26 * one of the vectors, which will not reside in .init.data. We then
27 * alias this one vector to alpha_mv, so no copy is needed.
28 *
29 * Upshot: set __initdata to nothing for non-GENERIC kernels.
30 *
31 * Note we do the same thing for the UNKNOWN kernel, as we need to write
32 * to the machine vector while setting it up.
33 */
34
35#if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_UNKNOWN)
36#define __initmv __attribute__((unused,__section__ (".machvec.init"))) 15#define __initmv __attribute__((unused,__section__ (".machvec.init")))
37#define ALIAS_MV(x)
38#else
39#define __initmv
40
41/* GCC actually has a syntax for defining aliases, but is under some
42 delusion that you shouldn't be able to declare it extern somewhere
43 else beforehand. Fine. We'll do it ourselves. */
44#if 0
45#define ALIAS_MV(system) \
46 struct sh_machine_vector sh_mv __attribute__((alias("mv_"#system)));
47#else
48#define ALIAS_MV(system) \ 16#define ALIAS_MV(system) \
49 asm(".global sh_mv\nsh_mv = mv_"#system ); 17 asm(".global sh_mv\nsh_mv = mv_"#system );
50#endif
51#endif /* GENERIC */
52 18
53#endif /* __SH_MACHVEC_INIT_H */ 19#endif /* __SH_MACHVEC_INIT_H */
diff --git a/include/asm-sh/sections.h b/include/asm-sh/sections.h
index 44c06c09e208..2a696b8ee4f5 100644
--- a/include/asm-sh/sections.h
+++ b/include/asm-sh/sections.h
@@ -3,5 +3,7 @@
3 3
4#include <asm-generic/sections.h> 4#include <asm-generic/sections.h>
5 5
6extern long __machvec_start, __machvec_end;
7
6#endif /* __ASM_SH_SECTIONS_H */ 8#endif /* __ASM_SH_SECTIONS_H */
7 9
diff --git a/include/asm-sh/setup.h b/include/asm-sh/setup.h
index 1583c6b7bdaa..586a9711a75d 100644
--- a/include/asm-sh/setup.h
+++ b/include/asm-sh/setup.h
@@ -6,6 +6,7 @@
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7 7
8int setup_early_printk(char *); 8int setup_early_printk(char *);
9void sh_mv_setup(void);
9 10
10#endif /* __KERNEL__ */ 11#endif /* __KERNEL__ */
11 12