diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-09 16:08:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-09 16:08:20 -0400 |
commit | d84c4124c4b6611301b402e8611b7e36de3bd351 (patch) | |
tree | d83cfaabfb901755d85074815ad948028dc7b03f /arch/sh/kernel/cpu | |
parent | 932c37c375cca25175f9b6acee4c75d7a96d985f (diff) | |
parent | a3cf4ea8729a5d448742fd5a0a003827c9f25cb6 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6:
sh: Fix stacktrace simplification fallout.
sh: SH7760 DMABRG support.
sh: clockevent/clocksource/hrtimers/nohz TMU support.
sh: Truncate MAX_ACTIVE_REGIONS for the common case.
rtc: rtc-sh: Fix rtc_dev pointer for rtc_update_irq().
sh: Convert to common die chain.
sh: Wire up utimensat syscall.
sh: landisk mv_nr_irqs definition.
sh: Fixup ndelay() xloops calculation for alternate HZ.
sh: Add 32-bit opcode feature CPU flag.
sh: Fix PC adjustments for varying opcode length.
sh: Support for SH-2A 32-bit opcodes.
sh: Kill off redundant __div64_32 symbol export.
sh: Share exception vector table for SH-3/4.
sh: Always define TRAPA_BUG_OPCODE.
sh: __GFP_REPEAT for pte allocations, too.
rtc: rtc-sh: Fix up dev_dbg() warnings.
sh: generic quicklist support.
Diffstat (limited to 'arch/sh/kernel/cpu')
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/Makefile | 5 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/opcode_helper.c | 55 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/probe.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh3/ex.S | 13 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4/Makefile | 6 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4/ex.S | 62 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4/fpu.c | 3 |
7 files changed, 71 insertions, 74 deletions
diff --git a/arch/sh/kernel/cpu/sh2a/Makefile b/arch/sh/kernel/cpu/sh2a/Makefile index 350972ae9410..965fa2572b23 100644 --- a/arch/sh/kernel/cpu/sh2a/Makefile +++ b/arch/sh/kernel/cpu/sh2a/Makefile | |||
@@ -2,9 +2,8 @@ | |||
2 | # Makefile for the Linux/SuperH SH-2A backends. | 2 | # Makefile for the Linux/SuperH SH-2A backends. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := common.o probe.o | 5 | obj-y := common.o probe.o opcode_helper.o |
6 | 6 | ||
7 | common-y += $(addprefix ../sh2/, ex.o) | 7 | common-y += $(addprefix ../sh2/, ex.o entry.o) |
8 | common-y += $(addprefix ../sh2/, entry.o) | ||
9 | 8 | ||
10 | obj-$(CONFIG_CPU_SUBTYPE_SH7206) += setup-sh7206.o clock-sh7206.o | 9 | obj-$(CONFIG_CPU_SUBTYPE_SH7206) += setup-sh7206.o clock-sh7206.o |
diff --git a/arch/sh/kernel/cpu/sh2a/opcode_helper.c b/arch/sh/kernel/cpu/sh2a/opcode_helper.c new file mode 100644 index 000000000000..9704b7926d8b --- /dev/null +++ b/arch/sh/kernel/cpu/sh2a/opcode_helper.c | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * arch/sh/kernel/cpu/sh2a/opcode_helper.c | ||
3 | * | ||
4 | * Helper for the SH-2A 32-bit opcodes. | ||
5 | * | ||
6 | * Copyright (C) 2007 Paul Mundt | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | #include <linux/kernel.h> | ||
13 | #include <asm/system.h> | ||
14 | |||
15 | /* | ||
16 | * Instructions on SH are generally fixed at 16-bits, however, SH-2A | ||
17 | * introduces some 32-bit instructions. Since there are no real | ||
18 | * constraints on their use (and they can be mixed and matched), we need | ||
19 | * to check the instruction encoding to work out if it's a true 32-bit | ||
20 | * instruction or not. | ||
21 | * | ||
22 | * Presently, 32-bit opcodes have only slight variations in what the | ||
23 | * actual encoding looks like in the first-half of the instruction, which | ||
24 | * makes it fairly straightforward to differentiate from the 16-bit ones. | ||
25 | * | ||
26 | * First 16-bits of encoding Used by | ||
27 | * | ||
28 | * 0011nnnnmmmm0001 mov.b, mov.w, mov.l, fmov.d, | ||
29 | * fmov.s, movu.b, movu.w | ||
30 | * | ||
31 | * 0011nnnn0iii1001 bclr.b, bld.b, bset.b, bst.b, band.b, | ||
32 | * bandnot.b, bldnot.b, bor.b, bornot.b, | ||
33 | * bxor.b | ||
34 | * | ||
35 | * 0000nnnniiii0000 movi20 | ||
36 | * 0000nnnniiii0001 movi20s | ||
37 | */ | ||
38 | unsigned int instruction_size(unsigned int insn) | ||
39 | { | ||
40 | /* Look for the common cases */ | ||
41 | switch ((insn & 0xf00f)) { | ||
42 | case 0x0000: /* movi20 */ | ||
43 | case 0x0001: /* movi20s */ | ||
44 | case 0x3001: /* 32-bit mov/fmov/movu variants */ | ||
45 | return 4; | ||
46 | } | ||
47 | |||
48 | /* And the special cases.. */ | ||
49 | switch ((insn & 0xf08f)) { | ||
50 | case 0x3009: /* 32-bit b*.b bit operations */ | ||
51 | return 4; | ||
52 | } | ||
53 | |||
54 | return 2; | ||
55 | } | ||
diff --git a/arch/sh/kernel/cpu/sh2a/probe.c b/arch/sh/kernel/cpu/sh2a/probe.c index 426f6db01fc6..f455c3509789 100644 --- a/arch/sh/kernel/cpu/sh2a/probe.c +++ b/arch/sh/kernel/cpu/sh2a/probe.c | |||
@@ -18,6 +18,7 @@ int __init detect_cpu_and_cache_system(void) | |||
18 | { | 18 | { |
19 | /* Just SH7206 for now .. */ | 19 | /* Just SH7206 for now .. */ |
20 | current_cpu_data.type = CPU_SH7206; | 20 | current_cpu_data.type = CPU_SH7206; |
21 | current_cpu_data.flags |= CPU_HAS_OP32; | ||
21 | 22 | ||
22 | current_cpu_data.dcache.ways = 4; | 23 | current_cpu_data.dcache.ways = 4; |
23 | current_cpu_data.dcache.way_incr = (1 << 11); | 24 | current_cpu_data.dcache.way_incr = (1 << 11); |
diff --git a/arch/sh/kernel/cpu/sh3/ex.S b/arch/sh/kernel/cpu/sh3/ex.S index ba3082d640b5..2b2a9e02fb75 100644 --- a/arch/sh/kernel/cpu/sh3/ex.S +++ b/arch/sh/kernel/cpu/sh3/ex.S | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh/kernel/cpu/sh3/ex.S | 2 | * arch/sh/kernel/cpu/sh3/ex.S |
3 | * | 3 | * |
4 | * The SH-3 exception vector table. | 4 | * The SH-3 and SH-4 exception vector table. |
5 | 5 | ||
6 | * Copyright (C) 1999, 2000, 2002 Niibe Yutaka | 6 | * Copyright (C) 1999, 2000, 2002 Niibe Yutaka |
7 | * Copyright (C) 2003 - 2006 Paul Mundt | 7 | * Copyright (C) 2003 - 2006 Paul Mundt |
@@ -9,7 +9,6 @@ | |||
9 | * This file is subject to the terms and conditions of the GNU General Public | 9 | * This file is subject to the terms and conditions of the GNU General Public |
10 | * License. See the file "COPYING" in the main directory of this archive | 10 | * License. See the file "COPYING" in the main directory of this archive |
11 | * for more details. | 11 | * for more details. |
12 | * | ||
13 | */ | 12 | */ |
14 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
15 | 14 | ||
@@ -36,8 +35,12 @@ ENTRY(exception_handling_table) | |||
36 | .long exception_error ! address error load | 35 | .long exception_error ! address error load |
37 | .long exception_error ! address error store /* 100 */ | 36 | .long exception_error ! address error store /* 100 */ |
38 | #endif | 37 | #endif |
39 | .long exception_error ! fpu_exception /* 120 */ | 38 | #if defined(CONFIG_SH_FPU) |
40 | .long exception_error /* 140 */ | 39 | .long do_fpu_error /* 120 */ |
40 | #else | ||
41 | .long exception_error /* 120 */ | ||
42 | #endif | ||
43 | .long exception_error /* 140 */ | ||
41 | .long system_call ! Unconditional Trap /* 160 */ | 44 | .long system_call ! Unconditional Trap /* 160 */ |
42 | .long exception_error ! reserved_instruction (filled by trap_init) /* 180 */ | 45 | .long exception_error ! reserved_instruction (filled by trap_init) /* 180 */ |
43 | .long exception_error ! illegal_slot_instruction (filled by trap_init) /*1A0*/ | 46 | .long exception_error ! illegal_slot_instruction (filled by trap_init) /*1A0*/ |
@@ -55,4 +58,4 @@ ENTRY(user_break_point_trap) | |||
55 | * away offsets can be manually inserted in to their appropriate | 58 | * away offsets can be manually inserted in to their appropriate |
56 | * location via set_exception_table_{evt,vec}(). | 59 | * location via set_exception_table_{evt,vec}(). |
57 | */ | 60 | */ |
58 | .balign 4096,0,4096 | 61 | .balign 4096,0,4096 |
diff --git a/arch/sh/kernel/cpu/sh4/Makefile b/arch/sh/kernel/cpu/sh4/Makefile index 19ca68c71884..8add10bd8268 100644 --- a/arch/sh/kernel/cpu/sh4/Makefile +++ b/arch/sh/kernel/cpu/sh4/Makefile | |||
@@ -2,10 +2,10 @@ | |||
2 | # Makefile for the Linux/SuperH SH-4 backends. | 2 | # Makefile for the Linux/SuperH SH-4 backends. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := ex.o probe.o common.o | 5 | obj-y := probe.o common.o |
6 | common-y += $(addprefix ../sh3/, entry.o) | 6 | common-y += $(addprefix ../sh3/, entry.o ex.o) |
7 | 7 | ||
8 | obj-$(CONFIG_SH_FPU) += fpu.o | 8 | obj-$(CONFIG_SH_FPU) += fpu.o |
9 | obj-$(CONFIG_SH_STORE_QUEUES) += sq.o | 9 | obj-$(CONFIG_SH_STORE_QUEUES) += sq.o |
10 | 10 | ||
11 | # CPU subtype setup | 11 | # CPU subtype setup |
diff --git a/arch/sh/kernel/cpu/sh4/ex.S b/arch/sh/kernel/cpu/sh4/ex.S deleted file mode 100644 index ac8ab57413cc..000000000000 --- a/arch/sh/kernel/cpu/sh4/ex.S +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh/kernel/cpu/sh4/ex.S | ||
3 | * | ||
4 | * The SH-4 exception vector table. | ||
5 | |||
6 | * Copyright (C) 1999, 2000, 2002 Niibe Yutaka | ||
7 | * Copyright (C) 2003 - 2006 Paul Mundt | ||
8 | * | ||
9 | * This file is subject to the terms and conditions of the GNU General Public | ||
10 | * License. See the file "COPYING" in the main directory of this archive | ||
11 | * for more details. | ||
12 | * | ||
13 | */ | ||
14 | #include <linux/linkage.h> | ||
15 | |||
16 | .align 2 | ||
17 | .data | ||
18 | |||
19 | ENTRY(exception_handling_table) | ||
20 | .long exception_error /* 000 */ | ||
21 | .long exception_error | ||
22 | #if defined(CONFIG_MMU) | ||
23 | .long tlb_miss_load /* 040 */ | ||
24 | .long tlb_miss_store | ||
25 | .long initial_page_write | ||
26 | .long tlb_protection_violation_load | ||
27 | .long tlb_protection_violation_store | ||
28 | .long address_error_load | ||
29 | .long address_error_store /* 100 */ | ||
30 | #else | ||
31 | .long exception_error ! tlb miss load /* 040 */ | ||
32 | .long exception_error ! tlb miss store | ||
33 | .long exception_error ! initial page write | ||
34 | .long exception_error ! tlb prot violation load | ||
35 | .long exception_error ! tlb prot violation store | ||
36 | .long exception_error ! address error load | ||
37 | .long exception_error ! address error store /* 100 */ | ||
38 | #endif | ||
39 | #if defined(CONFIG_SH_FPU) | ||
40 | .long do_fpu_error /* 120 */ | ||
41 | #else | ||
42 | .long exception_error /* 120 */ | ||
43 | #endif | ||
44 | .long exception_error /* 140 */ | ||
45 | .long system_call ! Unconditional Trap /* 160 */ | ||
46 | .long exception_error ! reserved_instruction (filled by trap_init) /* 180 */ | ||
47 | .long exception_error ! illegal_slot_instruction (filled by trap_init) /*1A0*/ | ||
48 | ENTRY(nmi_slot) | ||
49 | #if defined (CONFIG_KGDB_NMI) | ||
50 | .long debug_enter /* 1C0 */ ! Allow trap to debugger | ||
51 | #else | ||
52 | .long exception_none /* 1C0 */ ! Not implemented yet | ||
53 | #endif | ||
54 | ENTRY(user_break_point_trap) | ||
55 | .long break_point_trap /* 1E0 */ | ||
56 | |||
57 | /* | ||
58 | * Pad the remainder of the table out, exceptions residing in far | ||
59 | * away offsets can be manually inserted in to their appropriate | ||
60 | * location via set_exception_table_{evt,vec}(). | ||
61 | */ | ||
62 | .balign 4096,0,4096 | ||
diff --git a/arch/sh/kernel/cpu/sh4/fpu.c b/arch/sh/kernel/cpu/sh4/fpu.c index 7624677f6628..d61dd599169f 100644 --- a/arch/sh/kernel/cpu/sh4/fpu.c +++ b/arch/sh/kernel/cpu/sh4/fpu.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
17 | #include <linux/signal.h> | 17 | #include <linux/signal.h> |
18 | #include <asm/processor.h> | 18 | #include <asm/processor.h> |
19 | #include <asm/system.h> | ||
19 | #include <asm/io.h> | 20 | #include <asm/io.h> |
20 | 21 | ||
21 | /* The PR (precision) bit in the FP Status Register must be clear when | 22 | /* The PR (precision) bit in the FP Status Register must be clear when |
@@ -265,7 +266,7 @@ ieee_fpe_handler (struct pt_regs *regs) | |||
265 | nextpc = regs->pr; | 266 | nextpc = regs->pr; |
266 | finsn = *(unsigned short *) (regs->pc + 2); | 267 | finsn = *(unsigned short *) (regs->pc + 2); |
267 | } else { | 268 | } else { |
268 | nextpc = regs->pc + 2; | 269 | nextpc = regs->pc + instruction_size(insn); |
269 | finsn = insn; | 270 | finsn = insn; |
270 | } | 271 | } |
271 | 272 | ||