aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 12:45:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 12:45:57 -0400
commite945e849e18006c131fe59252ab920c6b5f7959c (patch)
treea86b1a299c5cebed14889fb638cb6808417b5f4a /arch/sparc64
parent77a50df2b14c8d3ee3c58c21c4a0e0157570df09 (diff)
parent194f1a68b93e959ede6ec363db4714e630bdbb6a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: sparc: video drivers: add facility level sparc: tcx.c make tcx_init and tcx_exit static sparc: ffb.c make ffb_init and ffb_exit static sparc: cg14.c make cg14_init and cg15_exit static sparc: bw2.c fix bw2_exit sparc64: Fix accidental syscall restart on child return from clone/fork/vfork. sparc64: Clean up handling of pt_regs trap type encoding. sparc: Remove old style signal frame support. sparc64: Kill bogus RT_ALIGNEDSZ macro from signal.c sparc: sunzilog.c remove unused argument sparc: fix drivers/video/tcx.c warning sparc64: Kill unused local ISA bus layer. input: Rewrite sparcspkr device probing. sparc64: Do not ignore 'pmu' device ranges. sparc64: Kill ISA_FLOPPY_WORKS code. sparc64: Kill CONFIG_SPARC32_COMPAT sparc64: Cleanups and corrections for arch/sparc64/Kconfig sparc64: Fix wedged irq regression.
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/Kconfig85
-rw-r--r--arch/sparc64/defconfig23
-rw-r--r--arch/sparc64/kernel/Makefile6
-rw-r--r--arch/sparc64/kernel/audit.c6
-rw-r--r--arch/sparc64/kernel/irq.c3
-rw-r--r--arch/sparc64/kernel/isa.c191
-rw-r--r--arch/sparc64/kernel/of_device.c6
-rw-r--r--arch/sparc64/kernel/pci.c2
-rw-r--r--arch/sparc64/kernel/process.c12
-rw-r--r--arch/sparc64/kernel/signal.c16
-rw-r--r--arch/sparc64/kernel/signal32.c272
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c2
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c11
13 files changed, 65 insertions, 570 deletions
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 8acc5cc38621..edbe71e3fab9 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -1,9 +1,5 @@
1# $Id: config.in,v 1.158 2002/01/24 22:14:44 davem Exp $ 1# sparc64 configuration
2# For a description of the syntax of this configuration file, 2mainmenu "Linux Kernel Configuration for 64-bit SPARC"
3# see the Configure script.
4#
5
6mainmenu "Linux/UltraSPARC Kernel Configuration"
7 3
8config SPARC 4config SPARC
9 bool 5 bool
@@ -17,12 +13,6 @@ config SPARC64
17 default y 13 default y
18 select HAVE_IDE 14 select HAVE_IDE
19 select HAVE_LMB 15 select HAVE_LMB
20 help
21 SPARC is a family of RISC microprocessors designed and marketed by
22 Sun Microsystems, incorporated. This port covers the newer 64-bit
23 UltraSPARC. The UltraLinux project maintains both the SPARC32 and
24 SPARC64 ports; its web page is available at
25 <http://www.ultralinux.org/>.
26 16
27config GENERIC_TIME 17config GENERIC_TIME
28 bool 18 bool
@@ -97,7 +87,7 @@ config SPARC64_PAGE_SIZE_8KB
97 help 87 help
98 This lets you select the page size of the kernel. 88 This lets you select the page size of the kernel.
99 89
100 8KB and 64KB work quite well, since Sparc ELF sections 90 8KB and 64KB work quite well, since SPARC ELF sections
101 provide for up to 64KB alignment. 91 provide for up to 64KB alignment.
102 92
103 Therefore, 512KB and 4MB are for expert hackers only. 93 Therefore, 512KB and 4MB are for expert hackers only.
@@ -138,7 +128,7 @@ config HOTPLUG_CPU
138 bool "Support for hot-pluggable CPUs" 128 bool "Support for hot-pluggable CPUs"
139 depends on SMP 129 depends on SMP
140 select HOTPLUG 130 select HOTPLUG
141 ---help--- 131 help
142 Say Y here to experiment with turning CPUs off and on. CPUs 132 Say Y here to experiment with turning CPUs off and on. CPUs
143 can be controlled through /sys/devices/system/cpu/cpu#. 133 can be controlled through /sys/devices/system/cpu/cpu#.
144 Say N if you want to disable CPU hotplug. 134 Say N if you want to disable CPU hotplug.
@@ -155,23 +145,16 @@ source "kernel/time/Kconfig"
155 145
156config SMP 146config SMP
157 bool "Symmetric multi-processing support" 147 bool "Symmetric multi-processing support"
158 ---help--- 148 help
159 This enables support for systems with more than one CPU. If you have 149 This enables support for systems with more than one CPU. If you have
160 a system with only one CPU, say N. If you have a system with more than 150 a system with only one CPU, say N. If you have a system with more than
161 one CPU, say Y. 151 one CPU, say Y.
162 152
163 If you say N here, the kernel will run on single and multiprocessor 153 If you say N here, the kernel will run on single and multiprocessor
164 machines, but will use only one CPU of a multiprocessor machine. If 154 machines, but will use only one CPU of a multiprocessor machine. If
165 you say Y here, the kernel will run on many, but not all, 155 you say Y here, the kernel will run on single-processor machines.
166 singleprocessor machines. On a singleprocessor machine, the kernel 156 On a single-processor machine, the kernel will run faster if you say
167 will run faster if you say N here. 157 N here.
168
169 People using multiprocessor machines who say Y here should also say
170 Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
171 Management" code will be disabled if you say Y here.
172
173 See also <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO
174 available at <http://www.tldp.org/docs.html#howto>.
175 158
176 If you don't know what to do here, say N. 159 If you don't know what to do here, say N.
177 160
@@ -284,50 +267,19 @@ source "mm/Kconfig"
284 267
285config ISA 268config ISA
286 bool 269 bool
287 help
288 Find out whether you have ISA slots on your motherboard. ISA is the
289 name of a bus system, i.e. the way the CPU talks to the other stuff
290 inside your box. Other bus systems are PCI, EISA, MicroChannel
291 (MCA) or VESA. ISA is an older system, now being displaced by PCI;
292 newer boards don't support it. If you have ISA, say Y, otherwise N.
293 270
294config ISAPNP 271config ISAPNP
295 bool 272 bool
296 help
297 Say Y here if you would like support for ISA Plug and Play devices.
298 Some information is in <file:Documentation/isapnp.txt>.
299
300 To compile this driver as a module, choose M here: the
301 module will be called isapnp.
302
303 If unsure, say Y.
304 273
305config EISA 274config EISA
306 bool 275 bool
307 ---help---
308 The Extended Industry Standard Architecture (EISA) bus was
309 developed as an open alternative to the IBM MicroChannel bus.
310
311 The EISA bus provided some of the features of the IBM MicroChannel
312 bus while maintaining backward compatibility with cards made for
313 the older ISA bus. The EISA bus saw limited use between 1988 and
314 1995 when it was made obsolete by the PCI bus.
315
316 Say Y here if you are building a kernel for an EISA-based machine.
317
318 Otherwise, say N.
319 276
320config MCA 277config MCA
321 bool 278 bool
322 help
323 MicroChannel Architecture is found in some IBM PS/2 machines and
324 laptops. It is a bus system similar to PCI or ISA. See
325 <file:Documentation/mca.txt> (and especially the web page given
326 there) before attempting to build an MCA bus kernel.
327 279
328config PCMCIA 280config PCMCIA
329 tristate 281 tristate
330 ---help--- 282 help
331 Say Y here if you want to attach PCMCIA- or PC-cards to your Linux 283 Say Y here if you want to attach PCMCIA- or PC-cards to your Linux
332 computer. These are credit-card size devices such as network cards, 284 computer. These are credit-card size devices such as network cards,
333 modems or hard drives often used with laptops computers. There are 285 modems or hard drives often used with laptops computers. There are
@@ -369,10 +321,10 @@ config PCI
369 bool "PCI support" 321 bool "PCI support"
370 select ARCH_SUPPORTS_MSI 322 select ARCH_SUPPORTS_MSI
371 help 323 help
372 Find out whether you have a PCI motherboard. PCI is the name of a 324 Find out whether your system includes a PCI bus. PCI is the name of
373 bus system, i.e. the way the CPU talks to the other stuff inside 325 a bus system, i.e. the way the CPU talks to the other stuff inside
374 your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or 326 your box. If you say Y here, the kernel will include drivers and
375 VESA. If you have PCI, say Y, otherwise N. 327 infrastructure code to support PCI bus devices.
376 328
377config PCI_DOMAINS 329config PCI_DOMAINS
378 def_bool PCI 330 def_bool PCI
@@ -396,15 +348,8 @@ menu "Executable file formats"
396 348
397source "fs/Kconfig.binfmt" 349source "fs/Kconfig.binfmt"
398 350
399config SPARC32_COMPAT
400 bool "Kernel support for Linux/Sparc 32bit binary compatibility"
401 help
402 This allows you to run 32-bit binaries on your Ultra.
403 Everybody wants this; say Y.
404
405config COMPAT 351config COMPAT
406 bool 352 bool
407 depends on SPARC32_COMPAT
408 default y 353 default y
409 select COMPAT_BINFMT_ELF 354 select COMPAT_BINFMT_ELF
410 355
@@ -421,8 +366,8 @@ config SCHED_SMT
421 default y 366 default y
422 help 367 help
423 SMT scheduler support improves the CPU scheduler's decision making 368 SMT scheduler support improves the CPU scheduler's decision making
424 when dealing with UltraSPARC cpus at a cost of slightly increased 369 when dealing with SPARC cpus at a cost of slightly increased overhead
425 overhead in some places. If unsure say N here. 370 in some places. If unsure say N here.
426 371
427config SCHED_MC 372config SCHED_MC
428 bool "Multi-core scheduler support" 373 bool "Multi-core scheduler support"
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index 92f79680f70d..aff93c9d13f4 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.25-numa 3# Linux kernel version: 2.6.25
4# Wed Apr 23 04:49:08 2008 4# Sat Apr 26 03:11:06 2008
5# 5#
6CONFIG_SPARC=y 6CONFIG_SPARC=y
7CONFIG_SPARC64=y 7CONFIG_SPARC64=y
@@ -152,7 +152,9 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
152CONFIG_HUGETLB_PAGE_SIZE_4MB=y 152CONFIG_HUGETLB_PAGE_SIZE_4MB=y
153# CONFIG_HUGETLB_PAGE_SIZE_512K is not set 153# CONFIG_HUGETLB_PAGE_SIZE_512K is not set
154# CONFIG_HUGETLB_PAGE_SIZE_64K is not set 154# CONFIG_HUGETLB_PAGE_SIZE_64K is not set
155# CONFIG_NUMA is not set 155CONFIG_NUMA=y
156CONFIG_NODES_SHIFT=4
157CONFIG_NODES_SPAN_OTHER_NODES=y
156CONFIG_ARCH_POPULATES_NODE_MAP=y 158CONFIG_ARCH_POPULATES_NODE_MAP=y
157CONFIG_ARCH_SELECT_MEMORY_MODEL=y 159CONFIG_ARCH_SELECT_MEMORY_MODEL=y
158CONFIG_ARCH_SPARSEMEM_ENABLE=y 160CONFIG_ARCH_SPARSEMEM_ENABLE=y
@@ -162,12 +164,14 @@ CONFIG_SELECT_MEMORY_MODEL=y
162# CONFIG_DISCONTIGMEM_MANUAL is not set 164# CONFIG_DISCONTIGMEM_MANUAL is not set
163CONFIG_SPARSEMEM_MANUAL=y 165CONFIG_SPARSEMEM_MANUAL=y
164CONFIG_SPARSEMEM=y 166CONFIG_SPARSEMEM=y
167CONFIG_NEED_MULTIPLE_NODES=y
165CONFIG_HAVE_MEMORY_PRESENT=y 168CONFIG_HAVE_MEMORY_PRESENT=y
166# CONFIG_SPARSEMEM_STATIC is not set 169# CONFIG_SPARSEMEM_STATIC is not set
167CONFIG_SPARSEMEM_EXTREME=y 170CONFIG_SPARSEMEM_EXTREME=y
168CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y 171CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
169CONFIG_SPARSEMEM_VMEMMAP=y 172CONFIG_SPARSEMEM_VMEMMAP=y
170CONFIG_SPLIT_PTLOCK_CPUS=4 173CONFIG_SPLIT_PTLOCK_CPUS=4
174CONFIG_MIGRATION=y
171CONFIG_RESOURCES_64BIT=y 175CONFIG_RESOURCES_64BIT=y
172CONFIG_ZONE_DMA_FLAG=0 176CONFIG_ZONE_DMA_FLAG=0
173CONFIG_NR_QUICK=1 177CONFIG_NR_QUICK=1
@@ -191,7 +195,6 @@ CONFIG_SUN_OPENPROMFS=m
191CONFIG_BINFMT_ELF=y 195CONFIG_BINFMT_ELF=y
192CONFIG_COMPAT_BINFMT_ELF=y 196CONFIG_COMPAT_BINFMT_ELF=y
193CONFIG_BINFMT_MISC=m 197CONFIG_BINFMT_MISC=m
194CONFIG_SPARC32_COMPAT=y
195CONFIG_COMPAT=y 198CONFIG_COMPAT=y
196CONFIG_SYSVIPC_COMPAT=y 199CONFIG_SYSVIPC_COMPAT=y
197CONFIG_SCHED_SMT=y 200CONFIG_SCHED_SMT=y
@@ -746,13 +749,7 @@ CONFIG_DEVPORT=y
746CONFIG_I2C=y 749CONFIG_I2C=y
747CONFIG_I2C_BOARDINFO=y 750CONFIG_I2C_BOARDINFO=y
748# CONFIG_I2C_CHARDEV is not set 751# CONFIG_I2C_CHARDEV is not set
749
750#
751# I2C Algorithms
752#
753CONFIG_I2C_ALGOBIT=y 752CONFIG_I2C_ALGOBIT=y
754# CONFIG_I2C_ALGOPCF is not set
755# CONFIG_I2C_ALGOPCA is not set
756 753
757# 754#
758# I2C Hardware Bus support 755# I2C Hardware Bus support
@@ -780,6 +777,7 @@ CONFIG_I2C_ALGOBIT=y
780# CONFIG_I2C_VIA is not set 777# CONFIG_I2C_VIA is not set
781# CONFIG_I2C_VIAPRO is not set 778# CONFIG_I2C_VIAPRO is not set
782# CONFIG_I2C_VOODOO3 is not set 779# CONFIG_I2C_VOODOO3 is not set
780# CONFIG_I2C_PCA_PLATFORM is not set
783 781
784# 782#
785# Miscellaneous I2C Chip support 783# Miscellaneous I2C Chip support
@@ -1026,6 +1024,7 @@ CONFIG_SND_ALI5451=m
1026# CONFIG_SND_AU8810 is not set 1024# CONFIG_SND_AU8810 is not set
1027# CONFIG_SND_AU8820 is not set 1025# CONFIG_SND_AU8820 is not set
1028# CONFIG_SND_AU8830 is not set 1026# CONFIG_SND_AU8830 is not set
1027# CONFIG_SND_AW2 is not set
1029# CONFIG_SND_AZT3328 is not set 1028# CONFIG_SND_AZT3328 is not set
1030# CONFIG_SND_BT87X is not set 1029# CONFIG_SND_BT87X is not set
1031# CONFIG_SND_CA0106 is not set 1030# CONFIG_SND_CA0106 is not set
@@ -1097,10 +1096,6 @@ CONFIG_SND_SUN_CS4231=m
1097# CONFIG_SND_SOC is not set 1096# CONFIG_SND_SOC is not set
1098 1097
1099# 1098#
1100# SoC Audio support for SuperH
1101#
1102
1103#
1104# ALSA SoC audio for Freescale SOCs 1099# ALSA SoC audio for Freescale SOCs
1105# 1100#
1106 1101
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile
index 63c6ae0dd273..2bd0340b743d 100644
--- a/arch/sparc64/kernel/Makefile
+++ b/arch/sparc64/kernel/Makefile
@@ -15,17 +15,17 @@ obj-y := process.o setup.o cpu.o idprom.o \
15 visemul.o prom.o of_device.o hvapi.o sstate.o mdesc.o 15 visemul.o prom.o of_device.o hvapi.o sstate.o mdesc.o
16 16
17obj-$(CONFIG_STACKTRACE) += stacktrace.o 17obj-$(CONFIG_STACKTRACE) += stacktrace.o
18obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o \ 18obj-$(CONFIG_PCI) += ebus.o pci_common.o \
19 pci_psycho.o pci_sabre.o pci_schizo.o \ 19 pci_psycho.o pci_sabre.o pci_schizo.o \
20 pci_sun4v.o pci_sun4v_asm.o pci_fire.o 20 pci_sun4v.o pci_sun4v_asm.o pci_fire.o
21obj-$(CONFIG_PCI_MSI) += pci_msi.o 21obj-$(CONFIG_PCI_MSI) += pci_msi.o
22obj-$(CONFIG_SMP) += smp.o trampoline.o hvtramp.o 22obj-$(CONFIG_SMP) += smp.o trampoline.o hvtramp.o
23obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o 23obj-$(CONFIG_COMPAT) += sys32.o sys_sparc32.o signal32.o
24obj-$(CONFIG_MODULES) += module.o 24obj-$(CONFIG_MODULES) += module.o
25obj-$(CONFIG_US3_FREQ) += us3_cpufreq.o 25obj-$(CONFIG_US3_FREQ) += us3_cpufreq.o
26obj-$(CONFIG_US2E_FREQ) += us2e_cpufreq.o 26obj-$(CONFIG_US2E_FREQ) += us2e_cpufreq.o
27obj-$(CONFIG_KPROBES) += kprobes.o 27obj-$(CONFIG_KPROBES) += kprobes.o
28obj-$(CONFIG_SUN_LDOMS) += ldc.o vio.o viohs.o ds.o 28obj-$(CONFIG_SUN_LDOMS) += ldc.o vio.o viohs.o ds.o
29obj-$(CONFIG_AUDIT) += audit.o 29obj-$(CONFIG_AUDIT) += audit.o
30obj-$(CONFIG_AUDIT)$(CONFIG_SPARC32_COMPAT) += compat_audit.o 30obj-$(CONFIG_AUDIT)$(CONFIG_COMPAT) += compat_audit.o
31obj-y += $(obj-yy) 31obj-y += $(obj-yy)
diff --git a/arch/sparc64/kernel/audit.c b/arch/sparc64/kernel/audit.c
index 24d7f4b4178a..8fff0ac63d56 100644
--- a/arch/sparc64/kernel/audit.c
+++ b/arch/sparc64/kernel/audit.c
@@ -30,7 +30,7 @@ static unsigned signal_class[] = {
30 30
31int audit_classify_arch(int arch) 31int audit_classify_arch(int arch)
32{ 32{
33#ifdef CONFIG_SPARC32_COMPAT 33#ifdef CONFIG_COMPAT
34 if (arch == AUDIT_ARCH_SPARC) 34 if (arch == AUDIT_ARCH_SPARC)
35 return 1; 35 return 1;
36#endif 36#endif
@@ -39,7 +39,7 @@ int audit_classify_arch(int arch)
39 39
40int audit_classify_syscall(int abi, unsigned syscall) 40int audit_classify_syscall(int abi, unsigned syscall)
41{ 41{
42#ifdef CONFIG_SPARC32_COMPAT 42#ifdef CONFIG_COMPAT
43 extern int sparc32_classify_syscall(unsigned); 43 extern int sparc32_classify_syscall(unsigned);
44 if (abi == AUDIT_ARCH_SPARC) 44 if (abi == AUDIT_ARCH_SPARC)
45 return sparc32_classify_syscall(syscall); 45 return sparc32_classify_syscall(syscall);
@@ -60,7 +60,7 @@ int audit_classify_syscall(int abi, unsigned syscall)
60 60
61static int __init audit_classes_init(void) 61static int __init audit_classes_init(void)
62{ 62{
63#ifdef CONFIG_SPARC32_COMPAT 63#ifdef CONFIG_COMPAT
64 extern __u32 sparc32_dir_class[]; 64 extern __u32 sparc32_dir_class[];
65 extern __u32 sparc32_write_class[]; 65 extern __u32 sparc32_write_class[];
66 extern __u32 sparc32_read_class[]; 66 extern __u32 sparc32_read_class[];
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index eb88bd6e674e..b441a26b73b0 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -1,6 +1,6 @@
1/* irq.c: UltraSparc IRQ handling/init/registry. 1/* irq.c: UltraSparc IRQ handling/init/registry.
2 * 2 *
3 * Copyright (C) 1997, 2007 David S. Miller (davem@davemloft.net) 3 * Copyright (C) 1997, 2007, 2008 David S. Miller (davem@davemloft.net)
4 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) 4 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
5 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) 5 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
6 */ 6 */
@@ -308,6 +308,7 @@ static void sun4u_irq_enable(unsigned int virt_irq)
308 IMAP_AID_SAFARI | IMAP_NID_SAFARI); 308 IMAP_AID_SAFARI | IMAP_NID_SAFARI);
309 val |= tid | IMAP_VALID; 309 val |= tid | IMAP_VALID;
310 upa_writeq(val, imap); 310 upa_writeq(val, imap);
311 upa_writeq(ICLR_IDLE, data->iclr);
311 } 312 }
312} 313}
313 314
diff --git a/arch/sparc64/kernel/isa.c b/arch/sparc64/kernel/isa.c
deleted file mode 100644
index a2af5ed784c9..000000000000
--- a/arch/sparc64/kernel/isa.c
+++ /dev/null
@@ -1,191 +0,0 @@
1#include <linux/kernel.h>
2#include <linux/init.h>
3#include <linux/pci.h>
4#include <linux/slab.h>
5#include <asm/oplib.h>
6#include <asm/prom.h>
7#include <asm/of_device.h>
8#include <asm/isa.h>
9
10struct sparc_isa_bridge *isa_chain;
11
12static void __init fatal_err(const char *reason)
13{
14 prom_printf("ISA: fatal error, %s.\n", reason);
15}
16
17static void __init report_dev(struct sparc_isa_device *isa_dev, int child)
18{
19 if (child)
20 printk(" (%s)", isa_dev->prom_node->name);
21 else
22 printk(" [%s", isa_dev->prom_node->name);
23}
24
25static void __init isa_dev_get_resource(struct sparc_isa_device *isa_dev)
26{
27 struct of_device *op = of_find_device_by_node(isa_dev->prom_node);
28
29 memcpy(&isa_dev->resource, &op->resource[0], sizeof(struct resource));
30}
31
32static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev)
33{
34 struct of_device *op = of_find_device_by_node(isa_dev->prom_node);
35
36 if (!op || !op->num_irqs) {
37 isa_dev->irq = PCI_IRQ_NONE;
38 } else {
39 isa_dev->irq = op->irqs[0];
40 }
41}
42
43static void __init isa_fill_children(struct sparc_isa_device *parent_isa_dev)
44{
45 struct device_node *dp = parent_isa_dev->prom_node->child;
46
47 if (!dp)
48 return;
49
50 printk(" ->");
51 while (dp) {
52 struct sparc_isa_device *isa_dev;
53
54 isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
55 if (!isa_dev) {
56 fatal_err("cannot allocate child isa_dev");
57 prom_halt();
58 }
59
60 /* Link it in to parent. */
61 isa_dev->next = parent_isa_dev->child;
62 parent_isa_dev->child = isa_dev;
63
64 isa_dev->bus = parent_isa_dev->bus;
65 isa_dev->prom_node = dp;
66
67 isa_dev_get_resource(isa_dev);
68 isa_dev_get_irq(isa_dev);
69
70 report_dev(isa_dev, 1);
71
72 dp = dp->sibling;
73 }
74}
75
76static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
77{
78 struct device_node *dp = isa_br->prom_node->child;
79
80 while (dp) {
81 struct sparc_isa_device *isa_dev;
82 struct dev_archdata *sd;
83
84 isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
85 if (!isa_dev) {
86 printk(KERN_DEBUG "ISA: cannot allocate isa_dev");
87 return;
88 }
89
90 sd = &isa_dev->ofdev.dev.archdata;
91 sd->prom_node = dp;
92 sd->op = &isa_dev->ofdev;
93 sd->iommu = isa_br->ofdev.dev.parent->archdata.iommu;
94 sd->stc = isa_br->ofdev.dev.parent->archdata.stc;
95 sd->numa_node = isa_br->ofdev.dev.parent->archdata.numa_node;
96
97 isa_dev->ofdev.node = dp;
98 isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev;
99 isa_dev->ofdev.dev.bus = &isa_bus_type;
100 sprintf(isa_dev->ofdev.dev.bus_id, "isa[%08x]", dp->node);
101
102 /* Register with core */
103 if (of_device_register(&isa_dev->ofdev) != 0) {
104 printk(KERN_DEBUG "isa: device registration error for %s!\n",
105 dp->path_component_name);
106 kfree(isa_dev);
107 goto next_sibling;
108 }
109
110 /* Link it in. */
111 isa_dev->next = NULL;
112 if (isa_br->devices == NULL) {
113 isa_br->devices = isa_dev;
114 } else {
115 struct sparc_isa_device *tmp = isa_br->devices;
116
117 while (tmp->next)
118 tmp = tmp->next;
119
120 tmp->next = isa_dev;
121 }
122
123 isa_dev->bus = isa_br;
124 isa_dev->prom_node = dp;
125
126 isa_dev_get_resource(isa_dev);
127 isa_dev_get_irq(isa_dev);
128
129 report_dev(isa_dev, 0);
130
131 isa_fill_children(isa_dev);
132
133 printk("]");
134
135 next_sibling:
136 dp = dp->sibling;
137 }
138}
139
140void __init isa_init(void)
141{
142 struct pci_dev *pdev;
143 unsigned short vendor, device;
144 int index = 0;
145
146 vendor = PCI_VENDOR_ID_AL;
147 device = PCI_DEVICE_ID_AL_M1533;
148
149 pdev = NULL;
150 while ((pdev = pci_get_device(vendor, device, pdev)) != NULL) {
151 struct sparc_isa_bridge *isa_br;
152 struct device_node *dp;
153
154 dp = pci_device_to_OF_node(pdev);
155
156 isa_br = kzalloc(sizeof(*isa_br), GFP_KERNEL);
157 if (!isa_br) {
158 printk(KERN_DEBUG "isa: cannot allocate sparc_isa_bridge");
159 pci_dev_put(pdev);
160 return;
161 }
162
163 isa_br->ofdev.node = dp;
164 isa_br->ofdev.dev.parent = &pdev->dev;
165 isa_br->ofdev.dev.bus = &isa_bus_type;
166 sprintf(isa_br->ofdev.dev.bus_id, "isa%d", index);
167
168 /* Register with core */
169 if (of_device_register(&isa_br->ofdev) != 0) {
170 printk(KERN_DEBUG "isa: device registration error for %s!\n",
171 dp->path_component_name);
172 kfree(isa_br);
173 pci_dev_put(pdev);
174 return;
175 }
176
177 /* Link it in. */
178 isa_br->next = isa_chain;
179 isa_chain = isa_br;
180
181 isa_br->self = pdev;
182 isa_br->index = index++;
183 isa_br->prom_node = dp;
184
185 printk("isa%d:", isa_br->index);
186
187 isa_fill_devices(isa_br);
188
189 printk("\n");
190 }
191}
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index 9e58e8cba1c3..d569f60c24b8 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -412,12 +412,6 @@ static int __init build_one_resource(struct device_node *parent,
412 412
413static int __init use_1to1_mapping(struct device_node *pp) 413static int __init use_1to1_mapping(struct device_node *pp)
414{ 414{
415 /* If this is on the PMU bus, don't try to translate it even
416 * if a ranges property exists.
417 */
418 if (!strcmp(pp->name, "pmu"))
419 return 1;
420
421 /* If we have a ranges property in the parent, use it. */ 415 /* If we have a ranges property in the parent, use it. */
422 if (of_find_property(pp, "ranges", NULL) != NULL) 416 if (of_find_property(pp, "ranges", NULL) != NULL)
423 return 0; 417 return 0;
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 49f912766519..dbf2fc2f4d87 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -23,7 +23,6 @@
23#include <asm/pgtable.h> 23#include <asm/pgtable.h>
24#include <asm/irq.h> 24#include <asm/irq.h>
25#include <asm/ebus.h> 25#include <asm/ebus.h>
26#include <asm/isa.h>
27#include <asm/prom.h> 26#include <asm/prom.h>
28#include <asm/apb.h> 27#include <asm/apb.h>
29 28
@@ -885,7 +884,6 @@ static int __init pcibios_init(void)
885 884
886 pci_scan_each_controller_bus(); 885 pci_scan_each_controller_bus();
887 886
888 isa_init();
889 ebus_init(); 887 ebus_init();
890 power_init(); 888 power_init();
891 889
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index acf8c5250aa9..056013749157 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -1,5 +1,4 @@
1/* $Id: process.c,v 1.131 2002/02/09 19:49:30 davem Exp $ 1/* arch/sparc64/kernel/process.c
2 * arch/sparc64/kernel/process.c
3 * 2 *
4 * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu)
5 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) 4 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
@@ -368,9 +367,6 @@ void flush_thread(void)
368 367
369 if (get_thread_current_ds() != ASI_AIUS) 368 if (get_thread_current_ds() != ASI_AIUS)
370 set_fs(USER_DS); 369 set_fs(USER_DS);
371
372 /* Init new signal delivery disposition. */
373 clear_thread_flag(TIF_NEWSIGNALS);
374} 370}
375 371
376/* It's a bit more tricky when 64-bit tasks are involved... */ 372/* It's a bit more tricky when 64-bit tasks are involved... */
@@ -595,6 +591,12 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
595 if (clone_flags & CLONE_SETTLS) 591 if (clone_flags & CLONE_SETTLS)
596 t->kregs->u_regs[UREG_G7] = regs->u_regs[UREG_I3]; 592 t->kregs->u_regs[UREG_G7] = regs->u_regs[UREG_I3];
597 593
594 /* We do not want to accidently trigger system call restart
595 * handling in the new thread. Therefore, clear out the trap
596 * type, which will make pt_regs_regs_is_syscall() return false.
597 */
598 pt_regs_clear_trap_type(t->kregs);
599
598 return 0; 600 return 0;
599} 601}
600 602
diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c
index 77a3e8592cbc..f2d88d8f7a42 100644
--- a/arch/sparc64/kernel/signal.c
+++ b/arch/sparc64/kernel/signal.c
@@ -8,7 +8,7 @@
8 * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 8 * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
9 */ 9 */
10 10
11#ifdef CONFIG_SPARC32_COMPAT 11#ifdef CONFIG_COMPAT
12#include <linux/compat.h> /* for compat_old_sigset_t */ 12#include <linux/compat.h> /* for compat_old_sigset_t */
13#endif 13#endif
14#include <linux/sched.h> 14#include <linux/sched.h>
@@ -236,9 +236,6 @@ struct rt_signal_frame {
236 __siginfo_fpu_t fpu_state; 236 __siginfo_fpu_t fpu_state;
237}; 237};
238 238
239/* Align macros */
240#define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame) + 7) & (~7)))
241
242static long _sigpause_common(old_sigset_t set) 239static long _sigpause_common(old_sigset_t set)
243{ 240{
244 set &= _BLOCKABLE; 241 set &= _BLOCKABLE;
@@ -400,7 +397,7 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
400 synchronize_user_stack(); 397 synchronize_user_stack();
401 save_and_clear_fpu(); 398 save_and_clear_fpu();
402 399
403 sigframe_size = RT_ALIGNEDSZ; 400 sigframe_size = sizeof(struct rt_signal_frame);
404 if (!(current_thread_info()->fpsaved[0] & FPRS_FEF)) 401 if (!(current_thread_info()->fpsaved[0] & FPRS_FEF))
405 sigframe_size -= sizeof(__siginfo_fpu_t); 402 sigframe_size -= sizeof(__siginfo_fpu_t);
406 403
@@ -516,11 +513,10 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
516 struct k_sigaction ka; 513 struct k_sigaction ka;
517 sigset_t *oldset; 514 sigset_t *oldset;
518 siginfo_t info; 515 siginfo_t info;
519 int signr, tt; 516 int signr;
520 517
521 tt = regs->magic & 0x1ff; 518 if (pt_regs_is_syscall(regs)) {
522 if (tt == 0x110 || tt == 0x111 || tt == 0x16d) { 519 pt_regs_clear_trap_type(regs);
523 regs->magic &= ~0x1ff;
524 cookie.restart_syscall = 1; 520 cookie.restart_syscall = 1;
525 } else 521 } else
526 cookie.restart_syscall = 0; 522 cookie.restart_syscall = 0;
@@ -531,7 +527,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
531 else 527 else
532 oldset = &current->blocked; 528 oldset = &current->blocked;
533 529
534#ifdef CONFIG_SPARC32_COMPAT 530#ifdef CONFIG_COMPAT
535 if (test_thread_flag(TIF_32BIT)) { 531 if (test_thread_flag(TIF_32BIT)) {
536 extern void do_signal32(sigset_t *, struct pt_regs *, 532 extern void do_signal32(sigset_t *, struct pt_regs *,
537 struct signal_deliver_cookie *); 533 struct signal_deliver_cookie *);
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c
index 43cdec64d9c9..91f8d0826db1 100644
--- a/arch/sparc64/kernel/signal32.c
+++ b/arch/sparc64/kernel/signal32.c
@@ -1,5 +1,4 @@
1/* $Id: signal32.c,v 1.74 2002/02/09 19:49:30 davem Exp $ 1/* arch/sparc64/kernel/signal32.c
2 * arch/sparc64/kernel/signal32.c
3 * 2 *
4 * Copyright (C) 1991, 1992 Linus Torvalds 3 * Copyright (C) 1991, 1992 Linus Torvalds
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -31,30 +30,6 @@
31 30
32#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 31#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
33 32
34/* Signal frames: the original one (compatible with SunOS):
35 *
36 * Set up a signal frame... Make the stack look the way SunOS
37 * expects it to look which is basically:
38 *
39 * ---------------------------------- <-- %sp at signal time
40 * Struct sigcontext
41 * Signal address
42 * Ptr to sigcontext area above
43 * Signal code
44 * The signal number itself
45 * One register window
46 * ---------------------------------- <-- New %sp
47 */
48struct signal_sframe32 {
49 struct reg_window32 sig_window;
50 int sig_num;
51 int sig_code;
52 /* struct sigcontext32 * */ u32 sig_scptr;
53 int sig_address;
54 struct sigcontext32 sig_context;
55 unsigned int extramask[_COMPAT_NSIG_WORDS - 1];
56};
57
58/* This magic should be in g_upper[0] for all upper parts 33/* This magic should be in g_upper[0] for all upper parts
59 * to be valid. 34 * to be valid.
60 */ 35 */
@@ -65,12 +40,7 @@ typedef struct {
65 unsigned int asi; 40 unsigned int asi;
66} siginfo_extra_v8plus_t; 41} siginfo_extra_v8plus_t;
67 42
68/* 43struct signal_frame32 {
69 * And the new one, intended to be used for Linux applications only
70 * (we have enough in there to work with clone).
71 * All the interesting bits are in the info field.
72 */
73struct new_signal_frame32 {
74 struct sparc_stackf32 ss; 44 struct sparc_stackf32 ss;
75 __siginfo32_t info; 45 __siginfo32_t info;
76 /* __siginfo_fpu32_t * */ u32 fpu_save; 46 /* __siginfo_fpu32_t * */ u32 fpu_save;
@@ -149,8 +119,7 @@ struct rt_signal_frame32 {
149}; 119};
150 120
151/* Align macros */ 121/* Align macros */
152#define SF_ALIGNEDSZ (((sizeof(struct signal_sframe32) + 7) & (~7))) 122#define SF_ALIGNEDSZ (((sizeof(struct signal_frame32) + 7) & (~7)))
153#define NF_ALIGNEDSZ (((sizeof(struct new_signal_frame32) + 7) & (~7)))
154#define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 7) & (~7))) 123#define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 7) & (~7)))
155 124
156int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) 125int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
@@ -241,17 +210,22 @@ static int restore_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu
241 return err; 210 return err;
242} 211}
243 212
244void do_new_sigreturn32(struct pt_regs *regs) 213void do_sigreturn32(struct pt_regs *regs)
245{ 214{
246 struct new_signal_frame32 __user *sf; 215 struct signal_frame32 __user *sf;
247 unsigned int psr; 216 unsigned int psr;
248 unsigned pc, npc, fpu_save; 217 unsigned pc, npc, fpu_save;
249 sigset_t set; 218 sigset_t set;
250 unsigned seta[_COMPAT_NSIG_WORDS]; 219 unsigned seta[_COMPAT_NSIG_WORDS];
251 int err, i; 220 int err, i;
252 221
222 /* Always make any pending restarted system calls return -EINTR */
223 current_thread_info()->restart_block.fn = do_no_restart_syscall;
224
225 synchronize_user_stack();
226
253 regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL; 227 regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL;
254 sf = (struct new_signal_frame32 __user *) regs->u_regs[UREG_FP]; 228 sf = (struct signal_frame32 __user *) regs->u_regs[UREG_FP];
255 229
256 /* 1. Make sure we are not getting garbage from the user */ 230 /* 1. Make sure we are not getting garbage from the user */
257 if (!access_ok(VERIFY_READ, sf, sizeof(*sf)) || 231 if (!access_ok(VERIFY_READ, sf, sizeof(*sf)) ||
@@ -319,76 +293,6 @@ segv:
319 force_sig(SIGSEGV, current); 293 force_sig(SIGSEGV, current);
320} 294}
321 295
322asmlinkage void do_sigreturn32(struct pt_regs *regs)
323{
324 struct sigcontext32 __user *scptr;
325 unsigned int pc, npc, psr;
326 sigset_t set;
327 unsigned int seta[_COMPAT_NSIG_WORDS];
328 int err;
329
330 /* Always make any pending restarted system calls return -EINTR */
331 current_thread_info()->restart_block.fn = do_no_restart_syscall;
332
333 synchronize_user_stack();
334 if (test_thread_flag(TIF_NEWSIGNALS)) {
335 do_new_sigreturn32(regs);
336 return;
337 }
338
339 scptr = (struct sigcontext32 __user *)
340 (regs->u_regs[UREG_I0] & 0x00000000ffffffffUL);
341 /* Check sanity of the user arg. */
342 if (!access_ok(VERIFY_READ, scptr, sizeof(struct sigcontext32)) ||
343 (((unsigned long) scptr) & 3))
344 goto segv;
345
346 err = __get_user(pc, &scptr->sigc_pc);
347 err |= __get_user(npc, &scptr->sigc_npc);
348
349 if ((pc | npc) & 3)
350 goto segv; /* Nice try. */
351
352 err |= __get_user(seta[0], &scptr->sigc_mask);
353 /* Note that scptr + 1 points to extramask */
354 err |= copy_from_user(seta+1, scptr + 1,
355 (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned int));
356 if (err)
357 goto segv;
358 switch (_NSIG_WORDS) {
359 case 4: set.sig[3] = seta[6] + (((long)seta[7]) << 32);
360 case 3: set.sig[2] = seta[4] + (((long)seta[5]) << 32);
361 case 2: set.sig[1] = seta[2] + (((long)seta[3]) << 32);
362 case 1: set.sig[0] = seta[0] + (((long)seta[1]) << 32);
363 }
364 sigdelsetmask(&set, ~_BLOCKABLE);
365 spin_lock_irq(&current->sighand->siglock);
366 current->blocked = set;
367 recalc_sigpending();
368 spin_unlock_irq(&current->sighand->siglock);
369
370 if (test_thread_flag(TIF_32BIT)) {
371 pc &= 0xffffffff;
372 npc &= 0xffffffff;
373 }
374 regs->tpc = pc;
375 regs->tnpc = npc;
376 err = __get_user(regs->u_regs[UREG_FP], &scptr->sigc_sp);
377 err |= __get_user(regs->u_regs[UREG_I0], &scptr->sigc_o0);
378 err |= __get_user(regs->u_regs[UREG_G1], &scptr->sigc_g1);
379
380 /* User can only change condition codes in %tstate. */
381 err |= __get_user(psr, &scptr->sigc_psr);
382 if (err)
383 goto segv;
384 regs->tstate &= ~(TSTATE_ICC|TSTATE_XCC);
385 regs->tstate |= psr_to_tstate_icc(psr);
386 return;
387
388segv:
389 force_sig(SIGSEGV, current);
390}
391
392asmlinkage void do_rt_sigreturn32(struct pt_regs *regs) 296asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
393{ 297{
394 struct rt_signal_frame32 __user *sf; 298 struct rt_signal_frame32 __user *sf;
@@ -504,145 +408,6 @@ static void __user *get_sigframe(struct sigaction *sa, struct pt_regs *regs, uns
504 return (void __user *)(sp - framesize); 408 return (void __user *)(sp - framesize);
505} 409}
506 410
507static void
508setup_frame32(struct sigaction *sa, struct pt_regs *regs, int signr, sigset_t *oldset, siginfo_t *info)
509{
510 struct signal_sframe32 __user *sframep;
511 struct sigcontext32 __user *sc;
512 unsigned int seta[_COMPAT_NSIG_WORDS];
513 int err = 0;
514 void __user *sig_address;
515 int sig_code;
516 unsigned long pc = regs->tpc;
517 unsigned long npc = regs->tnpc;
518 unsigned int psr;
519
520 if (test_thread_flag(TIF_32BIT)) {
521 pc &= 0xffffffff;
522 npc &= 0xffffffff;
523 }
524
525 synchronize_user_stack();
526 save_and_clear_fpu();
527
528 sframep = (struct signal_sframe32 __user *)
529 get_sigframe(sa, regs, SF_ALIGNEDSZ);
530 if (invalid_frame_pointer(sframep, sizeof(*sframep))){
531 /* Don't change signal code and address, so that
532 * post mortem debuggers can have a look.
533 */
534 do_exit(SIGILL);
535 }
536
537 sc = &sframep->sig_context;
538
539 /* We've already made sure frame pointer isn't in kernel space... */
540 err = __put_user((sas_ss_flags(regs->u_regs[UREG_FP]) == SS_ONSTACK),
541 &sc->sigc_onstack);
542
543 switch (_NSIG_WORDS) {
544 case 4: seta[7] = (oldset->sig[3] >> 32);
545 seta[6] = oldset->sig[3];
546 case 3: seta[5] = (oldset->sig[2] >> 32);
547 seta[4] = oldset->sig[2];
548 case 2: seta[3] = (oldset->sig[1] >> 32);
549 seta[2] = oldset->sig[1];
550 case 1: seta[1] = (oldset->sig[0] >> 32);
551 seta[0] = oldset->sig[0];
552 }
553 err |= __put_user(seta[0], &sc->sigc_mask);
554 err |= __copy_to_user(sframep->extramask, seta + 1,
555 (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned int));
556 err |= __put_user(regs->u_regs[UREG_FP], &sc->sigc_sp);
557 err |= __put_user(pc, &sc->sigc_pc);
558 err |= __put_user(npc, &sc->sigc_npc);
559 psr = tstate_to_psr(regs->tstate);
560 if (current_thread_info()->fpsaved[0] & FPRS_FEF)
561 psr |= PSR_EF;
562 err |= __put_user(psr, &sc->sigc_psr);
563 err |= __put_user(regs->u_regs[UREG_G1], &sc->sigc_g1);
564 err |= __put_user(regs->u_regs[UREG_I0], &sc->sigc_o0);
565 err |= __put_user(get_thread_wsaved(), &sc->sigc_oswins);
566
567 err |= copy_in_user((u32 __user *)sframep,
568 (u32 __user *)(regs->u_regs[UREG_FP]),
569 sizeof(struct reg_window32));
570
571 set_thread_wsaved(0); /* So process is allowed to execute. */
572 err |= __put_user(signr, &sframep->sig_num);
573 sig_address = NULL;
574 sig_code = 0;
575 if (SI_FROMKERNEL (info) && (info->si_code & __SI_MASK) == __SI_FAULT) {
576 sig_address = info->si_addr;
577 switch (signr) {
578 case SIGSEGV:
579 switch (info->si_code) {
580 case SEGV_MAPERR: sig_code = SUBSIG_NOMAPPING; break;
581 default: sig_code = SUBSIG_PROTECTION; break;
582 }
583 break;
584 case SIGILL:
585 switch (info->si_code) {
586 case ILL_ILLOPC: sig_code = SUBSIG_ILLINST; break;
587 case ILL_PRVOPC: sig_code = SUBSIG_PRIVINST; break;
588 case ILL_ILLTRP: sig_code = SUBSIG_BADTRAP(info->si_trapno); break;
589 default: sig_code = SUBSIG_STACK; break;
590 }
591 break;
592 case SIGFPE:
593 switch (info->si_code) {
594 case FPE_INTDIV: sig_code = SUBSIG_IDIVZERO; break;
595 case FPE_INTOVF: sig_code = SUBSIG_FPINTOVFL; break;
596 case FPE_FLTDIV: sig_code = SUBSIG_FPDIVZERO; break;
597 case FPE_FLTOVF: sig_code = SUBSIG_FPOVFLOW; break;
598 case FPE_FLTUND: sig_code = SUBSIG_FPUNFLOW; break;
599 case FPE_FLTRES: sig_code = SUBSIG_FPINEXACT; break;
600 case FPE_FLTINV: sig_code = SUBSIG_FPOPERROR; break;
601 default: sig_code = SUBSIG_FPERROR; break;
602 }
603 break;
604 case SIGBUS:
605 switch (info->si_code) {
606 case BUS_ADRALN: sig_code = SUBSIG_ALIGNMENT; break;
607 case BUS_ADRERR: sig_code = SUBSIG_MISCERROR; break;
608 default: sig_code = SUBSIG_BUSTIMEOUT; break;
609 }
610 break;
611 case SIGEMT:
612 switch (info->si_code) {
613 case EMT_TAGOVF: sig_code = SUBSIG_TAG; break;
614 }
615 break;
616 case SIGSYS:
617 if (info->si_code == (__SI_FAULT|0x100)) {
618 /* See sys_sunos32.c */
619 sig_code = info->si_trapno;
620 break;
621 }
622 default:
623 sig_address = NULL;
624 }
625 }
626 err |= __put_user(ptr_to_compat(sig_address), &sframep->sig_address);
627 err |= __put_user(sig_code, &sframep->sig_code);
628 err |= __put_user(ptr_to_compat(sc), &sframep->sig_scptr);
629 if (err)
630 goto sigsegv;
631
632 regs->u_regs[UREG_FP] = (unsigned long) sframep;
633 regs->tpc = (unsigned long) sa->sa_handler;
634 regs->tnpc = (regs->tpc + 4);
635 if (test_thread_flag(TIF_32BIT)) {
636 regs->tpc &= 0xffffffff;
637 regs->tnpc &= 0xffffffff;
638 }
639 return;
640
641sigsegv:
642 force_sigsegv(signr, current);
643}
644
645
646static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) 411static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
647{ 412{
648 unsigned long *fpregs = current_thread_info()->fpregs; 413 unsigned long *fpregs = current_thread_info()->fpregs;
@@ -663,10 +428,10 @@ static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
663 return err; 428 return err;
664} 429}
665 430
666static void new_setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, 431static void setup_frame32(struct k_sigaction *ka, struct pt_regs *regs,
667 int signo, sigset_t *oldset) 432 int signo, sigset_t *oldset)
668{ 433{
669 struct new_signal_frame32 __user *sf; 434 struct signal_frame32 __user *sf;
670 int sigframe_size; 435 int sigframe_size;
671 u32 psr; 436 u32 psr;
672 int i, err; 437 int i, err;
@@ -676,11 +441,11 @@ static void new_setup_frame32(struct k_sigaction *ka, struct pt_regs *regs,
676 synchronize_user_stack(); 441 synchronize_user_stack();
677 save_and_clear_fpu(); 442 save_and_clear_fpu();
678 443
679 sigframe_size = NF_ALIGNEDSZ; 444 sigframe_size = SF_ALIGNEDSZ;
680 if (!(current_thread_info()->fpsaved[0] & FPRS_FEF)) 445 if (!(current_thread_info()->fpsaved[0] & FPRS_FEF))
681 sigframe_size -= sizeof(__siginfo_fpu_t); 446 sigframe_size -= sizeof(__siginfo_fpu_t);
682 447
683 sf = (struct new_signal_frame32 __user *) 448 sf = (struct signal_frame32 __user *)
684 get_sigframe(&ka->sa, regs, sigframe_size); 449 get_sigframe(&ka->sa, regs, sigframe_size);
685 450
686 if (invalid_frame_pointer(sf, sigframe_size)) 451 if (invalid_frame_pointer(sf, sigframe_size))
@@ -944,10 +709,9 @@ static inline void handle_signal32(unsigned long signr, struct k_sigaction *ka,
944{ 709{
945 if (ka->sa.sa_flags & SA_SIGINFO) 710 if (ka->sa.sa_flags & SA_SIGINFO)
946 setup_rt_frame32(ka, regs, signr, oldset, info); 711 setup_rt_frame32(ka, regs, signr, oldset, info);
947 else if (test_thread_flag(TIF_NEWSIGNALS))
948 new_setup_frame32(ka, regs, signr, oldset);
949 else 712 else
950 setup_frame32(&ka->sa, regs, signr, oldset, info); 713 setup_frame32(ka, regs, signr, oldset);
714
951 spin_lock_irq(&current->sighand->siglock); 715 spin_lock_irq(&current->sighand->siglock);
952 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 716 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
953 if (!(ka->sa.sa_flags & SA_NOMASK)) 717 if (!(ka->sa.sa_flags & SA_NOMASK))
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index 66336590e830..8ac0b99f2c55 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -49,7 +49,6 @@
49#endif 49#endif
50#ifdef CONFIG_PCI 50#ifdef CONFIG_PCI
51#include <asm/ebus.h> 51#include <asm/ebus.h>
52#include <asm/isa.h>
53#endif 52#endif
54#include <asm/ns87303.h> 53#include <asm/ns87303.h>
55#include <asm/timer.h> 54#include <asm/timer.h>
@@ -187,7 +186,6 @@ EXPORT_SYMBOL(insw);
187EXPORT_SYMBOL(insl); 186EXPORT_SYMBOL(insl);
188#ifdef CONFIG_PCI 187#ifdef CONFIG_PCI
189EXPORT_SYMBOL(ebus_chain); 188EXPORT_SYMBOL(ebus_chain);
190EXPORT_SYMBOL(isa_chain);
191EXPORT_SYMBOL(pci_alloc_consistent); 189EXPORT_SYMBOL(pci_alloc_consistent);
192EXPORT_SYMBOL(pci_free_consistent); 190EXPORT_SYMBOL(pci_free_consistent);
193EXPORT_SYMBOL(pci_map_single); 191EXPORT_SYMBOL(pci_map_single);
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index c1a61e98899a..161ce4710fe7 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -554,10 +554,8 @@ asmlinkage long compat_sys_sigaction(int sig, struct old_sigaction32 __user *act
554 struct k_sigaction new_ka, old_ka; 554 struct k_sigaction new_ka, old_ka;
555 int ret; 555 int ret;
556 556
557 if (sig < 0) { 557 WARN_ON_ONCE(sig >= 0);
558 set_thread_flag(TIF_NEWSIGNALS); 558 sig = -sig;
559 sig = -sig;
560 }
561 559
562 if (act) { 560 if (act) {
563 compat_old_sigset_t mask; 561 compat_old_sigset_t mask;
@@ -601,11 +599,6 @@ asmlinkage long compat_sys_rt_sigaction(int sig,
601 if (sigsetsize != sizeof(compat_sigset_t)) 599 if (sigsetsize != sizeof(compat_sigset_t))
602 return -EINVAL; 600 return -EINVAL;
603 601
604 /* All tasks which use RT signals (effectively) use
605 * new style signals.
606 */
607 set_thread_flag(TIF_NEWSIGNALS);
608
609 if (act) { 602 if (act) {
610 u32 u_handler, u_restorer; 603 u32 u_handler, u_restorer;
611 604