diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-16 22:08:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-16 22:08:03 -0400 |
commit | dc113c1f1d4b47af1b1ca701c5a39e24d296c2ac (patch) | |
tree | 0bb5ce21bcd41a9443708567edbdca80d9a72397 /arch/m68k/kernel | |
parent | 63a93699c6a58795b854ff573542a08367684dae (diff) | |
parent | 059718d572e8ad388313b863aff717623bb2552f (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
m68k/block: amiflop - Remove superfluous amiga_chip_alloc() cast
m68k/atari: ARAnyM - Add support for network access
m68k/atari: ARAnyM - Add support for console access
m68k/atari: ARAnyM - Add support for block access
m68k/atari: Initial ARAnyM support
m68k: Kconfig - Remove unneeded "default n"
m68k: Makefiles - Change to new flags variables
m68k/amiga: Reclaim Chip RAM for PPC exception handlers
m68k: Allow all kernel traps to be handled via exception fixups
m68k: Use base_trap_init() to initialize vectors
m68k: Add helper function handle_kernel_fault()
Diffstat (limited to 'arch/m68k/kernel')
-rw-r--r-- | arch/m68k/kernel/setup.c | 5 | ||||
-rw-r--r-- | arch/m68k/kernel/signal.c | 24 | ||||
-rw-r--r-- | arch/m68k/kernel/traps.c | 20 |
3 files changed, 40 insertions, 9 deletions
diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c index b3963ab3d14..334d8364037 100644 --- a/arch/m68k/kernel/setup.c +++ b/arch/m68k/kernel/setup.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #ifdef CONFIG_SUN3X | 42 | #ifdef CONFIG_SUN3X |
43 | #include <asm/dvma.h> | 43 | #include <asm/dvma.h> |
44 | #endif | 44 | #endif |
45 | #include <asm/natfeat.h> | ||
45 | 46 | ||
46 | #if !FPSTATESIZE || !NR_IRQS | 47 | #if !FPSTATESIZE || !NR_IRQS |
47 | #warning No CPU/platform type selected, your kernel will not work! | 48 | #warning No CPU/platform type selected, your kernel will not work! |
@@ -324,6 +325,10 @@ void __init setup_arch(char **cmdline_p) | |||
324 | panic("No configuration setup"); | 325 | panic("No configuration setup"); |
325 | } | 326 | } |
326 | 327 | ||
328 | #ifdef CONFIG_NATFEAT | ||
329 | nf_init(); | ||
330 | #endif | ||
331 | |||
327 | paging_init(); | 332 | paging_init(); |
328 | 333 | ||
329 | #ifndef CONFIG_SUN3 | 334 | #ifndef CONFIG_SUN3 |
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index d12c3b0d9e4..a0afc239304 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/personality.h> | 42 | #include <linux/personality.h> |
43 | #include <linux/tty.h> | 43 | #include <linux/tty.h> |
44 | #include <linux/binfmts.h> | 44 | #include <linux/binfmts.h> |
45 | #include <linux/module.h> | ||
45 | 46 | ||
46 | #include <asm/setup.h> | 47 | #include <asm/setup.h> |
47 | #include <asm/uaccess.h> | 48 | #include <asm/uaccess.h> |
@@ -51,7 +52,7 @@ | |||
51 | 52 | ||
52 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | 53 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) |
53 | 54 | ||
54 | const int frame_extra_sizes[16] = { | 55 | static const int frame_extra_sizes[16] = { |
55 | [1] = -1, /* sizeof(((struct frame *)0)->un.fmt1), */ | 56 | [1] = -1, /* sizeof(((struct frame *)0)->un.fmt1), */ |
56 | [2] = sizeof(((struct frame *)0)->un.fmt2), | 57 | [2] = sizeof(((struct frame *)0)->un.fmt2), |
57 | [3] = sizeof(((struct frame *)0)->un.fmt3), | 58 | [3] = sizeof(((struct frame *)0)->un.fmt3), |
@@ -69,6 +70,27 @@ const int frame_extra_sizes[16] = { | |||
69 | [15] = -1, /* sizeof(((struct frame *)0)->un.fmtf), */ | 70 | [15] = -1, /* sizeof(((struct frame *)0)->un.fmtf), */ |
70 | }; | 71 | }; |
71 | 72 | ||
73 | int handle_kernel_fault(struct pt_regs *regs) | ||
74 | { | ||
75 | const struct exception_table_entry *fixup; | ||
76 | struct pt_regs *tregs; | ||
77 | |||
78 | /* Are we prepared to handle this kernel fault? */ | ||
79 | fixup = search_exception_tables(regs->pc); | ||
80 | if (!fixup) | ||
81 | return 0; | ||
82 | |||
83 | /* Create a new four word stack frame, discarding the old one. */ | ||
84 | regs->stkadj = frame_extra_sizes[regs->format]; | ||
85 | tregs = (struct pt_regs *)((long)regs + regs->stkadj); | ||
86 | tregs->vector = regs->vector; | ||
87 | tregs->format = 0; | ||
88 | tregs->pc = fixup->fixup; | ||
89 | tregs->sr = regs->sr; | ||
90 | |||
91 | return 1; | ||
92 | } | ||
93 | |||
72 | /* | 94 | /* |
73 | * Atomically swap in the new signal mask, and wait for a signal. | 95 | * Atomically swap in the new signal mask, and wait for a signal. |
74 | */ | 96 | */ |
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index ada4f4cca81..4022bbc2887 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c | |||
@@ -48,10 +48,7 @@ asmlinkage void nmihandler(void); | |||
48 | asmlinkage void fpu_emu(void); | 48 | asmlinkage void fpu_emu(void); |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | e_vector vectors[256] = { | 51 | e_vector vectors[256]; |
52 | [VEC_BUSERR] = buserr, | ||
53 | [VEC_SYS] = system_call, | ||
54 | }; | ||
55 | 52 | ||
56 | /* nmi handler for the Amiga */ | 53 | /* nmi handler for the Amiga */ |
57 | asm(".text\n" | 54 | asm(".text\n" |
@@ -61,10 +58,11 @@ asm(".text\n" | |||
61 | /* | 58 | /* |
62 | * this must be called very early as the kernel might | 59 | * this must be called very early as the kernel might |
63 | * use some instruction that are emulated on the 060 | 60 | * use some instruction that are emulated on the 060 |
61 | * and so we're prepared for early probe attempts (e.g. nf_init). | ||
64 | */ | 62 | */ |
65 | void __init base_trap_init(void) | 63 | void __init base_trap_init(void) |
66 | { | 64 | { |
67 | if(MACH_IS_SUN3X) { | 65 | if (MACH_IS_SUN3X) { |
68 | extern e_vector *sun3x_prom_vbr; | 66 | extern e_vector *sun3x_prom_vbr; |
69 | 67 | ||
70 | __asm__ volatile ("movec %%vbr, %0" : "=r" (sun3x_prom_vbr)); | 68 | __asm__ volatile ("movec %%vbr, %0" : "=r" (sun3x_prom_vbr)); |
@@ -79,6 +77,10 @@ void __init base_trap_init(void) | |||
79 | 77 | ||
80 | vectors[VEC_UNIMPII] = unimp_vec; | 78 | vectors[VEC_UNIMPII] = unimp_vec; |
81 | } | 79 | } |
80 | |||
81 | vectors[VEC_BUSERR] = buserr; | ||
82 | vectors[VEC_ILLEGAL] = trap; | ||
83 | vectors[VEC_SYS] = system_call; | ||
82 | } | 84 | } |
83 | 85 | ||
84 | void __init trap_init (void) | 86 | void __init trap_init (void) |
@@ -1055,9 +1057,11 @@ asmlinkage void trap_c(struct frame *fp) | |||
1055 | siginfo_t info; | 1057 | siginfo_t info; |
1056 | 1058 | ||
1057 | if (fp->ptregs.sr & PS_S) { | 1059 | if (fp->ptregs.sr & PS_S) { |
1058 | if ((fp->ptregs.vector >> 2) == VEC_TRACE) { | 1060 | if (fp->ptregs.vector == VEC_TRACE << 2) { |
1059 | /* traced a trapping instruction */ | 1061 | /* traced a trapping instruction on a 68020/30, |
1060 | } else | 1062 | * real exception will be executed afterwards. |
1063 | */ | ||
1064 | } else if (!handle_kernel_fault(&fp->ptregs)) | ||
1061 | bad_super_trap(fp); | 1065 | bad_super_trap(fp); |
1062 | return; | 1066 | return; |
1063 | } | 1067 | } |