diff options
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r-- | arch/sh/kernel/cpu/init.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh2/probe.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/probe.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh3/entry.S | 32 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh3/probe.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4/probe.c | 10 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/smp-shx3.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh5/probe.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/localtimer.c | 9 | ||||
-rw-r--r-- | arch/sh/kernel/process_64.c | 24 | ||||
-rw-r--r-- | arch/sh/kernel/setup.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/sh_ksyms_32.c | 6 | ||||
-rw-r--r-- | arch/sh/kernel/sh_ksyms_64.c | 9 | ||||
-rw-r--r-- | arch/sh/kernel/signal_64.c | 38 | ||||
-rw-r--r-- | arch/sh/kernel/time.c | 4 |
15 files changed, 66 insertions, 78 deletions
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c index d40b9db5be03..e932ebef4738 100644 --- a/arch/sh/kernel/cpu/init.c +++ b/arch/sh/kernel/cpu/init.c | |||
@@ -299,11 +299,9 @@ asmlinkage void __init sh_cpu_init(void) | |||
299 | cache_init(); | 299 | cache_init(); |
300 | 300 | ||
301 | if (raw_smp_processor_id() == 0) { | 301 | if (raw_smp_processor_id() == 0) { |
302 | #ifdef CONFIG_MMU | ||
303 | shm_align_mask = max_t(unsigned long, | 302 | shm_align_mask = max_t(unsigned long, |
304 | current_cpu_data.dcache.way_size - 1, | 303 | current_cpu_data.dcache.way_size - 1, |
305 | PAGE_SIZE - 1); | 304 | PAGE_SIZE - 1); |
306 | #endif | ||
307 | 305 | ||
308 | /* Boot CPU sets the cache shape */ | 306 | /* Boot CPU sets the cache shape */ |
309 | detect_cache_shape(); | 307 | detect_cache_shape(); |
diff --git a/arch/sh/kernel/cpu/sh2/probe.c b/arch/sh/kernel/cpu/sh2/probe.c index 5916d9096b99..1db6d8883888 100644 --- a/arch/sh/kernel/cpu/sh2/probe.c +++ b/arch/sh/kernel/cpu/sh2/probe.c | |||
@@ -29,6 +29,7 @@ int __init detect_cpu_and_cache_system(void) | |||
29 | */ | 29 | */ |
30 | boot_cpu_data.dcache.flags |= SH_CACHE_COMBINED; | 30 | boot_cpu_data.dcache.flags |= SH_CACHE_COMBINED; |
31 | boot_cpu_data.icache = boot_cpu_data.dcache; | 31 | boot_cpu_data.icache = boot_cpu_data.dcache; |
32 | boot_cpu_data.family = CPU_FAMILY_SH2; | ||
32 | 33 | ||
33 | return 0; | 34 | return 0; |
34 | } | 35 | } |
diff --git a/arch/sh/kernel/cpu/sh2a/probe.c b/arch/sh/kernel/cpu/sh2a/probe.c index e098e2f6aa08..6825d6507164 100644 --- a/arch/sh/kernel/cpu/sh2a/probe.c +++ b/arch/sh/kernel/cpu/sh2a/probe.c | |||
@@ -15,6 +15,8 @@ | |||
15 | 15 | ||
16 | int __init detect_cpu_and_cache_system(void) | 16 | int __init detect_cpu_and_cache_system(void) |
17 | { | 17 | { |
18 | boot_cpu_data.family = CPU_FAMILY_SH2A; | ||
19 | |||
18 | /* All SH-2A CPUs have support for 16 and 32-bit opcodes.. */ | 20 | /* All SH-2A CPUs have support for 16 and 32-bit opcodes.. */ |
19 | boot_cpu_data.flags |= CPU_HAS_OP32; | 21 | boot_cpu_data.flags |= CPU_HAS_OP32; |
20 | 22 | ||
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S index 9421ec715fd2..aebd33d18ff7 100644 --- a/arch/sh/kernel/cpu/sh3/entry.S +++ b/arch/sh/kernel/cpu/sh3/entry.S | |||
@@ -113,35 +113,34 @@ OFF_TRA = (16*4+6*4) | |||
113 | #if defined(CONFIG_MMU) | 113 | #if defined(CONFIG_MMU) |
114 | .align 2 | 114 | .align 2 |
115 | ENTRY(tlb_miss_load) | 115 | ENTRY(tlb_miss_load) |
116 | bra call_dpf | 116 | bra call_handle_tlbmiss |
117 | mov #0, r5 | 117 | mov #0, r5 |
118 | 118 | ||
119 | .align 2 | 119 | .align 2 |
120 | ENTRY(tlb_miss_store) | 120 | ENTRY(tlb_miss_store) |
121 | bra call_dpf | 121 | bra call_handle_tlbmiss |
122 | mov #1, r5 | 122 | mov #1, r5 |
123 | 123 | ||
124 | .align 2 | 124 | .align 2 |
125 | ENTRY(initial_page_write) | 125 | ENTRY(initial_page_write) |
126 | bra call_dpf | 126 | bra call_handle_tlbmiss |
127 | mov #1, r5 | 127 | mov #2, r5 |
128 | 128 | ||
129 | .align 2 | 129 | .align 2 |
130 | ENTRY(tlb_protection_violation_load) | 130 | ENTRY(tlb_protection_violation_load) |
131 | bra call_dpf | 131 | bra call_do_page_fault |
132 | mov #0, r5 | 132 | mov #0, r5 |
133 | 133 | ||
134 | .align 2 | 134 | .align 2 |
135 | ENTRY(tlb_protection_violation_store) | 135 | ENTRY(tlb_protection_violation_store) |
136 | bra call_dpf | 136 | bra call_do_page_fault |
137 | mov #1, r5 | 137 | mov #1, r5 |
138 | 138 | ||
139 | call_dpf: | 139 | call_handle_tlbmiss: |
140 | setup_frame_reg | 140 | setup_frame_reg |
141 | mov.l 1f, r0 | 141 | mov.l 1f, r0 |
142 | mov r5, r8 | 142 | mov r5, r8 |
143 | mov.l @r0, r6 | 143 | mov.l @r0, r6 |
144 | mov r6, r9 | ||
145 | mov.l 2f, r0 | 144 | mov.l 2f, r0 |
146 | sts pr, r10 | 145 | sts pr, r10 |
147 | jsr @r0 | 146 | jsr @r0 |
@@ -152,16 +151,25 @@ call_dpf: | |||
152 | lds r10, pr | 151 | lds r10, pr |
153 | rts | 152 | rts |
154 | nop | 153 | nop |
155 | 0: mov.l 3f, r0 | 154 | 0: |
156 | mov r9, r6 | ||
157 | mov r8, r5 | 155 | mov r8, r5 |
156 | call_do_page_fault: | ||
157 | mov.l 1f, r0 | ||
158 | mov.l @r0, r6 | ||
159 | |||
160 | sti | ||
161 | |||
162 | mov.l 3f, r0 | ||
163 | mov.l 4f, r1 | ||
164 | mov r15, r4 | ||
158 | jmp @r0 | 165 | jmp @r0 |
159 | mov r15, r4 | 166 | lds r1, pr |
160 | 167 | ||
161 | .align 2 | 168 | .align 2 |
162 | 1: .long MMU_TEA | 169 | 1: .long MMU_TEA |
163 | 2: .long __do_page_fault | 170 | 2: .long handle_tlbmiss |
164 | 3: .long do_page_fault | 171 | 3: .long do_page_fault |
172 | 4: .long ret_from_exception | ||
165 | 173 | ||
166 | .align 2 | 174 | .align 2 |
167 | ENTRY(address_error_load) | 175 | ENTRY(address_error_load) |
diff --git a/arch/sh/kernel/cpu/sh3/probe.c b/arch/sh/kernel/cpu/sh3/probe.c index 10f2a760c5ee..f9c7df64eb01 100644 --- a/arch/sh/kernel/cpu/sh3/probe.c +++ b/arch/sh/kernel/cpu/sh3/probe.c | |||
@@ -107,5 +107,7 @@ int __uses_jump_to_uncached detect_cpu_and_cache_system(void) | |||
107 | boot_cpu_data.dcache.flags |= SH_CACHE_COMBINED; | 107 | boot_cpu_data.dcache.flags |= SH_CACHE_COMBINED; |
108 | boot_cpu_data.icache = boot_cpu_data.dcache; | 108 | boot_cpu_data.icache = boot_cpu_data.dcache; |
109 | 109 | ||
110 | boot_cpu_data.family = CPU_FAMILY_SH3; | ||
111 | |||
110 | return 0; | 112 | return 0; |
111 | } | 113 | } |
diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c index afd3e73d5ad4..d36f0c45f55f 100644 --- a/arch/sh/kernel/cpu/sh4/probe.c +++ b/arch/sh/kernel/cpu/sh4/probe.c | |||
@@ -57,8 +57,12 @@ int __init detect_cpu_and_cache_system(void) | |||
57 | * Setup some generic flags we can probe on SH-4A parts | 57 | * Setup some generic flags we can probe on SH-4A parts |
58 | */ | 58 | */ |
59 | if (((pvr >> 16) & 0xff) == 0x10) { | 59 | if (((pvr >> 16) & 0xff) == 0x10) { |
60 | if ((cvr & 0x10000000) == 0) | 60 | boot_cpu_data.family = CPU_FAMILY_SH4A; |
61 | |||
62 | if ((cvr & 0x10000000) == 0) { | ||
61 | boot_cpu_data.flags |= CPU_HAS_DSP; | 63 | boot_cpu_data.flags |= CPU_HAS_DSP; |
64 | boot_cpu_data.family = CPU_FAMILY_SH4AL_DSP; | ||
65 | } | ||
62 | 66 | ||
63 | boot_cpu_data.flags |= CPU_HAS_LLSC | CPU_HAS_PERF_COUNTER; | 67 | boot_cpu_data.flags |= CPU_HAS_LLSC | CPU_HAS_PERF_COUNTER; |
64 | boot_cpu_data.cut_major = pvr & 0x7f; | 68 | boot_cpu_data.cut_major = pvr & 0x7f; |
@@ -68,6 +72,7 @@ int __init detect_cpu_and_cache_system(void) | |||
68 | } else { | 72 | } else { |
69 | /* And some SH-4 defaults.. */ | 73 | /* And some SH-4 defaults.. */ |
70 | boot_cpu_data.flags |= CPU_HAS_PTEA; | 74 | boot_cpu_data.flags |= CPU_HAS_PTEA; |
75 | boot_cpu_data.family = CPU_FAMILY_SH4; | ||
71 | } | 76 | } |
72 | 77 | ||
73 | /* FPU detection works for everyone */ | 78 | /* FPU detection works for everyone */ |
@@ -180,9 +185,6 @@ int __init detect_cpu_and_cache_system(void) | |||
180 | boot_cpu_data.dcache.ways = 2; | 185 | boot_cpu_data.dcache.ways = 2; |
181 | 186 | ||
182 | break; | 187 | break; |
183 | default: | ||
184 | boot_cpu_data.type = CPU_SH_NONE; | ||
185 | break; | ||
186 | } | 188 | } |
187 | 189 | ||
188 | /* | 190 | /* |
diff --git a/arch/sh/kernel/cpu/sh4a/smp-shx3.c b/arch/sh/kernel/cpu/sh4a/smp-shx3.c index 2b6b0d50c576..185ec3976a25 100644 --- a/arch/sh/kernel/cpu/sh4a/smp-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/smp-shx3.c | |||
@@ -57,6 +57,8 @@ void __init plat_prepare_cpus(unsigned int max_cpus) | |||
57 | { | 57 | { |
58 | int i; | 58 | int i; |
59 | 59 | ||
60 | local_timer_setup(0); | ||
61 | |||
60 | BUILD_BUG_ON(SMP_MSG_NR >= 8); | 62 | BUILD_BUG_ON(SMP_MSG_NR >= 8); |
61 | 63 | ||
62 | for (i = 0; i < SMP_MSG_NR; i++) | 64 | for (i = 0; i < SMP_MSG_NR; i++) |
diff --git a/arch/sh/kernel/cpu/sh5/probe.c b/arch/sh/kernel/cpu/sh5/probe.c index 92ad844b5c12..521d05b3f7ba 100644 --- a/arch/sh/kernel/cpu/sh5/probe.c +++ b/arch/sh/kernel/cpu/sh5/probe.c | |||
@@ -34,6 +34,8 @@ int __init detect_cpu_and_cache_system(void) | |||
34 | /* CPU.VCR aliased at CIR address on SH5-101 */ | 34 | /* CPU.VCR aliased at CIR address on SH5-101 */ |
35 | boot_cpu_data.type = CPU_SH5_101; | 35 | boot_cpu_data.type = CPU_SH5_101; |
36 | 36 | ||
37 | boot_cpu_data.family = CPU_FAMILY_SH5; | ||
38 | |||
37 | /* | 39 | /* |
38 | * First, setup some sane values for the I-cache. | 40 | * First, setup some sane values for the I-cache. |
39 | */ | 41 | */ |
diff --git a/arch/sh/kernel/localtimer.c b/arch/sh/kernel/localtimer.c index 96e8eaea1e62..0b04e7d4a9b9 100644 --- a/arch/sh/kernel/localtimer.c +++ b/arch/sh/kernel/localtimer.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/jiffies.h> | 22 | #include <linux/jiffies.h> |
23 | #include <linux/percpu.h> | 23 | #include <linux/percpu.h> |
24 | #include <linux/clockchips.h> | 24 | #include <linux/clockchips.h> |
25 | #include <linux/hardirq.h> | ||
25 | #include <linux/irq.h> | 26 | #include <linux/irq.h> |
26 | 27 | ||
27 | static DEFINE_PER_CPU(struct clock_event_device, local_clockevent); | 28 | static DEFINE_PER_CPU(struct clock_event_device, local_clockevent); |
@@ -33,7 +34,9 @@ void local_timer_interrupt(void) | |||
33 | { | 34 | { |
34 | struct clock_event_device *clk = &__get_cpu_var(local_clockevent); | 35 | struct clock_event_device *clk = &__get_cpu_var(local_clockevent); |
35 | 36 | ||
37 | irq_enter(); | ||
36 | clk->event_handler(clk); | 38 | clk->event_handler(clk); |
39 | irq_exit(); | ||
37 | } | 40 | } |
38 | 41 | ||
39 | static void dummy_timer_set_mode(enum clock_event_mode mode, | 42 | static void dummy_timer_set_mode(enum clock_event_mode mode, |
@@ -46,8 +49,10 @@ void __cpuinit local_timer_setup(unsigned int cpu) | |||
46 | struct clock_event_device *clk = &per_cpu(local_clockevent, cpu); | 49 | struct clock_event_device *clk = &per_cpu(local_clockevent, cpu); |
47 | 50 | ||
48 | clk->name = "dummy_timer"; | 51 | clk->name = "dummy_timer"; |
49 | clk->features = CLOCK_EVT_FEAT_DUMMY; | 52 | clk->features = CLOCK_EVT_FEAT_ONESHOT | |
50 | clk->rating = 200; | 53 | CLOCK_EVT_FEAT_PERIODIC | |
54 | CLOCK_EVT_FEAT_DUMMY; | ||
55 | clk->rating = 400; | ||
51 | clk->mult = 1; | 56 | clk->mult = 1; |
52 | clk->set_mode = dummy_timer_set_mode; | 57 | clk->set_mode = dummy_timer_set_mode; |
53 | clk->broadcast = smp_timer_broadcast; | 58 | clk->broadcast = smp_timer_broadcast; |
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c index 24de74214940..1192398ef582 100644 --- a/arch/sh/kernel/process_64.c +++ b/arch/sh/kernel/process_64.c | |||
@@ -425,7 +425,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
425 | struct task_struct *p, struct pt_regs *regs) | 425 | struct task_struct *p, struct pt_regs *regs) |
426 | { | 426 | { |
427 | struct pt_regs *childregs; | 427 | struct pt_regs *childregs; |
428 | unsigned long long se; /* Sign extension */ | ||
429 | 428 | ||
430 | #ifdef CONFIG_SH_FPU | 429 | #ifdef CONFIG_SH_FPU |
431 | if(last_task_used_math == current) { | 430 | if(last_task_used_math == current) { |
@@ -441,11 +440,19 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
441 | 440 | ||
442 | *childregs = *regs; | 441 | *childregs = *regs; |
443 | 442 | ||
443 | /* | ||
444 | * Sign extend the edited stack. | ||
445 | * Note that thread.pc and thread.pc will stay | ||
446 | * 32-bit wide and context switch must take care | ||
447 | * of NEFF sign extension. | ||
448 | */ | ||
444 | if (user_mode(regs)) { | 449 | if (user_mode(regs)) { |
445 | childregs->regs[15] = usp; | 450 | childregs->regs[15] = neff_sign_extend(usp); |
446 | p->thread.uregs = childregs; | 451 | p->thread.uregs = childregs; |
447 | } else { | 452 | } else { |
448 | childregs->regs[15] = (unsigned long)task_stack_page(p) + THREAD_SIZE; | 453 | childregs->regs[15] = |
454 | neff_sign_extend((unsigned long)task_stack_page(p) + | ||
455 | THREAD_SIZE); | ||
449 | } | 456 | } |
450 | 457 | ||
451 | childregs->regs[9] = 0; /* Set return value for child */ | 458 | childregs->regs[9] = 0; /* Set return value for child */ |
@@ -454,17 +461,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
454 | p->thread.sp = (unsigned long) childregs; | 461 | p->thread.sp = (unsigned long) childregs; |
455 | p->thread.pc = (unsigned long) ret_from_fork; | 462 | p->thread.pc = (unsigned long) ret_from_fork; |
456 | 463 | ||
457 | /* | ||
458 | * Sign extend the edited stack. | ||
459 | * Note that thread.pc and thread.pc will stay | ||
460 | * 32-bit wide and context switch must take care | ||
461 | * of NEFF sign extension. | ||
462 | */ | ||
463 | |||
464 | se = childregs->regs[15]; | ||
465 | se = (se & NEFF_SIGN) ? (se | NEFF_MASK) : se; | ||
466 | childregs->regs[15] = se; | ||
467 | |||
468 | return 0; | 464 | return 0; |
469 | } | 465 | } |
470 | 466 | ||
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index d13bbafb4e1b..f9d44f8e0df6 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
@@ -49,6 +49,7 @@ | |||
49 | struct sh_cpuinfo cpu_data[NR_CPUS] __read_mostly = { | 49 | struct sh_cpuinfo cpu_data[NR_CPUS] __read_mostly = { |
50 | [0] = { | 50 | [0] = { |
51 | .type = CPU_SH_NONE, | 51 | .type = CPU_SH_NONE, |
52 | .family = CPU_FAMILY_UNKNOWN, | ||
52 | .loops_per_jiffy = 10000000, | 53 | .loops_per_jiffy = 10000000, |
53 | }, | 54 | }, |
54 | }; | 55 | }; |
diff --git a/arch/sh/kernel/sh_ksyms_32.c b/arch/sh/kernel/sh_ksyms_32.c index cec610888e28..8dbe26b17c44 100644 --- a/arch/sh/kernel/sh_ksyms_32.c +++ b/arch/sh/kernel/sh_ksyms_32.c | |||
@@ -101,11 +101,6 @@ EXPORT_SYMBOL(flush_cache_range); | |||
101 | EXPORT_SYMBOL(flush_dcache_page); | 101 | EXPORT_SYMBOL(flush_dcache_page); |
102 | #endif | 102 | #endif |
103 | 103 | ||
104 | #if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \ | ||
105 | (defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB)) | ||
106 | EXPORT_SYMBOL(clear_user_page); | ||
107 | #endif | ||
108 | |||
109 | #ifdef CONFIG_MCOUNT | 104 | #ifdef CONFIG_MCOUNT |
110 | DECLARE_EXPORT(mcount); | 105 | DECLARE_EXPORT(mcount); |
111 | #endif | 106 | #endif |
@@ -114,7 +109,6 @@ EXPORT_SYMBOL(csum_partial_copy_generic); | |||
114 | #ifdef CONFIG_IPV6 | 109 | #ifdef CONFIG_IPV6 |
115 | EXPORT_SYMBOL(csum_ipv6_magic); | 110 | EXPORT_SYMBOL(csum_ipv6_magic); |
116 | #endif | 111 | #endif |
117 | EXPORT_SYMBOL(clear_page); | ||
118 | EXPORT_SYMBOL(copy_page); | 112 | EXPORT_SYMBOL(copy_page); |
119 | EXPORT_SYMBOL(__clear_user); | 113 | EXPORT_SYMBOL(__clear_user); |
120 | EXPORT_SYMBOL(_ebss); | 114 | EXPORT_SYMBOL(_ebss); |
diff --git a/arch/sh/kernel/sh_ksyms_64.c b/arch/sh/kernel/sh_ksyms_64.c index f5bd156ea504..d008e17eb257 100644 --- a/arch/sh/kernel/sh_ksyms_64.c +++ b/arch/sh/kernel/sh_ksyms_64.c | |||
@@ -30,14 +30,6 @@ extern int dump_fpu(struct pt_regs *, elf_fpregset_t *); | |||
30 | EXPORT_SYMBOL(dump_fpu); | 30 | EXPORT_SYMBOL(dump_fpu); |
31 | EXPORT_SYMBOL(kernel_thread); | 31 | EXPORT_SYMBOL(kernel_thread); |
32 | 32 | ||
33 | #if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) | ||
34 | EXPORT_SYMBOL(clear_user_page); | ||
35 | #endif | ||
36 | |||
37 | #ifndef CONFIG_CACHE_OFF | ||
38 | EXPORT_SYMBOL(flush_dcache_page); | ||
39 | #endif | ||
40 | |||
41 | #ifdef CONFIG_VT | 33 | #ifdef CONFIG_VT |
42 | EXPORT_SYMBOL(screen_info); | 34 | EXPORT_SYMBOL(screen_info); |
43 | #endif | 35 | #endif |
@@ -52,7 +44,6 @@ EXPORT_SYMBOL(__get_user_asm_l); | |||
52 | EXPORT_SYMBOL(__get_user_asm_q); | 44 | EXPORT_SYMBOL(__get_user_asm_q); |
53 | EXPORT_SYMBOL(__strnlen_user); | 45 | EXPORT_SYMBOL(__strnlen_user); |
54 | EXPORT_SYMBOL(__strncpy_from_user); | 46 | EXPORT_SYMBOL(__strncpy_from_user); |
55 | EXPORT_SYMBOL(clear_page); | ||
56 | EXPORT_SYMBOL(__clear_user); | 47 | EXPORT_SYMBOL(__clear_user); |
57 | EXPORT_SYMBOL(copy_page); | 48 | EXPORT_SYMBOL(copy_page); |
58 | EXPORT_SYMBOL(__copy_user); | 49 | EXPORT_SYMBOL(__copy_user); |
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c index 0663a0ee6021..026fd1cfe17d 100644 --- a/arch/sh/kernel/signal_64.c +++ b/arch/sh/kernel/signal_64.c | |||
@@ -561,13 +561,11 @@ static int setup_frame(int sig, struct k_sigaction *ka, | |||
561 | /* Set up to return from userspace. If provided, use a stub | 561 | /* Set up to return from userspace. If provided, use a stub |
562 | already in userspace. */ | 562 | already in userspace. */ |
563 | if (ka->sa.sa_flags & SA_RESTORER) { | 563 | if (ka->sa.sa_flags & SA_RESTORER) { |
564 | DEREF_REG_PR = (unsigned long) ka->sa.sa_restorer | 0x1; | ||
565 | |||
566 | /* | 564 | /* |
567 | * On SH5 all edited pointers are subject to NEFF | 565 | * On SH5 all edited pointers are subject to NEFF |
568 | */ | 566 | */ |
569 | DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ? | 567 | DEREF_REG_PR = neff_sign_extend((unsigned long) |
570 | (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR; | 568 | ka->sa.sa_restorer | 0x1); |
571 | } else { | 569 | } else { |
572 | /* | 570 | /* |
573 | * Different approach on SH5. | 571 | * Different approach on SH5. |
@@ -580,9 +578,8 @@ static int setup_frame(int sig, struct k_sigaction *ka, | |||
580 | * . being code, linker turns ShMedia bit on, always | 578 | * . being code, linker turns ShMedia bit on, always |
581 | * dereference index -1. | 579 | * dereference index -1. |
582 | */ | 580 | */ |
583 | DEREF_REG_PR = (unsigned long) frame->retcode | 0x01; | 581 | DEREF_REG_PR = neff_sign_extend((unsigned long) |
584 | DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ? | 582 | frame->retcode | 0x01); |
585 | (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR; | ||
586 | 583 | ||
587 | if (__copy_to_user(frame->retcode, | 584 | if (__copy_to_user(frame->retcode, |
588 | (void *)((unsigned long)sa_default_restorer & (~1)), 16) != 0) | 585 | (void *)((unsigned long)sa_default_restorer & (~1)), 16) != 0) |
@@ -596,9 +593,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, | |||
596 | * Set up registers for signal handler. | 593 | * Set up registers for signal handler. |
597 | * All edited pointers are subject to NEFF. | 594 | * All edited pointers are subject to NEFF. |
598 | */ | 595 | */ |
599 | regs->regs[REG_SP] = (unsigned long) frame; | 596 | regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame); |
600 | regs->regs[REG_SP] = (regs->regs[REG_SP] & NEFF_SIGN) ? | ||
601 | (regs->regs[REG_SP] | NEFF_MASK) : regs->regs[REG_SP]; | ||
602 | regs->regs[REG_ARG1] = signal; /* Arg for signal handler */ | 597 | regs->regs[REG_ARG1] = signal; /* Arg for signal handler */ |
603 | 598 | ||
604 | /* FIXME: | 599 | /* FIXME: |
@@ -613,8 +608,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, | |||
613 | regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->sc; | 608 | regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->sc; |
614 | regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->sc; | 609 | regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->sc; |
615 | 610 | ||
616 | regs->pc = (unsigned long) ka->sa.sa_handler; | 611 | regs->pc = neff_sign_extend((unsigned long)ka->sa.sa_handler); |
617 | regs->pc = (regs->pc & NEFF_SIGN) ? (regs->pc | NEFF_MASK) : regs->pc; | ||
618 | 612 | ||
619 | set_fs(USER_DS); | 613 | set_fs(USER_DS); |
620 | 614 | ||
@@ -676,13 +670,11 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
676 | /* Set up to return from userspace. If provided, use a stub | 670 | /* Set up to return from userspace. If provided, use a stub |
677 | already in userspace. */ | 671 | already in userspace. */ |
678 | if (ka->sa.sa_flags & SA_RESTORER) { | 672 | if (ka->sa.sa_flags & SA_RESTORER) { |
679 | DEREF_REG_PR = (unsigned long) ka->sa.sa_restorer | 0x1; | ||
680 | |||
681 | /* | 673 | /* |
682 | * On SH5 all edited pointers are subject to NEFF | 674 | * On SH5 all edited pointers are subject to NEFF |
683 | */ | 675 | */ |
684 | DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ? | 676 | DEREF_REG_PR = neff_sign_extend((unsigned long) |
685 | (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR; | 677 | ka->sa.sa_restorer | 0x1); |
686 | } else { | 678 | } else { |
687 | /* | 679 | /* |
688 | * Different approach on SH5. | 680 | * Different approach on SH5. |
@@ -695,15 +687,14 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
695 | * . being code, linker turns ShMedia bit on, always | 687 | * . being code, linker turns ShMedia bit on, always |
696 | * dereference index -1. | 688 | * dereference index -1. |
697 | */ | 689 | */ |
698 | 690 | DEREF_REG_PR = neff_sign_extend((unsigned long) | |
699 | DEREF_REG_PR = (unsigned long) frame->retcode | 0x01; | 691 | frame->retcode | 0x01); |
700 | DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ? | ||
701 | (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR; | ||
702 | 692 | ||
703 | if (__copy_to_user(frame->retcode, | 693 | if (__copy_to_user(frame->retcode, |
704 | (void *)((unsigned long)sa_default_rt_restorer & (~1)), 16) != 0) | 694 | (void *)((unsigned long)sa_default_rt_restorer & (~1)), 16) != 0) |
705 | goto give_sigsegv; | 695 | goto give_sigsegv; |
706 | 696 | ||
697 | /* Cohere the trampoline with the I-cache. */ | ||
707 | flush_icache_range(DEREF_REG_PR-1, DEREF_REG_PR-1+15); | 698 | flush_icache_range(DEREF_REG_PR-1, DEREF_REG_PR-1+15); |
708 | } | 699 | } |
709 | 700 | ||
@@ -711,14 +702,11 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
711 | * Set up registers for signal handler. | 702 | * Set up registers for signal handler. |
712 | * All edited pointers are subject to NEFF. | 703 | * All edited pointers are subject to NEFF. |
713 | */ | 704 | */ |
714 | regs->regs[REG_SP] = (unsigned long) frame; | 705 | regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame); |
715 | regs->regs[REG_SP] = (regs->regs[REG_SP] & NEFF_SIGN) ? | ||
716 | (regs->regs[REG_SP] | NEFF_MASK) : regs->regs[REG_SP]; | ||
717 | regs->regs[REG_ARG1] = signal; /* Arg for signal handler */ | 706 | regs->regs[REG_ARG1] = signal; /* Arg for signal handler */ |
718 | regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->info; | 707 | regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->info; |
719 | regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->uc.uc_mcontext; | 708 | regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->uc.uc_mcontext; |
720 | regs->pc = (unsigned long) ka->sa.sa_handler; | 709 | regs->pc = neff_sign_extend((unsigned long)ka->sa.sa_handler); |
721 | regs->pc = (regs->pc & NEFF_SIGN) ? (regs->pc | NEFF_MASK) : regs->pc; | ||
722 | 710 | ||
723 | set_fs(USER_DS); | 711 | set_fs(USER_DS); |
724 | 712 | ||
diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index 7f95f479060f..632aff533285 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c | |||
@@ -119,9 +119,5 @@ void __init time_init(void) | |||
119 | set_normalized_timespec(&wall_to_monotonic, | 119 | set_normalized_timespec(&wall_to_monotonic, |
120 | -xtime.tv_sec, -xtime.tv_nsec); | 120 | -xtime.tv_sec, -xtime.tv_nsec); |
121 | 121 | ||
122 | #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST | ||
123 | local_timer_setup(smp_processor_id()); | ||
124 | #endif | ||
125 | |||
126 | late_time_init = sh_late_time_init; | 122 | late_time_init = sh_late_time_init; |
127 | } | 123 | } |