aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/configs/at91rm9200dk_defconfig2
-rw-r--r--arch/arm/configs/at91rm9200ek_defconfig2
-rw-r--r--arch/arm/configs/csb337_defconfig2
-rw-r--r--arch/arm/configs/csb637_defconfig2
-rw-r--r--arch/arm/configs/kafa_defconfig2
-rw-r--r--arch/arm/configs/onearm_defconfig2
-rw-r--r--arch/arm/mach-ixp2000/ixdp2400.c4
-rw-r--r--arch/arm/mach-lh7a40x/Kconfig4
-rw-r--r--arch/sh/boards/hp6xx/hp6xx_apm.c2
-rw-r--r--arch/sh/boards/hp6xx/pm.c2
-rw-r--r--arch/sh/boards/hp6xx/setup.c2
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/io.c2
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/irq.c2
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/setup.c7
-rw-r--r--arch/sh/boards/renesas/r7780rp/io.c2
-rw-r--r--arch/sh/boards/renesas/r7780rp/irq.c9
-rw-r--r--arch/sh/boards/renesas/r7780rp/setup.c2
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/io.c4
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/irq.c6
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/led.c15
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/setup.c2
-rw-r--r--arch/sh/boards/shmin/setup.c2
-rw-r--r--arch/sh/cchips/voyagergx/irq.c22
-rw-r--r--arch/sh/drivers/pci/ops-r7780rp.c2
-rw-r--r--arch/sh/drivers/pci/ops-rts7751r2d.c24
-rw-r--r--arch/sh/kernel/cpu/irq/intc2.c165
-rw-r--r--arch/sh/kernel/cpu/irq/ipr.c5
-rw-r--r--arch/sh/kernel/cpu/sh3/ex.S9
-rw-r--r--arch/sh/kernel/cpu/sh4/ex.S9
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7760.c63
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7780.c27
-rw-r--r--arch/sh/kernel/irq.c2
-rw-r--r--arch/sh/kernel/process.c12
-rw-r--r--arch/sh/kernel/traps.c167
-rw-r--r--arch/um/drivers/mconsole_kern.c23
-rw-r--r--arch/um/drivers/mconsole_user.c1
-rw-r--r--arch/um/include/mconsole.h1
37 files changed, 297 insertions, 314 deletions
diff --git a/arch/arm/configs/at91rm9200dk_defconfig b/arch/arm/configs/at91rm9200dk_defconfig
index c82e4667f45e..b43041476e02 100644
--- a/arch/arm/configs/at91rm9200dk_defconfig
+++ b/arch/arm/configs/at91rm9200dk_defconfig
@@ -577,7 +577,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
577# Watchdog Device Drivers 577# Watchdog Device Drivers
578# 578#
579# CONFIG_SOFT_WATCHDOG is not set 579# CONFIG_SOFT_WATCHDOG is not set
580CONFIG_AT91_WATCHDOG=y 580CONFIG_AT91RM9200_WATCHDOG=y
581 581
582# 582#
583# USB-based Watchdog Cards 583# USB-based Watchdog Cards
diff --git a/arch/arm/configs/at91rm9200ek_defconfig b/arch/arm/configs/at91rm9200ek_defconfig
index b983fc59aa42..d96fc8386e2f 100644
--- a/arch/arm/configs/at91rm9200ek_defconfig
+++ b/arch/arm/configs/at91rm9200ek_defconfig
@@ -558,7 +558,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
558# Watchdog Device Drivers 558# Watchdog Device Drivers
559# 559#
560# CONFIG_SOFT_WATCHDOG is not set 560# CONFIG_SOFT_WATCHDOG is not set
561CONFIG_AT91_WATCHDOG=y 561CONFIG_AT91RM9200_WATCHDOG=y
562 562
563# 563#
564# USB-based Watchdog Cards 564# USB-based Watchdog Cards
diff --git a/arch/arm/configs/csb337_defconfig b/arch/arm/configs/csb337_defconfig
index a2d6fd398f16..20e68250d835 100644
--- a/arch/arm/configs/csb337_defconfig
+++ b/arch/arm/configs/csb337_defconfig
@@ -615,7 +615,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
615# Watchdog Device Drivers 615# Watchdog Device Drivers
616# 616#
617# CONFIG_SOFT_WATCHDOG is not set 617# CONFIG_SOFT_WATCHDOG is not set
618CONFIG_AT91_WATCHDOG=y 618CONFIG_AT91RM9200_WATCHDOG=y
619 619
620# 620#
621# USB-based Watchdog Cards 621# USB-based Watchdog Cards
diff --git a/arch/arm/configs/csb637_defconfig b/arch/arm/configs/csb637_defconfig
index 2a1ac6c60abc..df8595ac031f 100644
--- a/arch/arm/configs/csb637_defconfig
+++ b/arch/arm/configs/csb637_defconfig
@@ -615,7 +615,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
615# Watchdog Device Drivers 615# Watchdog Device Drivers
616# 616#
617# CONFIG_SOFT_WATCHDOG is not set 617# CONFIG_SOFT_WATCHDOG is not set
618CONFIG_AT91_WATCHDOG=y 618CONFIG_AT91RM9200_WATCHDOG=y
619 619
620# 620#
621# USB-based Watchdog Cards 621# USB-based Watchdog Cards
diff --git a/arch/arm/configs/kafa_defconfig b/arch/arm/configs/kafa_defconfig
index 54fcd75779da..a4cdafc1548a 100644
--- a/arch/arm/configs/kafa_defconfig
+++ b/arch/arm/configs/kafa_defconfig
@@ -560,7 +560,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
560# Watchdog Device Drivers 560# Watchdog Device Drivers
561# 561#
562# CONFIG_SOFT_WATCHDOG is not set 562# CONFIG_SOFT_WATCHDOG is not set
563CONFIG_AT91_WATCHDOG=y 563CONFIG_AT91RM9200_WATCHDOG=y
564# CONFIG_NVRAM is not set 564# CONFIG_NVRAM is not set
565# CONFIG_DTLK is not set 565# CONFIG_DTLK is not set
566# CONFIG_R3964 is not set 566# CONFIG_R3964 is not set
diff --git a/arch/arm/configs/onearm_defconfig b/arch/arm/configs/onearm_defconfig
index cb1d94f9049e..9b9f2155af35 100644
--- a/arch/arm/configs/onearm_defconfig
+++ b/arch/arm/configs/onearm_defconfig
@@ -607,7 +607,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
607# Watchdog Device Drivers 607# Watchdog Device Drivers
608# 608#
609# CONFIG_SOFT_WATCHDOG is not set 609# CONFIG_SOFT_WATCHDOG is not set
610CONFIG_AT91_WATCHDOG=y 610CONFIG_AT91RM9200_WATCHDOG=y
611 611
612# 612#
613# USB-based Watchdog Cards 613# USB-based Watchdog Cards
diff --git a/arch/arm/mach-ixp2000/ixdp2400.c b/arch/arm/mach-ixp2000/ixdp2400.c
index 9ee63834e603..0fdd03ab36e6 100644
--- a/arch/arm/mach-ixp2000/ixdp2400.c
+++ b/arch/arm/mach-ixp2000/ixdp2400.c
@@ -135,11 +135,11 @@ static void ixdp2400_pci_postinit(void)
135 if (ixdp2x00_master_npu()) { 135 if (ixdp2x00_master_npu()) {
136 dev = pci_get_bus_and_slot(1, IXDP2400_SLAVE_ENET_DEVFN); 136 dev = pci_get_bus_and_slot(1, IXDP2400_SLAVE_ENET_DEVFN);
137 pci_remove_bus_device(dev); 137 pci_remove_bus_device(dev);
138 pci_dev_put(dev) 138 pci_dev_put(dev);
139 } else { 139 } else {
140 dev = pci_get_bus_and_slot(1, IXDP2400_MASTER_ENET_DEVFN); 140 dev = pci_get_bus_and_slot(1, IXDP2400_MASTER_ENET_DEVFN);
141 pci_remove_bus_device(dev); 141 pci_remove_bus_device(dev);
142 pci_dev_put(dev) 142 pci_dev_put(dev);
143 143
144 ixdp2x00_slave_pci_postinit(); 144 ixdp2x00_slave_pci_postinit();
145 } 145 }
diff --git a/arch/arm/mach-lh7a40x/Kconfig b/arch/arm/mach-lh7a40x/Kconfig
index 558a34f53b1c..147b01928a9b 100644
--- a/arch/arm/mach-lh7a40x/Kconfig
+++ b/arch/arm/mach-lh7a40x/Kconfig
@@ -14,7 +14,7 @@ config MACH_LPD7A400
14 bool "LPD7A400 Card Engine" 14 bool "LPD7A400 Card Engine"
15 select ARCH_LH7A400 15 select ARCH_LH7A400
16# select IDE_POLL 16# select IDE_POLL
17 select HAS_TOUCHSCREEN_ADS7843_LH7 17# select HAS_TOUCHSCREEN_ADS7843_LH7
18 help 18 help
19 Say Y here if you are using Logic Product Development's 19 Say Y here if you are using Logic Product Development's
20 LPD7A400 CardEngine. For the time being, the LPD7A400 and 20 LPD7A400 CardEngine. For the time being, the LPD7A400 and
@@ -24,7 +24,7 @@ config MACH_LPD7A404
24 bool "LPD7A404 Card Engine" 24 bool "LPD7A404 Card Engine"
25 select ARCH_LH7A404 25 select ARCH_LH7A404
26# select IDE_POLL 26# select IDE_POLL
27 select HAS_TOUCHSCREEN_ADC_LH7 27# select HAS_TOUCHSCREEN_ADC_LH7
28 help 28 help
29 Say Y here if you are using Logic Product Development's 29 Say Y here if you are using Logic Product Development's
30 LPD7A404 CardEngine. For the time being, the LPD7A400 and 30 LPD7A404 CardEngine. For the time being, the LPD7A400 and
diff --git a/arch/sh/boards/hp6xx/hp6xx_apm.c b/arch/sh/boards/hp6xx/hp6xx_apm.c
index 219179114f0f..d146cdaa0b8b 100644
--- a/arch/sh/boards/hp6xx/hp6xx_apm.c
+++ b/arch/sh/boards/hp6xx/hp6xx_apm.c
@@ -14,7 +14,7 @@
14#include <asm/io.h> 14#include <asm/io.h>
15#include <asm/apm.h> 15#include <asm/apm.h>
16#include <asm/adc.h> 16#include <asm/adc.h>
17#include <asm/hp6xx/hp6xx.h> 17#include <asm/hp6xx.h>
18 18
19#define SH7709_PGDR 0xa400012c 19#define SH7709_PGDR 0xa400012c
20 20
diff --git a/arch/sh/boards/hp6xx/pm.c b/arch/sh/boards/hp6xx/pm.c
index 83d327212064..d1947732fb3e 100644
--- a/arch/sh/boards/hp6xx/pm.c
+++ b/arch/sh/boards/hp6xx/pm.c
@@ -12,7 +12,7 @@
12#include <linux/time.h> 12#include <linux/time.h>
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/hd64461.h> 14#include <asm/hd64461.h>
15#include <asm/hp6xx/hp6xx.h> 15#include <asm/hp6xx.h>
16#include <asm/cpu/dac.h> 16#include <asm/cpu/dac.h>
17#include <asm/pm.h> 17#include <asm/pm.h>
18 18
diff --git a/arch/sh/boards/hp6xx/setup.c b/arch/sh/boards/hp6xx/setup.c
index 2d3a5b4faf58..b5a96649ed26 100644
--- a/arch/sh/boards/hp6xx/setup.c
+++ b/arch/sh/boards/hp6xx/setup.c
@@ -13,7 +13,7 @@
13#include <asm/hd64461.h> 13#include <asm/hd64461.h>
14#include <asm/io.h> 14#include <asm/io.h>
15#include <asm/irq.h> 15#include <asm/irq.h>
16#include <asm/hp6xx/hp6xx.h> 16#include <asm/hp6xx.h>
17#include <asm/cpu/dac.h> 17#include <asm/cpu/dac.h>
18 18
19#define SCPCR 0xa4000116 19#define SCPCR 0xa4000116
diff --git a/arch/sh/boards/renesas/hs7751rvoip/io.c b/arch/sh/boards/renesas/hs7751rvoip/io.c
index 51f3f6574210..bb9aa0d62852 100644
--- a/arch/sh/boards/renesas/hs7751rvoip/io.c
+++ b/arch/sh/boards/renesas/hs7751rvoip/io.c
@@ -15,7 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/pci.h> 16#include <linux/pci.h>
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/hs7751rvoip/hs7751rvoip.h> 18#include <asm/hs7751rvoip.h>
19#include <asm/addrspace.h> 19#include <asm/addrspace.h>
20 20
21extern void *area6_io8_base; /* Area 6 8bit I/O Base address */ 21extern void *area6_io8_base; /* Area 6 8bit I/O Base address */
diff --git a/arch/sh/boards/renesas/hs7751rvoip/irq.c b/arch/sh/boards/renesas/hs7751rvoip/irq.c
index c617b188258a..943f93aa6052 100644
--- a/arch/sh/boards/renesas/hs7751rvoip/irq.c
+++ b/arch/sh/boards/renesas/hs7751rvoip/irq.c
@@ -14,7 +14,7 @@
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/irq.h> 16#include <asm/irq.h>
17#include <asm/hs7751rvoip/hs7751rvoip.h> 17#include <asm/hs7751rvoip.h>
18 18
19static int mask_pos[] = {8, 9, 10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6, 7}; 19static int mask_pos[] = {8, 9, 10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6, 7};
20 20
diff --git a/arch/sh/boards/renesas/hs7751rvoip/setup.c b/arch/sh/boards/renesas/hs7751rvoip/setup.c
index 0414c15c3458..1d997ffd7931 100644
--- a/arch/sh/boards/renesas/hs7751rvoip/setup.c
+++ b/arch/sh/boards/renesas/hs7751rvoip/setup.c
@@ -10,15 +10,10 @@
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/irq.h> 11#include <linux/irq.h>
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/vmalloc.h>
14#include <linux/hdreg.h>
15#include <linux/ide.h>
16#include <linux/pm.h> 13#include <linux/pm.h>
14#include <asm/hs7751rvoip.h>
17#include <asm/io.h> 15#include <asm/io.h>
18#include <asm/hs7751rvoip/hs7751rvoip.h>
19#include <asm/machvec.h> 16#include <asm/machvec.h>
20#include <asm/rtc.h>
21#include <asm/irq.h>
22 17
23static void __init hs7751rvoip_init_irq(void) 18static void __init hs7751rvoip_init_irq(void)
24{ 19{
diff --git a/arch/sh/boards/renesas/r7780rp/io.c b/arch/sh/boards/renesas/r7780rp/io.c
index db92d6e6ae99..311ccccba718 100644
--- a/arch/sh/boards/renesas/r7780rp/io.c
+++ b/arch/sh/boards/renesas/r7780rp/io.c
@@ -11,7 +11,7 @@
11#include <linux/pci.h> 11#include <linux/pci.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/types.h> 13#include <linux/types.h>
14#include <asm/r7780rp/r7780rp.h> 14#include <asm/r7780rp.h>
15#include <asm/addrspace.h> 15#include <asm/addrspace.h>
16#include <asm/io.h> 16#include <asm/io.h>
17 17
diff --git a/arch/sh/boards/renesas/r7780rp/irq.c b/arch/sh/boards/renesas/r7780rp/irq.c
index b544772cbc72..aa15ec5bc69e 100644
--- a/arch/sh/boards/renesas/r7780rp/irq.c
+++ b/arch/sh/boards/renesas/r7780rp/irq.c
@@ -10,7 +10,8 @@
10 */ 10 */
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/irq.h> 12#include <linux/irq.h>
13#include <asm/io.h> 13#include <linux/io.h>
14#include <asm/r7780rp.h>
14 15
15#ifdef CONFIG_SH_R7780MP 16#ifdef CONFIG_SH_R7780MP
16static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0}; 17static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0};
@@ -32,7 +33,7 @@ static void disable_r7780rp_irq(unsigned int irq)
32} 33}
33 34
34static struct irq_chip r7780rp_irq_chip __read_mostly = { 35static struct irq_chip r7780rp_irq_chip __read_mostly = {
35 .name = "r7780rp", 36 .name = "R7780RP",
36 .mask = disable_r7780rp_irq, 37 .mask = disable_r7780rp_irq,
37 .unmask = enable_r7780rp_irq, 38 .unmask = enable_r7780rp_irq,
38 .mask_ack = disable_r7780rp_irq, 39 .mask_ack = disable_r7780rp_irq,
@@ -47,8 +48,8 @@ void __init init_r7780rp_IRQ(void)
47 48
48 for (i = 0; i < 15; i++) { 49 for (i = 0; i < 15; i++) {
49 disable_irq_nosync(i); 50 disable_irq_nosync(i);
50 set_irq_chip_and_handler(i, &r7780rp_irq_chip, 51 set_irq_chip_and_handler_name(i, &r7780rp_irq_chip,
51 handle_level_irq); 52 handle_level_irq, "level");
52 enable_r7780rp_irq(i); 53 enable_r7780rp_irq(i);
53 } 54 }
54} 55}
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c
index b941aa0aa34e..c331caeb694b 100644
--- a/arch/sh/boards/renesas/r7780rp/setup.c
+++ b/arch/sh/boards/renesas/r7780rp/setup.c
@@ -13,7 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <asm/machvec.h> 15#include <asm/machvec.h>
16#include <asm/r7780rp/r7780rp.h> 16#include <asm/r7780rp.h>
17#include <asm/clock.h> 17#include <asm/clock.h>
18#include <asm/io.h> 18#include <asm/io.h>
19 19
diff --git a/arch/sh/boards/renesas/rts7751r2d/io.c b/arch/sh/boards/renesas/rts7751r2d/io.c
index 135aa0b5e62d..f2507a804979 100644
--- a/arch/sh/boards/renesas/rts7751r2d/io.c
+++ b/arch/sh/boards/renesas/rts7751r2d/io.c
@@ -11,8 +11,8 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/pci.h> 13#include <linux/pci.h>
14#include <asm/rts7751r2d/rts7751r2d.h> 14#include <linux/io.h>
15#include <asm/io.h> 15#include <asm/rts7751r2d.h>
16#include <asm/addrspace.h> 16#include <asm/addrspace.h>
17 17
18/* 18/*
diff --git a/arch/sh/boards/renesas/rts7751r2d/irq.c b/arch/sh/boards/renesas/rts7751r2d/irq.c
index c915e7a3693a..cb0eb20d1b43 100644
--- a/arch/sh/boards/renesas/rts7751r2d/irq.c
+++ b/arch/sh/boards/renesas/rts7751r2d/irq.c
@@ -8,12 +8,10 @@
8 * Modified for RTS7751R2D by 8 * Modified for RTS7751R2D by
9 * Atom Create Engineering Co., Ltd. 2002. 9 * Atom Create Engineering Co., Ltd. 2002.
10 */ 10 */
11
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/irq.h> 12#include <linux/irq.h>
14#include <asm/io.h> 13#include <linux/io.h>
15#include <asm/irq.h> 14#include <asm/rts7751r2d.h>
16#include <asm/rts7751r2d/rts7751r2d.h>
17 15
18#if defined(CONFIG_RTS7751R2D_REV11) 16#if defined(CONFIG_RTS7751R2D_REV11)
19static int mask_pos[] = {11, 9, 8, 12, 10, 6, 5, 4, 7, 14, 13, 0, 0, 0, 0}; 17static int mask_pos[] = {11, 9, 8, 12, 10, 6, 5, 4, 7, 14, 13, 0, 0, 0, 0};
diff --git a/arch/sh/boards/renesas/rts7751r2d/led.c b/arch/sh/boards/renesas/rts7751r2d/led.c
index a7ce66c1e4f0..509f548bdce0 100644
--- a/arch/sh/boards/renesas/rts7751r2d/led.c
+++ b/arch/sh/boards/renesas/rts7751r2d/led.c
@@ -8,13 +8,9 @@
8 * 8 *
9 * This file contains Renesas Technology Sales RTS7751R2D specific LED code. 9 * This file contains Renesas Technology Sales RTS7751R2D specific LED code.
10 */ 10 */
11 11#include <linux/io.h>
12#include <asm/io.h>
13#include <asm/rts7751r2d/rts7751r2d.h>
14
15#ifdef CONFIG_HEARTBEAT
16
17#include <linux/sched.h> 12#include <linux/sched.h>
13#include <asm/rts7751r2d.h>
18 14
19/* Cycle the LED's in the clasic Knightriger/Sun pattern */ 15/* Cycle the LED's in the clasic Knightriger/Sun pattern */
20void heartbeat_rts7751r2d(void) 16void heartbeat_rts7751r2d(void)
@@ -46,10 +42,3 @@ void heartbeat_rts7751r2d(void)
46 else 42 else
47 bit--; 43 bit--;
48} 44}
49#endif /* CONFIG_HEARTBEAT */
50
51void rts7751r2d_led(unsigned short value)
52{
53 ctrl_outw(value, PA_OUTPORT);
54}
55
diff --git a/arch/sh/boards/renesas/rts7751r2d/setup.c b/arch/sh/boards/renesas/rts7751r2d/setup.c
index 20597a6e6702..5c042d35ec91 100644
--- a/arch/sh/boards/renesas/rts7751r2d/setup.c
+++ b/arch/sh/boards/renesas/rts7751r2d/setup.c
@@ -12,9 +12,9 @@
12#include <linux/platform_device.h> 12#include <linux/platform_device.h>
13#include <linux/serial_8250.h> 13#include <linux/serial_8250.h>
14#include <linux/pm.h> 14#include <linux/pm.h>
15#include <asm/io.h>
16#include <asm/machvec.h> 15#include <asm/machvec.h>
17#include <asm/mach/rts7751r2d.h> 16#include <asm/mach/rts7751r2d.h>
17#include <asm/io.h>
18#include <asm/voyagergx.h> 18#include <asm/voyagergx.h>
19 19
20extern void heartbeat_rts7751r2d(void); 20extern void heartbeat_rts7751r2d(void);
diff --git a/arch/sh/boards/shmin/setup.c b/arch/sh/boards/shmin/setup.c
index 2f0c19706cf9..a31a1d1e2681 100644
--- a/arch/sh/boards/shmin/setup.c
+++ b/arch/sh/boards/shmin/setup.c
@@ -7,7 +7,7 @@
7 */ 7 */
8#include <linux/init.h> 8#include <linux/init.h>
9#include <asm/machvec.h> 9#include <asm/machvec.h>
10#include <asm/shmin/shmin.h> 10#include <asm/shmin.h>
11#include <asm/clock.h> 11#include <asm/clock.h>
12#include <asm/irq.h> 12#include <asm/irq.h>
13#include <asm/io.h> 13#include <asm/io.h>
diff --git a/arch/sh/cchips/voyagergx/irq.c b/arch/sh/cchips/voyagergx/irq.c
index bf1b28feca06..f7ea700d05ae 100644
--- a/arch/sh/cchips/voyagergx/irq.c
+++ b/arch/sh/cchips/voyagergx/irq.c
@@ -17,29 +17,18 @@
17 17
18 Copyright 2003 (c) Lineo uSolutions,Inc. 18 Copyright 2003 (c) Lineo uSolutions,Inc.
19*/ 19*/
20/* -------------------------------------------------------------------- */
21
22#undef DEBUG
23
24#include <linux/sched.h>
25#include <linux/module.h>
26#include <linux/kernel.h>
27#include <linux/param.h>
28#include <linux/ioport.h>
29#include <linux/interrupt.h> 20#include <linux/interrupt.h>
30#include <linux/init.h> 21#include <linux/init.h>
31#include <linux/irq.h> 22#include <linux/io.h>
32
33#include <asm/io.h>
34#include <asm/irq.h>
35#include <asm/voyagergx.h> 23#include <asm/voyagergx.h>
24#include <asm/rts7751r2d.h>
36 25
37static void disable_voyagergx_irq(unsigned int irq) 26static void disable_voyagergx_irq(unsigned int irq)
38{ 27{
39 unsigned long val; 28 unsigned long val;
40 unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE); 29 unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE);
41 30
42 pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask); 31 pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask);
43 val = inl(VOYAGER_INT_MASK); 32 val = inl(VOYAGER_INT_MASK);
44 val &= ~mask; 33 val &= ~mask;
45 outl(val, VOYAGER_INT_MASK); 34 outl(val, VOYAGER_INT_MASK);
@@ -50,7 +39,7 @@ static void enable_voyagergx_irq(unsigned int irq)
50 unsigned long val; 39 unsigned long val;
51 unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE); 40 unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE);
52 41
53 pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask); 42 pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask);
54 val = inl(VOYAGER_INT_MASK); 43 val = inl(VOYAGER_INT_MASK);
55 val |= mask; 44 val |= mask;
56 outl(val, VOYAGER_INT_MASK); 45 outl(val, VOYAGER_INT_MASK);
@@ -137,7 +126,7 @@ int voyagergx_irq_demux(int irq)
137 } else { 126 } else {
138 printk("Unexpected IRQ irq = %d status = 0x%08lx\n", irq, val); 127 printk("Unexpected IRQ irq = %d status = 0x%08lx\n", irq, val);
139 } 128 }
140 pr_debug("voyagergx_irq_demux %d \n", i); 129 pr_debug("voyagergx_irq_demux %ld\n", i);
141#else 130#else
142 for (bit = 1, i = 0 ; i < VOYAGER_IRQ_NUM ; bit <<= 1, i++) 131 for (bit = 1, i = 0 ; i < VOYAGER_IRQ_NUM ; bit <<= 1, i++)
143 if (val & bit) 132 if (val & bit)
@@ -185,4 +174,3 @@ void __init setup_voyagergx_irq(void)
185 174
186 setup_irq(IRQ_VOYAGER, &irq0); 175 setup_irq(IRQ_VOYAGER, &irq0);
187} 176}
188
diff --git a/arch/sh/drivers/pci/ops-r7780rp.c b/arch/sh/drivers/pci/ops-r7780rp.c
index 6e3ba9c65b40..eeea1577e112 100644
--- a/arch/sh/drivers/pci/ops-r7780rp.c
+++ b/arch/sh/drivers/pci/ops-r7780rp.c
@@ -13,7 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/delay.h> 14#include <linux/delay.h>
15#include <linux/pci.h> 15#include <linux/pci.h>
16#include <asm/r7780rp/r7780rp.h> 16#include <asm/r7780rp.h>
17#include <asm/io.h> 17#include <asm/io.h>
18#include "pci-sh4.h" 18#include "pci-sh4.h"
19 19
diff --git a/arch/sh/drivers/pci/ops-rts7751r2d.c b/arch/sh/drivers/pci/ops-rts7751r2d.c
index b68824c8b81e..4a518d948049 100644
--- a/arch/sh/drivers/pci/ops-rts7751r2d.c
+++ b/arch/sh/drivers/pci/ops-rts7751r2d.c
@@ -10,28 +10,24 @@
10 * 10 *
11 * PCI initialization for the Renesas SH7751R RTS7751R2D board 11 * PCI initialization for the Renesas SH7751R RTS7751R2D board
12 */ 12 */
13
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/delay.h>
18#include <linux/pci.h> 16#include <linux/pci.h>
19#include <linux/module.h> 17#include <linux/io.h>
20#include <asm/rts7751r2d/rts7751r2d.h> 18#include <asm/rts7751r2d.h>
21#include <asm/io.h>
22#include "pci-sh4.h" 19#include "pci-sh4.h"
23 20
21static u8 rts7751r2d_irq_tab[] __initdata = {
22 IRQ_PCISLOT1,
23 IRQ_PCISLOT2,
24 IRQ_PCMCIA,
25 IRQ_PCIETH,
26};
27
24int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) 28int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
25{ 29{
26 switch (slot) { 30 return rts7751r2d_irq_tab[slot];
27 case 0: return IRQ_PCISLOT1; /* PCI Extend slot #1 */
28 case 1: return IRQ_PCISLOT2; /* PCI Extend slot #2 */
29 case 2: return IRQ_PCMCIA; /* PCI Cardbus Bridge */
30 case 3: return IRQ_PCIETH; /* Realtek Ethernet controller */
31 default:
32 printk("PCI: Bad IRQ mapping request for slot %d\n", slot);
33 return -1;
34 }
35} 31}
36 32
37static struct resource sh7751_io_resource = { 33static struct resource sh7751_io_resource = {
diff --git a/arch/sh/kernel/cpu/irq/intc2.c b/arch/sh/kernel/cpu/irq/intc2.c
index d4b2bb7e08c7..74ca576a7ce5 100644
--- a/arch/sh/kernel/cpu/irq/intc2.c
+++ b/arch/sh/kernel/cpu/irq/intc2.c
@@ -11,10 +11,9 @@
11 * Hitachi 7751, the STM ST40 STB1, SH7760, and SH7780. 11 * Hitachi 7751, the STM ST40 STB1, SH7760, and SH7780.
12 */ 12 */
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/io.h>
16#include <asm/system.h> 16#include <asm/system.h>
17#include <asm/io.h>
18 17
19static void disable_intc2_irq(unsigned int irq) 18static void disable_intc2_irq(unsigned int irq)
20{ 19{
@@ -31,7 +30,7 @@ static void enable_intc2_irq(unsigned int irq)
31} 30}
32 31
33static struct irq_chip intc2_irq_chip = { 32static struct irq_chip intc2_irq_chip = {
34 .typename = "intc2", 33 .name = "INTC2",
35 .mask = disable_intc2_irq, 34 .mask = disable_intc2_irq,
36 .unmask = enable_intc2_irq, 35 .unmask = enable_intc2_irq,
37 .mask_ack = disable_intc2_irq, 36 .mask_ack = disable_intc2_irq,
@@ -45,150 +44,36 @@ static struct irq_chip intc2_irq_chip = {
45 * PIO1 which is INTPRI00[19,16] and INTMSK00[13] 44 * PIO1 which is INTPRI00[19,16] and INTMSK00[13]
46 * would be: ^ ^ ^ ^ 45 * would be: ^ ^ ^ ^
47 * | | | | 46 * | | | |
48 * make_intc2_irq(84, 0, 16, 0, 13); 47 * { 84, 0, 16, 0, 13 },
48 *
49 * in the intc2_data table.
49 */ 50 */
50void make_intc2_irq(struct intc2_data *p) 51void make_intc2_irq(struct intc2_data *table, unsigned int nr_irqs)
51{ 52{
52 unsigned int flags; 53 int i;
53 unsigned long ipr;
54
55 disable_irq_nosync(p->irq);
56
57 /* Set the priority level */
58 local_irq_save(flags);
59
60 ipr = ctrl_inl(INTC2_BASE + INTC2_INTPRI_OFFSET + p->ipr_offset);
61 ipr &= ~(0xf << p->ipr_shift);
62 ipr |= p->priority << p->ipr_shift;
63 ctrl_outl(ipr, INTC2_BASE + INTC2_INTPRI_OFFSET + p->ipr_offset);
64
65 local_irq_restore(flags);
66 54
67 set_irq_chip_and_handler(p->irq, &intc2_irq_chip, handle_level_irq); 55 for (i = 0; i < nr_irqs; i++) {
68 set_irq_chip_data(p->irq, p); 56 unsigned long ipr, flags;
57 struct intc2_data *p = table + i;
69 58
70 enable_intc2_irq(p->irq); 59 disable_irq_nosync(p->irq);
71}
72 60
73static struct intc2_data intc2_irq_table[] = { 61 /* Set the priority level */
74#if defined(CONFIG_CPU_SUBTYPE_ST40) 62 local_irq_save(flags);
75 {64, 0, 0, 0, 0, 13}, /* PCI serr */
76 {65, 0, 4, 0, 1, 13}, /* PCI err */
77 {66, 0, 4, 0, 2, 13}, /* PCI ad */
78 {67, 0, 4, 0, 3, 13}, /* PCI pwd down */
79 {72, 0, 8, 0, 5, 13}, /* DMAC INT0 */
80 {73, 0, 8, 0, 6, 13}, /* DMAC INT1 */
81 {74, 0, 8, 0, 7, 13}, /* DMAC INT2 */
82 {75, 0, 8, 0, 8, 13}, /* DMAC INT3 */
83 {76, 0, 8, 0, 9, 13}, /* DMAC INT4 */
84 {78, 0, 8, 0, 11, 13}, /* DMAC ERR */
85 {80, 0, 12, 0, 12, 13}, /* PIO0 */
86 {84, 0, 16, 0, 13, 13}, /* PIO1 */
87 {88, 0, 20, 0, 14, 13}, /* PIO2 */
88 {112, 4, 0, 4, 0, 13}, /* Mailbox */
89 #ifdef CONFIG_CPU_SUBTYPE_ST40GX1
90 {116, 4, 4, 4, 4, 13}, /* SSC0 */
91 {120, 4, 8, 4, 8, 13}, /* IR Blaster */
92 {124, 4, 12, 4, 12, 13}, /* USB host */
93 {128, 4, 16, 4, 16, 13}, /* Video processor BLITTER */
94 {132, 4, 20, 4, 20, 13}, /* UART0 */
95 {134, 4, 20, 4, 22, 13}, /* UART2 */
96 {136, 4, 24, 4, 24, 13}, /* IO_PIO0 */
97 {140, 4, 28, 4, 28, 13}, /* EMPI */
98 {144, 8, 0, 8, 0, 13}, /* MAFE */
99 {148, 8, 4, 8, 4, 13}, /* PWM */
100 {152, 8, 8, 8, 8, 13}, /* SSC1 */
101 {156, 8, 12, 8, 12, 13}, /* IO_PIO1 */
102 {160, 8, 16, 8, 16, 13}, /* USB target */
103 {164, 8, 20, 8, 20, 13}, /* UART1 */
104 {168, 8, 24, 8, 24, 13}, /* Teletext */
105 {172, 8, 28, 8, 28, 13}, /* VideoSync VTG */
106 {173, 8, 28, 8, 29, 13}, /* VideoSync DVP0 */
107 {174, 8, 28, 8, 30, 13}, /* VideoSync DVP1 */
108#endif
109#elif defined(CONFIG_CPU_SUBTYPE_SH7760)
110/*
111 * SH7760 INTC2-Style interrupts, vectors IRQ48-111 INTEVT 0x800-0xFE0
112 */
113 /* INTPRIO0 | INTMSK0 */
114 {48, 0, 28, 0, 31, 3}, /* IRQ 4 */
115 {49, 0, 24, 0, 30, 3}, /* IRQ 3 */
116 {50, 0, 20, 0, 29, 3}, /* IRQ 2 */
117 {51, 0, 16, 0, 28, 3}, /* IRQ 1 */
118 /* 52-55 (INTEVT 0x880-0x8E0) unused/reserved */
119 /* INTPRIO4 | INTMSK0 */
120 {56, 4, 28, 0, 25, 3}, /* HCAN2_CHAN0 */
121 {57, 4, 24, 0, 24, 3}, /* HCAN2_CHAN1 */
122 {58, 4, 20, 0, 23, 3}, /* I2S_CHAN0 */
123 {59, 4, 16, 0, 22, 3}, /* I2S_CHAN1 */
124 {60, 4, 12, 0, 21, 3}, /* AC97_CHAN0 */
125 {61, 4, 8, 0, 20, 3}, /* AC97_CHAN1 */
126 {62, 4, 4, 0, 19, 3}, /* I2C_CHAN0 */
127 {63, 4, 0, 0, 18, 3}, /* I2C_CHAN1 */
128 /* INTPRIO8 | INTMSK0 */
129 {52, 8, 16, 0, 11, 3}, /* SCIF0_ERI_IRQ */
130 {53, 8, 16, 0, 10, 3}, /* SCIF0_RXI_IRQ */
131 {54, 8, 16, 0, 9, 3}, /* SCIF0_BRI_IRQ */
132 {55, 8, 16, 0, 8, 3}, /* SCIF0_TXI_IRQ */
133 {64, 8, 28, 0, 17, 3}, /* USBHI_IRQ */
134 {65, 8, 24, 0, 16, 3}, /* LCDC */
135 /* 66, 67 unused */
136 {68, 8, 20, 0, 14, 13}, /* DMABRGI0_IRQ */
137 {69, 8, 20, 0, 13, 13}, /* DMABRGI1_IRQ */
138 {70, 8, 20, 0, 12, 13}, /* DMABRGI2_IRQ */
139 /* 71 unused */
140 {72, 8, 12, 0, 7, 3}, /* SCIF1_ERI_IRQ */
141 {73, 8, 12, 0, 6, 3}, /* SCIF1_RXI_IRQ */
142 {74, 8, 12, 0, 5, 3}, /* SCIF1_BRI_IRQ */
143 {75, 8, 12, 0, 4, 3}, /* SCIF1_TXI_IRQ */
144 {76, 8, 8, 0, 3, 3}, /* SCIF2_ERI_IRQ */
145 {77, 8, 8, 0, 2, 3}, /* SCIF2_RXI_IRQ */
146 {78, 8, 8, 0, 1, 3}, /* SCIF2_BRI_IRQ */
147 {79, 8, 8, 0, 0, 3}, /* SCIF2_TXI_IRQ */
148 /* | INTMSK4 */
149 {80, 8, 4, 4, 23, 3}, /* SIM_ERI */
150 {81, 8, 4, 4, 22, 3}, /* SIM_RXI */
151 {82, 8, 4, 4, 21, 3}, /* SIM_TXI */
152 {83, 8, 4, 4, 20, 3}, /* SIM_TEI */
153 {84, 8, 0, 4, 19, 3}, /* HSPII */
154 /* INTPRIOC | INTMSK4 */
155 /* 85-87 unused/reserved */
156 {88, 12, 20, 4, 18, 3}, /* MMCI0 */
157 {89, 12, 20, 4, 17, 3}, /* MMCI1 */
158 {90, 12, 20, 4, 16, 3}, /* MMCI2 */
159 {91, 12, 20, 4, 15, 3}, /* MMCI3 */
160 {92, 12, 12, 4, 6, 3}, /* MFI (unsure, bug? in my 7760 manual*/
161 /* 93-107 reserved/undocumented */
162 {108,12, 4, 4, 1, 3}, /* ADC */
163 {109,12, 0, 4, 0, 3}, /* CMTI */
164 /* 110-111 reserved/unused */
165#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
166 { TIMER_IRQ, 0, 24, 0, INTC_TMU0_MSK, 2},
167 { 21, 1, 0, 0, INTC_RTC_MSK, TIMER_PRIORITY },
168 { 22, 1, 1, 0, INTC_RTC_MSK, TIMER_PRIORITY },
169 { 23, 1, 2, 0, INTC_RTC_MSK, TIMER_PRIORITY },
170 { SCIF0_ERI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
171 { SCIF0_RXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
172 { SCIF0_BRI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
173 { SCIF0_TXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
174 63
175 { SCIF1_ERI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY }, 64 ipr = ctrl_inl(INTC2_BASE + INTC2_INTPRI_OFFSET +
176 { SCIF1_RXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY }, 65 p->ipr_offset);
177 { SCIF1_BRI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY }, 66 ipr &= ~(0xf << p->ipr_shift);
178 { SCIF1_TXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY }, 67 ipr |= p->priority << p->ipr_shift;
68 ctrl_outl(ipr, INTC2_BASE + INTC2_INTPRI_OFFSET +
69 p->ipr_offset);
179 70
180 { PCIC0_IRQ, 0x10, 8, 0, INTC_PCIC0_MSK, PCIC0_PRIORITY }, 71 local_irq_restore(flags);
181 { PCIC1_IRQ, 0x10, 0, 0, INTC_PCIC1_MSK, PCIC1_PRIORITY },
182 { PCIC2_IRQ, 0x14, 24, 0, INTC_PCIC2_MSK, PCIC2_PRIORITY },
183 { PCIC3_IRQ, 0x14, 16, 0, INTC_PCIC3_MSK, PCIC3_PRIORITY },
184 { PCIC4_IRQ, 0x14, 8, 0, INTC_PCIC4_MSK, PCIC4_PRIORITY },
185#endif
186};
187 72
188void __init init_IRQ_intc2(void) 73 set_irq_chip_and_handler_name(p->irq, &intc2_irq_chip,
189{ 74 handle_level_irq, "level");
190 int i; 75 set_irq_chip_data(p->irq, p);
191 76
192 for (i = 0; i < ARRAY_SIZE(intc2_irq_table); i++) 77 enable_intc2_irq(p->irq);
193 make_intc2_irq(intc2_irq_table + i); 78 }
194} 79}
diff --git a/arch/sh/kernel/cpu/irq/ipr.c b/arch/sh/kernel/cpu/irq/ipr.c
index 8944abdf6e1c..f7997312ef98 100644
--- a/arch/sh/kernel/cpu/irq/ipr.c
+++ b/arch/sh/kernel/cpu/irq/ipr.c
@@ -44,7 +44,7 @@ static void enable_ipr_irq(unsigned int irq)
44} 44}
45 45
46static struct irq_chip ipr_irq_chip = { 46static struct irq_chip ipr_irq_chip = {
47 .name = "ipr", 47 .name = "IPR",
48 .mask = disable_ipr_irq, 48 .mask = disable_ipr_irq,
49 .unmask = enable_ipr_irq, 49 .unmask = enable_ipr_irq,
50 .mask_ack = disable_ipr_irq, 50 .mask_ack = disable_ipr_irq,
@@ -60,7 +60,8 @@ void make_ipr_irq(unsigned int irq, unsigned int addr, int pos, int priority)
60 ipr_data.shift = pos*4; /* POSition (0-3) x 4 means shift */ 60 ipr_data.shift = pos*4; /* POSition (0-3) x 4 means shift */
61 ipr_data.priority = priority; 61 ipr_data.priority = priority;
62 62
63 set_irq_chip_and_handler(irq, &ipr_irq_chip, handle_level_irq); 63 set_irq_chip_and_handler_name(irq, &ipr_irq_chip,
64 handle_level_irq, "level");
64 set_irq_chip_data(irq, &ipr_data); 65 set_irq_chip_data(irq, &ipr_data);
65 66
66 enable_ipr_irq(irq); 67 enable_ipr_irq(irq);
diff --git a/arch/sh/kernel/cpu/sh3/ex.S b/arch/sh/kernel/cpu/sh3/ex.S
index 6be46f0686b7..ba3082d640b5 100644
--- a/arch/sh/kernel/cpu/sh3/ex.S
+++ b/arch/sh/kernel/cpu/sh3/ex.S
@@ -4,7 +4,7 @@
4 * The SH-3 exception vector table. 4 * The SH-3 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 Paul Mundt 7 * Copyright (C) 2003 - 2006 Paul Mundt
8 * 8 *
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
@@ -49,3 +49,10 @@ ENTRY(nmi_slot)
49#endif 49#endif
50ENTRY(user_break_point_trap) 50ENTRY(user_break_point_trap)
51 .long break_point_trap /* 1E0 */ 51 .long break_point_trap /* 1E0 */
52
53 /*
54 * Pad the remainder of the table out, exceptions residing in far
55 * away offsets can be manually inserted in to their appropriate
56 * location via set_exception_table_{evt,vec}().
57 */
58 .balign 4096,0,4096
diff --git a/arch/sh/kernel/cpu/sh4/ex.S b/arch/sh/kernel/cpu/sh4/ex.S
index 3f4cd043e900..ac8ab57413cc 100644
--- a/arch/sh/kernel/cpu/sh4/ex.S
+++ b/arch/sh/kernel/cpu/sh4/ex.S
@@ -4,7 +4,7 @@
4 * The SH-4 exception vector table. 4 * The 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 Paul Mundt 7 * Copyright (C) 2003 - 2006 Paul Mundt
8 * 8 *
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
@@ -53,3 +53,10 @@ ENTRY(nmi_slot)
53#endif 53#endif
54ENTRY(user_break_point_trap) 54ENTRY(user_break_point_trap)
55 .long break_point_trap /* 1E0 */ 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/setup-sh7760.c b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
index 97f1c9af35d6..07e5377bf550 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7760.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
@@ -51,3 +51,66 @@ static int __init sh7760_devices_setup(void)
51 ARRAY_SIZE(sh7760_devices)); 51 ARRAY_SIZE(sh7760_devices));
52} 52}
53__initcall(sh7760_devices_setup); 53__initcall(sh7760_devices_setup);
54
55/*
56 * SH7760 INTC2-Style interrupts, vectors IRQ48-111 INTEVT 0x800-0xFE0
57 */
58static struct intc2_data intc2_irq_table[] = {
59 /* INTPRIO0 | INTMSK0 */
60 {48, 0, 28, 0, 31, 3}, /* IRQ 4 */
61 {49, 0, 24, 0, 30, 3}, /* IRQ 3 */
62 {50, 0, 20, 0, 29, 3}, /* IRQ 2 */
63 {51, 0, 16, 0, 28, 3}, /* IRQ 1 */
64 /* 52-55 (INTEVT 0x880-0x8E0) unused/reserved */
65 /* INTPRIO4 | INTMSK0 */
66 {56, 4, 28, 0, 25, 3}, /* HCAN2_CHAN0 */
67 {57, 4, 24, 0, 24, 3}, /* HCAN2_CHAN1 */
68 {58, 4, 20, 0, 23, 3}, /* I2S_CHAN0 */
69 {59, 4, 16, 0, 22, 3}, /* I2S_CHAN1 */
70 {60, 4, 12, 0, 21, 3}, /* AC97_CHAN0 */
71 {61, 4, 8, 0, 20, 3}, /* AC97_CHAN1 */
72 {62, 4, 4, 0, 19, 3}, /* I2C_CHAN0 */
73 {63, 4, 0, 0, 18, 3}, /* I2C_CHAN1 */
74 /* INTPRIO8 | INTMSK0 */
75 {52, 8, 16, 0, 11, 3}, /* SCIF0_ERI_IRQ */
76 {53, 8, 16, 0, 10, 3}, /* SCIF0_RXI_IRQ */
77 {54, 8, 16, 0, 9, 3}, /* SCIF0_BRI_IRQ */
78 {55, 8, 16, 0, 8, 3}, /* SCIF0_TXI_IRQ */
79 {64, 8, 28, 0, 17, 3}, /* USBHI_IRQ */
80 {65, 8, 24, 0, 16, 3}, /* LCDC */
81 /* 66, 67 unused */
82 {68, 8, 20, 0, 14, 13}, /* DMABRGI0_IRQ */
83 {69, 8, 20, 0, 13, 13}, /* DMABRGI1_IRQ */
84 {70, 8, 20, 0, 12, 13}, /* DMABRGI2_IRQ */
85 /* 71 unused */
86 {72, 8, 12, 0, 7, 3}, /* SCIF1_ERI_IRQ */
87 {73, 8, 12, 0, 6, 3}, /* SCIF1_RXI_IRQ */
88 {74, 8, 12, 0, 5, 3}, /* SCIF1_BRI_IRQ */
89 {75, 8, 12, 0, 4, 3}, /* SCIF1_TXI_IRQ */
90 {76, 8, 8, 0, 3, 3}, /* SCIF2_ERI_IRQ */
91 {77, 8, 8, 0, 2, 3}, /* SCIF2_RXI_IRQ */
92 {78, 8, 8, 0, 1, 3}, /* SCIF2_BRI_IRQ */
93 {79, 8, 8, 0, 0, 3}, /* SCIF2_TXI_IRQ */
94 /* | INTMSK4 */
95 {80, 8, 4, 4, 23, 3}, /* SIM_ERI */
96 {81, 8, 4, 4, 22, 3}, /* SIM_RXI */
97 {82, 8, 4, 4, 21, 3}, /* SIM_TXI */
98 {83, 8, 4, 4, 20, 3}, /* SIM_TEI */
99 {84, 8, 0, 4, 19, 3}, /* HSPII */
100 /* INTPRIOC | INTMSK4 */
101 /* 85-87 unused/reserved */
102 {88, 12, 20, 4, 18, 3}, /* MMCI0 */
103 {89, 12, 20, 4, 17, 3}, /* MMCI1 */
104 {90, 12, 20, 4, 16, 3}, /* MMCI2 */
105 {91, 12, 20, 4, 15, 3}, /* MMCI3 */
106 {92, 12, 12, 4, 6, 3}, /* MFI (unsure, bug? in my 7760 manual*/
107 /* 93-107 reserved/undocumented */
108 {108,12, 4, 4, 1, 3}, /* ADC */
109 {109,12, 0, 4, 0, 3}, /* CMTI */
110 /* 110-111 reserved/unused */
111};
112
113void __init init_IRQ_intc2(void)
114{
115 make_intc2_irq(intc2_irq_table, ARRAY_SIZE(intc2_irq_table));
116}
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7780.c b/arch/sh/kernel/cpu/sh4/setup-sh7780.c
index 72493f259edc..814ddb226531 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7780.c
@@ -77,3 +77,30 @@ static int __init sh7780_devices_setup(void)
77 ARRAY_SIZE(sh7780_devices)); 77 ARRAY_SIZE(sh7780_devices));
78} 78}
79__initcall(sh7780_devices_setup); 79__initcall(sh7780_devices_setup);
80
81static struct intc2_data intc2_irq_table[] = {
82 { TIMER_IRQ, 0, 24, 0, INTC_TMU0_MSK, 2 },
83 { 21, 1, 0, 0, INTC_RTC_MSK, TIMER_PRIORITY },
84 { 22, 1, 1, 0, INTC_RTC_MSK, TIMER_PRIORITY },
85 { 23, 1, 2, 0, INTC_RTC_MSK, TIMER_PRIORITY },
86 { SCIF0_ERI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
87 { SCIF0_RXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
88 { SCIF0_BRI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
89 { SCIF0_TXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
90
91 { SCIF1_ERI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
92 { SCIF1_RXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
93 { SCIF1_BRI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
94 { SCIF1_TXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
95
96 { PCIC0_IRQ, 0x10, 8, 0, INTC_PCIC0_MSK, PCIC0_PRIORITY },
97 { PCIC1_IRQ, 0x10, 0, 0, INTC_PCIC1_MSK, PCIC1_PRIORITY },
98 { PCIC2_IRQ, 0x14, 24, 0, INTC_PCIC2_MSK, PCIC2_PRIORITY },
99 { PCIC3_IRQ, 0x14, 16, 0, INTC_PCIC3_MSK, PCIC3_PRIORITY },
100 { PCIC4_IRQ, 0x14, 8, 0, INTC_PCIC4_MSK, PCIC4_PRIORITY },
101};
102
103void __init init_IRQ_intc2(void)
104{
105 make_intc2_irq(intc2_irq_table, ARRAY_SIZE(intc2_irq_table));
106}
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index acf2602569c4..944128ce9706 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -54,7 +54,7 @@ int show_interrupts(struct seq_file *p, void *v)
54 for_each_online_cpu(j) 54 for_each_online_cpu(j)
55 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 55 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
56 seq_printf(p, " %14s", irq_desc[i].chip->name); 56 seq_printf(p, " %14s", irq_desc[i].chip->name);
57 seq_printf(p, "-%s", handle_irq_name(irq_desc[i].handle_irq)); 57 seq_printf(p, "-%-8s", irq_desc[i].name);
58 seq_printf(p, " %s", action->name); 58 seq_printf(p, " %s", action->name);
59 59
60 for (action=action->next; action; action = action->next) 60 for (action=action->next; action; action = action->next)
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 91516dca4a85..a52b13ac6b7f 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -105,7 +105,7 @@ void show_regs(struct pt_regs * regs)
105{ 105{
106 printk("\n"); 106 printk("\n");
107 printk("Pid : %d, Comm: %20s\n", current->pid, current->comm); 107 printk("Pid : %d, Comm: %20s\n", current->pid, current->comm);
108 print_symbol("PC is at %s\n", regs->pc); 108 print_symbol("PC is at %s\n", instruction_pointer(regs));
109 printk("PC : %08lx SP : %08lx SR : %08lx ", 109 printk("PC : %08lx SP : %08lx SR : %08lx ",
110 regs->pc, regs->regs[15], regs->sr); 110 regs->pc, regs->regs[15], regs->sr);
111#ifdef CONFIG_MMU 111#ifdef CONFIG_MMU
@@ -130,15 +130,7 @@ void show_regs(struct pt_regs * regs)
130 printk("MACH: %08lx MACL: %08lx GBR : %08lx PR : %08lx\n", 130 printk("MACH: %08lx MACL: %08lx GBR : %08lx PR : %08lx\n",
131 regs->mach, regs->macl, regs->gbr, regs->pr); 131 regs->mach, regs->macl, regs->gbr, regs->pr);
132 132
133 /* 133 show_trace(NULL, (unsigned long *)regs->regs[15], regs);
134 * If we're in kernel mode, dump the stack too..
135 */
136 if (!user_mode(regs)) {
137 extern void show_task(unsigned long *sp);
138 unsigned long sp = regs->regs[15];
139
140 show_task((unsigned long *)sp);
141 }
142} 134}
143 135
144/* 136/*
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c
index c2c597e09482..53dfa55f3156 100644
--- a/arch/sh/kernel/traps.c
+++ b/arch/sh/kernel/traps.c
@@ -1,38 +1,25 @@
1/* $Id: traps.c,v 1.17 2004/05/02 01:46:30 sugioka Exp $ 1/*
2 * 2 * 'traps.c' handles hardware traps and faults after we have saved some
3 * linux/arch/sh/traps.c 3 * state in 'entry.S'.
4 * 4 *
5 * SuperH version: Copyright (C) 1999 Niibe Yutaka 5 * SuperH version: Copyright (C) 1999 Niibe Yutaka
6 * Copyright (C) 2000 Philipp Rumpf 6 * Copyright (C) 2000 Philipp Rumpf
7 * Copyright (C) 2000 David Howells 7 * Copyright (C) 2000 David Howells
8 * Copyright (C) 2002, 2003 Paul Mundt 8 * Copyright (C) 2002 - 2006 Paul Mundt
9 */ 9 *
10 10 * This file is subject to the terms and conditions of the GNU General Public
11/* 11 * License. See the file "COPYING" in the main directory of this archive
12 * 'Traps.c' handles hardware traps and faults after we have saved some 12 * for more details.
13 * state in 'entry.S'.
14 */ 13 */
15#include <linux/sched.h>
16#include <linux/kernel.h> 14#include <linux/kernel.h>
17#include <linux/string.h>
18#include <linux/errno.h>
19#include <linux/ptrace.h> 15#include <linux/ptrace.h>
20#include <linux/timer.h>
21#include <linux/mm.h>
22#include <linux/smp.h>
23#include <linux/smp_lock.h>
24#include <linux/init.h> 16#include <linux/init.h>
25#include <linux/delay.h>
26#include <linux/spinlock.h> 17#include <linux/spinlock.h>
27#include <linux/module.h> 18#include <linux/module.h>
28#include <linux/kallsyms.h> 19#include <linux/kallsyms.h>
29 20#include <linux/io.h>
30#include <asm/system.h> 21#include <asm/system.h>
31#include <asm/uaccess.h> 22#include <asm/uaccess.h>
32#include <asm/io.h>
33#include <asm/atomic.h>
34#include <asm/processor.h>
35#include <asm/sections.h>
36 23
37#ifdef CONFIG_SH_KGDB 24#ifdef CONFIG_SH_KGDB
38#include <asm/kgdb.h> 25#include <asm/kgdb.h>
@@ -53,13 +40,32 @@
53#define TRAP_ILLEGAL_SLOT_INST 13 40#define TRAP_ILLEGAL_SLOT_INST 13
54#endif 41#endif
55 42
56/* 43static void dump_mem(const char *str, unsigned long bottom, unsigned long top)
57 * These constants are for searching for possible module text 44{
58 * segments. VMALLOC_OFFSET comes from mm/vmalloc.c; MODULE_RANGE is 45 unsigned long p;
59 * a guess of how much space is likely to be vmalloced. 46 int i;
60 */ 47
61#define VMALLOC_OFFSET (8*1024*1024) 48 printk("%s(0x%08lx to 0x%08lx)\n", str, bottom, top);
62#define MODULE_RANGE (8*1024*1024) 49
50 for (p = bottom & ~31; p < top; ) {
51 printk("%04lx: ", p & 0xffff);
52
53 for (i = 0; i < 8; i++, p += 4) {
54 unsigned int val;
55
56 if (p < bottom || p >= top)
57 printk(" ");
58 else {
59 if (__get_user(val, (unsigned int __user *)p)) {
60 printk("\n");
61 return;
62 }
63 printk("%08x ", val);
64 }
65 }
66 printk("\n");
67 }
68}
63 69
64DEFINE_SPINLOCK(die_lock); 70DEFINE_SPINLOCK(die_lock);
65 71
@@ -69,14 +75,28 @@ void die(const char * str, struct pt_regs * regs, long err)
69 75
70 console_verbose(); 76 console_verbose();
71 spin_lock_irq(&die_lock); 77 spin_lock_irq(&die_lock);
78 bust_spinlocks(1);
79
72 printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); 80 printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
81
73 CHK_REMOTE_DEBUG(regs); 82 CHK_REMOTE_DEBUG(regs);
83 print_modules();
74 show_regs(regs); 84 show_regs(regs);
85
86 printk("Process: %s (pid: %d, stack limit = %p)\n",
87 current->comm, current->pid, task_stack_page(current) + 1);
88
89 if (!user_mode(regs) || in_interrupt())
90 dump_mem("Stack: ", regs->regs[15], THREAD_SIZE +
91 (unsigned long)task_stack_page(current));
92
93 bust_spinlocks(0);
75 spin_unlock_irq(&die_lock); 94 spin_unlock_irq(&die_lock);
76 do_exit(SIGSEGV); 95 do_exit(SIGSEGV);
77} 96}
78 97
79static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err) 98static inline void die_if_kernel(const char *str, struct pt_regs *regs,
99 long err)
80{ 100{
81 if (!user_mode(regs)) 101 if (!user_mode(regs))
82 die(str, regs, err); 102 die(str, regs, err);
@@ -93,8 +113,7 @@ static int handle_unaligned_notify_count = 10;
93 */ 113 */
94static int die_if_no_fixup(const char * str, struct pt_regs * regs, long err) 114static int die_if_no_fixup(const char * str, struct pt_regs * regs, long err)
95{ 115{
96 if (!user_mode(regs)) 116 if (!user_mode(regs)) {
97 {
98 const struct exception_table_entry *fixup; 117 const struct exception_table_entry *fixup;
99 fixup = search_exception_tables(regs->pc); 118 fixup = search_exception_tables(regs->pc);
100 if (fixup) { 119 if (fixup) {
@@ -550,7 +569,10 @@ int is_dsp_inst(struct pt_regs *regs)
550#define is_dsp_inst(regs) (0) 569#define is_dsp_inst(regs) (0)
551#endif /* CONFIG_SH_DSP */ 570#endif /* CONFIG_SH_DSP */
552 571
553extern int do_fpu_inst(unsigned short, struct pt_regs*); 572/* arch/sh/kernel/cpu/sh4/fpu.c */
573extern int do_fpu_inst(unsigned short, struct pt_regs *);
574extern asmlinkage void do_fpu_state_restore(unsigned long r4, unsigned long r5,
575 unsigned long r6, unsigned long r7, struct pt_regs regs);
554 576
555asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5, 577asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5,
556 unsigned long r6, unsigned long r7, 578 unsigned long r6, unsigned long r7,
@@ -709,14 +731,20 @@ void __init per_cpu_trap_init(void)
709 : "memory"); 731 : "memory");
710} 732}
711 733
712void __init trap_init(void) 734void *set_exception_table_vec(unsigned int vec, void *handler)
713{ 735{
714 extern void *exception_handling_table[]; 736 extern void *exception_handling_table[];
737 void *old_handler;
738
739 old_handler = exception_handling_table[vec];
740 exception_handling_table[vec] = handler;
741 return old_handler;
742}
715 743
716 exception_handling_table[TRAP_RESERVED_INST] 744void __init trap_init(void)
717 = (void *)do_reserved_inst; 745{
718 exception_handling_table[TRAP_ILLEGAL_SLOT_INST] 746 set_exception_table_vec(TRAP_RESERVED_INST, do_reserved_inst);
719 = (void *)do_illegal_slot_inst; 747 set_exception_table_vec(TRAP_ILLEGAL_SLOT_INST, do_illegal_slot_inst);
720 748
721#if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_FPU) || \ 749#if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_FPU) || \
722 defined(CONFIG_SH_FPU_EMU) 750 defined(CONFIG_SH_FPU_EMU)
@@ -725,61 +753,54 @@ void __init trap_init(void)
725 * reserved. They'll be handled in the math-emu case, or faulted on 753 * reserved. They'll be handled in the math-emu case, or faulted on
726 * otherwise. 754 * otherwise.
727 */ 755 */
728 /* entry 64 corresponds to EXPEVT=0x800 */ 756 set_exception_table_evt(0x800, do_reserved_inst);
729 exception_handling_table[64] = (void *)do_reserved_inst; 757 set_exception_table_evt(0x820, do_illegal_slot_inst);
730 exception_handling_table[65] = (void *)do_illegal_slot_inst; 758#elif defined(CONFIG_SH_FPU)
759 set_exception_table_evt(0x800, do_fpu_state_restore);
760 set_exception_table_evt(0x820, do_fpu_state_restore);
731#endif 761#endif
732 762
733 /* Setup VBR for boot cpu */ 763 /* Setup VBR for boot cpu */
734 per_cpu_trap_init(); 764 per_cpu_trap_init();
735} 765}
736 766
737void show_stack(struct task_struct *tsk, unsigned long *sp) 767void show_trace(struct task_struct *tsk, unsigned long *sp,
768 struct pt_regs *regs)
738{ 769{
739 unsigned long *stack, addr; 770 unsigned long addr;
740 unsigned long module_start = VMALLOC_START;
741 unsigned long module_end = VMALLOC_END;
742 int i = 1;
743
744 if (!tsk)
745 tsk = current;
746 if (tsk == current)
747 sp = (unsigned long *)current_stack_pointer;
748 else
749 sp = (unsigned long *)tsk->thread.sp;
750 771
751 stack = sp; 772 if (regs && user_mode(regs))
773 return;
752 774
753 printk("\nCall trace: "); 775 printk("\nCall trace: ");
754#ifdef CONFIG_KALLSYMS 776#ifdef CONFIG_KALLSYMS
755 printk("\n"); 777 printk("\n");
756#endif 778#endif
757 779
758 while (!kstack_end(stack)) { 780 while (!kstack_end(sp)) {
759 addr = *stack++; 781 addr = *sp++;
760 if (((addr >= (unsigned long)_text) && 782 if (kernel_text_address(addr))
761 (addr <= (unsigned long)_etext)) || 783 print_ip_sym(addr);
762 ((addr >= module_start) && (addr <= module_end))) {
763 /*
764 * For 80-columns display, 6 entry is maximum.
765 * NOTE: '[<8c00abcd>] ' consumes 13 columns .
766 */
767#ifndef CONFIG_KALLSYMS
768 if (i && ((i % 6) == 0))
769 printk("\n ");
770#endif
771 printk("[<%08lx>] ", addr);
772 print_symbol("%s\n", addr);
773 i++;
774 }
775 } 784 }
776 785
777 printk("\n"); 786 printk("\n");
778} 787}
779 788
780void show_task(unsigned long *sp) 789void show_stack(struct task_struct *tsk, unsigned long *sp)
781{ 790{
782 show_stack(NULL, sp); 791 unsigned long stack;
792
793 if (!tsk)
794 tsk = current;
795 if (tsk == current)
796 sp = (unsigned long *)current_stack_pointer;
797 else
798 sp = (unsigned long *)tsk->thread.sp;
799
800 stack = (unsigned long)sp;
801 dump_mem("Stack: ", stack, THREAD_SIZE +
802 (unsigned long)task_stack_page(tsk));
803 show_trace(tsk, sp, NULL);
783} 804}
784 805
785void dump_stack(void) 806void dump_stack(void)
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index d08bd036ccb8..7b172160fe04 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -79,7 +79,7 @@ static irqreturn_t mconsole_interrupt(int irq, void *dev_id)
79 /* long to avoid size mismatch warnings from gcc */ 79 /* long to avoid size mismatch warnings from gcc */
80 long fd; 80 long fd;
81 struct mconsole_entry *new; 81 struct mconsole_entry *new;
82 struct mc_request req; 82 static struct mc_request req; /* that's OK */
83 83
84 fd = (long) dev_id; 84 fd = (long) dev_id;
85 while (mconsole_get_request(fd, &req)){ 85 while (mconsole_get_request(fd, &req)){
@@ -91,6 +91,7 @@ static irqreturn_t mconsole_interrupt(int irq, void *dev_id)
91 mconsole_reply(&req, "Out of memory", 1, 0); 91 mconsole_reply(&req, "Out of memory", 1, 0);
92 else { 92 else {
93 new->request = req; 93 new->request = req;
94 new->request.regs = get_irq_regs()->regs;
94 list_add(&new->list, &mc_requests); 95 list_add(&new->list, &mc_requests);
95 } 96 }
96 } 97 }
@@ -314,9 +315,21 @@ void mconsole_stop(struct mc_request *req)
314{ 315{
315 deactivate_fd(req->originating_fd, MCONSOLE_IRQ); 316 deactivate_fd(req->originating_fd, MCONSOLE_IRQ);
316 os_set_fd_block(req->originating_fd, 1); 317 os_set_fd_block(req->originating_fd, 1);
317 mconsole_reply(req, "", 0, 0); 318 mconsole_reply(req, "stopped", 0, 0);
318 while(mconsole_get_request(req->originating_fd, req)){ 319 while (mconsole_get_request(req->originating_fd, req)) {
319 if(req->cmd->handler == mconsole_go) break; 320 if (req->cmd->handler == mconsole_go)
321 break;
322 if (req->cmd->handler == mconsole_stop) {
323 mconsole_reply(req, "Already stopped", 1, 0);
324 continue;
325 }
326 if (req->cmd->handler == mconsole_sysrq) {
327 struct pt_regs *old_regs;
328 old_regs = set_irq_regs((struct pt_regs *)&req->regs);
329 mconsole_sysrq(req);
330 set_irq_regs(old_regs);
331 continue;
332 }
320 (*req->cmd->handler)(req); 333 (*req->cmd->handler)(req);
321 } 334 }
322 os_set_fd_block(req->originating_fd, 0); 335 os_set_fd_block(req->originating_fd, 0);
@@ -673,9 +686,7 @@ static void with_console(struct mc_request *req, void (*proc)(void *),
673static void sysrq_proc(void *arg) 686static void sysrq_proc(void *arg)
674{ 687{
675 char *op = arg; 688 char *op = arg;
676 struct pt_regs *old_regs = set_irq_regs(&current->thread.regs);
677 handle_sysrq(*op, NULL); 689 handle_sysrq(*op, NULL);
678 set_irq_regs(old_regs);
679} 690}
680 691
681void mconsole_sysrq(struct mc_request *req) 692void mconsole_sysrq(struct mc_request *req)
diff --git a/arch/um/drivers/mconsole_user.c b/arch/um/drivers/mconsole_user.c
index 17068eb746c0..75aef6f7ef6e 100644
--- a/arch/um/drivers/mconsole_user.c
+++ b/arch/um/drivers/mconsole_user.c
@@ -14,6 +14,7 @@
14#include <sys/un.h> 14#include <sys/un.h>
15#include <unistd.h> 15#include <unistd.h>
16#include "user.h" 16#include "user.h"
17#include "sysdep/ptrace.h"
17#include "mconsole.h" 18#include "mconsole.h"
18#include "umid.h" 19#include "umid.h"
19#include "user_util.h" 20#include "user_util.h"
diff --git a/arch/um/include/mconsole.h b/arch/um/include/mconsole.h
index 58f67d391105..2666815b6af5 100644
--- a/arch/um/include/mconsole.h
+++ b/arch/um/include/mconsole.h
@@ -61,6 +61,7 @@ struct mc_request
61 61
62 struct mconsole_request request; 62 struct mconsole_request request;
63 struct mconsole_command *cmd; 63 struct mconsole_command *cmd;
64 union uml_pt_regs regs;
64}; 65};
65 66
66extern char mconsole_socket_name[]; 67extern char mconsole_socket_name[];