aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/traps_32.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-01-12 00:50:43 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-01-12 00:50:43 -0500
commit191d0d24b632eb69767705acded5cbf7449ad457 (patch)
tree4fda30db2941692bea884685f1df2e751468bd6f /arch/sh/kernel/traps_32.c
parentee2760ea58d81fc00bcc2137232ed9bc28202aec (diff)
sh: Tidy up the sh bios VBR handling.
This moves the VBR handling out of the main trap handling code and in to the sh-bios helper code. A couple of accessors are added in order to permit other kernel code to get at the VBR value for state save/restore paths. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/traps_32.c')
-rw-r--r--arch/sh/kernel/traps_32.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c
index 86639beac3a2..efcbdfe52f52 100644
--- a/arch/sh/kernel/traps_32.c
+++ b/arch/sh/kernel/traps_32.c
@@ -31,6 +31,7 @@
31#include <asm/uaccess.h> 31#include <asm/uaccess.h>
32#include <asm/fpu.h> 32#include <asm/fpu.h>
33#include <asm/kprobes.h> 33#include <asm/kprobes.h>
34#include <asm/sh_bios.h>
34 35
35#ifdef CONFIG_CPU_SH2 36#ifdef CONFIG_CPU_SH2
36# define TRAP_RESERVED_INST 4 37# define TRAP_RESERVED_INST 4
@@ -876,35 +877,10 @@ asmlinkage void do_exception_error(unsigned long r4, unsigned long r5,
876 die_if_kernel("exception", regs, ex); 877 die_if_kernel("exception", regs, ex);
877} 878}
878 879
879#if defined(CONFIG_SH_STANDARD_BIOS)
880void *gdb_vbr_vector;
881
882static inline void __init gdb_vbr_init(void)
883{
884 register unsigned long vbr;
885
886 /*
887 * Read the old value of the VBR register to initialise
888 * the vector through which debug and BIOS traps are
889 * delegated by the Linux trap handler.
890 */
891 asm volatile("stc vbr, %0" : "=r" (vbr));
892
893 gdb_vbr_vector = (void *)(vbr + 0x100);
894 printk("Setting GDB trap vector to 0x%08lx\n",
895 (unsigned long)gdb_vbr_vector);
896}
897#endif
898
899void __cpuinit per_cpu_trap_init(void) 880void __cpuinit per_cpu_trap_init(void)
900{ 881{
901 extern void *vbr_base; 882 extern void *vbr_base;
902 883
903#ifdef CONFIG_SH_STANDARD_BIOS
904 if (raw_smp_processor_id() == 0)
905 gdb_vbr_init();
906#endif
907
908 /* NOTE: The VBR value should be at P1 884 /* NOTE: The VBR value should be at P1
909 (or P2, virtural "fixed" address space). 885 (or P2, virtural "fixed" address space).
910 It's definitely should not in physical address. */ 886 It's definitely should not in physical address. */
@@ -959,6 +935,9 @@ void __init trap_init(void)
959 set_exception_table_vec(TRAP_UBC, break_point_trap); 935 set_exception_table_vec(TRAP_UBC, break_point_trap);
960#endif 936#endif
961 937
938 /* Save off the BIOS VBR, if there is one */
939 sh_bios_vbr_init();
940
962 /* Setup VBR for boot cpu */ 941 /* Setup VBR for boot cpu */
963 per_cpu_trap_init(); 942 per_cpu_trap_init();
964} 943}