aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/osf_sys.c7
-rw-r--r--arch/alpha/kernel/sys_dp264.c41
-rw-r--r--arch/arm/boot/compressed/ofw-shark.c2
-rw-r--r--arch/arm/common/locomo.c2
-rw-r--r--arch/arm/configs/enp2611_defconfig182
-rw-r--r--arch/arm/configs/ixdp2400_defconfig182
-rw-r--r--arch/arm/configs/ixdp2401_defconfig182
-rw-r--r--arch/arm/configs/ixdp2800_defconfig182
-rw-r--r--arch/arm/configs/ixdp2801_defconfig182
-rw-r--r--arch/arm/kernel/semaphore.c2
-rw-r--r--arch/arm/kernel/traps.c3
-rw-r--r--arch/arm/kernel/vmlinux.lds.S8
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c6
-rw-r--r--arch/arm/mach-pxa/corgi.c57
-rw-r--r--arch/arm/mach-pxa/lubbock.c6
-rw-r--r--arch/arm/mach-pxa/poodle.c113
-rw-r--r--arch/arm/mach-s3c2410/mach-anubis.c3
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c3
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c7
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c6
-rw-r--r--arch/arm/mach-s3c2410/mach-nexcoder.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-otom.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-rx3715.c5
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2410.c5
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2440.c5
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c3
-rw-r--r--arch/arm/mach-sa1100/collie.c11
-rw-r--r--arch/arm/mach-sa1100/generic.h3
-rw-r--r--arch/arm/mm/fault.c12
-rw-r--r--arch/arm/mm/proc-arm1020.S2
-rw-r--r--arch/arm/mm/proc-arm1020e.S2
-rw-r--r--arch/arm/mm/proc-arm1022.S2
-rw-r--r--arch/arm/mm/proc-arm1026.S2
-rw-r--r--arch/arm/mm/proc-arm6_7.S2
-rw-r--r--arch/arm/mm/proc-arm720.S2
-rw-r--r--arch/arm/mm/proc-arm920.S2
-rw-r--r--arch/arm/mm/proc-arm922.S2
-rw-r--r--arch/arm/mm/proc-arm925.S2
-rw-r--r--arch/arm/mm/proc-arm926.S2
-rw-r--r--arch/arm/mm/proc-sa110.S2
-rw-r--r--arch/arm/mm/proc-sa1100.S2
-rw-r--r--arch/arm/mm/proc-v6.S2
-rw-r--r--arch/arm/mm/proc-xscale.S2
-rw-r--r--arch/arm26/boot/compressed/hw-bse.c74
-rw-r--r--arch/i386/Kconfig5
-rw-r--r--arch/i386/kernel/acpi/earlyquirk.c10
-rw-r--r--arch/i386/lib/Makefile1
-rw-r--r--arch/i386/lib/dec_and_lock.c42
-rw-r--r--arch/ia64/Kconfig5
-rw-r--r--arch/ia64/Makefile12
-rw-r--r--arch/ia64/ia32/binfmt_elf32.c6
-rw-r--r--arch/ia64/kernel/acpi.c2
-rw-r--r--arch/ia64/kernel/asm-offsets.c1
-rw-r--r--arch/ia64/kernel/entry.S2
-rw-r--r--arch/ia64/kernel/mca_drv.c114
-rw-r--r--arch/ia64/kernel/mca_drv.h2
-rw-r--r--arch/ia64/kernel/mca_drv_asm.S48
-rw-r--r--arch/ia64/kernel/perfmon.c5
-rw-r--r--arch/ia64/lib/Makefile1
-rw-r--r--arch/ia64/lib/dec_and_lock.c42
-rw-r--r--arch/m32r/Kconfig5
-rw-r--r--arch/mips/Kconfig4
-rw-r--r--arch/mips/kernel/sysirix.c9
-rw-r--r--arch/mips/lib/Makefile2
-rw-r--r--arch/mips/lib/dec_and_lock.c47
-rw-r--r--arch/ppc/Kconfig4
-rw-r--r--arch/ppc/lib/Makefile2
-rw-r--r--arch/ppc/lib/dec_and_lock.c38
-rw-r--r--arch/ppc/syslib/Makefile3
-rw-r--r--arch/ppc/syslib/mpc8xx_devices.c224
-rw-r--r--arch/ppc/syslib/mpc8xx_sys.c61
-rw-r--r--arch/ppc/syslib/open_pic2.c2
-rw-r--r--arch/ppc64/Kconfig4
-rw-r--r--arch/ppc64/Makefile2
-rw-r--r--arch/ppc64/kernel/head.S6
-rw-r--r--arch/ppc64/kernel/pSeries_iommu.c169
-rw-r--r--arch/ppc64/kernel/pci.c9
-rw-r--r--arch/ppc64/kernel/prom_init.c3
-rw-r--r--arch/ppc64/kernel/vdso.c15
-rw-r--r--arch/ppc64/lib/Makefile2
-rw-r--r--arch/ppc64/lib/dec_and_lock.c47
-rw-r--r--arch/ppc64/mm/fault.c1
-rw-r--r--arch/s390/defconfig36
-rw-r--r--arch/s390/kernel/Makefile2
-rw-r--r--arch/s390/kernel/entry.S2
-rw-r--r--arch/s390/kernel/entry64.S2
-rw-r--r--arch/s390/kernel/reipl_diag.c39
-rw-r--r--arch/s390/kernel/setup.c5
-rw-r--r--arch/s390/kernel/smp.c3
-rw-r--r--arch/sparc64/Kconfig.debug8
-rw-r--r--arch/sparc64/kernel/entry.S39
-rw-r--r--arch/sparc64/kernel/ptrace.c7
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c3
-rw-r--r--arch/sparc64/kernel/una_asm.S2
-rw-r--r--arch/sparc64/kernel/unaligned.c64
-rw-r--r--arch/sparc64/lib/Makefile2
-rw-r--r--arch/sparc64/lib/dec_and_lock.S80
-rw-r--r--arch/um/Kconfig.i3864
-rw-r--r--arch/um/Makefile6
-rw-r--r--arch/um/drivers/mcast_user.c12
-rw-r--r--arch/um/drivers/mconsole_kern.c52
-rw-r--r--arch/um/drivers/mconsole_user.c7
-rw-r--r--arch/um/drivers/pty.c3
-rw-r--r--arch/um/drivers/ubd_user.c75
-rw-r--r--arch/um/drivers/xterm.c6
-rw-r--r--arch/um/include/common-offsets.h4
-rw-r--r--arch/um/include/mconsole.h1
-rw-r--r--arch/um/include/mem_user.h15
-rw-r--r--arch/um/include/os.h5
-rw-r--r--arch/um/kernel/Makefile16
-rw-r--r--arch/um/kernel/helper.c12
-rw-r--r--arch/um/kernel/init_task.c5
-rw-r--r--arch/um/kernel/mem.c16
-rw-r--r--arch/um/kernel/mem_user.c273
-rw-r--r--arch/um/kernel/process_kern.c19
-rw-r--r--arch/um/kernel/skas/include/mode_kern-skas.h2
-rw-r--r--arch/um/kernel/skas/include/uaccess-skas.h6
-rw-r--r--arch/um/kernel/skas/process_kern.c7
-rw-r--r--arch/um/kernel/tempfile.c82
-rw-r--r--arch/um/kernel/tlb.c2
-rw-r--r--arch/um/kernel/tt/include/mode_kern-tt.h2
-rw-r--r--arch/um/kernel/tt/include/uaccess-tt.h6
-rw-r--r--arch/um/kernel/tt/mem_user.c1
-rw-r--r--arch/um/kernel/tt/process_kern.c8
-rw-r--r--arch/um/kernel/um_arch.c5
-rw-r--r--arch/um/kernel/user_util.c18
-rw-r--r--arch/um/os-Linux/Makefile8
-rw-r--r--arch/um/os-Linux/aio.c10
-rw-r--r--arch/um/os-Linux/drivers/tuntap_user.c8
-rw-r--r--arch/um/os-Linux/elf_aux.c6
-rw-r--r--arch/um/os-Linux/file.c82
-rw-r--r--arch/um/os-Linux/mem.c161
-rw-r--r--arch/um/os-Linux/process.c1
-rw-r--r--arch/um/os-Linux/start_up.c109
-rw-r--r--arch/um/os-Linux/tt.c14
-rw-r--r--arch/um/sys-i386/ldt.c1
-rw-r--r--arch/x86_64/Kconfig7
-rw-r--r--arch/x86_64/ia32/ia32_binfmt.c5
-rw-r--r--arch/x86_64/ia32/syscall32.c6
-rw-r--r--arch/x86_64/kernel/e820.c2
-rw-r--r--arch/x86_64/kernel/io_apic.c9
-rw-r--r--arch/x86_64/kernel/setup.c15
-rw-r--r--arch/x86_64/kernel/x8664_ksyms.c4
-rw-r--r--arch/x86_64/lib/Makefile2
-rw-r--r--arch/x86_64/lib/dec_and_lock.c40
-rw-r--r--arch/xtensa/Kconfig4
146 files changed, 1848 insertions, 1893 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 0636116210d2..01fe990d3e54 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -37,6 +37,7 @@
37#include <linux/namei.h> 37#include <linux/namei.h>
38#include <linux/uio.h> 38#include <linux/uio.h>
39#include <linux/vfs.h> 39#include <linux/vfs.h>
40#include <linux/rcupdate.h>
40 41
41#include <asm/fpu.h> 42#include <asm/fpu.h>
42#include <asm/io.h> 43#include <asm/io.h>
@@ -975,6 +976,7 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
975 long timeout; 976 long timeout;
976 int ret = -EINVAL; 977 int ret = -EINVAL;
977 struct fdtable *fdt; 978 struct fdtable *fdt;
979 int max_fdset;
978 980
979 timeout = MAX_SCHEDULE_TIMEOUT; 981 timeout = MAX_SCHEDULE_TIMEOUT;
980 if (tvp) { 982 if (tvp) {
@@ -996,8 +998,11 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
996 } 998 }
997 } 999 }
998 1000
1001 rcu_read_lock();
999 fdt = files_fdtable(current->files); 1002 fdt = files_fdtable(current->files);
1000 if (n < 0 || n > fdt->max_fdset) 1003 max_fdset = fdt->max_fdset;
1004 rcu_read_unlock();
1005 if (n < 0 || n > max_fdset)
1001 goto out_nofds; 1006 goto out_nofds;
1002 1007
1003 /* 1008 /*
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c
index 9e36b07fa940..d5da6b1b28ee 100644
--- a/arch/alpha/kernel/sys_dp264.c
+++ b/arch/alpha/kernel/sys_dp264.c
@@ -395,6 +395,22 @@ clipper_init_irq(void)
395 */ 395 */
396 396
397static int __init 397static int __init
398isa_irq_fixup(struct pci_dev *dev, int irq)
399{
400 u8 irq8;
401
402 if (irq > 0)
403 return irq;
404
405 /* This interrupt is routed via ISA bridge, so we'll
406 just have to trust whatever value the console might
407 have assigned. */
408 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq8);
409
410 return irq8 & 0xf;
411}
412
413static int __init
398dp264_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 414dp264_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
399{ 415{
400 static char irq_tab[6][5] __initdata = { 416 static char irq_tab[6][5] __initdata = {
@@ -407,25 +423,13 @@ dp264_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
407 { 16+ 3, 16+ 3, 16+ 2, 16+ 1, 16+ 0} /* IdSel 10 slot 3 */ 423 { 16+ 3, 16+ 3, 16+ 2, 16+ 1, 16+ 0} /* IdSel 10 slot 3 */
408 }; 424 };
409 const long min_idsel = 5, max_idsel = 10, irqs_per_slot = 5; 425 const long min_idsel = 5, max_idsel = 10, irqs_per_slot = 5;
410
411 struct pci_controller *hose = dev->sysdata; 426 struct pci_controller *hose = dev->sysdata;
412 int irq = COMMON_TABLE_LOOKUP; 427 int irq = COMMON_TABLE_LOOKUP;
413 428
414 if (irq > 0) { 429 if (irq > 0)
415 irq += 16 * hose->index; 430 irq += 16 * hose->index;
416 } else {
417 /* ??? The Contaq IDE controller on the ISA bridge uses
418 "legacy" interrupts 14 and 15. I don't know if anything
419 can wind up at the same slot+pin on hose1, so we'll
420 just have to trust whatever value the console might
421 have assigned. */
422
423 u8 irq8;
424 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq8);
425 irq = irq8;
426 }
427 431
428 return irq; 432 return isa_irq_fixup(dev, irq);
429} 433}
430 434
431static int __init 435static int __init
@@ -453,7 +457,8 @@ monet_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
453 { 24, 24, 25, 26, 27} /* IdSel 15 slot 5 PCI2*/ 457 { 24, 24, 25, 26, 27} /* IdSel 15 slot 5 PCI2*/
454 }; 458 };
455 const long min_idsel = 3, max_idsel = 15, irqs_per_slot = 5; 459 const long min_idsel = 3, max_idsel = 15, irqs_per_slot = 5;
456 return COMMON_TABLE_LOOKUP; 460
461 return isa_irq_fixup(dev, COMMON_TABLE_LOOKUP);
457} 462}
458 463
459static u8 __init 464static u8 __init
@@ -507,7 +512,8 @@ webbrick_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
507 { 47, 47, 46, 45, 44}, /* IdSel 17 slot 3 */ 512 { 47, 47, 46, 45, 44}, /* IdSel 17 slot 3 */
508 }; 513 };
509 const long min_idsel = 7, max_idsel = 17, irqs_per_slot = 5; 514 const long min_idsel = 7, max_idsel = 17, irqs_per_slot = 5;
510 return COMMON_TABLE_LOOKUP; 515
516 return isa_irq_fixup(dev, COMMON_TABLE_LOOKUP);
511} 517}
512 518
513static int __init 519static int __init
@@ -524,14 +530,13 @@ clipper_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
524 { -1, -1, -1, -1, -1} /* IdSel 7 ISA Bridge */ 530 { -1, -1, -1, -1, -1} /* IdSel 7 ISA Bridge */
525 }; 531 };
526 const long min_idsel = 1, max_idsel = 7, irqs_per_slot = 5; 532 const long min_idsel = 1, max_idsel = 7, irqs_per_slot = 5;
527
528 struct pci_controller *hose = dev->sysdata; 533 struct pci_controller *hose = dev->sysdata;
529 int irq = COMMON_TABLE_LOOKUP; 534 int irq = COMMON_TABLE_LOOKUP;
530 535
531 if (irq > 0) 536 if (irq > 0)
532 irq += 16 * hose->index; 537 irq += 16 * hose->index;
533 538
534 return irq; 539 return isa_irq_fixup(dev, irq);
535} 540}
536 541
537static void __init 542static void __init
diff --git a/arch/arm/boot/compressed/ofw-shark.c b/arch/arm/boot/compressed/ofw-shark.c
index 7f6f5db0d060..465c54b6b128 100644
--- a/arch/arm/boot/compressed/ofw-shark.c
+++ b/arch/arm/boot/compressed/ofw-shark.c
@@ -256,5 +256,5 @@ asmlinkage void ofw_init(ofw_handle_t o, int *nomr, int *pointer)
256 temp[11]='\0'; 256 temp[11]='\0';
257 mem_len = OF_getproplen(o,phandle, temp); 257 mem_len = OF_getproplen(o,phandle, temp);
258 OF_getprop(o,phandle, temp, buffer, mem_len); 258 OF_getprop(o,phandle, temp, buffer, mem_len);
259 (unsigned char) pointer[32] = ((unsigned char *) buffer)[mem_len-2]; 259 * ((unsigned char *) &pointer[32]) = ((unsigned char *) buffer)[mem_len-2];
260} 260}
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index 2786f7c34b3f..a7bd85700152 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -551,7 +551,7 @@ struct locomo_save_data {
551 u16 LCM_SPIMD; 551 u16 LCM_SPIMD;
552}; 552};
553 553
554static int locomo_suspend(struct device *dev, u32 pm_message_t, u32 level) 554static int locomo_suspend(struct device *dev, pm_message_t state, u32 level)
555{ 555{
556 struct locomo *lchip = dev_get_drvdata(dev); 556 struct locomo *lchip = dev_get_drvdata(dev);
557 struct locomo_save_data *save; 557 struct locomo_save_data *save;
diff --git a/arch/arm/configs/enp2611_defconfig b/arch/arm/configs/enp2611_defconfig
index f67ca01b4982..30e6444f9aaa 100644
--- a/arch/arm/configs/enp2611_defconfig
+++ b/arch/arm/configs/enp2611_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.13-rc2 3# Linux kernel version: 2.6.13
4# Thu Jul 7 16:41:21 2005 4# Wed Sep 14 10:51:52 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -135,7 +135,6 @@ CONFIG_PCI_NAMES=y
135# 135#
136# Kernel Features 136# Kernel Features
137# 137#
138# CONFIG_SMP is not set
139# CONFIG_PREEMPT is not set 138# CONFIG_PREEMPT is not set
140# CONFIG_NO_IDLE_HZ is not set 139# CONFIG_NO_IDLE_HZ is not set
141# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 140# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
@@ -179,6 +178,68 @@ CONFIG_BINFMT_ELF=y
179# CONFIG_PM is not set 178# CONFIG_PM is not set
180 179
181# 180#
181# Networking
182#
183CONFIG_NET=y
184
185#
186# Networking options
187#
188CONFIG_PACKET=y
189CONFIG_PACKET_MMAP=y
190CONFIG_UNIX=y
191# CONFIG_NET_KEY is not set
192CONFIG_INET=y
193# CONFIG_IP_MULTICAST is not set
194# CONFIG_IP_ADVANCED_ROUTER is not set
195CONFIG_IP_FIB_HASH=y
196CONFIG_IP_PNP=y
197CONFIG_IP_PNP_DHCP=y
198CONFIG_IP_PNP_BOOTP=y
199# CONFIG_IP_PNP_RARP is not set
200# CONFIG_NET_IPIP is not set
201# CONFIG_NET_IPGRE is not set
202# CONFIG_ARPD is not set
203CONFIG_SYN_COOKIES=y
204# CONFIG_INET_AH is not set
205# CONFIG_INET_ESP is not set
206# CONFIG_INET_IPCOMP is not set
207# CONFIG_INET_TUNNEL is not set
208# CONFIG_IP_TCPDIAG is not set
209# CONFIG_IP_TCPDIAG_IPV6 is not set
210# CONFIG_TCP_CONG_ADVANCED is not set
211CONFIG_TCP_CONG_BIC=y
212# CONFIG_IPV6 is not set
213# CONFIG_NETFILTER is not set
214
215#
216# SCTP Configuration (EXPERIMENTAL)
217#
218# CONFIG_IP_SCTP is not set
219# CONFIG_ATM is not set
220# CONFIG_BRIDGE is not set
221# CONFIG_VLAN_8021Q is not set
222# CONFIG_DECNET is not set
223# CONFIG_LLC2 is not set
224# CONFIG_IPX is not set
225# CONFIG_ATALK is not set
226# CONFIG_X25 is not set
227# CONFIG_LAPB is not set
228# CONFIG_NET_DIVERT is not set
229# CONFIG_ECONET is not set
230# CONFIG_WAN_ROUTER is not set
231# CONFIG_NET_SCHED is not set
232# CONFIG_NET_CLS_ROUTE is not set
233
234#
235# Network testing
236#
237# CONFIG_NET_PKTGEN is not set
238# CONFIG_HAMRADIO is not set
239# CONFIG_IRDA is not set
240# CONFIG_BT is not set
241
242#
182# Device Drivers 243# Device Drivers
183# 244#
184 245
@@ -248,6 +309,7 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
248CONFIG_MTD_IXP2000=y 309CONFIG_MTD_IXP2000=y
249# CONFIG_MTD_EDB7312 is not set 310# CONFIG_MTD_EDB7312 is not set
250# CONFIG_MTD_PCI is not set 311# CONFIG_MTD_PCI is not set
312# CONFIG_MTD_PLATRAM is not set
251 313
252# 314#
253# Self-contained MTD device drivers 315# Self-contained MTD device drivers
@@ -334,72 +396,8 @@ CONFIG_IOSCHED_CFQ=y
334# CONFIG_I2O is not set 396# CONFIG_I2O is not set
335 397
336# 398#
337# Networking support 399# Network device support
338#
339CONFIG_NET=y
340
341#
342# Networking options
343#
344CONFIG_PACKET=y
345CONFIG_PACKET_MMAP=y
346CONFIG_UNIX=y
347# CONFIG_NET_KEY is not set
348CONFIG_INET=y
349# CONFIG_IP_MULTICAST is not set
350# CONFIG_IP_ADVANCED_ROUTER is not set
351CONFIG_IP_FIB_HASH=y
352CONFIG_IP_PNP=y
353CONFIG_IP_PNP_DHCP=y
354CONFIG_IP_PNP_BOOTP=y
355# CONFIG_IP_PNP_RARP is not set
356# CONFIG_NET_IPIP is not set
357# CONFIG_NET_IPGRE is not set
358# CONFIG_ARPD is not set
359CONFIG_SYN_COOKIES=y
360# CONFIG_INET_AH is not set
361# CONFIG_INET_ESP is not set
362# CONFIG_INET_IPCOMP is not set
363# CONFIG_INET_TUNNEL is not set
364# CONFIG_IP_TCPDIAG is not set
365# CONFIG_IP_TCPDIAG_IPV6 is not set
366# CONFIG_TCP_CONG_ADVANCED is not set
367CONFIG_TCP_CONG_BIC=y
368# CONFIG_IPV6 is not set
369# CONFIG_NETFILTER is not set
370
371#
372# SCTP Configuration (EXPERIMENTAL)
373#
374# CONFIG_IP_SCTP is not set
375# CONFIG_ATM is not set
376# CONFIG_BRIDGE is not set
377# CONFIG_VLAN_8021Q is not set
378# CONFIG_DECNET is not set
379# CONFIG_LLC2 is not set
380# CONFIG_IPX is not set
381# CONFIG_ATALK is not set
382# CONFIG_X25 is not set
383# CONFIG_LAPB is not set
384# CONFIG_NET_DIVERT is not set
385# CONFIG_ECONET is not set
386# CONFIG_WAN_ROUTER is not set
387
388#
389# QoS and/or fair queueing
390#
391# CONFIG_NET_SCHED is not set
392# CONFIG_NET_CLS_ROUTE is not set
393
394#
395# Network testing
396# 400#
397# CONFIG_NET_PKTGEN is not set
398# CONFIG_NETPOLL is not set
399# CONFIG_NET_POLL_CONTROLLER is not set
400# CONFIG_HAMRADIO is not set
401# CONFIG_IRDA is not set
402# CONFIG_BT is not set
403CONFIG_NETDEVICES=y 401CONFIG_NETDEVICES=y
404CONFIG_DUMMY=y 402CONFIG_DUMMY=y
405# CONFIG_BONDING is not set 403# CONFIG_BONDING is not set
@@ -509,6 +507,8 @@ CONFIG_DLCI_MAX=8
509# CONFIG_SLIP is not set 507# CONFIG_SLIP is not set
510# CONFIG_SHAPER is not set 508# CONFIG_SHAPER is not set
511# CONFIG_NETCONSOLE is not set 509# CONFIG_NETCONSOLE is not set
510# CONFIG_NETPOLL is not set
511# CONFIG_NET_POLL_CONTROLLER is not set
512 512
513# 513#
514# ISDN subsystem 514# ISDN subsystem
@@ -635,7 +635,7 @@ CONFIG_I2C_ALGOBIT=y
635# CONFIG_I2C_I810 is not set 635# CONFIG_I2C_I810 is not set
636# CONFIG_I2C_PIIX4 is not set 636# CONFIG_I2C_PIIX4 is not set
637# CONFIG_I2C_ISA is not set 637# CONFIG_I2C_ISA is not set
638# CONFIG_I2C_IXP2000 is not set 638CONFIG_I2C_IXP2000=y
639# CONFIG_I2C_NFORCE2 is not set 639# CONFIG_I2C_NFORCE2 is not set
640# CONFIG_I2C_PARPORT_LIGHT is not set 640# CONFIG_I2C_PARPORT_LIGHT is not set
641# CONFIG_I2C_PROSAVAGE is not set 641# CONFIG_I2C_PROSAVAGE is not set
@@ -649,11 +649,28 @@ CONFIG_I2C_ALGOBIT=y
649# CONFIG_I2C_VIAPRO is not set 649# CONFIG_I2C_VIAPRO is not set
650# CONFIG_I2C_VOODOO3 is not set 650# CONFIG_I2C_VOODOO3 is not set
651# CONFIG_I2C_PCA_ISA is not set 651# CONFIG_I2C_PCA_ISA is not set
652CONFIG_I2C_SENSOR=y
652 653
653# 654#
654# Hardware Sensors Chip support 655# Miscellaneous I2C Chip support
655# 656#
656CONFIG_I2C_SENSOR=y 657# CONFIG_SENSORS_DS1337 is not set
658# CONFIG_SENSORS_DS1374 is not set
659CONFIG_SENSORS_EEPROM=y
660# CONFIG_SENSORS_PCF8574 is not set
661# CONFIG_SENSORS_PCA9539 is not set
662# CONFIG_SENSORS_PCF8591 is not set
663# CONFIG_SENSORS_RTC8564 is not set
664# CONFIG_SENSORS_MAX6875 is not set
665# CONFIG_I2C_DEBUG_CORE is not set
666# CONFIG_I2C_DEBUG_ALGO is not set
667# CONFIG_I2C_DEBUG_BUS is not set
668# CONFIG_I2C_DEBUG_CHIP is not set
669
670#
671# Hardware Monitoring support
672#
673CONFIG_HWMON=y
657# CONFIG_SENSORS_ADM1021 is not set 674# CONFIG_SENSORS_ADM1021 is not set
658# CONFIG_SENSORS_ADM1025 is not set 675# CONFIG_SENSORS_ADM1025 is not set
659# CONFIG_SENSORS_ADM1026 is not set 676# CONFIG_SENSORS_ADM1026 is not set
@@ -679,30 +696,15 @@ CONFIG_I2C_SENSOR=y
679# CONFIG_SENSORS_LM92 is not set 696# CONFIG_SENSORS_LM92 is not set
680# CONFIG_SENSORS_MAX1619 is not set 697# CONFIG_SENSORS_MAX1619 is not set
681# CONFIG_SENSORS_PC87360 is not set 698# CONFIG_SENSORS_PC87360 is not set
682# CONFIG_SENSORS_SMSC47B397 is not set
683# CONFIG_SENSORS_SIS5595 is not set 699# CONFIG_SENSORS_SIS5595 is not set
684# CONFIG_SENSORS_SMSC47M1 is not set 700# CONFIG_SENSORS_SMSC47M1 is not set
701# CONFIG_SENSORS_SMSC47B397 is not set
685# CONFIG_SENSORS_VIA686A is not set 702# CONFIG_SENSORS_VIA686A is not set
686# CONFIG_SENSORS_W83781D is not set 703# CONFIG_SENSORS_W83781D is not set
687# CONFIG_SENSORS_W83L785TS is not set 704# CONFIG_SENSORS_W83L785TS is not set
688# CONFIG_SENSORS_W83627HF is not set 705# CONFIG_SENSORS_W83627HF is not set
689# CONFIG_SENSORS_W83627EHF is not set 706# CONFIG_SENSORS_W83627EHF is not set
690 707# CONFIG_HWMON_DEBUG_CHIP is not set
691#
692# Other I2C Chip support
693#
694# CONFIG_SENSORS_DS1337 is not set
695# CONFIG_SENSORS_DS1374 is not set
696CONFIG_SENSORS_EEPROM=y
697# CONFIG_SENSORS_PCF8574 is not set
698# CONFIG_SENSORS_PCA9539 is not set
699# CONFIG_SENSORS_PCF8591 is not set
700# CONFIG_SENSORS_RTC8564 is not set
701# CONFIG_SENSORS_MAX6875 is not set
702# CONFIG_I2C_DEBUG_CORE is not set
703# CONFIG_I2C_DEBUG_ALGO is not set
704# CONFIG_I2C_DEBUG_BUS is not set
705# CONFIG_I2C_DEBUG_CHIP is not set
706 708
707# 709#
708# Misc devices 710# Misc devices
@@ -770,6 +772,7 @@ CONFIG_FS_POSIX_ACL=y
770# CONFIG_XFS_FS is not set 772# CONFIG_XFS_FS is not set
771# CONFIG_MINIX_FS is not set 773# CONFIG_MINIX_FS is not set
772# CONFIG_ROMFS_FS is not set 774# CONFIG_ROMFS_FS is not set
775CONFIG_INOTIFY=y
773# CONFIG_QUOTA is not set 776# CONFIG_QUOTA is not set
774CONFIG_DNOTIFY=y 777CONFIG_DNOTIFY=y
775# CONFIG_AUTOFS_FS is not set 778# CONFIG_AUTOFS_FS is not set
@@ -812,8 +815,7 @@ CONFIG_RAMFS=y
812# CONFIG_JFFS_FS is not set 815# CONFIG_JFFS_FS is not set
813CONFIG_JFFS2_FS=y 816CONFIG_JFFS2_FS=y
814CONFIG_JFFS2_FS_DEBUG=0 817CONFIG_JFFS2_FS_DEBUG=0
815# CONFIG_JFFS2_FS_NAND is not set 818CONFIG_JFFS2_FS_WRITEBUFFER=y
816# CONFIG_JFFS2_FS_NOR_ECC is not set
817# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 819# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
818CONFIG_JFFS2_ZLIB=y 820CONFIG_JFFS2_ZLIB=y
819CONFIG_JFFS2_RTIME=y 821CONFIG_JFFS2_RTIME=y
diff --git a/arch/arm/configs/ixdp2400_defconfig b/arch/arm/configs/ixdp2400_defconfig
index 5c6c928215d0..678720fa2e2e 100644
--- a/arch/arm/configs/ixdp2400_defconfig
+++ b/arch/arm/configs/ixdp2400_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.13-rc2 3# Linux kernel version: 2.6.13
4# Thu Jul 7 16:49:01 2005 4# Wed Sep 14 10:52:01 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -136,7 +136,6 @@ CONFIG_PCI_NAMES=y
136# 136#
137# Kernel Features 137# Kernel Features
138# 138#
139# CONFIG_SMP is not set
140# CONFIG_PREEMPT is not set 139# CONFIG_PREEMPT is not set
141# CONFIG_NO_IDLE_HZ is not set 140# CONFIG_NO_IDLE_HZ is not set
142# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 141# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
@@ -180,6 +179,68 @@ CONFIG_BINFMT_ELF=y
180# CONFIG_PM is not set 179# CONFIG_PM is not set
181 180
182# 181#
182# Networking
183#
184CONFIG_NET=y
185
186#
187# Networking options
188#
189CONFIG_PACKET=y
190CONFIG_PACKET_MMAP=y
191CONFIG_UNIX=y
192# CONFIG_NET_KEY is not set
193CONFIG_INET=y
194# CONFIG_IP_MULTICAST is not set
195# CONFIG_IP_ADVANCED_ROUTER is not set
196CONFIG_IP_FIB_HASH=y
197CONFIG_IP_PNP=y
198CONFIG_IP_PNP_DHCP=y
199CONFIG_IP_PNP_BOOTP=y
200# CONFIG_IP_PNP_RARP is not set
201# CONFIG_NET_IPIP is not set
202# CONFIG_NET_IPGRE is not set
203# CONFIG_ARPD is not set
204CONFIG_SYN_COOKIES=y
205# CONFIG_INET_AH is not set
206# CONFIG_INET_ESP is not set
207# CONFIG_INET_IPCOMP is not set
208# CONFIG_INET_TUNNEL is not set
209# CONFIG_IP_TCPDIAG is not set
210# CONFIG_IP_TCPDIAG_IPV6 is not set
211# CONFIG_TCP_CONG_ADVANCED is not set
212CONFIG_TCP_CONG_BIC=y
213# CONFIG_IPV6 is not set
214# CONFIG_NETFILTER is not set
215
216#
217# SCTP Configuration (EXPERIMENTAL)
218#
219# CONFIG_IP_SCTP is not set
220# CONFIG_ATM is not set
221# CONFIG_BRIDGE is not set
222# CONFIG_VLAN_8021Q is not set
223# CONFIG_DECNET is not set
224# CONFIG_LLC2 is not set
225# CONFIG_IPX is not set
226# CONFIG_ATALK is not set
227# CONFIG_X25 is not set
228# CONFIG_LAPB is not set
229# CONFIG_NET_DIVERT is not set
230# CONFIG_ECONET is not set
231# CONFIG_WAN_ROUTER is not set
232# CONFIG_NET_SCHED is not set
233# CONFIG_NET_CLS_ROUTE is not set
234
235#
236# Network testing
237#
238# CONFIG_NET_PKTGEN is not set
239# CONFIG_HAMRADIO is not set
240# CONFIG_IRDA is not set
241# CONFIG_BT is not set
242
243#
183# Device Drivers 244# Device Drivers
184# 245#
185 246
@@ -249,6 +310,7 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
249CONFIG_MTD_IXP2000=y 310CONFIG_MTD_IXP2000=y
250# CONFIG_MTD_EDB7312 is not set 311# CONFIG_MTD_EDB7312 is not set
251# CONFIG_MTD_PCI is not set 312# CONFIG_MTD_PCI is not set
313# CONFIG_MTD_PLATRAM is not set
252 314
253# 315#
254# Self-contained MTD device drivers 316# Self-contained MTD device drivers
@@ -335,72 +397,8 @@ CONFIG_IOSCHED_CFQ=y
335# CONFIG_I2O is not set 397# CONFIG_I2O is not set
336 398
337# 399#
338# Networking support 400# Network device support
339#
340CONFIG_NET=y
341
342#
343# Networking options
344#
345CONFIG_PACKET=y
346CONFIG_PACKET_MMAP=y
347CONFIG_UNIX=y
348# CONFIG_NET_KEY is not set
349CONFIG_INET=y
350# CONFIG_IP_MULTICAST is not set
351# CONFIG_IP_ADVANCED_ROUTER is not set
352CONFIG_IP_FIB_HASH=y
353CONFIG_IP_PNP=y
354CONFIG_IP_PNP_DHCP=y
355CONFIG_IP_PNP_BOOTP=y
356# CONFIG_IP_PNP_RARP is not set
357# CONFIG_NET_IPIP is not set
358# CONFIG_NET_IPGRE is not set
359# CONFIG_ARPD is not set
360CONFIG_SYN_COOKIES=y
361# CONFIG_INET_AH is not set
362# CONFIG_INET_ESP is not set
363# CONFIG_INET_IPCOMP is not set
364# CONFIG_INET_TUNNEL is not set
365# CONFIG_IP_TCPDIAG is not set
366# CONFIG_IP_TCPDIAG_IPV6 is not set
367# CONFIG_TCP_CONG_ADVANCED is not set
368CONFIG_TCP_CONG_BIC=y
369# CONFIG_IPV6 is not set
370# CONFIG_NETFILTER is not set
371
372#
373# SCTP Configuration (EXPERIMENTAL)
374#
375# CONFIG_IP_SCTP is not set
376# CONFIG_ATM is not set
377# CONFIG_BRIDGE is not set
378# CONFIG_VLAN_8021Q is not set
379# CONFIG_DECNET is not set
380# CONFIG_LLC2 is not set
381# CONFIG_IPX is not set
382# CONFIG_ATALK is not set
383# CONFIG_X25 is not set
384# CONFIG_LAPB is not set
385# CONFIG_NET_DIVERT is not set
386# CONFIG_ECONET is not set
387# CONFIG_WAN_ROUTER is not set
388
389#
390# QoS and/or fair queueing
391#
392# CONFIG_NET_SCHED is not set
393# CONFIG_NET_CLS_ROUTE is not set
394
395#
396# Network testing
397# 401#
398# CONFIG_NET_PKTGEN is not set
399# CONFIG_NETPOLL is not set
400# CONFIG_NET_POLL_CONTROLLER is not set
401# CONFIG_HAMRADIO is not set
402# CONFIG_IRDA is not set
403# CONFIG_BT is not set
404CONFIG_NETDEVICES=y 402CONFIG_NETDEVICES=y
405CONFIG_DUMMY=y 403CONFIG_DUMMY=y
406# CONFIG_BONDING is not set 404# CONFIG_BONDING is not set
@@ -510,6 +508,8 @@ CONFIG_DLCI_MAX=8
510# CONFIG_SLIP is not set 508# CONFIG_SLIP is not set
511# CONFIG_SHAPER is not set 509# CONFIG_SHAPER is not set
512# CONFIG_NETCONSOLE is not set 510# CONFIG_NETCONSOLE is not set
511# CONFIG_NETPOLL is not set
512# CONFIG_NET_POLL_CONTROLLER is not set
513 513
514# 514#
515# ISDN subsystem 515# ISDN subsystem
@@ -636,7 +636,7 @@ CONFIG_I2C_ALGOBIT=y
636# CONFIG_I2C_I810 is not set 636# CONFIG_I2C_I810 is not set
637# CONFIG_I2C_PIIX4 is not set 637# CONFIG_I2C_PIIX4 is not set
638# CONFIG_I2C_ISA is not set 638# CONFIG_I2C_ISA is not set
639# CONFIG_I2C_IXP2000 is not set 639CONFIG_I2C_IXP2000=y
640# CONFIG_I2C_NFORCE2 is not set 640# CONFIG_I2C_NFORCE2 is not set
641# CONFIG_I2C_PARPORT_LIGHT is not set 641# CONFIG_I2C_PARPORT_LIGHT is not set
642# CONFIG_I2C_PROSAVAGE is not set 642# CONFIG_I2C_PROSAVAGE is not set
@@ -650,11 +650,28 @@ CONFIG_I2C_ALGOBIT=y
650# CONFIG_I2C_VIAPRO is not set 650# CONFIG_I2C_VIAPRO is not set
651# CONFIG_I2C_VOODOO3 is not set 651# CONFIG_I2C_VOODOO3 is not set
652# CONFIG_I2C_PCA_ISA is not set 652# CONFIG_I2C_PCA_ISA is not set
653CONFIG_I2C_SENSOR=y
653 654
654# 655#
655# Hardware Sensors Chip support 656# Miscellaneous I2C Chip support
656# 657#
657CONFIG_I2C_SENSOR=y 658# CONFIG_SENSORS_DS1337 is not set
659# CONFIG_SENSORS_DS1374 is not set
660CONFIG_SENSORS_EEPROM=y
661# CONFIG_SENSORS_PCF8574 is not set
662# CONFIG_SENSORS_PCA9539 is not set
663# CONFIG_SENSORS_PCF8591 is not set
664# CONFIG_SENSORS_RTC8564 is not set
665# CONFIG_SENSORS_MAX6875 is not set
666# CONFIG_I2C_DEBUG_CORE is not set
667# CONFIG_I2C_DEBUG_ALGO is not set
668# CONFIG_I2C_DEBUG_BUS is not set
669# CONFIG_I2C_DEBUG_CHIP is not set
670
671#
672# Hardware Monitoring support
673#
674CONFIG_HWMON=y
658# CONFIG_SENSORS_ADM1021 is not set 675# CONFIG_SENSORS_ADM1021 is not set
659# CONFIG_SENSORS_ADM1025 is not set 676# CONFIG_SENSORS_ADM1025 is not set
660# CONFIG_SENSORS_ADM1026 is not set 677# CONFIG_SENSORS_ADM1026 is not set
@@ -680,30 +697,15 @@ CONFIG_I2C_SENSOR=y
680# CONFIG_SENSORS_LM92 is not set 697# CONFIG_SENSORS_LM92 is not set
681# CONFIG_SENSORS_MAX1619 is not set 698# CONFIG_SENSORS_MAX1619 is not set
682# CONFIG_SENSORS_PC87360 is not set 699# CONFIG_SENSORS_PC87360 is not set
683# CONFIG_SENSORS_SMSC47B397 is not set
684# CONFIG_SENSORS_SIS5595 is not set 700# CONFIG_SENSORS_SIS5595 is not set
685# CONFIG_SENSORS_SMSC47M1 is not set 701# CONFIG_SENSORS_SMSC47M1 is not set
702# CONFIG_SENSORS_SMSC47B397 is not set
686# CONFIG_SENSORS_VIA686A is not set 703# CONFIG_SENSORS_VIA686A is not set
687# CONFIG_SENSORS_W83781D is not set 704# CONFIG_SENSORS_W83781D is not set
688# CONFIG_SENSORS_W83L785TS is not set 705# CONFIG_SENSORS_W83L785TS is not set
689# CONFIG_SENSORS_W83627HF is not set 706# CONFIG_SENSORS_W83627HF is not set
690# CONFIG_SENSORS_W83627EHF is not set 707# CONFIG_SENSORS_W83627EHF is not set
691 708# CONFIG_HWMON_DEBUG_CHIP is not set
692#
693# Other I2C Chip support
694#
695# CONFIG_SENSORS_DS1337 is not set
696# CONFIG_SENSORS_DS1374 is not set
697CONFIG_SENSORS_EEPROM=y
698# CONFIG_SENSORS_PCF8574 is not set
699# CONFIG_SENSORS_PCA9539 is not set
700# CONFIG_SENSORS_PCF8591 is not set
701# CONFIG_SENSORS_RTC8564 is not set
702# CONFIG_SENSORS_MAX6875 is not set
703# CONFIG_I2C_DEBUG_CORE is not set
704# CONFIG_I2C_DEBUG_ALGO is not set
705# CONFIG_I2C_DEBUG_BUS is not set
706# CONFIG_I2C_DEBUG_CHIP is not set
707 709
708# 710#
709# Misc devices 711# Misc devices
@@ -771,6 +773,7 @@ CONFIG_FS_POSIX_ACL=y
771# CONFIG_XFS_FS is not set 773# CONFIG_XFS_FS is not set
772# CONFIG_MINIX_FS is not set 774# CONFIG_MINIX_FS is not set
773# CONFIG_ROMFS_FS is not set 775# CONFIG_ROMFS_FS is not set
776CONFIG_INOTIFY=y
774# CONFIG_QUOTA is not set 777# CONFIG_QUOTA is not set
775CONFIG_DNOTIFY=y 778CONFIG_DNOTIFY=y
776# CONFIG_AUTOFS_FS is not set 779# CONFIG_AUTOFS_FS is not set
@@ -813,8 +816,7 @@ CONFIG_RAMFS=y
813# CONFIG_JFFS_FS is not set 816# CONFIG_JFFS_FS is not set
814CONFIG_JFFS2_FS=y 817CONFIG_JFFS2_FS=y
815CONFIG_JFFS2_FS_DEBUG=0 818CONFIG_JFFS2_FS_DEBUG=0
816# CONFIG_JFFS2_FS_NAND is not set 819CONFIG_JFFS2_FS_WRITEBUFFER=y
817# CONFIG_JFFS2_FS_NOR_ECC is not set
818# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 820# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
819CONFIG_JFFS2_ZLIB=y 821CONFIG_JFFS2_ZLIB=y
820CONFIG_JFFS2_RTIME=y 822CONFIG_JFFS2_RTIME=y
diff --git a/arch/arm/configs/ixdp2401_defconfig b/arch/arm/configs/ixdp2401_defconfig
index 6dc40f6be0ef..38c9a721d5c9 100644
--- a/arch/arm/configs/ixdp2401_defconfig
+++ b/arch/arm/configs/ixdp2401_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.13-rc2 3# Linux kernel version: 2.6.13
4# Thu Jul 7 16:49:08 2005 4# Wed Sep 14 10:52:10 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -136,7 +136,6 @@ CONFIG_PCI_NAMES=y
136# 136#
137# Kernel Features 137# Kernel Features
138# 138#
139# CONFIG_SMP is not set
140# CONFIG_PREEMPT is not set 139# CONFIG_PREEMPT is not set
141# CONFIG_NO_IDLE_HZ is not set 140# CONFIG_NO_IDLE_HZ is not set
142# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 141# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
@@ -180,6 +179,68 @@ CONFIG_BINFMT_ELF=y
180# CONFIG_PM is not set 179# CONFIG_PM is not set
181 180
182# 181#
182# Networking
183#
184CONFIG_NET=y
185
186#
187# Networking options
188#
189CONFIG_PACKET=y
190CONFIG_PACKET_MMAP=y
191CONFIG_UNIX=y
192# CONFIG_NET_KEY is not set
193CONFIG_INET=y
194# CONFIG_IP_MULTICAST is not set
195# CONFIG_IP_ADVANCED_ROUTER is not set
196CONFIG_IP_FIB_HASH=y
197CONFIG_IP_PNP=y
198CONFIG_IP_PNP_DHCP=y
199CONFIG_IP_PNP_BOOTP=y
200# CONFIG_IP_PNP_RARP is not set
201# CONFIG_NET_IPIP is not set
202# CONFIG_NET_IPGRE is not set
203# CONFIG_ARPD is not set
204CONFIG_SYN_COOKIES=y
205# CONFIG_INET_AH is not set
206# CONFIG_INET_ESP is not set
207# CONFIG_INET_IPCOMP is not set
208# CONFIG_INET_TUNNEL is not set
209CONFIG_IP_TCPDIAG=y
210# CONFIG_IP_TCPDIAG_IPV6 is not set
211# CONFIG_TCP_CONG_ADVANCED is not set
212CONFIG_TCP_CONG_BIC=y
213# CONFIG_IPV6 is not set
214# CONFIG_NETFILTER is not set
215
216#
217# SCTP Configuration (EXPERIMENTAL)
218#
219# CONFIG_IP_SCTP is not set
220# CONFIG_ATM is not set
221# CONFIG_BRIDGE is not set
222# CONFIG_VLAN_8021Q is not set
223# CONFIG_DECNET is not set
224# CONFIG_LLC2 is not set
225# CONFIG_IPX is not set
226# CONFIG_ATALK is not set
227# CONFIG_X25 is not set
228# CONFIG_LAPB is not set
229# CONFIG_NET_DIVERT is not set
230# CONFIG_ECONET is not set
231# CONFIG_WAN_ROUTER is not set
232# CONFIG_NET_SCHED is not set
233# CONFIG_NET_CLS_ROUTE is not set
234
235#
236# Network testing
237#
238# CONFIG_NET_PKTGEN is not set
239# CONFIG_HAMRADIO is not set
240# CONFIG_IRDA is not set
241# CONFIG_BT is not set
242
243#
183# Device Drivers 244# Device Drivers
184# 245#
185 246
@@ -249,6 +310,7 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
249CONFIG_MTD_IXP2000=y 310CONFIG_MTD_IXP2000=y
250# CONFIG_MTD_EDB7312 is not set 311# CONFIG_MTD_EDB7312 is not set
251# CONFIG_MTD_PCI is not set 312# CONFIG_MTD_PCI is not set
313# CONFIG_MTD_PLATRAM is not set
252 314
253# 315#
254# Self-contained MTD device drivers 316# Self-contained MTD device drivers
@@ -335,72 +397,8 @@ CONFIG_IOSCHED_CFQ=y
335# CONFIG_I2O is not set 397# CONFIG_I2O is not set
336 398
337# 399#
338# Networking support 400# Network device support
339#
340CONFIG_NET=y
341
342#
343# Networking options
344#
345CONFIG_PACKET=y
346CONFIG_PACKET_MMAP=y
347CONFIG_UNIX=y
348# CONFIG_NET_KEY is not set
349CONFIG_INET=y
350# CONFIG_IP_MULTICAST is not set
351# CONFIG_IP_ADVANCED_ROUTER is not set
352CONFIG_IP_FIB_HASH=y
353CONFIG_IP_PNP=y
354CONFIG_IP_PNP_DHCP=y
355CONFIG_IP_PNP_BOOTP=y
356# CONFIG_IP_PNP_RARP is not set
357# CONFIG_NET_IPIP is not set
358# CONFIG_NET_IPGRE is not set
359# CONFIG_ARPD is not set
360CONFIG_SYN_COOKIES=y
361# CONFIG_INET_AH is not set
362# CONFIG_INET_ESP is not set
363# CONFIG_INET_IPCOMP is not set
364# CONFIG_INET_TUNNEL is not set
365CONFIG_IP_TCPDIAG=y
366# CONFIG_IP_TCPDIAG_IPV6 is not set
367# CONFIG_TCP_CONG_ADVANCED is not set
368CONFIG_TCP_CONG_BIC=y
369# CONFIG_IPV6 is not set
370# CONFIG_NETFILTER is not set
371
372#
373# SCTP Configuration (EXPERIMENTAL)
374#
375# CONFIG_IP_SCTP is not set
376# CONFIG_ATM is not set
377# CONFIG_BRIDGE is not set
378# CONFIG_VLAN_8021Q is not set
379# CONFIG_DECNET is not set
380# CONFIG_LLC2 is not set
381# CONFIG_IPX is not set
382# CONFIG_ATALK is not set
383# CONFIG_X25 is not set
384# CONFIG_LAPB is not set
385# CONFIG_NET_DIVERT is not set
386# CONFIG_ECONET is not set
387# CONFIG_WAN_ROUTER is not set
388
389#
390# QoS and/or fair queueing
391#
392# CONFIG_NET_SCHED is not set
393# CONFIG_NET_CLS_ROUTE is not set
394
395#
396# Network testing
397# 401#
398# CONFIG_NET_PKTGEN is not set
399# CONFIG_NETPOLL is not set
400# CONFIG_NET_POLL_CONTROLLER is not set
401# CONFIG_HAMRADIO is not set
402# CONFIG_IRDA is not set
403# CONFIG_BT is not set
404CONFIG_NETDEVICES=y 402CONFIG_NETDEVICES=y
405CONFIG_DUMMY=y 403CONFIG_DUMMY=y
406# CONFIG_BONDING is not set 404# CONFIG_BONDING is not set
@@ -511,6 +509,8 @@ CONFIG_DLCI_MAX=8
511# CONFIG_SLIP is not set 509# CONFIG_SLIP is not set
512# CONFIG_SHAPER is not set 510# CONFIG_SHAPER is not set
513# CONFIG_NETCONSOLE is not set 511# CONFIG_NETCONSOLE is not set
512# CONFIG_NETPOLL is not set
513# CONFIG_NET_POLL_CONTROLLER is not set
514 514
515# 515#
516# ISDN subsystem 516# ISDN subsystem
@@ -637,7 +637,7 @@ CONFIG_I2C_ALGOBIT=y
637# CONFIG_I2C_I810 is not set 637# CONFIG_I2C_I810 is not set
638# CONFIG_I2C_PIIX4 is not set 638# CONFIG_I2C_PIIX4 is not set
639# CONFIG_I2C_ISA is not set 639# CONFIG_I2C_ISA is not set
640# CONFIG_I2C_IXP2000 is not set 640CONFIG_I2C_IXP2000=y
641# CONFIG_I2C_NFORCE2 is not set 641# CONFIG_I2C_NFORCE2 is not set
642# CONFIG_I2C_PARPORT_LIGHT is not set 642# CONFIG_I2C_PARPORT_LIGHT is not set
643# CONFIG_I2C_PROSAVAGE is not set 643# CONFIG_I2C_PROSAVAGE is not set
@@ -651,11 +651,28 @@ CONFIG_I2C_ALGOBIT=y
651# CONFIG_I2C_VIAPRO is not set 651# CONFIG_I2C_VIAPRO is not set
652# CONFIG_I2C_VOODOO3 is not set 652# CONFIG_I2C_VOODOO3 is not set
653# CONFIG_I2C_PCA_ISA is not set 653# CONFIG_I2C_PCA_ISA is not set
654CONFIG_I2C_SENSOR=y
654 655
655# 656#
656# Hardware Sensors Chip support 657# Miscellaneous I2C Chip support
657# 658#
658CONFIG_I2C_SENSOR=y 659# CONFIG_SENSORS_DS1337 is not set
660# CONFIG_SENSORS_DS1374 is not set
661CONFIG_SENSORS_EEPROM=y
662# CONFIG_SENSORS_PCF8574 is not set
663# CONFIG_SENSORS_PCA9539 is not set
664# CONFIG_SENSORS_PCF8591 is not set
665# CONFIG_SENSORS_RTC8564 is not set
666# CONFIG_SENSORS_MAX6875 is not set
667# CONFIG_I2C_DEBUG_CORE is not set
668# CONFIG_I2C_DEBUG_ALGO is not set
669# CONFIG_I2C_DEBUG_BUS is not set
670# CONFIG_I2C_DEBUG_CHIP is not set
671
672#
673# Hardware Monitoring support
674#
675CONFIG_HWMON=y
659# CONFIG_SENSORS_ADM1021 is not set 676# CONFIG_SENSORS_ADM1021 is not set
660# CONFIG_SENSORS_ADM1025 is not set 677# CONFIG_SENSORS_ADM1025 is not set
661# CONFIG_SENSORS_ADM1026 is not set 678# CONFIG_SENSORS_ADM1026 is not set
@@ -681,30 +698,15 @@ CONFIG_I2C_SENSOR=y
681# CONFIG_SENSORS_LM92 is not set 698# CONFIG_SENSORS_LM92 is not set
682# CONFIG_SENSORS_MAX1619 is not set 699# CONFIG_SENSORS_MAX1619 is not set
683# CONFIG_SENSORS_PC87360 is not set 700# CONFIG_SENSORS_PC87360 is not set
684# CONFIG_SENSORS_SMSC47B397 is not set
685# CONFIG_SENSORS_SIS5595 is not set 701# CONFIG_SENSORS_SIS5595 is not set
686# CONFIG_SENSORS_SMSC47M1 is not set 702# CONFIG_SENSORS_SMSC47M1 is not set
703# CONFIG_SENSORS_SMSC47B397 is not set
687# CONFIG_SENSORS_VIA686A is not set 704# CONFIG_SENSORS_VIA686A is not set
688# CONFIG_SENSORS_W83781D is not set 705# CONFIG_SENSORS_W83781D is not set
689# CONFIG_SENSORS_W83L785TS is not set 706# CONFIG_SENSORS_W83L785TS is not set
690# CONFIG_SENSORS_W83627HF is not set 707# CONFIG_SENSORS_W83627HF is not set
691# CONFIG_SENSORS_W83627EHF is not set 708# CONFIG_SENSORS_W83627EHF is not set
692 709# CONFIG_HWMON_DEBUG_CHIP is not set
693#
694# Other I2C Chip support
695#
696# CONFIG_SENSORS_DS1337 is not set
697# CONFIG_SENSORS_DS1374 is not set
698CONFIG_SENSORS_EEPROM=y
699# CONFIG_SENSORS_PCF8574 is not set
700# CONFIG_SENSORS_PCA9539 is not set
701# CONFIG_SENSORS_PCF8591 is not set
702# CONFIG_SENSORS_RTC8564 is not set
703# CONFIG_SENSORS_MAX6875 is not set
704# CONFIG_I2C_DEBUG_CORE is not set
705# CONFIG_I2C_DEBUG_ALGO is not set
706# CONFIG_I2C_DEBUG_BUS is not set
707# CONFIG_I2C_DEBUG_CHIP is not set
708 710
709# 711#
710# Misc devices 712# Misc devices
@@ -772,6 +774,7 @@ CONFIG_FS_POSIX_ACL=y
772# CONFIG_XFS_FS is not set 774# CONFIG_XFS_FS is not set
773# CONFIG_MINIX_FS is not set 775# CONFIG_MINIX_FS is not set
774# CONFIG_ROMFS_FS is not set 776# CONFIG_ROMFS_FS is not set
777CONFIG_INOTIFY=y
775# CONFIG_QUOTA is not set 778# CONFIG_QUOTA is not set
776CONFIG_DNOTIFY=y 779CONFIG_DNOTIFY=y
777# CONFIG_AUTOFS_FS is not set 780# CONFIG_AUTOFS_FS is not set
@@ -814,8 +817,7 @@ CONFIG_RAMFS=y
814# CONFIG_JFFS_FS is not set 817# CONFIG_JFFS_FS is not set
815CONFIG_JFFS2_FS=y 818CONFIG_JFFS2_FS=y
816CONFIG_JFFS2_FS_DEBUG=0 819CONFIG_JFFS2_FS_DEBUG=0
817# CONFIG_JFFS2_FS_NAND is not set 820CONFIG_JFFS2_FS_WRITEBUFFER=y
818# CONFIG_JFFS2_FS_NOR_ECC is not set
819# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 821# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
820CONFIG_JFFS2_ZLIB=y 822CONFIG_JFFS2_ZLIB=y
821CONFIG_JFFS2_RTIME=y 823CONFIG_JFFS2_RTIME=y
diff --git a/arch/arm/configs/ixdp2800_defconfig b/arch/arm/configs/ixdp2800_defconfig
index d2bb0b7153fe..261e2343903b 100644
--- a/arch/arm/configs/ixdp2800_defconfig
+++ b/arch/arm/configs/ixdp2800_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.13-rc2 3# Linux kernel version: 2.6.13
4# Thu Jul 7 16:49:20 2005 4# Wed Sep 14 10:52:23 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -136,7 +136,6 @@ CONFIG_PCI_NAMES=y
136# 136#
137# Kernel Features 137# Kernel Features
138# 138#
139# CONFIG_SMP is not set
140# CONFIG_PREEMPT is not set 139# CONFIG_PREEMPT is not set
141# CONFIG_NO_IDLE_HZ is not set 140# CONFIG_NO_IDLE_HZ is not set
142# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 141# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
@@ -180,6 +179,68 @@ CONFIG_BINFMT_ELF=y
180# CONFIG_PM is not set 179# CONFIG_PM is not set
181 180
182# 181#
182# Networking
183#
184CONFIG_NET=y
185
186#
187# Networking options
188#
189CONFIG_PACKET=y
190CONFIG_PACKET_MMAP=y
191CONFIG_UNIX=y
192# CONFIG_NET_KEY is not set
193CONFIG_INET=y
194# CONFIG_IP_MULTICAST is not set
195# CONFIG_IP_ADVANCED_ROUTER is not set
196CONFIG_IP_FIB_HASH=y
197CONFIG_IP_PNP=y
198CONFIG_IP_PNP_DHCP=y
199CONFIG_IP_PNP_BOOTP=y
200# CONFIG_IP_PNP_RARP is not set
201# CONFIG_NET_IPIP is not set
202# CONFIG_NET_IPGRE is not set
203# CONFIG_ARPD is not set
204CONFIG_SYN_COOKIES=y
205# CONFIG_INET_AH is not set
206# CONFIG_INET_ESP is not set
207# CONFIG_INET_IPCOMP is not set
208# CONFIG_INET_TUNNEL is not set
209# CONFIG_IP_TCPDIAG is not set
210# CONFIG_IP_TCPDIAG_IPV6 is not set
211# CONFIG_TCP_CONG_ADVANCED is not set
212CONFIG_TCP_CONG_BIC=y
213# CONFIG_IPV6 is not set
214# CONFIG_NETFILTER is not set
215
216#
217# SCTP Configuration (EXPERIMENTAL)
218#
219# CONFIG_IP_SCTP is not set
220# CONFIG_ATM is not set
221# CONFIG_BRIDGE is not set
222# CONFIG_VLAN_8021Q is not set
223# CONFIG_DECNET is not set
224# CONFIG_LLC2 is not set
225# CONFIG_IPX is not set
226# CONFIG_ATALK is not set
227# CONFIG_X25 is not set
228# CONFIG_LAPB is not set
229# CONFIG_NET_DIVERT is not set
230# CONFIG_ECONET is not set
231# CONFIG_WAN_ROUTER is not set
232# CONFIG_NET_SCHED is not set
233# CONFIG_NET_CLS_ROUTE is not set
234
235#
236# Network testing
237#
238# CONFIG_NET_PKTGEN is not set
239# CONFIG_HAMRADIO is not set
240# CONFIG_IRDA is not set
241# CONFIG_BT is not set
242
243#
183# Device Drivers 244# Device Drivers
184# 245#
185 246
@@ -249,6 +310,7 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
249CONFIG_MTD_IXP2000=y 310CONFIG_MTD_IXP2000=y
250# CONFIG_MTD_EDB7312 is not set 311# CONFIG_MTD_EDB7312 is not set
251# CONFIG_MTD_PCI is not set 312# CONFIG_MTD_PCI is not set
313# CONFIG_MTD_PLATRAM is not set
252 314
253# 315#
254# Self-contained MTD device drivers 316# Self-contained MTD device drivers
@@ -335,72 +397,8 @@ CONFIG_IOSCHED_CFQ=y
335# CONFIG_I2O is not set 397# CONFIG_I2O is not set
336 398
337# 399#
338# Networking support 400# Network device support
339#
340CONFIG_NET=y
341
342#
343# Networking options
344#
345CONFIG_PACKET=y
346CONFIG_PACKET_MMAP=y
347CONFIG_UNIX=y
348# CONFIG_NET_KEY is not set
349CONFIG_INET=y
350# CONFIG_IP_MULTICAST is not set
351# CONFIG_IP_ADVANCED_ROUTER is not set
352CONFIG_IP_FIB_HASH=y
353CONFIG_IP_PNP=y
354CONFIG_IP_PNP_DHCP=y
355CONFIG_IP_PNP_BOOTP=y
356# CONFIG_IP_PNP_RARP is not set
357# CONFIG_NET_IPIP is not set
358# CONFIG_NET_IPGRE is not set
359# CONFIG_ARPD is not set
360CONFIG_SYN_COOKIES=y
361# CONFIG_INET_AH is not set
362# CONFIG_INET_ESP is not set
363# CONFIG_INET_IPCOMP is not set
364# CONFIG_INET_TUNNEL is not set
365# CONFIG_IP_TCPDIAG is not set
366# CONFIG_IP_TCPDIAG_IPV6 is not set
367# CONFIG_TCP_CONG_ADVANCED is not set
368CONFIG_TCP_CONG_BIC=y
369# CONFIG_IPV6 is not set
370# CONFIG_NETFILTER is not set
371
372#
373# SCTP Configuration (EXPERIMENTAL)
374#
375# CONFIG_IP_SCTP is not set
376# CONFIG_ATM is not set
377# CONFIG_BRIDGE is not set
378# CONFIG_VLAN_8021Q is not set
379# CONFIG_DECNET is not set
380# CONFIG_LLC2 is not set
381# CONFIG_IPX is not set
382# CONFIG_ATALK is not set
383# CONFIG_X25 is not set
384# CONFIG_LAPB is not set
385# CONFIG_NET_DIVERT is not set
386# CONFIG_ECONET is not set
387# CONFIG_WAN_ROUTER is not set
388
389#
390# QoS and/or fair queueing
391#
392# CONFIG_NET_SCHED is not set
393# CONFIG_NET_CLS_ROUTE is not set
394
395#
396# Network testing
397# 401#
398# CONFIG_NET_PKTGEN is not set
399# CONFIG_NETPOLL is not set
400# CONFIG_NET_POLL_CONTROLLER is not set
401# CONFIG_HAMRADIO is not set
402# CONFIG_IRDA is not set
403# CONFIG_BT is not set
404CONFIG_NETDEVICES=y 402CONFIG_NETDEVICES=y
405CONFIG_DUMMY=y 403CONFIG_DUMMY=y
406# CONFIG_BONDING is not set 404# CONFIG_BONDING is not set
@@ -510,6 +508,8 @@ CONFIG_DLCI_MAX=8
510# CONFIG_SLIP is not set 508# CONFIG_SLIP is not set
511# CONFIG_SHAPER is not set 509# CONFIG_SHAPER is not set
512# CONFIG_NETCONSOLE is not set 510# CONFIG_NETCONSOLE is not set
511# CONFIG_NETPOLL is not set
512# CONFIG_NET_POLL_CONTROLLER is not set
513 513
514# 514#
515# ISDN subsystem 515# ISDN subsystem
@@ -636,7 +636,7 @@ CONFIG_I2C_ALGOBIT=y
636# CONFIG_I2C_I810 is not set 636# CONFIG_I2C_I810 is not set
637# CONFIG_I2C_PIIX4 is not set 637# CONFIG_I2C_PIIX4 is not set
638# CONFIG_I2C_ISA is not set 638# CONFIG_I2C_ISA is not set
639# CONFIG_I2C_IXP2000 is not set 639CONFIG_I2C_IXP2000=y
640# CONFIG_I2C_NFORCE2 is not set 640# CONFIG_I2C_NFORCE2 is not set
641# CONFIG_I2C_PARPORT_LIGHT is not set 641# CONFIG_I2C_PARPORT_LIGHT is not set
642# CONFIG_I2C_PROSAVAGE is not set 642# CONFIG_I2C_PROSAVAGE is not set
@@ -650,11 +650,28 @@ CONFIG_I2C_ALGOBIT=y
650# CONFIG_I2C_VIAPRO is not set 650# CONFIG_I2C_VIAPRO is not set
651# CONFIG_I2C_VOODOO3 is not set 651# CONFIG_I2C_VOODOO3 is not set
652# CONFIG_I2C_PCA_ISA is not set 652# CONFIG_I2C_PCA_ISA is not set
653CONFIG_I2C_SENSOR=y
653 654
654# 655#
655# Hardware Sensors Chip support 656# Miscellaneous I2C Chip support
656# 657#
657CONFIG_I2C_SENSOR=y 658# CONFIG_SENSORS_DS1337 is not set
659# CONFIG_SENSORS_DS1374 is not set
660CONFIG_SENSORS_EEPROM=y
661# CONFIG_SENSORS_PCF8574 is not set
662# CONFIG_SENSORS_PCA9539 is not set
663# CONFIG_SENSORS_PCF8591 is not set
664# CONFIG_SENSORS_RTC8564 is not set
665# CONFIG_SENSORS_MAX6875 is not set
666# CONFIG_I2C_DEBUG_CORE is not set
667# CONFIG_I2C_DEBUG_ALGO is not set
668# CONFIG_I2C_DEBUG_BUS is not set
669# CONFIG_I2C_DEBUG_CHIP is not set
670
671#
672# Hardware Monitoring support
673#
674CONFIG_HWMON=y
658# CONFIG_SENSORS_ADM1021 is not set 675# CONFIG_SENSORS_ADM1021 is not set
659# CONFIG_SENSORS_ADM1025 is not set 676# CONFIG_SENSORS_ADM1025 is not set
660# CONFIG_SENSORS_ADM1026 is not set 677# CONFIG_SENSORS_ADM1026 is not set
@@ -680,30 +697,15 @@ CONFIG_I2C_SENSOR=y
680# CONFIG_SENSORS_LM92 is not set 697# CONFIG_SENSORS_LM92 is not set
681# CONFIG_SENSORS_MAX1619 is not set 698# CONFIG_SENSORS_MAX1619 is not set
682# CONFIG_SENSORS_PC87360 is not set 699# CONFIG_SENSORS_PC87360 is not set
683# CONFIG_SENSORS_SMSC47B397 is not set
684# CONFIG_SENSORS_SIS5595 is not set 700# CONFIG_SENSORS_SIS5595 is not set
685# CONFIG_SENSORS_SMSC47M1 is not set 701# CONFIG_SENSORS_SMSC47M1 is not set
702# CONFIG_SENSORS_SMSC47B397 is not set
686# CONFIG_SENSORS_VIA686A is not set 703# CONFIG_SENSORS_VIA686A is not set
687# CONFIG_SENSORS_W83781D is not set 704# CONFIG_SENSORS_W83781D is not set
688# CONFIG_SENSORS_W83L785TS is not set 705# CONFIG_SENSORS_W83L785TS is not set
689# CONFIG_SENSORS_W83627HF is not set 706# CONFIG_SENSORS_W83627HF is not set
690# CONFIG_SENSORS_W83627EHF is not set 707# CONFIG_SENSORS_W83627EHF is not set
691 708# CONFIG_HWMON_DEBUG_CHIP is not set
692#
693# Other I2C Chip support
694#
695# CONFIG_SENSORS_DS1337 is not set
696# CONFIG_SENSORS_DS1374 is not set
697CONFIG_SENSORS_EEPROM=y
698# CONFIG_SENSORS_PCF8574 is not set
699# CONFIG_SENSORS_PCA9539 is not set
700# CONFIG_SENSORS_PCF8591 is not set
701# CONFIG_SENSORS_RTC8564 is not set
702# CONFIG_SENSORS_MAX6875 is not set
703# CONFIG_I2C_DEBUG_CORE is not set
704# CONFIG_I2C_DEBUG_ALGO is not set
705# CONFIG_I2C_DEBUG_BUS is not set
706# CONFIG_I2C_DEBUG_CHIP is not set
707 709
708# 710#
709# Misc devices 711# Misc devices
@@ -771,6 +773,7 @@ CONFIG_FS_POSIX_ACL=y
771# CONFIG_XFS_FS is not set 773# CONFIG_XFS_FS is not set
772# CONFIG_MINIX_FS is not set 774# CONFIG_MINIX_FS is not set
773# CONFIG_ROMFS_FS is not set 775# CONFIG_ROMFS_FS is not set
776CONFIG_INOTIFY=y
774# CONFIG_QUOTA is not set 777# CONFIG_QUOTA is not set
775CONFIG_DNOTIFY=y 778CONFIG_DNOTIFY=y
776# CONFIG_AUTOFS_FS is not set 779# CONFIG_AUTOFS_FS is not set
@@ -813,8 +816,7 @@ CONFIG_RAMFS=y
813# CONFIG_JFFS_FS is not set 816# CONFIG_JFFS_FS is not set
814CONFIG_JFFS2_FS=y 817CONFIG_JFFS2_FS=y
815CONFIG_JFFS2_FS_DEBUG=0 818CONFIG_JFFS2_FS_DEBUG=0
816# CONFIG_JFFS2_FS_NAND is not set 819CONFIG_JFFS2_FS_WRITEBUFFER=y
817# CONFIG_JFFS2_FS_NOR_ECC is not set
818# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 820# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
819CONFIG_JFFS2_ZLIB=y 821CONFIG_JFFS2_ZLIB=y
820CONFIG_JFFS2_RTIME=y 822CONFIG_JFFS2_RTIME=y
diff --git a/arch/arm/configs/ixdp2801_defconfig b/arch/arm/configs/ixdp2801_defconfig
index 2d6f960e3395..12ef23d1c016 100644
--- a/arch/arm/configs/ixdp2801_defconfig
+++ b/arch/arm/configs/ixdp2801_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.13-rc2 3# Linux kernel version: 2.6.13
4# Thu Jul 7 16:49:13 2005 4# Wed Sep 14 10:52:16 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -136,7 +136,6 @@ CONFIG_PCI_NAMES=y
136# 136#
137# Kernel Features 137# Kernel Features
138# 138#
139# CONFIG_SMP is not set
140# CONFIG_PREEMPT is not set 139# CONFIG_PREEMPT is not set
141# CONFIG_NO_IDLE_HZ is not set 140# CONFIG_NO_IDLE_HZ is not set
142# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 141# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
@@ -180,6 +179,68 @@ CONFIG_BINFMT_ELF=y
180# CONFIG_PM is not set 179# CONFIG_PM is not set
181 180
182# 181#
182# Networking
183#
184CONFIG_NET=y
185
186#
187# Networking options
188#
189CONFIG_PACKET=y
190CONFIG_PACKET_MMAP=y
191CONFIG_UNIX=y
192# CONFIG_NET_KEY is not set
193CONFIG_INET=y
194# CONFIG_IP_MULTICAST is not set
195# CONFIG_IP_ADVANCED_ROUTER is not set
196CONFIG_IP_FIB_HASH=y
197CONFIG_IP_PNP=y
198CONFIG_IP_PNP_DHCP=y
199CONFIG_IP_PNP_BOOTP=y
200# CONFIG_IP_PNP_RARP is not set
201# CONFIG_NET_IPIP is not set
202# CONFIG_NET_IPGRE is not set
203# CONFIG_ARPD is not set
204CONFIG_SYN_COOKIES=y
205# CONFIG_INET_AH is not set
206# CONFIG_INET_ESP is not set
207# CONFIG_INET_IPCOMP is not set
208# CONFIG_INET_TUNNEL is not set
209# CONFIG_IP_TCPDIAG is not set
210# CONFIG_IP_TCPDIAG_IPV6 is not set
211# CONFIG_TCP_CONG_ADVANCED is not set
212CONFIG_TCP_CONG_BIC=y
213# CONFIG_IPV6 is not set
214# CONFIG_NETFILTER is not set
215
216#
217# SCTP Configuration (EXPERIMENTAL)
218#
219# CONFIG_IP_SCTP is not set
220# CONFIG_ATM is not set
221# CONFIG_BRIDGE is not set
222# CONFIG_VLAN_8021Q is not set
223# CONFIG_DECNET is not set
224# CONFIG_LLC2 is not set
225# CONFIG_IPX is not set
226# CONFIG_ATALK is not set
227# CONFIG_X25 is not set
228# CONFIG_LAPB is not set
229# CONFIG_NET_DIVERT is not set
230# CONFIG_ECONET is not set
231# CONFIG_WAN_ROUTER is not set
232# CONFIG_NET_SCHED is not set
233# CONFIG_NET_CLS_ROUTE is not set
234
235#
236# Network testing
237#
238# CONFIG_NET_PKTGEN is not set
239# CONFIG_HAMRADIO is not set
240# CONFIG_IRDA is not set
241# CONFIG_BT is not set
242
243#
183# Device Drivers 244# Device Drivers
184# 245#
185 246
@@ -249,6 +310,7 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
249CONFIG_MTD_IXP2000=y 310CONFIG_MTD_IXP2000=y
250# CONFIG_MTD_EDB7312 is not set 311# CONFIG_MTD_EDB7312 is not set
251# CONFIG_MTD_PCI is not set 312# CONFIG_MTD_PCI is not set
313# CONFIG_MTD_PLATRAM is not set
252 314
253# 315#
254# Self-contained MTD device drivers 316# Self-contained MTD device drivers
@@ -335,72 +397,8 @@ CONFIG_IOSCHED_CFQ=y
335# CONFIG_I2O is not set 397# CONFIG_I2O is not set
336 398
337# 399#
338# Networking support 400# Network device support
339#
340CONFIG_NET=y
341
342#
343# Networking options
344#
345CONFIG_PACKET=y
346CONFIG_PACKET_MMAP=y
347CONFIG_UNIX=y
348# CONFIG_NET_KEY is not set
349CONFIG_INET=y
350# CONFIG_IP_MULTICAST is not set
351# CONFIG_IP_ADVANCED_ROUTER is not set
352CONFIG_IP_FIB_HASH=y
353CONFIG_IP_PNP=y
354CONFIG_IP_PNP_DHCP=y
355CONFIG_IP_PNP_BOOTP=y
356# CONFIG_IP_PNP_RARP is not set
357# CONFIG_NET_IPIP is not set
358# CONFIG_NET_IPGRE is not set
359# CONFIG_ARPD is not set
360CONFIG_SYN_COOKIES=y
361# CONFIG_INET_AH is not set
362# CONFIG_INET_ESP is not set
363# CONFIG_INET_IPCOMP is not set
364# CONFIG_INET_TUNNEL is not set
365# CONFIG_IP_TCPDIAG is not set
366# CONFIG_IP_TCPDIAG_IPV6 is not set
367# CONFIG_TCP_CONG_ADVANCED is not set
368CONFIG_TCP_CONG_BIC=y
369# CONFIG_IPV6 is not set
370# CONFIG_NETFILTER is not set
371
372#
373# SCTP Configuration (EXPERIMENTAL)
374#
375# CONFIG_IP_SCTP is not set
376# CONFIG_ATM is not set
377# CONFIG_BRIDGE is not set
378# CONFIG_VLAN_8021Q is not set
379# CONFIG_DECNET is not set
380# CONFIG_LLC2 is not set
381# CONFIG_IPX is not set
382# CONFIG_ATALK is not set
383# CONFIG_X25 is not set
384# CONFIG_LAPB is not set
385# CONFIG_NET_DIVERT is not set
386# CONFIG_ECONET is not set
387# CONFIG_WAN_ROUTER is not set
388
389#
390# QoS and/or fair queueing
391#
392# CONFIG_NET_SCHED is not set
393# CONFIG_NET_CLS_ROUTE is not set
394
395#
396# Network testing
397# 401#
398# CONFIG_NET_PKTGEN is not set
399# CONFIG_NETPOLL is not set
400# CONFIG_NET_POLL_CONTROLLER is not set
401# CONFIG_HAMRADIO is not set
402# CONFIG_IRDA is not set
403# CONFIG_BT is not set
404CONFIG_NETDEVICES=y 402CONFIG_NETDEVICES=y
405CONFIG_DUMMY=y 403CONFIG_DUMMY=y
406# CONFIG_BONDING is not set 404# CONFIG_BONDING is not set
@@ -511,6 +509,8 @@ CONFIG_DLCI_MAX=8
511# CONFIG_SLIP is not set 509# CONFIG_SLIP is not set
512# CONFIG_SHAPER is not set 510# CONFIG_SHAPER is not set
513# CONFIG_NETCONSOLE is not set 511# CONFIG_NETCONSOLE is not set
512# CONFIG_NETPOLL is not set
513# CONFIG_NET_POLL_CONTROLLER is not set
514 514
515# 515#
516# ISDN subsystem 516# ISDN subsystem
@@ -637,7 +637,7 @@ CONFIG_I2C_ALGOBIT=y
637# CONFIG_I2C_I810 is not set 637# CONFIG_I2C_I810 is not set
638# CONFIG_I2C_PIIX4 is not set 638# CONFIG_I2C_PIIX4 is not set
639# CONFIG_I2C_ISA is not set 639# CONFIG_I2C_ISA is not set
640# CONFIG_I2C_IXP2000 is not set 640CONFIG_I2C_IXP2000=y
641# CONFIG_I2C_NFORCE2 is not set 641# CONFIG_I2C_NFORCE2 is not set
642# CONFIG_I2C_PARPORT_LIGHT is not set 642# CONFIG_I2C_PARPORT_LIGHT is not set
643# CONFIG_I2C_PROSAVAGE is not set 643# CONFIG_I2C_PROSAVAGE is not set
@@ -651,11 +651,28 @@ CONFIG_I2C_ALGOBIT=y
651# CONFIG_I2C_VIAPRO is not set 651# CONFIG_I2C_VIAPRO is not set
652# CONFIG_I2C_VOODOO3 is not set 652# CONFIG_I2C_VOODOO3 is not set
653# CONFIG_I2C_PCA_ISA is not set 653# CONFIG_I2C_PCA_ISA is not set
654CONFIG_I2C_SENSOR=y
654 655
655# 656#
656# Hardware Sensors Chip support 657# Miscellaneous I2C Chip support
657# 658#
658CONFIG_I2C_SENSOR=y 659# CONFIG_SENSORS_DS1337 is not set
660# CONFIG_SENSORS_DS1374 is not set
661CONFIG_SENSORS_EEPROM=y
662# CONFIG_SENSORS_PCF8574 is not set
663# CONFIG_SENSORS_PCA9539 is not set
664# CONFIG_SENSORS_PCF8591 is not set
665# CONFIG_SENSORS_RTC8564 is not set
666# CONFIG_SENSORS_MAX6875 is not set
667# CONFIG_I2C_DEBUG_CORE is not set
668# CONFIG_I2C_DEBUG_ALGO is not set
669# CONFIG_I2C_DEBUG_BUS is not set
670# CONFIG_I2C_DEBUG_CHIP is not set
671
672#
673# Hardware Monitoring support
674#
675CONFIG_HWMON=y
659# CONFIG_SENSORS_ADM1021 is not set 676# CONFIG_SENSORS_ADM1021 is not set
660# CONFIG_SENSORS_ADM1025 is not set 677# CONFIG_SENSORS_ADM1025 is not set
661# CONFIG_SENSORS_ADM1026 is not set 678# CONFIG_SENSORS_ADM1026 is not set
@@ -681,30 +698,15 @@ CONFIG_I2C_SENSOR=y
681# CONFIG_SENSORS_LM92 is not set 698# CONFIG_SENSORS_LM92 is not set
682# CONFIG_SENSORS_MAX1619 is not set 699# CONFIG_SENSORS_MAX1619 is not set
683# CONFIG_SENSORS_PC87360 is not set 700# CONFIG_SENSORS_PC87360 is not set
684# CONFIG_SENSORS_SMSC47B397 is not set
685# CONFIG_SENSORS_SIS5595 is not set 701# CONFIG_SENSORS_SIS5595 is not set
686# CONFIG_SENSORS_SMSC47M1 is not set 702# CONFIG_SENSORS_SMSC47M1 is not set
703# CONFIG_SENSORS_SMSC47B397 is not set
687# CONFIG_SENSORS_VIA686A is not set 704# CONFIG_SENSORS_VIA686A is not set
688# CONFIG_SENSORS_W83781D is not set 705# CONFIG_SENSORS_W83781D is not set
689# CONFIG_SENSORS_W83L785TS is not set 706# CONFIG_SENSORS_W83L785TS is not set
690# CONFIG_SENSORS_W83627HF is not set 707# CONFIG_SENSORS_W83627HF is not set
691# CONFIG_SENSORS_W83627EHF is not set 708# CONFIG_SENSORS_W83627EHF is not set
692 709# CONFIG_HWMON_DEBUG_CHIP is not set
693#
694# Other I2C Chip support
695#
696# CONFIG_SENSORS_DS1337 is not set
697# CONFIG_SENSORS_DS1374 is not set
698CONFIG_SENSORS_EEPROM=y
699# CONFIG_SENSORS_PCF8574 is not set
700# CONFIG_SENSORS_PCA9539 is not set
701# CONFIG_SENSORS_PCF8591 is not set
702# CONFIG_SENSORS_RTC8564 is not set
703# CONFIG_SENSORS_MAX6875 is not set
704# CONFIG_I2C_DEBUG_CORE is not set
705# CONFIG_I2C_DEBUG_ALGO is not set
706# CONFIG_I2C_DEBUG_BUS is not set
707# CONFIG_I2C_DEBUG_CHIP is not set
708 710
709# 711#
710# Misc devices 712# Misc devices
@@ -772,6 +774,7 @@ CONFIG_FS_POSIX_ACL=y
772# CONFIG_XFS_FS is not set 774# CONFIG_XFS_FS is not set
773# CONFIG_MINIX_FS is not set 775# CONFIG_MINIX_FS is not set
774# CONFIG_ROMFS_FS is not set 776# CONFIG_ROMFS_FS is not set
777CONFIG_INOTIFY=y
775# CONFIG_QUOTA is not set 778# CONFIG_QUOTA is not set
776CONFIG_DNOTIFY=y 779CONFIG_DNOTIFY=y
777# CONFIG_AUTOFS_FS is not set 780# CONFIG_AUTOFS_FS is not set
@@ -814,8 +817,7 @@ CONFIG_RAMFS=y
814# CONFIG_JFFS_FS is not set 817# CONFIG_JFFS_FS is not set
815CONFIG_JFFS2_FS=y 818CONFIG_JFFS2_FS=y
816CONFIG_JFFS2_FS_DEBUG=0 819CONFIG_JFFS2_FS_DEBUG=0
817# CONFIG_JFFS2_FS_NAND is not set 820CONFIG_JFFS2_FS_WRITEBUFFER=y
818# CONFIG_JFFS2_FS_NOR_ECC is not set
819# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 821# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
820CONFIG_JFFS2_ZLIB=y 822CONFIG_JFFS2_ZLIB=y
821CONFIG_JFFS2_RTIME=y 823CONFIG_JFFS2_RTIME=y
diff --git a/arch/arm/kernel/semaphore.c b/arch/arm/kernel/semaphore.c
index ac423e3e224b..4c31f2923055 100644
--- a/arch/arm/kernel/semaphore.c
+++ b/arch/arm/kernel/semaphore.c
@@ -178,7 +178,7 @@ int __down_trylock(struct semaphore * sem)
178 * registers (r0 to r3 and lr), but not ip, as we use it as a return 178 * registers (r0 to r3 and lr), but not ip, as we use it as a return
179 * value in some cases.. 179 * value in some cases..
180 */ 180 */
181asm(" .section .sched.text,\"ax\" \n\ 181asm(" .section .sched.text,\"ax\",%progbits \n\
182 .align 5 \n\ 182 .align 5 \n\
183 .globl __down_failed \n\ 183 .globl __down_failed \n\
184__down_failed: \n\ 184__down_failed: \n\
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 4554c961251c..e7d22dbcb691 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -624,6 +624,9 @@ void __attribute__((noreturn)) __bug(const char *file, int line, void *data)
624 printk(" - extra data = %p", data); 624 printk(" - extra data = %p", data);
625 printk("\n"); 625 printk("\n");
626 *(int *)0 = 0; 626 *(int *)0 = 0;
627
628 /* Avoid "noreturn function does return" */
629 for (;;);
627} 630}
628EXPORT_SYMBOL(__bug); 631EXPORT_SYMBOL(__bug);
629 632
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index ad2d66c93a5c..08e58ecd44be 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -23,20 +23,20 @@ SECTIONS
23 *(.init.text) 23 *(.init.text)
24 _einittext = .; 24 _einittext = .;
25 __proc_info_begin = .; 25 __proc_info_begin = .;
26 *(.proc.info) 26 *(.proc.info.init)
27 __proc_info_end = .; 27 __proc_info_end = .;
28 __arch_info_begin = .; 28 __arch_info_begin = .;
29 *(.arch.info) 29 *(.arch.info.init)
30 __arch_info_end = .; 30 __arch_info_end = .;
31 __tagtable_begin = .; 31 __tagtable_begin = .;
32 *(.taglist) 32 *(.taglist.init)
33 __tagtable_end = .; 33 __tagtable_end = .;
34 . = ALIGN(16); 34 . = ALIGN(16);
35 __setup_start = .; 35 __setup_start = .;
36 *(.init.setup) 36 *(.init.setup)
37 __setup_end = .; 37 __setup_end = .;
38 __early_begin = .; 38 __early_begin = .;
39 *(__early_param) 39 *(.early_param.init)
40 __early_end = .; 40 __early_end = .;
41 __initcall_start = .; 41 __initcall_start = .;
42 *(.initcall1.init) 42 *(.initcall1.init)
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index ae1fa099d5fa..39b06ed80646 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -123,6 +123,7 @@ static void __init ixdp425_init(void)
123 platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); 123 platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices));
124} 124}
125 125
126#ifdef CONFIG_ARCH_IXDP465
126MACHINE_START(IXDP425, "Intel IXDP425 Development Platform") 127MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
127 /* Maintainer: MontaVista Software, Inc. */ 128 /* Maintainer: MontaVista Software, Inc. */
128 .phys_ram = PHYS_OFFSET, 129 .phys_ram = PHYS_OFFSET,
@@ -134,7 +135,9 @@ MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
134 .boot_params = 0x0100, 135 .boot_params = 0x0100,
135 .init_machine = ixdp425_init, 136 .init_machine = ixdp425_init,
136MACHINE_END 137MACHINE_END
138#endif
137 139
140#ifdef CONFIG_MACH_IXDP465
138MACHINE_START(IXDP465, "Intel IXDP465 Development Platform") 141MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
139 /* Maintainer: MontaVista Software, Inc. */ 142 /* Maintainer: MontaVista Software, Inc. */
140 .phys_ram = PHYS_OFFSET, 143 .phys_ram = PHYS_OFFSET,
@@ -146,7 +149,9 @@ MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
146 .boot_params = 0x0100, 149 .boot_params = 0x0100,
147 .init_machine = ixdp425_init, 150 .init_machine = ixdp425_init,
148MACHINE_END 151MACHINE_END
152#endif
149 153
154#ifdef CONFIG_ARCH_PRPMC1100
150MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform") 155MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
151 /* Maintainer: MontaVista Software, Inc. */ 156 /* Maintainer: MontaVista Software, Inc. */
152 .phys_ram = PHYS_OFFSET, 157 .phys_ram = PHYS_OFFSET,
@@ -158,6 +163,7 @@ MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
158 .boot_params = 0x0100, 163 .boot_params = 0x0100,
159 .init_machine = ixdp425_init, 164 .init_machine = ixdp425_init,
160MACHINE_END 165MACHINE_END
166#endif
161 167
162/* 168/*
163 * Avila is functionally equivalent to IXDP425 except that it adds 169 * Avila is functionally equivalent to IXDP425 except that it adds
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 426c2bc517eb..be37586cb1b0 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -198,13 +198,10 @@ static void corgi_mci_setpower(struct device *dev, unsigned int vdd)
198{ 198{
199 struct pxamci_platform_data* p_d = dev->platform_data; 199 struct pxamci_platform_data* p_d = dev->platform_data;
200 200
201 if (( 1 << vdd) & p_d->ocr_mask) { 201 if (( 1 << vdd) & p_d->ocr_mask)
202 printk(KERN_DEBUG "%s: on\n", __FUNCTION__);
203 GPSR1 = GPIO_bit(CORGI_GPIO_SD_PWR); 202 GPSR1 = GPIO_bit(CORGI_GPIO_SD_PWR);
204 } else { 203 else
205 printk(KERN_DEBUG "%s: off\n", __FUNCTION__);
206 GPCR1 = GPIO_bit(CORGI_GPIO_SD_PWR); 204 GPCR1 = GPIO_bit(CORGI_GPIO_SD_PWR);
207 }
208} 205}
209 206
210static int corgi_mci_get_ro(struct device *dev) 207static int corgi_mci_get_ro(struct device *dev)
@@ -259,6 +256,16 @@ static struct platform_device *devices[] __initdata = {
259 256
260static void __init corgi_init(void) 257static void __init corgi_init(void)
261{ 258{
259 /* setup sleep mode values */
260 PWER = 0x00000002;
261 PFER = 0x00000000;
262 PRER = 0x00000002;
263 PGSR0 = 0x0158C000;
264 PGSR1 = 0x00FF0080;
265 PGSR2 = 0x0001C004;
266 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
267 PCFR |= PCFR_OPDE;
268
262 corgi_ssp_set_machinfo(&corgi_ssp_machinfo); 269 corgi_ssp_set_machinfo(&corgi_ssp_machinfo);
263 270
264 pxa_gpio_mode(CORGI_GPIO_USB_PULLUP | GPIO_OUT); 271 pxa_gpio_mode(CORGI_GPIO_USB_PULLUP | GPIO_OUT);
@@ -285,42 +292,14 @@ static void __init fixup_corgi(struct machine_desc *desc,
285 mi->bank[0].size = (64*1024*1024); 292 mi->bank[0].size = (64*1024*1024);
286} 293}
287 294
288static void __init corgi_init_irq(void)
289{
290 pxa_init_irq();
291}
292
293static struct map_desc corgi_io_desc[] __initdata = {
294/* virtual physical length */
295/* { 0xf1000000, 0x08000000, 0x01000000, MT_DEVICE },*/ /* LCDC (readable for Qt driver) */
296/* { 0xef700000, 0x10800000, 0x00001000, MT_DEVICE },*/ /* SCOOP */
297 { 0xef800000, 0x00000000, 0x00800000, MT_DEVICE }, /* Boot Flash */
298};
299
300static void __init corgi_map_io(void)
301{
302 pxa_map_io();
303 iotable_init(corgi_io_desc,ARRAY_SIZE(corgi_io_desc));
304
305 /* setup sleep mode values */
306 PWER = 0x00000002;
307 PFER = 0x00000000;
308 PRER = 0x00000002;
309 PGSR0 = 0x0158C000;
310 PGSR1 = 0x00FF0080;
311 PGSR2 = 0x0001C004;
312 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
313 PCFR |= PCFR_OPDE;
314}
315
316#ifdef CONFIG_MACH_CORGI 295#ifdef CONFIG_MACH_CORGI
317MACHINE_START(CORGI, "SHARP Corgi") 296MACHINE_START(CORGI, "SHARP Corgi")
318 .phys_ram = 0xa0000000, 297 .phys_ram = 0xa0000000,
319 .phys_io = 0x40000000, 298 .phys_io = 0x40000000,
320 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 299 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
321 .fixup = fixup_corgi, 300 .fixup = fixup_corgi,
322 .map_io = corgi_map_io, 301 .map_io = pxa_map_io,
323 .init_irq = corgi_init_irq, 302 .init_irq = pxa_init_irq,
324 .init_machine = corgi_init, 303 .init_machine = corgi_init,
325 .timer = &pxa_timer, 304 .timer = &pxa_timer,
326MACHINE_END 305MACHINE_END
@@ -332,8 +311,8 @@ MACHINE_START(SHEPHERD, "SHARP Shepherd")
332 .phys_io = 0x40000000, 311 .phys_io = 0x40000000,
333 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 312 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
334 .fixup = fixup_corgi, 313 .fixup = fixup_corgi,
335 .map_io = corgi_map_io, 314 .map_io = pxa_map_io,
336 .init_irq = corgi_init_irq, 315 .init_irq = pxa_init_irq,
337 .init_machine = corgi_init, 316 .init_machine = corgi_init,
338 .timer = &pxa_timer, 317 .timer = &pxa_timer,
339MACHINE_END 318MACHINE_END
@@ -345,8 +324,8 @@ MACHINE_START(HUSKY, "SHARP Husky")
345 .phys_io = 0x40000000, 324 .phys_io = 0x40000000,
346 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 325 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
347 .fixup = fixup_corgi, 326 .fixup = fixup_corgi,
348 .map_io = corgi_map_io, 327 .map_io = pxa_map_io,
349 .init_irq = corgi_init_irq, 328 .init_irq = pxa_init_irq,
350 .init_machine = corgi_init, 329 .init_machine = corgi_init,
351 .timer = &pxa_timer, 330 .timer = &pxa_timer,
352MACHINE_END 331MACHINE_END
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 923f6eb774c0..1f38033921e9 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -146,6 +146,11 @@ static struct pxa2xx_udc_mach_info udc_info __initdata = {
146 // no D+ pullup; lubbock can't connect/disconnect in software 146 // no D+ pullup; lubbock can't connect/disconnect in software
147}; 147};
148 148
149static struct platform_device lub_audio_device = {
150 .name = "pxa2xx-ac97",
151 .id = -1,
152};
153
149static struct resource sa1111_resources[] = { 154static struct resource sa1111_resources[] = {
150 [0] = { 155 [0] = {
151 .start = 0x10000000, 156 .start = 0x10000000,
@@ -195,6 +200,7 @@ static struct platform_device smc91x_device = {
195 200
196static struct platform_device *devices[] __initdata = { 201static struct platform_device *devices[] __initdata = {
197 &sa1111_device, 202 &sa1111_device,
203 &lub_audio_device,
198 &smc91x_device, 204 &smc91x_device,
199}; 205};
200 206
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 47cfb8bb8318..f25638810017 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -30,6 +30,8 @@
30 30
31#include <asm/arch/pxa-regs.h> 31#include <asm/arch/pxa-regs.h>
32#include <asm/arch/irq.h> 32#include <asm/arch/irq.h>
33#include <asm/arch/mmc.h>
34#include <asm/arch/udc.h>
33#include <asm/arch/poodle.h> 35#include <asm/arch/poodle.h>
34#include <asm/arch/pxafb.h> 36#include <asm/arch/pxafb.h>
35 37
@@ -93,6 +95,83 @@ static struct platform_device locomo_device = {
93 .resource = locomo_resources, 95 .resource = locomo_resources,
94}; 96};
95 97
98
99/*
100 * MMC/SD Device
101 *
102 * The card detect interrupt isn't debounced so we delay it by 250ms
103 * to give the card a chance to fully insert/eject.
104 */
105static struct pxamci_platform_data poodle_mci_platform_data;
106
107static int poodle_mci_init(struct device *dev, irqreturn_t (*poodle_detect_int)(int, void *, struct pt_regs *), void *data)
108{
109 int err;
110
111 /* setup GPIO for PXA25x MMC controller */
112 pxa_gpio_mode(GPIO6_MMCCLK_MD);
113 pxa_gpio_mode(GPIO8_MMCCS0_MD);
114 pxa_gpio_mode(POODLE_GPIO_nSD_DETECT | GPIO_IN);
115 pxa_gpio_mode(POODLE_GPIO_SD_PWR | GPIO_OUT);
116
117 poodle_mci_platform_data.detect_delay = msecs_to_jiffies(250);
118
119 err = request_irq(POODLE_IRQ_GPIO_nSD_DETECT, poodle_detect_int, SA_INTERRUPT,
120 "MMC card detect", data);
121 if (err) {
122 printk(KERN_ERR "poodle_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
123 return -1;
124 }
125
126 set_irq_type(POODLE_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);
127
128 return 0;
129}
130
131static void poodle_mci_setpower(struct device *dev, unsigned int vdd)
132{
133 struct pxamci_platform_data* p_d = dev->platform_data;
134
135 if (( 1 << vdd) & p_d->ocr_mask)
136 GPSR1 = GPIO_bit(POODLE_GPIO_SD_PWR);
137 else
138 GPCR1 = GPIO_bit(POODLE_GPIO_SD_PWR);
139}
140
141static void poodle_mci_exit(struct device *dev, void *data)
142{
143 free_irq(POODLE_IRQ_GPIO_nSD_DETECT, data);
144}
145
146static struct pxamci_platform_data poodle_mci_platform_data = {
147 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
148 .init = poodle_mci_init,
149 .setpower = poodle_mci_setpower,
150 .exit = poodle_mci_exit,
151};
152
153
154/*
155 * USB Device Controller
156 */
157static void poodle_udc_command(int cmd)
158{
159 switch(cmd) {
160 case PXA2XX_UDC_CMD_CONNECT:
161 GPSR(POODLE_GPIO_USB_PULLUP) = GPIO_bit(POODLE_GPIO_USB_PULLUP);
162 break;
163 case PXA2XX_UDC_CMD_DISCONNECT:
164 GPCR(POODLE_GPIO_USB_PULLUP) = GPIO_bit(POODLE_GPIO_USB_PULLUP);
165 break;
166 }
167}
168
169static struct pxa2xx_udc_mach_info udc_info __initdata = {
170 /* no connect GPIO; poodle can't tell connection status */
171 .udc_command = poodle_udc_command,
172};
173
174
96/* PXAFB device */ 175/* PXAFB device */
97static struct pxafb_mach_info poodle_fb_info __initdata = { 176static struct pxafb_mach_info poodle_fb_info __initdata = {
98 .pixclock = 144700, 177 .pixclock = 144700,
@@ -126,6 +205,15 @@ static void __init poodle_init(void)
126{ 205{
127 int ret = 0; 206 int ret = 0;
128 207
208 /* setup sleep mode values */
209 PWER = 0x00000002;
210 PFER = 0x00000000;
211 PRER = 0x00000002;
212 PGSR0 = 0x00008000;
213 PGSR1 = 0x003F0202;
214 PGSR2 = 0x0001C000;
215 PCFR |= PCFR_OPDE;
216
129 /* cpu initialize */ 217 /* cpu initialize */
130 /* Pgsr Register */ 218 /* Pgsr Register */
131 PGSR0 = 0x0146dd80; 219 PGSR0 = 0x0146dd80;
@@ -155,6 +243,9 @@ static void __init poodle_init(void)
155 GPSR2 = 0x00000000; 243 GPSR2 = 0x00000000;
156 244
157 set_pxa_fb_info(&poodle_fb_info); 245 set_pxa_fb_info(&poodle_fb_info);
246 pxa_gpio_mode(POODLE_GPIO_USB_PULLUP | GPIO_OUT);
247 pxa_set_udc_info(&udc_info);
248 pxa_set_mci_info(&poodle_mci_platform_data);
158 249
159 scoop_num = 1; 250 scoop_num = 1;
160 scoop_devs = &poodle_pcmcia_scoop[0]; 251 scoop_devs = &poodle_pcmcia_scoop[0];
@@ -171,32 +262,12 @@ static void __init fixup_poodle(struct machine_desc *desc,
171 sharpsl_save_param(); 262 sharpsl_save_param();
172} 263}
173 264
174static struct map_desc poodle_io_desc[] __initdata = {
175 /* virtual physical length */
176 { 0xef800000, 0x00000000, 0x00800000, MT_DEVICE }, /* Boot Flash */
177};
178
179static void __init poodle_map_io(void)
180{
181 pxa_map_io();
182 iotable_init(poodle_io_desc, ARRAY_SIZE(poodle_io_desc));
183
184 /* setup sleep mode values */
185 PWER = 0x00000002;
186 PFER = 0x00000000;
187 PRER = 0x00000002;
188 PGSR0 = 0x00008000;
189 PGSR1 = 0x003F0202;
190 PGSR2 = 0x0001C000;
191 PCFR |= PCFR_OPDE;
192}
193
194MACHINE_START(POODLE, "SHARP Poodle") 265MACHINE_START(POODLE, "SHARP Poodle")
195 .phys_ram = 0xa0000000, 266 .phys_ram = 0xa0000000,
196 .phys_io = 0x40000000, 267 .phys_io = 0x40000000,
197 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 268 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
198 .fixup = fixup_poodle, 269 .fixup = fixup_poodle,
199 .map_io = poodle_map_io, 270 .map_io = pxa_map_io,
200 .init_irq = pxa_init_irq, 271 .init_irq = pxa_init_irq,
201 .timer = &pxa_timer, 272 .timer = &pxa_timer,
202 .init_machine = poodle_init, 273 .init_machine = poodle_init,
diff --git a/arch/arm/mach-s3c2410/mach-anubis.c b/arch/arm/mach-s3c2410/mach-anubis.c
index f87aa0b669ad..7c05f27fe1d6 100644
--- a/arch/arm/mach-s3c2410/mach-anubis.c
+++ b/arch/arm/mach-s3c2410/mach-anubis.c
@@ -12,6 +12,7 @@
12 * 12 *
13 * Modifications: 13 * Modifications:
14 * 02-May-2005 BJD Copied from mach-bast.c 14 * 02-May-2005 BJD Copied from mach-bast.c
15 * 20-Sep-2005 BJD Added static to non-exported items
15*/ 16*/
16 17
17#include <linux/kernel.h> 18#include <linux/kernel.h>
@@ -232,7 +233,7 @@ static struct s3c24xx_board anubis_board __initdata = {
232 .clocks_count = ARRAY_SIZE(anubis_clocks) 233 .clocks_count = ARRAY_SIZE(anubis_clocks)
233}; 234};
234 235
235void __init anubis_map_io(void) 236static void __init anubis_map_io(void)
236{ 237{
237 /* initialise the clocks */ 238 /* initialise the clocks */
238 239
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 1a3367da6408..ed1f07d7252f 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -31,6 +31,7 @@
31 * 17-Jul-2005 BJD Changed to platform device for SuperIO 16550s 31 * 17-Jul-2005 BJD Changed to platform device for SuperIO 16550s
32 * 25-Jul-2005 BJD Removed ASIX static mappings 32 * 25-Jul-2005 BJD Removed ASIX static mappings
33 * 27-Jul-2005 BJD Ensure maximum frequency of i2c bus 33 * 27-Jul-2005 BJD Ensure maximum frequency of i2c bus
34 * 20-Sep-2005 BJD Added static to non-exported items
34*/ 35*/
35 36
36#include <linux/kernel.h> 37#include <linux/kernel.h>
@@ -428,7 +429,7 @@ static struct s3c24xx_board bast_board __initdata = {
428 .clocks_count = ARRAY_SIZE(bast_clocks) 429 .clocks_count = ARRAY_SIZE(bast_clocks)
429}; 430};
430 431
431void __init bast_map_io(void) 432static void __init bast_map_io(void)
432{ 433{
433 /* initialise the clocks */ 434 /* initialise the clocks */
434 435
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 6ff1889fbd21..fb3cb01266e5 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -24,6 +24,7 @@
24 * 10-Jan-2005 BJD Removed include of s3c2410.h 24 * 10-Jan-2005 BJD Removed include of s3c2410.h
25 * 14-Jan-2005 BJD Added clock init 25 * 14-Jan-2005 BJD Added clock init
26 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 26 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
27 * 20-Sep-2005 BJD Added static to non-exported items
27*/ 28*/
28 29
29#include <linux/kernel.h> 30#include <linux/kernel.h>
@@ -147,7 +148,7 @@ static struct s3c24xx_board h1940_board __initdata = {
147 .devices_count = ARRAY_SIZE(h1940_devices) 148 .devices_count = ARRAY_SIZE(h1940_devices)
148}; 149};
149 150
150void __init h1940_map_io(void) 151static void __init h1940_map_io(void)
151{ 152{
152 s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc)); 153 s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc));
153 s3c24xx_init_clocks(0); 154 s3c24xx_init_clocks(0);
@@ -155,13 +156,13 @@ void __init h1940_map_io(void)
155 s3c24xx_set_board(&h1940_board); 156 s3c24xx_set_board(&h1940_board);
156} 157}
157 158
158void __init h1940_init_irq(void) 159static void __init h1940_init_irq(void)
159{ 160{
160 s3c24xx_init_irq(); 161 s3c24xx_init_irq();
161 162
162} 163}
163 164
164void __init h1940_init(void) 165static void __init h1940_init(void)
165{ 166{
166 set_s3c2410fb_info(&h1940_lcdcfg); 167 set_s3c2410fb_info(&h1940_lcdcfg);
167} 168}
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 66bf5bb2b3db..5c0f2b091f95 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -97,7 +97,7 @@ static struct s3c24xx_board n30_board __initdata = {
97 .devices_count = ARRAY_SIZE(n30_devices) 97 .devices_count = ARRAY_SIZE(n30_devices)
98}; 98};
99 99
100void __init n30_map_io(void) 100static void __init n30_map_io(void)
101{ 101{
102 s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc)); 102 s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc));
103 s3c24xx_init_clocks(0); 103 s3c24xx_init_clocks(0);
@@ -105,14 +105,14 @@ void __init n30_map_io(void)
105 s3c24xx_set_board(&n30_board); 105 s3c24xx_set_board(&n30_board);
106} 106}
107 107
108void __init n30_init_irq(void) 108static void __init n30_init_irq(void)
109{ 109{
110 s3c24xx_init_irq(); 110 s3c24xx_init_irq();
111} 111}
112 112
113/* GPB3 is the line that controls the pull-up for the USB D+ line */ 113/* GPB3 is the line that controls the pull-up for the USB D+ line */
114 114
115void __init n30_init(void) 115static void __init n30_init(void)
116{ 116{
117 s3c_device_i2c.dev.platform_data = &n30_i2ccfg; 117 s3c_device_i2c.dev.platform_data = &n30_i2ccfg;
118 118
diff --git a/arch/arm/mach-s3c2410/mach-nexcoder.c b/arch/arm/mach-s3c2410/mach-nexcoder.c
index d24c242414ca..c22f8216032d 100644
--- a/arch/arm/mach-s3c2410/mach-nexcoder.c
+++ b/arch/arm/mach-s3c2410/mach-nexcoder.c
@@ -136,7 +136,7 @@ static void __init nexcoder_sensorboard_init(void)
136 s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP); // CAM_GPIO6 => CAM_PWRDN 136 s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP); // CAM_GPIO6 => CAM_PWRDN
137} 137}
138 138
139void __init nexcoder_map_io(void) 139static void __init nexcoder_map_io(void)
140{ 140{
141 s3c24xx_init_io(nexcoder_iodesc, ARRAY_SIZE(nexcoder_iodesc)); 141 s3c24xx_init_io(nexcoder_iodesc, ARRAY_SIZE(nexcoder_iodesc));
142 s3c24xx_init_clocks(0); 142 s3c24xx_init_clocks(0);
diff --git a/arch/arm/mach-s3c2410/mach-otom.c b/arch/arm/mach-s3c2410/mach-otom.c
index d901ed492ff5..ad1459e402e2 100644
--- a/arch/arm/mach-s3c2410/mach-otom.c
+++ b/arch/arm/mach-s3c2410/mach-otom.c
@@ -105,7 +105,7 @@ static struct s3c24xx_board otom11_board __initdata = {
105}; 105};
106 106
107 107
108void __init otom11_map_io(void) 108static void __init otom11_map_io(void)
109{ 109{
110 s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc)); 110 s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc));
111 s3c24xx_init_clocks(0); 111 s3c24xx_init_clocks(0);
diff --git a/arch/arm/mach-s3c2410/mach-rx3715.c b/arch/arm/mach-s3c2410/mach-rx3715.c
index a73d61c1de46..22d9e070fd68 100644
--- a/arch/arm/mach-s3c2410/mach-rx3715.c
+++ b/arch/arm/mach-s3c2410/mach-rx3715.c
@@ -16,6 +16,7 @@
16 * 14-Jan-2005 BJD Added new clock init 16 * 14-Jan-2005 BJD Added new clock init
17 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 17 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
18 * 14-Mar-2005 BJD Fixed __iomem warnings 18 * 14-Mar-2005 BJD Fixed __iomem warnings
19 * 20-Sep-2005 BJD Added static to non-exported items
19*/ 20*/
20 21
21#include <linux/kernel.h> 22#include <linux/kernel.h>
@@ -108,7 +109,7 @@ static struct s3c24xx_board rx3715_board __initdata = {
108 .devices_count = ARRAY_SIZE(rx3715_devices) 109 .devices_count = ARRAY_SIZE(rx3715_devices)
109}; 110};
110 111
111void __init rx3715_map_io(void) 112static void __init rx3715_map_io(void)
112{ 113{
113 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc)); 114 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
114 s3c24xx_init_clocks(16934000); 115 s3c24xx_init_clocks(16934000);
@@ -116,7 +117,7 @@ void __init rx3715_map_io(void)
116 s3c24xx_set_board(&rx3715_board); 117 s3c24xx_set_board(&rx3715_board);
117} 118}
118 119
119void __init rx3715_init_irq(void) 120static void __init rx3715_init_irq(void)
120{ 121{
121 s3c24xx_init_irq(); 122 s3c24xx_init_irq();
122} 123}
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c
index 67e903a700d3..2eda55a6b678 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2410.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2410.c
@@ -28,6 +28,7 @@
28 * Ben Dooks <ben@simtec.co.uk> 28 * Ben Dooks <ben@simtec.co.uk>
29 * 29 *
30 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 30 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
31 * 20-Sep-2005 BJD Added static to non-exported items
31 * 32 *
32 ***********************************************************************/ 33 ***********************************************************************/
33 34
@@ -97,7 +98,7 @@ static struct s3c24xx_board smdk2410_board __initdata = {
97 .devices_count = ARRAY_SIZE(smdk2410_devices) 98 .devices_count = ARRAY_SIZE(smdk2410_devices)
98}; 99};
99 100
100void __init smdk2410_map_io(void) 101static void __init smdk2410_map_io(void)
101{ 102{
102 s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc)); 103 s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));
103 s3c24xx_init_clocks(0); 104 s3c24xx_init_clocks(0);
@@ -105,7 +106,7 @@ void __init smdk2410_map_io(void)
105 s3c24xx_set_board(&smdk2410_board); 106 s3c24xx_set_board(&smdk2410_board);
106} 107}
107 108
108void __init smdk2410_init_irq(void) 109static void __init smdk2410_init_irq(void)
109{ 110{
110 s3c24xx_init_irq(); 111 s3c24xx_init_irq();
111} 112}
diff --git a/arch/arm/mach-s3c2410/mach-smdk2440.c b/arch/arm/mach-s3c2410/mach-smdk2440.c
index 357522106f68..722ef46b630a 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2440.c
@@ -18,6 +18,7 @@
18 * 22-Feb-2005 BJD Updated for 2.6.11-rc5 relesa 18 * 22-Feb-2005 BJD Updated for 2.6.11-rc5 relesa
19 * 10-Mar-2005 LCVR Replaced S3C2410_VA by S3C24XX_VA 19 * 10-Mar-2005 LCVR Replaced S3C2410_VA by S3C24XX_VA
20 * 14-Mar-2005 BJD void __iomem fixes 20 * 14-Mar-2005 BJD void __iomem fixes
21 * 20-Sep-2005 BJD Added static to non-exported items
21*/ 22*/
22 23
23#include <linux/kernel.h> 24#include <linux/kernel.h>
@@ -98,7 +99,7 @@ static struct s3c24xx_board smdk2440_board __initdata = {
98 .devices_count = ARRAY_SIZE(smdk2440_devices) 99 .devices_count = ARRAY_SIZE(smdk2440_devices)
99}; 100};
100 101
101void __init smdk2440_map_io(void) 102static void __init smdk2440_map_io(void)
102{ 103{
103 s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc)); 104 s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
104 s3c24xx_init_clocks(16934400); 105 s3c24xx_init_clocks(16934400);
@@ -106,7 +107,7 @@ void __init smdk2440_map_io(void)
106 s3c24xx_set_board(&smdk2440_board); 107 s3c24xx_set_board(&smdk2440_board);
107} 108}
108 109
109void __init smdk2440_machine_init(void) 110static void __init smdk2440_machine_init(void)
110{ 111{
111 /* Configure the LEDs (even if we have no LED support)*/ 112 /* Configure the LEDs (even if we have no LED support)*/
112 113
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 8f9ab2893df4..663a7f98fc0b 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -28,6 +28,7 @@
28 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 28 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
29 * 14-Mar-2006 BJD void __iomem fixes 29 * 14-Mar-2006 BJD void __iomem fixes
30 * 22-Jun-2006 BJD Added DM9000 platform information 30 * 22-Jun-2006 BJD Added DM9000 platform information
31 * 20-Sep-2005 BJD Added static to non-exported items
31*/ 32*/
32 33
33#include <linux/kernel.h> 34#include <linux/kernel.h>
@@ -347,7 +348,7 @@ static void vr1000_power_off(void)
347 s3c2410_gpio_setpin(S3C2410_GPB9, 1); 348 s3c2410_gpio_setpin(S3C2410_GPB9, 1);
348} 349}
349 350
350void __init vr1000_map_io(void) 351static void __init vr1000_map_io(void)
351{ 352{
352 /* initialise clock sources */ 353 /* initialise clock sources */
353 354
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 8cb69113a57c..25d6a4e27533 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -111,12 +111,11 @@ static struct mtd_partition collie_partitions[] = {
111 111
112static void collie_set_vpp(int vpp) 112static void collie_set_vpp(int vpp)
113{ 113{
114 write_scoop_reg(SCOOP_GPCR, read_scoop_reg(SCOOP_GPCR) | COLLIE_SCP_VPEN); 114 write_scoop_reg(&colliescoop_device.dev, SCOOP_GPCR, read_scoop_reg(SCOOP_GPCR) | COLLIE_SCP_VPEN);
115 if (vpp) { 115 if (vpp)
116 write_scoop_reg(SCOOP_GPWR, read_scoop_reg(SCOOP_GPWR) | COLLIE_SCP_VPEN); 116 write_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR, read_scoop_reg(SCOOP_GPWR) | COLLIE_SCP_VPEN);
117 } else { 117 else
118 write_scoop_reg(SCOOP_GPWR, read_scoop_reg(SCOOP_GPWR) & ~COLLIE_SCP_VPEN); 118 write_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR, read_scoop_reg(SCOOP_GPWR) & ~COLLIE_SCP_VPEN);
119 }
120} 119}
121 120
122static struct flash_platform_data collie_flash_data = { 121static struct flash_platform_data collie_flash_data = {
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index 279e3afa3c39..f085d68e568e 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -39,3 +39,6 @@ extern void sa11x0_set_ssp_data(struct sa11x0_ssp_plat_ops *ops);
39 39
40struct irda_platform_data; 40struct irda_platform_data;
41void sa11x0_set_irda_data(struct irda_platform_data *irda); 41void sa11x0_set_irda_data(struct irda_platform_data *irda);
42
43struct mcp_plat_data;
44void sa11x0_set_mcp_data(struct mcp_plat_data *data);
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 0b6c4db44e08..4a884baf3b9c 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -233,7 +233,17 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
233 if (in_interrupt() || !mm) 233 if (in_interrupt() || !mm)
234 goto no_context; 234 goto no_context;
235 235
236 down_read(&mm->mmap_sem); 236 /*
237 * As per x86, we may deadlock here. However, since the kernel only
238 * validly references user space from well defined areas of the code,
239 * we can bug out early if this is from code which shouldn't.
240 */
241 if (!down_read_trylock(&mm->mmap_sem)) {
242 if (!user_mode(regs) && !search_exception_tables(regs->ARM_pc))
243 goto no_context;
244 down_read(&mm->mmap_sem);
245 }
246
237 fault = __do_page_fault(mm, addr, fsr, tsk); 247 fault = __do_page_fault(mm, addr, fsr, tsk);
238 up_read(&mm->mmap_sem); 248 up_read(&mm->mmap_sem);
239 249
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S
index 1d739d282a45..82ec954e45b6 100644
--- a/arch/arm/mm/proc-arm1020.S
+++ b/arch/arm/mm/proc-arm1020.S
@@ -509,7 +509,7 @@ cpu_arm1020_name:
509 509
510 .align 510 .align
511 511
512 .section ".proc.info", #alloc, #execinstr 512 .section ".proc.info.init", #alloc, #execinstr
513 513
514 .type __arm1020_proc_info,#object 514 .type __arm1020_proc_info,#object
515__arm1020_proc_info: 515__arm1020_proc_info:
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S
index 9b725665b5c7..7375fe930f72 100644
--- a/arch/arm/mm/proc-arm1020e.S
+++ b/arch/arm/mm/proc-arm1020e.S
@@ -491,7 +491,7 @@ cpu_arm1020e_name:
491 491
492 .align 492 .align
493 493
494 .section ".proc.info", #alloc, #execinstr 494 .section ".proc.info.init", #alloc, #execinstr
495 495
496 .type __arm1020e_proc_info,#object 496 .type __arm1020e_proc_info,#object
497__arm1020e_proc_info: 497__arm1020e_proc_info:
diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S
index 37b70fa21c76..6ca639094d6f 100644
--- a/arch/arm/mm/proc-arm1022.S
+++ b/arch/arm/mm/proc-arm1022.S
@@ -473,7 +473,7 @@ cpu_arm1022_name:
473 473
474 .align 474 .align
475 475
476 .section ".proc.info", #alloc, #execinstr 476 .section ".proc.info.init", #alloc, #execinstr
477 477
478 .type __arm1022_proc_info,#object 478 .type __arm1022_proc_info,#object
479__arm1022_proc_info: 479__arm1022_proc_info:
diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S
index 931b690d1be2..10317e4f55d2 100644
--- a/arch/arm/mm/proc-arm1026.S
+++ b/arch/arm/mm/proc-arm1026.S
@@ -469,7 +469,7 @@ cpu_arm1026_name:
469 469
470 .align 470 .align
471 471
472 .section ".proc.info", #alloc, #execinstr 472 .section ".proc.info.init", #alloc, #execinstr
473 473
474 .type __arm1026_proc_info,#object 474 .type __arm1026_proc_info,#object
475__arm1026_proc_info: 475__arm1026_proc_info:
diff --git a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S
index d0f1bbb48f6c..8e7e1e70ab05 100644
--- a/arch/arm/mm/proc-arm6_7.S
+++ b/arch/arm/mm/proc-arm6_7.S
@@ -332,7 +332,7 @@ cpu_arm710_name:
332 332
333 .align 333 .align
334 334
335 .section ".proc.info", #alloc, #execinstr 335 .section ".proc.info.init", #alloc, #execinstr
336 336
337 .type __arm6_proc_info, #object 337 .type __arm6_proc_info, #object
338__arm6_proc_info: 338__arm6_proc_info:
diff --git a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S
index c69c9de32391..a13e0184d343 100644
--- a/arch/arm/mm/proc-arm720.S
+++ b/arch/arm/mm/proc-arm720.S
@@ -222,7 +222,7 @@ cpu_arm720_name:
222 * See linux/include/asm-arm/procinfo.h for a definition of this structure. 222 * See linux/include/asm-arm/procinfo.h for a definition of this structure.
223 */ 223 */
224 224
225 .section ".proc.info", #alloc, #execinstr 225 .section ".proc.info.init", #alloc, #execinstr
226 226
227 .type __arm710_proc_info, #object 227 .type __arm710_proc_info, #object
228__arm710_proc_info: 228__arm710_proc_info:
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
index 0f490a0fcb71..d16513899999 100644
--- a/arch/arm/mm/proc-arm920.S
+++ b/arch/arm/mm/proc-arm920.S
@@ -452,7 +452,7 @@ cpu_arm920_name:
452 452
453 .align 453 .align
454 454
455 .section ".proc.info", #alloc, #execinstr 455 .section ".proc.info.init", #alloc, #execinstr
456 456
457 .type __arm920_proc_info,#object 457 .type __arm920_proc_info,#object
458__arm920_proc_info: 458__arm920_proc_info:
diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S
index 62bc34a139ee..23b8ed97f4e3 100644
--- a/arch/arm/mm/proc-arm922.S
+++ b/arch/arm/mm/proc-arm922.S
@@ -456,7 +456,7 @@ cpu_arm922_name:
456 456
457 .align 457 .align
458 458
459 .section ".proc.info", #alloc, #execinstr 459 .section ".proc.info.init", #alloc, #execinstr
460 460
461 .type __arm922_proc_info,#object 461 .type __arm922_proc_info,#object
462__arm922_proc_info: 462__arm922_proc_info:
diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S
index ee49aa2ca781..ee95c52db513 100644
--- a/arch/arm/mm/proc-arm925.S
+++ b/arch/arm/mm/proc-arm925.S
@@ -521,7 +521,7 @@ cpu_arm925_name:
521 521
522 .align 522 .align
523 523
524 .section ".proc.info", #alloc, #execinstr 524 .section ".proc.info.init", #alloc, #execinstr
525 525
526 .type __arm925_proc_info,#object 526 .type __arm925_proc_info,#object
527__arm925_proc_info: 527__arm925_proc_info:
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
index bb95cc9fed03..7d042dc20c47 100644
--- a/arch/arm/mm/proc-arm926.S
+++ b/arch/arm/mm/proc-arm926.S
@@ -471,7 +471,7 @@ cpu_arm926_name:
471 471
472 .align 472 .align
473 473
474 .section ".proc.info", #alloc, #execinstr 474 .section ".proc.info.init", #alloc, #execinstr
475 475
476 .type __arm926_proc_info,#object 476 .type __arm926_proc_info,#object
477__arm926_proc_info: 477__arm926_proc_info:
diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S
index 34f7e7d3f419..bd330c4075a1 100644
--- a/arch/arm/mm/proc-sa110.S
+++ b/arch/arm/mm/proc-sa110.S
@@ -249,7 +249,7 @@ cpu_sa110_name:
249 249
250 .align 250 .align
251 251
252 .section ".proc.info", #alloc, #execinstr 252 .section ".proc.info.init", #alloc, #execinstr
253 253
254 .type __sa110_proc_info,#object 254 .type __sa110_proc_info,#object
255__sa110_proc_info: 255__sa110_proc_info:
diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S
index ca14f80d5ab4..91b89124c0d7 100644
--- a/arch/arm/mm/proc-sa1100.S
+++ b/arch/arm/mm/proc-sa1100.S
@@ -280,7 +280,7 @@ cpu_sa1110_name:
280 280
281 .align 281 .align
282 282
283 .section ".proc.info", #alloc, #execinstr 283 .section ".proc.info.init", #alloc, #execinstr
284 284
285 .type __sa1100_proc_info,#object 285 .type __sa1100_proc_info,#object
286__sa1100_proc_info: 286__sa1100_proc_info:
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index eb34823c9dbf..caf3b19b167f 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -240,7 +240,7 @@ cpu_elf_name:
240 .size cpu_elf_name, . - cpu_elf_name 240 .size cpu_elf_name, . - cpu_elf_name
241 .align 241 .align
242 242
243 .section ".proc.info", #alloc, #execinstr 243 .section ".proc.info.init", #alloc, #execinstr
244 244
245 /* 245 /*
246 * Match any ARMv6 processor core. 246 * Match any ARMv6 processor core.
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index b88de2700146..861b35947280 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -578,7 +578,7 @@ cpu_pxa270_name:
578 578
579 .align 579 .align
580 580
581 .section ".proc.info", #alloc, #execinstr 581 .section ".proc.info.init", #alloc, #execinstr
582 582
583 .type __80200_proc_info,#object 583 .type __80200_proc_info,#object
584__80200_proc_info: 584__80200_proc_info:
diff --git a/arch/arm26/boot/compressed/hw-bse.c b/arch/arm26/boot/compressed/hw-bse.c
deleted file mode 100644
index 3e8f07f8e08a..000000000000
--- a/arch/arm26/boot/compressed/hw-bse.c
+++ /dev/null
@@ -1,74 +0,0 @@
1/*
2 * Bright Star Engineering Inc.
3 *
4 * code for readng parameters from the
5 * parameter blocks of the boot block
6 * flash memory
7 *
8 */
9
10static int strcmp(const char *s1, const char *s2)
11{
12 while (*s1 != '\0' && *s1 == *s2)
13 {
14 s1++;
15 s2++;
16 }
17
18 return (*(unsigned char *) s1) - (*(unsigned char *) s2);
19}
20
21struct pblk_t {
22 char type;
23 unsigned short size;
24};
25
26static char *bse_getflashparam(char *name) {
27 unsigned int esize;
28 char *q,*r;
29 unsigned char *p,*e;
30 struct pblk_t *thepb = (struct pblk_t *) 0x00004000;
31 struct pblk_t *altpb = (struct pblk_t *) 0x00006000;
32 if (thepb->type&1) {
33 if (altpb->type&1) {
34 /* no valid param block */
35 return (char*)0;
36 } else {
37 /* altpb is valid */
38 struct pblk_t *tmp;
39 tmp = thepb;
40 thepb = altpb;
41 altpb = tmp;
42 }
43 }
44 p = (char*)thepb + sizeof(struct pblk_t);
45 e = p + thepb->size;
46 while (p < e) {
47 q = p;
48 esize = *p;
49 if (esize == 0xFF) break;
50 if (esize == 0) break;
51 if (esize > 127) {
52 esize = (esize&0x7F)<<8 | p[1];
53 q++;
54 }
55 q++;
56 r=q;
57 if (*r && ((name == 0) || (!strcmp(name,r)))) {
58 while (*q++) ;
59 return q;
60 }
61 p+=esize;
62 }
63 return (char*)0;
64}
65
66void bse_setup(void) {
67 /* extract the linux cmdline from flash */
68 char *name=bse_getflashparam("linuxboot");
69 char *x = (char *)0xc0000100;
70 if (name) {
71 while (*name) *x++=*name++;
72 }
73 *x=0;
74}
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index b22f003eaa6d..d2703cda61ea 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -908,11 +908,6 @@ config IRQBALANCE
908 The default yes will allow the kernel to do irq load balancing. 908 The default yes will allow the kernel to do irq load balancing.
909 Saying no will keep the kernel from doing irq load balancing. 909 Saying no will keep the kernel from doing irq load balancing.
910 910
911config HAVE_DEC_LOCK
912 bool
913 depends on (SMP || PREEMPT) && X86_CMPXCHG
914 default y
915
916# turning this on wastes a bunch of space. 911# turning this on wastes a bunch of space.
917# Summit needs it only when NUMA is on 912# Summit needs it only when NUMA is on
918config BOOT_IOREMAP 913config BOOT_IOREMAP
diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/i386/kernel/acpi/earlyquirk.c
index 1ae2aeeda18b..f1b9d2a46dab 100644
--- a/arch/i386/kernel/acpi/earlyquirk.c
+++ b/arch/i386/kernel/acpi/earlyquirk.c
@@ -7,7 +7,6 @@
7#include <linux/pci.h> 7#include <linux/pci.h>
8#include <asm/pci-direct.h> 8#include <asm/pci-direct.h>
9#include <asm/acpi.h> 9#include <asm/acpi.h>
10#include <asm/apic.h>
11 10
12static int __init check_bridge(int vendor, int device) 11static int __init check_bridge(int vendor, int device)
13{ 12{
@@ -16,15 +15,6 @@ static int __init check_bridge(int vendor, int device)
16 if (vendor == PCI_VENDOR_ID_NVIDIA) { 15 if (vendor == PCI_VENDOR_ID_NVIDIA) {
17 acpi_skip_timer_override = 1; 16 acpi_skip_timer_override = 1;
18 } 17 }
19#ifdef CONFIG_X86_LOCAL_APIC
20 /*
21 * ATI IXP chipsets get double timer interrupts.
22 * For now just do this for all ATI chipsets.
23 * FIXME: this needs to be checked for the non ACPI case too.
24 */
25 if (vendor == PCI_VENDOR_ID_ATI)
26 disable_timer_pin_1 = 1;
27#endif
28 return 0; 18 return 0;
29} 19}
30 20
diff --git a/arch/i386/lib/Makefile b/arch/i386/lib/Makefile
index 7b1932d20f96..914933e9ec3d 100644
--- a/arch/i386/lib/Makefile
+++ b/arch/i386/lib/Makefile
@@ -7,4 +7,3 @@ lib-y = checksum.o delay.o usercopy.o getuser.o putuser.o memcpy.o strstr.o \
7 bitops.o 7 bitops.o
8 8
9lib-$(CONFIG_X86_USE_3DNOW) += mmx.o 9lib-$(CONFIG_X86_USE_3DNOW) += mmx.o
10lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
diff --git a/arch/i386/lib/dec_and_lock.c b/arch/i386/lib/dec_and_lock.c
deleted file mode 100644
index 8b81b2524fa6..000000000000
--- a/arch/i386/lib/dec_and_lock.c
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * x86 version of "atomic_dec_and_lock()" using
3 * the atomic "cmpxchg" instruction.
4 *
5 * (For CPU's lacking cmpxchg, we use the slow
6 * generic version, and this one never even gets
7 * compiled).
8 */
9
10#include <linux/spinlock.h>
11#include <linux/module.h>
12#include <asm/atomic.h>
13
14int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)
15{
16 int counter;
17 int newcount;
18
19repeat:
20 counter = atomic_read(atomic);
21 newcount = counter-1;
22
23 if (!newcount)
24 goto slow_path;
25
26 asm volatile("lock; cmpxchgl %1,%2"
27 :"=a" (newcount)
28 :"r" (newcount), "m" (atomic->counter), "0" (counter));
29
30 /* If the above failed, "eax" will have changed */
31 if (newcount != counter)
32 goto repeat;
33 return 0;
34
35slow_path:
36 spin_lock(lock);
37 if (atomic_dec_and_test(atomic))
38 return 1;
39 spin_unlock(lock);
40 return 0;
41}
42EXPORT_SYMBOL(_atomic_dec_and_lock);
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index ed25d66c8d50..945c15a0722b 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -298,11 +298,6 @@ config PREEMPT
298 298
299source "mm/Kconfig" 299source "mm/Kconfig"
300 300
301config HAVE_DEC_LOCK
302 bool
303 depends on (SMP || PREEMPT)
304 default y
305
306config IA32_SUPPORT 301config IA32_SUPPORT
307 bool "Support for Linux/x86 binaries" 302 bool "Support for Linux/x86 binaries"
308 help 303 help
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
index 70f8ed2748d1..67932ad53082 100644
--- a/arch/ia64/Makefile
+++ b/arch/ia64/Makefile
@@ -82,17 +82,7 @@ unwcheck: vmlinux
82archclean: 82archclean:
83 $(Q)$(MAKE) $(clean)=$(boot) 83 $(Q)$(MAKE) $(clean)=$(boot)
84 84
85archprepare: include/asm-ia64/.offsets.h.stamp 85CLEAN_FILES += vmlinux.gz bootloader
86
87include/asm-ia64/.offsets.h.stamp:
88 mkdir -p include/asm-ia64
89 [ -s include/asm-ia64/asm-offsets.h ] \
90 || echo "#define IA64_TASK_SIZE 0" > include/asm-ia64/asm-offsets.h
91 touch $@
92
93
94
95CLEAN_FILES += vmlinux.gz bootloader include/asm-ia64/.offsets.h.stamp
96 86
97boot: lib/lib.a vmlinux 87boot: lib/lib.a vmlinux
98 $(Q)$(MAKE) $(build)=$(boot) $@ 88 $(Q)$(MAKE) $(build)=$(boot) $@
diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c
index 31de70b7c67f..a7280d9f6c16 100644
--- a/arch/ia64/ia32/binfmt_elf32.c
+++ b/arch/ia64/ia32/binfmt_elf32.c
@@ -216,12 +216,6 @@ ia32_setup_arg_pages (struct linux_binprm *bprm, int executable_stack)
216 if (!mpnt) 216 if (!mpnt)
217 return -ENOMEM; 217 return -ENOMEM;
218 218
219 if (security_vm_enough_memory((IA32_STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))
220 >> PAGE_SHIFT)) {
221 kmem_cache_free(vm_area_cachep, mpnt);
222 return -ENOMEM;
223 }
224
225 memset(mpnt, 0, sizeof(*mpnt)); 219 memset(mpnt, 0, sizeof(*mpnt));
226 220
227 down_write(&current->mm->mmap_sem); 221 down_write(&current->mm->mmap_sem);
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 28a4529fdd60..7e926471e4ec 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -899,7 +899,7 @@ int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
899 if ((err = iosapic_init(phys_addr, gsi_base))) 899 if ((err = iosapic_init(phys_addr, gsi_base)))
900 return err; 900 return err;
901 901
902#if CONFIG_ACPI_NUMA 902#ifdef CONFIG_ACPI_NUMA
903 acpi_map_iosapic(handle, 0, NULL, NULL); 903 acpi_map_iosapic(handle, 0, NULL, NULL);
904#endif /* CONFIG_ACPI_NUMA */ 904#endif /* CONFIG_ACPI_NUMA */
905 905
diff --git a/arch/ia64/kernel/asm-offsets.c b/arch/ia64/kernel/asm-offsets.c
index f6a234289341..77225659e968 100644
--- a/arch/ia64/kernel/asm-offsets.c
+++ b/arch/ia64/kernel/asm-offsets.c
@@ -4,6 +4,7 @@
4 * to extract and format the required data. 4 * to extract and format the required data.
5 */ 5 */
6 6
7#define ASM_OFFSETS_C 1
7#include <linux/config.h> 8#include <linux/config.h>
8 9
9#include <linux/sched.h> 10#include <linux/sched.h>
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index ba0b6a1f429f..0741b066b98f 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -491,7 +491,7 @@ GLOBAL_ENTRY(prefetch_stack)
491 ;; 491 ;;
492 lfetch.fault [r16], 128 492 lfetch.fault [r16], 128
493 br.ret.sptk.many rp 493 br.ret.sptk.many rp
494END(prefetch_switch_stack) 494END(prefetch_stack)
495 495
496GLOBAL_ENTRY(execve) 496GLOBAL_ENTRY(execve)
497 mov r15=__NR_execve // put syscall number in place 497 mov r15=__NR_execve // put syscall number in place
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index 6e683745af49..80f83d6cdbfc 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -84,23 +84,23 @@ mca_page_isolate(unsigned long paddr)
84 struct page *p; 84 struct page *p;
85 85
86 /* whether physical address is valid or not */ 86 /* whether physical address is valid or not */
87 if ( !ia64_phys_addr_valid(paddr) ) 87 if (!ia64_phys_addr_valid(paddr))
88 return ISOLATE_NG; 88 return ISOLATE_NG;
89 89
90 /* convert physical address to physical page number */ 90 /* convert physical address to physical page number */
91 p = pfn_to_page(paddr>>PAGE_SHIFT); 91 p = pfn_to_page(paddr>>PAGE_SHIFT);
92 92
93 /* check whether a page number have been already registered or not */ 93 /* check whether a page number have been already registered or not */
94 for( i = 0; i < num_page_isolate; i++ ) 94 for (i = 0; i < num_page_isolate; i++)
95 if( page_isolate[i] == p ) 95 if (page_isolate[i] == p)
96 return ISOLATE_OK; /* already listed */ 96 return ISOLATE_OK; /* already listed */
97 97
98 /* limitation check */ 98 /* limitation check */
99 if( num_page_isolate == MAX_PAGE_ISOLATE ) 99 if (num_page_isolate == MAX_PAGE_ISOLATE)
100 return ISOLATE_NG; 100 return ISOLATE_NG;
101 101
102 /* kick pages having attribute 'SLAB' or 'Reserved' */ 102 /* kick pages having attribute 'SLAB' or 'Reserved' */
103 if( PageSlab(p) || PageReserved(p) ) 103 if (PageSlab(p) || PageReserved(p))
104 return ISOLATE_NG; 104 return ISOLATE_NG;
105 105
106 /* add attribute 'Reserved' and register the page */ 106 /* add attribute 'Reserved' and register the page */
@@ -139,10 +139,10 @@ mca_handler_bh(unsigned long paddr)
139 * @peidx: pointer to index of processor error section 139 * @peidx: pointer to index of processor error section
140 */ 140 */
141 141
142static void 142static void
143mca_make_peidx(sal_log_processor_info_t *slpi, peidx_table_t *peidx) 143mca_make_peidx(sal_log_processor_info_t *slpi, peidx_table_t *peidx)
144{ 144{
145 /* 145 /*
146 * calculate the start address of 146 * calculate the start address of
147 * "struct cpuid_info" and "sal_processor_static_info_t". 147 * "struct cpuid_info" and "sal_processor_static_info_t".
148 */ 148 */
@@ -164,7 +164,7 @@ mca_make_peidx(sal_log_processor_info_t *slpi, peidx_table_t *peidx)
164} 164}
165 165
166/** 166/**
167 * mca_make_slidx - Make index of SAL error record 167 * mca_make_slidx - Make index of SAL error record
168 * @buffer: pointer to SAL error record 168 * @buffer: pointer to SAL error record
169 * @slidx: pointer to index of SAL error record 169 * @slidx: pointer to index of SAL error record
170 * 170 *
@@ -172,12 +172,12 @@ mca_make_peidx(sal_log_processor_info_t *slpi, peidx_table_t *peidx)
172 * 1 if record has platform error / 0 if not 172 * 1 if record has platform error / 0 if not
173 */ 173 */
174#define LOG_INDEX_ADD_SECT_PTR(sect, ptr) \ 174#define LOG_INDEX_ADD_SECT_PTR(sect, ptr) \
175 { slidx_list_t *hl = &slidx_pool.buffer[slidx_pool.cur_idx]; \ 175 {slidx_list_t *hl = &slidx_pool.buffer[slidx_pool.cur_idx]; \
176 hl->hdr = ptr; \ 176 hl->hdr = ptr; \
177 list_add(&hl->list, &(sect)); \ 177 list_add(&hl->list, &(sect)); \
178 slidx_pool.cur_idx = (slidx_pool.cur_idx + 1)%slidx_pool.max_idx; } 178 slidx_pool.cur_idx = (slidx_pool.cur_idx + 1)%slidx_pool.max_idx; }
179 179
180static int 180static int
181mca_make_slidx(void *buffer, slidx_table_t *slidx) 181mca_make_slidx(void *buffer, slidx_table_t *slidx)
182{ 182{
183 int platform_err = 0; 183 int platform_err = 0;
@@ -214,28 +214,36 @@ mca_make_slidx(void *buffer, slidx_table_t *slidx)
214 sp = (sal_log_section_hdr_t *)((char*)buffer + ercd_pos); 214 sp = (sal_log_section_hdr_t *)((char*)buffer + ercd_pos);
215 if (!efi_guidcmp(sp->guid, SAL_PROC_DEV_ERR_SECT_GUID)) { 215 if (!efi_guidcmp(sp->guid, SAL_PROC_DEV_ERR_SECT_GUID)) {
216 LOG_INDEX_ADD_SECT_PTR(slidx->proc_err, sp); 216 LOG_INDEX_ADD_SECT_PTR(slidx->proc_err, sp);
217 } else if (!efi_guidcmp(sp->guid, SAL_PLAT_MEM_DEV_ERR_SECT_GUID)) { 217 } else if (!efi_guidcmp(sp->guid,
218 SAL_PLAT_MEM_DEV_ERR_SECT_GUID)) {
218 platform_err = 1; 219 platform_err = 1;
219 LOG_INDEX_ADD_SECT_PTR(slidx->mem_dev_err, sp); 220 LOG_INDEX_ADD_SECT_PTR(slidx->mem_dev_err, sp);
220 } else if (!efi_guidcmp(sp->guid, SAL_PLAT_SEL_DEV_ERR_SECT_GUID)) { 221 } else if (!efi_guidcmp(sp->guid,
222 SAL_PLAT_SEL_DEV_ERR_SECT_GUID)) {
221 platform_err = 1; 223 platform_err = 1;
222 LOG_INDEX_ADD_SECT_PTR(slidx->sel_dev_err, sp); 224 LOG_INDEX_ADD_SECT_PTR(slidx->sel_dev_err, sp);
223 } else if (!efi_guidcmp(sp->guid, SAL_PLAT_PCI_BUS_ERR_SECT_GUID)) { 225 } else if (!efi_guidcmp(sp->guid,
226 SAL_PLAT_PCI_BUS_ERR_SECT_GUID)) {
224 platform_err = 1; 227 platform_err = 1;
225 LOG_INDEX_ADD_SECT_PTR(slidx->pci_bus_err, sp); 228 LOG_INDEX_ADD_SECT_PTR(slidx->pci_bus_err, sp);
226 } else if (!efi_guidcmp(sp->guid, SAL_PLAT_SMBIOS_DEV_ERR_SECT_GUID)) { 229 } else if (!efi_guidcmp(sp->guid,
230 SAL_PLAT_SMBIOS_DEV_ERR_SECT_GUID)) {
227 platform_err = 1; 231 platform_err = 1;
228 LOG_INDEX_ADD_SECT_PTR(slidx->smbios_dev_err, sp); 232 LOG_INDEX_ADD_SECT_PTR(slidx->smbios_dev_err, sp);
229 } else if (!efi_guidcmp(sp->guid, SAL_PLAT_PCI_COMP_ERR_SECT_GUID)) { 233 } else if (!efi_guidcmp(sp->guid,
234 SAL_PLAT_PCI_COMP_ERR_SECT_GUID)) {
230 platform_err = 1; 235 platform_err = 1;
231 LOG_INDEX_ADD_SECT_PTR(slidx->pci_comp_err, sp); 236 LOG_INDEX_ADD_SECT_PTR(slidx->pci_comp_err, sp);
232 } else if (!efi_guidcmp(sp->guid, SAL_PLAT_SPECIFIC_ERR_SECT_GUID)) { 237 } else if (!efi_guidcmp(sp->guid,
238 SAL_PLAT_SPECIFIC_ERR_SECT_GUID)) {
233 platform_err = 1; 239 platform_err = 1;
234 LOG_INDEX_ADD_SECT_PTR(slidx->plat_specific_err, sp); 240 LOG_INDEX_ADD_SECT_PTR(slidx->plat_specific_err, sp);
235 } else if (!efi_guidcmp(sp->guid, SAL_PLAT_HOST_CTLR_ERR_SECT_GUID)) { 241 } else if (!efi_guidcmp(sp->guid,
242 SAL_PLAT_HOST_CTLR_ERR_SECT_GUID)) {
236 platform_err = 1; 243 platform_err = 1;
237 LOG_INDEX_ADD_SECT_PTR(slidx->host_ctlr_err, sp); 244 LOG_INDEX_ADD_SECT_PTR(slidx->host_ctlr_err, sp);
238 } else if (!efi_guidcmp(sp->guid, SAL_PLAT_BUS_ERR_SECT_GUID)) { 245 } else if (!efi_guidcmp(sp->guid,
246 SAL_PLAT_BUS_ERR_SECT_GUID)) {
239 platform_err = 1; 247 platform_err = 1;
240 LOG_INDEX_ADD_SECT_PTR(slidx->plat_bus_err, sp); 248 LOG_INDEX_ADD_SECT_PTR(slidx->plat_bus_err, sp);
241 } else { 249 } else {
@@ -253,15 +261,16 @@ mca_make_slidx(void *buffer, slidx_table_t *slidx)
253 * Return value: 261 * Return value:
254 * 0 on Success / -ENOMEM on Failure 262 * 0 on Success / -ENOMEM on Failure
255 */ 263 */
256static int 264static int
257init_record_index_pools(void) 265init_record_index_pools(void)
258{ 266{
259 int i; 267 int i;
260 int rec_max_size; /* Maximum size of SAL error records */ 268 int rec_max_size; /* Maximum size of SAL error records */
261 int sect_min_size; /* Minimum size of SAL error sections */ 269 int sect_min_size; /* Minimum size of SAL error sections */
262 /* minimum size table of each section */ 270 /* minimum size table of each section */
263 static int sal_log_sect_min_sizes[] = { 271 static int sal_log_sect_min_sizes[] = {
264 sizeof(sal_log_processor_info_t) + sizeof(sal_processor_static_info_t), 272 sizeof(sal_log_processor_info_t)
273 + sizeof(sal_processor_static_info_t),
265 sizeof(sal_log_mem_dev_err_info_t), 274 sizeof(sal_log_mem_dev_err_info_t),
266 sizeof(sal_log_sel_dev_err_info_t), 275 sizeof(sal_log_sel_dev_err_info_t),
267 sizeof(sal_log_pci_bus_err_info_t), 276 sizeof(sal_log_pci_bus_err_info_t),
@@ -294,7 +303,8 @@ init_record_index_pools(void)
294 303
295 /* - 3 - */ 304 /* - 3 - */
296 slidx_pool.max_idx = (rec_max_size/sect_min_size) * 2 + 1; 305 slidx_pool.max_idx = (rec_max_size/sect_min_size) * 2 + 1;
297 slidx_pool.buffer = (slidx_list_t *) kmalloc(slidx_pool.max_idx * sizeof(slidx_list_t), GFP_KERNEL); 306 slidx_pool.buffer = (slidx_list_t *)
307 kmalloc(slidx_pool.max_idx * sizeof(slidx_list_t), GFP_KERNEL);
298 308
299 return slidx_pool.buffer ? 0 : -ENOMEM; 309 return slidx_pool.buffer ? 0 : -ENOMEM;
300} 310}
@@ -308,6 +318,7 @@ init_record_index_pools(void)
308 * is_mca_global - Check whether this MCA is global or not 318 * is_mca_global - Check whether this MCA is global or not
309 * @peidx: pointer of index of processor error section 319 * @peidx: pointer of index of processor error section
310 * @pbci: pointer to pal_bus_check_info_t 320 * @pbci: pointer to pal_bus_check_info_t
321 * @sos: pointer to hand off struct between SAL and OS
311 * 322 *
312 * Return value: 323 * Return value:
313 * MCA_IS_LOCAL / MCA_IS_GLOBAL 324 * MCA_IS_LOCAL / MCA_IS_GLOBAL
@@ -317,11 +328,12 @@ static mca_type_t
317is_mca_global(peidx_table_t *peidx, pal_bus_check_info_t *pbci, 328is_mca_global(peidx_table_t *peidx, pal_bus_check_info_t *pbci,
318 struct ia64_sal_os_state *sos) 329 struct ia64_sal_os_state *sos)
319{ 330{
320 pal_processor_state_info_t *psp = (pal_processor_state_info_t*)peidx_psp(peidx); 331 pal_processor_state_info_t *psp =
332 (pal_processor_state_info_t*)peidx_psp(peidx);
321 333
322 /* 334 /*
323 * PAL can request a rendezvous, if the MCA has a global scope. 335 * PAL can request a rendezvous, if the MCA has a global scope.
324 * If "rz_always" flag is set, SAL requests MCA rendezvous 336 * If "rz_always" flag is set, SAL requests MCA rendezvous
325 * in spite of global MCA. 337 * in spite of global MCA.
326 * Therefore it is local MCA when rendezvous has not been requested. 338 * Therefore it is local MCA when rendezvous has not been requested.
327 * Failed to rendezvous, the system must be down. 339 * Failed to rendezvous, the system must be down.
@@ -381,13 +393,15 @@ is_mca_global(peidx_table_t *peidx, pal_bus_check_info_t *pbci,
381 * @slidx: pointer of index of SAL error record 393 * @slidx: pointer of index of SAL error record
382 * @peidx: pointer of index of processor error section 394 * @peidx: pointer of index of processor error section
383 * @pbci: pointer of pal_bus_check_info 395 * @pbci: pointer of pal_bus_check_info
396 * @sos: pointer to hand off struct between SAL and OS
384 * 397 *
385 * Return value: 398 * Return value:
386 * 1 on Success / 0 on Failure 399 * 1 on Success / 0 on Failure
387 */ 400 */
388 401
389static int 402static int
390recover_from_read_error(slidx_table_t *slidx, peidx_table_t *peidx, pal_bus_check_info_t *pbci, 403recover_from_read_error(slidx_table_t *slidx,
404 peidx_table_t *peidx, pal_bus_check_info_t *pbci,
391 struct ia64_sal_os_state *sos) 405 struct ia64_sal_os_state *sos)
392{ 406{
393 sal_log_mod_error_info_t *smei; 407 sal_log_mod_error_info_t *smei;
@@ -453,24 +467,28 @@ recover_from_read_error(slidx_table_t *slidx, peidx_table_t *peidx, pal_bus_chec
453 * @slidx: pointer of index of SAL error record 467 * @slidx: pointer of index of SAL error record
454 * @peidx: pointer of index of processor error section 468 * @peidx: pointer of index of processor error section
455 * @pbci: pointer of pal_bus_check_info 469 * @pbci: pointer of pal_bus_check_info
470 * @sos: pointer to hand off struct between SAL and OS
456 * 471 *
457 * Return value: 472 * Return value:
458 * 1 on Success / 0 on Failure 473 * 1 on Success / 0 on Failure
459 */ 474 */
460 475
461static int 476static int
462recover_from_platform_error(slidx_table_t *slidx, peidx_table_t *peidx, pal_bus_check_info_t *pbci, 477recover_from_platform_error(slidx_table_t *slidx, peidx_table_t *peidx,
478 pal_bus_check_info_t *pbci,
463 struct ia64_sal_os_state *sos) 479 struct ia64_sal_os_state *sos)
464{ 480{
465 int status = 0; 481 int status = 0;
466 pal_processor_state_info_t *psp = (pal_processor_state_info_t*)peidx_psp(peidx); 482 pal_processor_state_info_t *psp =
483 (pal_processor_state_info_t*)peidx_psp(peidx);
467 484
468 if (psp->bc && pbci->eb && pbci->bsi == 0) { 485 if (psp->bc && pbci->eb && pbci->bsi == 0) {
469 switch(pbci->type) { 486 switch(pbci->type) {
470 case 1: /* partial read */ 487 case 1: /* partial read */
471 case 3: /* full line(cpu) read */ 488 case 3: /* full line(cpu) read */
472 case 9: /* I/O space read */ 489 case 9: /* I/O space read */
473 status = recover_from_read_error(slidx, peidx, pbci, sos); 490 status = recover_from_read_error(slidx, peidx, pbci,
491 sos);
474 break; 492 break;
475 case 0: /* unknown */ 493 case 0: /* unknown */
476 case 2: /* partial write */ 494 case 2: /* partial write */
@@ -481,7 +499,8 @@ recover_from_platform_error(slidx_table_t *slidx, peidx_table_t *peidx, pal_bus_
481 case 8: /* write coalescing transactions */ 499 case 8: /* write coalescing transactions */
482 case 10: /* I/O space write */ 500 case 10: /* I/O space write */
483 case 11: /* inter-processor interrupt message(IPI) */ 501 case 11: /* inter-processor interrupt message(IPI) */
484 case 12: /* interrupt acknowledge or external task priority cycle */ 502 case 12: /* interrupt acknowledge or
503 external task priority cycle */
485 default: 504 default:
486 break; 505 break;
487 } 506 }
@@ -496,6 +515,7 @@ recover_from_platform_error(slidx_table_t *slidx, peidx_table_t *peidx, pal_bus_
496 * @slidx: pointer of index of SAL error record 515 * @slidx: pointer of index of SAL error record
497 * @peidx: pointer of index of processor error section 516 * @peidx: pointer of index of processor error section
498 * @pbci: pointer of pal_bus_check_info 517 * @pbci: pointer of pal_bus_check_info
518 * @sos: pointer to hand off struct between SAL and OS
499 * 519 *
500 * Return value: 520 * Return value:
501 * 1 on Success / 0 on Failure 521 * 1 on Success / 0 on Failure
@@ -509,15 +529,17 @@ recover_from_platform_error(slidx_table_t *slidx, peidx_table_t *peidx, pal_bus_
509 */ 529 */
510 530
511static int 531static int
512recover_from_processor_error(int platform, slidx_table_t *slidx, peidx_table_t *peidx, pal_bus_check_info_t *pbci, 532recover_from_processor_error(int platform, slidx_table_t *slidx,
533 peidx_table_t *peidx, pal_bus_check_info_t *pbci,
513 struct ia64_sal_os_state *sos) 534 struct ia64_sal_os_state *sos)
514{ 535{
515 pal_processor_state_info_t *psp = (pal_processor_state_info_t*)peidx_psp(peidx); 536 pal_processor_state_info_t *psp =
537 (pal_processor_state_info_t*)peidx_psp(peidx);
516 538
517 /* 539 /*
518 * We cannot recover errors with other than bus_check. 540 * We cannot recover errors with other than bus_check.
519 */ 541 */
520 if (psp->cc || psp->rc || psp->uc) 542 if (psp->cc || psp->rc || psp->uc)
521 return 0; 543 return 0;
522 544
523 /* 545 /*
@@ -546,10 +568,10 @@ recover_from_processor_error(int platform, slidx_table_t *slidx, peidx_table_t *
546 * (e.g. a load from poisoned memory) 568 * (e.g. a load from poisoned memory)
547 * This means "there are some platform errors". 569 * This means "there are some platform errors".
548 */ 570 */
549 if (platform) 571 if (platform)
550 return recover_from_platform_error(slidx, peidx, pbci, sos); 572 return recover_from_platform_error(slidx, peidx, pbci, sos);
551 /* 573 /*
552 * On account of strange SAL error record, we cannot recover. 574 * On account of strange SAL error record, we cannot recover.
553 */ 575 */
554 return 0; 576 return 0;
555} 577}
@@ -557,14 +579,14 @@ recover_from_processor_error(int platform, slidx_table_t *slidx, peidx_table_t *
557/** 579/**
558 * mca_try_to_recover - Try to recover from MCA 580 * mca_try_to_recover - Try to recover from MCA
559 * @rec: pointer to a SAL error record 581 * @rec: pointer to a SAL error record
582 * @sos: pointer to hand off struct between SAL and OS
560 * 583 *
561 * Return value: 584 * Return value:
562 * 1 on Success / 0 on Failure 585 * 1 on Success / 0 on Failure
563 */ 586 */
564 587
565static int 588static int
566mca_try_to_recover(void *rec, 589mca_try_to_recover(void *rec, struct ia64_sal_os_state *sos)
567 struct ia64_sal_os_state *sos)
568{ 590{
569 int platform_err; 591 int platform_err;
570 int n_proc_err; 592 int n_proc_err;
@@ -588,7 +610,8 @@ mca_try_to_recover(void *rec,
588 } 610 }
589 611
590 /* Make index of processor error section */ 612 /* Make index of processor error section */
591 mca_make_peidx((sal_log_processor_info_t*)slidx_first_entry(&slidx.proc_err)->hdr, &peidx); 613 mca_make_peidx((sal_log_processor_info_t*)
614 slidx_first_entry(&slidx.proc_err)->hdr, &peidx);
592 615
593 /* Extract Processor BUS_CHECK[0] */ 616 /* Extract Processor BUS_CHECK[0] */
594 *((u64*)&pbci) = peidx_check_info(&peidx, bus_check, 0); 617 *((u64*)&pbci) = peidx_check_info(&peidx, bus_check, 0);
@@ -598,7 +621,8 @@ mca_try_to_recover(void *rec,
598 return 0; 621 return 0;
599 622
600 /* Try to recover a processor error */ 623 /* Try to recover a processor error */
601 return recover_from_processor_error(platform_err, &slidx, &peidx, &pbci, sos); 624 return recover_from_processor_error(platform_err, &slidx, &peidx,
625 &pbci, sos);
602} 626}
603 627
604/* 628/*
@@ -611,7 +635,7 @@ int __init mca_external_handler_init(void)
611 return -ENOMEM; 635 return -ENOMEM;
612 636
613 /* register external mca handlers */ 637 /* register external mca handlers */
614 if (ia64_reg_MCA_extension(mca_try_to_recover)){ 638 if (ia64_reg_MCA_extension(mca_try_to_recover)) {
615 printk(KERN_ERR "ia64_reg_MCA_extension failed.\n"); 639 printk(KERN_ERR "ia64_reg_MCA_extension failed.\n");
616 kfree(slidx_pool.buffer); 640 kfree(slidx_pool.buffer);
617 return -EFAULT; 641 return -EFAULT;
diff --git a/arch/ia64/kernel/mca_drv.h b/arch/ia64/kernel/mca_drv.h
index 0227b761f2c4..e2f6fa1e0ef6 100644
--- a/arch/ia64/kernel/mca_drv.h
+++ b/arch/ia64/kernel/mca_drv.h
@@ -6,7 +6,7 @@
6 * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com) 6 * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com)
7 */ 7 */
8/* 8/*
9 * Processor error section: 9 * Processor error section:
10 * 10 *
11 * +-sal_log_processor_info_t *info-------------+ 11 * +-sal_log_processor_info_t *info-------------+
12 * | sal_log_section_hdr_t header; | 12 * | sal_log_section_hdr_t header; |
diff --git a/arch/ia64/kernel/mca_drv_asm.S b/arch/ia64/kernel/mca_drv_asm.S
index 2d7e0217638d..3f298ee4d00c 100644
--- a/arch/ia64/kernel/mca_drv_asm.S
+++ b/arch/ia64/kernel/mca_drv_asm.S
@@ -13,45 +13,45 @@
13#include <asm/ptrace.h> 13#include <asm/ptrace.h>
14 14
15GLOBAL_ENTRY(mca_handler_bhhook) 15GLOBAL_ENTRY(mca_handler_bhhook)
16 invala // clear RSE ? 16 invala // clear RSE ?
17 ;; // 17 ;;
18 cover // 18 cover
19 ;; // 19 ;;
20 clrrrb // 20 clrrrb
21 ;; 21 ;;
22 alloc r16=ar.pfs,0,2,1,0 // make a new frame 22 alloc r16=ar.pfs,0,2,1,0 // make a new frame
23 ;; 23 ;;
24 mov ar.rsc=0 24 mov ar.rsc=0
25 ;; 25 ;;
26 mov r13=IA64_KR(CURRENT) // current task pointer 26 mov r13=IA64_KR(CURRENT) // current task pointer
27 ;; 27 ;;
28 mov r2=r13 28 mov r2=r13
29 ;; 29 ;;
30 addl r22=IA64_RBS_OFFSET,r2 30 addl r22=IA64_RBS_OFFSET,r2
31 ;; 31 ;;
32 mov ar.bspstore=r22 32 mov ar.bspstore=r22
33 ;; 33 ;;
34 addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2 34 addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2
35 ;; 35 ;;
36 adds r2=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13 36 adds r2=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
37 ;; 37 ;;
38 st1 [r2]=r0 // clear current->thread.on_ustack flag 38 st1 [r2]=r0 // clear current->thread.on_ustack flag
39 mov loc0=r16 39 mov loc0=r16
40 movl loc1=mca_handler_bh // recovery C function 40 movl loc1=mca_handler_bh // recovery C function
41 ;; 41 ;;
42 mov out0=r8 // poisoned address 42 mov out0=r8 // poisoned address
43 mov b6=loc1 43 mov b6=loc1
44 ;; 44 ;;
45 mov loc1=rp 45 mov loc1=rp
46 ;; 46 ;;
47 ssm psr.i 47 ssm psr.i
48 ;; 48 ;;
49 br.call.sptk.many rp=b6 // does not return ... 49 br.call.sptk.many rp=b6 // does not return ...
50 ;; 50 ;;
51 mov ar.pfs=loc0 51 mov ar.pfs=loc0
52 mov rp=loc1 52 mov rp=loc1
53 ;; 53 ;;
54 mov r8=r0 54 mov r8=r0
55 br.ret.sptk.many rp 55 br.ret.sptk.many rp
56 ;; 56 ;;
57END(mca_handler_bhhook) 57END(mca_handler_bhhook)
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 1650353e3f77..d71731ee5b61 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -574,7 +574,7 @@ pfm_protect_ctx_ctxsw(pfm_context_t *x)
574 return 0UL; 574 return 0UL;
575} 575}
576 576
577static inline unsigned long 577static inline void
578pfm_unprotect_ctx_ctxsw(pfm_context_t *x, unsigned long f) 578pfm_unprotect_ctx_ctxsw(pfm_context_t *x, unsigned long f)
579{ 579{
580 spin_unlock(&(x)->ctx_lock); 580 spin_unlock(&(x)->ctx_lock);
@@ -2218,12 +2218,13 @@ static void
2218pfm_free_fd(int fd, struct file *file) 2218pfm_free_fd(int fd, struct file *file)
2219{ 2219{
2220 struct files_struct *files = current->files; 2220 struct files_struct *files = current->files;
2221 struct fdtable *fdt = files_fdtable(files); 2221 struct fdtable *fdt;
2222 2222
2223 /* 2223 /*
2224 * there ie no fd_uninstall(), so we do it here 2224 * there ie no fd_uninstall(), so we do it here
2225 */ 2225 */
2226 spin_lock(&files->file_lock); 2226 spin_lock(&files->file_lock);
2227 fdt = files_fdtable(files);
2227 rcu_assign_pointer(fdt->fd[fd], NULL); 2228 rcu_assign_pointer(fdt->fd[fd], NULL);
2228 spin_unlock(&files->file_lock); 2229 spin_unlock(&files->file_lock);
2229 2230
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile
index 799407e7726f..cb1af597370b 100644
--- a/arch/ia64/lib/Makefile
+++ b/arch/ia64/lib/Makefile
@@ -15,7 +15,6 @@ lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o
15lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o 15lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o
16lib-$(CONFIG_PERFMON) += carta_random.o 16lib-$(CONFIG_PERFMON) += carta_random.o
17lib-$(CONFIG_MD_RAID5) += xor.o 17lib-$(CONFIG_MD_RAID5) += xor.o
18lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
19 18
20AFLAGS___divdi3.o = 19AFLAGS___divdi3.o =
21AFLAGS___udivdi3.o = -DUNSIGNED 20AFLAGS___udivdi3.o = -DUNSIGNED
diff --git a/arch/ia64/lib/dec_and_lock.c b/arch/ia64/lib/dec_and_lock.c
deleted file mode 100644
index c7ce92f968f1..000000000000
--- a/arch/ia64/lib/dec_and_lock.c
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * Copyright (C) 2003 Jerome Marchand, Bull S.A.
3 * Cleaned up by David Mosberger-Tang <davidm@hpl.hp.com>
4 *
5 * This file is released under the GPLv2, or at your option any later version.
6 *
7 * ia64 version of "atomic_dec_and_lock()" using the atomic "cmpxchg" instruction. This
8 * code is an adaptation of the x86 version of "atomic_dec_and_lock()".
9 */
10
11#include <linux/compiler.h>
12#include <linux/module.h>
13#include <linux/spinlock.h>
14#include <asm/atomic.h>
15
16/*
17 * Decrement REFCOUNT and if the count reaches zero, acquire the spinlock. Both of these
18 * operations have to be done atomically, so that the count doesn't drop to zero without
19 * acquiring the spinlock first.
20 */
21int
22_atomic_dec_and_lock (atomic_t *refcount, spinlock_t *lock)
23{
24 int old, new;
25
26 do {
27 old = atomic_read(refcount);
28 new = old - 1;
29
30 if (unlikely (old == 1)) {
31 /* oops, we may be decrementing to zero, do it the slow way... */
32 spin_lock(lock);
33 if (atomic_dec_and_test(refcount))
34 return 1;
35 spin_unlock(lock);
36 return 0;
37 }
38 } while (cmpxchg(&refcount->counter, old, new) != old);
39 return 0;
40}
41
42EXPORT_SYMBOL(_atomic_dec_and_lock);
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index 1ef3987ebc6a..4d100f3886e1 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -220,11 +220,6 @@ config PREEMPT
220 Say Y here if you are building a kernel for a desktop, embedded 220 Say Y here if you are building a kernel for a desktop, embedded
221 or real-time system. Say N if you are unsure. 221 or real-time system. Say N if you are unsure.
222 222
223config HAVE_DEC_LOCK
224 bool
225 depends on (SMP || PREEMPT)
226 default n
227
228config SMP 223config SMP
229 bool "Symmetric multi-processing support" 224 bool "Symmetric multi-processing support"
230 ---help--- 225 ---help---
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 0eb71ac303af..4cd724c05700 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1009,10 +1009,6 @@ config GENERIC_CALIBRATE_DELAY
1009 bool 1009 bool
1010 default y 1010 default y
1011 1011
1012config HAVE_DEC_LOCK
1013 bool
1014 default y
1015
1016# 1012#
1017# Select some configuration options automatically based on user selections. 1013# Select some configuration options automatically based on user selections.
1018# 1014#
diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c
index 4de155699c4f..7ae4af476974 100644
--- a/arch/mips/kernel/sysirix.c
+++ b/arch/mips/kernel/sysirix.c
@@ -581,18 +581,13 @@ asmlinkage int irix_brk(unsigned long brk)
581 } 581 }
582 582
583 /* 583 /*
584 * Check if we have enough memory.. 584 * Ok, looks good - let it rip.
585 */ 585 */
586 if (security_vm_enough_memory((newbrk-oldbrk) >> PAGE_SHIFT)) { 586 if (do_brk(oldbrk, newbrk-oldbrk) != oldbrk) {
587 ret = -ENOMEM; 587 ret = -ENOMEM;
588 goto out; 588 goto out;
589 } 589 }
590
591 /*
592 * Ok, looks good - let it rip.
593 */
594 mm->brk = brk; 590 mm->brk = brk;
595 do_brk(oldbrk, newbrk-oldbrk);
596 ret = 0; 591 ret = 0;
597 592
598out: 593out:
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile
index 21b92b9dd013..037303412909 100644
--- a/arch/mips/lib/Makefile
+++ b/arch/mips/lib/Makefile
@@ -2,7 +2,7 @@
2# Makefile for MIPS-specific library files.. 2# Makefile for MIPS-specific library files..
3# 3#
4 4
5lib-y += csum_partial_copy.o dec_and_lock.o memcpy.o promlib.o \ 5lib-y += csum_partial_copy.o memcpy.o promlib.o \
6 strlen_user.o strncpy_user.o strnlen_user.o 6 strlen_user.o strncpy_user.o strnlen_user.o
7 7
8obj-y += iomap.o 8obj-y += iomap.o
diff --git a/arch/mips/lib/dec_and_lock.c b/arch/mips/lib/dec_and_lock.c
deleted file mode 100644
index fd82c84a93b7..000000000000
--- a/arch/mips/lib/dec_and_lock.c
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * MIPS version of atomic_dec_and_lock() using cmpxchg
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include <linux/module.h>
11#include <linux/spinlock.h>
12#include <asm/atomic.h>
13#include <asm/system.h>
14
15/*
16 * This is an implementation of the notion of "decrement a
17 * reference count, and return locked if it decremented to zero".
18 *
19 * This implementation can be used on any architecture that
20 * has a cmpxchg, and where atomic->value is an int holding
21 * the value of the atomic (i.e. the high bits aren't used
22 * for a lock or anything like that).
23 */
24int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)
25{
26 int counter;
27 int newcount;
28
29 for (;;) {
30 counter = atomic_read(atomic);
31 newcount = counter - 1;
32 if (!newcount)
33 break; /* do it the slow way */
34
35 newcount = cmpxchg(&atomic->counter, counter, newcount);
36 if (newcount == counter)
37 return 0;
38 }
39
40 spin_lock(lock);
41 if (atomic_dec_and_test(atomic))
42 return 1;
43 spin_unlock(lock);
44 return 0;
45}
46
47EXPORT_SYMBOL(_atomic_dec_and_lock);
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 347ea284140b..776941c75672 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -26,10 +26,6 @@ config GENERIC_CALIBRATE_DELAY
26 bool 26 bool
27 default y 27 default y
28 28
29config HAVE_DEC_LOCK
30 bool
31 default y
32
33config PPC 29config PPC
34 bool 30 bool
35 default y 31 default y
diff --git a/arch/ppc/lib/Makefile b/arch/ppc/lib/Makefile
index f1e1fb4144f0..50358e4ea159 100644
--- a/arch/ppc/lib/Makefile
+++ b/arch/ppc/lib/Makefile
@@ -2,7 +2,7 @@
2# Makefile for ppc-specific library files.. 2# Makefile for ppc-specific library files..
3# 3#
4 4
5obj-y := checksum.o string.o strcase.o dec_and_lock.o div64.o 5obj-y := checksum.o string.o strcase.o div64.o
6 6
7obj-$(CONFIG_8xx) += rheap.o 7obj-$(CONFIG_8xx) += rheap.o
8obj-$(CONFIG_CPM2) += rheap.o 8obj-$(CONFIG_CPM2) += rheap.o
diff --git a/arch/ppc/lib/dec_and_lock.c b/arch/ppc/lib/dec_and_lock.c
deleted file mode 100644
index b18f0d9a00fc..000000000000
--- a/arch/ppc/lib/dec_and_lock.c
+++ /dev/null
@@ -1,38 +0,0 @@
1#include <linux/module.h>
2#include <linux/spinlock.h>
3#include <asm/atomic.h>
4#include <asm/system.h>
5
6/*
7 * This is an implementation of the notion of "decrement a
8 * reference count, and return locked if it decremented to zero".
9 *
10 * This implementation can be used on any architecture that
11 * has a cmpxchg, and where atomic->value is an int holding
12 * the value of the atomic (i.e. the high bits aren't used
13 * for a lock or anything like that).
14 */
15int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)
16{
17 int counter;
18 int newcount;
19
20 for (;;) {
21 counter = atomic_read(atomic);
22 newcount = counter - 1;
23 if (!newcount)
24 break; /* do it the slow way */
25
26 newcount = cmpxchg(&atomic->counter, counter, newcount);
27 if (newcount == counter)
28 return 0;
29 }
30
31 spin_lock(lock);
32 if (atomic_dec_and_test(atomic))
33 return 1;
34 spin_unlock(lock);
35 return 0;
36}
37
38EXPORT_SYMBOL(_atomic_dec_and_lock);
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index 8b9b226005d1..b8d08f33f7ee 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -34,7 +34,8 @@ ifeq ($(CONFIG_40x),y)
34obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o ppc405_pci.o 34obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o ppc405_pci.o
35endif 35endif
36endif 36endif
37obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) 37obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \
38 ppc_sys.o mpc8xx_devices.o mpc8xx_sys.o
38ifeq ($(CONFIG_8xx),y) 39ifeq ($(CONFIG_8xx),y)
39obj-$(CONFIG_PCI) += qspan_pci.o i8259.o 40obj-$(CONFIG_PCI) += qspan_pci.o i8259.o
40endif 41endif
diff --git a/arch/ppc/syslib/mpc8xx_devices.c b/arch/ppc/syslib/mpc8xx_devices.c
new file mode 100644
index 000000000000..2b5f0e701687
--- /dev/null
+++ b/arch/ppc/syslib/mpc8xx_devices.c
@@ -0,0 +1,224 @@
1/*
2 * arch/ppc/syslib/mpc8xx_devices.c
3 *
4 * MPC8xx Device descriptions
5 *
6 * Maintainer: Kumar Gala <kumar.gala@freescale.com>
7 *
8 * Copyright 2005 MontaVista Software, Inc. by Vitaly Bordug<vbordug@ru.mvista.com>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#include <linux/init.h>
17#include <linux/module.h>
18#include <linux/device.h>
19#include <linux/serial_8250.h>
20#include <linux/mii.h>
21#include <asm/commproc.h>
22#include <asm/mpc8xx.h>
23#include <asm/irq.h>
24#include <asm/ppc_sys.h>
25
26/* We use offsets for IORESOURCE_MEM to do not set dependences at compile time.
27 * They will get fixed up by mach_mpc8xx_fixup
28 */
29
30struct platform_device ppc_sys_platform_devices[] = {
31 [MPC8xx_CPM_FEC1] = {
32 .name = "fsl-cpm-fec",
33 .id = 1,
34 .num_resources = 2,
35 .resource = (struct resource[]) {
36 {
37 .name = "regs",
38 .start = 0xe00,
39 .end = 0xe88,
40 .flags = IORESOURCE_MEM,
41 },
42 {
43 .name = "interrupt",
44 .start = MPC8xx_INT_FEC1,
45 .end = MPC8xx_INT_FEC1,
46 .flags = IORESOURCE_IRQ,
47 },
48 },
49 },
50 [MPC8xx_CPM_FEC2] = {
51 .name = "fsl-cpm-fec",
52 .id = 2,
53 .num_resources = 2,
54 .resource = (struct resource[]) {
55 {
56 .name = "regs",
57 .start = 0x1e00,
58 .end = 0x1e88,
59 .flags = IORESOURCE_MEM,
60 },
61 {
62 .name = "interrupt",
63 .start = MPC8xx_INT_FEC2,
64 .end = MPC8xx_INT_FEC2,
65 .flags = IORESOURCE_IRQ,
66 },
67 },
68 },
69 [MPC8xx_CPM_SCC1] = {
70 .name = "fsl-cpm-scc",
71 .id = 1,
72 .num_resources = 3,
73 .resource = (struct resource[]) {
74 {
75 .name = "regs",
76 .start = 0xa00,
77 .end = 0xa18,
78 .flags = IORESOURCE_MEM,
79 },
80 {
81 .name = "pram",
82 .start = 0x3c00,
83 .end = 0x3c80,
84 .flags = IORESOURCE_MEM,
85 },
86 {
87 .name = "interrupt",
88 .start = MPC8xx_INT_SCC1,
89 .end = MPC8xx_INT_SCC1,
90 .flags = IORESOURCE_IRQ,
91 },
92 },
93 },
94 [MPC8xx_CPM_SCC2] = {
95 .name = "fsl-cpm-scc",
96 .id = 2,
97 .num_resources = 3,
98 .resource = (struct resource[]) {
99 {
100 .name = "regs",
101 .start = 0xa20,
102 .end = 0xa38,
103 .flags = IORESOURCE_MEM,
104 },
105 {
106 .name = "pram",
107 .start = 0x3d00,
108 .end = 0x3d80,
109 .flags = IORESOURCE_MEM,
110 },
111
112 {
113 .name = "interrupt",
114 .start = MPC8xx_INT_SCC2,
115 .end = MPC8xx_INT_SCC2,
116 .flags = IORESOURCE_IRQ,
117 },
118 },
119 },
120 [MPC8xx_CPM_SCC3] = {
121 .name = "fsl-cpm-scc",
122 .id = 3,
123 .num_resources = 3,
124 .resource = (struct resource[]) {
125 {
126 .name = "regs",
127 .start = 0xa40,
128 .end = 0xa58,
129 .flags = IORESOURCE_MEM,
130 },
131 {
132 .name = "pram",
133 .start = 0x3e00,
134 .end = 0x3e80,
135 .flags = IORESOURCE_MEM,
136 },
137
138 {
139 .name = "interrupt",
140 .start = MPC8xx_INT_SCC3,
141 .end = MPC8xx_INT_SCC3,
142 .flags = IORESOURCE_IRQ,
143 },
144 },
145 },
146 [MPC8xx_CPM_SCC4] = {
147 .name = "fsl-cpm-scc",
148 .id = 4,
149 .num_resources = 3,
150 .resource = (struct resource[]) {
151 {
152 .name = "regs",
153 .start = 0xa60,
154 .end = 0xa78,
155 .flags = IORESOURCE_MEM,
156 },
157 {
158 .name = "pram",
159 .start = 0x3f00,
160 .end = 0x3f80,
161 .flags = IORESOURCE_MEM,
162 },
163
164 {
165 .name = "interrupt",
166 .start = MPC8xx_INT_SCC4,
167 .end = MPC8xx_INT_SCC4,
168 .flags = IORESOURCE_IRQ,
169 },
170 },
171 },
172 [MPC8xx_CPM_SMC1] = {
173 .name = "fsl-cpm-smc",
174 .id = 1,
175 .num_resources = 2,
176 .resource = (struct resource[]) {
177 {
178 .name = "regs",
179 .start = 0xa82,
180 .end = 0xa91,
181 .flags = IORESOURCE_MEM,
182 },
183 {
184 .name = "interrupt",
185 .start = MPC8xx_INT_SMC1,
186 .end = MPC8xx_INT_SMC1,
187 .flags = IORESOURCE_IRQ,
188 },
189 },
190 },
191 [MPC8xx_CPM_SMC2] = {
192 .name = "fsl-cpm-smc",
193 .id = 2,
194 .num_resources = 2,
195 .resource = (struct resource[]) {
196 {
197 .name = "regs",
198 .start = 0xa92,
199 .end = 0xaa1,
200 .flags = IORESOURCE_MEM,
201 },
202 {
203 .name = "interrupt",
204 .start = MPC8xx_INT_SMC2,
205 .end = MPC8xx_INT_SMC2,
206 .flags = IORESOURCE_IRQ,
207 },
208 },
209 },
210};
211
212static int __init mach_mpc8xx_fixup(struct platform_device *pdev)
213{
214 ppc_sys_fixup_mem_resource (pdev, IMAP_ADDR);
215 return 0;
216}
217
218static int __init mach_mpc8xx_init(void)
219{
220 ppc_sys_device_fixup = mach_mpc8xx_fixup;
221 return 0;
222}
223
224postcore_initcall(mach_mpc8xx_init);
diff --git a/arch/ppc/syslib/mpc8xx_sys.c b/arch/ppc/syslib/mpc8xx_sys.c
new file mode 100644
index 000000000000..a532ccc861c0
--- /dev/null
+++ b/arch/ppc/syslib/mpc8xx_sys.c
@@ -0,0 +1,61 @@
1/*
2 * arch/ppc/platforms/mpc8xx_sys.c
3 *
4 * MPC8xx System descriptions
5 *
6 * Maintainer: Kumar Gala <kumar.gala@freescale.com>
7 *
8 * Copyright 2005 MontaVista Software, Inc. by Vitaly Bordug <vbordug@ru.mvista.com>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#include <linux/init.h>
17#include <linux/module.h>
18#include <linux/device.h>
19#include <asm/ppc_sys.h>
20
21struct ppc_sys_spec *cur_ppc_sys_spec;
22struct ppc_sys_spec ppc_sys_specs[] = {
23 {
24 .ppc_sys_name = "MPC86X",
25 .mask = 0xFFFFFFFF,
26 .value = 0x00000000,
27 .num_devices = 2,
28 .device_list = (enum ppc_sys_devices[])
29 {
30 MPC8xx_CPM_FEC1,
31 MPC8xx_CPM_SCC1,
32 MPC8xx_CPM_SCC2,
33 MPC8xx_CPM_SCC3,
34 MPC8xx_CPM_SCC4,
35 MPC8xx_CPM_SMC1,
36 MPC8xx_CPM_SMC2,
37 },
38 },
39 {
40 .ppc_sys_name = "MPC885",
41 .mask = 0xFFFFFFFF,
42 .value = 0x00000000,
43 .num_devices = 3,
44 .device_list = (enum ppc_sys_devices[])
45 {
46 MPC8xx_CPM_FEC1,
47 MPC8xx_CPM_FEC2,
48 MPC8xx_CPM_SCC1,
49 MPC8xx_CPM_SCC2,
50 MPC8xx_CPM_SCC3,
51 MPC8xx_CPM_SCC4,
52 MPC8xx_CPM_SMC1,
53 MPC8xx_CPM_SMC2,
54 },
55 },
56 { /* default match */
57 .ppc_sys_name = "",
58 .mask = 0x00000000,
59 .value = 0x00000000,
60 },
61};
diff --git a/arch/ppc/syslib/open_pic2.c b/arch/ppc/syslib/open_pic2.c
index 2e0ea92144f6..9a7e8748e2b2 100644
--- a/arch/ppc/syslib/open_pic2.c
+++ b/arch/ppc/syslib/open_pic2.c
@@ -575,7 +575,7 @@ static void openpic2_cached_disable_irq(u_int irq)
575 * we need something better to deal with that... Maybe switch to S1 for 575 * we need something better to deal with that... Maybe switch to S1 for
576 * cpufreq changes 576 * cpufreq changes
577 */ 577 */
578int openpic2_suspend(struct sys_device *sysdev, u32 state) 578int openpic2_suspend(struct sys_device *sysdev, pm_message_t state)
579{ 579{
580 int i; 580 int i;
581 unsigned long flags; 581 unsigned long flags;
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
index deca68ad644a..c658650af429 100644
--- a/arch/ppc64/Kconfig
+++ b/arch/ppc64/Kconfig
@@ -28,10 +28,6 @@ config GENERIC_ISA_DMA
28 bool 28 bool
29 default y 29 default y
30 30
31config HAVE_DEC_LOCK
32 bool
33 default y
34
35config EARLY_PRINTK 31config EARLY_PRINTK
36 bool 32 bool
37 default y 33 default y
diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile
index 17d2c1eac3b8..521c2a5a2862 100644
--- a/arch/ppc64/Makefile
+++ b/arch/ppc64/Makefile
@@ -107,7 +107,7 @@ install: vmlinux
107 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ 107 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
108 108
109defaultimage-$(CONFIG_PPC_PSERIES) := zImage 109defaultimage-$(CONFIG_PPC_PSERIES) := zImage
110defaultimage-$(CONFIG_PPC_PMAC) := vmlinux 110defaultimage-$(CONFIG_PPC_PMAC) := zImage.vmode
111defaultimage-$(CONFIG_PPC_MAPLE) := zImage 111defaultimage-$(CONFIG_PPC_MAPLE) := zImage
112defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux 112defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
113KBUILD_IMAGE := $(defaultimage-y) 113KBUILD_IMAGE := $(defaultimage-y)
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S
index 58c314738c99..72c61041151a 100644
--- a/arch/ppc64/kernel/head.S
+++ b/arch/ppc64/kernel/head.S
@@ -1649,7 +1649,7 @@ _GLOBAL(__secondary_start)
1649 ld r3,0(r3) 1649 ld r3,0(r3)
1650 lwz r3,PLATFORM(r3) /* r3 = platform flags */ 1650 lwz r3,PLATFORM(r3) /* r3 = platform flags */
1651 andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */ 1651 andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */
1652 bne 98f 1652 beq 98f /* branch if result is 0 */
1653 mfspr r3,PVR 1653 mfspr r3,PVR
1654 srwi r3,r3,16 1654 srwi r3,r3,16
1655 cmpwi r3,0x37 /* SStar */ 1655 cmpwi r3,0x37 /* SStar */
@@ -1813,7 +1813,7 @@ _STATIC(start_here_multiplatform)
1813 ld r3,0(r3) 1813 ld r3,0(r3)
1814 lwz r3,PLATFORM(r3) /* r3 = platform flags */ 1814 lwz r3,PLATFORM(r3) /* r3 = platform flags */
1815 andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */ 1815 andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */
1816 bne 98f 1816 beq 98f /* branch if result is 0 */
1817 mfspr r3,PVR 1817 mfspr r3,PVR
1818 srwi r3,r3,16 1818 srwi r3,r3,16
1819 cmpwi r3,0x37 /* SStar */ 1819 cmpwi r3,0x37 /* SStar */
@@ -1834,7 +1834,7 @@ _STATIC(start_here_multiplatform)
1834 lwz r3,PLATFORM(r3) /* r3 = platform flags */ 1834 lwz r3,PLATFORM(r3) /* r3 = platform flags */
1835 /* Test if bit 0 is set (LPAR bit) */ 1835 /* Test if bit 0 is set (LPAR bit) */
1836 andi. r3,r3,PLATFORM_LPAR 1836 andi. r3,r3,PLATFORM_LPAR
1837 bne 98f 1837 bne 98f /* branch if result is !0 */
1838 LOADADDR(r6,_SDR1) /* Only if NOT LPAR */ 1838 LOADADDR(r6,_SDR1) /* Only if NOT LPAR */
1839 sub r6,r6,r26 1839 sub r6,r6,r26
1840 ld r6,0(r6) /* get the value of _SDR1 */ 1840 ld r6,0(r6) /* get the value of _SDR1 */
diff --git a/arch/ppc64/kernel/pSeries_iommu.c b/arch/ppc64/kernel/pSeries_iommu.c
index f0fd7fbd6531..8c6313e7e145 100644
--- a/arch/ppc64/kernel/pSeries_iommu.c
+++ b/arch/ppc64/kernel/pSeries_iommu.c
@@ -265,8 +265,10 @@ static void iommu_table_setparms(struct pci_controller *phb,
265 tbl->it_offset = phb->dma_window_base_cur >> PAGE_SHIFT; 265 tbl->it_offset = phb->dma_window_base_cur >> PAGE_SHIFT;
266 266
267 /* Test if we are going over 2GB of DMA space */ 267 /* Test if we are going over 2GB of DMA space */
268 if (phb->dma_window_base_cur + phb->dma_window_size > (1L << 31)) 268 if (phb->dma_window_base_cur + phb->dma_window_size > 0x80000000ul) {
269 udbg_printf("PCI_DMA: Unexpected number of IOAs under this PHB.\n");
269 panic("PCI_DMA: Unexpected number of IOAs under this PHB.\n"); 270 panic("PCI_DMA: Unexpected number of IOAs under this PHB.\n");
271 }
270 272
271 phb->dma_window_base_cur += phb->dma_window_size; 273 phb->dma_window_base_cur += phb->dma_window_size;
272 274
@@ -310,92 +312,84 @@ static void iommu_table_setparms_lpar(struct pci_controller *phb,
310 312
311static void iommu_bus_setup_pSeries(struct pci_bus *bus) 313static void iommu_bus_setup_pSeries(struct pci_bus *bus)
312{ 314{
313 struct device_node *dn, *pdn; 315 struct device_node *dn;
314 struct pci_dn *pci;
315 struct iommu_table *tbl; 316 struct iommu_table *tbl;
317 struct device_node *isa_dn, *isa_dn_orig;
318 struct device_node *tmp;
319 struct pci_dn *pci;
320 int children;
316 321
317 DBG("iommu_bus_setup_pSeries, bus %p, bus->self %p\n", bus, bus->self); 322 DBG("iommu_bus_setup_pSeries, bus %p, bus->self %p\n", bus, bus->self);
318 323
319 /* For each (root) bus, we carve up the available DMA space in 256MB 324 dn = pci_bus_to_OF_node(bus);
320 * pieces. Since each piece is used by one (sub) bus/device, that would 325 pci = PCI_DN(dn);
321 * give a maximum of 7 devices per PHB. In most cases, this is plenty. 326
322 * 327 if (bus->self) {
323 * The exception is on Python PHBs (pre-POWER4). Here we don't have EADS 328 /* This is not a root bus, any setup will be done for the
324 * bridges below the PHB to allocate the sectioned tables to, so instead 329 * device-side of the bridge in iommu_dev_setup_pSeries().
325 * we allocate a 1GB table at the PHB level. 330 */
331 return;
332 }
333
334 /* Check if the ISA bus on the system is under
335 * this PHB.
326 */ 336 */
337 isa_dn = isa_dn_orig = of_find_node_by_type(NULL, "isa");
327 338
328 dn = pci_bus_to_OF_node(bus); 339 while (isa_dn && isa_dn != dn)
329 pci = dn->data; 340 isa_dn = isa_dn->parent;
330 341
331 if (!bus->self) { 342 if (isa_dn_orig)
332 /* Root bus */ 343 of_node_put(isa_dn_orig);
333 if (is_python(dn)) {
334 unsigned int *iohole;
335
336 DBG("Python root bus %s\n", bus->name);
337
338 iohole = (unsigned int *)get_property(dn, "io-hole", 0);
339
340 if (iohole) {
341 /* On first bus we need to leave room for the
342 * ISA address space. Just skip the first 256MB
343 * alltogether. This leaves 768MB for the window.
344 */
345 DBG("PHB has io-hole, reserving 256MB\n");
346 pci->phb->dma_window_size = 3 << 28;
347 pci->phb->dma_window_base_cur = 1 << 28;
348 } else {
349 /* 1GB window by default */
350 pci->phb->dma_window_size = 1 << 30;
351 pci->phb->dma_window_base_cur = 0;
352 }
353
354 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
355
356 iommu_table_setparms(pci->phb, dn, tbl);
357 pci->iommu_table = iommu_init_table(tbl);
358 } else {
359 /* Do a 128MB table at root. This is used for the IDE
360 * controller on some SMP-mode POWER4 machines. It
361 * doesn't hurt to allocate it on other machines
362 * -- it'll just be unused since new tables are
363 * allocated on the EADS level.
364 *
365 * Allocate at offset 128MB to avoid having to deal
366 * with ISA holes; 128MB table for IDE is plenty.
367 */
368 pci->phb->dma_window_size = 1 << 27;
369 pci->phb->dma_window_base_cur = 1 << 27;
370
371 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
372
373 iommu_table_setparms(pci->phb, dn, tbl);
374 pci->iommu_table = iommu_init_table(tbl);
375
376 /* All child buses have 256MB tables */
377 pci->phb->dma_window_size = 1 << 28;
378 }
379 } else {
380 pdn = pci_bus_to_OF_node(bus->parent);
381 344
382 if (!bus->parent->self && !is_python(pdn)) { 345 /* Count number of direct PCI children of the PHB.
383 struct iommu_table *tbl; 346 * All PCI device nodes have class-code property, so it's
384 /* First child and not python means this is the EADS 347 * an easy way to find them.
385 * level. Allocate new table for this slot with 256MB 348 */
386 * window. 349 for (children = 0, tmp = dn->child; tmp; tmp = tmp->sibling)
387 */ 350 if (get_property(tmp, "class-code", NULL))
351 children++;
388 352
389 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); 353 DBG("Children: %d\n", children);
390 354
391 iommu_table_setparms(pci->phb, dn, tbl); 355 /* Calculate amount of DMA window per slot. Each window must be
356 * a power of two (due to pci_alloc_consistent requirements).
357 *
358 * Keep 256MB aside for PHBs with ISA.
359 */
392 360
393 pci->iommu_table = iommu_init_table(tbl); 361 if (!isa_dn) {
394 } else { 362 /* No ISA/IDE - just set window size and return */
395 /* Lower than first child or under python, use parent table */ 363 pci->phb->dma_window_size = 0x80000000ul; /* To be divided */
396 pci->iommu_table = PCI_DN(pdn)->iommu_table; 364
397 } 365 while (pci->phb->dma_window_size * children > 0x80000000ul)
366 pci->phb->dma_window_size >>= 1;
367 DBG("No ISA/IDE, window size is %x\n", pci->phb->dma_window_size);
368 pci->phb->dma_window_base_cur = 0;
369
370 return;
398 } 371 }
372
373 /* If we have ISA, then we probably have an IDE
374 * controller too. Allocate a 128MB table but
375 * skip the first 128MB to avoid stepping on ISA
376 * space.
377 */
378 pci->phb->dma_window_size = 0x8000000ul;
379 pci->phb->dma_window_base_cur = 0x8000000ul;
380
381 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
382
383 iommu_table_setparms(pci->phb, dn, tbl);
384 pci->iommu_table = iommu_init_table(tbl);
385
386 /* Divide the rest (1.75GB) among the children */
387 pci->phb->dma_window_size = 0x80000000ul;
388 while (pci->phb->dma_window_size * children > 0x70000000ul)
389 pci->phb->dma_window_size >>= 1;
390
391 DBG("ISA/IDE, window size is %x\n", pci->phb->dma_window_size);
392
399} 393}
400 394
401 395
@@ -446,14 +440,29 @@ static void iommu_bus_setup_pSeriesLP(struct pci_bus *bus)
446static void iommu_dev_setup_pSeries(struct pci_dev *dev) 440static void iommu_dev_setup_pSeries(struct pci_dev *dev)
447{ 441{
448 struct device_node *dn, *mydn; 442 struct device_node *dn, *mydn;
443 struct iommu_table *tbl;
449 444
450 DBG("iommu_dev_setup_pSeries, dev %p (%s)\n", dev, dev->pretty_name); 445 DBG("iommu_dev_setup_pSeries, dev %p (%s)\n", dev, dev->pretty_name);
451 /* Now copy the iommu_table ptr from the bus device down to the 446
452 * pci device_node. This means get_iommu_table() won't need to search
453 * up the device tree to find it.
454 */
455 mydn = dn = pci_device_to_OF_node(dev); 447 mydn = dn = pci_device_to_OF_node(dev);
456 448
449 /* If we're the direct child of a root bus, then we need to allocate
450 * an iommu table ourselves. The bus setup code should have setup
451 * the window sizes already.
452 */
453 if (!dev->bus->self) {
454 DBG(" --> first child, no bridge. Allocating iommu table.\n");
455 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
456 iommu_table_setparms(PCI_DN(dn)->phb, dn, tbl);
457 PCI_DN(mydn)->iommu_table = iommu_init_table(tbl);
458
459 return;
460 }
461
462 /* If this device is further down the bus tree, search upwards until
463 * an already allocated iommu table is found and use that.
464 */
465
457 while (dn && dn->data && PCI_DN(dn)->iommu_table == NULL) 466 while (dn && dn->data && PCI_DN(dn)->iommu_table == NULL)
458 dn = dn->parent; 467 dn = dn->parent;
459 468
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
index 861138ad092c..ff4be1da69d5 100644
--- a/arch/ppc64/kernel/pci.c
+++ b/arch/ppc64/kernel/pci.c
@@ -246,11 +246,14 @@ static unsigned int pci_parse_of_flags(u32 addr0)
246 unsigned int flags = 0; 246 unsigned int flags = 0;
247 247
248 if (addr0 & 0x02000000) { 248 if (addr0 & 0x02000000) {
249 flags |= IORESOURCE_MEM; 249 flags = IORESOURCE_MEM | PCI_BASE_ADDRESS_SPACE_MEMORY;
250 flags |= (addr0 >> 22) & PCI_BASE_ADDRESS_MEM_TYPE_64;
251 flags |= (addr0 >> 28) & PCI_BASE_ADDRESS_MEM_TYPE_1M;
250 if (addr0 & 0x40000000) 252 if (addr0 & 0x40000000)
251 flags |= IORESOURCE_PREFETCH; 253 flags |= IORESOURCE_PREFETCH
254 | PCI_BASE_ADDRESS_MEM_PREFETCH;
252 } else if (addr0 & 0x01000000) 255 } else if (addr0 & 0x01000000)
253 flags |= IORESOURCE_IO; 256 flags = IORESOURCE_IO | PCI_BASE_ADDRESS_SPACE_IO;
254 return flags; 257 return flags;
255} 258}
256 259
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c
index 9979919cdf92..f252670874a4 100644
--- a/arch/ppc64/kernel/prom_init.c
+++ b/arch/ppc64/kernel/prom_init.c
@@ -1711,6 +1711,7 @@ static void __init flatten_device_tree(void)
1711 unsigned long offset = reloc_offset(); 1711 unsigned long offset = reloc_offset();
1712 unsigned long mem_start, mem_end, room; 1712 unsigned long mem_start, mem_end, room;
1713 struct boot_param_header *hdr; 1713 struct boot_param_header *hdr;
1714 struct prom_t *_prom = PTRRELOC(&prom);
1714 char *namep; 1715 char *namep;
1715 u64 *rsvmap; 1716 u64 *rsvmap;
1716 1717
@@ -1765,6 +1766,7 @@ static void __init flatten_device_tree(void)
1765 RELOC(dt_struct_end) = PAGE_ALIGN(mem_start); 1766 RELOC(dt_struct_end) = PAGE_ALIGN(mem_start);
1766 1767
1767 /* Finish header */ 1768 /* Finish header */
1769 hdr->boot_cpuid_phys = _prom->cpu;
1768 hdr->magic = OF_DT_HEADER; 1770 hdr->magic = OF_DT_HEADER;
1769 hdr->totalsize = RELOC(dt_struct_end) - RELOC(dt_header_start); 1771 hdr->totalsize = RELOC(dt_struct_end) - RELOC(dt_header_start);
1770 hdr->off_dt_struct = RELOC(dt_struct_start) - RELOC(dt_header_start); 1772 hdr->off_dt_struct = RELOC(dt_struct_start) - RELOC(dt_header_start);
@@ -1854,7 +1856,6 @@ static void __init prom_find_boot_cpu(void)
1854 1856
1855 cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu); 1857 cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu);
1856 1858
1857 prom_setprop(cpu_pkg, "linux,boot-cpu", NULL, 0);
1858 prom_getprop(cpu_pkg, "reg", &getprop_rval, sizeof(getprop_rval)); 1859 prom_getprop(cpu_pkg, "reg", &getprop_rval, sizeof(getprop_rval));
1859 _prom->cpu = getprop_rval; 1860 _prom->cpu = getprop_rval;
1860 1861
diff --git a/arch/ppc64/kernel/vdso.c b/arch/ppc64/kernel/vdso.c
index 4777676365fe..efa985f05aca 100644
--- a/arch/ppc64/kernel/vdso.c
+++ b/arch/ppc64/kernel/vdso.c
@@ -224,10 +224,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack)
224 vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); 224 vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
225 if (vma == NULL) 225 if (vma == NULL)
226 return -ENOMEM; 226 return -ENOMEM;
227 if (security_vm_enough_memory(vdso_pages)) { 227
228 kmem_cache_free(vm_area_cachep, vma);
229 return -ENOMEM;
230 }
231 memset(vma, 0, sizeof(*vma)); 228 memset(vma, 0, sizeof(*vma));
232 229
233 /* 230 /*
@@ -237,8 +234,10 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack)
237 */ 234 */
238 vdso_base = get_unmapped_area(NULL, vdso_base, 235 vdso_base = get_unmapped_area(NULL, vdso_base,
239 vdso_pages << PAGE_SHIFT, 0, 0); 236 vdso_pages << PAGE_SHIFT, 0, 0);
240 if (vdso_base & ~PAGE_MASK) 237 if (vdso_base & ~PAGE_MASK) {
238 kmem_cache_free(vm_area_cachep, vma);
241 return (int)vdso_base; 239 return (int)vdso_base;
240 }
242 241
243 current->thread.vdso_base = vdso_base; 242 current->thread.vdso_base = vdso_base;
244 243
@@ -266,7 +265,11 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack)
266 vma->vm_ops = &vdso_vmops; 265 vma->vm_ops = &vdso_vmops;
267 266
268 down_write(&mm->mmap_sem); 267 down_write(&mm->mmap_sem);
269 insert_vm_struct(mm, vma); 268 if (insert_vm_struct(mm, vma)) {
269 up_write(&mm->mmap_sem);
270 kmem_cache_free(vm_area_cachep, vma);
271 return -ENOMEM;
272 }
270 mm->total_vm += (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 273 mm->total_vm += (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
271 up_write(&mm->mmap_sem); 274 up_write(&mm->mmap_sem);
272 275
diff --git a/arch/ppc64/lib/Makefile b/arch/ppc64/lib/Makefile
index 76fbfa9f706f..0b6e967de948 100644
--- a/arch/ppc64/lib/Makefile
+++ b/arch/ppc64/lib/Makefile
@@ -2,7 +2,7 @@
2# Makefile for ppc64-specific library files.. 2# Makefile for ppc64-specific library files..
3# 3#
4 4
5lib-y := checksum.o dec_and_lock.o string.o strcase.o 5lib-y := checksum.o string.o strcase.o
6lib-y += copypage.o memcpy.o copyuser.o usercopy.o 6lib-y += copypage.o memcpy.o copyuser.o usercopy.o
7 7
8# Lock primitives are defined as no-ops in include/linux/spinlock.h 8# Lock primitives are defined as no-ops in include/linux/spinlock.h
diff --git a/arch/ppc64/lib/dec_and_lock.c b/arch/ppc64/lib/dec_and_lock.c
deleted file mode 100644
index 7b9d4da5cf92..000000000000
--- a/arch/ppc64/lib/dec_and_lock.c
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * ppc64 version of atomic_dec_and_lock() using cmpxchg
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include <linux/module.h>
11#include <linux/spinlock.h>
12#include <asm/atomic.h>
13#include <asm/system.h>
14
15/*
16 * This is an implementation of the notion of "decrement a
17 * reference count, and return locked if it decremented to zero".
18 *
19 * This implementation can be used on any architecture that
20 * has a cmpxchg, and where atomic->value is an int holding
21 * the value of the atomic (i.e. the high bits aren't used
22 * for a lock or anything like that).
23 */
24int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)
25{
26 int counter;
27 int newcount;
28
29 for (;;) {
30 counter = atomic_read(atomic);
31 newcount = counter - 1;
32 if (!newcount)
33 break; /* do it the slow way */
34
35 newcount = cmpxchg(&atomic->counter, counter, newcount);
36 if (newcount == counter)
37 return 0;
38 }
39
40 spin_lock(lock);
41 if (atomic_dec_and_test(atomic))
42 return 1;
43 spin_unlock(lock);
44 return 0;
45}
46
47EXPORT_SYMBOL(_atomic_dec_and_lock);
diff --git a/arch/ppc64/mm/fault.c b/arch/ppc64/mm/fault.c
index 7fbc68bbb739..be3f25cf3e9f 100644
--- a/arch/ppc64/mm/fault.c
+++ b/arch/ppc64/mm/fault.c
@@ -38,6 +38,7 @@
38#include <asm/system.h> 38#include <asm/system.h>
39#include <asm/uaccess.h> 39#include <asm/uaccess.h>
40#include <asm/kdebug.h> 40#include <asm/kdebug.h>
41#include <asm/siginfo.h>
41 42
42/* 43/*
43 * Check whether the instruction at regs->nip is a store using 44 * Check whether the instruction at regs->nip is a store using
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 0865251a3f44..45d44c6bb39d 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/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.13-rc4 3# Linux kernel version: 2.6.14-rc1
4# Fri Jul 29 14:49:30 2005 4# Wed Sep 14 16:46:19 2005
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_RWSEM_XCHGADD_ALGORITHM=y 7CONFIG_RWSEM_XCHGADD_ALGORITHM=y
@@ -21,6 +21,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
21# General setup 21# General setup
22# 22#
23CONFIG_LOCALVERSION="" 23CONFIG_LOCALVERSION=""
24CONFIG_LOCALVERSION_AUTO=y
24CONFIG_SWAP=y 25CONFIG_SWAP=y
25CONFIG_SYSVIPC=y 26CONFIG_SYSVIPC=y
26CONFIG_POSIX_MQUEUE=y 27CONFIG_POSIX_MQUEUE=y
@@ -33,6 +34,7 @@ CONFIG_KOBJECT_UEVENT=y
33CONFIG_IKCONFIG=y 34CONFIG_IKCONFIG=y
34CONFIG_IKCONFIG_PROC=y 35CONFIG_IKCONFIG_PROC=y
35# CONFIG_CPUSETS is not set 36# CONFIG_CPUSETS is not set
37CONFIG_INITRAMFS_SOURCE=""
36# CONFIG_EMBEDDED is not set 38# CONFIG_EMBEDDED is not set
37CONFIG_KALLSYMS=y 39CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_ALL is not set 40# CONFIG_KALLSYMS_ALL is not set
@@ -94,6 +96,7 @@ CONFIG_FLATMEM_MANUAL=y
94# CONFIG_SPARSEMEM_MANUAL is not set 96# CONFIG_SPARSEMEM_MANUAL is not set
95CONFIG_FLATMEM=y 97CONFIG_FLATMEM=y
96CONFIG_FLAT_NODE_MEM_MAP=y 98CONFIG_FLAT_NODE_MEM_MAP=y
99# CONFIG_SPARSEMEM_STATIC is not set
97 100
98# 101#
99# I/O subsystem configuration 102# I/O subsystem configuration
@@ -151,8 +154,8 @@ CONFIG_IP_FIB_HASH=y
151# CONFIG_INET_ESP is not set 154# CONFIG_INET_ESP is not set
152# CONFIG_INET_IPCOMP is not set 155# CONFIG_INET_IPCOMP is not set
153# CONFIG_INET_TUNNEL is not set 156# CONFIG_INET_TUNNEL is not set
154CONFIG_IP_TCPDIAG=y 157CONFIG_INET_DIAG=y
155CONFIG_IP_TCPDIAG_IPV6=y 158CONFIG_INET_TCP_DIAG=y
156# CONFIG_TCP_CONG_ADVANCED is not set 159# CONFIG_TCP_CONG_ADVANCED is not set
157CONFIG_TCP_CONG_BIC=y 160CONFIG_TCP_CONG_BIC=y
158CONFIG_IPV6=y 161CONFIG_IPV6=y
@@ -165,6 +168,11 @@ CONFIG_IPV6=y
165# CONFIG_NETFILTER is not set 168# CONFIG_NETFILTER is not set
166 169
167# 170#
171# DCCP Configuration (EXPERIMENTAL)
172#
173# CONFIG_IP_DCCP is not set
174
175#
168# SCTP Configuration (EXPERIMENTAL) 176# SCTP Configuration (EXPERIMENTAL)
169# 177#
170# CONFIG_IP_SCTP is not set 178# CONFIG_IP_SCTP is not set
@@ -217,9 +225,11 @@ CONFIG_NET_CLS_POLICE=y
217# Network testing 225# Network testing
218# 226#
219# CONFIG_NET_PKTGEN is not set 227# CONFIG_NET_PKTGEN is not set
228# CONFIG_NETFILTER_NETLINK is not set
220# CONFIG_HAMRADIO is not set 229# CONFIG_HAMRADIO is not set
221# CONFIG_IRDA is not set 230# CONFIG_IRDA is not set
222# CONFIG_BT is not set 231# CONFIG_BT is not set
232# CONFIG_IEEE80211 is not set
223# CONFIG_PCMCIA is not set 233# CONFIG_PCMCIA is not set
224 234
225# 235#
@@ -233,6 +243,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
233# 243#
234# SCSI device support 244# SCSI device support
235# 245#
246# CONFIG_RAID_ATTRS is not set
236CONFIG_SCSI=y 247CONFIG_SCSI=y
237CONFIG_SCSI_PROC_FS=y 248CONFIG_SCSI_PROC_FS=y
238 249
@@ -260,6 +271,7 @@ CONFIG_SCSI_LOGGING=y
260# CONFIG_SCSI_SPI_ATTRS is not set 271# CONFIG_SCSI_SPI_ATTRS is not set
261CONFIG_SCSI_FC_ATTRS=y 272CONFIG_SCSI_FC_ATTRS=y
262# CONFIG_SCSI_ISCSI_ATTRS is not set 273# CONFIG_SCSI_ISCSI_ATTRS is not set
274# CONFIG_SCSI_SAS_ATTRS is not set
263 275
264# 276#
265# SCSI low-level drivers 277# SCSI low-level drivers
@@ -280,7 +292,6 @@ CONFIG_BLK_DEV_RAM=y
280CONFIG_BLK_DEV_RAM_COUNT=16 292CONFIG_BLK_DEV_RAM_COUNT=16
281CONFIG_BLK_DEV_RAM_SIZE=4096 293CONFIG_BLK_DEV_RAM_SIZE=4096
282CONFIG_BLK_DEV_INITRD=y 294CONFIG_BLK_DEV_INITRD=y
283CONFIG_INITRAMFS_SOURCE=""
284# CONFIG_LBD is not set 295# CONFIG_LBD is not set
285# CONFIG_CDROM_PKTCDVD is not set 296# CONFIG_CDROM_PKTCDVD is not set
286 297
@@ -384,6 +395,10 @@ CONFIG_EQUALIZER=m
384CONFIG_TUN=m 395CONFIG_TUN=m
385 396
386# 397#
398# PHY device support
399#
400
401#
387# Ethernet (10 or 100Mbit) 402# Ethernet (10 or 100Mbit)
388# 403#
389CONFIG_NET_ETHERNET=y 404CONFIG_NET_ETHERNET=y
@@ -453,10 +468,6 @@ CONFIG_FS_MBCACHE=y
453# CONFIG_REISERFS_FS is not set 468# CONFIG_REISERFS_FS is not set
454# CONFIG_JFS_FS is not set 469# CONFIG_JFS_FS is not set
455# CONFIG_FS_POSIX_ACL is not set 470# CONFIG_FS_POSIX_ACL is not set
456
457#
458# XFS support
459#
460# CONFIG_XFS_FS is not set 471# CONFIG_XFS_FS is not set
461# CONFIG_MINIX_FS is not set 472# CONFIG_MINIX_FS is not set
462# CONFIG_ROMFS_FS is not set 473# CONFIG_ROMFS_FS is not set
@@ -465,6 +476,7 @@ CONFIG_INOTIFY=y
465CONFIG_DNOTIFY=y 476CONFIG_DNOTIFY=y
466# CONFIG_AUTOFS_FS is not set 477# CONFIG_AUTOFS_FS is not set
467# CONFIG_AUTOFS4_FS is not set 478# CONFIG_AUTOFS4_FS is not set
479# CONFIG_FUSE_FS is not set
468 480
469# 481#
470# CD-ROM/DVD Filesystems 482# CD-ROM/DVD Filesystems
@@ -485,11 +497,10 @@ CONFIG_DNOTIFY=y
485CONFIG_PROC_FS=y 497CONFIG_PROC_FS=y
486CONFIG_PROC_KCORE=y 498CONFIG_PROC_KCORE=y
487CONFIG_SYSFS=y 499CONFIG_SYSFS=y
488# CONFIG_DEVPTS_FS_XATTR is not set
489CONFIG_TMPFS=y 500CONFIG_TMPFS=y
490# CONFIG_TMPFS_XATTR is not set
491# CONFIG_HUGETLB_PAGE is not set 501# CONFIG_HUGETLB_PAGE is not set
492CONFIG_RAMFS=y 502CONFIG_RAMFS=y
503# CONFIG_RELAYFS_FS is not set
493 504
494# 505#
495# Miscellaneous filesystems 506# Miscellaneous filesystems
@@ -533,6 +544,7 @@ CONFIG_SUNRPC=y
533# CONFIG_NCP_FS is not set 544# CONFIG_NCP_FS is not set
534# CONFIG_CODA_FS is not set 545# CONFIG_CODA_FS is not set
535# CONFIG_AFS_FS is not set 546# CONFIG_AFS_FS is not set
547# CONFIG_9P_FS is not set
536 548
537# 549#
538# Partition Types 550# Partition Types
@@ -572,6 +584,7 @@ CONFIG_MSDOS_PARTITION=y
572CONFIG_DEBUG_KERNEL=y 584CONFIG_DEBUG_KERNEL=y
573CONFIG_MAGIC_SYSRQ=y 585CONFIG_MAGIC_SYSRQ=y
574CONFIG_LOG_BUF_SHIFT=17 586CONFIG_LOG_BUF_SHIFT=17
587CONFIG_DETECT_SOFTLOCKUP=y
575# CONFIG_SCHEDSTATS is not set 588# CONFIG_SCHEDSTATS is not set
576# CONFIG_DEBUG_SLAB is not set 589# CONFIG_DEBUG_SLAB is not set
577CONFIG_DEBUG_PREEMPT=y 590CONFIG_DEBUG_PREEMPT=y
@@ -626,5 +639,6 @@ CONFIG_CRYPTO=y
626# Library routines 639# Library routines
627# 640#
628# CONFIG_CRC_CCITT is not set 641# CONFIG_CRC_CCITT is not set
642# CONFIG_CRC16 is not set
629CONFIG_CRC32=m 643CONFIG_CRC32=m
630# CONFIG_LIBCRC32C is not set 644# CONFIG_LIBCRC32C is not set
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index ab1e49d2e518..8584dd823218 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -6,7 +6,7 @@ EXTRA_AFLAGS := -traditional
6 6
7obj-y := bitmap.o traps.o time.o process.o \ 7obj-y := bitmap.o traps.o time.o process.o \
8 setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ 8 setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
9 semaphore.o s390_ext.o debug.o profile.o irq.o 9 semaphore.o s390_ext.o debug.o profile.o irq.o reipl_diag.o
10 10
11extra-$(CONFIG_ARCH_S390_31) += head.o 11extra-$(CONFIG_ARCH_S390_31) += head.o
12extra-$(CONFIG_ARCH_S390X) += head64.o 12extra-$(CONFIG_ARCH_S390X) += head64.o
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index 58fc7fbcb40e..9b30f4cf32c4 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -108,7 +108,7 @@ STACK_SIZE = 1 << STACK_SHIFT
108 bl BASED(0f) 108 bl BASED(0f)
109 l %r14,BASED(.Lcleanup_critical) 109 l %r14,BASED(.Lcleanup_critical)
110 basr %r14,%r14 110 basr %r14,%r14
111 tm 0(%r12),0x01 # retest problem state after cleanup 111 tm 1(%r12),0x01 # retest problem state after cleanup
112 bnz BASED(1f) 112 bnz BASED(1f)
1130: l %r14,__LC_ASYNC_STACK # are we already on the async stack ? 1130: l %r14,__LC_ASYNC_STACK # are we already on the async stack ?
114 slr %r14,%r15 114 slr %r14,%r15
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index d0c9ffaa25db..7b9b4a2ba1d7 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -101,7 +101,7 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_MCCK_PENDING)
101 clc \psworg+8(8),BASED(.Lcritical_start) 101 clc \psworg+8(8),BASED(.Lcritical_start)
102 jl 0f 102 jl 0f
103 brasl %r14,cleanup_critical 103 brasl %r14,cleanup_critical
104 tm 0(%r12),0x01 # retest problem state after cleanup 104 tm 1(%r12),0x01 # retest problem state after cleanup
105 jnz 1f 105 jnz 1f
1060: lg %r14,__LC_ASYNC_STACK # are we already on the async. stack ? 1060: lg %r14,__LC_ASYNC_STACK # are we already on the async. stack ?
107 slgr %r14,%r15 107 slgr %r14,%r15
diff --git a/arch/s390/kernel/reipl_diag.c b/arch/s390/kernel/reipl_diag.c
new file mode 100644
index 000000000000..83cb42bc0b76
--- /dev/null
+++ b/arch/s390/kernel/reipl_diag.c
@@ -0,0 +1,39 @@
1/*
2 * This file contains the implementation of the
3 * Linux re-IPL support
4 *
5 * (C) Copyright IBM Corp. 2005
6 *
7 * Author(s): Volker Sameske (sameske@de.ibm.com)
8 *
9 */
10
11#include <linux/kernel.h>
12
13static unsigned int reipl_diag_rc1;
14static unsigned int reipl_diag_rc2;
15
16/*
17 * re-IPL the system using the last used IPL parameters
18 */
19void reipl_diag(void)
20{
21 asm volatile (
22 " la %%r4,0\n"
23 " la %%r5,0\n"
24 " diag %%r4,%2,0x308\n"
25 "0:\n"
26 " st %%r4,%0\n"
27 " st %%r5,%1\n"
28 ".section __ex_table,\"a\"\n"
29#ifdef __s390x__
30 " .align 8\n"
31 " .quad 0b, 0b\n"
32#else
33 " .align 4\n"
34 " .long 0b, 0b\n"
35#endif
36 ".previous\n"
37 : "=m" (reipl_diag_rc1), "=m" (reipl_diag_rc2)
38 : "d" (3) : "cc", "4", "5" );
39}
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 5ba5a5485da9..5204778b8e5e 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -261,8 +261,11 @@ void (*_machine_power_off)(void) = machine_power_off_smp;
261 * Reboot, halt and power_off routines for non SMP. 261 * Reboot, halt and power_off routines for non SMP.
262 */ 262 */
263extern void reipl(unsigned long devno); 263extern void reipl(unsigned long devno);
264extern void reipl_diag(void);
264static void do_machine_restart_nonsmp(char * __unused) 265static void do_machine_restart_nonsmp(char * __unused)
265{ 266{
267 reipl_diag();
268
266 if (MACHINE_IS_VM) 269 if (MACHINE_IS_VM)
267 cpcmd ("IPL", NULL, 0); 270 cpcmd ("IPL", NULL, 0);
268 else 271 else
@@ -634,6 +637,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
634 struct cpuinfo_S390 *cpuinfo; 637 struct cpuinfo_S390 *cpuinfo;
635 unsigned long n = (unsigned long) v - 1; 638 unsigned long n = (unsigned long) v - 1;
636 639
640 preempt_disable();
637 if (!n) { 641 if (!n) {
638 seq_printf(m, "vendor_id : IBM/S390\n" 642 seq_printf(m, "vendor_id : IBM/S390\n"
639 "# processors : %i\n" 643 "# processors : %i\n"
@@ -658,6 +662,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
658 cpuinfo->cpu_id.ident, 662 cpuinfo->cpu_id.ident,
659 cpuinfo->cpu_id.machine); 663 cpuinfo->cpu_id.machine);
660 } 664 }
665 preempt_enable();
661 return 0; 666 return 0;
662} 667}
663 668
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 85222fee4361..e13c87b446b2 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -65,6 +65,7 @@ extern char vmhalt_cmd[];
65extern char vmpoff_cmd[]; 65extern char vmpoff_cmd[];
66 66
67extern void reipl(unsigned long devno); 67extern void reipl(unsigned long devno);
68extern void reipl_diag(void);
68 69
69static void smp_ext_bitcall(int, ec_bit_sig); 70static void smp_ext_bitcall(int, ec_bit_sig);
70static void smp_ext_bitcall_others(ec_bit_sig); 71static void smp_ext_bitcall_others(ec_bit_sig);
@@ -283,6 +284,8 @@ static void do_machine_restart(void * __unused)
283 * interrupted by an external interrupt and s390irq 284 * interrupted by an external interrupt and s390irq
284 * locks are always held disabled). 285 * locks are always held disabled).
285 */ 286 */
287 reipl_diag();
288
286 if (MACHINE_IS_VM) 289 if (MACHINE_IS_VM)
287 cpcmd ("IPL", NULL, 0, NULL); 290 cpcmd ("IPL", NULL, 0, NULL);
288 else 291 else
diff --git a/arch/sparc64/Kconfig.debug b/arch/sparc64/Kconfig.debug
index cd8d39fb954d..af0e9411b83e 100644
--- a/arch/sparc64/Kconfig.debug
+++ b/arch/sparc64/Kconfig.debug
@@ -33,14 +33,6 @@ config DEBUG_BOOTMEM
33 depends on DEBUG_KERNEL 33 depends on DEBUG_KERNEL
34 bool "Debug BOOTMEM initialization" 34 bool "Debug BOOTMEM initialization"
35 35
36# We have a custom atomic_dec_and_lock() implementation but it's not
37# compatible with spinlock debugging so we need to fall back on
38# the generic version in that case.
39config HAVE_DEC_LOCK
40 bool
41 depends on SMP && !DEBUG_SPINLOCK
42 default y
43
44config MCOUNT 36config MCOUNT
45 bool 37 bool
46 depends on STACK_DEBUG 38 depends on STACK_DEBUG
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index 3e0badb820c5..b48349527853 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -42,19 +42,15 @@
42 * executing (see inherit_locked_prom_mappings() rant). 42 * executing (see inherit_locked_prom_mappings() rant).
43 */ 43 */
44sparc64_vpte_nucleus: 44sparc64_vpte_nucleus:
45 /* Load 0xf0000000, which is LOW_OBP_ADDRESS. */ 45 /* Note that kvmap below has verified that the address is
46 mov 0xf, %g5 46 * in the range MODULES_VADDR --> VMALLOC_END already. So
47 sllx %g5, 28, %g5 47 * here we need only check if it is an OBP address or not.
48 48 */
49 /* Is addr >= LOW_OBP_ADDRESS? */ 49 sethi %hi(LOW_OBP_ADDRESS), %g5
50 cmp %g4, %g5 50 cmp %g4, %g5
51 blu,pn %xcc, sparc64_vpte_patchme1 51 blu,pn %xcc, sparc64_vpte_patchme1
52 mov 0x1, %g5 52 mov 0x1, %g5
53
54 /* Load 0x100000000, which is HI_OBP_ADDRESS. */
55 sllx %g5, 32, %g5 53 sllx %g5, 32, %g5
56
57 /* Is addr < HI_OBP_ADDRESS? */
58 cmp %g4, %g5 54 cmp %g4, %g5
59 blu,pn %xcc, obp_iaddr_patch 55 blu,pn %xcc, obp_iaddr_patch
60 nop 56 nop
@@ -156,26 +152,29 @@ obp_daddr_patch:
156 * rather, use information saved during inherit_prom_mappings() using 8k 152 * rather, use information saved during inherit_prom_mappings() using 8k
157 * pagesize. 153 * pagesize.
158 */ 154 */
155 .align 32
159kvmap: 156kvmap:
160 /* Load 0xf0000000, which is LOW_OBP_ADDRESS. */ 157 sethi %hi(MODULES_VADDR), %g5
161 mov 0xf, %g5 158 cmp %g4, %g5
162 sllx %g5, 28, %g5 159 blu,pn %xcc, longpath
160 mov (VMALLOC_END >> 24), %g5
161 sllx %g5, 24, %g5
162 cmp %g4, %g5
163 bgeu,pn %xcc, longpath
164 nop
163 165
164 /* Is addr >= LOW_OBP_ADDRESS? */ 166kvmap_check_obp:
167 sethi %hi(LOW_OBP_ADDRESS), %g5
165 cmp %g4, %g5 168 cmp %g4, %g5
166 blu,pn %xcc, vmalloc_addr 169 blu,pn %xcc, kvmap_vmalloc_addr
167 mov 0x1, %g5 170 mov 0x1, %g5
168
169 /* Load 0x100000000, which is HI_OBP_ADDRESS. */
170 sllx %g5, 32, %g5 171 sllx %g5, 32, %g5
171
172 /* Is addr < HI_OBP_ADDRESS? */
173 cmp %g4, %g5 172 cmp %g4, %g5
174 blu,pn %xcc, obp_daddr_patch 173 blu,pn %xcc, obp_daddr_patch
175 nop 174 nop
176 175
177vmalloc_addr: 176kvmap_vmalloc_addr:
178 /* If we get here, a vmalloc addr accessed, load kernel VPTE. */ 177 /* If we get here, a vmalloc addr was accessed, load kernel VPTE. */
179 ldxa [%g3 + %g6] ASI_N, %g5 178 ldxa [%g3 + %g6] ASI_N, %g5
180 brgez,pn %g5, longpath 179 brgez,pn %g5, longpath
181 nop 180 nop
diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
index 23ad839d113f..5efbff90d668 100644
--- a/arch/sparc64/kernel/ptrace.c
+++ b/arch/sparc64/kernel/ptrace.c
@@ -30,6 +30,7 @@
30#include <asm/psrcompat.h> 30#include <asm/psrcompat.h>
31#include <asm/visasm.h> 31#include <asm/visasm.h>
32#include <asm/spitfire.h> 32#include <asm/spitfire.h>
33#include <asm/page.h>
33 34
34/* Returning from ptrace is a bit tricky because the syscall return 35/* Returning from ptrace is a bit tricky because the syscall return
35 * low level code assumes any value returned which is negative and 36 * low level code assumes any value returned which is negative and
@@ -128,20 +129,20 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
128 * is mapped to in the user's address space, we can skip the 129 * is mapped to in the user's address space, we can skip the
129 * D-cache flush. 130 * D-cache flush.
130 */ 131 */
131 if ((uaddr ^ kaddr) & (1UL << 13)) { 132 if ((uaddr ^ (unsigned long) kaddr) & (1UL << 13)) {
132 unsigned long start = __pa(kaddr); 133 unsigned long start = __pa(kaddr);
133 unsigned long end = start + len; 134 unsigned long end = start + len;
134 135
135 if (tlb_type == spitfire) { 136 if (tlb_type == spitfire) {
136 for (; start < end; start += 32) 137 for (; start < end; start += 32)
137 spitfire_put_dcache_tag(va & 0x3fe0, 0x0); 138 spitfire_put_dcache_tag(start & 0x3fe0, 0x0);
138 } else { 139 } else {
139 for (; start < end; start += 32) 140 for (; start < end; start += 32)
140 __asm__ __volatile__( 141 __asm__ __volatile__(
141 "stxa %%g0, [%0] %1\n\t" 142 "stxa %%g0, [%0] %1\n\t"
142 "membar #Sync" 143 "membar #Sync"
143 : /* no outputs */ 144 : /* no outputs */
144 : "r" (va), 145 : "r" (start),
145 "i" (ASI_DCACHE_INVALIDATE)); 146 "i" (ASI_DCACHE_INVALIDATE));
146 } 147 }
147 } 148 }
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index cbb5e59824e5..fb7a5370dbfc 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -163,9 +163,6 @@ EXPORT_SYMBOL(atomic64_add);
163EXPORT_SYMBOL(atomic64_add_ret); 163EXPORT_SYMBOL(atomic64_add_ret);
164EXPORT_SYMBOL(atomic64_sub); 164EXPORT_SYMBOL(atomic64_sub);
165EXPORT_SYMBOL(atomic64_sub_ret); 165EXPORT_SYMBOL(atomic64_sub_ret);
166#ifdef CONFIG_SMP
167EXPORT_SYMBOL(_atomic_dec_and_lock);
168#endif
169 166
170/* Atomic bit operations. */ 167/* Atomic bit operations. */
171EXPORT_SYMBOL(test_and_set_bit); 168EXPORT_SYMBOL(test_and_set_bit);
diff --git a/arch/sparc64/kernel/una_asm.S b/arch/sparc64/kernel/una_asm.S
index cbb40585253c..da48400bcc95 100644
--- a/arch/sparc64/kernel/una_asm.S
+++ b/arch/sparc64/kernel/una_asm.S
@@ -17,7 +17,7 @@ kernel_unaligned_trap_fault:
17__do_int_store: 17__do_int_store:
18 rd %asi, %o4 18 rd %asi, %o4
19 wr %o3, 0, %asi 19 wr %o3, 0, %asi
20 ldx [%o2], %g3 20 mov %o2, %g3
21 cmp %o1, 2 21 cmp %o1, 2
22 be,pn %icc, 2f 22 be,pn %icc, 2f
23 cmp %o1, 4 23 cmp %o1, 4
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c
index da9739f0d437..42718f6a7d36 100644
--- a/arch/sparc64/kernel/unaligned.c
+++ b/arch/sparc64/kernel/unaligned.c
@@ -184,13 +184,14 @@ extern void do_int_load(unsigned long *dest_reg, int size,
184 unsigned long *saddr, int is_signed, int asi); 184 unsigned long *saddr, int is_signed, int asi);
185 185
186extern void __do_int_store(unsigned long *dst_addr, int size, 186extern void __do_int_store(unsigned long *dst_addr, int size,
187 unsigned long *src_val, int asi); 187 unsigned long src_val, int asi);
188 188
189static inline void do_int_store(int reg_num, int size, unsigned long *dst_addr, 189static inline void do_int_store(int reg_num, int size, unsigned long *dst_addr,
190 struct pt_regs *regs, int asi) 190 struct pt_regs *regs, int asi, int orig_asi)
191{ 191{
192 unsigned long zero = 0; 192 unsigned long zero = 0;
193 unsigned long *src_val = &zero; 193 unsigned long *src_val_p = &zero;
194 unsigned long src_val;
194 195
195 if (size == 16) { 196 if (size == 16) {
196 size = 8; 197 size = 8;
@@ -198,7 +199,25 @@ static inline void do_int_store(int reg_num, int size, unsigned long *dst_addr,
198 (unsigned)fetch_reg(reg_num, regs) : 0)) << 32) | 199 (unsigned)fetch_reg(reg_num, regs) : 0)) << 32) |
199 (unsigned)fetch_reg(reg_num + 1, regs); 200 (unsigned)fetch_reg(reg_num + 1, regs);
200 } else if (reg_num) { 201 } else if (reg_num) {
201 src_val = fetch_reg_addr(reg_num, regs); 202 src_val_p = fetch_reg_addr(reg_num, regs);
203 }
204 src_val = *src_val_p;
205 if (unlikely(asi != orig_asi)) {
206 switch (size) {
207 case 2:
208 src_val = swab16(src_val);
209 break;
210 case 4:
211 src_val = swab32(src_val);
212 break;
213 case 8:
214 src_val = swab64(src_val);
215 break;
216 case 16:
217 default:
218 BUG();
219 break;
220 };
202 } 221 }
203 __do_int_store(dst_addr, size, src_val, asi); 222 __do_int_store(dst_addr, size, src_val, asi);
204} 223}
@@ -276,6 +295,7 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, u
276 kernel_mna_trap_fault(); 295 kernel_mna_trap_fault();
277 } else { 296 } else {
278 unsigned long addr; 297 unsigned long addr;
298 int orig_asi, asi;
279 299
280 addr = compute_effective_address(regs, insn, 300 addr = compute_effective_address(regs, insn,
281 ((insn >> 25) & 0x1f)); 301 ((insn >> 25) & 0x1f));
@@ -285,18 +305,48 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, u
285 regs->tpc, dirstrings[dir], addr, size, 305 regs->tpc, dirstrings[dir], addr, size,
286 regs->u_regs[UREG_RETPC]); 306 regs->u_regs[UREG_RETPC]);
287#endif 307#endif
308 orig_asi = asi = decode_asi(insn, regs);
309 switch (asi) {
310 case ASI_NL:
311 case ASI_AIUPL:
312 case ASI_AIUSL:
313 case ASI_PL:
314 case ASI_SL:
315 case ASI_PNFL:
316 case ASI_SNFL:
317 asi &= ~0x08;
318 break;
319 };
288 switch (dir) { 320 switch (dir) {
289 case load: 321 case load:
290 do_int_load(fetch_reg_addr(((insn>>25)&0x1f), regs), 322 do_int_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
291 size, (unsigned long *) addr, 323 size, (unsigned long *) addr,
292 decode_signedness(insn), 324 decode_signedness(insn), asi);
293 decode_asi(insn, regs)); 325 if (unlikely(asi != orig_asi)) {
326 unsigned long val_in = *(unsigned long *) addr;
327 switch (size) {
328 case 2:
329 val_in = swab16(val_in);
330 break;
331 case 4:
332 val_in = swab32(val_in);
333 break;
334 case 8:
335 val_in = swab64(val_in);
336 break;
337 case 16:
338 default:
339 BUG();
340 break;
341 };
342 *(unsigned long *) addr = val_in;
343 }
294 break; 344 break;
295 345
296 case store: 346 case store:
297 do_int_store(((insn>>25)&0x1f), size, 347 do_int_store(((insn>>25)&0x1f), size,
298 (unsigned long *) addr, regs, 348 (unsigned long *) addr, regs,
299 decode_asi(insn, regs)); 349 asi, orig_asi);
300 break; 350 break;
301 351
302 default: 352 default:
diff --git a/arch/sparc64/lib/Makefile b/arch/sparc64/lib/Makefile
index d968aebe83b2..c295806500f7 100644
--- a/arch/sparc64/lib/Makefile
+++ b/arch/sparc64/lib/Makefile
@@ -14,6 +14,4 @@ lib-y := PeeCeeI.o copy_page.o clear_page.o strlen.o strncmp.o \
14 copy_in_user.o user_fixup.o memmove.o \ 14 copy_in_user.o user_fixup.o memmove.o \
15 mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o 15 mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o
16 16
17lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
18
19obj-y += iomap.o 17obj-y += iomap.o
diff --git a/arch/sparc64/lib/dec_and_lock.S b/arch/sparc64/lib/dec_and_lock.S
deleted file mode 100644
index 8ee288dd0afc..000000000000
--- a/arch/sparc64/lib/dec_and_lock.S
+++ /dev/null
@@ -1,80 +0,0 @@
1/* $Id: dec_and_lock.S,v 1.5 2001/11/18 00:12:56 davem Exp $
2 * dec_and_lock.S: Sparc64 version of "atomic_dec_and_lock()"
3 * using cas and ldstub instructions.
4 *
5 * Copyright (C) 2000 David S. Miller (davem@redhat.com)
6 */
7#include <linux/config.h>
8#include <asm/thread_info.h>
9
10 .text
11 .align 64
12
13 /* CAS basically works like this:
14 *
15 * void CAS(MEM, REG1, REG2)
16 * {
17 * START_ATOMIC();
18 * if (*(MEM) == REG1) {
19 * TMP = *(MEM);
20 * *(MEM) = REG2;
21 * REG2 = TMP;
22 * } else
23 * REG2 = *(MEM);
24 * END_ATOMIC();
25 * }
26 */
27
28 .globl _atomic_dec_and_lock
29_atomic_dec_and_lock: /* %o0 = counter, %o1 = lock */
30loop1: lduw [%o0], %g2
31 subcc %g2, 1, %g7
32 be,pn %icc, start_to_zero
33 nop
34nzero: cas [%o0], %g2, %g7
35 cmp %g2, %g7
36 bne,pn %icc, loop1
37 mov 0, %g1
38
39out:
40 membar #StoreLoad | #StoreStore
41 retl
42 mov %g1, %o0
43start_to_zero:
44#ifdef CONFIG_PREEMPT
45 ldsw [%g6 + TI_PRE_COUNT], %g3
46 add %g3, 1, %g3
47 stw %g3, [%g6 + TI_PRE_COUNT]
48#endif
49to_zero:
50 ldstub [%o1], %g3
51 membar #StoreLoad | #StoreStore
52 brnz,pn %g3, spin_on_lock
53 nop
54loop2: cas [%o0], %g2, %g7 /* ASSERT(g7 == 0) */
55 cmp %g2, %g7
56
57 be,pt %icc, out
58 mov 1, %g1
59 lduw [%o0], %g2
60 subcc %g2, 1, %g7
61 be,pn %icc, loop2
62 nop
63 membar #StoreStore | #LoadStore
64 stb %g0, [%o1]
65#ifdef CONFIG_PREEMPT
66 ldsw [%g6 + TI_PRE_COUNT], %g3
67 sub %g3, 1, %g3
68 stw %g3, [%g6 + TI_PRE_COUNT]
69#endif
70
71 b,pt %xcc, nzero
72 nop
73spin_on_lock:
74 ldub [%o1], %g3
75 membar #LoadLoad
76 brnz,pt %g3, spin_on_lock
77 nop
78 ba,pt %xcc, to_zero
79 nop
80 nop
diff --git a/arch/um/Kconfig.i386 b/arch/um/Kconfig.i386
index 8ad156a00499..5d92cacd56c6 100644
--- a/arch/um/Kconfig.i386
+++ b/arch/um/Kconfig.i386
@@ -42,3 +42,7 @@ config ARCH_HAS_SC_SIGNALS
42config ARCH_REUSE_HOST_VSYSCALL_AREA 42config ARCH_REUSE_HOST_VSYSCALL_AREA
43 bool 43 bool
44 default y 44 default y
45
46config X86_CMPXCHG
47 bool
48 default y
diff --git a/arch/um/Makefile b/arch/um/Makefile
index ce987266dac6..5b5af95721ab 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -53,9 +53,13 @@ SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH)
53 53
54# -Dvmap=kernel_vmap affects everything, and prevents anything from 54# -Dvmap=kernel_vmap affects everything, and prevents anything from
55# referencing the libpcap.o symbol so named. 55# referencing the libpcap.o symbol so named.
56#
57# Same things for in6addr_loopback - found in libc.
56 58
57CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ 59CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
58 $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap 60 $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \
61 -Din6addr_loopback=kernel_in6addr_loopback
62
59AFLAGS += $(ARCH_INCLUDE) 63AFLAGS += $(ARCH_INCLUDE)
60 64
61USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) 65USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
diff --git a/arch/um/drivers/mcast_user.c b/arch/um/drivers/mcast_user.c
index 7a0d115b29d0..5db136e2651c 100644
--- a/arch/um/drivers/mcast_user.c
+++ b/arch/um/drivers/mcast_user.c
@@ -13,7 +13,6 @@
13 13
14#include <errno.h> 14#include <errno.h>
15#include <unistd.h> 15#include <unistd.h>
16#include <linux/inet.h>
17#include <sys/socket.h> 16#include <sys/socket.h>
18#include <sys/un.h> 17#include <sys/un.h>
19#include <sys/time.h> 18#include <sys/time.h>
@@ -55,7 +54,7 @@ static int mcast_open(void *data)
55 struct mcast_data *pri = data; 54 struct mcast_data *pri = data;
56 struct sockaddr_in *sin = pri->mcast_addr; 55 struct sockaddr_in *sin = pri->mcast_addr;
57 struct ip_mreq mreq; 56 struct ip_mreq mreq;
58 int fd = -EINVAL, yes = 1, err = -EINVAL;; 57 int fd, yes = 1, err = 0;
59 58
60 59
61 if ((sin->sin_addr.s_addr == 0) || (sin->sin_port == 0)) 60 if ((sin->sin_addr.s_addr == 0) || (sin->sin_port == 0))
@@ -66,13 +65,14 @@ static int mcast_open(void *data)
66 if (fd < 0){ 65 if (fd < 0){
67 printk("mcast_open : data socket failed, errno = %d\n", 66 printk("mcast_open : data socket failed, errno = %d\n",
68 errno); 67 errno);
69 fd = -errno; 68 err = -errno;
70 goto out; 69 goto out;
71 } 70 }
72 71
73 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) { 72 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) {
74 printk("mcast_open: SO_REUSEADDR failed, errno = %d\n", 73 printk("mcast_open: SO_REUSEADDR failed, errno = %d\n",
75 errno); 74 errno);
75 err = -errno;
76 goto out_close; 76 goto out_close;
77 } 77 }
78 78
@@ -81,6 +81,7 @@ static int mcast_open(void *data)
81 sizeof(pri->ttl)) < 0) { 81 sizeof(pri->ttl)) < 0) {
82 printk("mcast_open: IP_MULTICAST_TTL failed, error = %d\n", 82 printk("mcast_open: IP_MULTICAST_TTL failed, error = %d\n",
83 errno); 83 errno);
84 err = -errno;
84 goto out_close; 85 goto out_close;
85 } 86 }
86 87
@@ -88,12 +89,14 @@ static int mcast_open(void *data)
88 if (setsockopt(fd, SOL_IP, IP_MULTICAST_LOOP, &yes, sizeof(yes)) < 0) { 89 if (setsockopt(fd, SOL_IP, IP_MULTICAST_LOOP, &yes, sizeof(yes)) < 0) {
89 printk("mcast_open: IP_MULTICAST_LOOP failed, error = %d\n", 90 printk("mcast_open: IP_MULTICAST_LOOP failed, error = %d\n",
90 errno); 91 errno);
92 err = -errno;
91 goto out_close; 93 goto out_close;
92 } 94 }
93 95
94 /* bind socket to mcast address */ 96 /* bind socket to mcast address */
95 if (bind(fd, (struct sockaddr *) sin, sizeof(*sin)) < 0) { 97 if (bind(fd, (struct sockaddr *) sin, sizeof(*sin)) < 0) {
96 printk("mcast_open : data bind failed, errno = %d\n", errno); 98 printk("mcast_open : data bind failed, errno = %d\n", errno);
99 err = -errno;
97 goto out_close; 100 goto out_close;
98 } 101 }
99 102
@@ -108,14 +111,15 @@ static int mcast_open(void *data)
108 "interface on the host.\n"); 111 "interface on the host.\n");
109 printk("eth0 should be configured in order to use the " 112 printk("eth0 should be configured in order to use the "
110 "multicast transport.\n"); 113 "multicast transport.\n");
114 err = -errno;
111 goto out_close; 115 goto out_close;
112 } 116 }
113 117
114 out:
115 return fd; 118 return fd;
116 119
117 out_close: 120 out_close:
118 os_close_file(fd); 121 os_close_file(fd);
122 out:
119 return err; 123 return err;
120} 124}
121 125
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index c190c2414197..12c95368124a 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -32,6 +32,7 @@
32#include "os.h" 32#include "os.h"
33#include "umid.h" 33#include "umid.h"
34#include "irq_kern.h" 34#include "irq_kern.h"
35#include "choose-mode.h"
35 36
36static int do_unlink_socket(struct notifier_block *notifier, 37static int do_unlink_socket(struct notifier_block *notifier,
37 unsigned long what, void *data) 38 unsigned long what, void *data)
@@ -276,6 +277,7 @@ void mconsole_proc(struct mc_request *req)
276 go - continue the UML after a 'stop' \n\ 277 go - continue the UML after a 'stop' \n\
277 log <string> - make UML enter <string> into the kernel log\n\ 278 log <string> - make UML enter <string> into the kernel log\n\
278 proc <file> - returns the contents of the UML's /proc/<file>\n\ 279 proc <file> - returns the contents of the UML's /proc/<file>\n\
280 stack <pid> - returns the stack of the specified pid\n\
279" 281"
280 282
281void mconsole_help(struct mc_request *req) 283void mconsole_help(struct mc_request *req)
@@ -479,6 +481,56 @@ void mconsole_sysrq(struct mc_request *req)
479} 481}
480#endif 482#endif
481 483
484/* Mconsole stack trace
485 * Added by Allan Graves, Jeff Dike
486 * Dumps a stacks registers to the linux console.
487 * Usage stack <pid>.
488 */
489void do_stack(struct mc_request *req)
490{
491 char *ptr = req->request.data;
492 int pid_requested= -1;
493 struct task_struct *from = NULL;
494 struct task_struct *to = NULL;
495
496 /* Would be nice:
497 * 1) Send showregs output to mconsole.
498 * 2) Add a way to stack dump all pids.
499 */
500
501 ptr += strlen("stack");
502 while(isspace(*ptr)) ptr++;
503
504 /* Should really check for multiple pids or reject bad args here */
505 /* What do the arguments in mconsole_reply mean? */
506 if(sscanf(ptr, "%d", &pid_requested) == 0){
507 mconsole_reply(req, "Please specify a pid", 1, 0);
508 return;
509 }
510
511 from = current;
512 to = find_task_by_pid(pid_requested);
513
514 if((to == NULL) || (pid_requested == 0)) {
515 mconsole_reply(req, "Couldn't find that pid", 1, 0);
516 return;
517 }
518 to->thread.saved_task = current;
519
520 switch_to(from, to, from);
521 mconsole_reply(req, "Stack Dumped to console and message log", 0, 0);
522}
523
524void mconsole_stack(struct mc_request *req)
525{
526 /* This command doesn't work in TT mode, so let's check and then
527 * get out of here
528 */
529 CHOOSE_MODE(mconsole_reply(req, "Sorry, this doesn't work in TT mode",
530 1, 0),
531 do_stack(req));
532}
533
482/* Changed by mconsole_setup, which is __setup, and called before SMP is 534/* Changed by mconsole_setup, which is __setup, and called before SMP is
483 * active. 535 * active.
484 */ 536 */
diff --git a/arch/um/drivers/mconsole_user.c b/arch/um/drivers/mconsole_user.c
index fe5afb13252c..310c1f823f26 100644
--- a/arch/um/drivers/mconsole_user.c
+++ b/arch/um/drivers/mconsole_user.c
@@ -30,6 +30,7 @@ static struct mconsole_command commands[] = {
30 { "go", mconsole_go, MCONSOLE_INTR }, 30 { "go", mconsole_go, MCONSOLE_INTR },
31 { "log", mconsole_log, MCONSOLE_INTR }, 31 { "log", mconsole_log, MCONSOLE_INTR },
32 { "proc", mconsole_proc, MCONSOLE_PROC }, 32 { "proc", mconsole_proc, MCONSOLE_PROC },
33 { "stack", mconsole_stack, MCONSOLE_INTR },
33}; 34};
34 35
35/* Initialized in mconsole_init, which is an initcall */ 36/* Initialized in mconsole_init, which is an initcall */
@@ -172,9 +173,9 @@ int mconsole_notify(char *sock_name, int type, const void *data, int len)
172 if(notify_sock < 0){ 173 if(notify_sock < 0){
173 notify_sock = socket(PF_UNIX, SOCK_DGRAM, 0); 174 notify_sock = socket(PF_UNIX, SOCK_DGRAM, 0);
174 if(notify_sock < 0){ 175 if(notify_sock < 0){
175 printk("mconsole_notify - socket failed, errno = %d\n",
176 errno);
177 err = -errno; 176 err = -errno;
177 printk("mconsole_notify - socket failed, errno = %d\n",
178 err);
178 } 179 }
179 } 180 }
180 unlock_notify(); 181 unlock_notify();
@@ -197,8 +198,8 @@ int mconsole_notify(char *sock_name, int type, const void *data, int len)
197 n = sendto(notify_sock, &packet, len, 0, (struct sockaddr *) &target, 198 n = sendto(notify_sock, &packet, len, 0, (struct sockaddr *) &target,
198 sizeof(target)); 199 sizeof(target));
199 if(n < 0){ 200 if(n < 0){
200 printk("mconsole_notify - sendto failed, errno = %d\n", errno);
201 err = -errno; 201 err = -errno;
202 printk("mconsole_notify - sendto failed, errno = %d\n", errno);
202 } 203 }
203 return(err); 204 return(err);
204} 205}
diff --git a/arch/um/drivers/pty.c b/arch/um/drivers/pty.c
index ed84d01df6cc..0306a1b215b7 100644
--- a/arch/um/drivers/pty.c
+++ b/arch/um/drivers/pty.c
@@ -43,8 +43,9 @@ static int pts_open(int input, int output, int primary, void *d,
43 43
44 fd = get_pty(); 44 fd = get_pty();
45 if(fd < 0){ 45 if(fd < 0){
46 err = -errno;
46 printk("open_pts : Failed to open pts\n"); 47 printk("open_pts : Failed to open pts\n");
47 return(-errno); 48 return err;
48 } 49 }
49 if(data->raw){ 50 if(data->raw){
50 CATCH_EINTR(err = tcgetattr(fd, &data->tt)); 51 CATCH_EINTR(err = tcgetattr(fd, &data->tt));
diff --git a/arch/um/drivers/ubd_user.c b/arch/um/drivers/ubd_user.c
deleted file mode 100644
index b94d2bc4fe06..000000000000
--- a/arch/um/drivers/ubd_user.c
+++ /dev/null
@@ -1,75 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Copyright (C) 2001 Ridgerun,Inc (glonnon@ridgerun.com)
4 * Licensed under the GPL
5 */
6
7#include <stddef.h>
8#include <unistd.h>
9#include <errno.h>
10#include <sched.h>
11#include <signal.h>
12#include <string.h>
13#include <netinet/in.h>
14#include <sys/time.h>
15#include <sys/socket.h>
16#include <sys/mman.h>
17#include <sys/param.h>
18#include "asm/types.h"
19#include "user_util.h"
20#include "kern_util.h"
21#include "user.h"
22#include "ubd_user.h"
23#include "os.h"
24#include "cow.h"
25
26#include <endian.h>
27#include <byteswap.h>
28
29void ignore_sigwinch_sig(void)
30{
31 signal(SIGWINCH, SIG_IGN);
32}
33
34int start_io_thread(unsigned long sp, int *fd_out)
35{
36 int pid, fds[2], err;
37
38 err = os_pipe(fds, 1, 1);
39 if(err < 0){
40 printk("start_io_thread - os_pipe failed, err = %d\n", -err);
41 goto out;
42 }
43
44 kernel_fd = fds[0];
45 *fd_out = fds[1];
46
47 pid = clone(io_thread, (void *) sp, CLONE_FILES | CLONE_VM | SIGCHLD,
48 NULL);
49 if(pid < 0){
50 printk("start_io_thread - clone failed : errno = %d\n", errno);
51 err = -errno;
52 goto out_close;
53 }
54
55 return(pid);
56
57 out_close:
58 os_close_file(fds[0]);
59 os_close_file(fds[1]);
60 kernel_fd = -1;
61 *fd_out = -1;
62 out:
63 return(err);
64}
65
66/*
67 * Overrides for Emacs so that we follow Linus's tabbing style.
68 * Emacs will notice this stuff at the end of the file and automatically
69 * adjust the settings for this buffer only. This must remain at the end
70 * of the file.
71 * ---------------------------------------------------------------------------
72 * Local variables:
73 * c-file-style: "linux"
74 * End:
75 */
diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c
index 93dc1911363f..90e0e5ff451e 100644
--- a/arch/um/drivers/xterm.c
+++ b/arch/um/drivers/xterm.c
@@ -110,13 +110,15 @@ int xterm_open(int input, int output, int primary, void *d,
110 110
111 fd = mkstemp(file); 111 fd = mkstemp(file);
112 if(fd < 0){ 112 if(fd < 0){
113 err = -errno;
113 printk("xterm_open : mkstemp failed, errno = %d\n", errno); 114 printk("xterm_open : mkstemp failed, errno = %d\n", errno);
114 return(-errno); 115 return err;
115 } 116 }
116 117
117 if(unlink(file)){ 118 if(unlink(file)){
119 err = -errno;
118 printk("xterm_open : unlink failed, errno = %d\n", errno); 120 printk("xterm_open : unlink failed, errno = %d\n", errno);
119 return(-errno); 121 return err;
120 } 122 }
121 os_close_file(fd); 123 os_close_file(fd);
122 124
diff --git a/arch/um/include/common-offsets.h b/arch/um/include/common-offsets.h
index 0aa620970adb..782ac3a3baf9 100644
--- a/arch/um/include/common-offsets.h
+++ b/arch/um/include/common-offsets.h
@@ -12,4 +12,6 @@ DEFINE_STR(UM_KERN_WARNING, KERN_WARNING);
12DEFINE_STR(UM_KERN_NOTICE, KERN_NOTICE); 12DEFINE_STR(UM_KERN_NOTICE, KERN_NOTICE);
13DEFINE_STR(UM_KERN_INFO, KERN_INFO); 13DEFINE_STR(UM_KERN_INFO, KERN_INFO);
14DEFINE_STR(UM_KERN_DEBUG, KERN_DEBUG); 14DEFINE_STR(UM_KERN_DEBUG, KERN_DEBUG);
15DEFINE(HOST_ELF_CLASS, ELF_CLASS); 15DEFINE(UM_ELF_CLASS, ELF_CLASS);
16DEFINE(UM_ELFCLASS32, ELFCLASS32);
17DEFINE(UM_ELFCLASS64, ELFCLASS64);
diff --git a/arch/um/include/mconsole.h b/arch/um/include/mconsole.h
index cfa368e045a5..b1b512f47035 100644
--- a/arch/um/include/mconsole.h
+++ b/arch/um/include/mconsole.h
@@ -81,6 +81,7 @@ extern void mconsole_stop(struct mc_request *req);
81extern void mconsole_go(struct mc_request *req); 81extern void mconsole_go(struct mc_request *req);
82extern void mconsole_log(struct mc_request *req); 82extern void mconsole_log(struct mc_request *req);
83extern void mconsole_proc(struct mc_request *req); 83extern void mconsole_proc(struct mc_request *req);
84extern void mconsole_stack(struct mc_request *req);
84 85
85extern int mconsole_get_request(int fd, struct mc_request *req); 86extern int mconsole_get_request(int fd, struct mc_request *req);
86extern int mconsole_notify(char *sock_name, int type, const void *data, 87extern int mconsole_notify(char *sock_name, int type, const void *data,
diff --git a/arch/um/include/mem_user.h b/arch/um/include/mem_user.h
index d6404bb64662..9fef4123a65a 100644
--- a/arch/um/include/mem_user.h
+++ b/arch/um/include/mem_user.h
@@ -51,7 +51,6 @@ extern unsigned long task_size;
51 51
52extern void check_devanon(void); 52extern void check_devanon(void);
53extern int init_mem_user(void); 53extern int init_mem_user(void);
54extern int create_mem_file(unsigned long len);
55extern void setup_memory(void *entry); 54extern void setup_memory(void *entry);
56extern unsigned long find_iomem(char *driver, unsigned long *len_out); 55extern unsigned long find_iomem(char *driver, unsigned long *len_out);
57extern int init_maps(unsigned long physmem, unsigned long iomem, 56extern int init_maps(unsigned long physmem, unsigned long iomem,
@@ -64,20 +63,6 @@ extern unsigned long phys_offset(unsigned long phys);
64extern void unmap_physmem(void); 63extern void unmap_physmem(void);
65extern void map_memory(unsigned long virt, unsigned long phys, 64extern void map_memory(unsigned long virt, unsigned long phys,
66 unsigned long len, int r, int w, int x); 65 unsigned long len, int r, int w, int x);
67extern int protect_memory(unsigned long addr, unsigned long len,
68 int r, int w, int x, int must_succeed);
69extern unsigned long get_kmem_end(void); 66extern unsigned long get_kmem_end(void);
70extern void check_tmpexec(void);
71 67
72#endif 68#endif
73
74/*
75 * Overrides for Emacs so that we follow Linus's tabbing style.
76 * Emacs will notice this stuff at the end of the file and automatically
77 * adjust the settings for this buffer only. This must remain at the end
78 * of the file.
79 * ---------------------------------------------------------------------------
80 * Local variables:
81 * c-file-style: "linux"
82 * End:
83 */
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index 4c362458052c..583329d0a539 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -157,6 +157,9 @@ extern int os_lock_file(int fd, int excl);
157extern void os_early_checks(void); 157extern void os_early_checks(void);
158extern int can_do_skas(void); 158extern int can_do_skas(void);
159 159
160/* mem.c */
161extern int create_mem_file(unsigned long len);
162
160/* process.c */ 163/* process.c */
161extern unsigned long os_process_pc(int pid); 164extern unsigned long os_process_pc(int pid);
162extern int os_process_parent(int pid); 165extern int os_process_parent(int pid);
@@ -181,6 +184,8 @@ extern unsigned long long os_usecs(void);
181/* tt.c 184/* tt.c
182 * for tt mode only (will be deleted in future...) 185 * for tt mode only (will be deleted in future...)
183 */ 186 */
187extern int protect_memory(unsigned long addr, unsigned long len,
188 int r, int w, int x, int must_succeed);
184extern void forward_pending_sigio(int target); 189extern void forward_pending_sigio(int target);
185extern int start_fork_tramp(void *arg, unsigned long temp_stack, 190extern int start_fork_tramp(void *arg, unsigned long temp_stack,
186 int clone_flags, int (*tramp)(void *)); 191 int clone_flags, int (*tramp)(void *));
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
index 614b8ebeb0ed..1a0001b3850c 100644
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
@@ -1,4 +1,4 @@
1# 1#
2# Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2# Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
@@ -7,11 +7,11 @@ extra-y := vmlinux.lds
7clean-files := 7clean-files :=
8 8
9obj-y = config.o exec_kern.o exitcode.o \ 9obj-y = config.o exec_kern.o exitcode.o \
10 helper.o init_task.o irq.o irq_user.o ksyms.o main.o mem.o mem_user.o \ 10 helper.o init_task.o irq.o irq_user.o ksyms.o main.o mem.o physmem.o \
11 physmem.o process_kern.o ptrace.o reboot.o resource.o sigio_user.o \ 11 process_kern.o ptrace.o reboot.o resource.o sigio_user.o sigio_kern.o \
12 sigio_kern.o signal_kern.o signal_user.o smp.o syscall_kern.o sysrq.o \ 12 signal_kern.o signal_user.o smp.o syscall_kern.o sysrq.o time.o \
13 tempfile.o time.o time_kern.o tlb.o trap_kern.o trap_user.o \ 13 time_kern.o tlb.o trap_kern.o trap_user.o uaccess_user.o um_arch.o \
14 uaccess_user.o um_arch.o umid.o user_util.o 14 umid.o user_util.o
15 15
16obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o 16obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
17obj-$(CONFIG_GPROF) += gprof_syms.o 17obj-$(CONFIG_GPROF) += gprof_syms.o
@@ -24,8 +24,8 @@ obj-$(CONFIG_MODE_SKAS) += skas/
24 24
25user-objs-$(CONFIG_TTY_LOG) += tty_log.o 25user-objs-$(CONFIG_TTY_LOG) += tty_log.o
26 26
27USER_OBJS := $(user-objs-y) config.o helper.o main.o tempfile.o time.o \ 27USER_OBJS := $(user-objs-y) config.o helper.o main.o time.o tty_log.o umid.o \
28 tty_log.o umid.o user_util.o 28 user_util.o
29 29
30include arch/um/scripts/Makefile.rules 30include arch/um/scripts/Makefile.rules
31 31
diff --git a/arch/um/kernel/helper.c b/arch/um/kernel/helper.c
index f83e1e8e2392..33fb0bd3b11a 100644
--- a/arch/um/kernel/helper.c
+++ b/arch/um/kernel/helper.c
@@ -85,8 +85,8 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
85 data.fd = fds[1]; 85 data.fd = fds[1];
86 pid = clone(helper_child, (void *) sp, CLONE_VM | SIGCHLD, &data); 86 pid = clone(helper_child, (void *) sp, CLONE_VM | SIGCHLD, &data);
87 if(pid < 0){ 87 if(pid < 0){
88 printk("run_helper : clone failed, errno = %d\n", errno);
89 ret = -errno; 88 ret = -errno;
89 printk("run_helper : clone failed, errno = %d\n", errno);
90 goto out_close; 90 goto out_close;
91 } 91 }
92 92
@@ -122,7 +122,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
122 unsigned long *stack_out, int stack_order) 122 unsigned long *stack_out, int stack_order)
123{ 123{
124 unsigned long stack, sp; 124 unsigned long stack, sp;
125 int pid, status; 125 int pid, status, err;
126 126
127 stack = alloc_stack(stack_order, um_in_interrupt()); 127 stack = alloc_stack(stack_order, um_in_interrupt());
128 if(stack == 0) return(-ENOMEM); 128 if(stack == 0) return(-ENOMEM);
@@ -130,16 +130,18 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
130 sp = stack + (page_size() << stack_order) - sizeof(void *); 130 sp = stack + (page_size() << stack_order) - sizeof(void *);
131 pid = clone(proc, (void *) sp, flags | SIGCHLD, arg); 131 pid = clone(proc, (void *) sp, flags | SIGCHLD, arg);
132 if(pid < 0){ 132 if(pid < 0){
133 err = -errno;
133 printk("run_helper_thread : clone failed, errno = %d\n", 134 printk("run_helper_thread : clone failed, errno = %d\n",
134 errno); 135 errno);
135 return(-errno); 136 return err;
136 } 137 }
137 if(stack_out == NULL){ 138 if(stack_out == NULL){
138 CATCH_EINTR(pid = waitpid(pid, &status, 0)); 139 CATCH_EINTR(pid = waitpid(pid, &status, 0));
139 if(pid < 0){ 140 if(pid < 0){
141 err = -errno;
140 printk("run_helper_thread - wait failed, errno = %d\n", 142 printk("run_helper_thread - wait failed, errno = %d\n",
141 errno); 143 errno);
142 pid = -errno; 144 pid = err;
143 } 145 }
144 if(!WIFEXITED(status) || (WEXITSTATUS(status) != 0)) 146 if(!WIFEXITED(status) || (WEXITSTATUS(status) != 0))
145 printk("run_helper_thread - thread returned status " 147 printk("run_helper_thread - thread returned status "
@@ -156,8 +158,8 @@ int helper_wait(int pid)
156 158
157 CATCH_EINTR(ret = waitpid(pid, NULL, WNOHANG)); 159 CATCH_EINTR(ret = waitpid(pid, NULL, WNOHANG));
158 if(ret < 0){ 160 if(ret < 0){
161 ret = -errno;
159 printk("helper_wait : waitpid failed, errno = %d\n", errno); 162 printk("helper_wait : waitpid failed, errno = %d\n", errno);
160 return(-errno);
161 } 163 }
162 return(ret); 164 return(ret);
163} 165}
diff --git a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c
index cd7c85be0a1b..49ed5ddf0704 100644
--- a/arch/um/kernel/init_task.c
+++ b/arch/um/kernel/init_task.c
@@ -13,6 +13,7 @@
13#include "asm/pgtable.h" 13#include "asm/pgtable.h"
14#include "user_util.h" 14#include "user_util.h"
15#include "mem_user.h" 15#include "mem_user.h"
16#include "os.h"
16 17
17static struct fs_struct init_fs = INIT_FS; 18static struct fs_struct init_fs = INIT_FS;
18struct mm_struct init_mm = INIT_MM(init_mm); 19struct mm_struct init_mm = INIT_MM(init_mm);
@@ -45,8 +46,8 @@ __attribute__((__section__(".data.init_task"))) =
45 46
46void unprotect_stack(unsigned long stack) 47void unprotect_stack(unsigned long stack)
47{ 48{
48 protect_memory(stack, (1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE, 49 os_protect_memory((void *) stack, (1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE,
49 1, 1, 0, 1); 50 1, 1, 0);
50} 51}
51 52
52/* 53/*
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 64fa062cc119..ea008b031a8f 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) 2 * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -19,6 +19,10 @@
19#include "mem_user.h" 19#include "mem_user.h"
20#include "uml_uaccess.h" 20#include "uml_uaccess.h"
21#include "os.h" 21#include "os.h"
22#include "linux/types.h"
23#include "linux/string.h"
24#include "init.h"
25#include "kern_constants.h"
22 26
23extern char __binary_start; 27extern char __binary_start;
24 28
@@ -368,6 +372,16 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
368 return pte; 372 return pte;
369} 373}
370 374
375struct iomem_region *iomem_regions = NULL;
376int iomem_size = 0;
377
378extern int parse_iomem(char *str, int *add) __init;
379
380__uml_setup("iomem=", parse_iomem,
381"iomem=<name>,<file>\n"
382" Configure <file> as an IO memory region named <name>.\n\n"
383);
384
371/* 385/*
372 * Overrides for Emacs so that we follow Linus's tabbing style. 386 * Overrides for Emacs so that we follow Linus's tabbing style.
373 * Emacs will notice this stuff at the end of the file and automatically 387 * Emacs will notice this stuff at the end of the file and automatically
diff --git a/arch/um/kernel/mem_user.c b/arch/um/kernel/mem_user.c
deleted file mode 100644
index 4a663fd434bb..000000000000
--- a/arch/um/kernel/mem_user.c
+++ /dev/null
@@ -1,273 +0,0 @@
1/*
2 * arch/um/kernel/mem_user.c
3 *
4 * BRIEF MODULE DESCRIPTION
5 * user side memory routines for supporting IO memory inside user mode linux
6 *
7 * Copyright (C) 2001 RidgeRun, Inc.
8 * Author: RidgeRun, Inc.
9 * Greg Lonnon glonnon@ridgerun.com or info@ridgerun.com
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 *
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
19 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
22 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * You should have received a copy of the GNU General Public License along
28 * with this program; if not, write to the Free Software Foundation, Inc.,
29 * 675 Mass Ave, Cambridge, MA 02139, USA.
30 */
31
32#include <stdio.h>
33#include <stdlib.h>
34#include <stddef.h>
35#include <stdarg.h>
36#include <unistd.h>
37#include <errno.h>
38#include <string.h>
39#include <fcntl.h>
40#include <sys/types.h>
41#include <sys/mman.h>
42#include "kern_util.h"
43#include "user.h"
44#include "user_util.h"
45#include "mem_user.h"
46#include "init.h"
47#include "os.h"
48#include "tempfile.h"
49#include "kern_constants.h"
50
51#define TEMPNAME_TEMPLATE "vm_file-XXXXXX"
52
53static int create_tmp_file(unsigned long len)
54{
55 int fd, err;
56 char zero;
57
58 fd = make_tempfile(TEMPNAME_TEMPLATE, NULL, 1);
59 if(fd < 0) {
60 os_print_error(fd, "make_tempfile");
61 exit(1);
62 }
63
64 err = os_mode_fd(fd, 0777);
65 if(err < 0){
66 os_print_error(err, "os_mode_fd");
67 exit(1);
68 }
69 err = os_seek_file(fd, len);
70 if(err < 0){
71 os_print_error(err, "os_seek_file");
72 exit(1);
73 }
74 zero = 0;
75 err = os_write_file(fd, &zero, 1);
76 if(err != 1){
77 os_print_error(err, "os_write_file");
78 exit(1);
79 }
80
81 return(fd);
82}
83
84void check_tmpexec(void)
85{
86 void *addr;
87 int err, fd = create_tmp_file(UM_KERN_PAGE_SIZE);
88
89 addr = mmap(NULL, UM_KERN_PAGE_SIZE,
90 PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0);
91 printf("Checking PROT_EXEC mmap in /tmp...");
92 fflush(stdout);
93 if(addr == MAP_FAILED){
94 err = errno;
95 perror("failed");
96 if(err == EPERM)
97 printf("/tmp must be not mounted noexec\n");
98 exit(1);
99 }
100 printf("OK\n");
101 munmap(addr, UM_KERN_PAGE_SIZE);
102
103 os_close_file(fd);
104}
105
106static int have_devanon = 0;
107
108void check_devanon(void)
109{
110 int fd;
111
112 printk("Checking for /dev/anon on the host...");
113 fd = open("/dev/anon", O_RDWR);
114 if(fd < 0){
115 printk("Not available (open failed with errno %d)\n", errno);
116 return;
117 }
118
119 printk("OK\n");
120 have_devanon = 1;
121}
122
123static int create_anon_file(unsigned long len)
124{
125 void *addr;
126 int fd;
127
128 fd = open("/dev/anon", O_RDWR);
129 if(fd < 0) {
130 os_print_error(fd, "opening /dev/anon");
131 exit(1);
132 }
133
134 addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
135 if(addr == MAP_FAILED){
136 perror("mapping physmem file");
137 exit(1);
138 }
139 munmap(addr, len);
140
141 return(fd);
142}
143
144int create_mem_file(unsigned long len)
145{
146 int err, fd;
147
148 if(have_devanon)
149 fd = create_anon_file(len);
150 else fd = create_tmp_file(len);
151
152 err = os_set_exec_close(fd, 1);
153 if(err < 0)
154 os_print_error(err, "exec_close");
155 return(fd);
156}
157
158struct iomem_region *iomem_regions = NULL;
159int iomem_size = 0;
160
161static int __init parse_iomem(char *str, int *add)
162{
163 struct iomem_region *new;
164 struct uml_stat buf;
165 char *file, *driver;
166 int fd, err, size;
167
168 driver = str;
169 file = strchr(str,',');
170 if(file == NULL){
171 printf("parse_iomem : failed to parse iomem\n");
172 goto out;
173 }
174 *file = '\0';
175 file++;
176 fd = os_open_file(file, of_rdwr(OPENFLAGS()), 0);
177 if(fd < 0){
178 os_print_error(fd, "parse_iomem - Couldn't open io file");
179 goto out;
180 }
181
182 err = os_stat_fd(fd, &buf);
183 if(err < 0){
184 os_print_error(err, "parse_iomem - cannot stat_fd file");
185 goto out_close;
186 }
187
188 new = malloc(sizeof(*new));
189 if(new == NULL){
190 perror("Couldn't allocate iomem_region struct");
191 goto out_close;
192 }
193
194 size = (buf.ust_size + UM_KERN_PAGE_SIZE) & ~(UM_KERN_PAGE_SIZE - 1);
195
196 *new = ((struct iomem_region) { .next = iomem_regions,
197 .driver = driver,
198 .fd = fd,
199 .size = size,
200 .phys = 0,
201 .virt = 0 });
202 iomem_regions = new;
203 iomem_size += new->size + UM_KERN_PAGE_SIZE;
204
205 return(0);
206 out_close:
207 os_close_file(fd);
208 out:
209 return(1);
210}
211
212__uml_setup("iomem=", parse_iomem,
213"iomem=<name>,<file>\n"
214" Configure <file> as an IO memory region named <name>.\n\n"
215);
216
217int protect_memory(unsigned long addr, unsigned long len, int r, int w, int x,
218 int must_succeed)
219{
220 int err;
221
222 err = os_protect_memory((void *) addr, len, r, w, x);
223 if(err < 0){
224 if(must_succeed)
225 panic("protect failed, err = %d", -err);
226 else return(err);
227 }
228 return(0);
229}
230
231#if 0
232/* Debugging facility for dumping stuff out to the host, avoiding the timing
233 * problems that come with printf and breakpoints.
234 * Enable in case of emergency.
235 */
236
237int logging = 1;
238int logging_fd = -1;
239
240int logging_line = 0;
241char logging_buf[512];
242
243void log(char *fmt, ...)
244{
245 va_list ap;
246 struct timeval tv;
247 struct openflags flags;
248
249 if(logging == 0) return;
250 if(logging_fd < 0){
251 flags = of_create(of_trunc(of_rdwr(OPENFLAGS())));
252 logging_fd = os_open_file("log", flags, 0644);
253 }
254 gettimeofday(&tv, NULL);
255 sprintf(logging_buf, "%d\t %u.%u ", logging_line++, tv.tv_sec,
256 tv.tv_usec);
257 va_start(ap, fmt);
258 vsprintf(&logging_buf[strlen(logging_buf)], fmt, ap);
259 va_end(ap);
260 write(logging_fd, logging_buf, strlen(logging_buf));
261}
262#endif
263
264/*
265 * Overrides for Emacs so that we follow Linus's tabbing style.
266 * Emacs will notice this stuff at the end of the file and automatically
267 * adjust the settings for this buffer only. This must remain at the end
268 * of the file.
269 * ---------------------------------------------------------------------------
270 * Local variables:
271 * c-file-style: "linux"
272 * End:
273 */
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c
index c23d8a08d0ff..39cf568ccfaf 100644
--- a/arch/um/kernel/process_kern.c
+++ b/arch/um/kernel/process_kern.c
@@ -113,8 +113,23 @@ void set_current(void *t)
113 113
114void *_switch_to(void *prev, void *next, void *last) 114void *_switch_to(void *prev, void *next, void *last)
115{ 115{
116 return(CHOOSE_MODE(switch_to_tt(prev, next), 116 struct task_struct *from = prev;
117 switch_to_skas(prev, next))); 117 struct task_struct *to= next;
118
119 to->thread.prev_sched = from;
120 set_current(to);
121
122 do {
123 current->thread.saved_task = NULL ;
124 CHOOSE_MODE_PROC(switch_to_tt, switch_to_skas, prev, next);
125 if(current->thread.saved_task)
126 show_regs(&(current->thread.regs));
127 next= current->thread.saved_task;
128 prev= current;
129 } while(current->thread.saved_task);
130
131 return(current->thread.prev_sched);
132
118} 133}
119 134
120void interrupt_end(void) 135void interrupt_end(void)
diff --git a/arch/um/kernel/skas/include/mode_kern-skas.h b/arch/um/kernel/skas/include/mode_kern-skas.h
index e48490028111..c97a80dfe370 100644
--- a/arch/um/kernel/skas/include/mode_kern-skas.h
+++ b/arch/um/kernel/skas/include/mode_kern-skas.h
@@ -11,7 +11,7 @@
11#include "asm/ptrace.h" 11#include "asm/ptrace.h"
12 12
13extern void flush_thread_skas(void); 13extern void flush_thread_skas(void);
14extern void *switch_to_skas(void *prev, void *next); 14extern void switch_to_skas(void *prev, void *next);
15extern void start_thread_skas(struct pt_regs *regs, unsigned long eip, 15extern void start_thread_skas(struct pt_regs *regs, unsigned long eip,
16 unsigned long esp); 16 unsigned long esp);
17extern int copy_thread_skas(int nr, unsigned long clone_flags, 17extern int copy_thread_skas(int nr, unsigned long clone_flags,
diff --git a/arch/um/kernel/skas/include/uaccess-skas.h b/arch/um/kernel/skas/include/uaccess-skas.h
index 6ee3f3902e68..7da0c2def0ef 100644
--- a/arch/um/kernel/skas/include/uaccess-skas.h
+++ b/arch/um/kernel/skas/include/uaccess-skas.h
@@ -18,12 +18,6 @@
18 ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \ 18 ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \
19 ((unsigned long) (addr) + (size) >= (unsigned long)(addr)))) 19 ((unsigned long) (addr) + (size) >= (unsigned long)(addr))))
20 20
21static inline int verify_area_skas(int type, const void __user * addr,
22 unsigned long size)
23{
24 return(access_ok_skas(type, addr, size) ? 0 : -EFAULT);
25}
26
27extern int copy_from_user_skas(void *to, const void __user *from, int n); 21extern int copy_from_user_skas(void *to, const void __user *from, int n);
28extern int copy_to_user_skas(void __user *to, const void *from, int n); 22extern int copy_to_user_skas(void __user *to, const void *from, int n);
29extern int strncpy_from_user_skas(char *dst, const char __user *src, int count); 23extern int strncpy_from_user_skas(char *dst, const char __user *src, int count);
diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c
index 3d1b227226e6..efe92e8aa2a9 100644
--- a/arch/um/kernel/skas/process_kern.c
+++ b/arch/um/kernel/skas/process_kern.c
@@ -24,7 +24,7 @@
24#include "proc_mm.h" 24#include "proc_mm.h"
25#include "registers.h" 25#include "registers.h"
26 26
27void *switch_to_skas(void *prev, void *next) 27void switch_to_skas(void *prev, void *next)
28{ 28{
29 struct task_struct *from, *to; 29 struct task_struct *from, *to;
30 30
@@ -35,16 +35,11 @@ void *switch_to_skas(void *prev, void *next)
35 if(current->pid == 0) 35 if(current->pid == 0)
36 switch_timers(0); 36 switch_timers(0);
37 37
38 to->thread.prev_sched = from;
39 set_current(to);
40
41 switch_threads(&from->thread.mode.skas.switch_buf, 38 switch_threads(&from->thread.mode.skas.switch_buf,
42 to->thread.mode.skas.switch_buf); 39 to->thread.mode.skas.switch_buf);
43 40
44 if(current->pid == 0) 41 if(current->pid == 0)
45 switch_timers(1); 42 switch_timers(1);
46
47 return(current->thread.prev_sched);
48} 43}
49 44
50extern void schedule_tail(struct task_struct *prev); 45extern void schedule_tail(struct task_struct *prev);
diff --git a/arch/um/kernel/tempfile.c b/arch/um/kernel/tempfile.c
deleted file mode 100644
index b1674bc1395d..000000000000
--- a/arch/um/kernel/tempfile.c
+++ /dev/null
@@ -1,82 +0,0 @@
1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <stdio.h>
7#include <stdlib.h>
8#include <unistd.h>
9#include <string.h>
10#include <errno.h>
11#include <sys/param.h>
12#include "init.h"
13
14/* Modified from create_mem_file and start_debugger */
15static char *tempdir = NULL;
16
17static void __init find_tempdir(void)
18{
19 char *dirs[] = { "TMP", "TEMP", "TMPDIR", NULL };
20 int i;
21 char *dir = NULL;
22
23 if(tempdir != NULL) return; /* We've already been called */
24 for(i = 0; dirs[i]; i++){
25 dir = getenv(dirs[i]);
26 if((dir != NULL) && (*dir != '\0'))
27 break;
28 }
29 if((dir == NULL) || (*dir == '\0'))
30 dir = "/tmp";
31
32 tempdir = malloc(strlen(dir) + 2);
33 if(tempdir == NULL){
34 fprintf(stderr, "Failed to malloc tempdir, "
35 "errno = %d\n", errno);
36 return;
37 }
38 strcpy(tempdir, dir);
39 strcat(tempdir, "/");
40}
41
42int make_tempfile(const char *template, char **out_tempname, int do_unlink)
43{
44 char tempname[MAXPATHLEN];
45 int fd;
46
47 find_tempdir();
48 if (*template != '/')
49 strcpy(tempname, tempdir);
50 else
51 *tempname = 0;
52 strcat(tempname, template);
53 fd = mkstemp(tempname);
54 if(fd < 0){
55 fprintf(stderr, "open - cannot create %s: %s\n", tempname,
56 strerror(errno));
57 return -1;
58 }
59 if(do_unlink && (unlink(tempname) < 0)){
60 perror("unlink");
61 return -1;
62 }
63 if(out_tempname){
64 *out_tempname = strdup(tempname);
65 if(*out_tempname == NULL){
66 perror("strdup");
67 return -1;
68 }
69 }
70 return(fd);
71}
72
73/*
74 * Overrides for Emacs so that we follow Linus's tabbing style.
75 * Emacs will notice this stuff at the end of the file and automatically
76 * adjust the settings for this buffer only. This must remain at the end
77 * of the file.
78 * ---------------------------------------------------------------------------
79 * Local variables:
80 * c-file-style: "linux"
81 * End:
82 */
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index 80ed6188e8a2..0a562c3c0fd8 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -307,7 +307,7 @@ int flush_tlb_kernel_range_common(unsigned long start, unsigned long end)
307 } 307 }
308 else if(pte_newprot(*pte)){ 308 else if(pte_newprot(*pte)){
309 updated = 1; 309 updated = 1;
310 protect_memory(addr, PAGE_SIZE, 1, 1, 1, 1); 310 os_protect_memory((void *) addr, PAGE_SIZE, 1, 1, 1);
311 } 311 }
312 addr += PAGE_SIZE; 312 addr += PAGE_SIZE;
313 } 313 }
diff --git a/arch/um/kernel/tt/include/mode_kern-tt.h b/arch/um/kernel/tt/include/mode_kern-tt.h
index e0ca0e0b2516..2a35b15c5fef 100644
--- a/arch/um/kernel/tt/include/mode_kern-tt.h
+++ b/arch/um/kernel/tt/include/mode_kern-tt.h
@@ -11,7 +11,7 @@
11#include "asm/ptrace.h" 11#include "asm/ptrace.h"
12#include "asm/uaccess.h" 12#include "asm/uaccess.h"
13 13
14extern void *switch_to_tt(void *prev, void *next); 14extern void switch_to_tt(void *prev, void *next);
15extern void flush_thread_tt(void); 15extern void flush_thread_tt(void);
16extern void start_thread_tt(struct pt_regs *regs, unsigned long eip, 16extern void start_thread_tt(struct pt_regs *regs, unsigned long eip,
17 unsigned long esp); 17 unsigned long esp);
diff --git a/arch/um/kernel/tt/include/uaccess-tt.h b/arch/um/kernel/tt/include/uaccess-tt.h
index aa6db384af80..dc2ebfa8c54f 100644
--- a/arch/um/kernel/tt/include/uaccess-tt.h
+++ b/arch/um/kernel/tt/include/uaccess-tt.h
@@ -33,12 +33,6 @@ extern unsigned long uml_physmem;
33 (((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) && \ 33 (((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) && \
34 (under_task_size(addr, size) || is_stack(addr, size)))) 34 (under_task_size(addr, size) || is_stack(addr, size))))
35 35
36static inline int verify_area_tt(int type, const void __user * addr,
37 unsigned long size)
38{
39 return(access_ok_tt(type, addr, size) ? 0 : -EFAULT);
40}
41
42extern unsigned long get_fault_addr(void); 36extern unsigned long get_fault_addr(void);
43 37
44extern int __do_copy_from_user(void *to, const void *from, int n, 38extern int __do_copy_from_user(void *to, const void *from, int n,
diff --git a/arch/um/kernel/tt/mem_user.c b/arch/um/kernel/tt/mem_user.c
index 3085267459b1..03e589895388 100644
--- a/arch/um/kernel/tt/mem_user.c
+++ b/arch/um/kernel/tt/mem_user.c
@@ -12,6 +12,7 @@
12#include "tt.h" 12#include "tt.h"
13#include "mem_user.h" 13#include "mem_user.h"
14#include "user_util.h" 14#include "user_util.h"
15#include "os.h"
15 16
16void remap_data(void *segment_start, void *segment_end, int w) 17void remap_data(void *segment_start, void *segment_end, int w)
17{ 18{
diff --git a/arch/um/kernel/tt/process_kern.c b/arch/um/kernel/tt/process_kern.c
index a189a2b92935..cfaa373a6e77 100644
--- a/arch/um/kernel/tt/process_kern.c
+++ b/arch/um/kernel/tt/process_kern.c
@@ -23,10 +23,11 @@
23#include "mem_user.h" 23#include "mem_user.h"
24#include "tlb.h" 24#include "tlb.h"
25#include "mode.h" 25#include "mode.h"
26#include "mode_kern.h"
26#include "init.h" 27#include "init.h"
27#include "tt.h" 28#include "tt.h"
28 29
29void *switch_to_tt(void *prev, void *next, void *last) 30void switch_to_tt(void *prev, void *next)
30{ 31{
31 struct task_struct *from, *to, *prev_sched; 32 struct task_struct *from, *to, *prev_sched;
32 unsigned long flags; 33 unsigned long flags;
@@ -36,8 +37,6 @@ void *switch_to_tt(void *prev, void *next, void *last)
36 from = prev; 37 from = prev;
37 to = next; 38 to = next;
38 39
39 to->thread.prev_sched = from;
40
41 cpu = from->thread_info->cpu; 40 cpu = from->thread_info->cpu;
42 if(cpu == 0) 41 if(cpu == 0)
43 forward_interrupts(to->thread.mode.tt.extern_pid); 42 forward_interrupts(to->thread.mode.tt.extern_pid);
@@ -53,7 +52,6 @@ void *switch_to_tt(void *prev, void *next, void *last)
53 forward_pending_sigio(to->thread.mode.tt.extern_pid); 52 forward_pending_sigio(to->thread.mode.tt.extern_pid);
54 53
55 c = 0; 54 c = 0;
56 set_current(to);
57 55
58 err = os_write_file(to->thread.mode.tt.switch_pipe[1], &c, sizeof(c)); 56 err = os_write_file(to->thread.mode.tt.switch_pipe[1], &c, sizeof(c));
59 if(err != sizeof(c)) 57 if(err != sizeof(c))
@@ -85,8 +83,6 @@ void *switch_to_tt(void *prev, void *next, void *last)
85 83
86 flush_tlb_all(); 84 flush_tlb_all();
87 local_irq_restore(flags); 85 local_irq_restore(flags);
88
89 return(current->thread.prev_sched);
90} 86}
91 87
92void release_thread_tt(struct task_struct *task) 88void release_thread_tt(struct task_struct *task)
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 09f6f7ce4695..f0a275947d34 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -361,11 +361,6 @@ int linux_main(int argc, char **argv)
361 uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas, 0, 361 uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas, 0,
362 &host_task_size, &task_size); 362 &host_task_size, &task_size);
363 363
364 /* Need to check this early because mmapping happens before the
365 * kernel is running.
366 */
367 check_tmpexec();
368
369 brk_start = (unsigned long) sbrk(0); 364 brk_start = (unsigned long) sbrk(0);
370 CHOOSE_MODE_PROC(before_mem_tt, before_mem_skas, brk_start); 365 CHOOSE_MODE_PROC(before_mem_tt, before_mem_skas, brk_start);
371 /* Increase physical memory size for exec-shield users 366 /* Increase physical memory size for exec-shield users
diff --git a/arch/um/kernel/user_util.c b/arch/um/kernel/user_util.c
index 954ff67cc8b3..41d17c71511c 100644
--- a/arch/um/kernel/user_util.c
+++ b/arch/um/kernel/user_util.c
@@ -109,18 +109,14 @@ int raw(int fd)
109 int err; 109 int err;
110 110
111 CATCH_EINTR(err = tcgetattr(fd, &tt)); 111 CATCH_EINTR(err = tcgetattr(fd, &tt));
112 if (err < 0) { 112 if(err < 0)
113 printk("tcgetattr failed, errno = %d\n", errno); 113 return -errno;
114 return(-errno);
115 }
116 114
117 cfmakeraw(&tt); 115 cfmakeraw(&tt);
118 116
119 CATCH_EINTR(err = tcsetattr(fd, TCSADRAIN, &tt)); 117 CATCH_EINTR(err = tcsetattr(fd, TCSADRAIN, &tt));
120 if (err < 0) { 118 if(err < 0)
121 printk("tcsetattr failed, errno = %d\n", errno); 119 return -errno;
122 return(-errno);
123 }
124 120
125 /* XXX tcsetattr could have applied only some changes 121 /* XXX tcsetattr could have applied only some changes
126 * (and cfmakeraw() is a set of changes) */ 122 * (and cfmakeraw() is a set of changes) */
@@ -132,6 +128,12 @@ void setup_machinename(char *machine_out)
132 struct utsname host; 128 struct utsname host;
133 129
134 uname(&host); 130 uname(&host);
131#if defined(UML_CONFIG_UML_X86) && !defined(UML_CONFIG_64BIT)
132 if (!strcmp(host.machine, "x86_64")) {
133 strcpy(machine_out, "i686");
134 return;
135 }
136#endif
135 strcpy(machine_out, host.machine); 137 strcpy(machine_out, host.machine);
136} 138}
137 139
diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile
index 7a1662419c0c..d15ec2af6a22 100644
--- a/arch/um/os-Linux/Makefile
+++ b/arch/um/os-Linux/Makefile
@@ -3,11 +3,11 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6obj-y = aio.o elf_aux.o file.o process.o signal.o start_up.o time.o tt.o \ 6obj-y = aio.o elf_aux.o file.o mem.o process.o signal.o start_up.o time.o \
7 tty.o user_syms.o drivers/ sys-$(SUBARCH)/ 7 tt.o tty.o user_syms.o drivers/ sys-$(SUBARCH)/
8 8
9USER_OBJS := aio.o elf_aux.o file.o process.o signal.o start_up.o time.o tt.o \ 9USER_OBJS := aio.o elf_aux.o file.o mem.o process.o signal.o start_up.o \
10 tty.o 10 time.o tt.o tty.o
11 11
12elf_aux.o: $(ARCH_DIR)/kernel-offsets.h 12elf_aux.o: $(ARCH_DIR)/kernel-offsets.h
13CFLAGS_elf_aux.o += -I$(objtree)/arch/um 13CFLAGS_elf_aux.o += -I$(objtree)/arch/um
diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c
index b04897cd995d..f6e64026f995 100644
--- a/arch/um/os-Linux/aio.c
+++ b/arch/um/os-Linux/aio.c
@@ -117,6 +117,8 @@ static int do_aio(aio_context_t ctx, struct aio_context *aio)
117 err = io_submit(ctx, 1, &iocbp); 117 err = io_submit(ctx, 1, &iocbp);
118 if(err > 0) 118 if(err > 0)
119 err = 0; 119 err = 0;
120 else
121 err = -errno;
120 122
121 out: 123 out:
122 return err; 124 return err;
@@ -142,7 +144,8 @@ static int aio_thread(void *arg)
142 "errno = %d\n", errno); 144 "errno = %d\n", errno);
143 } 145 }
144 else { 146 else {
145 aio = (struct aio_context *) event.data; 147 /* This is safe as we've just a pointer here. */
148 aio = (struct aio_context *) (long) event.data;
146 if(update_aio(aio, event.res)){ 149 if(update_aio(aio, event.res)){
147 do_aio(ctx, aio); 150 do_aio(ctx, aio);
148 continue; 151 continue;
@@ -313,15 +316,16 @@ static int init_aio_26(void)
313 int err; 316 int err;
314 317
315 if(io_setup(256, &ctx)){ 318 if(io_setup(256, &ctx)){
319 err = -errno;
316 printk("aio_thread failed to initialize context, err = %d\n", 320 printk("aio_thread failed to initialize context, err = %d\n",
317 errno); 321 errno);
318 return -errno; 322 return err;
319 } 323 }
320 324
321 err = run_helper_thread(aio_thread, NULL, 325 err = run_helper_thread(aio_thread, NULL,
322 CLONE_FILES | CLONE_VM | SIGCHLD, &stack, 0); 326 CLONE_FILES | CLONE_VM | SIGCHLD, &stack, 0);
323 if(err < 0) 327 if(err < 0)
324 return -errno; 328 return err;
325 329
326 aio_pid = err; 330 aio_pid = err;
327 331
diff --git a/arch/um/os-Linux/drivers/tuntap_user.c b/arch/um/os-Linux/drivers/tuntap_user.c
index 4b83c6c3f48d..4ba9b17adf13 100644
--- a/arch/um/os-Linux/drivers/tuntap_user.c
+++ b/arch/um/os-Linux/drivers/tuntap_user.c
@@ -75,7 +75,7 @@ static int tuntap_open_tramp(char *gate, int *fd_out, int me, int remote,
75 struct msghdr msg; 75 struct msghdr msg;
76 struct cmsghdr *cmsg; 76 struct cmsghdr *cmsg;
77 struct iovec iov; 77 struct iovec iov;
78 int pid, n; 78 int pid, n, err;
79 79
80 sprintf(version_buf, "%d", UML_NET_VERSION); 80 sprintf(version_buf, "%d", UML_NET_VERSION);
81 81
@@ -105,9 +105,10 @@ static int tuntap_open_tramp(char *gate, int *fd_out, int me, int remote,
105 n = recvmsg(me, &msg, 0); 105 n = recvmsg(me, &msg, 0);
106 *used_out = n; 106 *used_out = n;
107 if(n < 0){ 107 if(n < 0){
108 err = -errno;
108 printk("tuntap_open_tramp : recvmsg failed - errno = %d\n", 109 printk("tuntap_open_tramp : recvmsg failed - errno = %d\n",
109 errno); 110 errno);
110 return(-errno); 111 return err;
111 } 112 }
112 CATCH_EINTR(waitpid(pid, NULL, 0)); 113 CATCH_EINTR(waitpid(pid, NULL, 0));
113 114
@@ -147,9 +148,10 @@ static int tuntap_open(void *data)
147 ifr.ifr_flags = IFF_TAP | IFF_NO_PI; 148 ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
148 strlcpy(ifr.ifr_name, pri->dev_name, sizeof(ifr.ifr_name)); 149 strlcpy(ifr.ifr_name, pri->dev_name, sizeof(ifr.ifr_name));
149 if(ioctl(pri->fd, TUNSETIFF, (void *) &ifr) < 0){ 150 if(ioctl(pri->fd, TUNSETIFF, (void *) &ifr) < 0){
151 err = -errno;
150 printk("TUNSETIFF failed, errno = %d\n", errno); 152 printk("TUNSETIFF failed, errno = %d\n", errno);
151 os_close_file(pri->fd); 153 os_close_file(pri->fd);
152 return(-errno); 154 return err;
153 } 155 }
154 } 156 }
155 else { 157 else {
diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c
index 1399520a8588..ab33cb3c74ec 100644
--- a/arch/um/os-Linux/elf_aux.c
+++ b/arch/um/os-Linux/elf_aux.c
@@ -14,7 +14,8 @@
14#include "mem_user.h" 14#include "mem_user.h"
15#include <kernel-offsets.h> 15#include <kernel-offsets.h>
16 16
17#if HOST_ELF_CLASS == ELFCLASS32 17/* Use the one from the kernel - the host may miss it, if having old headers. */
18#if UM_ELF_CLASS == UM_ELFCLASS32
18typedef Elf32_auxv_t elf_auxv_t; 19typedef Elf32_auxv_t elf_auxv_t;
19#else 20#else
20typedef Elf64_auxv_t elf_auxv_t; 21typedef Elf64_auxv_t elf_auxv_t;
@@ -54,7 +55,8 @@ __init void scan_elf_aux( char **envp)
54 * a_un, so we have to use a_val, which is 55 * a_un, so we have to use a_val, which is
55 * all that's left. 56 * all that's left.
56 */ 57 */
57 elf_aux_platform = (char *) auxv->a_un.a_val; 58 elf_aux_platform =
59 (char *) (long) auxv->a_un.a_val;
58 break; 60 break;
59 case AT_PAGESZ: 61 case AT_PAGESZ:
60 page_size = auxv->a_un.a_val; 62 page_size = auxv->a_un.a_val;
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index fd45bb260907..f55773c819e6 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -119,15 +119,11 @@ int os_window_size(int fd, int *rows, int *cols)
119 119
120int os_new_tty_pgrp(int fd, int pid) 120int os_new_tty_pgrp(int fd, int pid)
121{ 121{
122 if(ioctl(fd, TIOCSCTTY, 0) < 0){ 122 if(ioctl(fd, TIOCSCTTY, 0) < 0)
123 printk("TIOCSCTTY failed, errno = %d\n", errno); 123 return -errno;
124 return(-errno);
125 }
126 124
127 if(tcsetpgrp(fd, pid) < 0){ 125 if(tcsetpgrp(fd, pid) < 0)
128 printk("tcsetpgrp failed, errno = %d\n", errno); 126 return -errno;
129 return(-errno);
130 }
131 127
132 return(0); 128 return(0);
133} 129}
@@ -146,18 +142,12 @@ int os_set_slip(int fd)
146 int disc, sencap; 142 int disc, sencap;
147 143
148 disc = N_SLIP; 144 disc = N_SLIP;
149 if(ioctl(fd, TIOCSETD, &disc) < 0){ 145 if(ioctl(fd, TIOCSETD, &disc) < 0)
150 printk("Failed to set slip line discipline - " 146 return -errno;
151 "errno = %d\n", errno);
152 return(-errno);
153 }
154 147
155 sencap = 0; 148 sencap = 0;
156 if(ioctl(fd, SIOCSIFENCAP, &sencap) < 0){ 149 if(ioctl(fd, SIOCSIFENCAP, &sencap) < 0)
157 printk("Failed to set slip encapsulation - " 150 return -errno;
158 "errno = %d\n", errno);
159 return(-errno);
160 }
161 151
162 return(0); 152 return(0);
163} 153}
@@ -180,22 +170,15 @@ int os_sigio_async(int master, int slave)
180 int flags; 170 int flags;
181 171
182 flags = fcntl(master, F_GETFL); 172 flags = fcntl(master, F_GETFL);
183 if(flags < 0) { 173 if(flags < 0)
184 printk("fcntl F_GETFL failed, errno = %d\n", errno); 174 return errno;
185 return(-errno);
186 }
187 175
188 if((fcntl(master, F_SETFL, flags | O_NONBLOCK | O_ASYNC) < 0) || 176 if((fcntl(master, F_SETFL, flags | O_NONBLOCK | O_ASYNC) < 0) ||
189 (fcntl(master, F_SETOWN, os_getpid()) < 0)){ 177 (fcntl(master, F_SETOWN, os_getpid()) < 0))
190 printk("fcntl F_SETFL or F_SETOWN failed, errno = %d\n", 178 return -errno;
191 errno);
192 return(-errno);
193 }
194 179
195 if((fcntl(slave, F_SETFL, flags | O_NONBLOCK) < 0)){ 180 if((fcntl(slave, F_SETFL, flags | O_NONBLOCK) < 0))
196 printk("fcntl F_SETFL failed, errno = %d\n", errno); 181 return -errno;
197 return(-errno);
198 }
199 182
200 return(0); 183 return(0);
201} 184}
@@ -255,7 +238,7 @@ int os_file_mode(char *file, struct openflags *mode_out)
255 238
256int os_open_file(char *file, struct openflags flags, int mode) 239int os_open_file(char *file, struct openflags flags, int mode)
257{ 240{
258 int fd, f = 0; 241 int fd, err, f = 0;
259 242
260 if(flags.r && flags.w) f = O_RDWR; 243 if(flags.r && flags.w) f = O_RDWR;
261 else if(flags.r) f = O_RDONLY; 244 else if(flags.r) f = O_RDONLY;
@@ -272,8 +255,9 @@ int os_open_file(char *file, struct openflags flags, int mode)
272 return(-errno); 255 return(-errno);
273 256
274 if(flags.cl && fcntl(fd, F_SETFD, 1)){ 257 if(flags.cl && fcntl(fd, F_SETFD, 1)){
258 err = -errno;
275 os_close_file(fd); 259 os_close_file(fd);
276 return(-errno); 260 return err;
277 } 261 }
278 262
279 return(fd); 263 return(fd);
@@ -383,9 +367,9 @@ int os_file_size(char *file, unsigned long long *size_out)
383 return(fd); 367 return(fd);
384 } 368 }
385 if(ioctl(fd, BLKGETSIZE, &blocks) < 0){ 369 if(ioctl(fd, BLKGETSIZE, &blocks) < 0){
370 err = -errno;
386 printk("Couldn't get the block size of \"%s\", " 371 printk("Couldn't get the block size of \"%s\", "
387 "errno = %d\n", file, errno); 372 "errno = %d\n", file, errno);
388 err = -errno;
389 os_close_file(fd); 373 os_close_file(fd);
390 return(err); 374 return(err);
391 } 375 }
@@ -473,11 +457,14 @@ int os_pipe(int *fds, int stream, int close_on_exec)
473 457
474int os_set_fd_async(int fd, int owner) 458int os_set_fd_async(int fd, int owner)
475{ 459{
460 int err;
461
476 /* XXX This should do F_GETFL first */ 462 /* XXX This should do F_GETFL first */
477 if(fcntl(fd, F_SETFL, O_ASYNC | O_NONBLOCK) < 0){ 463 if(fcntl(fd, F_SETFL, O_ASYNC | O_NONBLOCK) < 0){
464 err = -errno;
478 printk("os_set_fd_async : failed to set O_ASYNC and " 465 printk("os_set_fd_async : failed to set O_ASYNC and "
479 "O_NONBLOCK on fd # %d, errno = %d\n", fd, errno); 466 "O_NONBLOCK on fd # %d, errno = %d\n", fd, errno);
480 return(-errno); 467 return err;
481 } 468 }
482#ifdef notdef 469#ifdef notdef
483 if(fcntl(fd, F_SETFD, 1) < 0){ 470 if(fcntl(fd, F_SETFD, 1) < 0){
@@ -488,10 +475,11 @@ int os_set_fd_async(int fd, int owner)
488 475
489 if((fcntl(fd, F_SETSIG, SIGIO) < 0) || 476 if((fcntl(fd, F_SETSIG, SIGIO) < 0) ||
490 (fcntl(fd, F_SETOWN, owner) < 0)){ 477 (fcntl(fd, F_SETOWN, owner) < 0)){
478 err = -errno;
491 printk("os_set_fd_async : Failed to fcntl F_SETOWN " 479 printk("os_set_fd_async : Failed to fcntl F_SETOWN "
492 "(or F_SETSIG) fd %d to pid %d, errno = %d\n", fd, 480 "(or F_SETSIG) fd %d to pid %d, errno = %d\n", fd,
493 owner, errno); 481 owner, errno);
494 return(-errno); 482 return err;
495 } 483 }
496 484
497 return(0); 485 return(0);
@@ -516,11 +504,9 @@ int os_set_fd_block(int fd, int blocking)
516 if(blocking) flags &= ~O_NONBLOCK; 504 if(blocking) flags &= ~O_NONBLOCK;
517 else flags |= O_NONBLOCK; 505 else flags |= O_NONBLOCK;
518 506
519 if(fcntl(fd, F_SETFL, flags) < 0){ 507 if(fcntl(fd, F_SETFL, flags) < 0)
520 printk("Failed to change blocking on fd # %d, errno = %d\n", 508 return -errno;
521 fd, errno); 509
522 return(-errno);
523 }
524 return(0); 510 return(0);
525} 511}
526 512
@@ -609,11 +595,8 @@ int os_create_unix_socket(char *file, int len, int close_on_exec)
609 int sock, err; 595 int sock, err;
610 596
611 sock = socket(PF_UNIX, SOCK_DGRAM, 0); 597 sock = socket(PF_UNIX, SOCK_DGRAM, 0);
612 if (sock < 0){ 598 if(sock < 0)
613 printk("create_unix_socket - socket failed, errno = %d\n", 599 return -errno;
614 errno);
615 return(-errno);
616 }
617 600
618 if(close_on_exec) { 601 if(close_on_exec) {
619 err = os_set_exec_close(sock, 1); 602 err = os_set_exec_close(sock, 1);
@@ -628,11 +611,8 @@ int os_create_unix_socket(char *file, int len, int close_on_exec)
628 snprintf(addr.sun_path, len, "%s", file); 611 snprintf(addr.sun_path, len, "%s", file);
629 612
630 err = bind(sock, (struct sockaddr *) &addr, sizeof(addr)); 613 err = bind(sock, (struct sockaddr *) &addr, sizeof(addr));
631 if (err < 0){ 614 if(err < 0)
632 printk("create_listening_socket at '%s' - bind failed, " 615 return -errno;
633 "errno = %d\n", file, errno);
634 return(-errno);
635 }
636 616
637 return(sock); 617 return(sock);
638} 618}
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
new file mode 100644
index 000000000000..8e71edaaf80b
--- /dev/null
+++ b/arch/um/os-Linux/mem.c
@@ -0,0 +1,161 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include <stddef.h>
4#include <stdarg.h>
5#include <unistd.h>
6#include <errno.h>
7#include <string.h>
8#include <fcntl.h>
9#include <sys/types.h>
10#include <sys/mman.h>
11#include "kern_util.h"
12#include "user.h"
13#include "user_util.h"
14#include "mem_user.h"
15#include "init.h"
16#include "os.h"
17#include "tempfile.h"
18#include "kern_constants.h"
19
20#include <sys/param.h>
21
22static char *tempdir = NULL;
23
24static void __init find_tempdir(void)
25{
26 char *dirs[] = { "TMP", "TEMP", "TMPDIR", NULL };
27 int i;
28 char *dir = NULL;
29
30 if(tempdir != NULL) return; /* We've already been called */
31 for(i = 0; dirs[i]; i++){
32 dir = getenv(dirs[i]);
33 if((dir != NULL) && (*dir != '\0'))
34 break;
35 }
36 if((dir == NULL) || (*dir == '\0'))
37 dir = "/tmp";
38
39 tempdir = malloc(strlen(dir) + 2);
40 if(tempdir == NULL){
41 fprintf(stderr, "Failed to malloc tempdir, "
42 "errno = %d\n", errno);
43 return;
44 }
45 strcpy(tempdir, dir);
46 strcat(tempdir, "/");
47}
48
49/*
50 * This proc still used in tt-mode
51 * (file: kernel/tt/ptproxy/proxy.c, proc: start_debugger).
52 * So it isn't 'static' yet.
53 */
54int make_tempfile(const char *template, char **out_tempname, int do_unlink)
55{
56 char tempname[MAXPATHLEN];
57 int fd;
58
59 find_tempdir();
60 if (*template != '/')
61 strcpy(tempname, tempdir);
62 else
63 *tempname = 0;
64 strcat(tempname, template);
65 fd = mkstemp(tempname);
66 if(fd < 0){
67 fprintf(stderr, "open - cannot create %s: %s\n", tempname,
68 strerror(errno));
69 return -1;
70 }
71 if(do_unlink && (unlink(tempname) < 0)){
72 perror("unlink");
73 return -1;
74 }
75 if(out_tempname){
76 *out_tempname = strdup(tempname);
77 if(*out_tempname == NULL){
78 perror("strdup");
79 return -1;
80 }
81 }
82 return(fd);
83}
84
85#define TEMPNAME_TEMPLATE "vm_file-XXXXXX"
86
87/*
88 * This proc is used in start_up.c
89 * So it isn't 'static'.
90 */
91int create_tmp_file(unsigned long len)
92{
93 int fd, err;
94 char zero;
95
96 fd = make_tempfile(TEMPNAME_TEMPLATE, NULL, 1);
97 if(fd < 0) {
98 exit(1);
99 }
100
101 err = fchmod(fd, 0777);
102 if(err < 0){
103 perror("os_mode_fd");
104 exit(1);
105 }
106
107 if (lseek64(fd, len, SEEK_SET) < 0) {
108 perror("os_seek_file");
109 exit(1);
110 }
111
112 zero = 0;
113
114 err = os_write_file(fd, &zero, 1);
115 if(err != 1){
116 errno = -err;
117 perror("os_write_file");
118 exit(1);
119 }
120
121 return(fd);
122}
123
124static int create_anon_file(unsigned long len)
125{
126 void *addr;
127 int fd;
128
129 fd = open("/dev/anon", O_RDWR);
130 if(fd < 0) {
131 perror("opening /dev/anon");
132 exit(1);
133 }
134
135 addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
136 if(addr == MAP_FAILED){
137 perror("mapping physmem file");
138 exit(1);
139 }
140 munmap(addr, len);
141
142 return(fd);
143}
144
145extern int have_devanon;
146
147int create_mem_file(unsigned long len)
148{
149 int err, fd;
150
151 if(have_devanon)
152 fd = create_anon_file(len);
153 else fd = create_tmp_file(len);
154
155 err = os_set_exec_close(fd, 1);
156 if(err < 0){
157 errno = -err;
158 perror("exec_close");
159 }
160 return(fd);
161}
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index d32413e4b4ce..d9c52387c4a1 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -3,6 +3,7 @@
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include <unistd.h>
6#include <stdio.h> 7#include <stdio.h>
7#include <errno.h> 8#include <errno.h>
8#include <signal.h> 9#include <signal.h>
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index 040cc1472bc7..6af83171ca4e 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -4,18 +4,22 @@
4 */ 4 */
5 5
6#include <stdio.h> 6#include <stdio.h>
7#include <stddef.h>
8#include <stdarg.h>
9#include <stdlib.h>
10#include <string.h>
7#include <unistd.h> 11#include <unistd.h>
8#include <signal.h> 12#include <signal.h>
9#include <sched.h> 13#include <sched.h>
14#include <fcntl.h>
10#include <errno.h> 15#include <errno.h>
11#include <stdarg.h>
12#include <stdlib.h>
13#include <setjmp.h> 16#include <setjmp.h>
14#include <sys/time.h> 17#include <sys/time.h>
15#include <sys/wait.h> 18#include <sys/wait.h>
16#include <sys/mman.h> 19#include <sys/mman.h>
17#include <asm/unistd.h> 20#include <asm/unistd.h>
18#include <asm/page.h> 21#include <asm/page.h>
22#include <sys/types.h>
19#include "user_util.h" 23#include "user_util.h"
20#include "kern_util.h" 24#include "kern_util.h"
21#include "user.h" 25#include "user.h"
@@ -25,6 +29,7 @@
25#include "sysdep/sigcontext.h" 29#include "sysdep/sigcontext.h"
26#include "irq_user.h" 30#include "irq_user.h"
27#include "ptrace_user.h" 31#include "ptrace_user.h"
32#include "mem_user.h"
28#include "time_user.h" 33#include "time_user.h"
29#include "init.h" 34#include "init.h"
30#include "os.h" 35#include "os.h"
@@ -32,6 +37,8 @@
32#include "choose-mode.h" 37#include "choose-mode.h"
33#include "mode.h" 38#include "mode.h"
34#include "tempfile.h" 39#include "tempfile.h"
40#include "kern_constants.h"
41
35#ifdef UML_CONFIG_MODE_SKAS 42#ifdef UML_CONFIG_MODE_SKAS
36#include "skas.h" 43#include "skas.h"
37#include "skas_ptrace.h" 44#include "skas_ptrace.h"
@@ -276,9 +283,38 @@ static void __init check_ptrace(void)
276 check_sysemu(); 283 check_sysemu();
277} 284}
278 285
286extern int create_tmp_file(unsigned long len);
287
288static void check_tmpexec(void)
289{
290 void *addr;
291 int err, fd = create_tmp_file(UM_KERN_PAGE_SIZE);
292
293 addr = mmap(NULL, UM_KERN_PAGE_SIZE,
294 PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0);
295 printf("Checking PROT_EXEC mmap in /tmp...");
296 fflush(stdout);
297 if(addr == MAP_FAILED){
298 err = errno;
299 perror("failed");
300 if(err == EPERM)
301 printf("/tmp must be not mounted noexec\n");
302 exit(1);
303 }
304 printf("OK\n");
305 munmap(addr, UM_KERN_PAGE_SIZE);
306
307 close(fd);
308}
309
279void os_early_checks(void) 310void os_early_checks(void)
280{ 311{
281 check_ptrace(); 312 check_ptrace();
313
314 /* Need to check this early because mmapping happens before the
315 * kernel is running.
316 */
317 check_tmpexec();
282} 318}
283 319
284static int __init noprocmm_cmd_param(char *str, int* add) 320static int __init noprocmm_cmd_param(char *str, int* add)
@@ -357,3 +393,72 @@ int can_do_skas(void)
357 return(0); 393 return(0);
358} 394}
359#endif 395#endif
396
397int have_devanon = 0;
398
399void check_devanon(void)
400{
401 int fd;
402
403 printk("Checking for /dev/anon on the host...");
404 fd = open("/dev/anon", O_RDWR);
405 if(fd < 0){
406 printk("Not available (open failed with errno %d)\n", errno);
407 return;
408 }
409
410 printk("OK\n");
411 have_devanon = 1;
412}
413
414int __init parse_iomem(char *str, int *add)
415{
416 struct iomem_region *new;
417 struct uml_stat buf;
418 char *file, *driver;
419 int fd, err, size;
420
421 driver = str;
422 file = strchr(str,',');
423 if(file == NULL){
424 printf("parse_iomem : failed to parse iomem\n");
425 goto out;
426 }
427 *file = '\0';
428 file++;
429 fd = os_open_file(file, of_rdwr(OPENFLAGS()), 0);
430 if(fd < 0){
431 os_print_error(fd, "parse_iomem - Couldn't open io file");
432 goto out;
433 }
434
435 err = os_stat_fd(fd, &buf);
436 if(err < 0){
437 os_print_error(err, "parse_iomem - cannot stat_fd file");
438 goto out_close;
439 }
440
441 new = malloc(sizeof(*new));
442 if(new == NULL){
443 perror("Couldn't allocate iomem_region struct");
444 goto out_close;
445 }
446
447 size = (buf.ust_size + UM_KERN_PAGE_SIZE) & ~(UM_KERN_PAGE_SIZE - 1);
448
449 *new = ((struct iomem_region) { .next = iomem_regions,
450 .driver = driver,
451 .fd = fd,
452 .size = size,
453 .phys = 0,
454 .virt = 0 });
455 iomem_regions = new;
456 iomem_size += new->size + UM_KERN_PAGE_SIZE;
457
458 return(0);
459 out_close:
460 os_close_file(fd);
461 out:
462 return(1);
463}
464
diff --git a/arch/um/os-Linux/tt.c b/arch/um/os-Linux/tt.c
index 5b047ab8416a..a6db8877931a 100644
--- a/arch/um/os-Linux/tt.c
+++ b/arch/um/os-Linux/tt.c
@@ -36,6 +36,20 @@
36#include "mode.h" 36#include "mode.h"
37#include "tempfile.h" 37#include "tempfile.h"
38 38
39int protect_memory(unsigned long addr, unsigned long len, int r, int w, int x,
40 int must_succeed)
41{
42 int err;
43
44 err = os_protect_memory((void *) addr, len, r, w, x);
45 if(err < 0){
46 if(must_succeed)
47 panic("protect failed, err = %d", -err);
48 else return(err);
49 }
50 return(0);
51}
52
39/* 53/*
40 *------------------------- 54 *-------------------------
41 * only for tt mode (will be deleted in future...) 55 * only for tt mode (will be deleted in future...)
diff --git a/arch/um/sys-i386/ldt.c b/arch/um/sys-i386/ldt.c
index bd3c34aa52e5..36b5c2c13289 100644
--- a/arch/um/sys-i386/ldt.c
+++ b/arch/um/sys-i386/ldt.c
@@ -83,6 +83,7 @@ int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount)
83 goto out; 83 goto out;
84 } 84 }
85 p = buf; 85 p = buf;
86 break;
86 default: 87 default:
87 res = -ENOSYS; 88 res = -ENOSYS;
88 goto out; 89 goto out;
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index e63323e03ea9..21afa69a086d 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -277,11 +277,6 @@ source "mm/Kconfig"
277config HAVE_ARCH_EARLY_PFN_TO_NID 277config HAVE_ARCH_EARLY_PFN_TO_NID
278 def_bool y 278 def_bool y
279 279
280config HAVE_DEC_LOCK
281 bool
282 depends on SMP
283 default y
284
285config NR_CPUS 280config NR_CPUS
286 int "Maximum number of CPUs (2-256)" 281 int "Maximum number of CPUs (2-256)"
287 range 2 256 282 range 2 256
@@ -313,7 +308,7 @@ config HPET_TIMER
313 present. The HPET provides a stable time base on SMP 308 present. The HPET provides a stable time base on SMP
314 systems, unlike the TSC, but it is more expensive to access, 309 systems, unlike the TSC, but it is more expensive to access,
315 as it is off-chip. You can find the HPET spec at 310 as it is off-chip. You can find the HPET spec at
316 <http://www.intel.com/labs/platcomp/hpet/hpetspec.htm>. 311 <http://www.intel.com/hardwaredesign/hpetspec.htm>.
317 312
318config X86_PM_TIMER 313config X86_PM_TIMER
319 bool "PM timer" 314 bool "PM timer"
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c
index c8131f342cfc..d9161e395978 100644
--- a/arch/x86_64/ia32/ia32_binfmt.c
+++ b/arch/x86_64/ia32/ia32_binfmt.c
@@ -353,11 +353,6 @@ int setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, int exec
353 mpnt = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); 353 mpnt = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
354 if (!mpnt) 354 if (!mpnt)
355 return -ENOMEM; 355 return -ENOMEM;
356
357 if (security_vm_enough_memory((IA32_STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))>>PAGE_SHIFT)) {
358 kmem_cache_free(vm_area_cachep, mpnt);
359 return -ENOMEM;
360 }
361 356
362 memset(mpnt, 0, sizeof(*mpnt)); 357 memset(mpnt, 0, sizeof(*mpnt));
363 358
diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86_64/ia32/syscall32.c
index adbc5f8089e9..3a01329473ab 100644
--- a/arch/x86_64/ia32/syscall32.c
+++ b/arch/x86_64/ia32/syscall32.c
@@ -52,17 +52,13 @@ int syscall32_setup_pages(struct linux_binprm *bprm, int exstack)
52 vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); 52 vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
53 if (!vma) 53 if (!vma)
54 return -ENOMEM; 54 return -ENOMEM;
55 if (security_vm_enough_memory(npages)) {
56 kmem_cache_free(vm_area_cachep, vma);
57 return -ENOMEM;
58 }
59 55
60 memset(vma, 0, sizeof(struct vm_area_struct)); 56 memset(vma, 0, sizeof(struct vm_area_struct));
61 /* Could randomize here */ 57 /* Could randomize here */
62 vma->vm_start = VSYSCALL32_BASE; 58 vma->vm_start = VSYSCALL32_BASE;
63 vma->vm_end = VSYSCALL32_END; 59 vma->vm_end = VSYSCALL32_END;
64 /* MAYWRITE to allow gdb to COW and set breakpoints */ 60 /* MAYWRITE to allow gdb to COW and set breakpoints */
65 vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYEXEC|VM_MAYWRITE; 61 vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYWRITE;
66 vma->vm_flags |= mm->def_flags; 62 vma->vm_flags |= mm->def_flags;
67 vma->vm_page_prot = protection_map[vma->vm_flags & 7]; 63 vma->vm_page_prot = protection_map[vma->vm_flags & 7];
68 vma->vm_ops = &syscall32_vm_ops; 64 vma->vm_ops = &syscall32_vm_ops;
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
index 4e34b0f9d613..ab3f87aaff70 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86_64/kernel/e820.c
@@ -17,6 +17,8 @@
17#include <linux/ioport.h> 17#include <linux/ioport.h>
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/kexec.h> 19#include <linux/kexec.h>
20#include <linux/module.h>
21
20#include <asm/page.h> 22#include <asm/page.h>
21#include <asm/e820.h> 23#include <asm/e820.h>
22#include <asm/proto.h> 24#include <asm/proto.h>
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 522944a000ad..c8eee20cd519 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -299,15 +299,6 @@ void __init check_ioapic(void)
299#endif 299#endif
300 /* RED-PEN skip them on mptables too? */ 300 /* RED-PEN skip them on mptables too? */
301 return; 301 return;
302 case PCI_VENDOR_ID_ATI:
303 /* All timer interrupts on atiixp
304 are doubled. Disable one. */
305 if (disable_timer_pin_1 == 0) {
306 disable_timer_pin_1 = 1;
307 printk(KERN_INFO
308 "ATI board detected. Disabling timer pin 1.\n");
309 }
310 return;
311 } 302 }
312 303
313 /* No multi-function device? */ 304 /* No multi-function device? */
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 351d8d64c2fb..238f73e1a834 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -831,11 +831,26 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
831#endif 831#endif
832} 832}
833 833
834#define HWCR 0xc0010015
835
834static int __init init_amd(struct cpuinfo_x86 *c) 836static int __init init_amd(struct cpuinfo_x86 *c)
835{ 837{
836 int r; 838 int r;
837 int level; 839 int level;
838 840
841#ifdef CONFIG_SMP
842 unsigned long value;
843
844 // Disable TLB flush filter by setting HWCR.FFDIS:
845 // bit 6 of msr C001_0015
846 //
847 // Errata 63 for SH-B3 steppings
848 // Errata 122 for all(?) steppings
849 rdmsrl(HWCR, value);
850 value |= 1 << 6;
851 wrmsrl(HWCR, value);
852#endif
853
839 /* Bit 31 in normal CPUID used for nonstandard 3DNow ID; 854 /* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
840 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */ 855 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
841 clear_bit(0*32+31, &c->x86_capability); 856 clear_bit(0*32+31, &c->x86_capability);
diff --git a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c
index 68ec03070e5a..fd99ddd009bc 100644
--- a/arch/x86_64/kernel/x8664_ksyms.c
+++ b/arch/x86_64/kernel/x8664_ksyms.c
@@ -178,10 +178,6 @@ EXPORT_SYMBOL(rwsem_down_write_failed_thunk);
178 178
179EXPORT_SYMBOL(empty_zero_page); 179EXPORT_SYMBOL(empty_zero_page);
180 180
181#ifdef CONFIG_HAVE_DEC_LOCK
182EXPORT_SYMBOL(_atomic_dec_and_lock);
183#endif
184
185EXPORT_SYMBOL(die_chain); 181EXPORT_SYMBOL(die_chain);
186EXPORT_SYMBOL(register_die_notifier); 182EXPORT_SYMBOL(register_die_notifier);
187 183
diff --git a/arch/x86_64/lib/Makefile b/arch/x86_64/lib/Makefile
index 6b26a1c1e9ff..bba5db6cebd6 100644
--- a/arch/x86_64/lib/Makefile
+++ b/arch/x86_64/lib/Makefile
@@ -10,5 +10,3 @@ lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \
10 usercopy.o getuser.o putuser.o \ 10 usercopy.o getuser.o putuser.o \
11 thunk.o clear_page.o copy_page.o bitstr.o bitops.o 11 thunk.o clear_page.o copy_page.o bitstr.o bitops.o
12lib-y += memcpy.o memmove.o memset.o copy_user.o 12lib-y += memcpy.o memmove.o memset.o copy_user.o
13
14lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
diff --git a/arch/x86_64/lib/dec_and_lock.c b/arch/x86_64/lib/dec_and_lock.c
deleted file mode 100644
index ab43394dc775..000000000000
--- a/arch/x86_64/lib/dec_and_lock.c
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * x86 version of "atomic_dec_and_lock()" using
3 * the atomic "cmpxchg" instruction.
4 *
5 * (For CPU's lacking cmpxchg, we use the slow
6 * generic version, and this one never even gets
7 * compiled).
8 */
9
10#include <linux/spinlock.h>
11#include <asm/atomic.h>
12
13int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)
14{
15 int counter;
16 int newcount;
17
18repeat:
19 counter = atomic_read(atomic);
20 newcount = counter-1;
21
22 if (!newcount)
23 goto slow_path;
24
25 asm volatile("lock; cmpxchgl %1,%2"
26 :"=a" (newcount)
27 :"r" (newcount), "m" (atomic->counter), "0" (counter));
28
29 /* If the above failed, "eax" will have changed */
30 if (newcount != counter)
31 goto repeat;
32 return 0;
33
34slow_path:
35 spin_lock(lock);
36 if (atomic_dec_and_test(atomic))
37 return 1;
38 spin_unlock(lock);
39 return 0;
40}
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 2b6257bec4c3..7e841aa2a4aa 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -26,10 +26,6 @@ config RWSEM_XCHGADD_ALGORITHM
26 bool 26 bool
27 default y 27 default y
28 28
29config HAVE_DEC_LOCK
30 bool
31 default y
32
33config GENERIC_HARDIRQS 29config GENERIC_HARDIRQS
34 bool 30 bool
35 default y 31 default y