aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-05 14:15:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-05 14:15:54 -0400
commit45e36c1666aa6c8b0c538abcf984b336184d8c3f (patch)
treec1f1771d6b02ec210238081450b4a063847b3383 /arch/sh/kernel
parent87fc94d54b639d8c39fc4a11db0e142f84096e13 (diff)
parent68b42d1b548be1840aff7122fdebeb804daf0fa3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (23 commits) sh: sh7785lcr: Map whole PCI address space. sh: Fix up DSP context save/restore. sh: Fix up number of on-chip DMA channels on SH7091. sh: update defconfigs. sh: Kill off broken direct-mapped cache mode. sh: Wire up ARCH_HAS_DEFAULT_IDLE for cpuidle. sh: Add a command line option for disabling I/O trapping. sh: Select ARCH_HIBERNATION_POSSIBLE. sh: migor: Fix up CEU use flags. input: migor_ts: add wakeup support rtc: rtc-sh: use set_irq_wake() input: sh_keysc: use enable/disable_irq_wake() sh: intc: set_irq_wake() support sh: intc: install enable, disable and shutdown callbacks clocksource: sh_cmt: use remove_irq() and remove clockevent workaround sh: ap325 and Migo-R use new sh_mobile_ceu_info flags sh: Fix up -Wformat-security whining. sh: ap325rxa: Add ov772x support, again. sh: Sanitize asm/mmu.h for assembly use. sh: Tidy up sh7786 pinmux table. ...
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/cpu/sh3/entry.S85
-rw-r--r--arch/sh/kernel/cpu/sh4/probe.c5
-rw-r--r--arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c185
-rw-r--r--arch/sh/kernel/idle.c2
-rw-r--r--arch/sh/kernel/io_trapped.c13
-rw-r--r--arch/sh/kernel/process_32.c14
-rw-r--r--arch/sh/kernel/ptrace_32.c6
-rw-r--r--arch/sh/kernel/setup.c5
-rw-r--r--arch/sh/kernel/traps_32.c2
9 files changed, 80 insertions, 237 deletions
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S
index 55da0ff9848d..3cb531f233f2 100644
--- a/arch/sh/kernel/cpu/sh3/entry.S
+++ b/arch/sh/kernel/cpu/sh3/entry.S
@@ -254,40 +254,6 @@ restore_all:
254 254
255 lds k2, pr ! restore pr 255 lds k2, pr ! restore pr
256 ! 256 !
257#ifdef CONFIG_SH_DSP
258 mov.l @r15+, k0 ! DSP mode marker
259 mov.l 5f, k1
260 cmp/eq k0, k1 ! Do we have a DSP stack frame?
261 bf skip_restore
262
263 stc sr, k0 ! Enable CPU DSP mode
264 or k1, k0 ! (within kernel it may be disabled)
265 ldc k0, sr
266 mov r2, k0 ! Backup r2
267
268 ! Restore DSP registers from stack
269 mov r15, r2
270 movs.l @r2+, a1
271 movs.l @r2+, a0g
272 movs.l @r2+, a1g
273 movs.l @r2+, m0
274 movs.l @r2+, m1
275 mov r2, r15
276
277 lds.l @r15+, a0
278 lds.l @r15+, x0
279 lds.l @r15+, x1
280 lds.l @r15+, y0
281 lds.l @r15+, y1
282 lds.l @r15+, dsr
283 ldc.l @r15+, rs
284 ldc.l @r15+, re
285 ldc.l @r15+, mod
286
287 mov k0, r2 ! Restore r2
288skip_restore:
289#endif
290 !
291 ! Calculate new SR value 257 ! Calculate new SR value
292 mov k3, k2 ! original SR value 258 mov k3, k2 ! original SR value
293 mov #0xf0, k1 259 mov #0xf0, k1
@@ -358,7 +324,7 @@ general_exception:
358 add k0, k4 324 add k0, k4
3590: 3250:
360 ! Setup stack and save DSP context (k0 contains original r15 on return) 326 ! Setup stack and save DSP context (k0 contains original r15 on return)
361 bsr prepare_stack_save_dsp 327 bsr prepare_stack
362 nop 328 nop
363 329
364 ! Save registers / Switch to bank 0 330 ! Save registers / Switch to bank 0
@@ -374,15 +340,14 @@ general_exception:
3741: .long EXPEVT 3401: .long EXPEVT
375#endif 341#endif
376 342
377! prepare_stack_save_dsp() 343! prepare_stack()
378! - roll back gRB 344! - roll back gRB
379! - switch to kernel stack 345! - switch to kernel stack
380! - save DSP
381! k0 returns original sp (after roll back) 346! k0 returns original sp (after roll back)
382! k1 trashed 347! k1 trashed
383! k2 trashed 348! k2 trashed
384 349
385prepare_stack_save_dsp: 350prepare_stack:
386#ifdef CONFIG_GUSA 351#ifdef CONFIG_GUSA
387 ! Check for roll back gRB (User and Kernel) 352 ! Check for roll back gRB (User and Kernel)
388 mov r15, k0 353 mov r15, k0
@@ -416,47 +381,9 @@ prepare_stack_save_dsp:
416 mov k1, r15 ! change to kernel stack 381 mov k1, r15 ! change to kernel stack
417 ! 382 !
4181: 3831:
419#ifdef CONFIG_SH_DSP
420 ! Save DSP context if needed
421 stc sr, k1
422 mov #0x10, k2
423 shll8 k2 ! DSP=1 (0x00001000)
424 tst k2, k1 ! Check if in DSP mode (passed in k2)
425 bt/s skip_save
426 mov #0, k1 ! Set marker for no stack frame
427
428 mov k2, k1 ! Save has-frame marker
429
430 ! Save DSP registers on stack
431 stc.l mod, @-r15
432 stc.l re, @-r15
433 stc.l rs, @-r15
434 sts.l dsr, @-r15
435 sts.l y1, @-r15
436 sts.l y0, @-r15
437 sts.l x1, @-r15
438 sts.l x0, @-r15
439 sts.l a0, @-r15
440
441 ! GAS is broken, does not generate correct "movs.l Ds,@-As" instr.
442
443 ! FIXME: Make sure that this is still the case with newer toolchains,
444 ! as we're not at all interested in supporting ancient toolchains at
445 ! this point. -- PFM.
446
447 mov r15, k2
448 .word 0xf653 ! movs.l a1, @-r2
449 .word 0xf6f3 ! movs.l a0g, @-r2
450 .word 0xf6d3 ! movs.l a1g, @-r2
451 .word 0xf6c3 ! movs.l m0, @-r2
452 .word 0xf6e3 ! movs.l m1, @-r2
453 mov k2, r15
454
455skip_save:
456 mov.l k1, @-r15 ! Push DSP mode marker onto stack
457#endif
458 rts 384 rts
459 nop 385 nop
386
460! 387!
461! 0x400: Instruction and Data TLB miss exception vector 388! 0x400: Instruction and Data TLB miss exception vector
462! 389!
@@ -468,7 +395,7 @@ handle_exception:
468 mova exception_data, k0 395 mova exception_data, k0
469 396
470 ! Setup stack and save DSP context (k0 contains original r15 on return) 397 ! Setup stack and save DSP context (k0 contains original r15 on return)
471 bsr prepare_stack_save_dsp 398 bsr prepare_stack
472 PREF(k0) 399 PREF(k0)
473 400
474 ! Save registers / Switch to bank 0 401 ! Save registers / Switch to bank 0
@@ -572,7 +499,7 @@ ENTRY(handle_interrupt)
572 mova exception_data, k0 499 mova exception_data, k0
573 500
574 ! Setup stack and save DSP context (k0 contains original r15 on return) 501 ! Setup stack and save DSP context (k0 contains original r15 on return)
575 bsr prepare_stack_save_dsp 502 bsr prepare_stack
576 PREF(k0) 503 PREF(k0)
577 504
578 ! Save registers / Switch to bank 0 505 ! Save registers / Switch to bank 0
diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c
index 3d3a3c4425a9..91e3677ae09d 100644
--- a/arch/sh/kernel/cpu/sh4/probe.c
+++ b/arch/sh/kernel/cpu/sh4/probe.c
@@ -199,11 +199,6 @@ int __init detect_cpu_and_cache_system(void)
199 break; 199 break;
200 } 200 }
201 201
202#ifdef CONFIG_SH_DIRECT_MAPPED
203 boot_cpu_data.icache.ways = 1;
204 boot_cpu_data.dcache.ways = 1;
205#endif
206
207#ifdef CONFIG_CPU_HAS_PTEA 202#ifdef CONFIG_CPU_HAS_PTEA
208 boot_cpu_data.flags |= CPU_HAS_PTEA; 203 boot_cpu_data.flags |= CPU_HAS_PTEA;
209#endif 204#endif
diff --git a/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c b/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c
index 373b3447bfdf..4229e0724c89 100644
--- a/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c
@@ -149,150 +149,44 @@ enum {
149 PINMUX_FUNCTION_END, 149 PINMUX_FUNCTION_END,
150 150
151 PINMUX_MARK_BEGIN, 151 PINMUX_MARK_BEGIN,
152 CDE_MARK, 152 DCLKIN_MARK, DCLKOUT_MARK, ODDF_MARK,
153 ETH_MAGIC_MARK, 153 VSYNC_MARK, HSYNC_MARK, CDE_MARK, DISP_MARK,
154 DISP_MARK, 154 DR0_MARK, DR1_MARK, DR2_MARK, DR3_MARK, DR4_MARK, DR5_MARK,
155 ETH_LINK_MARK, 155 DG0_MARK, DG1_MARK, DG2_MARK, DG3_MARK, DG4_MARK, DG5_MARK,
156 DR5_MARK, 156 DB0_MARK, DB1_MARK, DB2_MARK, DB3_MARK, DB4_MARK, DB5_MARK,
157 ETH_TX_ER_MARK, 157 ETH_MAGIC_MARK, ETH_LINK_MARK, ETH_TX_ER_MARK, ETH_TX_EN_MARK,
158 DR4_MARK, 158 ETH_MDIO_MARK, ETH_RX_CLK_MARK, ETH_MDC_MARK, ETH_COL_MARK,
159 ETH_TX_EN_MARK, 159 ETH_TX_CLK_MARK, ETH_CRS_MARK, ETH_RX_DV_MARK, ETH_RX_ER_MARK,
160 DR3_MARK, 160 ETH_TXD3_MARK, ETH_TXD2_MARK, ETH_TXD1_MARK, ETH_TXD0_MARK,
161 ETH_TXD3_MARK, 161 ETH_RXD3_MARK, ETH_RXD2_MARK, ETH_RXD1_MARK, ETH_RXD0_MARK,
162 DR2_MARK, 162 HSPI_CLK_MARK, HSPI_CS_MARK, HSPI_RX_MARK, HSPI_TX_MARK,
163 ETH_TXD2_MARK, 163 SCIF0_CTS_MARK, SCIF0_RTS_MARK,
164 DR1_MARK, 164 SCIF0_SCK_MARK, SCIF0_RXD_MARK, SCIF0_TXD_MARK,
165 ETH_TXD1_MARK, 165 SCIF1_SCK_MARK, SCIF1_RXD_MARK, SCIF1_TXD_MARK,
166 DR0_MARK, 166 SCIF3_SCK_MARK, SCIF3_RXD_MARK, SCIF3_TXD_MARK,
167 ETH_TXD0_MARK, 167 SCIF4_SCK_MARK, SCIF4_RXD_MARK, SCIF4_TXD_MARK,
168 168 SCIF5_SCK_MARK, SCIF5_RXD_MARK, SCIF5_TXD_MARK,
169 VSYNC_MARK, 169 BREQ_MARK, IOIS16_MARK, CE2B_MARK, CE2A_MARK, BACK_MARK,
170 HSPI_CLK_MARK, 170 FALE_MARK, FRB_MARK, FSTATUS_MARK,
171 ODDF_MARK, 171 FSE_MARK, FCLE_MARK,
172 HSPI_CS_MARK, 172 DACK0_MARK, DACK1_MARK, DACK2_MARK, DACK3_MARK,
173 DG5_MARK, 173 DREQ0_MARK, DREQ1_MARK, DREQ2_MARK, DREQ3_MARK,
174 ETH_MDIO_MARK, 174 DRAK0_MARK, DRAK1_MARK, DRAK2_MARK, DRAK3_MARK,
175 DG4_MARK, 175 USB_OVC1_MARK, USB_OVC0_MARK,
176 ETH_RX_CLK_MARK, 176 USB_PENC1_MARK, USB_PENC0_MARK,
177 DG3_MARK,
178 ETH_MDC_MARK,
179 DG2_MARK,
180 ETH_COL_MARK,
181 DG1_MARK,
182 ETH_TX_CLK_MARK,
183 DG0_MARK,
184 ETH_CRS_MARK,
185
186 DCLKIN_MARK,
187 HSPI_RX_MARK,
188 HSYNC_MARK,
189 HSPI_TX_MARK,
190 DB5_MARK,
191 ETH_RXD3_MARK,
192 DB4_MARK,
193 ETH_RXD2_MARK,
194 DB3_MARK,
195 ETH_RXD1_MARK,
196 DB2_MARK,
197 ETH_RXD0_MARK,
198 DB1_MARK,
199 ETH_RX_DV_MARK,
200 DB0_MARK,
201 ETH_RX_ER_MARK,
202
203 DCLKOUT_MARK,
204 SCIF1_SLK_MARK,
205 SCIF1_RXD_MARK,
206 SCIF1_TXD_MARK,
207 DACK1_MARK,
208 BACK_MARK,
209 FALE_MARK,
210 DACK0_MARK,
211 FCLE_MARK,
212 DREQ1_MARK,
213 BREQ_MARK,
214 USB_OVC1_MARK,
215 DREQ0_MARK,
216 USB_OVC0_MARK,
217
218 USB_PENC1_MARK,
219 USB_PENC0_MARK,
220
221 HAC1_SDOUT_MARK,
222 SSI1_SDATA_MARK,
223 SDIF1CMD_MARK,
224 HAC1_SDIN_MARK,
225 SSI1_SCK_MARK,
226 SDIF1CD_MARK,
227 HAC1_SYNC_MARK,
228 SSI1_WS_MARK,
229 SDIF1WP_MARK,
230 HAC1_BITCLK_MARK,
231 SSI1_CLK_MARK,
232 SDIF1CLK_MARK,
233 HAC0_SDOUT_MARK,
234 SSI0_SDATA_MARK,
235 SDIF1D3_MARK,
236 HAC0_SDIN_MARK,
237 SSI0_SCK_MARK,
238 SDIF1D2_MARK,
239 HAC0_SYNC_MARK,
240 SSI0_WS_MARK,
241 SDIF1D1_MARK,
242 HAC0_BITCLK_MARK,
243 SSI0_CLK_MARK,
244 SDIF1D0_MARK,
245
246 SCIF3_SCK_MARK,
247 SSI2_SDATA_MARK,
248 SCIF3_RXD_MARK,
249 TCLK_MARK,
250 SSI2_SCK_MARK,
251 SCIF3_TXD_MARK,
252 HAC_RES_MARK, 177 HAC_RES_MARK,
253 SSI2_WS_MARK, 178 HAC1_SDOUT_MARK, HAC1_SDIN_MARK, HAC1_SYNC_MARK, HAC1_BITCLK_MARK,
254 179 HAC0_SDOUT_MARK, HAC0_SDIN_MARK, HAC0_SYNC_MARK, HAC0_BITCLK_MARK,
255 DACK3_MARK, 180 SSI0_SDATA_MARK, SSI0_SCK_MARK, SSI0_WS_MARK, SSI0_CLK_MARK,
256 SDIF0CMD_MARK, 181 SSI1_SDATA_MARK, SSI1_SCK_MARK, SSI1_WS_MARK, SSI1_CLK_MARK,
257 DACK2_MARK, 182 SSI2_SDATA_MARK, SSI2_SCK_MARK, SSI2_WS_MARK,
258 SDIF0CD_MARK, 183 SSI3_SDATA_MARK, SSI3_SCK_MARK, SSI3_WS_MARK,
259 DREQ3_MARK, 184 SDIF1CMD_MARK, SDIF1CD_MARK, SDIF1WP_MARK, SDIF1CLK_MARK,
260 SDIF0WP_MARK, 185 SDIF1D3_MARK, SDIF1D2_MARK, SDIF1D1_MARK, SDIF1D0_MARK,
261 SCIF0_CTS_MARK, 186 SDIF0CMD_MARK, SDIF0CD_MARK, SDIF0WP_MARK, SDIF0CLK_MARK,
262 DREQ2_MARK, 187 SDIF0D3_MARK, SDIF0D2_MARK, SDIF0D1_MARK, SDIF0D0_MARK,
263 SDIF0CLK_MARK, 188 TCLK_MARK,
264 SCIF0_RTS_MARK, 189 IRL7_MARK, IRL6_MARK, IRL5_MARK, IRL4_MARK,
265 IRL7_MARK,
266 SDIF0D3_MARK,
267 SCIF0_SCK_MARK,
268 IRL6_MARK,
269 SDIF0D2_MARK,
270 SCIF0_RXD_MARK,
271 IRL5_MARK,
272 SDIF0D1_MARK,
273 SCIF0_TXD_MARK,
274 IRL4_MARK,
275 SDIF0D0_MARK,
276
277 SCIF5_SCK_MARK,
278 FRB_MARK,
279 SCIF5_RXD_MARK,
280 IOIS16_MARK,
281 SCIF5_TXD_MARK,
282 CE2B_MARK,
283 DRAK3_MARK,
284 CE2A_MARK,
285 SCIF4_SCK_MARK,
286 DRAK2_MARK,
287 SSI3_WS_MARK,
288 SCIF4_RXD_MARK,
289 DRAK1_MARK,
290 SSI3_SDATA_MARK,
291 FSTATUS_MARK,
292 SCIF4_TXD_MARK,
293 DRAK0_MARK,
294 SSI3_SCK_MARK,
295 FSE_MARK,
296 PINMUX_MARK_END, 190 PINMUX_MARK_END,
297}; 191};
298 192
@@ -377,7 +271,6 @@ static pinmux_enum_t pinmux_data[] = {
377 PINMUX_DATA(PJ1_DATA, PJ1_IN, PJ1_OUT, PJ1_IN_PU), 271 PINMUX_DATA(PJ1_DATA, PJ1_IN, PJ1_OUT, PJ1_IN_PU),
378 272
379 /* PA FN */ 273 /* PA FN */
380 PINMUX_MARK_BEGIN,
381 PINMUX_DATA(CDE_MARK, P1MSEL2_0, PA7_FN), 274 PINMUX_DATA(CDE_MARK, P1MSEL2_0, PA7_FN),
382 PINMUX_DATA(DISP_MARK, P1MSEL2_0, PA6_FN), 275 PINMUX_DATA(DISP_MARK, P1MSEL2_0, PA6_FN),
383 PINMUX_DATA(DR5_MARK, P1MSEL2_0, PA5_FN), 276 PINMUX_DATA(DR5_MARK, P1MSEL2_0, PA5_FN),
@@ -434,7 +327,7 @@ static pinmux_enum_t pinmux_data[] = {
434 327
435 /* PD FN */ 328 /* PD FN */
436 PINMUX_DATA(DCLKOUT_MARK, PD7_FN), 329 PINMUX_DATA(DCLKOUT_MARK, PD7_FN),
437 PINMUX_DATA(SCIF1_SLK_MARK, PD6_FN), 330 PINMUX_DATA(SCIF1_SCK_MARK, PD6_FN),
438 PINMUX_DATA(SCIF1_RXD_MARK, PD5_FN), 331 PINMUX_DATA(SCIF1_RXD_MARK, PD5_FN),
439 PINMUX_DATA(SCIF1_TXD_MARK, PD4_FN), 332 PINMUX_DATA(SCIF1_TXD_MARK, PD4_FN),
440 PINMUX_DATA(DACK1_MARK, P1MSEL13_1, P1MSEL12_0, PD3_FN), 333 PINMUX_DATA(DACK1_MARK, P1MSEL13_1, P1MSEL12_0, PD3_FN),
@@ -662,7 +555,7 @@ static struct pinmux_gpio pinmux_gpios[] = {
662 PINMUX_GPIO(GPIO_FN_DB0, DB0_MARK), 555 PINMUX_GPIO(GPIO_FN_DB0, DB0_MARK),
663 PINMUX_GPIO(GPIO_FN_ETH_RX_ER, ETH_RX_ER_MARK), 556 PINMUX_GPIO(GPIO_FN_ETH_RX_ER, ETH_RX_ER_MARK),
664 PINMUX_GPIO(GPIO_FN_DCLKOUT, DCLKOUT_MARK), 557 PINMUX_GPIO(GPIO_FN_DCLKOUT, DCLKOUT_MARK),
665 PINMUX_GPIO(GPIO_FN_SCIF1_SLK, SCIF1_SLK_MARK), 558 PINMUX_GPIO(GPIO_FN_SCIF1_SCK, SCIF1_SCK_MARK),
666 PINMUX_GPIO(GPIO_FN_SCIF1_RXD, SCIF1_RXD_MARK), 559 PINMUX_GPIO(GPIO_FN_SCIF1_RXD, SCIF1_RXD_MARK),
667 PINMUX_GPIO(GPIO_FN_SCIF1_TXD, SCIF1_TXD_MARK), 560 PINMUX_GPIO(GPIO_FN_SCIF1_TXD, SCIF1_TXD_MARK),
668 PINMUX_GPIO(GPIO_FN_DACK1, DACK1_MARK), 561 PINMUX_GPIO(GPIO_FN_DACK1, DACK1_MARK),
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
index fe59ccfc1152..f35ed0348850 100644
--- a/arch/sh/kernel/idle.c
+++ b/arch/sh/kernel/idle.c
@@ -38,7 +38,7 @@ static int __init hlt_setup(char *__unused)
38} 38}
39__setup("hlt", hlt_setup); 39__setup("hlt", hlt_setup);
40 40
41static void default_idle(void) 41void default_idle(void)
42{ 42{
43 if (!hlt_counter) { 43 if (!hlt_counter) {
44 clear_thread_flag(TIF_POLLING_NRFLAG); 44 clear_thread_flag(TIF_POLLING_NRFLAG);
diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c
index 39cd7f3aec7b..c22853b059ef 100644
--- a/arch/sh/kernel/io_trapped.c
+++ b/arch/sh/kernel/io_trapped.c
@@ -14,6 +14,7 @@
14#include <linux/bitops.h> 14#include <linux/bitops.h>
15#include <linux/vmalloc.h> 15#include <linux/vmalloc.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/init.h>
17#include <asm/system.h> 18#include <asm/system.h>
18#include <asm/mmu_context.h> 19#include <asm/mmu_context.h>
19#include <asm/uaccess.h> 20#include <asm/uaccess.h>
@@ -32,6 +33,15 @@ EXPORT_SYMBOL_GPL(trapped_mem);
32#endif 33#endif
33static DEFINE_SPINLOCK(trapped_lock); 34static DEFINE_SPINLOCK(trapped_lock);
34 35
36static int trapped_io_disable __read_mostly;
37
38static int __init trapped_io_setup(char *__unused)
39{
40 trapped_io_disable = 1;
41 return 1;
42}
43__setup("noiotrap", trapped_io_setup);
44
35int register_trapped_io(struct trapped_io *tiop) 45int register_trapped_io(struct trapped_io *tiop)
36{ 46{
37 struct resource *res; 47 struct resource *res;
@@ -39,6 +49,9 @@ int register_trapped_io(struct trapped_io *tiop)
39 struct page *pages[TRAPPED_PAGES_MAX]; 49 struct page *pages[TRAPPED_PAGES_MAX];
40 int k, n; 50 int k, n;
41 51
52 if (unlikely(trapped_io_disable))
53 return 0;
54
42 /* structure must be page aligned */ 55 /* structure must be page aligned */
43 if ((unsigned long)tiop & (PAGE_SIZE - 1)) 56 if ((unsigned long)tiop & (PAGE_SIZE - 1))
44 goto bad; 57 goto bad;
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c
index 694bc15f84fd..6d94725d22f2 100644
--- a/arch/sh/kernel/process_32.c
+++ b/arch/sh/kernel/process_32.c
@@ -176,14 +176,26 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
176{ 176{
177 struct thread_info *ti = task_thread_info(p); 177 struct thread_info *ti = task_thread_info(p);
178 struct pt_regs *childregs; 178 struct pt_regs *childregs;
179#if defined(CONFIG_SH_FPU) 179#if defined(CONFIG_SH_FPU) || defined(CONFIG_SH_DSP)
180 struct task_struct *tsk = current; 180 struct task_struct *tsk = current;
181#endif
181 182
183#if defined(CONFIG_SH_FPU)
182 unlazy_fpu(tsk, regs); 184 unlazy_fpu(tsk, regs);
183 p->thread.fpu = tsk->thread.fpu; 185 p->thread.fpu = tsk->thread.fpu;
184 copy_to_stopped_child_used_math(p); 186 copy_to_stopped_child_used_math(p);
185#endif 187#endif
186 188
189#if defined(CONFIG_SH_DSP)
190 if (is_dsp_enabled(tsk)) {
191 /* We can use the __save_dsp or just copy the struct:
192 * __save_dsp(p);
193 * p->thread.dsp_status.status |= SR_DSP
194 */
195 p->thread.dsp_status = tsk->thread.dsp_status;
196 }
197#endif
198
187 childregs = task_pt_regs(p); 199 childregs = task_pt_regs(p);
188 *childregs = *regs; 200 *childregs = *regs;
189 201
diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c
index 29ca09d24ef8..f7b22dd83b0c 100644
--- a/arch/sh/kernel/ptrace_32.c
+++ b/arch/sh/kernel/ptrace_32.c
@@ -200,7 +200,8 @@ static int dspregs_get(struct task_struct *target,
200 unsigned int pos, unsigned int count, 200 unsigned int pos, unsigned int count,
201 void *kbuf, void __user *ubuf) 201 void *kbuf, void __user *ubuf)
202{ 202{
203 const struct pt_dspregs *regs = task_pt_dspregs(target); 203 const struct pt_dspregs *regs =
204 (struct pt_dspregs *)&target->thread.dsp_status.dsp_regs;
204 int ret; 205 int ret;
205 206
206 ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, regs, 207 ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, regs,
@@ -217,7 +218,8 @@ static int dspregs_set(struct task_struct *target,
217 unsigned int pos, unsigned int count, 218 unsigned int pos, unsigned int count,
218 const void *kbuf, const void __user *ubuf) 219 const void *kbuf, const void __user *ubuf)
219{ 220{
220 struct pt_dspregs *regs = task_pt_dspregs(target); 221 struct pt_dspregs *regs =
222 (struct pt_dspregs *)&target->thread.dsp_status.dsp_regs;
221 int ret; 223 int ret;
222 224
223 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, regs, 225 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, regs,
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 24c60251f680..04a6004fccc4 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -103,12 +103,11 @@ static int __init early_parse_mem(char *p)
103 size = memparse(p, &p); 103 size = memparse(p, &p);
104 104
105 if (size > __MEMORY_SIZE) { 105 if (size > __MEMORY_SIZE) {
106 static char msg[] __initdata = KERN_ERR 106 printk(KERN_ERR
107 "Using mem= to increase the size of kernel memory " 107 "Using mem= to increase the size of kernel memory "
108 "is not allowed.\n" 108 "is not allowed.\n"
109 " Recompile the kernel with the correct value for " 109 " Recompile the kernel with the correct value for "
110 "CONFIG_MEMORY_SIZE.\n"; 110 "CONFIG_MEMORY_SIZE.\n");
111 printk(msg);
112 return 0; 111 return 0;
113 } 112 }
114 113
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c
index 60dcf87ed019..30ca9c51e52d 100644
--- a/arch/sh/kernel/traps_32.c
+++ b/arch/sh/kernel/traps_32.c
@@ -664,6 +664,8 @@ asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5,
664 if (is_dsp_inst(regs)) { 664 if (is_dsp_inst(regs)) {
665 /* Enable DSP mode, and restart instruction. */ 665 /* Enable DSP mode, and restart instruction. */
666 regs->sr |= SR_DSP; 666 regs->sr |= SR_DSP;
667 /* Save DSP mode */
668 tsk->thread.dsp_status.status |= SR_DSP;
667 return; 669 return;
668 } 670 }
669#endif 671#endif