aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/pci.c16
-rw-r--r--arch/arm/kernel/bios32.c17
-rw-r--r--arch/arm/kernel/entry-armv.S7
-rw-r--r--arch/arm/lib/bitops.h4
-rw-r--r--arch/arm/mach-ixp4xx/coyote-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c4
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c16
-rw-r--r--arch/arm/mach-s3c2410/usb-simtec.c18
-rw-r--r--arch/arm/mach-sa1100/jornada720.c1
-rw-r--r--arch/arm/mm/fault.c6
-rw-r--r--arch/arm/mm/mm-armv.c17
-rw-r--r--arch/arm/mm/proc-v6.S22
-rw-r--r--arch/arm/mm/proc-xscale.S136
-rw-r--r--arch/arm/nwfpe/double_cpdo.c24
-rw-r--r--arch/arm/nwfpe/extended_cpdo.c24
-rw-r--r--arch/arm/nwfpe/fpa11.c30
-rw-r--r--arch/arm/nwfpe/fpa11.h11
-rw-r--r--arch/arm/nwfpe/fpa11_cpdo.c28
-rw-r--r--arch/arm/nwfpe/fpa11_cpdt.c22
-rw-r--r--arch/arm/nwfpe/fpa11_cprt.c28
-rw-r--r--arch/arm/nwfpe/fpmodule.c15
-rw-r--r--arch/arm/nwfpe/single_cpdo.c24
-rw-r--r--arch/arm/nwfpe/softfloat.c334
-rw-r--r--arch/arm/nwfpe/softfloat.h68
-rw-r--r--arch/arm/oprofile/backtrace.c2
-rw-r--r--arch/arm/vfp/vfpdouble.c3
-rw-r--r--arch/arm26/mm/fault.c17
-rw-r--r--arch/cris/mm/fault.c6
-rw-r--r--arch/frv/mm/fault.c6
-rw-r--r--arch/i386/Kconfig3
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c7
-rw-r--r--arch/i386/kernel/cpu/transmeta.c6
-rw-r--r--arch/i386/kernel/syscall_table.S2
-rw-r--r--arch/i386/mach-visws/reboot.c11
-rw-r--r--arch/i386/mach-visws/setup.c2
-rw-r--r--arch/i386/mach-voyager/voyager_basic.c13
-rw-r--r--arch/i386/mm/discontig.c19
-rw-r--r--arch/i386/pci/acpi.c1
-rw-r--r--arch/i386/pci/common.c6
-rw-r--r--arch/i386/pci/irq.c1
-rw-r--r--arch/i386/pci/pci.h1
-rw-r--r--arch/i386/pci/visws.c2
-rw-r--r--arch/ia64/kernel/entry.S2
-rw-r--r--arch/ia64/kernel/process.c2
-rw-r--r--arch/m32r/kernel/time.c13
-rw-r--r--arch/m68k/mm/fault.c6
-rw-r--r--arch/parisc/mm/fault.c12
-rw-r--r--arch/ppc/8xx_io/Kconfig4
-rw-r--r--arch/ppc/8xx_io/commproc.c20
-rw-r--r--arch/ppc/8xx_io/fec.c43
-rw-r--r--arch/ppc/Kconfig2
-rw-r--r--arch/ppc/boot/simple/Makefile6
-rw-r--r--arch/ppc/boot/simple/pibs.c4
-rw-r--r--arch/ppc/configs/bamboo_defconfig943
-rw-r--r--arch/ppc/kernel/cputable.c20
-rw-r--r--arch/ppc/kernel/entry.S1
-rw-r--r--arch/ppc/kernel/head_44x.S24
-rw-r--r--arch/ppc/kernel/misc.S4
-rw-r--r--arch/ppc/kernel/pci.c15
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c2
-rw-r--r--arch/ppc/platforms/4xx/Kconfig20
-rw-r--r--arch/ppc/platforms/4xx/Makefile2
-rw-r--r--arch/ppc/platforms/4xx/bamboo.c427
-rw-r--r--arch/ppc/platforms/4xx/bamboo.h136
-rw-r--r--arch/ppc/platforms/4xx/ebony.c6
-rw-r--r--arch/ppc/platforms/4xx/ebony.h13
-rw-r--r--arch/ppc/platforms/4xx/ibm440ep.c220
-rw-r--r--arch/ppc/platforms/4xx/ibm440ep.h76
-rw-r--r--arch/ppc/platforms/4xx/ocotea.c4
-rw-r--r--arch/ppc/platforms/4xx/ocotea.h13
-rw-r--r--arch/ppc/syslib/Makefile2
-rw-r--r--arch/ppc/syslib/ibm440gx_common.c15
-rw-r--r--arch/ppc/syslib/ibm44x_common.h4
-rw-r--r--arch/ppc/syslib/m8xx_setup.c8
-rw-r--r--arch/ppc/syslib/mpc83xx_devices.c8
-rw-r--r--arch/ppc64/boot/zlib.c3
-rw-r--r--arch/ppc64/configs/bpa_defconfig987
-rw-r--r--arch/ppc64/configs/g5_defconfig12
-rw-r--r--arch/ppc64/configs/iSeries_defconfig14
-rw-r--r--arch/ppc64/configs/maple_defconfig9
-rw-r--r--arch/ppc64/configs/pSeries_defconfig14
-rw-r--r--arch/ppc64/defconfig16
-rw-r--r--arch/ppc64/kernel/head.S2
-rw-r--r--arch/ppc64/kernel/machine_kexec.c12
-rw-r--r--arch/ppc64/kernel/misc.S6
-rw-r--r--arch/ppc64/kernel/mpic.c4
-rw-r--r--arch/ppc64/kernel/mpic.h2
-rw-r--r--arch/ppc64/kernel/pci.c20
-rw-r--r--arch/ppc64/kernel/prom.c2
-rw-r--r--arch/ppc64/kernel/prom_init.c2
-rw-r--r--arch/ppc64/kernel/xics.c31
-rw-r--r--arch/ppc64/mm/numa.c7
-rw-r--r--arch/ppc64/xmon/xmon.c3
-rw-r--r--arch/s390/kernel/compat_wrapper.S26
-rw-r--r--arch/s390/kernel/machine_kexec.c7
-rw-r--r--arch/s390/kernel/relocate_kernel.S41
-rw-r--r--arch/s390/kernel/relocate_kernel64.S45
-rw-r--r--arch/s390/kernel/smp.c6
-rw-r--r--arch/s390/kernel/syscalls.S5
-rw-r--r--arch/s390/kernel/traps.c15
-rw-r--r--arch/sh64/mm/fault.c6
-rw-r--r--arch/sparc64/solaris/socket.c193
-rw-r--r--arch/x86_64/crypto/aes.c1
-rw-r--r--arch/x86_64/ia32/ptrace32.c8
-rw-r--r--arch/x86_64/kernel/mce.c16
-rw-r--r--arch/x86_64/kernel/mpparse.c17
-rw-r--r--arch/x86_64/kernel/setup.c6
-rw-r--r--arch/x86_64/lib/csum-copy.S2
-rw-r--r--arch/x86_64/mm/fault.c6
110 files changed, 3865 insertions, 742 deletions
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 1f36bbd0ed5d..2a8b364c822e 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -350,8 +350,24 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
350 region->end = res->end - offset; 350 region->end = res->end - offset;
351} 351}
352 352
353void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
354 struct pci_bus_region *region)
355{
356 struct pci_controller *hose = (struct pci_controller *)dev->sysdata;
357 unsigned long offset = 0;
358
359 if (res->flags & IORESOURCE_IO)
360 offset = hose->io_space->start;
361 else if (res->flags & IORESOURCE_MEM)
362 offset = hose->mem_space->start;
363
364 res->start = region->start + offset;
365 res->end = region->end + offset;
366}
367
353#ifdef CONFIG_HOTPLUG 368#ifdef CONFIG_HOTPLUG
354EXPORT_SYMBOL(pcibios_resource_to_bus); 369EXPORT_SYMBOL(pcibios_resource_to_bus);
370EXPORT_SYMBOL(pcibios_bus_to_resource);
355#endif 371#endif
356 372
357int 373int
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index ad26e98f1e62..c4923fac8dff 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -447,9 +447,26 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
447 region->end = res->end - offset; 447 region->end = res->end - offset;
448} 448}
449 449
450void __devinit
451pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
452 struct pci_bus_region *region)
453{
454 struct pci_sys_data *root = dev->sysdata;
455 unsigned long offset = 0;
456
457 if (res->flags & IORESOURCE_IO)
458 offset = root->io_offset;
459 if (res->flags & IORESOURCE_MEM)
460 offset = root->mem_offset;
461
462 res->start = region->start + offset;
463 res->end = region->end + offset;
464}
465
450#ifdef CONFIG_HOTPLUG 466#ifdef CONFIG_HOTPLUG
451EXPORT_SYMBOL(pcibios_fixup_bus); 467EXPORT_SYMBOL(pcibios_fixup_bus);
452EXPORT_SYMBOL(pcibios_resource_to_bus); 468EXPORT_SYMBOL(pcibios_resource_to_bus);
469EXPORT_SYMBOL(pcibios_bus_to_resource);
453#endif 470#endif
454 471
455/* 472/*
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 39a6c1b0b9a3..7152bfbee581 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -533,6 +533,13 @@ ENTRY(__switch_to)
533 ldr r3, [r2, #TI_TP_VALUE] 533 ldr r3, [r2, #TI_TP_VALUE]
534 stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack 534 stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack
535 ldr r6, [r2, #TI_CPU_DOMAIN]! 535 ldr r6, [r2, #TI_CPU_DOMAIN]!
536#if __LINUX_ARM_ARCH__ >= 6
537#ifdef CONFIG_CPU_MPCORE
538 clrex
539#else
540 strex r3, r4, [ip] @ Clear exclusive monitor
541#endif
542#endif
536#if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT) 543#if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT)
537 mra r4, r5, acc0 544 mra r4, r5, acc0
538 stmia ip, {r4, r5} 545 stmia ip, {r4, r5}
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index 2036ff15bda9..64a988c1ad44 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -1,4 +1,6 @@
1#if __LINUX_ARM_ARCH__ >= 6 1#include <linux/config.h>
2
3#if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_MPCORE)
2 .macro bitop, instr 4 .macro bitop, instr
3 mov r2, #1 5 mov r2, #1
4 and r3, r0, #7 @ Get bit offset 6 and r3, r0, #7 @ Get bit offset
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c
index 4ff4393ef0ea..7f58afb27e71 100644
--- a/arch/arm/mach-ixp4xx/coyote-setup.c
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -61,7 +61,7 @@ static struct plat_serial8250_port coyote_uart_data[] = {
61 .mapbase = IXP4XX_UART2_BASE_PHYS, 61 .mapbase = IXP4XX_UART2_BASE_PHYS,
62 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, 62 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
63 .irq = IRQ_IXP4XX_UART2, 63 .irq = IRQ_IXP4XX_UART2,
64 .flags = UPF_BOOT_AUTOCONF, 64 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
65 .iotype = UPIO_MEM, 65 .iotype = UPIO_MEM,
66 .regshift = 2, 66 .regshift = 2,
67 .uartclk = IXP4XX_UART_XTAL, 67 .uartclk = IXP4XX_UART_XTAL,
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
index 8ba1cd9406e7..65e356bd10d6 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -83,7 +83,7 @@ static struct plat_serial8250_port gtwx5715_uart_platform_data[] = {
83 .mapbase = IXP4XX_UART2_BASE_PHYS, 83 .mapbase = IXP4XX_UART2_BASE_PHYS,
84 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, 84 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
85 .irq = IRQ_IXP4XX_UART2, 85 .irq = IRQ_IXP4XX_UART2,
86 .flags = UPF_BOOT_AUTOCONF, 86 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
87 .iotype = UPIO_MEM, 87 .iotype = UPIO_MEM,
88 .regshift = 2, 88 .regshift = 2,
89 .uartclk = IXP4XX_UART_XTAL, 89 .uartclk = IXP4XX_UART_XTAL,
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index c2ba759e9946..4633470a6a37 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -82,7 +82,7 @@ static struct plat_serial8250_port ixdp425_uart_data[] = {
82 .mapbase = IXP4XX_UART1_BASE_PHYS, 82 .mapbase = IXP4XX_UART1_BASE_PHYS,
83 .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, 83 .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
84 .irq = IRQ_IXP4XX_UART1, 84 .irq = IRQ_IXP4XX_UART1,
85 .flags = UPF_BOOT_AUTOCONF, 85 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
86 .iotype = UPIO_MEM, 86 .iotype = UPIO_MEM,
87 .regshift = 2, 87 .regshift = 2,
88 .uartclk = IXP4XX_UART_XTAL, 88 .uartclk = IXP4XX_UART_XTAL,
@@ -91,7 +91,7 @@ static struct plat_serial8250_port ixdp425_uart_data[] = {
91 .mapbase = IXP4XX_UART2_BASE_PHYS, 91 .mapbase = IXP4XX_UART2_BASE_PHYS,
92 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, 92 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
93 .irq = IRQ_IXP4XX_UART1, 93 .irq = IRQ_IXP4XX_UART1,
94 .flags = UPF_BOOT_AUTOCONF, 94 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
95 .iotype = UPIO_MEM, 95 .iotype = UPIO_MEM,
96 .regshift = 2, 96 .regshift = 2,
97 .uartclk = IXP4XX_UART_XTAL, 97 .uartclk = IXP4XX_UART_XTAL,
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 1e7f343822d0..e9182242da95 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -30,6 +30,7 @@
30 * 28-Jun-2005 BJD Moved pm functionality out to common code 30 * 28-Jun-2005 BJD Moved pm functionality out to common code
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*/ 34*/
34 35
35#include <linux/kernel.h> 36#include <linux/kernel.h>
@@ -60,6 +61,7 @@
60#include <asm/arch/regs-mem.h> 61#include <asm/arch/regs-mem.h>
61#include <asm/arch/regs-lcd.h> 62#include <asm/arch/regs-lcd.h>
62#include <asm/arch/nand.h> 63#include <asm/arch/nand.h>
64#include <asm/arch/iic.h>
63 65
64#include <linux/mtd/mtd.h> 66#include <linux/mtd/mtd.h>
65#include <linux/mtd/nand.h> 67#include <linux/mtd/nand.h>
@@ -304,7 +306,7 @@ static void bast_nand_select(struct s3c2410_nand_set *set, int slot)
304} 306}
305 307
306static struct s3c2410_platform_nand bast_nand_info = { 308static struct s3c2410_platform_nand bast_nand_info = {
307 .tacls = 80, 309 .tacls = 40,
308 .twrph0 = 80, 310 .twrph0 = 80,
309 .twrph1 = 80, 311 .twrph1 = 80,
310 .nr_sets = ARRAY_SIZE(bast_nand_sets), 312 .nr_sets = ARRAY_SIZE(bast_nand_sets),
@@ -385,6 +387,17 @@ static struct platform_device bast_sio = {
385 }, 387 },
386}; 388};
387 389
390/* we have devices on the bus which cannot work much over the
391 * standard 100KHz i2c bus frequency
392*/
393
394static struct s3c2410_platform_i2c bast_i2c_info = {
395 .flags = 0,
396 .slave_addr = 0x10,
397 .bus_freq = 100*1000,
398 .max_freq = 130*1000,
399};
400
388/* Standard BAST devices */ 401/* Standard BAST devices */
389 402
390static struct platform_device *bast_devices[] __initdata = { 403static struct platform_device *bast_devices[] __initdata = {
@@ -431,6 +444,7 @@ void __init bast_map_io(void)
431 s3c24xx_uclk.parent = &s3c24xx_clkout1; 444 s3c24xx_uclk.parent = &s3c24xx_clkout1;
432 445
433 s3c_device_nand.dev.platform_data = &bast_nand_info; 446 s3c_device_nand.dev.platform_data = &bast_nand_info;
447 s3c_device_i2c.dev.platform_data = &bast_i2c_info;
434 448
435 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); 449 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
436 s3c24xx_init_clocks(0); 450 s3c24xx_init_clocks(0);
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c
index 7f2b61362976..f021fd82be52 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.c
+++ b/arch/arm/mach-s3c2410/usb-simtec.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2410/usb-simtec.c 1/* linux/arch/arm/mach-s3c2410/usb-simtec.c
2 * 2 *
3 * Copyright (c) 2004 Simtec Electronics 3 * Copyright (c) 2004,2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/ 6 * http://www.simtec.co.uk/products/EB2410ITX/
@@ -14,6 +14,8 @@
14 * Modifications: 14 * Modifications:
15 * 14-Sep-2004 BJD Created 15 * 14-Sep-2004 BJD Created
16 * 18-Oct-2004 BJD Cleanups, and added code to report OC cleared 16 * 18-Oct-2004 BJD Cleanups, and added code to report OC cleared
17 * 09-Aug-2005 BJD Renamed s3c2410_report_oc to s3c2410_usb_report_oc
18 * 09-Aug-2005 BJD Ports powered only if both are enabled
17*/ 19*/
18 20
19#define DEBUG 21#define DEBUG
@@ -47,13 +49,19 @@
47 * designed boards. 49 * designed boards.
48*/ 50*/
49 51
52static unsigned int power_state[2];
53
50static void 54static void
51usb_simtec_powercontrol(int port, int to) 55usb_simtec_powercontrol(int port, int to)
52{ 56{
53 pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to); 57 pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to);
54 58
55 if (port == 1) 59 power_state[port] = to;
56 s3c2410_gpio_setpin(S3C2410_GPB4, to ? 0:1); 60
61 if (power_state[0] && power_state[1])
62 s3c2410_gpio_setpin(S3C2410_GPB4, 0);
63 else
64 s3c2410_gpio_setpin(S3C2410_GPB4, 1);
57} 65}
58 66
59static irqreturn_t 67static irqreturn_t
@@ -63,10 +71,10 @@ usb_simtec_ocirq(int irq, void *pw, struct pt_regs *regs)
63 71
64 if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) { 72 if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) {
65 pr_debug("usb_simtec: over-current irq (oc detected)\n"); 73 pr_debug("usb_simtec: over-current irq (oc detected)\n");
66 s3c2410_report_oc(info, 3); 74 s3c2410_usb_report_oc(info, 3);
67 } else { 75 } else {
68 pr_debug("usb_simtec: over-current irq (oc cleared)\n"); 76 pr_debug("usb_simtec: over-current irq (oc cleared)\n");
69 s3c2410_report_oc(info, 0); 77 s3c2410_usb_report_oc(info, 0);
70 } 78 }
71 79
72 return IRQ_HANDLED; 80 return IRQ_HANDLED;
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index eee3cbc5ec4f..2f497112c96a 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -97,6 +97,7 @@ static void __init jornada720_map_io(void)
97} 97}
98 98
99MACHINE_START(JORNADA720, "HP Jornada 720") 99MACHINE_START(JORNADA720, "HP Jornada 720")
100 /* Maintainer: Michael Gernoth <michael@gernoth.net> */
100 .phys_ram = 0xc0000000, 101 .phys_ram = 0xc0000000,
101 .phys_io = 0x80000000, 102 .phys_io = 0x80000000,
102 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, 103 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 65bfe84b6d67..0b6c4db44e08 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -238,9 +238,9 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
238 up_read(&mm->mmap_sem); 238 up_read(&mm->mmap_sem);
239 239
240 /* 240 /*
241 * Handle the "normal" case first 241 * Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR
242 */ 242 */
243 if (fault > 0) 243 if (fault >= VM_FAULT_MINOR)
244 return 0; 244 return 0;
245 245
246 /* 246 /*
@@ -261,7 +261,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
261 do_exit(SIGKILL); 261 do_exit(SIGKILL);
262 return 0; 262 return 0;
263 263
264 case 0: 264 case VM_FAULT_SIGBUS:
265 /* 265 /*
266 * We had some memory, but were unable to 266 * We had some memory, but were unable to
267 * successfully fix up this page fault. 267 * successfully fix up this page fault.
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
index e33fe4229d05..3c655c54e231 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -383,6 +383,7 @@ static void __init build_mem_type_table(void)
383{ 383{
384 struct cachepolicy *cp; 384 struct cachepolicy *cp;
385 unsigned int cr = get_cr(); 385 unsigned int cr = get_cr();
386 unsigned int user_pgprot;
386 int cpu_arch = cpu_architecture(); 387 int cpu_arch = cpu_architecture();
387 int i; 388 int i;
388 389
@@ -408,6 +409,9 @@ static void __init build_mem_type_table(void)
408 } 409 }
409 } 410 }
410 411
412 cp = &cache_policies[cachepolicy];
413 user_pgprot = cp->pte;
414
411 /* 415 /*
412 * ARMv6 and above have extended page tables. 416 * ARMv6 and above have extended page tables.
413 */ 417 */
@@ -426,11 +430,18 @@ static void __init build_mem_type_table(void)
426 mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; 430 mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
427 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; 431 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
428 432
433 /*
434 * Mark the device area as "shared device"
435 */
429 mem_types[MT_DEVICE].prot_pte |= L_PTE_BUFFERABLE; 436 mem_types[MT_DEVICE].prot_pte |= L_PTE_BUFFERABLE;
430 mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED; 437 mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED;
431 }
432 438
433 cp = &cache_policies[cachepolicy]; 439 /*
440 * User pages need to be mapped with the ASID
441 * (iow, non-global)
442 */
443 user_pgprot |= L_PTE_ASID;
444 }
434 445
435 if (cpu_arch >= CPU_ARCH_ARMv5) { 446 if (cpu_arch >= CPU_ARCH_ARMv5) {
436 mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE; 447 mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE;
@@ -448,7 +459,7 @@ static void __init build_mem_type_table(void)
448 459
449 for (i = 0; i < 16; i++) { 460 for (i = 0; i < 16; i++) {
450 unsigned long v = pgprot_val(protection_map[i]); 461 unsigned long v = pgprot_val(protection_map[i]);
451 v &= (~(PTE_BUFFERABLE|PTE_CACHEABLE)) | cp->pte; 462 v &= (~(PTE_BUFFERABLE|PTE_CACHEABLE)) | user_pgprot;
452 protection_map[i] = __pgprot(v); 463 protection_map[i] = __pgprot(v);
453 } 464 }
454 465
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 352db98ee269..3429ddcf65d1 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -111,12 +111,6 @@ ENTRY(cpu_v6_switch_mm)
111 mcr p15, 0, r1, c13, c0, 1 @ set context ID 111 mcr p15, 0, r1, c13, c0, 1 @ set context ID
112 mov pc, lr 112 mov pc, lr
113 113
114#define nG (1 << 11)
115#define APX (1 << 9)
116#define AP1 (1 << 5)
117#define AP0 (1 << 4)
118#define XN (1 << 0)
119
120/* 114/*
121 * cpu_v6_set_pte(ptep, pte) 115 * cpu_v6_set_pte(ptep, pte)
122 * 116 *
@@ -139,24 +133,24 @@ ENTRY(cpu_v6_switch_mm)
139ENTRY(cpu_v6_set_pte) 133ENTRY(cpu_v6_set_pte)
140 str r1, [r0], #-2048 @ linux version 134 str r1, [r0], #-2048 @ linux version
141 135
142 bic r2, r1, #0x00000ff0 136 bic r2, r1, #0x000007f0
143 bic r2, r2, #0x00000003 137 bic r2, r2, #0x00000003
144 orr r2, r2, #AP0 | 2 138 orr r2, r2, #PTE_EXT_AP0 | 2
145 139
146 tst r1, #L_PTE_WRITE 140 tst r1, #L_PTE_WRITE
147 tstne r1, #L_PTE_DIRTY 141 tstne r1, #L_PTE_DIRTY
148 orreq r2, r2, #APX 142 orreq r2, r2, #PTE_EXT_APX
149 143
150 tst r1, #L_PTE_USER 144 tst r1, #L_PTE_USER
151 orrne r2, r2, #AP1 | nG 145 orrne r2, r2, #PTE_EXT_AP1
152 tstne r2, #APX 146 tstne r2, #PTE_EXT_APX
153 bicne r2, r2, #APX | AP0 147 bicne r2, r2, #PTE_EXT_APX | PTE_EXT_AP0
154 148
155 tst r1, #L_PTE_YOUNG 149 tst r1, #L_PTE_YOUNG
156 biceq r2, r2, #APX | AP1 | AP0 150 biceq r2, r2, #PTE_EXT_APX | PTE_EXT_AP_MASK
157 151
158@ tst r1, #L_PTE_EXEC 152@ tst r1, #L_PTE_EXEC
159@ orreq r2, r2, #XN 153@ orreq r2, r2, #PTE_EXT_XN
160 154
161 tst r1, #L_PTE_PRESENT 155 tst r1, #L_PTE_PRESENT
162 moveq r2, #0 156 moveq r2, #0
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 2d977b4eeeab..b88de2700146 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -370,142 +370,6 @@ ENTRY(cpu_xscale_dcache_clean_area)
370 bhi 1b 370 bhi 1b
371 mov pc, lr 371 mov pc, lr
372 372
373/* ================================ CACHE LOCKING============================
374 *
375 * The XScale MicroArchitecture implements support for locking entries into
376 * the data and instruction cache. The following functions implement the core
377 * low level instructions needed to accomplish the locking. The developer's
378 * manual states that the code that performs the locking must be in non-cached
379 * memory. To accomplish this, the code in xscale-cache-lock.c copies the
380 * following functions from the cache into a non-cached memory region that
381 * is allocated through consistent_alloc().
382 *
383 */
384 .align 5
385/*
386 * xscale_icache_lock
387 *
388 * r0: starting address to lock
389 * r1: end address to lock
390 */
391ENTRY(xscale_icache_lock)
392
393iLockLoop:
394 bic r0, r0, #CACHELINESIZE - 1
395 mcr p15, 0, r0, c9, c1, 0 @ lock into cache
396 cmp r0, r1 @ are we done?
397 add r0, r0, #CACHELINESIZE @ advance to next cache line
398 bls iLockLoop
399 mov pc, lr
400
401/*
402 * xscale_icache_unlock
403 */
404ENTRY(xscale_icache_unlock)
405 mcr p15, 0, r0, c9, c1, 1 @ Unlock icache
406 mov pc, lr
407
408/*
409 * xscale_dcache_lock
410 *
411 * r0: starting address to lock
412 * r1: end address to lock
413 */
414ENTRY(xscale_dcache_lock)
415 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
416 mov r2, #1
417 mcr p15, 0, r2, c9, c2, 0 @ Put dcache in lock mode
418 cpwait ip @ Wait for completion
419
420 mrs r2, cpsr
421 orr r3, r2, #PSR_F_BIT | PSR_I_BIT
422dLockLoop:
423 msr cpsr_c, r3
424 mcr p15, 0, r0, c7, c10, 1 @ Write back line if it is dirty
425 mcr p15, 0, r0, c7, c6, 1 @ Flush/invalidate line
426 msr cpsr_c, r2
427 ldr ip, [r0], #CACHELINESIZE @ Preload 32 bytes into cache from
428 @ location [r0]. Post-increment
429 @ r3 to next cache line
430 cmp r0, r1 @ Are we done?
431 bls dLockLoop
432
433 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
434 mov r2, #0
435 mcr p15, 0, r2, c9, c2, 0 @ Get out of lock mode
436 cpwait_ret lr, ip
437
438/*
439 * xscale_dcache_unlock
440 */
441ENTRY(xscale_dcache_unlock)
442 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
443 mcr p15, 0, ip, c9, c2, 1 @ Unlock cache
444 mov pc, lr
445
446/*
447 * Needed to determine the length of the code that needs to be copied.
448 */
449 .align 5
450ENTRY(xscale_cache_dummy)
451 mov pc, lr
452
453/* ================================ TLB LOCKING==============================
454 *
455 * The XScale MicroArchitecture implements support for locking entries into
456 * the Instruction and Data TLBs. The following functions provide the
457 * low level support for supporting these under Linux. xscale-lock.c
458 * implements some higher level management code. Most of the following
459 * is taken straight out of the Developer's Manual.
460 */
461
462/*
463 * Lock I-TLB entry
464 *
465 * r0: Virtual address to translate and lock
466 */
467 .align 5
468ENTRY(xscale_itlb_lock)
469 mrs r2, cpsr
470 orr r3, r2, #PSR_F_BIT | PSR_I_BIT
471 msr cpsr_c, r3 @ Disable interrupts
472 mcr p15, 0, r0, c8, c5, 1 @ Invalidate I-TLB entry
473 mcr p15, 0, r0, c10, c4, 0 @ Translate and lock
474 msr cpsr_c, r2 @ Restore interrupts
475 cpwait_ret lr, ip
476
477/*
478 * Lock D-TLB entry
479 *
480 * r0: Virtual address to translate and lock
481 */
482 .align 5
483ENTRY(xscale_dtlb_lock)
484 mrs r2, cpsr
485 orr r3, r2, #PSR_F_BIT | PSR_I_BIT
486 msr cpsr_c, r3 @ Disable interrupts
487 mcr p15, 0, r0, c8, c6, 1 @ Invalidate D-TLB entry
488 mcr p15, 0, r0, c10, c8, 0 @ Translate and lock
489 msr cpsr_c, r2 @ Restore interrupts
490 cpwait_ret lr, ip
491
492/*
493 * Unlock all I-TLB entries
494 */
495 .align 5
496ENTRY(xscale_itlb_unlock)
497 mcr p15, 0, ip, c10, c4, 1 @ Unlock I-TLB
498 mcr p15, 0, ip, c8, c5, 0 @ Invalidate I-TLB
499 cpwait_ret lr, ip
500
501/*
502 * Unlock all D-TLB entries
503 */
504ENTRY(xscale_dtlb_unlock)
505 mcr p15, 0, ip, c10, c8, 1 @ Unlock D-TBL
506 mcr p15, 0, ip, c8, c6, 0 @ Invalidate D-TLB
507 cpwait_ret lr, ip
508
509/* =============================== PageTable ============================== */ 373/* =============================== PageTable ============================== */
510 374
511#define PTE_CACHE_WRITE_ALLOCATE 0 375#define PTE_CACHE_WRITE_ALLOCATE 0
diff --git a/arch/arm/nwfpe/double_cpdo.c b/arch/arm/nwfpe/double_cpdo.c
index 7ffd8cb9bc96..c51d1386a97c 100644
--- a/arch/arm/nwfpe/double_cpdo.c
+++ b/arch/arm/nwfpe/double_cpdo.c
@@ -40,17 +40,17 @@ float64 float64_arccos(float64 rFm);
40float64 float64_pow(float64 rFn, float64 rFm); 40float64 float64_pow(float64 rFn, float64 rFm);
41float64 float64_pol(float64 rFn, float64 rFm); 41float64 float64_pol(float64 rFn, float64 rFm);
42 42
43static float64 float64_rsf(float64 rFn, float64 rFm) 43static float64 float64_rsf(struct roundingData *roundData, float64 rFn, float64 rFm)
44{ 44{
45 return float64_sub(rFm, rFn); 45 return float64_sub(roundData, rFm, rFn);
46} 46}
47 47
48static float64 float64_rdv(float64 rFn, float64 rFm) 48static float64 float64_rdv(struct roundingData *roundData, float64 rFn, float64 rFm)
49{ 49{
50 return float64_div(rFm, rFn); 50 return float64_div(roundData, rFm, rFn);
51} 51}
52 52
53static float64 (*const dyadic_double[16])(float64 rFn, float64 rFm) = { 53static float64 (*const dyadic_double[16])(struct roundingData*, float64 rFn, float64 rFm) = {
54 [ADF_CODE >> 20] = float64_add, 54 [ADF_CODE >> 20] = float64_add,
55 [MUF_CODE >> 20] = float64_mul, 55 [MUF_CODE >> 20] = float64_mul,
56 [SUF_CODE >> 20] = float64_sub, 56 [SUF_CODE >> 20] = float64_sub,
@@ -65,12 +65,12 @@ static float64 (*const dyadic_double[16])(float64 rFn, float64 rFm) = {
65 [FRD_CODE >> 20] = float64_rdv, 65 [FRD_CODE >> 20] = float64_rdv,
66}; 66};
67 67
68static float64 float64_mvf(float64 rFm) 68static float64 float64_mvf(struct roundingData *roundData,float64 rFm)
69{ 69{
70 return rFm; 70 return rFm;
71} 71}
72 72
73static float64 float64_mnf(float64 rFm) 73static float64 float64_mnf(struct roundingData *roundData,float64 rFm)
74{ 74{
75 union float64_components u; 75 union float64_components u;
76 76
@@ -84,7 +84,7 @@ static float64 float64_mnf(float64 rFm)
84 return u.f64; 84 return u.f64;
85} 85}
86 86
87static float64 float64_abs(float64 rFm) 87static float64 float64_abs(struct roundingData *roundData,float64 rFm)
88{ 88{
89 union float64_components u; 89 union float64_components u;
90 90
@@ -98,7 +98,7 @@ static float64 float64_abs(float64 rFm)
98 return u.f64; 98 return u.f64;
99} 99}
100 100
101static float64 (*const monadic_double[16])(float64 rFm) = { 101static float64 (*const monadic_double[16])(struct roundingData *, float64 rFm) = {
102 [MVF_CODE >> 20] = float64_mvf, 102 [MVF_CODE >> 20] = float64_mvf,
103 [MNF_CODE >> 20] = float64_mnf, 103 [MNF_CODE >> 20] = float64_mnf,
104 [ABS_CODE >> 20] = float64_abs, 104 [ABS_CODE >> 20] = float64_abs,
@@ -108,7 +108,7 @@ static float64 (*const monadic_double[16])(float64 rFm) = {
108 [NRM_CODE >> 20] = float64_mvf, 108 [NRM_CODE >> 20] = float64_mvf,
109}; 109};
110 110
111unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd) 111unsigned int DoubleCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd)
112{ 112{
113 FPA11 *fpa11 = GET_FPA11(); 113 FPA11 *fpa11 = GET_FPA11();
114 float64 rFm; 114 float64 rFm;
@@ -151,13 +151,13 @@ unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd)
151 } 151 }
152 152
153 if (dyadic_double[opc_mask_shift]) { 153 if (dyadic_double[opc_mask_shift]) {
154 rFd->fDouble = dyadic_double[opc_mask_shift](rFn, rFm); 154 rFd->fDouble = dyadic_double[opc_mask_shift](roundData, rFn, rFm);
155 } else { 155 } else {
156 return 0; 156 return 0;
157 } 157 }
158 } else { 158 } else {
159 if (monadic_double[opc_mask_shift]) { 159 if (monadic_double[opc_mask_shift]) {
160 rFd->fDouble = monadic_double[opc_mask_shift](rFm); 160 rFd->fDouble = monadic_double[opc_mask_shift](roundData, rFm);
161 } else { 161 } else {
162 return 0; 162 return 0;
163 } 163 }
diff --git a/arch/arm/nwfpe/extended_cpdo.c b/arch/arm/nwfpe/extended_cpdo.c
index c39f68a3449e..65a279ba927f 100644
--- a/arch/arm/nwfpe/extended_cpdo.c
+++ b/arch/arm/nwfpe/extended_cpdo.c
@@ -35,17 +35,17 @@ floatx80 floatx80_arccos(floatx80 rFm);
35floatx80 floatx80_pow(floatx80 rFn, floatx80 rFm); 35floatx80 floatx80_pow(floatx80 rFn, floatx80 rFm);
36floatx80 floatx80_pol(floatx80 rFn, floatx80 rFm); 36floatx80 floatx80_pol(floatx80 rFn, floatx80 rFm);
37 37
38static floatx80 floatx80_rsf(floatx80 rFn, floatx80 rFm) 38static floatx80 floatx80_rsf(struct roundingData *roundData, floatx80 rFn, floatx80 rFm)
39{ 39{
40 return floatx80_sub(rFm, rFn); 40 return floatx80_sub(roundData, rFm, rFn);
41} 41}
42 42
43static floatx80 floatx80_rdv(floatx80 rFn, floatx80 rFm) 43static floatx80 floatx80_rdv(struct roundingData *roundData, floatx80 rFn, floatx80 rFm)
44{ 44{
45 return floatx80_div(rFm, rFn); 45 return floatx80_div(roundData, rFm, rFn);
46} 46}
47 47
48static floatx80 (*const dyadic_extended[16])(floatx80 rFn, floatx80 rFm) = { 48static floatx80 (*const dyadic_extended[16])(struct roundingData*, floatx80 rFn, floatx80 rFm) = {
49 [ADF_CODE >> 20] = floatx80_add, 49 [ADF_CODE >> 20] = floatx80_add,
50 [MUF_CODE >> 20] = floatx80_mul, 50 [MUF_CODE >> 20] = floatx80_mul,
51 [SUF_CODE >> 20] = floatx80_sub, 51 [SUF_CODE >> 20] = floatx80_sub,
@@ -60,24 +60,24 @@ static floatx80 (*const dyadic_extended[16])(floatx80 rFn, floatx80 rFm) = {
60 [FRD_CODE >> 20] = floatx80_rdv, 60 [FRD_CODE >> 20] = floatx80_rdv,
61}; 61};
62 62
63static floatx80 floatx80_mvf(floatx80 rFm) 63static floatx80 floatx80_mvf(struct roundingData *roundData, floatx80 rFm)
64{ 64{
65 return rFm; 65 return rFm;
66} 66}
67 67
68static floatx80 floatx80_mnf(floatx80 rFm) 68static floatx80 floatx80_mnf(struct roundingData *roundData, floatx80 rFm)
69{ 69{
70 rFm.high ^= 0x8000; 70 rFm.high ^= 0x8000;
71 return rFm; 71 return rFm;
72} 72}
73 73
74static floatx80 floatx80_abs(floatx80 rFm) 74static floatx80 floatx80_abs(struct roundingData *roundData, floatx80 rFm)
75{ 75{
76 rFm.high &= 0x7fff; 76 rFm.high &= 0x7fff;
77 return rFm; 77 return rFm;
78} 78}
79 79
80static floatx80 (*const monadic_extended[16])(floatx80 rFm) = { 80static floatx80 (*const monadic_extended[16])(struct roundingData*, floatx80 rFm) = {
81 [MVF_CODE >> 20] = floatx80_mvf, 81 [MVF_CODE >> 20] = floatx80_mvf,
82 [MNF_CODE >> 20] = floatx80_mnf, 82 [MNF_CODE >> 20] = floatx80_mnf,
83 [ABS_CODE >> 20] = floatx80_abs, 83 [ABS_CODE >> 20] = floatx80_abs,
@@ -87,7 +87,7 @@ static floatx80 (*const monadic_extended[16])(floatx80 rFm) = {
87 [NRM_CODE >> 20] = floatx80_mvf, 87 [NRM_CODE >> 20] = floatx80_mvf,
88}; 88};
89 89
90unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd) 90unsigned int ExtendedCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd)
91{ 91{
92 FPA11 *fpa11 = GET_FPA11(); 92 FPA11 *fpa11 = GET_FPA11();
93 floatx80 rFm; 93 floatx80 rFm;
@@ -138,13 +138,13 @@ unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd)
138 } 138 }
139 139
140 if (dyadic_extended[opc_mask_shift]) { 140 if (dyadic_extended[opc_mask_shift]) {
141 rFd->fExtended = dyadic_extended[opc_mask_shift](rFn, rFm); 141 rFd->fExtended = dyadic_extended[opc_mask_shift](roundData, rFn, rFm);
142 } else { 142 } else {
143 return 0; 143 return 0;
144 } 144 }
145 } else { 145 } else {
146 if (monadic_extended[opc_mask_shift]) { 146 if (monadic_extended[opc_mask_shift]) {
147 rFd->fExtended = monadic_extended[opc_mask_shift](rFm); 147 rFd->fExtended = monadic_extended[opc_mask_shift](roundData, rFm);
148 } else { 148 } else {
149 return 0; 149 return 0;
150 } 150 }
diff --git a/arch/arm/nwfpe/fpa11.c b/arch/arm/nwfpe/fpa11.c
index bf61696865ec..7690f731ee87 100644
--- a/arch/arm/nwfpe/fpa11.c
+++ b/arch/arm/nwfpe/fpa11.c
@@ -51,48 +51,42 @@ static void resetFPA11(void)
51 fpa11->fpsr = FP_EMULATOR | BIT_AC; 51 fpa11->fpsr = FP_EMULATOR | BIT_AC;
52} 52}
53 53
54void SetRoundingMode(const unsigned int opcode) 54int8 SetRoundingMode(const unsigned int opcode)
55{ 55{
56 switch (opcode & MASK_ROUNDING_MODE) { 56 switch (opcode & MASK_ROUNDING_MODE) {
57 default: 57 default:
58 case ROUND_TO_NEAREST: 58 case ROUND_TO_NEAREST:
59 float_rounding_mode = float_round_nearest_even; 59 return float_round_nearest_even;
60 break;
61 60
62 case ROUND_TO_PLUS_INFINITY: 61 case ROUND_TO_PLUS_INFINITY:
63 float_rounding_mode = float_round_up; 62 return float_round_up;
64 break;
65 63
66 case ROUND_TO_MINUS_INFINITY: 64 case ROUND_TO_MINUS_INFINITY:
67 float_rounding_mode = float_round_down; 65 return float_round_down;
68 break;
69 66
70 case ROUND_TO_ZERO: 67 case ROUND_TO_ZERO:
71 float_rounding_mode = float_round_to_zero; 68 return float_round_to_zero;
72 break;
73 } 69 }
74} 70}
75 71
76void SetRoundingPrecision(const unsigned int opcode) 72int8 SetRoundingPrecision(const unsigned int opcode)
77{ 73{
78#ifdef CONFIG_FPE_NWFPE_XP 74#ifdef CONFIG_FPE_NWFPE_XP
79 switch (opcode & MASK_ROUNDING_PRECISION) { 75 switch (opcode & MASK_ROUNDING_PRECISION) {
80 case ROUND_SINGLE: 76 case ROUND_SINGLE:
81 floatx80_rounding_precision = 32; 77 return 32;
82 break;
83 78
84 case ROUND_DOUBLE: 79 case ROUND_DOUBLE:
85 floatx80_rounding_precision = 64; 80 return 64;
86 break;
87 81
88 case ROUND_EXTENDED: 82 case ROUND_EXTENDED:
89 floatx80_rounding_precision = 80; 83 return 80;
90 break;
91 84
92 default: 85 default:
93 floatx80_rounding_precision = 80; 86 return 80;
94 } 87 }
95#endif 88#endif
89 return 80;
96} 90}
97 91
98void nwfpe_init_fpa(union fp_state *fp) 92void nwfpe_init_fpa(union fp_state *fp)
@@ -103,8 +97,6 @@ void nwfpe_init_fpa(union fp_state *fp)
103#endif 97#endif
104 memset(fpa11, 0, sizeof(FPA11)); 98 memset(fpa11, 0, sizeof(FPA11));
105 resetFPA11(); 99 resetFPA11();
106 SetRoundingMode(ROUND_TO_NEAREST);
107 SetRoundingPrecision(ROUND_EXTENDED);
108 fpa11->initflag = 1; 100 fpa11->initflag = 1;
109} 101}
110 102
diff --git a/arch/arm/nwfpe/fpa11.h b/arch/arm/nwfpe/fpa11.h
index e4a61aea534b..93523ae4b7a1 100644
--- a/arch/arm/nwfpe/fpa11.h
+++ b/arch/arm/nwfpe/fpa11.h
@@ -37,6 +37,13 @@
37/* includes */ 37/* includes */
38#include "fpsr.h" /* FP control and status register definitions */ 38#include "fpsr.h" /* FP control and status register definitions */
39#include "milieu.h" 39#include "milieu.h"
40
41struct roundingData {
42 int8 mode;
43 int8 precision;
44 signed char exception;
45};
46
40#include "softfloat.h" 47#include "softfloat.h"
41 48
42#define typeNone 0x00 49#define typeNone 0x00
@@ -84,8 +91,8 @@ typedef struct tagFPA11 {
84 initialised. */ 91 initialised. */
85} FPA11; 92} FPA11;
86 93
87extern void SetRoundingMode(const unsigned int); 94extern int8 SetRoundingMode(const unsigned int);
88extern void SetRoundingPrecision(const unsigned int); 95extern int8 SetRoundingPrecision(const unsigned int);
89extern void nwfpe_init_fpa(union fp_state *fp); 96extern void nwfpe_init_fpa(union fp_state *fp);
90 97
91#endif 98#endif
diff --git a/arch/arm/nwfpe/fpa11_cpdo.c b/arch/arm/nwfpe/fpa11_cpdo.c
index 1bea67437b6f..4a31dfd94068 100644
--- a/arch/arm/nwfpe/fpa11_cpdo.c
+++ b/arch/arm/nwfpe/fpa11_cpdo.c
@@ -24,15 +24,16 @@
24#include "fpa11.h" 24#include "fpa11.h"
25#include "fpopcode.h" 25#include "fpopcode.h"
26 26
27unsigned int SingleCPDO(const unsigned int opcode, FPREG * rFd); 27unsigned int SingleCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd);
28unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd); 28unsigned int DoubleCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd);
29unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd); 29unsigned int ExtendedCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd);
30 30
31unsigned int EmulateCPDO(const unsigned int opcode) 31unsigned int EmulateCPDO(const unsigned int opcode)
32{ 32{
33 FPA11 *fpa11 = GET_FPA11(); 33 FPA11 *fpa11 = GET_FPA11();
34 FPREG *rFd; 34 FPREG *rFd;
35 unsigned int nType, nDest, nRc; 35 unsigned int nType, nDest, nRc;
36 struct roundingData roundData;
36 37
37 /* Get the destination size. If not valid let Linux perform 38 /* Get the destination size. If not valid let Linux perform
38 an invalid instruction trap. */ 39 an invalid instruction trap. */
@@ -40,7 +41,9 @@ unsigned int EmulateCPDO(const unsigned int opcode)
40 if (typeNone == nDest) 41 if (typeNone == nDest)
41 return 0; 42 return 0;
42 43
43 SetRoundingMode(opcode); 44 roundData.mode = SetRoundingMode(opcode);
45 roundData.precision = SetRoundingPrecision(opcode);
46 roundData.exception = 0;
44 47
45 /* Compare the size of the operands in Fn and Fm. 48 /* Compare the size of the operands in Fn and Fm.
46 Choose the largest size and perform operations in that size, 49 Choose the largest size and perform operations in that size,
@@ -63,14 +66,14 @@ unsigned int EmulateCPDO(const unsigned int opcode)
63 66
64 switch (nType) { 67 switch (nType) {
65 case typeSingle: 68 case typeSingle:
66 nRc = SingleCPDO(opcode, rFd); 69 nRc = SingleCPDO(&roundData, opcode, rFd);
67 break; 70 break;
68 case typeDouble: 71 case typeDouble:
69 nRc = DoubleCPDO(opcode, rFd); 72 nRc = DoubleCPDO(&roundData, opcode, rFd);
70 break; 73 break;
71#ifdef CONFIG_FPE_NWFPE_XP 74#ifdef CONFIG_FPE_NWFPE_XP
72 case typeExtended: 75 case typeExtended:
73 nRc = ExtendedCPDO(opcode, rFd); 76 nRc = ExtendedCPDO(&roundData, opcode, rFd);
74 break; 77 break;
75#endif 78#endif
76 default: 79 default:
@@ -93,9 +96,9 @@ unsigned int EmulateCPDO(const unsigned int opcode)
93 case typeSingle: 96 case typeSingle:
94 { 97 {
95 if (typeDouble == nType) 98 if (typeDouble == nType)
96 rFd->fSingle = float64_to_float32(rFd->fDouble); 99 rFd->fSingle = float64_to_float32(&roundData, rFd->fDouble);
97 else 100 else
98 rFd->fSingle = floatx80_to_float32(rFd->fExtended); 101 rFd->fSingle = floatx80_to_float32(&roundData, rFd->fExtended);
99 } 102 }
100 break; 103 break;
101 104
@@ -104,7 +107,7 @@ unsigned int EmulateCPDO(const unsigned int opcode)
104 if (typeSingle == nType) 107 if (typeSingle == nType)
105 rFd->fDouble = float32_to_float64(rFd->fSingle); 108 rFd->fDouble = float32_to_float64(rFd->fSingle);
106 else 109 else
107 rFd->fDouble = floatx80_to_float64(rFd->fExtended); 110 rFd->fDouble = floatx80_to_float64(&roundData, rFd->fExtended);
108 } 111 }
109 break; 112 break;
110 113
@@ -121,12 +124,15 @@ unsigned int EmulateCPDO(const unsigned int opcode)
121#else 124#else
122 if (nDest != nType) { 125 if (nDest != nType) {
123 if (nDest == typeSingle) 126 if (nDest == typeSingle)
124 rFd->fSingle = float64_to_float32(rFd->fDouble); 127 rFd->fSingle = float64_to_float32(&roundData, rFd->fDouble);
125 else 128 else
126 rFd->fDouble = float32_to_float64(rFd->fSingle); 129 rFd->fDouble = float32_to_float64(rFd->fSingle);
127 } 130 }
128#endif 131#endif
129 } 132 }
130 133
134 if (roundData.exception)
135 float_raise(roundData.exception);
136
131 return nRc; 137 return nRc;
132} 138}
diff --git a/arch/arm/nwfpe/fpa11_cpdt.c b/arch/arm/nwfpe/fpa11_cpdt.c
index 95fb63fa9d18..b0db5cbcc3b1 100644
--- a/arch/arm/nwfpe/fpa11_cpdt.c
+++ b/arch/arm/nwfpe/fpa11_cpdt.c
@@ -96,7 +96,7 @@ static inline void loadMultiple(const unsigned int Fn, const unsigned int __user
96 } 96 }
97} 97}
98 98
99static inline void storeSingle(const unsigned int Fn, unsigned int __user *pMem) 99static inline void storeSingle(struct roundingData *roundData, const unsigned int Fn, unsigned int __user *pMem)
100{ 100{
101 FPA11 *fpa11 = GET_FPA11(); 101 FPA11 *fpa11 = GET_FPA11();
102 union { 102 union {
@@ -106,12 +106,12 @@ static inline void storeSingle(const unsigned int Fn, unsigned int __user *pMem)
106 106
107 switch (fpa11->fType[Fn]) { 107 switch (fpa11->fType[Fn]) {
108 case typeDouble: 108 case typeDouble:
109 val.f = float64_to_float32(fpa11->fpreg[Fn].fDouble); 109 val.f = float64_to_float32(roundData, fpa11->fpreg[Fn].fDouble);
110 break; 110 break;
111 111
112#ifdef CONFIG_FPE_NWFPE_XP 112#ifdef CONFIG_FPE_NWFPE_XP
113 case typeExtended: 113 case typeExtended:
114 val.f = floatx80_to_float32(fpa11->fpreg[Fn].fExtended); 114 val.f = floatx80_to_float32(roundData, fpa11->fpreg[Fn].fExtended);
115 break; 115 break;
116#endif 116#endif
117 117
@@ -122,7 +122,7 @@ static inline void storeSingle(const unsigned int Fn, unsigned int __user *pMem)
122 put_user(val.i[0], pMem); 122 put_user(val.i[0], pMem);
123} 123}
124 124
125static inline void storeDouble(const unsigned int Fn, unsigned int __user *pMem) 125static inline void storeDouble(struct roundingData *roundData, const unsigned int Fn, unsigned int __user *pMem)
126{ 126{
127 FPA11 *fpa11 = GET_FPA11(); 127 FPA11 *fpa11 = GET_FPA11();
128 union { 128 union {
@@ -137,7 +137,7 @@ static inline void storeDouble(const unsigned int Fn, unsigned int __user *pMem)
137 137
138#ifdef CONFIG_FPE_NWFPE_XP 138#ifdef CONFIG_FPE_NWFPE_XP
139 case typeExtended: 139 case typeExtended:
140 val.f = floatx80_to_float64(fpa11->fpreg[Fn].fExtended); 140 val.f = floatx80_to_float64(roundData, fpa11->fpreg[Fn].fExtended);
141 break; 141 break;
142#endif 142#endif
143 143
@@ -259,8 +259,11 @@ unsigned int PerformSTF(const unsigned int opcode)
259{ 259{
260 unsigned int __user *pBase, *pAddress, *pFinal; 260 unsigned int __user *pBase, *pAddress, *pFinal;
261 unsigned int nRc = 1, write_back = WRITE_BACK(opcode); 261 unsigned int nRc = 1, write_back = WRITE_BACK(opcode);
262 struct roundingData roundData;
262 263
263 SetRoundingMode(ROUND_TO_NEAREST); 264 roundData.mode = SetRoundingMode(opcode);
265 roundData.precision = SetRoundingPrecision(opcode);
266 roundData.exception = 0;
264 267
265 pBase = (unsigned int __user *) readRegister(getRn(opcode)); 268 pBase = (unsigned int __user *) readRegister(getRn(opcode));
266 if (REG_PC == getRn(opcode)) { 269 if (REG_PC == getRn(opcode)) {
@@ -281,10 +284,10 @@ unsigned int PerformSTF(const unsigned int opcode)
281 284
282 switch (opcode & MASK_TRANSFER_LENGTH) { 285 switch (opcode & MASK_TRANSFER_LENGTH) {
283 case TRANSFER_SINGLE: 286 case TRANSFER_SINGLE:
284 storeSingle(getFd(opcode), pAddress); 287 storeSingle(&roundData, getFd(opcode), pAddress);
285 break; 288 break;
286 case TRANSFER_DOUBLE: 289 case TRANSFER_DOUBLE:
287 storeDouble(getFd(opcode), pAddress); 290 storeDouble(&roundData, getFd(opcode), pAddress);
288 break; 291 break;
289#ifdef CONFIG_FPE_NWFPE_XP 292#ifdef CONFIG_FPE_NWFPE_XP
290 case TRANSFER_EXTENDED: 293 case TRANSFER_EXTENDED:
@@ -295,6 +298,9 @@ unsigned int PerformSTF(const unsigned int opcode)
295 nRc = 0; 298 nRc = 0;
296 } 299 }
297 300
301 if (roundData.exception)
302 float_raise(roundData.exception);
303
298 if (write_back) 304 if (write_back)
299 writeRegister(getRn(opcode), (unsigned long) pFinal); 305 writeRegister(getRn(opcode), (unsigned long) pFinal);
300 return nRc; 306 return nRc;
diff --git a/arch/arm/nwfpe/fpa11_cprt.c b/arch/arm/nwfpe/fpa11_cprt.c
index db01fbc97216..adf8d3000540 100644
--- a/arch/arm/nwfpe/fpa11_cprt.c
+++ b/arch/arm/nwfpe/fpa11_cprt.c
@@ -33,8 +33,6 @@ extern flag floatx80_is_nan(floatx80);
33extern flag float64_is_nan(float64); 33extern flag float64_is_nan(float64);
34extern flag float32_is_nan(float32); 34extern flag float32_is_nan(float32);
35 35
36void SetRoundingMode(const unsigned int opcode);
37
38unsigned int PerformFLT(const unsigned int opcode); 36unsigned int PerformFLT(const unsigned int opcode);
39unsigned int PerformFIX(const unsigned int opcode); 37unsigned int PerformFIX(const unsigned int opcode);
40 38
@@ -77,14 +75,17 @@ unsigned int EmulateCPRT(const unsigned int opcode)
77unsigned int PerformFLT(const unsigned int opcode) 75unsigned int PerformFLT(const unsigned int opcode)
78{ 76{
79 FPA11 *fpa11 = GET_FPA11(); 77 FPA11 *fpa11 = GET_FPA11();
80 SetRoundingMode(opcode); 78 struct roundingData roundData;
81 SetRoundingPrecision(opcode); 79
80 roundData.mode = SetRoundingMode(opcode);
81 roundData.precision = SetRoundingPrecision(opcode);
82 roundData.exception = 0;
82 83
83 switch (opcode & MASK_ROUNDING_PRECISION) { 84 switch (opcode & MASK_ROUNDING_PRECISION) {
84 case ROUND_SINGLE: 85 case ROUND_SINGLE:
85 { 86 {
86 fpa11->fType[getFn(opcode)] = typeSingle; 87 fpa11->fType[getFn(opcode)] = typeSingle;
87 fpa11->fpreg[getFn(opcode)].fSingle = int32_to_float32(readRegister(getRd(opcode))); 88 fpa11->fpreg[getFn(opcode)].fSingle = int32_to_float32(&roundData, readRegister(getRd(opcode)));
88 } 89 }
89 break; 90 break;
90 91
@@ -108,6 +109,9 @@ unsigned int PerformFLT(const unsigned int opcode)
108 return 0; 109 return 0;
109 } 110 }
110 111
112 if (roundData.exception)
113 float_raise(roundData.exception);
114
111 return 1; 115 return 1;
112} 116}
113 117
@@ -115,26 +119,29 @@ unsigned int PerformFIX(const unsigned int opcode)
115{ 119{
116 FPA11 *fpa11 = GET_FPA11(); 120 FPA11 *fpa11 = GET_FPA11();
117 unsigned int Fn = getFm(opcode); 121 unsigned int Fn = getFm(opcode);
122 struct roundingData roundData;
118 123
119 SetRoundingMode(opcode); 124 roundData.mode = SetRoundingMode(opcode);
125 roundData.precision = SetRoundingPrecision(opcode);
126 roundData.exception = 0;
120 127
121 switch (fpa11->fType[Fn]) { 128 switch (fpa11->fType[Fn]) {
122 case typeSingle: 129 case typeSingle:
123 { 130 {
124 writeRegister(getRd(opcode), float32_to_int32(fpa11->fpreg[Fn].fSingle)); 131 writeRegister(getRd(opcode), float32_to_int32(&roundData, fpa11->fpreg[Fn].fSingle));
125 } 132 }
126 break; 133 break;
127 134
128 case typeDouble: 135 case typeDouble:
129 { 136 {
130 writeRegister(getRd(opcode), float64_to_int32(fpa11->fpreg[Fn].fDouble)); 137 writeRegister(getRd(opcode), float64_to_int32(&roundData, fpa11->fpreg[Fn].fDouble));
131 } 138 }
132 break; 139 break;
133 140
134#ifdef CONFIG_FPE_NWFPE_XP 141#ifdef CONFIG_FPE_NWFPE_XP
135 case typeExtended: 142 case typeExtended:
136 { 143 {
137 writeRegister(getRd(opcode), floatx80_to_int32(fpa11->fpreg[Fn].fExtended)); 144 writeRegister(getRd(opcode), floatx80_to_int32(&roundData, fpa11->fpreg[Fn].fExtended));
138 } 145 }
139 break; 146 break;
140#endif 147#endif
@@ -143,6 +150,9 @@ unsigned int PerformFIX(const unsigned int opcode)
143 return 0; 150 return 0;
144 } 151 }
145 152
153 if (roundData.exception)
154 float_raise(roundData.exception);
155
146 return 1; 156 return 1;
147} 157}
148 158
diff --git a/arch/arm/nwfpe/fpmodule.c b/arch/arm/nwfpe/fpmodule.c
index 12885f31d347..2dfe1ac42ee8 100644
--- a/arch/arm/nwfpe/fpmodule.c
+++ b/arch/arm/nwfpe/fpmodule.c
@@ -116,8 +116,6 @@ fpmodule.c to integrate with the NetBSD kernel (I hope!).
116code to access data in user space in some other source files at the 116code to access data in user space in some other source files at the
117moment (grep for get_user / put_user calls). --philb] 117moment (grep for get_user / put_user calls). --philb]
118 118
119float_exception_flags is a global variable in SoftFloat.
120
121This function is called by the SoftFloat routines to raise a floating 119This function is called by the SoftFloat routines to raise a floating
122point exception. We check the trap enable byte in the FPSR, and raise 120point exception. We check the trap enable byte in the FPSR, and raise
123a SIGFPE exception if necessary. If not the relevant bits in the 121a SIGFPE exception if necessary. If not the relevant bits in the
@@ -129,15 +127,14 @@ void float_raise(signed char flags)
129 register unsigned int fpsr, cumulativeTraps; 127 register unsigned int fpsr, cumulativeTraps;
130 128
131#ifdef CONFIG_DEBUG_USER 129#ifdef CONFIG_DEBUG_USER
132 printk(KERN_DEBUG 130 /* Ignore inexact errors as there are far too many of them to log */
133 "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n", 131 if (flags & ~BIT_IXC)
134 current->comm, current->pid, flags, 132 printk(KERN_DEBUG
135 __builtin_return_address(0), GET_USERREG()->ARM_pc); 133 "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n",
134 current->comm, current->pid, flags,
135 __builtin_return_address(0), GET_USERREG()->ARM_pc);
136#endif 136#endif
137 137
138 /* Keep SoftFloat exception flags up to date. */
139 float_exception_flags |= flags;
140
141 /* Read fpsr and initialize the cumulativeTraps. */ 138 /* Read fpsr and initialize the cumulativeTraps. */
142 fpsr = readFPSR(); 139 fpsr = readFPSR();
143 cumulativeTraps = 0; 140 cumulativeTraps = 0;
diff --git a/arch/arm/nwfpe/single_cpdo.c b/arch/arm/nwfpe/single_cpdo.c
index 705808e88d9d..c66981d682cf 100644
--- a/arch/arm/nwfpe/single_cpdo.c
+++ b/arch/arm/nwfpe/single_cpdo.c
@@ -36,17 +36,17 @@ float32 float32_arccos(float32 rFm);
36float32 float32_pow(float32 rFn, float32 rFm); 36float32 float32_pow(float32 rFn, float32 rFm);
37float32 float32_pol(float32 rFn, float32 rFm); 37float32 float32_pol(float32 rFn, float32 rFm);
38 38
39static float32 float32_rsf(float32 rFn, float32 rFm) 39static float32 float32_rsf(struct roundingData *roundData, float32 rFn, float32 rFm)
40{ 40{
41 return float32_sub(rFm, rFn); 41 return float32_sub(roundData, rFm, rFn);
42} 42}
43 43
44static float32 float32_rdv(float32 rFn, float32 rFm) 44static float32 float32_rdv(struct roundingData *roundData, float32 rFn, float32 rFm)
45{ 45{
46 return float32_div(rFm, rFn); 46 return float32_div(roundData, rFm, rFn);
47} 47}
48 48
49static float32 (*const dyadic_single[16])(float32 rFn, float32 rFm) = { 49static float32 (*const dyadic_single[16])(struct roundingData *, float32 rFn, float32 rFm) = {
50 [ADF_CODE >> 20] = float32_add, 50 [ADF_CODE >> 20] = float32_add,
51 [MUF_CODE >> 20] = float32_mul, 51 [MUF_CODE >> 20] = float32_mul,
52 [SUF_CODE >> 20] = float32_sub, 52 [SUF_CODE >> 20] = float32_sub,
@@ -60,22 +60,22 @@ static float32 (*const dyadic_single[16])(float32 rFn, float32 rFm) = {
60 [FRD_CODE >> 20] = float32_rdv, 60 [FRD_CODE >> 20] = float32_rdv,
61}; 61};
62 62
63static float32 float32_mvf(float32 rFm) 63static float32 float32_mvf(struct roundingData *roundData, float32 rFm)
64{ 64{
65 return rFm; 65 return rFm;
66} 66}
67 67
68static float32 float32_mnf(float32 rFm) 68static float32 float32_mnf(struct roundingData *roundData, float32 rFm)
69{ 69{
70 return rFm ^ 0x80000000; 70 return rFm ^ 0x80000000;
71} 71}
72 72
73static float32 float32_abs(float32 rFm) 73static float32 float32_abs(struct roundingData *roundData, float32 rFm)
74{ 74{
75 return rFm & 0x7fffffff; 75 return rFm & 0x7fffffff;
76} 76}
77 77
78static float32 (*const monadic_single[16])(float32 rFm) = { 78static float32 (*const monadic_single[16])(struct roundingData*, float32 rFm) = {
79 [MVF_CODE >> 20] = float32_mvf, 79 [MVF_CODE >> 20] = float32_mvf,
80 [MNF_CODE >> 20] = float32_mnf, 80 [MNF_CODE >> 20] = float32_mnf,
81 [ABS_CODE >> 20] = float32_abs, 81 [ABS_CODE >> 20] = float32_abs,
@@ -85,7 +85,7 @@ static float32 (*const monadic_single[16])(float32 rFm) = {
85 [NRM_CODE >> 20] = float32_mvf, 85 [NRM_CODE >> 20] = float32_mvf,
86}; 86};
87 87
88unsigned int SingleCPDO(const unsigned int opcode, FPREG * rFd) 88unsigned int SingleCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd)
89{ 89{
90 FPA11 *fpa11 = GET_FPA11(); 90 FPA11 *fpa11 = GET_FPA11();
91 float32 rFm; 91 float32 rFm;
@@ -108,13 +108,13 @@ unsigned int SingleCPDO(const unsigned int opcode, FPREG * rFd)
108 if (fpa11->fType[Fn] == typeSingle && 108 if (fpa11->fType[Fn] == typeSingle &&
109 dyadic_single[opc_mask_shift]) { 109 dyadic_single[opc_mask_shift]) {
110 rFn = fpa11->fpreg[Fn].fSingle; 110 rFn = fpa11->fpreg[Fn].fSingle;
111 rFd->fSingle = dyadic_single[opc_mask_shift](rFn, rFm); 111 rFd->fSingle = dyadic_single[opc_mask_shift](roundData, rFn, rFm);
112 } else { 112 } else {
113 return 0; 113 return 0;
114 } 114 }
115 } else { 115 } else {
116 if (monadic_single[opc_mask_shift]) { 116 if (monadic_single[opc_mask_shift]) {
117 rFd->fSingle = monadic_single[opc_mask_shift](rFm); 117 rFd->fSingle = monadic_single[opc_mask_shift](roundData, rFm);
118 } else { 118 } else {
119 return 0; 119 return 0;
120 } 120 }
diff --git a/arch/arm/nwfpe/softfloat.c b/arch/arm/nwfpe/softfloat.c
index e038dd3be9b3..8b75a6e7cb3a 100644
--- a/arch/arm/nwfpe/softfloat.c
+++ b/arch/arm/nwfpe/softfloat.c
@@ -36,16 +36,6 @@ this code that are retained.
36 36
37/* 37/*
38------------------------------------------------------------------------------- 38-------------------------------------------------------------------------------
39Floating-point rounding mode, extended double-precision rounding precision,
40and exception flags.
41-------------------------------------------------------------------------------
42*/
43int8 float_rounding_mode = float_round_nearest_even;
44int8 floatx80_rounding_precision = 80;
45int8 float_exception_flags;
46
47/*
48-------------------------------------------------------------------------------
49Primitive arithmetic functions, including multi-word arithmetic, and 39Primitive arithmetic functions, including multi-word arithmetic, and
50division and square root approximations. (Can be specialized to target if 40division and square root approximations. (Can be specialized to target if
51desired.) 41desired.)
@@ -77,14 +67,14 @@ input is too large, however, the invalid exception is raised and the largest
77positive or negative integer is returned. 67positive or negative integer is returned.
78------------------------------------------------------------------------------- 68-------------------------------------------------------------------------------
79*/ 69*/
80static int32 roundAndPackInt32( flag zSign, bits64 absZ ) 70static int32 roundAndPackInt32( struct roundingData *roundData, flag zSign, bits64 absZ )
81{ 71{
82 int8 roundingMode; 72 int8 roundingMode;
83 flag roundNearestEven; 73 flag roundNearestEven;
84 int8 roundIncrement, roundBits; 74 int8 roundIncrement, roundBits;
85 int32 z; 75 int32 z;
86 76
87 roundingMode = float_rounding_mode; 77 roundingMode = roundData->mode;
88 roundNearestEven = ( roundingMode == float_round_nearest_even ); 78 roundNearestEven = ( roundingMode == float_round_nearest_even );
89 roundIncrement = 0x40; 79 roundIncrement = 0x40;
90 if ( ! roundNearestEven ) { 80 if ( ! roundNearestEven ) {
@@ -107,10 +97,10 @@ static int32 roundAndPackInt32( flag zSign, bits64 absZ )
107 z = absZ; 97 z = absZ;
108 if ( zSign ) z = - z; 98 if ( zSign ) z = - z;
109 if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) { 99 if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) {
110 float_exception_flags |= float_flag_invalid; 100 roundData->exception |= float_flag_invalid;
111 return zSign ? 0x80000000 : 0x7FFFFFFF; 101 return zSign ? 0x80000000 : 0x7FFFFFFF;
112 } 102 }
113 if ( roundBits ) float_exception_flags |= float_flag_inexact; 103 if ( roundBits ) roundData->exception |= float_flag_inexact;
114 return z; 104 return z;
115 105
116} 106}
@@ -224,14 +214,14 @@ The handling of underflow and overflow follows the IEC/IEEE Standard for
224Binary Floating-point Arithmetic. 214Binary Floating-point Arithmetic.
225------------------------------------------------------------------------------- 215-------------------------------------------------------------------------------
226*/ 216*/
227static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig ) 217static float32 roundAndPackFloat32( struct roundingData *roundData, flag zSign, int16 zExp, bits32 zSig )
228{ 218{
229 int8 roundingMode; 219 int8 roundingMode;
230 flag roundNearestEven; 220 flag roundNearestEven;
231 int8 roundIncrement, roundBits; 221 int8 roundIncrement, roundBits;
232 flag isTiny; 222 flag isTiny;
233 223
234 roundingMode = float_rounding_mode; 224 roundingMode = roundData->mode;
235 roundNearestEven = ( roundingMode == float_round_nearest_even ); 225 roundNearestEven = ( roundingMode == float_round_nearest_even );
236 roundIncrement = 0x40; 226 roundIncrement = 0x40;
237 if ( ! roundNearestEven ) { 227 if ( ! roundNearestEven ) {
@@ -254,7 +244,7 @@ static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig )
254 || ( ( zExp == 0xFD ) 244 || ( ( zExp == 0xFD )
255 && ( (sbits32) ( zSig + roundIncrement ) < 0 ) ) 245 && ( (sbits32) ( zSig + roundIncrement ) < 0 ) )
256 ) { 246 ) {
257 float_raise( float_flag_overflow | float_flag_inexact ); 247 roundData->exception |= float_flag_overflow | float_flag_inexact;
258 return packFloat32( zSign, 0xFF, 0 ) - ( roundIncrement == 0 ); 248 return packFloat32( zSign, 0xFF, 0 ) - ( roundIncrement == 0 );
259 } 249 }
260 if ( zExp < 0 ) { 250 if ( zExp < 0 ) {
@@ -265,10 +255,10 @@ static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig )
265 shift32RightJamming( zSig, - zExp, &zSig ); 255 shift32RightJamming( zSig, - zExp, &zSig );
266 zExp = 0; 256 zExp = 0;
267 roundBits = zSig & 0x7F; 257 roundBits = zSig & 0x7F;
268 if ( isTiny && roundBits ) float_raise( float_flag_underflow ); 258 if ( isTiny && roundBits ) roundData->exception |= float_flag_underflow;
269 } 259 }
270 } 260 }
271 if ( roundBits ) float_exception_flags |= float_flag_inexact; 261 if ( roundBits ) roundData->exception |= float_flag_inexact;
272 zSig = ( zSig + roundIncrement )>>7; 262 zSig = ( zSig + roundIncrement )>>7;
273 zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven ); 263 zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
274 if ( zSig == 0 ) zExp = 0; 264 if ( zSig == 0 ) zExp = 0;
@@ -287,12 +277,12 @@ point exponent.
287------------------------------------------------------------------------------- 277-------------------------------------------------------------------------------
288*/ 278*/
289static float32 279static float32
290 normalizeRoundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig ) 280 normalizeRoundAndPackFloat32( struct roundingData *roundData, flag zSign, int16 zExp, bits32 zSig )
291{ 281{
292 int8 shiftCount; 282 int8 shiftCount;
293 283
294 shiftCount = countLeadingZeros32( zSig ) - 1; 284 shiftCount = countLeadingZeros32( zSig ) - 1;
295 return roundAndPackFloat32( zSign, zExp - shiftCount, zSig<<shiftCount ); 285 return roundAndPackFloat32( roundData, zSign, zExp - shiftCount, zSig<<shiftCount );
296 286
297} 287}
298 288
@@ -395,14 +385,14 @@ The handling of underflow and overflow follows the IEC/IEEE Standard for
395Binary Floating-point Arithmetic. 385Binary Floating-point Arithmetic.
396------------------------------------------------------------------------------- 386-------------------------------------------------------------------------------
397*/ 387*/
398static float64 roundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig ) 388static float64 roundAndPackFloat64( struct roundingData *roundData, flag zSign, int16 zExp, bits64 zSig )
399{ 389{
400 int8 roundingMode; 390 int8 roundingMode;
401 flag roundNearestEven; 391 flag roundNearestEven;
402 int16 roundIncrement, roundBits; 392 int16 roundIncrement, roundBits;
403 flag isTiny; 393 flag isTiny;
404 394
405 roundingMode = float_rounding_mode; 395 roundingMode = roundData->mode;
406 roundNearestEven = ( roundingMode == float_round_nearest_even ); 396 roundNearestEven = ( roundingMode == float_round_nearest_even );
407 roundIncrement = 0x200; 397 roundIncrement = 0x200;
408 if ( ! roundNearestEven ) { 398 if ( ! roundNearestEven ) {
@@ -427,7 +417,7 @@ static float64 roundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig )
427 ) { 417 ) {
428 //register int lr = __builtin_return_address(0); 418 //register int lr = __builtin_return_address(0);
429 //printk("roundAndPackFloat64 called from 0x%08x\n",lr); 419 //printk("roundAndPackFloat64 called from 0x%08x\n",lr);
430 float_raise( float_flag_overflow | float_flag_inexact ); 420 roundData->exception |= float_flag_overflow | float_flag_inexact;
431 return packFloat64( zSign, 0x7FF, 0 ) - ( roundIncrement == 0 ); 421 return packFloat64( zSign, 0x7FF, 0 ) - ( roundIncrement == 0 );
432 } 422 }
433 if ( zExp < 0 ) { 423 if ( zExp < 0 ) {
@@ -438,10 +428,10 @@ static float64 roundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig )
438 shift64RightJamming( zSig, - zExp, &zSig ); 428 shift64RightJamming( zSig, - zExp, &zSig );
439 zExp = 0; 429 zExp = 0;
440 roundBits = zSig & 0x3FF; 430 roundBits = zSig & 0x3FF;
441 if ( isTiny && roundBits ) float_raise( float_flag_underflow ); 431 if ( isTiny && roundBits ) roundData->exception |= float_flag_underflow;
442 } 432 }
443 } 433 }
444 if ( roundBits ) float_exception_flags |= float_flag_inexact; 434 if ( roundBits ) roundData->exception |= float_flag_inexact;
445 zSig = ( zSig + roundIncrement )>>10; 435 zSig = ( zSig + roundIncrement )>>10;
446 zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven ); 436 zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven );
447 if ( zSig == 0 ) zExp = 0; 437 if ( zSig == 0 ) zExp = 0;
@@ -460,12 +450,12 @@ point exponent.
460------------------------------------------------------------------------------- 450-------------------------------------------------------------------------------
461*/ 451*/
462static float64 452static float64
463 normalizeRoundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig ) 453 normalizeRoundAndPackFloat64( struct roundingData *roundData, flag zSign, int16 zExp, bits64 zSig )
464{ 454{
465 int8 shiftCount; 455 int8 shiftCount;
466 456
467 shiftCount = countLeadingZeros64( zSig ) - 1; 457 shiftCount = countLeadingZeros64( zSig ) - 1;
468 return roundAndPackFloat64( zSign, zExp - shiftCount, zSig<<shiftCount ); 458 return roundAndPackFloat64( roundData, zSign, zExp - shiftCount, zSig<<shiftCount );
469 459
470} 460}
471 461
@@ -572,14 +562,15 @@ Floating-point Arithmetic.
572*/ 562*/
573static floatx80 563static floatx80
574 roundAndPackFloatx80( 564 roundAndPackFloatx80(
575 int8 roundingPrecision, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 565 struct roundingData *roundData, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1
576 ) 566 )
577{ 567{
578 int8 roundingMode; 568 int8 roundingMode, roundingPrecision;
579 flag roundNearestEven, increment, isTiny; 569 flag roundNearestEven, increment, isTiny;
580 int64 roundIncrement, roundMask, roundBits; 570 int64 roundIncrement, roundMask, roundBits;
581 571
582 roundingMode = float_rounding_mode; 572 roundingMode = roundData->mode;
573 roundingPrecision = roundData->precision;
583 roundNearestEven = ( roundingMode == float_round_nearest_even ); 574 roundNearestEven = ( roundingMode == float_round_nearest_even );
584 if ( roundingPrecision == 80 ) goto precision80; 575 if ( roundingPrecision == 80 ) goto precision80;
585 if ( roundingPrecision == 64 ) { 576 if ( roundingPrecision == 64 ) {
@@ -623,8 +614,8 @@ static floatx80
623 shift64RightJamming( zSig0, 1 - zExp, &zSig0 ); 614 shift64RightJamming( zSig0, 1 - zExp, &zSig0 );
624 zExp = 0; 615 zExp = 0;
625 roundBits = zSig0 & roundMask; 616 roundBits = zSig0 & roundMask;
626 if ( isTiny && roundBits ) float_raise( float_flag_underflow ); 617 if ( isTiny && roundBits ) roundData->exception |= float_flag_underflow;
627 if ( roundBits ) float_exception_flags |= float_flag_inexact; 618 if ( roundBits ) roundData->exception |= float_flag_inexact;
628 zSig0 += roundIncrement; 619 zSig0 += roundIncrement;
629 if ( (sbits64) zSig0 < 0 ) zExp = 1; 620 if ( (sbits64) zSig0 < 0 ) zExp = 1;
630 roundIncrement = roundMask + 1; 621 roundIncrement = roundMask + 1;
@@ -635,7 +626,7 @@ static floatx80
635 return packFloatx80( zSign, zExp, zSig0 ); 626 return packFloatx80( zSign, zExp, zSig0 );
636 } 627 }
637 } 628 }
638 if ( roundBits ) float_exception_flags |= float_flag_inexact; 629 if ( roundBits ) roundData->exception |= float_flag_inexact;
639 zSig0 += roundIncrement; 630 zSig0 += roundIncrement;
640 if ( zSig0 < roundIncrement ) { 631 if ( zSig0 < roundIncrement ) {
641 ++zExp; 632 ++zExp;
@@ -672,7 +663,7 @@ static floatx80
672 ) { 663 ) {
673 roundMask = 0; 664 roundMask = 0;
674 overflow: 665 overflow:
675 float_raise( float_flag_overflow | float_flag_inexact ); 666 roundData->exception |= float_flag_overflow | float_flag_inexact;
676 if ( ( roundingMode == float_round_to_zero ) 667 if ( ( roundingMode == float_round_to_zero )
677 || ( zSign && ( roundingMode == float_round_up ) ) 668 || ( zSign && ( roundingMode == float_round_up ) )
678 || ( ! zSign && ( roundingMode == float_round_down ) ) 669 || ( ! zSign && ( roundingMode == float_round_down ) )
@@ -689,8 +680,8 @@ static floatx80
689 || ( zSig0 < LIT64( 0xFFFFFFFFFFFFFFFF ) ); 680 || ( zSig0 < LIT64( 0xFFFFFFFFFFFFFFFF ) );
690 shift64ExtraRightJamming( zSig0, zSig1, 1 - zExp, &zSig0, &zSig1 ); 681 shift64ExtraRightJamming( zSig0, zSig1, 1 - zExp, &zSig0, &zSig1 );
691 zExp = 0; 682 zExp = 0;
692 if ( isTiny && zSig1 ) float_raise( float_flag_underflow ); 683 if ( isTiny && zSig1 ) roundData->exception |= float_flag_underflow;
693 if ( zSig1 ) float_exception_flags |= float_flag_inexact; 684 if ( zSig1 ) roundData->exception |= float_flag_inexact;
694 if ( roundNearestEven ) { 685 if ( roundNearestEven ) {
695 increment = ( (sbits64) zSig1 < 0 ); 686 increment = ( (sbits64) zSig1 < 0 );
696 } 687 }
@@ -710,7 +701,7 @@ static floatx80
710 return packFloatx80( zSign, zExp, zSig0 ); 701 return packFloatx80( zSign, zExp, zSig0 );
711 } 702 }
712 } 703 }
713 if ( zSig1 ) float_exception_flags |= float_flag_inexact; 704 if ( zSig1 ) roundData->exception |= float_flag_inexact;
714 if ( increment ) { 705 if ( increment ) {
715 ++zSig0; 706 ++zSig0;
716 if ( zSig0 == 0 ) { 707 if ( zSig0 == 0 ) {
@@ -740,7 +731,7 @@ normalized.
740*/ 731*/
741static floatx80 732static floatx80
742 normalizeRoundAndPackFloatx80( 733 normalizeRoundAndPackFloatx80(
743 int8 roundingPrecision, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 734 struct roundingData *roundData, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1
744 ) 735 )
745{ 736{
746 int8 shiftCount; 737 int8 shiftCount;
@@ -754,7 +745,7 @@ static floatx80
754 shortShift128Left( zSig0, zSig1, shiftCount, &zSig0, &zSig1 ); 745 shortShift128Left( zSig0, zSig1, shiftCount, &zSig0, &zSig1 );
755 zExp -= shiftCount; 746 zExp -= shiftCount;
756 return 747 return
757 roundAndPackFloatx80( roundingPrecision, zSign, zExp, zSig0, zSig1 ); 748 roundAndPackFloatx80( roundData, zSign, zExp, zSig0, zSig1 );
758 749
759} 750}
760 751
@@ -767,14 +758,14 @@ the single-precision floating-point format. The conversion is performed
767according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. 758according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
768------------------------------------------------------------------------------- 759-------------------------------------------------------------------------------
769*/ 760*/
770float32 int32_to_float32( int32 a ) 761float32 int32_to_float32(struct roundingData *roundData, int32 a)
771{ 762{
772 flag zSign; 763 flag zSign;
773 764
774 if ( a == 0 ) return 0; 765 if ( a == 0 ) return 0;
775 if ( a == 0x80000000 ) return packFloat32( 1, 0x9E, 0 ); 766 if ( a == 0x80000000 ) return packFloat32( 1, 0x9E, 0 );
776 zSign = ( a < 0 ); 767 zSign = ( a < 0 );
777 return normalizeRoundAndPackFloat32( zSign, 0x9C, zSign ? - a : a ); 768 return normalizeRoundAndPackFloat32( roundData, zSign, 0x9C, zSign ? - a : a );
778 769
779} 770}
780 771
@@ -840,7 +831,7 @@ positive integer is returned. Otherwise, if the conversion overflows, the
840largest integer with the same sign as `a' is returned. 831largest integer with the same sign as `a' is returned.
841------------------------------------------------------------------------------- 832-------------------------------------------------------------------------------
842*/ 833*/
843int32 float32_to_int32( float32 a ) 834int32 float32_to_int32( struct roundingData *roundData, float32 a )
844{ 835{
845 flag aSign; 836 flag aSign;
846 int16 aExp, shiftCount; 837 int16 aExp, shiftCount;
@@ -856,7 +847,7 @@ int32 float32_to_int32( float32 a )
856 zSig = aSig; 847 zSig = aSig;
857 zSig <<= 32; 848 zSig <<= 32;
858 if ( 0 < shiftCount ) shift64RightJamming( zSig, shiftCount, &zSig ); 849 if ( 0 < shiftCount ) shift64RightJamming( zSig, shiftCount, &zSig );
859 return roundAndPackInt32( aSign, zSig ); 850 return roundAndPackInt32( roundData, aSign, zSig );
860 851
861} 852}
862 853
@@ -889,13 +880,13 @@ int32 float32_to_int32_round_to_zero( float32 a )
889 return 0x80000000; 880 return 0x80000000;
890 } 881 }
891 else if ( aExp <= 0x7E ) { 882 else if ( aExp <= 0x7E ) {
892 if ( aExp | aSig ) float_exception_flags |= float_flag_inexact; 883 if ( aExp | aSig ) float_raise( float_flag_inexact );
893 return 0; 884 return 0;
894 } 885 }
895 aSig = ( aSig | 0x00800000 )<<8; 886 aSig = ( aSig | 0x00800000 )<<8;
896 z = aSig>>( - shiftCount ); 887 z = aSig>>( - shiftCount );
897 if ( (bits32) ( aSig<<( shiftCount & 31 ) ) ) { 888 if ( (bits32) ( aSig<<( shiftCount & 31 ) ) ) {
898 float_exception_flags |= float_flag_inexact; 889 float_raise( float_flag_inexact );
899 } 890 }
900 return aSign ? - z : z; 891 return aSign ? - z : z;
901 892
@@ -973,7 +964,7 @@ operation is performed according to the IEC/IEEE Standard for Binary
973Floating-point Arithmetic. 964Floating-point Arithmetic.
974------------------------------------------------------------------------------- 965-------------------------------------------------------------------------------
975*/ 966*/
976float32 float32_round_to_int( float32 a ) 967float32 float32_round_to_int( struct roundingData *roundData, float32 a )
977{ 968{
978 flag aSign; 969 flag aSign;
979 int16 aExp; 970 int16 aExp;
@@ -988,11 +979,12 @@ float32 float32_round_to_int( float32 a )
988 } 979 }
989 return a; 980 return a;
990 } 981 }
982 roundingMode = roundData->mode;
991 if ( aExp <= 0x7E ) { 983 if ( aExp <= 0x7E ) {
992 if ( (bits32) ( a<<1 ) == 0 ) return a; 984 if ( (bits32) ( a<<1 ) == 0 ) return a;
993 float_exception_flags |= float_flag_inexact; 985 roundData->exception |= float_flag_inexact;
994 aSign = extractFloat32Sign( a ); 986 aSign = extractFloat32Sign( a );
995 switch ( float_rounding_mode ) { 987 switch ( roundingMode ) {
996 case float_round_nearest_even: 988 case float_round_nearest_even:
997 if ( ( aExp == 0x7E ) && extractFloat32Frac( a ) ) { 989 if ( ( aExp == 0x7E ) && extractFloat32Frac( a ) ) {
998 return packFloat32( aSign, 0x7F, 0 ); 990 return packFloat32( aSign, 0x7F, 0 );
@@ -1009,7 +1001,6 @@ float32 float32_round_to_int( float32 a )
1009 lastBitMask <<= 0x96 - aExp; 1001 lastBitMask <<= 0x96 - aExp;
1010 roundBitsMask = lastBitMask - 1; 1002 roundBitsMask = lastBitMask - 1;
1011 z = a; 1003 z = a;
1012 roundingMode = float_rounding_mode;
1013 if ( roundingMode == float_round_nearest_even ) { 1004 if ( roundingMode == float_round_nearest_even ) {
1014 z += lastBitMask>>1; 1005 z += lastBitMask>>1;
1015 if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask; 1006 if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask;
@@ -1020,7 +1011,7 @@ float32 float32_round_to_int( float32 a )
1020 } 1011 }
1021 } 1012 }
1022 z &= ~ roundBitsMask; 1013 z &= ~ roundBitsMask;
1023 if ( z != a ) float_exception_flags |= float_flag_inexact; 1014 if ( z != a ) roundData->exception |= float_flag_inexact;
1024 return z; 1015 return z;
1025 1016
1026} 1017}
@@ -1034,7 +1025,7 @@ addition is performed according to the IEC/IEEE Standard for Binary
1034Floating-point Arithmetic. 1025Floating-point Arithmetic.
1035------------------------------------------------------------------------------- 1026-------------------------------------------------------------------------------
1036*/ 1027*/
1037static float32 addFloat32Sigs( float32 a, float32 b, flag zSign ) 1028static float32 addFloat32Sigs( struct roundingData *roundData, float32 a, float32 b, flag zSign )
1038{ 1029{
1039 int16 aExp, bExp, zExp; 1030 int16 aExp, bExp, zExp;
1040 bits32 aSig, bSig, zSig; 1031 bits32 aSig, bSig, zSig;
@@ -1093,7 +1084,7 @@ static float32 addFloat32Sigs( float32 a, float32 b, flag zSign )
1093 ++zExp; 1084 ++zExp;
1094 } 1085 }
1095 roundAndPack: 1086 roundAndPack:
1096 return roundAndPackFloat32( zSign, zExp, zSig ); 1087 return roundAndPackFloat32( roundData, zSign, zExp, zSig );
1097 1088
1098} 1089}
1099 1090
@@ -1106,7 +1097,7 @@ result is a NaN. The subtraction is performed according to the IEC/IEEE
1106Standard for Binary Floating-point Arithmetic. 1097Standard for Binary Floating-point Arithmetic.
1107------------------------------------------------------------------------------- 1098-------------------------------------------------------------------------------
1108*/ 1099*/
1109static float32 subFloat32Sigs( float32 a, float32 b, flag zSign ) 1100static float32 subFloat32Sigs( struct roundingData *roundData, float32 a, float32 b, flag zSign )
1110{ 1101{
1111 int16 aExp, bExp, zExp; 1102 int16 aExp, bExp, zExp;
1112 bits32 aSig, bSig, zSig; 1103 bits32 aSig, bSig, zSig;
@@ -1123,7 +1114,7 @@ static float32 subFloat32Sigs( float32 a, float32 b, flag zSign )
1123 if ( expDiff < 0 ) goto bExpBigger; 1114 if ( expDiff < 0 ) goto bExpBigger;
1124 if ( aExp == 0xFF ) { 1115 if ( aExp == 0xFF ) {
1125 if ( aSig | bSig ) return propagateFloat32NaN( a, b ); 1116 if ( aSig | bSig ) return propagateFloat32NaN( a, b );
1126 float_raise( float_flag_invalid ); 1117 roundData->exception |= float_flag_invalid;
1127 return float32_default_nan; 1118 return float32_default_nan;
1128 } 1119 }
1129 if ( aExp == 0 ) { 1120 if ( aExp == 0 ) {
@@ -1132,7 +1123,7 @@ static float32 subFloat32Sigs( float32 a, float32 b, flag zSign )
1132 } 1123 }
1133 if ( bSig < aSig ) goto aBigger; 1124 if ( bSig < aSig ) goto aBigger;
1134 if ( aSig < bSig ) goto bBigger; 1125 if ( aSig < bSig ) goto bBigger;
1135 return packFloat32( float_rounding_mode == float_round_down, 0, 0 ); 1126 return packFloat32( roundData->mode == float_round_down, 0, 0 );
1136 bExpBigger: 1127 bExpBigger:
1137 if ( bExp == 0xFF ) { 1128 if ( bExp == 0xFF ) {
1138 if ( bSig ) return propagateFloat32NaN( a, b ); 1129 if ( bSig ) return propagateFloat32NaN( a, b );
@@ -1169,7 +1160,7 @@ static float32 subFloat32Sigs( float32 a, float32 b, flag zSign )
1169 zExp = aExp; 1160 zExp = aExp;
1170 normalizeRoundAndPack: 1161 normalizeRoundAndPack:
1171 --zExp; 1162 --zExp;
1172 return normalizeRoundAndPackFloat32( zSign, zExp, zSig ); 1163 return normalizeRoundAndPackFloat32( roundData, zSign, zExp, zSig );
1173 1164
1174} 1165}
1175 1166
@@ -1180,17 +1171,17 @@ and `b'. The operation is performed according to the IEC/IEEE Standard for
1180Binary Floating-point Arithmetic. 1171Binary Floating-point Arithmetic.
1181------------------------------------------------------------------------------- 1172-------------------------------------------------------------------------------
1182*/ 1173*/
1183float32 float32_add( float32 a, float32 b ) 1174float32 float32_add( struct roundingData *roundData, float32 a, float32 b )
1184{ 1175{
1185 flag aSign, bSign; 1176 flag aSign, bSign;
1186 1177
1187 aSign = extractFloat32Sign( a ); 1178 aSign = extractFloat32Sign( a );
1188 bSign = extractFloat32Sign( b ); 1179 bSign = extractFloat32Sign( b );
1189 if ( aSign == bSign ) { 1180 if ( aSign == bSign ) {
1190 return addFloat32Sigs( a, b, aSign ); 1181 return addFloat32Sigs( roundData, a, b, aSign );
1191 } 1182 }
1192 else { 1183 else {
1193 return subFloat32Sigs( a, b, aSign ); 1184 return subFloat32Sigs( roundData, a, b, aSign );
1194 } 1185 }
1195 1186
1196} 1187}
@@ -1202,17 +1193,17 @@ Returns the result of subtracting the single-precision floating-point values
1202for Binary Floating-point Arithmetic. 1193for Binary Floating-point Arithmetic.
1203------------------------------------------------------------------------------- 1194-------------------------------------------------------------------------------
1204*/ 1195*/
1205float32 float32_sub( float32 a, float32 b ) 1196float32 float32_sub( struct roundingData *roundData, float32 a, float32 b )
1206{ 1197{
1207 flag aSign, bSign; 1198 flag aSign, bSign;
1208 1199
1209 aSign = extractFloat32Sign( a ); 1200 aSign = extractFloat32Sign( a );
1210 bSign = extractFloat32Sign( b ); 1201 bSign = extractFloat32Sign( b );
1211 if ( aSign == bSign ) { 1202 if ( aSign == bSign ) {
1212 return subFloat32Sigs( a, b, aSign ); 1203 return subFloat32Sigs( roundData, a, b, aSign );
1213 } 1204 }
1214 else { 1205 else {
1215 return addFloat32Sigs( a, b, aSign ); 1206 return addFloat32Sigs( roundData, a, b, aSign );
1216 } 1207 }
1217 1208
1218} 1209}
@@ -1224,7 +1215,7 @@ Returns the result of multiplying the single-precision floating-point values
1224for Binary Floating-point Arithmetic. 1215for Binary Floating-point Arithmetic.
1225------------------------------------------------------------------------------- 1216-------------------------------------------------------------------------------
1226*/ 1217*/
1227float32 float32_mul( float32 a, float32 b ) 1218float32 float32_mul( struct roundingData *roundData, float32 a, float32 b )
1228{ 1219{
1229 flag aSign, bSign, zSign; 1220 flag aSign, bSign, zSign;
1230 int16 aExp, bExp, zExp; 1221 int16 aExp, bExp, zExp;
@@ -1244,7 +1235,7 @@ float32 float32_mul( float32 a, float32 b )
1244 return propagateFloat32NaN( a, b ); 1235 return propagateFloat32NaN( a, b );
1245 } 1236 }
1246 if ( ( bExp | bSig ) == 0 ) { 1237 if ( ( bExp | bSig ) == 0 ) {
1247 float_raise( float_flag_invalid ); 1238 roundData->exception |= float_flag_invalid;
1248 return float32_default_nan; 1239 return float32_default_nan;
1249 } 1240 }
1250 return packFloat32( zSign, 0xFF, 0 ); 1241 return packFloat32( zSign, 0xFF, 0 );
@@ -1252,7 +1243,7 @@ float32 float32_mul( float32 a, float32 b )
1252 if ( bExp == 0xFF ) { 1243 if ( bExp == 0xFF ) {
1253 if ( bSig ) return propagateFloat32NaN( a, b ); 1244 if ( bSig ) return propagateFloat32NaN( a, b );
1254 if ( ( aExp | aSig ) == 0 ) { 1245 if ( ( aExp | aSig ) == 0 ) {
1255 float_raise( float_flag_invalid ); 1246 roundData->exception |= float_flag_invalid;
1256 return float32_default_nan; 1247 return float32_default_nan;
1257 } 1248 }
1258 return packFloat32( zSign, 0xFF, 0 ); 1249 return packFloat32( zSign, 0xFF, 0 );
@@ -1274,7 +1265,7 @@ float32 float32_mul( float32 a, float32 b )
1274 zSig <<= 1; 1265 zSig <<= 1;
1275 --zExp; 1266 --zExp;
1276 } 1267 }
1277 return roundAndPackFloat32( zSign, zExp, zSig ); 1268 return roundAndPackFloat32( roundData, zSign, zExp, zSig );
1278 1269
1279} 1270}
1280 1271
@@ -1285,7 +1276,7 @@ by the corresponding value `b'. The operation is performed according to the
1285IEC/IEEE Standard for Binary Floating-point Arithmetic. 1276IEC/IEEE Standard for Binary Floating-point Arithmetic.
1286------------------------------------------------------------------------------- 1277-------------------------------------------------------------------------------
1287*/ 1278*/
1288float32 float32_div( float32 a, float32 b ) 1279float32 float32_div( struct roundingData *roundData, float32 a, float32 b )
1289{ 1280{
1290 flag aSign, bSign, zSign; 1281 flag aSign, bSign, zSign;
1291 int16 aExp, bExp, zExp; 1282 int16 aExp, bExp, zExp;
@@ -1302,7 +1293,7 @@ float32 float32_div( float32 a, float32 b )
1302 if ( aSig ) return propagateFloat32NaN( a, b ); 1293 if ( aSig ) return propagateFloat32NaN( a, b );
1303 if ( bExp == 0xFF ) { 1294 if ( bExp == 0xFF ) {
1304 if ( bSig ) return propagateFloat32NaN( a, b ); 1295 if ( bSig ) return propagateFloat32NaN( a, b );
1305 float_raise( float_flag_invalid ); 1296 roundData->exception |= float_flag_invalid;
1306 return float32_default_nan; 1297 return float32_default_nan;
1307 } 1298 }
1308 return packFloat32( zSign, 0xFF, 0 ); 1299 return packFloat32( zSign, 0xFF, 0 );
@@ -1314,10 +1305,10 @@ float32 float32_div( float32 a, float32 b )
1314 if ( bExp == 0 ) { 1305 if ( bExp == 0 ) {
1315 if ( bSig == 0 ) { 1306 if ( bSig == 0 ) {
1316 if ( ( aExp | aSig ) == 0 ) { 1307 if ( ( aExp | aSig ) == 0 ) {
1317 float_raise( float_flag_invalid ); 1308 roundData->exception |= float_flag_invalid;
1318 return float32_default_nan; 1309 return float32_default_nan;
1319 } 1310 }
1320 float_raise( float_flag_divbyzero ); 1311 roundData->exception |= float_flag_divbyzero;
1321 return packFloat32( zSign, 0xFF, 0 ); 1312 return packFloat32( zSign, 0xFF, 0 );
1322 } 1313 }
1323 normalizeFloat32Subnormal( bSig, &bExp, &bSig ); 1314 normalizeFloat32Subnormal( bSig, &bExp, &bSig );
@@ -1341,7 +1332,7 @@ float32 float32_div( float32 a, float32 b )
1341 if ( ( zSig & 0x3F ) == 0 ) { 1332 if ( ( zSig & 0x3F ) == 0 ) {
1342 zSig |= ( ( (bits64) bSig ) * zSig != ( (bits64) aSig )<<32 ); 1333 zSig |= ( ( (bits64) bSig ) * zSig != ( (bits64) aSig )<<32 );
1343 } 1334 }
1344 return roundAndPackFloat32( zSign, zExp, zSig ); 1335 return roundAndPackFloat32( roundData, zSign, zExp, zSig );
1345 1336
1346} 1337}
1347 1338
@@ -1352,7 +1343,7 @@ with respect to the corresponding value `b'. The operation is performed
1352according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. 1343according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
1353------------------------------------------------------------------------------- 1344-------------------------------------------------------------------------------
1354*/ 1345*/
1355float32 float32_rem( float32 a, float32 b ) 1346float32 float32_rem( struct roundingData *roundData, float32 a, float32 b )
1356{ 1347{
1357 flag aSign, bSign, zSign; 1348 flag aSign, bSign, zSign;
1358 int16 aExp, bExp, expDiff; 1349 int16 aExp, bExp, expDiff;
@@ -1372,7 +1363,7 @@ float32 float32_rem( float32 a, float32 b )
1372 if ( aSig || ( ( bExp == 0xFF ) && bSig ) ) { 1363 if ( aSig || ( ( bExp == 0xFF ) && bSig ) ) {
1373 return propagateFloat32NaN( a, b ); 1364 return propagateFloat32NaN( a, b );
1374 } 1365 }
1375 float_raise( float_flag_invalid ); 1366 roundData->exception |= float_flag_invalid;
1376 return float32_default_nan; 1367 return float32_default_nan;
1377 } 1368 }
1378 if ( bExp == 0xFF ) { 1369 if ( bExp == 0xFF ) {
@@ -1381,7 +1372,7 @@ float32 float32_rem( float32 a, float32 b )
1381 } 1372 }
1382 if ( bExp == 0 ) { 1373 if ( bExp == 0 ) {
1383 if ( bSig == 0 ) { 1374 if ( bSig == 0 ) {
1384 float_raise( float_flag_invalid ); 1375 roundData->exception |= float_flag_invalid;
1385 return float32_default_nan; 1376 return float32_default_nan;
1386 } 1377 }
1387 normalizeFloat32Subnormal( bSig, &bExp, &bSig ); 1378 normalizeFloat32Subnormal( bSig, &bExp, &bSig );
@@ -1444,7 +1435,7 @@ float32 float32_rem( float32 a, float32 b )
1444 } 1435 }
1445 zSign = ( (sbits32) aSig < 0 ); 1436 zSign = ( (sbits32) aSig < 0 );
1446 if ( zSign ) aSig = - aSig; 1437 if ( zSign ) aSig = - aSig;
1447 return normalizeRoundAndPackFloat32( aSign ^ zSign, bExp, aSig ); 1438 return normalizeRoundAndPackFloat32( roundData, aSign ^ zSign, bExp, aSig );
1448 1439
1449} 1440}
1450 1441
@@ -1455,7 +1446,7 @@ The operation is performed according to the IEC/IEEE Standard for Binary
1455Floating-point Arithmetic. 1446Floating-point Arithmetic.
1456------------------------------------------------------------------------------- 1447-------------------------------------------------------------------------------
1457*/ 1448*/
1458float32 float32_sqrt( float32 a ) 1449float32 float32_sqrt( struct roundingData *roundData, float32 a )
1459{ 1450{
1460 flag aSign; 1451 flag aSign;
1461 int16 aExp, zExp; 1452 int16 aExp, zExp;
@@ -1468,12 +1459,12 @@ float32 float32_sqrt( float32 a )
1468 if ( aExp == 0xFF ) { 1459 if ( aExp == 0xFF ) {
1469 if ( aSig ) return propagateFloat32NaN( a, 0 ); 1460 if ( aSig ) return propagateFloat32NaN( a, 0 );
1470 if ( ! aSign ) return a; 1461 if ( ! aSign ) return a;
1471 float_raise( float_flag_invalid ); 1462 roundData->exception |= float_flag_invalid;
1472 return float32_default_nan; 1463 return float32_default_nan;
1473 } 1464 }
1474 if ( aSign ) { 1465 if ( aSign ) {
1475 if ( ( aExp | aSig ) == 0 ) return a; 1466 if ( ( aExp | aSig ) == 0 ) return a;
1476 float_raise( float_flag_invalid ); 1467 roundData->exception |= float_flag_invalid;
1477 return float32_default_nan; 1468 return float32_default_nan;
1478 } 1469 }
1479 if ( aExp == 0 ) { 1470 if ( aExp == 0 ) {
@@ -1499,7 +1490,7 @@ float32 float32_sqrt( float32 a )
1499 } 1490 }
1500 } 1491 }
1501 shift32RightJamming( zSig, 1, &zSig ); 1492 shift32RightJamming( zSig, 1, &zSig );
1502 return roundAndPackFloat32( 0, zExp, zSig ); 1493 return roundAndPackFloat32( roundData, 0, zExp, zSig );
1503 1494
1504} 1495}
1505 1496
@@ -1661,7 +1652,7 @@ positive integer is returned. Otherwise, if the conversion overflows, the
1661largest integer with the same sign as `a' is returned. 1652largest integer with the same sign as `a' is returned.
1662------------------------------------------------------------------------------- 1653-------------------------------------------------------------------------------
1663*/ 1654*/
1664int32 float64_to_int32( float64 a ) 1655int32 float64_to_int32( struct roundingData *roundData, float64 a )
1665{ 1656{
1666 flag aSign; 1657 flag aSign;
1667 int16 aExp, shiftCount; 1658 int16 aExp, shiftCount;
@@ -1674,7 +1665,7 @@ int32 float64_to_int32( float64 a )
1674 if ( aExp ) aSig |= LIT64( 0x0010000000000000 ); 1665 if ( aExp ) aSig |= LIT64( 0x0010000000000000 );
1675 shiftCount = 0x42C - aExp; 1666 shiftCount = 0x42C - aExp;
1676 if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig ); 1667 if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig );
1677 return roundAndPackInt32( aSign, aSig ); 1668 return roundAndPackInt32( roundData, aSign, aSig );
1678 1669
1679} 1670}
1680 1671
@@ -1705,7 +1696,7 @@ int32 float64_to_int32_round_to_zero( float64 a )
1705 goto invalid; 1696 goto invalid;
1706 } 1697 }
1707 else if ( 52 < shiftCount ) { 1698 else if ( 52 < shiftCount ) {
1708 if ( aExp || aSig ) float_exception_flags |= float_flag_inexact; 1699 if ( aExp || aSig ) float_raise( float_flag_inexact );
1709 return 0; 1700 return 0;
1710 } 1701 }
1711 aSig |= LIT64( 0x0010000000000000 ); 1702 aSig |= LIT64( 0x0010000000000000 );
@@ -1715,11 +1706,11 @@ int32 float64_to_int32_round_to_zero( float64 a )
1715 if ( aSign ) z = - z; 1706 if ( aSign ) z = - z;
1716 if ( ( z < 0 ) ^ aSign ) { 1707 if ( ( z < 0 ) ^ aSign ) {
1717 invalid: 1708 invalid:
1718 float_exception_flags |= float_flag_invalid; 1709 float_raise( float_flag_invalid );
1719 return aSign ? 0x80000000 : 0x7FFFFFFF; 1710 return aSign ? 0x80000000 : 0x7FFFFFFF;
1720 } 1711 }
1721 if ( ( aSig<<shiftCount ) != savedASig ) { 1712 if ( ( aSig<<shiftCount ) != savedASig ) {
1722 float_exception_flags |= float_flag_inexact; 1713 float_raise( float_flag_inexact );
1723 } 1714 }
1724 return z; 1715 return z;
1725 1716
@@ -1736,7 +1727,7 @@ positive integer is returned. Otherwise, if the conversion overflows, the
1736largest positive integer is returned. 1727largest positive integer is returned.
1737------------------------------------------------------------------------------- 1728-------------------------------------------------------------------------------
1738*/ 1729*/
1739int32 float64_to_uint32( float64 a ) 1730int32 float64_to_uint32( struct roundingData *roundData, float64 a )
1740{ 1731{
1741 flag aSign; 1732 flag aSign;
1742 int16 aExp, shiftCount; 1733 int16 aExp, shiftCount;
@@ -1749,7 +1740,7 @@ int32 float64_to_uint32( float64 a )
1749 if ( aExp ) aSig |= LIT64( 0x0010000000000000 ); 1740 if ( aExp ) aSig |= LIT64( 0x0010000000000000 );
1750 shiftCount = 0x42C - aExp; 1741 shiftCount = 0x42C - aExp;
1751 if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig ); 1742 if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig );
1752 return roundAndPackInt32( aSign, aSig ); 1743 return roundAndPackInt32( roundData, aSign, aSig );
1753} 1744}
1754 1745
1755/* 1746/*
@@ -1778,7 +1769,7 @@ int32 float64_to_uint32_round_to_zero( float64 a )
1778 goto invalid; 1769 goto invalid;
1779 } 1770 }
1780 else if ( 52 < shiftCount ) { 1771 else if ( 52 < shiftCount ) {
1781 if ( aExp || aSig ) float_exception_flags |= float_flag_inexact; 1772 if ( aExp || aSig ) float_raise( float_flag_inexact );
1782 return 0; 1773 return 0;
1783 } 1774 }
1784 aSig |= LIT64( 0x0010000000000000 ); 1775 aSig |= LIT64( 0x0010000000000000 );
@@ -1788,11 +1779,11 @@ int32 float64_to_uint32_round_to_zero( float64 a )
1788 if ( aSign ) z = - z; 1779 if ( aSign ) z = - z;
1789 if ( ( z < 0 ) ^ aSign ) { 1780 if ( ( z < 0 ) ^ aSign ) {
1790 invalid: 1781 invalid:
1791 float_exception_flags |= float_flag_invalid; 1782 float_raise( float_flag_invalid );
1792 return aSign ? 0x80000000 : 0x7FFFFFFF; 1783 return aSign ? 0x80000000 : 0x7FFFFFFF;
1793 } 1784 }
1794 if ( ( aSig<<shiftCount ) != savedASig ) { 1785 if ( ( aSig<<shiftCount ) != savedASig ) {
1795 float_exception_flags |= float_flag_inexact; 1786 float_raise( float_flag_inexact );
1796 } 1787 }
1797 return z; 1788 return z;
1798} 1789}
@@ -1805,7 +1796,7 @@ performed according to the IEC/IEEE Standard for Binary Floating-point
1805Arithmetic. 1796Arithmetic.
1806------------------------------------------------------------------------------- 1797-------------------------------------------------------------------------------
1807*/ 1798*/
1808float32 float64_to_float32( float64 a ) 1799float32 float64_to_float32( struct roundingData *roundData, float64 a )
1809{ 1800{
1810 flag aSign; 1801 flag aSign;
1811 int16 aExp; 1802 int16 aExp;
@@ -1825,7 +1816,7 @@ float32 float64_to_float32( float64 a )
1825 zSig |= 0x40000000; 1816 zSig |= 0x40000000;
1826 aExp -= 0x381; 1817 aExp -= 0x381;
1827 } 1818 }
1828 return roundAndPackFloat32( aSign, aExp, zSig ); 1819 return roundAndPackFloat32( roundData, aSign, aExp, zSig );
1829 1820
1830} 1821}
1831 1822
@@ -1872,7 +1863,7 @@ operation is performed according to the IEC/IEEE Standard for Binary
1872Floating-point Arithmetic. 1863Floating-point Arithmetic.
1873------------------------------------------------------------------------------- 1864-------------------------------------------------------------------------------
1874*/ 1865*/
1875float64 float64_round_to_int( float64 a ) 1866float64 float64_round_to_int( struct roundingData *roundData, float64 a )
1876{ 1867{
1877 flag aSign; 1868 flag aSign;
1878 int16 aExp; 1869 int16 aExp;
@@ -1889,9 +1880,9 @@ float64 float64_round_to_int( float64 a )
1889 } 1880 }
1890 if ( aExp <= 0x3FE ) { 1881 if ( aExp <= 0x3FE ) {
1891 if ( (bits64) ( a<<1 ) == 0 ) return a; 1882 if ( (bits64) ( a<<1 ) == 0 ) return a;
1892 float_exception_flags |= float_flag_inexact; 1883 roundData->exception |= float_flag_inexact;
1893 aSign = extractFloat64Sign( a ); 1884 aSign = extractFloat64Sign( a );
1894 switch ( float_rounding_mode ) { 1885 switch ( roundData->mode ) {
1895 case float_round_nearest_even: 1886 case float_round_nearest_even:
1896 if ( ( aExp == 0x3FE ) && extractFloat64Frac( a ) ) { 1887 if ( ( aExp == 0x3FE ) && extractFloat64Frac( a ) ) {
1897 return packFloat64( aSign, 0x3FF, 0 ); 1888 return packFloat64( aSign, 0x3FF, 0 );
@@ -1909,7 +1900,7 @@ float64 float64_round_to_int( float64 a )
1909 lastBitMask <<= 0x433 - aExp; 1900 lastBitMask <<= 0x433 - aExp;
1910 roundBitsMask = lastBitMask - 1; 1901 roundBitsMask = lastBitMask - 1;
1911 z = a; 1902 z = a;
1912 roundingMode = float_rounding_mode; 1903 roundingMode = roundData->mode;
1913 if ( roundingMode == float_round_nearest_even ) { 1904 if ( roundingMode == float_round_nearest_even ) {
1914 z += lastBitMask>>1; 1905 z += lastBitMask>>1;
1915 if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask; 1906 if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask;
@@ -1920,7 +1911,7 @@ float64 float64_round_to_int( float64 a )
1920 } 1911 }
1921 } 1912 }
1922 z &= ~ roundBitsMask; 1913 z &= ~ roundBitsMask;
1923 if ( z != a ) float_exception_flags |= float_flag_inexact; 1914 if ( z != a ) roundData->exception |= float_flag_inexact;
1924 return z; 1915 return z;
1925 1916
1926} 1917}
@@ -1934,7 +1925,7 @@ addition is performed according to the IEC/IEEE Standard for Binary
1934Floating-point Arithmetic. 1925Floating-point Arithmetic.
1935------------------------------------------------------------------------------- 1926-------------------------------------------------------------------------------
1936*/ 1927*/
1937static float64 addFloat64Sigs( float64 a, float64 b, flag zSign ) 1928static float64 addFloat64Sigs( struct roundingData *roundData, float64 a, float64 b, flag zSign )
1938{ 1929{
1939 int16 aExp, bExp, zExp; 1930 int16 aExp, bExp, zExp;
1940 bits64 aSig, bSig, zSig; 1931 bits64 aSig, bSig, zSig;
@@ -1993,7 +1984,7 @@ static float64 addFloat64Sigs( float64 a, float64 b, flag zSign )
1993 ++zExp; 1984 ++zExp;
1994 } 1985 }
1995 roundAndPack: 1986 roundAndPack:
1996 return roundAndPackFloat64( zSign, zExp, zSig ); 1987 return roundAndPackFloat64( roundData, zSign, zExp, zSig );
1997 1988
1998} 1989}
1999 1990
@@ -2006,7 +1997,7 @@ result is a NaN. The subtraction is performed according to the IEC/IEEE
2006Standard for Binary Floating-point Arithmetic. 1997Standard for Binary Floating-point Arithmetic.
2007------------------------------------------------------------------------------- 1998-------------------------------------------------------------------------------
2008*/ 1999*/
2009static float64 subFloat64Sigs( float64 a, float64 b, flag zSign ) 2000static float64 subFloat64Sigs( struct roundingData *roundData, float64 a, float64 b, flag zSign )
2010{ 2001{
2011 int16 aExp, bExp, zExp; 2002 int16 aExp, bExp, zExp;
2012 bits64 aSig, bSig, zSig; 2003 bits64 aSig, bSig, zSig;
@@ -2023,7 +2014,7 @@ static float64 subFloat64Sigs( float64 a, float64 b, flag zSign )
2023 if ( expDiff < 0 ) goto bExpBigger; 2014 if ( expDiff < 0 ) goto bExpBigger;
2024 if ( aExp == 0x7FF ) { 2015 if ( aExp == 0x7FF ) {
2025 if ( aSig | bSig ) return propagateFloat64NaN( a, b ); 2016 if ( aSig | bSig ) return propagateFloat64NaN( a, b );
2026 float_raise( float_flag_invalid ); 2017 roundData->exception |= float_flag_invalid;
2027 return float64_default_nan; 2018 return float64_default_nan;
2028 } 2019 }
2029 if ( aExp == 0 ) { 2020 if ( aExp == 0 ) {
@@ -2032,7 +2023,7 @@ static float64 subFloat64Sigs( float64 a, float64 b, flag zSign )
2032 } 2023 }
2033 if ( bSig < aSig ) goto aBigger; 2024 if ( bSig < aSig ) goto aBigger;
2034 if ( aSig < bSig ) goto bBigger; 2025 if ( aSig < bSig ) goto bBigger;
2035 return packFloat64( float_rounding_mode == float_round_down, 0, 0 ); 2026 return packFloat64( roundData->mode == float_round_down, 0, 0 );
2036 bExpBigger: 2027 bExpBigger:
2037 if ( bExp == 0x7FF ) { 2028 if ( bExp == 0x7FF ) {
2038 if ( bSig ) return propagateFloat64NaN( a, b ); 2029 if ( bSig ) return propagateFloat64NaN( a, b );
@@ -2069,7 +2060,7 @@ static float64 subFloat64Sigs( float64 a, float64 b, flag zSign )
2069 zExp = aExp; 2060 zExp = aExp;
2070 normalizeRoundAndPack: 2061 normalizeRoundAndPack:
2071 --zExp; 2062 --zExp;
2072 return normalizeRoundAndPackFloat64( zSign, zExp, zSig ); 2063 return normalizeRoundAndPackFloat64( roundData, zSign, zExp, zSig );
2073 2064
2074} 2065}
2075 2066
@@ -2080,17 +2071,17 @@ and `b'. The operation is performed according to the IEC/IEEE Standard for
2080Binary Floating-point Arithmetic. 2071Binary Floating-point Arithmetic.
2081------------------------------------------------------------------------------- 2072-------------------------------------------------------------------------------
2082*/ 2073*/
2083float64 float64_add( float64 a, float64 b ) 2074float64 float64_add( struct roundingData *roundData, float64 a, float64 b )
2084{ 2075{
2085 flag aSign, bSign; 2076 flag aSign, bSign;
2086 2077
2087 aSign = extractFloat64Sign( a ); 2078 aSign = extractFloat64Sign( a );
2088 bSign = extractFloat64Sign( b ); 2079 bSign = extractFloat64Sign( b );
2089 if ( aSign == bSign ) { 2080 if ( aSign == bSign ) {
2090 return addFloat64Sigs( a, b, aSign ); 2081 return addFloat64Sigs( roundData, a, b, aSign );
2091 } 2082 }
2092 else { 2083 else {
2093 return subFloat64Sigs( a, b, aSign ); 2084 return subFloat64Sigs( roundData, a, b, aSign );
2094 } 2085 }
2095 2086
2096} 2087}
@@ -2102,17 +2093,17 @@ Returns the result of subtracting the double-precision floating-point values
2102for Binary Floating-point Arithmetic. 2093for Binary Floating-point Arithmetic.
2103------------------------------------------------------------------------------- 2094-------------------------------------------------------------------------------
2104*/ 2095*/
2105float64 float64_sub( float64 a, float64 b ) 2096float64 float64_sub( struct roundingData *roundData, float64 a, float64 b )
2106{ 2097{
2107 flag aSign, bSign; 2098 flag aSign, bSign;
2108 2099
2109 aSign = extractFloat64Sign( a ); 2100 aSign = extractFloat64Sign( a );
2110 bSign = extractFloat64Sign( b ); 2101 bSign = extractFloat64Sign( b );
2111 if ( aSign == bSign ) { 2102 if ( aSign == bSign ) {
2112 return subFloat64Sigs( a, b, aSign ); 2103 return subFloat64Sigs( roundData, a, b, aSign );
2113 } 2104 }
2114 else { 2105 else {
2115 return addFloat64Sigs( a, b, aSign ); 2106 return addFloat64Sigs( roundData, a, b, aSign );
2116 } 2107 }
2117 2108
2118} 2109}
@@ -2124,7 +2115,7 @@ Returns the result of multiplying the double-precision floating-point values
2124for Binary Floating-point Arithmetic. 2115for Binary Floating-point Arithmetic.
2125------------------------------------------------------------------------------- 2116-------------------------------------------------------------------------------
2126*/ 2117*/
2127float64 float64_mul( float64 a, float64 b ) 2118float64 float64_mul( struct roundingData *roundData, float64 a, float64 b )
2128{ 2119{
2129 flag aSign, bSign, zSign; 2120 flag aSign, bSign, zSign;
2130 int16 aExp, bExp, zExp; 2121 int16 aExp, bExp, zExp;
@@ -2142,7 +2133,7 @@ float64 float64_mul( float64 a, float64 b )
2142 return propagateFloat64NaN( a, b ); 2133 return propagateFloat64NaN( a, b );
2143 } 2134 }
2144 if ( ( bExp | bSig ) == 0 ) { 2135 if ( ( bExp | bSig ) == 0 ) {
2145 float_raise( float_flag_invalid ); 2136 roundData->exception |= float_flag_invalid;
2146 return float64_default_nan; 2137 return float64_default_nan;
2147 } 2138 }
2148 return packFloat64( zSign, 0x7FF, 0 ); 2139 return packFloat64( zSign, 0x7FF, 0 );
@@ -2150,7 +2141,7 @@ float64 float64_mul( float64 a, float64 b )
2150 if ( bExp == 0x7FF ) { 2141 if ( bExp == 0x7FF ) {
2151 if ( bSig ) return propagateFloat64NaN( a, b ); 2142 if ( bSig ) return propagateFloat64NaN( a, b );
2152 if ( ( aExp | aSig ) == 0 ) { 2143 if ( ( aExp | aSig ) == 0 ) {
2153 float_raise( float_flag_invalid ); 2144 roundData->exception |= float_flag_invalid;
2154 return float64_default_nan; 2145 return float64_default_nan;
2155 } 2146 }
2156 return packFloat64( zSign, 0x7FF, 0 ); 2147 return packFloat64( zSign, 0x7FF, 0 );
@@ -2172,7 +2163,7 @@ float64 float64_mul( float64 a, float64 b )
2172 zSig0 <<= 1; 2163 zSig0 <<= 1;
2173 --zExp; 2164 --zExp;
2174 } 2165 }
2175 return roundAndPackFloat64( zSign, zExp, zSig0 ); 2166 return roundAndPackFloat64( roundData, zSign, zExp, zSig0 );
2176 2167
2177} 2168}
2178 2169
@@ -2183,7 +2174,7 @@ by the corresponding value `b'. The operation is performed according to
2183the IEC/IEEE Standard for Binary Floating-point Arithmetic. 2174the IEC/IEEE Standard for Binary Floating-point Arithmetic.
2184------------------------------------------------------------------------------- 2175-------------------------------------------------------------------------------
2185*/ 2176*/
2186float64 float64_div( float64 a, float64 b ) 2177float64 float64_div( struct roundingData *roundData, float64 a, float64 b )
2187{ 2178{
2188 flag aSign, bSign, zSign; 2179 flag aSign, bSign, zSign;
2189 int16 aExp, bExp, zExp; 2180 int16 aExp, bExp, zExp;
@@ -2202,7 +2193,7 @@ float64 float64_div( float64 a, float64 b )
2202 if ( aSig ) return propagateFloat64NaN( a, b ); 2193 if ( aSig ) return propagateFloat64NaN( a, b );
2203 if ( bExp == 0x7FF ) { 2194 if ( bExp == 0x7FF ) {
2204 if ( bSig ) return propagateFloat64NaN( a, b ); 2195 if ( bSig ) return propagateFloat64NaN( a, b );
2205 float_raise( float_flag_invalid ); 2196 roundData->exception |= float_flag_invalid;
2206 return float64_default_nan; 2197 return float64_default_nan;
2207 } 2198 }
2208 return packFloat64( zSign, 0x7FF, 0 ); 2199 return packFloat64( zSign, 0x7FF, 0 );
@@ -2214,10 +2205,10 @@ float64 float64_div( float64 a, float64 b )
2214 if ( bExp == 0 ) { 2205 if ( bExp == 0 ) {
2215 if ( bSig == 0 ) { 2206 if ( bSig == 0 ) {
2216 if ( ( aExp | aSig ) == 0 ) { 2207 if ( ( aExp | aSig ) == 0 ) {
2217 float_raise( float_flag_invalid ); 2208 roundData->exception |= float_flag_invalid;
2218 return float64_default_nan; 2209 return float64_default_nan;
2219 } 2210 }
2220 float_raise( float_flag_divbyzero ); 2211 roundData->exception |= float_flag_divbyzero;
2221 return packFloat64( zSign, 0x7FF, 0 ); 2212 return packFloat64( zSign, 0x7FF, 0 );
2222 } 2213 }
2223 normalizeFloat64Subnormal( bSig, &bExp, &bSig ); 2214 normalizeFloat64Subnormal( bSig, &bExp, &bSig );
@@ -2243,7 +2234,7 @@ float64 float64_div( float64 a, float64 b )
2243 } 2234 }
2244 zSig |= ( rem1 != 0 ); 2235 zSig |= ( rem1 != 0 );
2245 } 2236 }
2246 return roundAndPackFloat64( zSign, zExp, zSig ); 2237 return roundAndPackFloat64( roundData, zSign, zExp, zSig );
2247 2238
2248} 2239}
2249 2240
@@ -2254,7 +2245,7 @@ with respect to the corresponding value `b'. The operation is performed
2254according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. 2245according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
2255------------------------------------------------------------------------------- 2246-------------------------------------------------------------------------------
2256*/ 2247*/
2257float64 float64_rem( float64 a, float64 b ) 2248float64 float64_rem( struct roundingData *roundData, float64 a, float64 b )
2258{ 2249{
2259 flag aSign, bSign, zSign; 2250 flag aSign, bSign, zSign;
2260 int16 aExp, bExp, expDiff; 2251 int16 aExp, bExp, expDiff;
@@ -2272,7 +2263,7 @@ float64 float64_rem( float64 a, float64 b )
2272 if ( aSig || ( ( bExp == 0x7FF ) && bSig ) ) { 2263 if ( aSig || ( ( bExp == 0x7FF ) && bSig ) ) {
2273 return propagateFloat64NaN( a, b ); 2264 return propagateFloat64NaN( a, b );
2274 } 2265 }
2275 float_raise( float_flag_invalid ); 2266 roundData->exception |= float_flag_invalid;
2276 return float64_default_nan; 2267 return float64_default_nan;
2277 } 2268 }
2278 if ( bExp == 0x7FF ) { 2269 if ( bExp == 0x7FF ) {
@@ -2281,7 +2272,7 @@ float64 float64_rem( float64 a, float64 b )
2281 } 2272 }
2282 if ( bExp == 0 ) { 2273 if ( bExp == 0 ) {
2283 if ( bSig == 0 ) { 2274 if ( bSig == 0 ) {
2284 float_raise( float_flag_invalid ); 2275 roundData->exception |= float_flag_invalid;
2285 return float64_default_nan; 2276 return float64_default_nan;
2286 } 2277 }
2287 normalizeFloat64Subnormal( bSig, &bExp, &bSig ); 2278 normalizeFloat64Subnormal( bSig, &bExp, &bSig );
@@ -2329,7 +2320,7 @@ float64 float64_rem( float64 a, float64 b )
2329 } 2320 }
2330 zSign = ( (sbits64) aSig < 0 ); 2321 zSign = ( (sbits64) aSig < 0 );
2331 if ( zSign ) aSig = - aSig; 2322 if ( zSign ) aSig = - aSig;
2332 return normalizeRoundAndPackFloat64( aSign ^ zSign, bExp, aSig ); 2323 return normalizeRoundAndPackFloat64( roundData, aSign ^ zSign, bExp, aSig );
2333 2324
2334} 2325}
2335 2326
@@ -2340,7 +2331,7 @@ The operation is performed according to the IEC/IEEE Standard for Binary
2340Floating-point Arithmetic. 2331Floating-point Arithmetic.
2341------------------------------------------------------------------------------- 2332-------------------------------------------------------------------------------
2342*/ 2333*/
2343float64 float64_sqrt( float64 a ) 2334float64 float64_sqrt( struct roundingData *roundData, float64 a )
2344{ 2335{
2345 flag aSign; 2336 flag aSign;
2346 int16 aExp, zExp; 2337 int16 aExp, zExp;
@@ -2354,12 +2345,12 @@ float64 float64_sqrt( float64 a )
2354 if ( aExp == 0x7FF ) { 2345 if ( aExp == 0x7FF ) {
2355 if ( aSig ) return propagateFloat64NaN( a, a ); 2346 if ( aSig ) return propagateFloat64NaN( a, a );
2356 if ( ! aSign ) return a; 2347 if ( ! aSign ) return a;
2357 float_raise( float_flag_invalid ); 2348 roundData->exception |= float_flag_invalid;
2358 return float64_default_nan; 2349 return float64_default_nan;
2359 } 2350 }
2360 if ( aSign ) { 2351 if ( aSign ) {
2361 if ( ( aExp | aSig ) == 0 ) return a; 2352 if ( ( aExp | aSig ) == 0 ) return a;
2362 float_raise( float_flag_invalid ); 2353 roundData->exception |= float_flag_invalid;
2363 return float64_default_nan; 2354 return float64_default_nan;
2364 } 2355 }
2365 if ( aExp == 0 ) { 2356 if ( aExp == 0 ) {
@@ -2390,7 +2381,7 @@ float64 float64_sqrt( float64 a )
2390 } 2381 }
2391 } 2382 }
2392 shift64RightJamming( zSig, 1, &zSig ); 2383 shift64RightJamming( zSig, 1, &zSig );
2393 return roundAndPackFloat64( 0, zExp, zSig ); 2384 return roundAndPackFloat64( roundData, 0, zExp, zSig );
2394 2385
2395} 2386}
2396 2387
@@ -2554,7 +2545,7 @@ largest positive integer is returned. Otherwise, if the conversion
2554overflows, the largest integer with the same sign as `a' is returned. 2545overflows, the largest integer with the same sign as `a' is returned.
2555------------------------------------------------------------------------------- 2546-------------------------------------------------------------------------------
2556*/ 2547*/
2557int32 floatx80_to_int32( floatx80 a ) 2548int32 floatx80_to_int32( struct roundingData *roundData, floatx80 a )
2558{ 2549{
2559 flag aSign; 2550 flag aSign;
2560 int32 aExp, shiftCount; 2551 int32 aExp, shiftCount;
@@ -2567,7 +2558,7 @@ int32 floatx80_to_int32( floatx80 a )
2567 shiftCount = 0x4037 - aExp; 2558 shiftCount = 0x4037 - aExp;
2568 if ( shiftCount <= 0 ) shiftCount = 1; 2559 if ( shiftCount <= 0 ) shiftCount = 1;
2569 shift64RightJamming( aSig, shiftCount, &aSig ); 2560 shift64RightJamming( aSig, shiftCount, &aSig );
2570 return roundAndPackInt32( aSign, aSig ); 2561 return roundAndPackInt32( roundData, aSign, aSig );
2571 2562
2572} 2563}
2573 2564
@@ -2598,7 +2589,7 @@ int32 floatx80_to_int32_round_to_zero( floatx80 a )
2598 goto invalid; 2589 goto invalid;
2599 } 2590 }
2600 else if ( 63 < shiftCount ) { 2591 else if ( 63 < shiftCount ) {
2601 if ( aExp || aSig ) float_exception_flags |= float_flag_inexact; 2592 if ( aExp || aSig ) float_raise( float_flag_inexact );
2602 return 0; 2593 return 0;
2603 } 2594 }
2604 savedASig = aSig; 2595 savedASig = aSig;
@@ -2607,11 +2598,11 @@ int32 floatx80_to_int32_round_to_zero( floatx80 a )
2607 if ( aSign ) z = - z; 2598 if ( aSign ) z = - z;
2608 if ( ( z < 0 ) ^ aSign ) { 2599 if ( ( z < 0 ) ^ aSign ) {
2609 invalid: 2600 invalid:
2610 float_exception_flags |= float_flag_invalid; 2601 float_raise( float_flag_invalid );
2611 return aSign ? 0x80000000 : 0x7FFFFFFF; 2602 return aSign ? 0x80000000 : 0x7FFFFFFF;
2612 } 2603 }
2613 if ( ( aSig<<shiftCount ) != savedASig ) { 2604 if ( ( aSig<<shiftCount ) != savedASig ) {
2614 float_exception_flags |= float_flag_inexact; 2605 float_raise( float_flag_inexact );
2615 } 2606 }
2616 return z; 2607 return z;
2617 2608
@@ -2625,7 +2616,7 @@ conversion is performed according to the IEC/IEEE Standard for Binary
2625Floating-point Arithmetic. 2616Floating-point Arithmetic.
2626------------------------------------------------------------------------------- 2617-------------------------------------------------------------------------------
2627*/ 2618*/
2628float32 floatx80_to_float32( floatx80 a ) 2619float32 floatx80_to_float32( struct roundingData *roundData, floatx80 a )
2629{ 2620{
2630 flag aSign; 2621 flag aSign;
2631 int32 aExp; 2622 int32 aExp;
@@ -2642,7 +2633,7 @@ float32 floatx80_to_float32( floatx80 a )
2642 } 2633 }
2643 shift64RightJamming( aSig, 33, &aSig ); 2634 shift64RightJamming( aSig, 33, &aSig );
2644 if ( aExp || aSig ) aExp -= 0x3F81; 2635 if ( aExp || aSig ) aExp -= 0x3F81;
2645 return roundAndPackFloat32( aSign, aExp, aSig ); 2636 return roundAndPackFloat32( roundData, aSign, aExp, aSig );
2646 2637
2647} 2638}
2648 2639
@@ -2654,7 +2645,7 @@ conversion is performed according to the IEC/IEEE Standard for Binary
2654Floating-point Arithmetic. 2645Floating-point Arithmetic.
2655------------------------------------------------------------------------------- 2646-------------------------------------------------------------------------------
2656*/ 2647*/
2657float64 floatx80_to_float64( floatx80 a ) 2648float64 floatx80_to_float64( struct roundingData *roundData, floatx80 a )
2658{ 2649{
2659 flag aSign; 2650 flag aSign;
2660 int32 aExp; 2651 int32 aExp;
@@ -2671,7 +2662,7 @@ float64 floatx80_to_float64( floatx80 a )
2671 } 2662 }
2672 shift64RightJamming( aSig, 1, &zSig ); 2663 shift64RightJamming( aSig, 1, &zSig );
2673 if ( aExp || aSig ) aExp -= 0x3C01; 2664 if ( aExp || aSig ) aExp -= 0x3C01;
2674 return roundAndPackFloat64( aSign, aExp, zSig ); 2665 return roundAndPackFloat64( roundData, aSign, aExp, zSig );
2675 2666
2676} 2667}
2677 2668
@@ -2683,7 +2674,7 @@ value. The operation is performed according to the IEC/IEEE Standard for
2683Binary Floating-point Arithmetic. 2674Binary Floating-point Arithmetic.
2684------------------------------------------------------------------------------- 2675-------------------------------------------------------------------------------
2685*/ 2676*/
2686floatx80 floatx80_round_to_int( floatx80 a ) 2677floatx80 floatx80_round_to_int( struct roundingData *roundData, floatx80 a )
2687{ 2678{
2688 flag aSign; 2679 flag aSign;
2689 int32 aExp; 2680 int32 aExp;
@@ -2703,9 +2694,9 @@ floatx80 floatx80_round_to_int( floatx80 a )
2703 && ( (bits64) ( extractFloatx80Frac( a )<<1 ) == 0 ) ) { 2694 && ( (bits64) ( extractFloatx80Frac( a )<<1 ) == 0 ) ) {
2704 return a; 2695 return a;
2705 } 2696 }
2706 float_exception_flags |= float_flag_inexact; 2697 roundData->exception |= float_flag_inexact;
2707 aSign = extractFloatx80Sign( a ); 2698 aSign = extractFloatx80Sign( a );
2708 switch ( float_rounding_mode ) { 2699 switch ( roundData->mode ) {
2709 case float_round_nearest_even: 2700 case float_round_nearest_even:
2710 if ( ( aExp == 0x3FFE ) && (bits64) ( extractFloatx80Frac( a )<<1 ) 2701 if ( ( aExp == 0x3FFE ) && (bits64) ( extractFloatx80Frac( a )<<1 )
2711 ) { 2702 ) {
@@ -2729,7 +2720,7 @@ floatx80 floatx80_round_to_int( floatx80 a )
2729 lastBitMask <<= 0x403E - aExp; 2720 lastBitMask <<= 0x403E - aExp;
2730 roundBitsMask = lastBitMask - 1; 2721 roundBitsMask = lastBitMask - 1;
2731 z = a; 2722 z = a;
2732 roundingMode = float_rounding_mode; 2723 roundingMode = roundData->mode;
2733 if ( roundingMode == float_round_nearest_even ) { 2724 if ( roundingMode == float_round_nearest_even ) {
2734 z.low += lastBitMask>>1; 2725 z.low += lastBitMask>>1;
2735 if ( ( z.low & roundBitsMask ) == 0 ) z.low &= ~ lastBitMask; 2726 if ( ( z.low & roundBitsMask ) == 0 ) z.low &= ~ lastBitMask;
@@ -2744,7 +2735,7 @@ floatx80 floatx80_round_to_int( floatx80 a )
2744 ++z.high; 2735 ++z.high;
2745 z.low = LIT64( 0x8000000000000000 ); 2736 z.low = LIT64( 0x8000000000000000 );
2746 } 2737 }
2747 if ( z.low != a.low ) float_exception_flags |= float_flag_inexact; 2738 if ( z.low != a.low ) roundData->exception |= float_flag_inexact;
2748 return z; 2739 return z;
2749 2740
2750} 2741}
@@ -2758,7 +2749,7 @@ The addition is performed according to the IEC/IEEE Standard for Binary
2758Floating-point Arithmetic. 2749Floating-point Arithmetic.
2759------------------------------------------------------------------------------- 2750-------------------------------------------------------------------------------
2760*/ 2751*/
2761static floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) 2752static floatx80 addFloatx80Sigs( struct roundingData *roundData, floatx80 a, floatx80 b, flag zSign )
2762{ 2753{
2763 int32 aExp, bExp, zExp; 2754 int32 aExp, bExp, zExp;
2764 bits64 aSig, bSig, zSig0, zSig1; 2755 bits64 aSig, bSig, zSig0, zSig1;
@@ -2814,7 +2805,7 @@ static floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign )
2814 roundAndPack: 2805 roundAndPack:
2815 return 2806 return
2816 roundAndPackFloatx80( 2807 roundAndPackFloatx80(
2817 floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); 2808 roundData, zSign, zExp, zSig0, zSig1 );
2818 2809
2819} 2810}
2820 2811
@@ -2827,7 +2818,7 @@ result is a NaN. The subtraction is performed according to the IEC/IEEE
2827Standard for Binary Floating-point Arithmetic. 2818Standard for Binary Floating-point Arithmetic.
2828------------------------------------------------------------------------------- 2819-------------------------------------------------------------------------------
2829*/ 2820*/
2830static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) 2821static floatx80 subFloatx80Sigs( struct roundingData *roundData, floatx80 a, floatx80 b, flag zSign )
2831{ 2822{
2832 int32 aExp, bExp, zExp; 2823 int32 aExp, bExp, zExp;
2833 bits64 aSig, bSig, zSig0, zSig1; 2824 bits64 aSig, bSig, zSig0, zSig1;
@@ -2845,7 +2836,7 @@ static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign )
2845 if ( (bits64) ( ( aSig | bSig )<<1 ) ) { 2836 if ( (bits64) ( ( aSig | bSig )<<1 ) ) {
2846 return propagateFloatx80NaN( a, b ); 2837 return propagateFloatx80NaN( a, b );
2847 } 2838 }
2848 float_raise( float_flag_invalid ); 2839 roundData->exception |= float_flag_invalid;
2849 z.low = floatx80_default_nan_low; 2840 z.low = floatx80_default_nan_low;
2850 z.high = floatx80_default_nan_high; 2841 z.high = floatx80_default_nan_high;
2851 return z; 2842 return z;
@@ -2857,7 +2848,7 @@ static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign )
2857 zSig1 = 0; 2848 zSig1 = 0;
2858 if ( bSig < aSig ) goto aBigger; 2849 if ( bSig < aSig ) goto aBigger;
2859 if ( aSig < bSig ) goto bBigger; 2850 if ( aSig < bSig ) goto bBigger;
2860 return packFloatx80( float_rounding_mode == float_round_down, 0, 0 ); 2851 return packFloatx80( roundData->mode == float_round_down, 0, 0 );
2861 bExpBigger: 2852 bExpBigger:
2862 if ( bExp == 0x7FFF ) { 2853 if ( bExp == 0x7FFF ) {
2863 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); 2854 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b );
@@ -2883,7 +2874,7 @@ static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign )
2883 normalizeRoundAndPack: 2874 normalizeRoundAndPack:
2884 return 2875 return
2885 normalizeRoundAndPackFloatx80( 2876 normalizeRoundAndPackFloatx80(
2886 floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); 2877 roundData, zSign, zExp, zSig0, zSig1 );
2887 2878
2888} 2879}
2889 2880
@@ -2894,17 +2885,17 @@ values `a' and `b'. The operation is performed according to the IEC/IEEE
2894Standard for Binary Floating-point Arithmetic. 2885Standard for Binary Floating-point Arithmetic.
2895------------------------------------------------------------------------------- 2886-------------------------------------------------------------------------------
2896*/ 2887*/
2897floatx80 floatx80_add( floatx80 a, floatx80 b ) 2888floatx80 floatx80_add( struct roundingData *roundData, floatx80 a, floatx80 b )
2898{ 2889{
2899 flag aSign, bSign; 2890 flag aSign, bSign;
2900 2891
2901 aSign = extractFloatx80Sign( a ); 2892 aSign = extractFloatx80Sign( a );
2902 bSign = extractFloatx80Sign( b ); 2893 bSign = extractFloatx80Sign( b );
2903 if ( aSign == bSign ) { 2894 if ( aSign == bSign ) {
2904 return addFloatx80Sigs( a, b, aSign ); 2895 return addFloatx80Sigs( roundData, a, b, aSign );
2905 } 2896 }
2906 else { 2897 else {
2907 return subFloatx80Sigs( a, b, aSign ); 2898 return subFloatx80Sigs( roundData, a, b, aSign );
2908 } 2899 }
2909 2900
2910} 2901}
@@ -2916,17 +2907,17 @@ point values `a' and `b'. The operation is performed according to the
2916IEC/IEEE Standard for Binary Floating-point Arithmetic. 2907IEC/IEEE Standard for Binary Floating-point Arithmetic.
2917------------------------------------------------------------------------------- 2908-------------------------------------------------------------------------------
2918*/ 2909*/
2919floatx80 floatx80_sub( floatx80 a, floatx80 b ) 2910floatx80 floatx80_sub( struct roundingData *roundData, floatx80 a, floatx80 b )
2920{ 2911{
2921 flag aSign, bSign; 2912 flag aSign, bSign;
2922 2913
2923 aSign = extractFloatx80Sign( a ); 2914 aSign = extractFloatx80Sign( a );
2924 bSign = extractFloatx80Sign( b ); 2915 bSign = extractFloatx80Sign( b );
2925 if ( aSign == bSign ) { 2916 if ( aSign == bSign ) {
2926 return subFloatx80Sigs( a, b, aSign ); 2917 return subFloatx80Sigs( roundData, a, b, aSign );
2927 } 2918 }
2928 else { 2919 else {
2929 return addFloatx80Sigs( a, b, aSign ); 2920 return addFloatx80Sigs( roundData, a, b, aSign );
2930 } 2921 }
2931 2922
2932} 2923}
@@ -2938,7 +2929,7 @@ point values `a' and `b'. The operation is performed according to the
2938IEC/IEEE Standard for Binary Floating-point Arithmetic. 2929IEC/IEEE Standard for Binary Floating-point Arithmetic.
2939------------------------------------------------------------------------------- 2930-------------------------------------------------------------------------------
2940*/ 2931*/
2941floatx80 floatx80_mul( floatx80 a, floatx80 b ) 2932floatx80 floatx80_mul( struct roundingData *roundData, floatx80 a, floatx80 b )
2942{ 2933{
2943 flag aSign, bSign, zSign; 2934 flag aSign, bSign, zSign;
2944 int32 aExp, bExp, zExp; 2935 int32 aExp, bExp, zExp;
@@ -2964,7 +2955,7 @@ floatx80 floatx80_mul( floatx80 a, floatx80 b )
2964 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); 2955 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b );
2965 if ( ( aExp | aSig ) == 0 ) { 2956 if ( ( aExp | aSig ) == 0 ) {
2966 invalid: 2957 invalid:
2967 float_raise( float_flag_invalid ); 2958 roundData->exception |= float_flag_invalid;
2968 z.low = floatx80_default_nan_low; 2959 z.low = floatx80_default_nan_low;
2969 z.high = floatx80_default_nan_high; 2960 z.high = floatx80_default_nan_high;
2970 return z; 2961 return z;
@@ -2987,7 +2978,7 @@ floatx80 floatx80_mul( floatx80 a, floatx80 b )
2987 } 2978 }
2988 return 2979 return
2989 roundAndPackFloatx80( 2980 roundAndPackFloatx80(
2990 floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); 2981 roundData, zSign, zExp, zSig0, zSig1 );
2991 2982
2992} 2983}
2993 2984
@@ -2998,7 +2989,7 @@ value `a' by the corresponding value `b'. The operation is performed
2998according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. 2989according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
2999------------------------------------------------------------------------------- 2990-------------------------------------------------------------------------------
3000*/ 2991*/
3001floatx80 floatx80_div( floatx80 a, floatx80 b ) 2992floatx80 floatx80_div( struct roundingData *roundData, floatx80 a, floatx80 b )
3002{ 2993{
3003 flag aSign, bSign, zSign; 2994 flag aSign, bSign, zSign;
3004 int32 aExp, bExp, zExp; 2995 int32 aExp, bExp, zExp;
@@ -3029,12 +3020,12 @@ floatx80 floatx80_div( floatx80 a, floatx80 b )
3029 if ( bSig == 0 ) { 3020 if ( bSig == 0 ) {
3030 if ( ( aExp | aSig ) == 0 ) { 3021 if ( ( aExp | aSig ) == 0 ) {
3031 invalid: 3022 invalid:
3032 float_raise( float_flag_invalid ); 3023 roundData->exception |= float_flag_invalid;
3033 z.low = floatx80_default_nan_low; 3024 z.low = floatx80_default_nan_low;
3034 z.high = floatx80_default_nan_high; 3025 z.high = floatx80_default_nan_high;
3035 return z; 3026 return z;
3036 } 3027 }
3037 float_raise( float_flag_divbyzero ); 3028 roundData->exception |= float_flag_divbyzero;
3038 return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); 3029 return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
3039 } 3030 }
3040 normalizeFloatx80Subnormal( bSig, &bExp, &bSig ); 3031 normalizeFloatx80Subnormal( bSig, &bExp, &bSig );
@@ -3068,7 +3059,7 @@ floatx80 floatx80_div( floatx80 a, floatx80 b )
3068 } 3059 }
3069 return 3060 return
3070 roundAndPackFloatx80( 3061 roundAndPackFloatx80(
3071 floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); 3062 roundData, zSign, zExp, zSig0, zSig1 );
3072 3063
3073} 3064}
3074 3065
@@ -3079,7 +3070,7 @@ Returns the remainder of the extended double-precision floating-point value
3079according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. 3070according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
3080------------------------------------------------------------------------------- 3071-------------------------------------------------------------------------------
3081*/ 3072*/
3082floatx80 floatx80_rem( floatx80 a, floatx80 b ) 3073floatx80 floatx80_rem( struct roundingData *roundData, floatx80 a, floatx80 b )
3083{ 3074{
3084 flag aSign, bSign, zSign; 3075 flag aSign, bSign, zSign;
3085 int32 aExp, bExp, expDiff; 3076 int32 aExp, bExp, expDiff;
@@ -3107,7 +3098,7 @@ floatx80 floatx80_rem( floatx80 a, floatx80 b )
3107 if ( bExp == 0 ) { 3098 if ( bExp == 0 ) {
3108 if ( bSig == 0 ) { 3099 if ( bSig == 0 ) {
3109 invalid: 3100 invalid:
3110 float_raise( float_flag_invalid ); 3101 roundData->exception |= float_flag_invalid;
3111 z.low = floatx80_default_nan_low; 3102 z.low = floatx80_default_nan_low;
3112 z.high = floatx80_default_nan_high; 3103 z.high = floatx80_default_nan_high;
3113 return z; 3104 return z;
@@ -3164,9 +3155,10 @@ floatx80 floatx80_rem( floatx80 a, floatx80 b )
3164 aSig1 = alternateASig1; 3155 aSig1 = alternateASig1;
3165 zSign = ! zSign; 3156 zSign = ! zSign;
3166 } 3157 }
3158
3167 return 3159 return
3168 normalizeRoundAndPackFloatx80( 3160 normalizeRoundAndPackFloatx80(
3169 80, zSign, bExp + expDiff, aSig0, aSig1 ); 3161 roundData, zSign, bExp + expDiff, aSig0, aSig1 );
3170 3162
3171} 3163}
3172 3164
@@ -3177,7 +3169,7 @@ value `a'. The operation is performed according to the IEC/IEEE Standard
3177for Binary Floating-point Arithmetic. 3169for Binary Floating-point Arithmetic.
3178------------------------------------------------------------------------------- 3170-------------------------------------------------------------------------------
3179*/ 3171*/
3180floatx80 floatx80_sqrt( floatx80 a ) 3172floatx80 floatx80_sqrt( struct roundingData *roundData, floatx80 a )
3181{ 3173{
3182 flag aSign; 3174 flag aSign;
3183 int32 aExp, zExp; 3175 int32 aExp, zExp;
@@ -3197,7 +3189,7 @@ floatx80 floatx80_sqrt( floatx80 a )
3197 if ( aSign ) { 3189 if ( aSign ) {
3198 if ( ( aExp | aSig0 ) == 0 ) return a; 3190 if ( ( aExp | aSig0 ) == 0 ) return a;
3199 invalid: 3191 invalid:
3200 float_raise( float_flag_invalid ); 3192 roundData->exception |= float_flag_invalid;
3201 z.low = floatx80_default_nan_low; 3193 z.low = floatx80_default_nan_low;
3202 z.high = floatx80_default_nan_high; 3194 z.high = floatx80_default_nan_high;
3203 return z; 3195 return z;
@@ -3242,7 +3234,7 @@ floatx80 floatx80_sqrt( floatx80 a )
3242 } 3234 }
3243 return 3235 return
3244 roundAndPackFloatx80( 3236 roundAndPackFloatx80(
3245 floatx80_rounding_precision, 0, zExp, zSig0, zSig1 ); 3237 roundData, 0, zExp, zSig0, zSig1 );
3246 3238
3247} 3239}
3248 3240
@@ -3264,7 +3256,7 @@ flag floatx80_eq( floatx80 a, floatx80 b )
3264 ) { 3256 ) {
3265 if ( floatx80_is_signaling_nan( a ) 3257 if ( floatx80_is_signaling_nan( a )
3266 || floatx80_is_signaling_nan( b ) ) { 3258 || floatx80_is_signaling_nan( b ) ) {
3267 float_raise( float_flag_invalid ); 3259 roundData->exception |= float_flag_invalid;
3268 } 3260 }
3269 return 0; 3261 return 0;
3270 } 3262 }
@@ -3294,7 +3286,7 @@ flag floatx80_le( floatx80 a, floatx80 b )
3294 || ( ( extractFloatx80Exp( b ) == 0x7FFF ) 3286 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3295 && (bits64) ( extractFloatx80Frac( b )<<1 ) ) 3287 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3296 ) { 3288 ) {
3297 float_raise( float_flag_invalid ); 3289 roundData->exception |= float_flag_invalid;
3298 return 0; 3290 return 0;
3299 } 3291 }
3300 aSign = extractFloatx80Sign( a ); 3292 aSign = extractFloatx80Sign( a );
@@ -3328,7 +3320,7 @@ flag floatx80_lt( floatx80 a, floatx80 b )
3328 || ( ( extractFloatx80Exp( b ) == 0x7FFF ) 3320 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3329 && (bits64) ( extractFloatx80Frac( b )<<1 ) ) 3321 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3330 ) { 3322 ) {
3331 float_raise( float_flag_invalid ); 3323 roundData->exception |= float_flag_invalid;
3332 return 0; 3324 return 0;
3333 } 3325 }
3334 aSign = extractFloatx80Sign( a ); 3326 aSign = extractFloatx80Sign( a );
@@ -3361,7 +3353,7 @@ flag floatx80_eq_signaling( floatx80 a, floatx80 b )
3361 || ( ( extractFloatx80Exp( b ) == 0x7FFF ) 3353 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3362 && (bits64) ( extractFloatx80Frac( b )<<1 ) ) 3354 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3363 ) { 3355 ) {
3364 float_raise( float_flag_invalid ); 3356 roundData->exception |= float_flag_invalid;
3365 return 0; 3357 return 0;
3366 } 3358 }
3367 return 3359 return
@@ -3392,7 +3384,7 @@ flag floatx80_le_quiet( floatx80 a, floatx80 b )
3392 ) { 3384 ) {
3393 if ( floatx80_is_signaling_nan( a ) 3385 if ( floatx80_is_signaling_nan( a )
3394 || floatx80_is_signaling_nan( b ) ) { 3386 || floatx80_is_signaling_nan( b ) ) {
3395 float_raise( float_flag_invalid ); 3387 roundData->exception |= float_flag_invalid;
3396 } 3388 }
3397 return 0; 3389 return 0;
3398 } 3390 }
@@ -3429,7 +3421,7 @@ flag floatx80_lt_quiet( floatx80 a, floatx80 b )
3429 ) { 3421 ) {
3430 if ( floatx80_is_signaling_nan( a ) 3422 if ( floatx80_is_signaling_nan( a )
3431 || floatx80_is_signaling_nan( b ) ) { 3423 || floatx80_is_signaling_nan( b ) ) {
3432 float_raise( float_flag_invalid ); 3424 roundData->exception |= float_flag_invalid;
3433 } 3425 }
3434 return 0; 3426 return 0;
3435 } 3427 }
diff --git a/arch/arm/nwfpe/softfloat.h b/arch/arm/nwfpe/softfloat.h
index 1e1743173899..1c8799b9ee4d 100644
--- a/arch/arm/nwfpe/softfloat.h
+++ b/arch/arm/nwfpe/softfloat.h
@@ -74,7 +74,7 @@ enum {
74Software IEC/IEEE floating-point rounding mode. 74Software IEC/IEEE floating-point rounding mode.
75------------------------------------------------------------------------------- 75-------------------------------------------------------------------------------
76*/ 76*/
77extern signed char float_rounding_mode; 77//extern int8 float_rounding_mode;
78enum { 78enum {
79 float_round_nearest_even = 0, 79 float_round_nearest_even = 0,
80 float_round_to_zero = 1, 80 float_round_to_zero = 1,
@@ -86,7 +86,6 @@ enum {
86------------------------------------------------------------------------------- 86-------------------------------------------------------------------------------
87Software IEC/IEEE floating-point exception flags. 87Software IEC/IEEE floating-point exception flags.
88------------------------------------------------------------------------------- 88-------------------------------------------------------------------------------
89extern signed char float_exception_flags;
90enum { 89enum {
91 float_flag_inexact = 1, 90 float_flag_inexact = 1,
92 float_flag_underflow = 2, 91 float_flag_underflow = 2,
@@ -99,7 +98,6 @@ ScottB: November 4, 1998
99Changed the enumeration to match the bit order in the FPA11. 98Changed the enumeration to match the bit order in the FPA11.
100*/ 99*/
101 100
102extern signed char float_exception_flags;
103enum { 101enum {
104 float_flag_invalid = 1, 102 float_flag_invalid = 1,
105 float_flag_divbyzero = 2, 103 float_flag_divbyzero = 2,
@@ -121,7 +119,7 @@ void float_raise( signed char );
121Software IEC/IEEE integer-to-floating-point conversion routines. 119Software IEC/IEEE integer-to-floating-point conversion routines.
122------------------------------------------------------------------------------- 120-------------------------------------------------------------------------------
123*/ 121*/
124float32 int32_to_float32( signed int ); 122float32 int32_to_float32( struct roundingData *, signed int );
125float64 int32_to_float64( signed int ); 123float64 int32_to_float64( signed int );
126#ifdef FLOATX80 124#ifdef FLOATX80
127floatx80 int32_to_floatx80( signed int ); 125floatx80 int32_to_floatx80( signed int );
@@ -132,7 +130,7 @@ floatx80 int32_to_floatx80( signed int );
132Software IEC/IEEE single-precision conversion routines. 130Software IEC/IEEE single-precision conversion routines.
133------------------------------------------------------------------------------- 131-------------------------------------------------------------------------------
134*/ 132*/
135signed int float32_to_int32( float32 ); 133signed int float32_to_int32( struct roundingData *, float32 );
136signed int float32_to_int32_round_to_zero( float32 ); 134signed int float32_to_int32_round_to_zero( float32 );
137float64 float32_to_float64( float32 ); 135float64 float32_to_float64( float32 );
138#ifdef FLOATX80 136#ifdef FLOATX80
@@ -144,13 +142,13 @@ floatx80 float32_to_floatx80( float32 );
144Software IEC/IEEE single-precision operations. 142Software IEC/IEEE single-precision operations.
145------------------------------------------------------------------------------- 143-------------------------------------------------------------------------------
146*/ 144*/
147float32 float32_round_to_int( float32 ); 145float32 float32_round_to_int( struct roundingData*, float32 );
148float32 float32_add( float32, float32 ); 146float32 float32_add( struct roundingData *, float32, float32 );
149float32 float32_sub( float32, float32 ); 147float32 float32_sub( struct roundingData *, float32, float32 );
150float32 float32_mul( float32, float32 ); 148float32 float32_mul( struct roundingData *, float32, float32 );
151float32 float32_div( float32, float32 ); 149float32 float32_div( struct roundingData *, float32, float32 );
152float32 float32_rem( float32, float32 ); 150float32 float32_rem( struct roundingData *, float32, float32 );
153float32 float32_sqrt( float32 ); 151float32 float32_sqrt( struct roundingData*, float32 );
154char float32_eq( float32, float32 ); 152char float32_eq( float32, float32 );
155char float32_le( float32, float32 ); 153char float32_le( float32, float32 );
156char float32_lt( float32, float32 ); 154char float32_lt( float32, float32 );
@@ -164,9 +162,9 @@ char float32_is_signaling_nan( float32 );
164Software IEC/IEEE double-precision conversion routines. 162Software IEC/IEEE double-precision conversion routines.
165------------------------------------------------------------------------------- 163-------------------------------------------------------------------------------
166*/ 164*/
167signed int float64_to_int32( float64 ); 165signed int float64_to_int32( struct roundingData *, float64 );
168signed int float64_to_int32_round_to_zero( float64 ); 166signed int float64_to_int32_round_to_zero( float64 );
169float32 float64_to_float32( float64 ); 167float32 float64_to_float32( struct roundingData *, float64 );
170#ifdef FLOATX80 168#ifdef FLOATX80
171floatx80 float64_to_floatx80( float64 ); 169floatx80 float64_to_floatx80( float64 );
172#endif 170#endif
@@ -176,13 +174,13 @@ floatx80 float64_to_floatx80( float64 );
176Software IEC/IEEE double-precision operations. 174Software IEC/IEEE double-precision operations.
177------------------------------------------------------------------------------- 175-------------------------------------------------------------------------------
178*/ 176*/
179float64 float64_round_to_int( float64 ); 177float64 float64_round_to_int( struct roundingData *, float64 );
180float64 float64_add( float64, float64 ); 178float64 float64_add( struct roundingData *, float64, float64 );
181float64 float64_sub( float64, float64 ); 179float64 float64_sub( struct roundingData *, float64, float64 );
182float64 float64_mul( float64, float64 ); 180float64 float64_mul( struct roundingData *, float64, float64 );
183float64 float64_div( float64, float64 ); 181float64 float64_div( struct roundingData *, float64, float64 );
184float64 float64_rem( float64, float64 ); 182float64 float64_rem( struct roundingData *, float64, float64 );
185float64 float64_sqrt( float64 ); 183float64 float64_sqrt( struct roundingData *, float64 );
186char float64_eq( float64, float64 ); 184char float64_eq( float64, float64 );
187char float64_le( float64, float64 ); 185char float64_le( float64, float64 );
188char float64_lt( float64, float64 ); 186char float64_lt( float64, float64 );
@@ -198,31 +196,23 @@ char float64_is_signaling_nan( float64 );
198Software IEC/IEEE extended double-precision conversion routines. 196Software IEC/IEEE extended double-precision conversion routines.
199------------------------------------------------------------------------------- 197-------------------------------------------------------------------------------
200*/ 198*/
201signed int floatx80_to_int32( floatx80 ); 199signed int floatx80_to_int32( struct roundingData *, floatx80 );
202signed int floatx80_to_int32_round_to_zero( floatx80 ); 200signed int floatx80_to_int32_round_to_zero( floatx80 );
203float32 floatx80_to_float32( floatx80 ); 201float32 floatx80_to_float32( struct roundingData *, floatx80 );
204float64 floatx80_to_float64( floatx80 ); 202float64 floatx80_to_float64( struct roundingData *, floatx80 );
205
206/*
207-------------------------------------------------------------------------------
208Software IEC/IEEE extended double-precision rounding precision. Valid
209values are 32, 64, and 80.
210-------------------------------------------------------------------------------
211*/
212extern signed char floatx80_rounding_precision;
213 203
214/* 204/*
215------------------------------------------------------------------------------- 205-------------------------------------------------------------------------------
216Software IEC/IEEE extended double-precision operations. 206Software IEC/IEEE extended double-precision operations.
217------------------------------------------------------------------------------- 207-------------------------------------------------------------------------------
218*/ 208*/
219floatx80 floatx80_round_to_int( floatx80 ); 209floatx80 floatx80_round_to_int( struct roundingData *, floatx80 );
220floatx80 floatx80_add( floatx80, floatx80 ); 210floatx80 floatx80_add( struct roundingData *, floatx80, floatx80 );
221floatx80 floatx80_sub( floatx80, floatx80 ); 211floatx80 floatx80_sub( struct roundingData *, floatx80, floatx80 );
222floatx80 floatx80_mul( floatx80, floatx80 ); 212floatx80 floatx80_mul( struct roundingData *, floatx80, floatx80 );
223floatx80 floatx80_div( floatx80, floatx80 ); 213floatx80 floatx80_div( struct roundingData *, floatx80, floatx80 );
224floatx80 floatx80_rem( floatx80, floatx80 ); 214floatx80 floatx80_rem( struct roundingData *, floatx80, floatx80 );
225floatx80 floatx80_sqrt( floatx80 ); 215floatx80 floatx80_sqrt( struct roundingData *, floatx80 );
226char floatx80_eq( floatx80, floatx80 ); 216char floatx80_eq( floatx80, floatx80 );
227char floatx80_le( floatx80, floatx80 ); 217char floatx80_le( floatx80, floatx80 );
228char floatx80_lt( floatx80, floatx80 ); 218char floatx80_lt( floatx80, floatx80 );
diff --git a/arch/arm/oprofile/backtrace.c b/arch/arm/oprofile/backtrace.c
index ec58d3e2eb8b..df35c452a8bf 100644
--- a/arch/arm/oprofile/backtrace.c
+++ b/arch/arm/oprofile/backtrace.c
@@ -115,7 +115,7 @@ static int valid_kernel_stack(struct frame_tail *tail, struct pt_regs *regs)
115 return (tailaddr > stack) && (tailaddr < stack_base); 115 return (tailaddr > stack) && (tailaddr < stack_base);
116} 116}
117 117
118void arm_backtrace(struct pt_regs const *regs, unsigned int depth) 118void arm_backtrace(struct pt_regs * const regs, unsigned int depth)
119{ 119{
120 struct frame_tail *tail; 120 struct frame_tail *tail;
121 unsigned long last_address = 0; 121 unsigned long last_address = 0;
diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c
index b801cd66b6ea..9b367a65cb4d 100644
--- a/arch/arm/vfp/vfpdouble.c
+++ b/arch/arm/vfp/vfpdouble.c
@@ -770,6 +770,9 @@ vfp_double_add(struct vfp_double *vdd, struct vfp_double *vdn,
770 if ((s64)m_sig < 0) { 770 if ((s64)m_sig < 0) {
771 vdd->sign = vfp_sign_negate(vdd->sign); 771 vdd->sign = vfp_sign_negate(vdd->sign);
772 m_sig = -m_sig; 772 m_sig = -m_sig;
773 } else if (m_sig == 0) {
774 vdd->sign = (fpscr & FPSCR_RMODE_MASK) ==
775 FPSCR_ROUND_MINUSINF ? 0x8000 : 0;
773 } 776 }
774 } else { 777 } else {
775 m_sig += vdn->significand; 778 m_sig += vdn->significand;
diff --git a/arch/arm26/mm/fault.c b/arch/arm26/mm/fault.c
index dacca8bb7744..bd6f2db608b7 100644
--- a/arch/arm26/mm/fault.c
+++ b/arch/arm26/mm/fault.c
@@ -176,12 +176,12 @@ survive:
176 * Handle the "normal" cases first - successful and sigbus 176 * Handle the "normal" cases first - successful and sigbus
177 */ 177 */
178 switch (fault) { 178 switch (fault) {
179 case 2: 179 case VM_FAULT_MAJOR:
180 tsk->maj_flt++; 180 tsk->maj_flt++;
181 return fault; 181 return fault;
182 case 1: 182 case VM_FAULT_MINOR:
183 tsk->min_flt++; 183 tsk->min_flt++;
184 case 0: 184 case VM_FAULT_SIGBUS:
185 return fault; 185 return fault;
186 } 186 }
187 187
@@ -226,14 +226,11 @@ int do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
226 /* 226 /*
227 * Handle the "normal" case first 227 * Handle the "normal" case first
228 */ 228 */
229 if (fault > 0) 229 switch (fault) {
230 case VM_FAULT_MINOR:
231 case VM_FAULT_MAJOR:
230 return 0; 232 return 0;
231 233 case VM_FAULT_SIGBUS:
232 /*
233 * We had some memory, but were unable to
234 * successfully fix up this page fault.
235 */
236 if (fault == 0){
237 goto do_sigbus; 234 goto do_sigbus;
238 } 235 }
239 236
diff --git a/arch/cris/mm/fault.c b/arch/cris/mm/fault.c
index fe1cc36b5aca..934c51078cce 100644
--- a/arch/cris/mm/fault.c
+++ b/arch/cris/mm/fault.c
@@ -284,13 +284,13 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
284 */ 284 */
285 285
286 switch (handle_mm_fault(mm, vma, address, writeaccess & 1)) { 286 switch (handle_mm_fault(mm, vma, address, writeaccess & 1)) {
287 case 1: 287 case VM_FAULT_MINOR:
288 tsk->min_flt++; 288 tsk->min_flt++;
289 break; 289 break;
290 case 2: 290 case VM_FAULT_MAJOR:
291 tsk->maj_flt++; 291 tsk->maj_flt++;
292 break; 292 break;
293 case 0: 293 case VM_FAULT_SIGBUS:
294 goto do_sigbus; 294 goto do_sigbus;
295 default: 295 default:
296 goto out_of_memory; 296 goto out_of_memory;
diff --git a/arch/frv/mm/fault.c b/arch/frv/mm/fault.c
index 41d02ac48233..8b3eb50c5105 100644
--- a/arch/frv/mm/fault.c
+++ b/arch/frv/mm/fault.c
@@ -163,13 +163,13 @@ asmlinkage void do_page_fault(int datammu, unsigned long esr0, unsigned long ear
163 * the fault. 163 * the fault.
164 */ 164 */
165 switch (handle_mm_fault(mm, vma, ear0, write)) { 165 switch (handle_mm_fault(mm, vma, ear0, write)) {
166 case 1: 166 case VM_FAULT_MINOR:
167 current->min_flt++; 167 current->min_flt++;
168 break; 168 break;
169 case 2: 169 case VM_FAULT_MAJOR:
170 current->maj_flt++; 170 current->maj_flt++;
171 break; 171 break;
172 case 0: 172 case VM_FAULT_SIGBUS:
173 goto do_sigbus; 173 goto do_sigbus;
174 default: 174 default:
175 goto out_of_memory; 175 goto out_of_memory;
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index a801d9d48606..619d843ba231 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -454,8 +454,9 @@ config HPET_TIMER
454 Choose N to continue using the legacy 8254 timer. 454 Choose N to continue using the legacy 8254 timer.
455 455
456config HPET_EMULATE_RTC 456config HPET_EMULATE_RTC
457 bool "Provide RTC interrupt" 457 bool
458 depends on HPET_TIMER && RTC=y 458 depends on HPET_TIMER && RTC=y
459 default y
459 460
460config SMP 461config SMP
461 bool "Symmetric multi-processing support" 462 bool "Symmetric multi-processing support"
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index 963e17aa205d..60a9e54dd20e 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -442,6 +442,13 @@ acpi_cpufreq_cpu_init (
442 (u32) data->acpi_data.states[i].transition_latency); 442 (u32) data->acpi_data.states[i].transition_latency);
443 443
444 cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu); 444 cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu);
445
446 /*
447 * the first call to ->target() should result in us actually
448 * writing something to the appropriate registers.
449 */
450 data->resume = 1;
451
445 return (result); 452 return (result);
446 453
447 err_freqfree: 454 err_freqfree:
diff --git a/arch/i386/kernel/cpu/transmeta.c b/arch/i386/kernel/cpu/transmeta.c
index f57e5ee94943..fc426380366b 100644
--- a/arch/i386/kernel/cpu/transmeta.c
+++ b/arch/i386/kernel/cpu/transmeta.c
@@ -76,6 +76,12 @@ static void __init init_transmeta(struct cpuinfo_x86 *c)
76#define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV) 76#define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV)
77 if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 ) 77 if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 )
78 c->x86 = 6; 78 c->x86 = 6;
79
80#ifdef CONFIG_SYSCTL
81 /* randomize_va_space slows us down enormously;
82 it probably triggers retranslation of x86->native bytecode */
83 randomize_va_space = 0;
84#endif
79} 85}
80 86
81static void transmeta_identify(struct cpuinfo_x86 * c) 87static void transmeta_identify(struct cpuinfo_x86 * c)
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
index 468500a7e894..9b21a31d4f4e 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -251,7 +251,7 @@ ENTRY(sys_call_table)
251 .long sys_io_submit 251 .long sys_io_submit
252 .long sys_io_cancel 252 .long sys_io_cancel
253 .long sys_fadvise64 /* 250 */ 253 .long sys_fadvise64 /* 250 */
254 .long sys_set_zone_reclaim 254 .long sys_ni_syscall
255 .long sys_exit_group 255 .long sys_exit_group
256 .long sys_lookup_dcookie 256 .long sys_lookup_dcookie
257 .long sys_epoll_create 257 .long sys_epoll_create
diff --git a/arch/i386/mach-visws/reboot.c b/arch/i386/mach-visws/reboot.c
index 9e9296676f93..5d73e042ed0a 100644
--- a/arch/i386/mach-visws/reboot.c
+++ b/arch/i386/mach-visws/reboot.c
@@ -9,12 +9,15 @@
9void (*pm_power_off)(void); 9void (*pm_power_off)(void);
10EXPORT_SYMBOL(pm_power_off); 10EXPORT_SYMBOL(pm_power_off);
11 11
12void machine_restart(char * __unused) 12void machine_shutdown(void)
13{ 13{
14#ifdef CONFIG_SMP 14#ifdef CONFIG_SMP
15 smp_send_stop(); 15 smp_send_stop();
16#endif 16#endif
17}
17 18
19void machine_emergency_restart(void)
20{
18 /* 21 /*
19 * Visual Workstations restart after this 22 * Visual Workstations restart after this
20 * register is poked on the PIIX4 23 * register is poked on the PIIX4
@@ -22,6 +25,12 @@ void machine_restart(char * __unused)
22 outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT); 25 outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT);
23} 26}
24 27
28void machine_restart(char * __unused)
29{
30 machine_shutdown();
31 machine_emergency_restart();
32}
33
25void machine_power_off(void) 34void machine_power_off(void)
26{ 35{
27 unsigned short pm_status; 36 unsigned short pm_status;
diff --git a/arch/i386/mach-visws/setup.c b/arch/i386/mach-visws/setup.c
index 9f6d2d9b1be7..26ada6fc0d77 100644
--- a/arch/i386/mach-visws/setup.c
+++ b/arch/i386/mach-visws/setup.c
@@ -14,6 +14,8 @@
14#include "cobalt.h" 14#include "cobalt.h"
15#include "piix4.h" 15#include "piix4.h"
16 16
17int no_broadcast;
18
17char visws_board_type = -1; 19char visws_board_type = -1;
18char visws_board_rev = -1; 20char visws_board_rev = -1;
19 21
diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c
index b3eda46e0fe9..c6384061328a 100644
--- a/arch/i386/mach-voyager/voyager_basic.c
+++ b/arch/i386/mach-voyager/voyager_basic.c
@@ -252,6 +252,12 @@ kb_wait(void)
252} 252}
253 253
254void 254void
255machine_shutdown(void)
256{
257 /* Architecture specific shutdown needed before a kexec */
258}
259
260void
255machine_restart(char *cmd) 261machine_restart(char *cmd)
256{ 262{
257 printk("Voyager Warm Restart\n"); 263 printk("Voyager Warm Restart\n");
@@ -279,6 +285,13 @@ machine_restart(char *cmd)
279} 285}
280 286
281void 287void
288machine_emergency_restart(void)
289{
290 /*for now, just hook this to a warm restart */
291 machine_restart(NULL);
292}
293
294void
282mca_nmi_hook(void) 295mca_nmi_hook(void)
283{ 296{
284 __u8 dumpval __attribute__((unused)) = inb(0xf823); 297 __u8 dumpval __attribute__((unused)) = inb(0xf823);
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c
index c369a8bf7cbe..6711ce3f6916 100644
--- a/arch/i386/mm/discontig.c
+++ b/arch/i386/mm/discontig.c
@@ -243,14 +243,6 @@ static unsigned long calculate_numa_remap_pages(void)
243 /* now the roundup is correct, convert to PAGE_SIZE pages */ 243 /* now the roundup is correct, convert to PAGE_SIZE pages */
244 size = size * PTRS_PER_PTE; 244 size = size * PTRS_PER_PTE;
245 245
246 if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) {
247 /*
248 * Adjust size if node_end_pfn is not on a proper
249 * pmd boundary. remap_numa_kva will barf otherwise.
250 */
251 size += node_end_pfn[nid] & (PTRS_PER_PTE-1);
252 }
253
254 /* 246 /*
255 * Validate the region we are allocating only contains valid 247 * Validate the region we are allocating only contains valid
256 * pages. 248 * pages.
@@ -270,6 +262,17 @@ static unsigned long calculate_numa_remap_pages(void)
270 reserve_pages += size; 262 reserve_pages += size;
271 printk("Shrinking node %d from %ld pages to %ld pages\n", 263 printk("Shrinking node %d from %ld pages to %ld pages\n",
272 nid, node_end_pfn[nid], node_end_pfn[nid] - size); 264 nid, node_end_pfn[nid], node_end_pfn[nid] - size);
265
266 if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) {
267 /*
268 * Align node_end_pfn[] and node_remap_start_pfn[] to
269 * pmd boundary. remap_numa_kva will barf otherwise.
270 */
271 printk("Shrinking node %d further by %ld pages for proper alignment\n",
272 nid, node_end_pfn[nid] & (PTRS_PER_PTE-1));
273 size += node_end_pfn[nid] & (PTRS_PER_PTE-1);
274 }
275
273 node_end_pfn[nid] -= size; 276 node_end_pfn[nid] -= size;
274 node_remap_start_pfn[nid] = node_end_pfn[nid]; 277 node_remap_start_pfn[nid] = node_end_pfn[nid];
275 } 278 }
diff --git a/arch/i386/pci/acpi.c b/arch/i386/pci/acpi.c
index 2db65ec45dc3..42913f43feb0 100644
--- a/arch/i386/pci/acpi.c
+++ b/arch/i386/pci/acpi.c
@@ -30,6 +30,7 @@ static int __init pci_acpi_init(void)
30 acpi_irq_penalty_init(); 30 acpi_irq_penalty_init();
31 pcibios_scanned++; 31 pcibios_scanned++;
32 pcibios_enable_irq = acpi_pci_irq_enable; 32 pcibios_enable_irq = acpi_pci_irq_enable;
33 pcibios_disable_irq = acpi_pci_irq_disable;
33 34
34 if (pci_routeirq) { 35 if (pci_routeirq) {
35 /* 36 /*
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c
index 70bcd53451f6..ade5bc57c34c 100644
--- a/arch/i386/pci/common.c
+++ b/arch/i386/pci/common.c
@@ -254,3 +254,9 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
254 254
255 return pcibios_enable_irq(dev); 255 return pcibios_enable_irq(dev);
256} 256}
257
258void pcibios_disable_device (struct pci_dev *dev)
259{
260 if (pcibios_disable_irq)
261 pcibios_disable_irq(dev);
262}
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index d291fb7f1357..86348b68fda1 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -56,6 +56,7 @@ struct irq_router_handler {
56}; 56};
57 57
58int (*pcibios_enable_irq)(struct pci_dev *dev) = NULL; 58int (*pcibios_enable_irq)(struct pci_dev *dev) = NULL;
59void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL;
59 60
60/* 61/*
61 * Check passed address for the PCI IRQ Routing Table signature 62 * Check passed address for the PCI IRQ Routing Table signature
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h
index a80f0f55ff51..127d53ad16be 100644
--- a/arch/i386/pci/pci.h
+++ b/arch/i386/pci/pci.h
@@ -73,3 +73,4 @@ extern int pcibios_scanned;
73extern spinlock_t pci_config_lock; 73extern spinlock_t pci_config_lock;
74 74
75extern int (*pcibios_enable_irq)(struct pci_dev *dev); 75extern int (*pcibios_enable_irq)(struct pci_dev *dev);
76extern void (*pcibios_disable_irq)(struct pci_dev *dev);
diff --git a/arch/i386/pci/visws.c b/arch/i386/pci/visws.c
index 314c933b6b8e..6c17433fdf7d 100644
--- a/arch/i386/pci/visws.c
+++ b/arch/i386/pci/visws.c
@@ -18,8 +18,10 @@
18extern struct pci_raw_ops pci_direct_conf1; 18extern struct pci_raw_ops pci_direct_conf1;
19 19
20static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; } 20static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; }
21static void pci_visws_disable_irq(struct pci_dev *dev) { }
21 22
22int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; 23int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq;
24void (*pcibios_disable_irq)(struct pci_dev *dev) = &pci_visws_disable_irq;
23 25
24void __init pcibios_penalize_isa_irq(int irq, int active) {} 26void __init pcibios_penalize_isa_irq(int irq, int active) {}
25 27
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 66946f3fdac7..9be53e1ea404 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1573,7 +1573,7 @@ sys_call_table:
1573 data8 sys_keyctl 1573 data8 sys_keyctl
1574 data8 sys_ioprio_set 1574 data8 sys_ioprio_set
1575 data8 sys_ioprio_get // 1275 1575 data8 sys_ioprio_get // 1275
1576 data8 sys_set_zone_reclaim 1576 data8 sys_ni_syscall
1577 data8 sys_inotify_init 1577 data8 sys_inotify_init
1578 data8 sys_inotify_add_watch 1578 data8 sys_inotify_add_watch
1579 data8 sys_inotify_rm_watch 1579 data8 sys_inotify_rm_watch
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index 66e840609808..051e050359e4 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -179,7 +179,7 @@ static int can_do_pal_halt = 1;
179 179
180static int __init nohalt_setup(char * str) 180static int __init nohalt_setup(char * str)
181{ 181{
182 pal_halt = 0; 182 pal_halt = can_do_pal_halt = 0;
183 return 1; 183 return 1;
184} 184}
185__setup("nohalt", nohalt_setup); 185__setup("nohalt", nohalt_setup);
diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c
index 3c4707280a52..8a2b77bc5749 100644
--- a/arch/m32r/kernel/time.c
+++ b/arch/m32r/kernel/time.c
@@ -205,8 +205,7 @@ static long last_rtc_update = 0;
205 * timer_interrupt() needs to keep up the real-time clock, 205 * timer_interrupt() needs to keep up the real-time clock,
206 * as well as call the "do_timer()" routine every clocktick 206 * as well as call the "do_timer()" routine every clocktick
207 */ 207 */
208static inline void 208irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
209do_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
210{ 209{
211#ifndef CONFIG_SMP 210#ifndef CONFIG_SMP
212 profile_tick(CPU_PROFILING, regs); 211 profile_tick(CPU_PROFILING, regs);
@@ -221,6 +220,7 @@ do_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
221 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be 220 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
222 * called as close as possible to 500 ms before the new second starts. 221 * called as close as possible to 500 ms before the new second starts.
223 */ 222 */
223 write_seqlock(&xtime_lock);
224 if ((time_status & STA_UNSYNC) == 0 224 if ((time_status & STA_UNSYNC) == 0
225 && xtime.tv_sec > last_rtc_update + 660 225 && xtime.tv_sec > last_rtc_update + 660
226 && (xtime.tv_nsec / 1000) >= 500000 - ((unsigned)TICK_SIZE) / 2 226 && (xtime.tv_nsec / 1000) >= 500000 - ((unsigned)TICK_SIZE) / 2
@@ -231,6 +231,7 @@ do_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
231 else /* do it again in 60 s */ 231 else /* do it again in 60 s */
232 last_rtc_update = xtime.tv_sec - 600; 232 last_rtc_update = xtime.tv_sec - 600;
233 } 233 }
234 write_sequnlock(&xtime_lock);
234 /* As we return to user mode fire off the other CPU schedulers.. 235 /* As we return to user mode fire off the other CPU schedulers..
235 this is basically because we don't yet share IRQ's around. 236 this is basically because we don't yet share IRQ's around.
236 This message is rigged to be safe on the 386 - basically it's 237 This message is rigged to be safe on the 386 - basically it's
@@ -238,14 +239,8 @@ do_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
238 239
239#ifdef CONFIG_SMP 240#ifdef CONFIG_SMP
240 smp_local_timer_interrupt(regs); 241 smp_local_timer_interrupt(regs);
242 smp_send_timer();
241#endif 243#endif
242}
243
244irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
245{
246 write_seqlock(&xtime_lock);
247 do_timer_interrupt(irq, NULL, regs);
248 write_sequnlock(&xtime_lock);
249 244
250 return IRQ_HANDLED; 245 return IRQ_HANDLED;
251} 246}
diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c
index ac48b6d2aff6..aec15270d334 100644
--- a/arch/m68k/mm/fault.c
+++ b/arch/m68k/mm/fault.c
@@ -160,13 +160,13 @@ good_area:
160 printk("handle_mm_fault returns %d\n",fault); 160 printk("handle_mm_fault returns %d\n",fault);
161#endif 161#endif
162 switch (fault) { 162 switch (fault) {
163 case 1: 163 case VM_FAULT_MINOR:
164 current->min_flt++; 164 current->min_flt++;
165 break; 165 break;
166 case 2: 166 case VM_FAULT_MAJOR:
167 current->maj_flt++; 167 current->maj_flt++;
168 break; 168 break;
169 case 0: 169 case VM_FAULT_SIGBUS:
170 goto bus_err; 170 goto bus_err;
171 default: 171 default:
172 goto out_of_memory; 172 goto out_of_memory;
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index eaa701479f5f..0ad945d4c0a4 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -178,17 +178,17 @@ good_area:
178 */ 178 */
179 179
180 switch (handle_mm_fault(mm, vma, address, (acc_type & VM_WRITE) != 0)) { 180 switch (handle_mm_fault(mm, vma, address, (acc_type & VM_WRITE) != 0)) {
181 case 1: 181 case VM_FAULT_MINOR:
182 ++current->min_flt; 182 ++current->min_flt;
183 break; 183 break;
184 case 2: 184 case VM_FAULT_MAJOR:
185 ++current->maj_flt; 185 ++current->maj_flt;
186 break; 186 break;
187 case 0: 187 case VM_FAULT_SIGBUS:
188 /* 188 /*
189 * We ran out of memory, or some other thing happened 189 * We hit a hared mapping outside of the file, or some
190 * to us that made us unable to handle the page fault 190 * other thing happened to us that made us unable to
191 * gracefully. 191 * handle the page fault gracefully.
192 */ 192 */
193 goto bad_area; 193 goto bad_area;
194 default: 194 default:
diff --git a/arch/ppc/8xx_io/Kconfig b/arch/ppc/8xx_io/Kconfig
index 9e2227ec3b34..57dacf978532 100644
--- a/arch/ppc/8xx_io/Kconfig
+++ b/arch/ppc/8xx_io/Kconfig
@@ -69,9 +69,9 @@ config FEC_QS6612
69 69
70config ENET_BIG_BUFFERS 70config ENET_BIG_BUFFERS
71 bool "Use Big CPM Ethernet Buffers" 71 bool "Use Big CPM Ethernet Buffers"
72 depends on NET_ETHERNET 72 depends on SCC_ENET || FEC_ENET
73 help 73 help
74 Allocate large buffers for MPC8xx Etherenet. Increases throughput 74 Allocate large buffers for MPC8xx Ethernet. Increases throughput
75 and decreases the likelihood of dropped packets, but costs memory. 75 and decreases the likelihood of dropped packets, but costs memory.
76 76
77config HTDMSOUND 77config HTDMSOUND
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 0cc2e7a9cb11..11726e2a4ec8 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -39,8 +39,6 @@
39#include <asm/tlbflush.h> 39#include <asm/tlbflush.h>
40#include <asm/rheap.h> 40#include <asm/rheap.h>
41 41
42extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep);
43
44static void m8xx_cpm_dpinit(void); 42static void m8xx_cpm_dpinit(void);
45static uint host_buffer; /* One page of host buffer */ 43static uint host_buffer; /* One page of host buffer */
46static uint host_end; /* end + 1 */ 44static uint host_end; /* end + 1 */
@@ -108,14 +106,11 @@ struct hw_interrupt_type cpm_pic = {
108 .end = cpm_eoi, 106 .end = cpm_eoi,
109}; 107};
110 108
111extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
112
113void 109void
114m8xx_cpm_reset(uint bootpage) 110m8xx_cpm_reset(void)
115{ 111{
116 volatile immap_t *imp; 112 volatile immap_t *imp;
117 volatile cpm8xx_t *commproc; 113 volatile cpm8xx_t *commproc;
118 pte_t *pte;
119 114
120 imp = (immap_t *)IMAP_ADDR; 115 imp = (immap_t *)IMAP_ADDR;
121 commproc = (cpm8xx_t *)&imp->im_cpm; 116 commproc = (cpm8xx_t *)&imp->im_cpm;
@@ -143,17 +138,6 @@ m8xx_cpm_reset(uint bootpage)
143 /* Reclaim the DP memory for our use. */ 138 /* Reclaim the DP memory for our use. */
144 m8xx_cpm_dpinit(); 139 m8xx_cpm_dpinit();
145 140
146 /* get the PTE for the bootpage */
147 if (!get_pteptr(&init_mm, bootpage, &pte))
148 panic("get_pteptr failed\n");
149
150 /* and make it uncachable */
151 pte_val(*pte) |= _PAGE_NO_CACHE;
152 _tlbie(bootpage);
153
154 host_buffer = bootpage;
155 host_end = host_buffer + PAGE_SIZE;
156
157 /* Tell everyone where the comm processor resides. 141 /* Tell everyone where the comm processor resides.
158 */ 142 */
159 cpmp = (cpm8xx_t *)commproc; 143 cpmp = (cpm8xx_t *)commproc;
@@ -384,8 +368,6 @@ static rh_info_t cpm_dpmem_info;
384 368
385void m8xx_cpm_dpinit(void) 369void m8xx_cpm_dpinit(void)
386{ 370{
387 cpm8xx_t *cp = &((immap_t *)IMAP_ADDR)->im_cpm;
388
389 spin_lock_init(&cpm_dpmem_lock); 371 spin_lock_init(&cpm_dpmem_lock);
390 372
391 /* Initialize the info header */ 373 /* Initialize the info header */
diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c
index 0730392dcc20..62f68d6181c6 100644
--- a/arch/ppc/8xx_io/fec.c
+++ b/arch/ppc/8xx_io/fec.c
@@ -173,7 +173,7 @@ struct fec_enet_private {
173 uint phy_status; 173 uint phy_status;
174 uint phy_speed; 174 uint phy_speed;
175 phy_info_t *phy; 175 phy_info_t *phy;
176 struct tq_struct phy_task; 176 struct work_struct phy_task;
177 177
178 uint sequence_done; 178 uint sequence_done;
179 179
@@ -199,7 +199,8 @@ static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev);
199#ifdef CONFIG_USE_MDIO 199#ifdef CONFIG_USE_MDIO
200static void fec_enet_mii(struct net_device *dev); 200static void fec_enet_mii(struct net_device *dev);
201#endif /* CONFIG_USE_MDIO */ 201#endif /* CONFIG_USE_MDIO */
202static void fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs); 202static irqreturn_t fec_enet_interrupt(int irq, void * dev_id,
203 struct pt_regs * regs);
203#ifdef CONFIG_FEC_PACKETHOOK 204#ifdef CONFIG_FEC_PACKETHOOK
204static void fec_enet_tx(struct net_device *dev, __u32 regval); 205static void fec_enet_tx(struct net_device *dev, __u32 regval);
205static void fec_enet_rx(struct net_device *dev, __u32 regval); 206static void fec_enet_rx(struct net_device *dev, __u32 regval);
@@ -471,7 +472,7 @@ fec_timeout(struct net_device *dev)
471/* The interrupt handler. 472/* The interrupt handler.
472 * This is called from the MPC core interrupt. 473 * This is called from the MPC core interrupt.
473 */ 474 */
474static void 475static irqreturn_t
475fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs) 476fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs)
476{ 477{
477 struct net_device *dev = dev_id; 478 struct net_device *dev = dev_id;
@@ -525,6 +526,7 @@ printk("%s[%d] %s: unexpected FEC_ENET_MII event\n", __FILE__,__LINE__,__FUNCTIO
525 } 526 }
526 527
527 } 528 }
529 return IRQ_RETVAL(IRQ_HANDLED);
528} 530}
529 531
530 532
@@ -1263,8 +1265,9 @@ static void mii_display_status(struct net_device *dev)
1263 printk(".\n"); 1265 printk(".\n");
1264} 1266}
1265 1267
1266static void mii_display_config(struct net_device *dev) 1268static void mii_display_config(void *priv)
1267{ 1269{
1270 struct net_device *dev = (struct net_device *)priv;
1268 struct fec_enet_private *fep = dev->priv; 1271 struct fec_enet_private *fep = dev->priv;
1269 volatile uint *s = &(fep->phy_status); 1272 volatile uint *s = &(fep->phy_status);
1270 1273
@@ -1294,8 +1297,9 @@ static void mii_display_config(struct net_device *dev)
1294 fep->sequence_done = 1; 1297 fep->sequence_done = 1;
1295} 1298}
1296 1299
1297static void mii_relink(struct net_device *dev) 1300static void mii_relink(void *priv)
1298{ 1301{
1302 struct net_device *dev = (struct net_device *)priv;
1299 struct fec_enet_private *fep = dev->priv; 1303 struct fec_enet_private *fep = dev->priv;
1300 int duplex; 1304 int duplex;
1301 1305
@@ -1323,18 +1327,16 @@ static void mii_queue_relink(uint mii_reg, struct net_device *dev)
1323{ 1327{
1324 struct fec_enet_private *fep = dev->priv; 1328 struct fec_enet_private *fep = dev->priv;
1325 1329
1326 fep->phy_task.routine = (void *)mii_relink; 1330 INIT_WORK(&fep->phy_task, mii_relink, (void *)dev);
1327 fep->phy_task.data = dev; 1331 schedule_work(&fep->phy_task);
1328 schedule_task(&fep->phy_task);
1329} 1332}
1330 1333
1331static void mii_queue_config(uint mii_reg, struct net_device *dev) 1334static void mii_queue_config(uint mii_reg, struct net_device *dev)
1332{ 1335{
1333 struct fec_enet_private *fep = dev->priv; 1336 struct fec_enet_private *fep = dev->priv;
1334 1337
1335 fep->phy_task.routine = (void *)mii_display_config; 1338 INIT_WORK(&fep->phy_task, mii_display_config, (void *)dev);
1336 fep->phy_task.data = dev; 1339 schedule_work(&fep->phy_task);
1337 schedule_task(&fep->phy_task);
1338} 1340}
1339 1341
1340 1342
@@ -1403,11 +1405,11 @@ mii_discover_phy(uint mii_reg, struct net_device *dev)
1403 1405
1404/* This interrupt occurs when the PHY detects a link change. 1406/* This interrupt occurs when the PHY detects a link change.
1405*/ 1407*/
1406static void 1408static
1407#ifdef CONFIG_RPXCLASSIC 1409#ifdef CONFIG_RPXCLASSIC
1408mii_link_interrupt(void *dev_id) 1410void mii_link_interrupt(void *dev_id)
1409#else 1411#else
1410mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) 1412irqreturn_t mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs)
1411#endif 1413#endif
1412{ 1414{
1413#ifdef CONFIG_USE_MDIO 1415#ifdef CONFIG_USE_MDIO
@@ -1440,6 +1442,9 @@ mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs)
1440printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__); 1442printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__);
1441#endif /* CONFIG_USE_MDIO */ 1443#endif /* CONFIG_USE_MDIO */
1442 1444
1445#ifndef CONFIG_RPXCLASSIC
1446 return IRQ_RETVAL(IRQ_HANDLED);
1447#endif /* CONFIG_RPXCLASSIC */
1443} 1448}
1444 1449
1445static int 1450static int
@@ -1575,7 +1580,7 @@ static int __init fec_enet_init(void)
1575 struct fec_enet_private *fep; 1580 struct fec_enet_private *fep;
1576 int i, j, k, err; 1581 int i, j, k, err;
1577 unsigned char *eap, *iap, *ba; 1582 unsigned char *eap, *iap, *ba;
1578 unsigned long mem_addr; 1583 dma_addr_t mem_addr;
1579 volatile cbd_t *bdp; 1584 volatile cbd_t *bdp;
1580 cbd_t *cbd_base; 1585 cbd_t *cbd_base;
1581 volatile immap_t *immap; 1586 volatile immap_t *immap;
@@ -1640,7 +1645,8 @@ static int __init fec_enet_init(void)
1640 printk("FEC initialization failed.\n"); 1645 printk("FEC initialization failed.\n");
1641 return 1; 1646 return 1;
1642 } 1647 }
1643 cbd_base = (cbd_t *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); 1648 cbd_base = (cbd_t *)dma_alloc_coherent(dev->class_dev.dev, PAGE_SIZE,
1649 &mem_addr, GFP_KERNEL);
1644 1650
1645 /* Set receive and transmit descriptor base. 1651 /* Set receive and transmit descriptor base.
1646 */ 1652 */
@@ -1657,7 +1663,10 @@ static int __init fec_enet_init(void)
1657 1663
1658 /* Allocate a page. 1664 /* Allocate a page.
1659 */ 1665 */
1660 ba = (unsigned char *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); 1666 ba = (unsigned char *)dma_alloc_coherent(dev->class_dev.dev,
1667 PAGE_SIZE,
1668 &mem_addr,
1669 GFP_KERNEL);
1661 /* BUG: no check for failure */ 1670 /* BUG: no check for failure */
1662 1671
1663 /* Initialize the BD for every fragment in the page. 1672 /* Initialize the BD for every fragment in the page.
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 2c2da9b43b7a..f6db3b385fea 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -558,6 +558,7 @@ config PPC_MULTIPLATFORM
558 558
559config APUS 559config APUS
560 bool "Amiga-APUS" 560 bool "Amiga-APUS"
561 depends on BROKEN
561 help 562 help
562 Select APUS if configuring for a PowerUP Amiga. 563 Select APUS if configuring for a PowerUP Amiga.
563 More information is available at: 564 More information is available at:
@@ -647,6 +648,7 @@ config PAL4
647 648
648config GEMINI 649config GEMINI
649 bool "Synergy-Gemini" 650 bool "Synergy-Gemini"
651 depends on BROKEN
650 help 652 help
651 Select Gemini if configuring for a Synergy Microsystems' Gemini 653 Select Gemini if configuring for a Synergy Microsystems' Gemini
652 series Single Board Computer. More information is available at: 654 series Single Board Computer. More information is available at:
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index 991b4cbb83c8..d4dc4fa79647 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -61,6 +61,12 @@ zimageinitrd-$(CONFIG_IBM_OPENBIOS) := zImage.initrd-TREE
61 end-$(CONFIG_EMBEDDEDBOOT) := embedded 61 end-$(CONFIG_EMBEDDEDBOOT) := embedded
62 misc-$(CONFIG_EMBEDDEDBOOT) := misc-embedded.o 62 misc-$(CONFIG_EMBEDDEDBOOT) := misc-embedded.o
63 63
64 zimage-$(CONFIG_BAMBOO) := zImage-TREE
65zimageinitrd-$(CONFIG_BAMBOO) := zImage.initrd-TREE
66 end-$(CONFIG_BAMBOO) := bamboo
67 entrypoint-$(CONFIG_BAMBOO) := 0x01000000
68 extra.o-$(CONFIG_BAMBOO) := pibs.o
69
64 zimage-$(CONFIG_EBONY) := zImage-TREE 70 zimage-$(CONFIG_EBONY) := zImage-TREE
65zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE 71zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE
66 end-$(CONFIG_EBONY) := ebony 72 end-$(CONFIG_EBONY) := ebony
diff --git a/arch/ppc/boot/simple/pibs.c b/arch/ppc/boot/simple/pibs.c
index 1348740e503f..67222d57c345 100644
--- a/arch/ppc/boot/simple/pibs.c
+++ b/arch/ppc/boot/simple/pibs.c
@@ -91,9 +91,11 @@ load_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
91 91
92 mac64 = simple_strtoull((char *)PIBS_MAC_BASE, 0, 16); 92 mac64 = simple_strtoull((char *)PIBS_MAC_BASE, 0, 16);
93 memcpy(hold_residual->bi_enetaddr, (char *)&mac64+2, 6); 93 memcpy(hold_residual->bi_enetaddr, (char *)&mac64+2, 6);
94#ifdef CONFIG_440GX 94#if defined(CONFIG_440GX) || defined(CONFIG_440EP)
95 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET), 0, 16); 95 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET), 0, 16);
96 memcpy(hold_residual->bi_enet1addr, (char *)&mac64+2, 6); 96 memcpy(hold_residual->bi_enet1addr, (char *)&mac64+2, 6);
97#endif
98#ifdef CONFIG_440GX
97 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*2), 0, 16); 99 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*2), 0, 16);
98 memcpy(hold_residual->bi_enet2addr, (char *)&mac64+2, 6); 100 memcpy(hold_residual->bi_enet2addr, (char *)&mac64+2, 6);
99 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*3), 0, 16); 101 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*3), 0, 16);
diff --git a/arch/ppc/configs/bamboo_defconfig b/arch/ppc/configs/bamboo_defconfig
new file mode 100644
index 000000000000..0ba4e70d50b6
--- /dev/null
+++ b/arch/ppc/configs/bamboo_defconfig
@@ -0,0 +1,943 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12
4# Tue Jun 28 15:24:25 2005
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y
12CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15
16#
17# Code maturity level options
18#
19CONFIG_EXPERIMENTAL=y
20CONFIG_CLEAN_COMPILE=y
21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
23
24#
25# General setup
26#
27CONFIG_LOCALVERSION=""
28CONFIG_SWAP=y
29CONFIG_SYSVIPC=y
30# CONFIG_POSIX_MQUEUE is not set
31# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y
33# CONFIG_AUDIT is not set
34# CONFIG_HOTPLUG is not set
35CONFIG_KOBJECT_UEVENT=y
36# CONFIG_IKCONFIG is not set
37CONFIG_EMBEDDED=y
38CONFIG_KALLSYMS=y
39# CONFIG_KALLSYMS_ALL is not set
40# CONFIG_KALLSYMS_EXTRA_PASS is not set
41CONFIG_PRINTK=y
42CONFIG_BUG=y
43CONFIG_BASE_FULL=y
44CONFIG_FUTEX=y
45CONFIG_EPOLL=y
46# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
47CONFIG_SHMEM=y
48CONFIG_CC_ALIGN_FUNCTIONS=0
49CONFIG_CC_ALIGN_LABELS=0
50CONFIG_CC_ALIGN_LOOPS=0
51CONFIG_CC_ALIGN_JUMPS=0
52# CONFIG_TINY_SHMEM is not set
53CONFIG_BASE_SMALL=0
54
55#
56# Loadable module support
57#
58CONFIG_MODULES=y
59CONFIG_MODULE_UNLOAD=y
60# CONFIG_MODULE_FORCE_UNLOAD is not set
61CONFIG_OBSOLETE_MODPARM=y
62# CONFIG_MODVERSIONS is not set
63# CONFIG_MODULE_SRCVERSION_ALL is not set
64CONFIG_KMOD=y
65
66#
67# Processor
68#
69# CONFIG_6xx is not set
70# CONFIG_40x is not set
71CONFIG_44x=y
72# CONFIG_POWER3 is not set
73# CONFIG_POWER4 is not set
74# CONFIG_8xx is not set
75# CONFIG_E200 is not set
76# CONFIG_E500 is not set
77CONFIG_PPC_FPU=y
78CONFIG_BOOKE=y
79CONFIG_PTE_64BIT=y
80CONFIG_PHYS_64BIT=y
81# CONFIG_MATH_EMULATION is not set
82# CONFIG_KEXEC is not set
83# CONFIG_CPU_FREQ is not set
84CONFIG_4xx=y
85
86#
87# IBM 4xx options
88#
89CONFIG_BAMBOO=y
90# CONFIG_EBONY is not set
91# CONFIG_LUAN is not set
92# CONFIG_OCOTEA is not set
93CONFIG_440EP=y
94CONFIG_440=y
95CONFIG_IBM440EP_ERR42=y
96CONFIG_IBM_OCP=y
97# CONFIG_PPC4xx_DMA is not set
98CONFIG_PPC_GEN550=y
99# CONFIG_PM is not set
100CONFIG_NOT_COHERENT_CACHE=y
101
102#
103# Platform options
104#
105# CONFIG_PC_KEYBOARD is not set
106# CONFIG_SMP is not set
107# CONFIG_PREEMPT is not set
108# CONFIG_HIGHMEM is not set
109CONFIG_SELECT_MEMORY_MODEL=y
110CONFIG_FLATMEM_MANUAL=y
111# CONFIG_DISCONTIGMEM_MANUAL is not set
112# CONFIG_SPARSEMEM_MANUAL is not set
113CONFIG_FLATMEM=y
114CONFIG_FLAT_NODE_MEM_MAP=y
115CONFIG_BINFMT_ELF=y
116# CONFIG_BINFMT_MISC is not set
117CONFIG_CMDLINE_BOOL=y
118CONFIG_CMDLINE="ip=on"
119CONFIG_SECCOMP=y
120CONFIG_ISA_DMA_API=y
121
122#
123# Bus options
124#
125CONFIG_PCI=y
126CONFIG_PCI_DOMAINS=y
127# CONFIG_PCI_LEGACY_PROC is not set
128# CONFIG_PCI_NAMES is not set
129# CONFIG_PCI_DEBUG is not set
130
131#
132# PCCARD (PCMCIA/CardBus) support
133#
134# CONFIG_PCCARD is not set
135
136#
137# Advanced setup
138#
139# CONFIG_ADVANCED_OPTIONS is not set
140
141#
142# Default settings for advanced configuration options are used
143#
144CONFIG_HIGHMEM_START=0xfe000000
145CONFIG_LOWMEM_SIZE=0x30000000
146CONFIG_KERNEL_START=0xc0000000
147CONFIG_TASK_SIZE=0x80000000
148CONFIG_CONSISTENT_START=0xff100000
149CONFIG_CONSISTENT_SIZE=0x00200000
150CONFIG_BOOT_LOAD=0x01000000
151
152#
153# Device Drivers
154#
155
156#
157# Generic Driver Options
158#
159# CONFIG_STANDALONE is not set
160CONFIG_PREVENT_FIRMWARE_BUILD=y
161# CONFIG_FW_LOADER is not set
162# CONFIG_DEBUG_DRIVER is not set
163
164#
165# Memory Technology Devices (MTD)
166#
167# CONFIG_MTD is not set
168
169#
170# Parallel port support
171#
172# CONFIG_PARPORT is not set
173
174#
175# Plug and Play support
176#
177
178#
179# Block devices
180#
181# CONFIG_BLK_DEV_FD is not set
182# CONFIG_BLK_CPQ_DA is not set
183# CONFIG_BLK_CPQ_CISS_DA is not set
184# CONFIG_BLK_DEV_DAC960 is not set
185# CONFIG_BLK_DEV_UMEM is not set
186# CONFIG_BLK_DEV_COW_COMMON is not set
187# CONFIG_BLK_DEV_LOOP is not set
188# CONFIG_BLK_DEV_NBD is not set
189# CONFIG_BLK_DEV_SX8 is not set
190# CONFIG_BLK_DEV_UB is not set
191# CONFIG_BLK_DEV_RAM is not set
192CONFIG_BLK_DEV_RAM_COUNT=16
193CONFIG_INITRAMFS_SOURCE=""
194# CONFIG_LBD is not set
195# CONFIG_CDROM_PKTCDVD is not set
196
197#
198# IO Schedulers
199#
200CONFIG_IOSCHED_NOOP=y
201CONFIG_IOSCHED_AS=y
202CONFIG_IOSCHED_DEADLINE=y
203CONFIG_IOSCHED_CFQ=y
204# CONFIG_ATA_OVER_ETH is not set
205
206#
207# ATA/ATAPI/MFM/RLL support
208#
209CONFIG_IDE=y
210CONFIG_BLK_DEV_IDE=y
211
212#
213# Please see Documentation/ide.txt for help/info on IDE drives
214#
215# CONFIG_BLK_DEV_IDE_SATA is not set
216CONFIG_BLK_DEV_IDEDISK=y
217# CONFIG_IDEDISK_MULTI_MODE is not set
218# CONFIG_BLK_DEV_IDECD is not set
219# CONFIG_BLK_DEV_IDETAPE is not set
220# CONFIG_BLK_DEV_IDEFLOPPY is not set
221# CONFIG_BLK_DEV_IDESCSI is not set
222# CONFIG_IDE_TASK_IOCTL is not set
223
224#
225# IDE chipset support/bugfixes
226#
227CONFIG_IDE_GENERIC=y
228CONFIG_BLK_DEV_IDEPCI=y
229# CONFIG_IDEPCI_SHARE_IRQ is not set
230# CONFIG_BLK_DEV_OFFBOARD is not set
231# CONFIG_BLK_DEV_GENERIC is not set
232# CONFIG_BLK_DEV_OPTI621 is not set
233# CONFIG_BLK_DEV_SL82C105 is not set
234CONFIG_BLK_DEV_IDEDMA_PCI=y
235# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
236# CONFIG_IDEDMA_PCI_AUTO is not set
237# CONFIG_BLK_DEV_AEC62XX is not set
238# CONFIG_BLK_DEV_ALI15X3 is not set
239# CONFIG_BLK_DEV_AMD74XX is not set
240CONFIG_BLK_DEV_CMD64X=y
241# CONFIG_BLK_DEV_TRIFLEX is not set
242# CONFIG_BLK_DEV_CY82C693 is not set
243# CONFIG_BLK_DEV_CS5520 is not set
244# CONFIG_BLK_DEV_CS5530 is not set
245# CONFIG_BLK_DEV_HPT34X is not set
246# CONFIG_BLK_DEV_HPT366 is not set
247# CONFIG_BLK_DEV_SC1200 is not set
248# CONFIG_BLK_DEV_PIIX is not set
249# CONFIG_BLK_DEV_IT821X is not set
250# CONFIG_BLK_DEV_NS87415 is not set
251# CONFIG_BLK_DEV_PDC202XX_OLD is not set
252# CONFIG_BLK_DEV_PDC202XX_NEW is not set
253# CONFIG_BLK_DEV_SVWKS is not set
254# CONFIG_BLK_DEV_SIIMAGE is not set
255# CONFIG_BLK_DEV_SLC90E66 is not set
256# CONFIG_BLK_DEV_TRM290 is not set
257# CONFIG_BLK_DEV_VIA82CXXX is not set
258# CONFIG_IDE_ARM is not set
259CONFIG_BLK_DEV_IDEDMA=y
260# CONFIG_IDEDMA_IVB is not set
261# CONFIG_IDEDMA_AUTO is not set
262# CONFIG_BLK_DEV_HD is not set
263
264#
265# SCSI device support
266#
267CONFIG_SCSI=y
268CONFIG_SCSI_PROC_FS=y
269
270#
271# SCSI support type (disk, tape, CD-ROM)
272#
273# CONFIG_BLK_DEV_SD is not set
274CONFIG_CHR_DEV_ST=y
275# CONFIG_CHR_DEV_OSST is not set
276# CONFIG_BLK_DEV_SR is not set
277# CONFIG_CHR_DEV_SG is not set
278# CONFIG_CHR_DEV_SCH is not set
279
280#
281# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
282#
283# CONFIG_SCSI_MULTI_LUN is not set
284# CONFIG_SCSI_CONSTANTS is not set
285# CONFIG_SCSI_LOGGING is not set
286
287#
288# SCSI Transport Attributes
289#
290CONFIG_SCSI_SPI_ATTRS=y
291# CONFIG_SCSI_FC_ATTRS is not set
292# CONFIG_SCSI_ISCSI_ATTRS is not set
293
294#
295# SCSI low-level drivers
296#
297# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
298# CONFIG_SCSI_3W_9XXX is not set
299# CONFIG_SCSI_ACARD is not set
300# CONFIG_SCSI_AACRAID is not set
301# CONFIG_SCSI_AIC7XXX is not set
302# CONFIG_SCSI_AIC7XXX_OLD is not set
303# CONFIG_SCSI_AIC79XX is not set
304# CONFIG_SCSI_DPT_I2O is not set
305# CONFIG_MEGARAID_NEWGEN is not set
306# CONFIG_MEGARAID_LEGACY is not set
307# CONFIG_SCSI_SATA is not set
308# CONFIG_SCSI_BUSLOGIC is not set
309# CONFIG_SCSI_DMX3191D is not set
310# CONFIG_SCSI_EATA is not set
311# CONFIG_SCSI_FUTURE_DOMAIN is not set
312# CONFIG_SCSI_GDTH is not set
313# CONFIG_SCSI_IPS is not set
314# CONFIG_SCSI_INITIO is not set
315# CONFIG_SCSI_INIA100 is not set
316CONFIG_SCSI_SYM53C8XX_2=y
317CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
318CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
319CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
320# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
321# CONFIG_SCSI_IPR is not set
322# CONFIG_SCSI_QLOGIC_FC is not set
323# CONFIG_SCSI_QLOGIC_1280 is not set
324CONFIG_SCSI_QLA2XXX=y
325# CONFIG_SCSI_QLA21XX is not set
326# CONFIG_SCSI_QLA22XX is not set
327# CONFIG_SCSI_QLA2300 is not set
328# CONFIG_SCSI_QLA2322 is not set
329# CONFIG_SCSI_QLA6312 is not set
330# CONFIG_SCSI_LPFC is not set
331# CONFIG_SCSI_DC395x is not set
332# CONFIG_SCSI_DC390T is not set
333# CONFIG_SCSI_NSP32 is not set
334# CONFIG_SCSI_DEBUG is not set
335
336#
337# Multi-device support (RAID and LVM)
338#
339# CONFIG_MD is not set
340
341#
342# Fusion MPT device support
343#
344# CONFIG_FUSION is not set
345# CONFIG_FUSION_SPI is not set
346# CONFIG_FUSION_FC is not set
347
348#
349# IEEE 1394 (FireWire) support
350#
351# CONFIG_IEEE1394 is not set
352
353#
354# I2O device support
355#
356# CONFIG_I2O is not set
357
358#
359# Macintosh device drivers
360#
361
362#
363# Networking support
364#
365CONFIG_NET=y
366
367#
368# Networking options
369#
370CONFIG_PACKET=y
371# CONFIG_PACKET_MMAP is not set
372CONFIG_UNIX=y
373# CONFIG_NET_KEY is not set
374CONFIG_INET=y
375# CONFIG_IP_MULTICAST is not set
376# CONFIG_IP_ADVANCED_ROUTER is not set
377CONFIG_IP_FIB_HASH=y
378CONFIG_IP_PNP=y
379# CONFIG_IP_PNP_DHCP is not set
380CONFIG_IP_PNP_BOOTP=y
381# CONFIG_IP_PNP_RARP is not set
382# CONFIG_NET_IPIP is not set
383# CONFIG_NET_IPGRE is not set
384# CONFIG_ARPD is not set
385# CONFIG_SYN_COOKIES is not set
386# CONFIG_INET_AH is not set
387# CONFIG_INET_ESP is not set
388# CONFIG_INET_IPCOMP is not set
389# CONFIG_INET_TUNNEL is not set
390CONFIG_IP_TCPDIAG=y
391# CONFIG_IP_TCPDIAG_IPV6 is not set
392# CONFIG_TCP_CONG_ADVANCED is not set
393CONFIG_TCP_CONG_BIC=y
394
395#
396# IP: Virtual Server Configuration
397#
398# CONFIG_IP_VS is not set
399# CONFIG_IPV6 is not set
400CONFIG_NETFILTER=y
401# CONFIG_NETFILTER_DEBUG is not set
402
403#
404# IP: Netfilter Configuration
405#
406# CONFIG_IP_NF_CONNTRACK is not set
407# CONFIG_IP_NF_CONNTRACK_MARK is not set
408# CONFIG_IP_NF_QUEUE is not set
409# CONFIG_IP_NF_IPTABLES is not set
410# CONFIG_IP_NF_ARPTABLES is not set
411
412#
413# SCTP Configuration (EXPERIMENTAL)
414#
415# CONFIG_IP_SCTP is not set
416# CONFIG_ATM is not set
417# CONFIG_BRIDGE is not set
418# CONFIG_VLAN_8021Q is not set
419# CONFIG_DECNET is not set
420# CONFIG_LLC2 is not set
421# CONFIG_IPX is not set
422# CONFIG_ATALK is not set
423# CONFIG_X25 is not set
424# CONFIG_LAPB is not set
425# CONFIG_NET_DIVERT is not set
426# CONFIG_ECONET is not set
427# CONFIG_WAN_ROUTER is not set
428
429#
430# QoS and/or fair queueing
431#
432# CONFIG_NET_SCHED is not set
433# CONFIG_NET_CLS_ROUTE is not set
434
435#
436# Network testing
437#
438# CONFIG_NET_PKTGEN is not set
439# CONFIG_NETPOLL is not set
440# CONFIG_NET_POLL_CONTROLLER is not set
441# CONFIG_HAMRADIO is not set
442# CONFIG_IRDA is not set
443# CONFIG_BT is not set
444CONFIG_NETDEVICES=y
445# CONFIG_DUMMY is not set
446# CONFIG_BONDING is not set
447# CONFIG_EQUALIZER is not set
448# CONFIG_TUN is not set
449
450#
451# ARCnet devices
452#
453# CONFIG_ARCNET is not set
454
455#
456# Ethernet (10 or 100Mbit)
457#
458CONFIG_NET_ETHERNET=y
459CONFIG_MII=y
460# CONFIG_HAPPYMEAL is not set
461# CONFIG_SUNGEM is not set
462# CONFIG_NET_VENDOR_3COM is not set
463
464#
465# Tulip family network device support
466#
467# CONFIG_NET_TULIP is not set
468# CONFIG_HP100 is not set
469CONFIG_IBM_EMAC=y
470# CONFIG_IBM_EMAC_ERRMSG is not set
471CONFIG_IBM_EMAC_RXB=64
472CONFIG_IBM_EMAC_TXB=8
473CONFIG_IBM_EMAC_FGAP=8
474CONFIG_IBM_EMAC_SKBRES=0
475CONFIG_NET_PCI=y
476# CONFIG_PCNET32 is not set
477# CONFIG_AMD8111_ETH is not set
478# CONFIG_ADAPTEC_STARFIRE is not set
479# CONFIG_B44 is not set
480# CONFIG_FORCEDETH is not set
481# CONFIG_DGRS is not set
482CONFIG_EEPRO100=y
483# CONFIG_E100 is not set
484# CONFIG_FEALNX is not set
485CONFIG_NATSEMI=y
486# CONFIG_NE2K_PCI is not set
487# CONFIG_8139CP is not set
488# CONFIG_8139TOO is not set
489# CONFIG_SIS900 is not set
490# CONFIG_EPIC100 is not set
491# CONFIG_SUNDANCE is not set
492# CONFIG_TLAN is not set
493# CONFIG_VIA_RHINE is not set
494
495#
496# Ethernet (1000 Mbit)
497#
498# CONFIG_ACENIC is not set
499# CONFIG_DL2K is not set
500CONFIG_E1000=y
501# CONFIG_E1000_NAPI is not set
502# CONFIG_NS83820 is not set
503# CONFIG_HAMACHI is not set
504# CONFIG_YELLOWFIN is not set
505# CONFIG_R8169 is not set
506# CONFIG_SKGE is not set
507# CONFIG_SK98LIN is not set
508# CONFIG_VIA_VELOCITY is not set
509# CONFIG_TIGON3 is not set
510# CONFIG_BNX2 is not set
511
512#
513# Ethernet (10000 Mbit)
514#
515# CONFIG_IXGB is not set
516# CONFIG_S2IO is not set
517
518#
519# Token Ring devices
520#
521# CONFIG_TR is not set
522
523#
524# Wireless LAN (non-hamradio)
525#
526# CONFIG_NET_RADIO is not set
527
528#
529# Wan interfaces
530#
531# CONFIG_WAN is not set
532# CONFIG_FDDI is not set
533# CONFIG_HIPPI is not set
534# CONFIG_PPP is not set
535# CONFIG_SLIP is not set
536# CONFIG_NET_FC is not set
537# CONFIG_SHAPER is not set
538# CONFIG_NETCONSOLE is not set
539
540#
541# ISDN subsystem
542#
543# CONFIG_ISDN is not set
544
545#
546# Telephony Support
547#
548# CONFIG_PHONE is not set
549
550#
551# Input device support
552#
553CONFIG_INPUT=y
554
555#
556# Userland interfaces
557#
558CONFIG_INPUT_MOUSEDEV=y
559CONFIG_INPUT_MOUSEDEV_PSAUX=y
560CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
561CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
562# CONFIG_INPUT_JOYDEV is not set
563# CONFIG_INPUT_TSDEV is not set
564# CONFIG_INPUT_EVDEV is not set
565# CONFIG_INPUT_EVBUG is not set
566
567#
568# Input Device Drivers
569#
570# CONFIG_INPUT_KEYBOARD is not set
571# CONFIG_INPUT_MOUSE is not set
572# CONFIG_INPUT_JOYSTICK is not set
573# CONFIG_INPUT_TOUCHSCREEN is not set
574# CONFIG_INPUT_MISC is not set
575
576#
577# Hardware I/O ports
578#
579CONFIG_SERIO=y
580# CONFIG_SERIO_I8042 is not set
581# CONFIG_SERIO_SERPORT is not set
582# CONFIG_SERIO_PCIPS2 is not set
583# CONFIG_SERIO_LIBPS2 is not set
584# CONFIG_SERIO_RAW is not set
585# CONFIG_GAMEPORT is not set
586
587#
588# Character devices
589#
590# CONFIG_VT is not set
591# CONFIG_SERIAL_NONSTANDARD is not set
592
593#
594# Serial drivers
595#
596CONFIG_SERIAL_8250=y
597CONFIG_SERIAL_8250_CONSOLE=y
598CONFIG_SERIAL_8250_NR_UARTS=4
599CONFIG_SERIAL_8250_EXTENDED=y
600# CONFIG_SERIAL_8250_MANY_PORTS is not set
601CONFIG_SERIAL_8250_SHARE_IRQ=y
602# CONFIG_SERIAL_8250_DETECT_IRQ is not set
603# CONFIG_SERIAL_8250_RSA is not set
604
605#
606# Non-8250 serial port support
607#
608CONFIG_SERIAL_CORE=y
609CONFIG_SERIAL_CORE_CONSOLE=y
610# CONFIG_SERIAL_JSM is not set
611CONFIG_UNIX98_PTYS=y
612CONFIG_LEGACY_PTYS=y
613CONFIG_LEGACY_PTY_COUNT=256
614
615#
616# IPMI
617#
618# CONFIG_IPMI_HANDLER is not set
619
620#
621# Watchdog Cards
622#
623# CONFIG_WATCHDOG is not set
624# CONFIG_NVRAM is not set
625# CONFIG_GEN_RTC is not set
626# CONFIG_DTLK is not set
627# CONFIG_R3964 is not set
628# CONFIG_APPLICOM is not set
629
630#
631# Ftape, the floppy tape device driver
632#
633# CONFIG_AGP is not set
634# CONFIG_DRM is not set
635# CONFIG_RAW_DRIVER is not set
636
637#
638# TPM devices
639#
640# CONFIG_TCG_TPM is not set
641
642#
643# I2C support
644#
645# CONFIG_I2C is not set
646
647#
648# Dallas's 1-wire bus
649#
650# CONFIG_W1 is not set
651
652#
653# Misc devices
654#
655
656#
657# Multimedia devices
658#
659# CONFIG_VIDEO_DEV is not set
660
661#
662# Digital Video Broadcasting Devices
663#
664# CONFIG_DVB is not set
665
666#
667# Graphics support
668#
669# CONFIG_FB is not set
670
671#
672# Sound
673#
674# CONFIG_SOUND is not set
675
676#
677# USB support
678#
679CONFIG_USB_ARCH_HAS_HCD=y
680CONFIG_USB_ARCH_HAS_OHCI=y
681CONFIG_USB=y
682CONFIG_USB_DEBUG=y
683
684#
685# Miscellaneous USB options
686#
687# CONFIG_USB_DEVICEFS is not set
688# CONFIG_USB_BANDWIDTH is not set
689# CONFIG_USB_DYNAMIC_MINORS is not set
690# CONFIG_USB_OTG is not set
691
692#
693# USB Host Controller Drivers
694#
695# CONFIG_USB_EHCI_HCD is not set
696# CONFIG_USB_ISP116X_HCD is not set
697# CONFIG_USB_OHCI_HCD is not set
698# CONFIG_USB_UHCI_HCD is not set
699# CONFIG_USB_SL811_HCD is not set
700
701#
702# USB Device Class drivers
703#
704# CONFIG_USB_BLUETOOTH_TTY is not set
705# CONFIG_USB_ACM is not set
706# CONFIG_USB_PRINTER is not set
707
708#
709# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
710#
711# CONFIG_USB_STORAGE is not set
712
713#
714# USB Input Devices
715#
716# CONFIG_USB_HID is not set
717
718#
719# USB HID Boot Protocol drivers
720#
721# CONFIG_USB_KBD is not set
722# CONFIG_USB_MOUSE is not set
723# CONFIG_USB_AIPTEK is not set
724# CONFIG_USB_WACOM is not set
725# CONFIG_USB_ACECAD is not set
726# CONFIG_USB_KBTAB is not set
727# CONFIG_USB_POWERMATE is not set
728# CONFIG_USB_MTOUCH is not set
729# CONFIG_USB_ITMTOUCH is not set
730# CONFIG_USB_EGALAX is not set
731# CONFIG_USB_XPAD is not set
732# CONFIG_USB_ATI_REMOTE is not set
733
734#
735# USB Imaging devices
736#
737# CONFIG_USB_MDC800 is not set
738# CONFIG_USB_MICROTEK is not set
739
740#
741# USB Multimedia devices
742#
743# CONFIG_USB_DABUSB is not set
744
745#
746# Video4Linux support is needed for USB Multimedia device support
747#
748
749#
750# USB Network Adapters
751#
752# CONFIG_USB_CATC is not set
753# CONFIG_USB_KAWETH is not set
754CONFIG_USB_PEGASUS=y
755# CONFIG_USB_RTL8150 is not set
756# CONFIG_USB_USBNET is not set
757CONFIG_USB_MON=y
758
759#
760# USB port drivers
761#
762
763#
764# USB Serial Converter support
765#
766# CONFIG_USB_SERIAL is not set
767
768#
769# USB Miscellaneous drivers
770#
771# CONFIG_USB_EMI62 is not set
772# CONFIG_USB_EMI26 is not set
773# CONFIG_USB_AUERSWALD is not set
774# CONFIG_USB_RIO500 is not set
775# CONFIG_USB_LEGOTOWER is not set
776# CONFIG_USB_LCD is not set
777# CONFIG_USB_LED is not set
778# CONFIG_USB_CYTHERM is not set
779# CONFIG_USB_PHIDGETKIT is not set
780# CONFIG_USB_PHIDGETSERVO is not set
781# CONFIG_USB_IDMOUSE is not set
782
783#
784# USB DSL modem support
785#
786
787#
788# USB Gadget Support
789#
790# CONFIG_USB_GADGET is not set
791
792#
793# MMC/SD Card support
794#
795# CONFIG_MMC is not set
796
797#
798# InfiniBand support
799#
800# CONFIG_INFINIBAND is not set
801
802#
803# SN Devices
804#
805
806#
807# File systems
808#
809# CONFIG_EXT2_FS is not set
810# CONFIG_EXT3_FS is not set
811# CONFIG_JBD is not set
812# CONFIG_REISERFS_FS is not set
813# CONFIG_JFS_FS is not set
814
815#
816# XFS support
817#
818# CONFIG_XFS_FS is not set
819# CONFIG_MINIX_FS is not set
820# CONFIG_ROMFS_FS is not set
821# CONFIG_QUOTA is not set
822CONFIG_DNOTIFY=y
823# CONFIG_AUTOFS_FS is not set
824# CONFIG_AUTOFS4_FS is not set
825
826#
827# CD-ROM/DVD Filesystems
828#
829# CONFIG_ISO9660_FS is not set
830# CONFIG_UDF_FS is not set
831
832#
833# DOS/FAT/NT Filesystems
834#
835# CONFIG_MSDOS_FS is not set
836# CONFIG_VFAT_FS is not set
837# CONFIG_NTFS_FS is not set
838
839#
840# Pseudo filesystems
841#
842CONFIG_PROC_FS=y
843CONFIG_PROC_KCORE=y
844CONFIG_SYSFS=y
845# CONFIG_DEVPTS_FS_XATTR is not set
846# CONFIG_TMPFS is not set
847# CONFIG_HUGETLB_PAGE is not set
848CONFIG_RAMFS=y
849
850#
851# Miscellaneous filesystems
852#
853# CONFIG_ADFS_FS is not set
854# CONFIG_AFFS_FS is not set
855# CONFIG_HFS_FS is not set
856# CONFIG_HFSPLUS_FS is not set
857# CONFIG_BEFS_FS is not set
858# CONFIG_BFS_FS is not set
859# CONFIG_EFS_FS is not set
860# CONFIG_CRAMFS is not set
861# CONFIG_VXFS_FS is not set
862# CONFIG_HPFS_FS is not set
863# CONFIG_QNX4FS_FS is not set
864# CONFIG_SYSV_FS is not set
865# CONFIG_UFS_FS is not set
866
867#
868# Network File Systems
869#
870CONFIG_NFS_FS=y
871# CONFIG_NFS_V3 is not set
872# CONFIG_NFS_V4 is not set
873# CONFIG_NFS_DIRECTIO is not set
874# CONFIG_NFSD is not set
875CONFIG_ROOT_NFS=y
876CONFIG_LOCKD=y
877CONFIG_NFS_COMMON=y
878CONFIG_SUNRPC=y
879# CONFIG_RPCSEC_GSS_KRB5 is not set
880# CONFIG_RPCSEC_GSS_SPKM3 is not set
881# CONFIG_SMB_FS is not set
882# CONFIG_CIFS is not set
883# CONFIG_NCP_FS is not set
884# CONFIG_CODA_FS is not set
885# CONFIG_AFS_FS is not set
886
887#
888# Partition Types
889#
890# CONFIG_PARTITION_ADVANCED is not set
891CONFIG_MSDOS_PARTITION=y
892
893#
894# Native Language Support
895#
896# CONFIG_NLS is not set
897
898#
899# Library routines
900#
901# CONFIG_CRC_CCITT is not set
902CONFIG_CRC32=y
903# CONFIG_LIBCRC32C is not set
904
905#
906# Profiling support
907#
908# CONFIG_PROFILING is not set
909
910#
911# Kernel hacking
912#
913# CONFIG_PRINTK_TIME is not set
914CONFIG_DEBUG_KERNEL=y
915CONFIG_MAGIC_SYSRQ=y
916CONFIG_LOG_BUF_SHIFT=14
917# CONFIG_SCHEDSTATS is not set
918# CONFIG_DEBUG_SLAB is not set
919# CONFIG_DEBUG_SPINLOCK is not set
920# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
921# CONFIG_DEBUG_KOBJECT is not set
922CONFIG_DEBUG_INFO=y
923# CONFIG_DEBUG_FS is not set
924# CONFIG_KGDB is not set
925# CONFIG_XMON is not set
926CONFIG_BDI_SWITCH=y
927# CONFIG_SERIAL_TEXT_DEBUG is not set
928CONFIG_PPC_OCP=y
929
930#
931# Security options
932#
933# CONFIG_KEYS is not set
934# CONFIG_SECURITY is not set
935
936#
937# Cryptographic options
938#
939# CONFIG_CRYPTO is not set
940
941#
942# Hardware crypto devices
943#
diff --git a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c
index 50936cda0af9..8a3d74f2531e 100644
--- a/arch/ppc/kernel/cputable.c
+++ b/arch/ppc/kernel/cputable.c
@@ -852,6 +852,26 @@ struct cpu_spec cpu_specs[] = {
852 852
853#endif /* CONFIG_40x */ 853#endif /* CONFIG_40x */
854#ifdef CONFIG_44x 854#ifdef CONFIG_44x
855 {
856 .pvr_mask = 0xf0000fff,
857 .pvr_value = 0x40000850,
858 .cpu_name = "440EP Rev. A",
859 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
860 CPU_FTR_USE_TB,
861 .cpu_user_features = COMMON_PPC, /* 440EP has an FPU */
862 .icache_bsize = 32,
863 .dcache_bsize = 32,
864 },
865 {
866 .pvr_mask = 0xf0000fff,
867 .pvr_value = 0x400008d3,
868 .cpu_name = "440EP Rev. B",
869 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
870 CPU_FTR_USE_TB,
871 .cpu_user_features = COMMON_PPC, /* 440EP has an FPU */
872 .icache_bsize = 32,
873 .dcache_bsize = 32,
874 },
855 { /* 440GP Rev. B */ 875 { /* 440GP Rev. B */
856 .pvr_mask = 0xf0000fff, 876 .pvr_mask = 0xf0000fff,
857 .pvr_value = 0x40000440, 877 .pvr_value = 0x40000440,
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index d4df68629cc6..cb83045e2edf 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -215,6 +215,7 @@ syscall_dotrace_cont:
215 lwzx r10,r10,r0 /* Fetch system call handler [ptr] */ 215 lwzx r10,r10,r0 /* Fetch system call handler [ptr] */
216 mtlr r10 216 mtlr r10
217 addi r9,r1,STACK_FRAME_OVERHEAD 217 addi r9,r1,STACK_FRAME_OVERHEAD
218 PPC440EP_ERR42
218 blrl /* Call handler */ 219 blrl /* Call handler */
219 .globl ret_from_syscall 220 .globl ret_from_syscall
220ret_from_syscall: 221ret_from_syscall:
diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S
index 6c7ae6052464..69ff3a9961e8 100644
--- a/arch/ppc/kernel/head_44x.S
+++ b/arch/ppc/kernel/head_44x.S
@@ -179,24 +179,26 @@ skpinv: addi r4,r4,1 /* Increment */
1794: 1794:
180#ifdef CONFIG_SERIAL_TEXT_DEBUG 180#ifdef CONFIG_SERIAL_TEXT_DEBUG
181 /* 181 /*
182 * Add temporary UART mapping for early debug. This 182 * Add temporary UART mapping for early debug.
183 * mapping must be identical to that used by the early 183 * We can map UART registers wherever we want as long as they don't
184 * bootloader code since the same asm/serial.h parameters 184 * interfere with other system mappings (e.g. with pinned entries).
185 * are used for polled operation. 185 * For an example of how we handle this - see ocotea.h. --ebs
186 */ 186 */
187 /* pageid fields */ 187 /* pageid fields */
188 lis r3,UART0_IO_BASE@h 188 lis r3,UART0_IO_BASE@h
189 ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_256M 189 ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_4K
190 190
191 /* xlat fields */ 191 /* xlat fields */
192 lis r4,UART0_PHYS_IO_BASE@h /* RPN depends on SoC */ 192 lis r4,UART0_PHYS_IO_BASE@h /* RPN depends on SoC */
193#ifndef CONFIG_440EP
193 ori r4,r4,0x0001 /* ERPN is 1 for second 4GB page */ 194 ori r4,r4,0x0001 /* ERPN is 1 for second 4GB page */
195#endif
194 196
195 /* attrib fields */ 197 /* attrib fields */
196 li r5,0 198 li r5,0
197 ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G) 199 ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G)
198 200
199 li r0,1 /* TLB slot 1 */ 201 li r0,0 /* TLB slot 0 */
200 202
201 tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */ 203 tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */
202 tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */ 204 tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */
@@ -228,6 +230,16 @@ skpinv: addi r4,r4,1 /* Increment */
228 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ 230 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */
229 mtspr SPRN_IVPR,r4 231 mtspr SPRN_IVPR,r4
230 232
233#ifdef CONFIG_440EP
234 /* Clear DAPUIB flag in CCR0 (enable APU between CPU and FPU) */
235 mfspr r2,SPRN_CCR0
236 lis r3,0xffef
237 ori r3,r3,0xffff
238 and r2,r2,r3
239 mtspr SPRN_CCR0,r2
240 isync
241#endif
242
231 /* 243 /*
232 * This is where the main kernel code starts. 244 * This is where the main kernel code starts.
233 */ 245 */
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 191a8def3bdb..ce71b4a01585 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -1145,6 +1145,7 @@ _GLOBAL(kernel_thread)
1145 stwu r0,-16(r1) 1145 stwu r0,-16(r1)
1146 mtlr r30 /* fn addr in lr */ 1146 mtlr r30 /* fn addr in lr */
1147 mr r3,r31 /* load arg and call fn */ 1147 mr r3,r31 /* load arg and call fn */
1148 PPC440EP_ERR42
1148 blrl 1149 blrl
1149 li r0,__NR_exit /* exit if function returns */ 1150 li r0,__NR_exit /* exit if function returns */
1150 li r3,0 1151 li r3,0
@@ -1451,3 +1452,6 @@ _GLOBAL(sys_call_table)
1451 .long sys_waitid 1452 .long sys_waitid
1452 .long sys_ioprio_set 1453 .long sys_ioprio_set
1453 .long sys_ioprio_get 1454 .long sys_ioprio_get
1455 .long sys_inotify_init /* 275 */
1456 .long sys_inotify_add_watch
1457 .long sys_inotify_rm_watch
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index 70cfb6ffd877..7b3586a3bf30 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -160,6 +160,21 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
160} 160}
161EXPORT_SYMBOL(pcibios_resource_to_bus); 161EXPORT_SYMBOL(pcibios_resource_to_bus);
162 162
163void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
164 struct pci_bus_region *region)
165{
166 unsigned long offset = 0;
167 struct pci_controller *hose = dev->sysdata;
168
169 if (hose && res->flags & IORESOURCE_IO)
170 offset = (unsigned long)hose->io_base_virt - isa_io_base;
171 else if (hose && res->flags & IORESOURCE_MEM)
172 offset = hose->pci_mem_offset;
173 res->start = region->start + offset;
174 res->end = region->end + offset;
175}
176EXPORT_SYMBOL(pcibios_bus_to_resource);
177
163/* 178/*
164 * We need to avoid collisions with `mirrored' VGA ports 179 * We need to avoid collisions with `mirrored' VGA ports
165 * and other strange ISA hardware, so we always want the 180 * and other strange ISA hardware, so we always want the
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index d59ad07de8e7..e7d40cc6c1b6 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -324,7 +324,7 @@ EXPORT_SYMBOL(__res);
324 324
325EXPORT_SYMBOL(next_mmu_context); 325EXPORT_SYMBOL(next_mmu_context);
326EXPORT_SYMBOL(set_context); 326EXPORT_SYMBOL(set_context);
327EXPORT_SYMBOL(handle_mm_fault); /* For MOL */ 327EXPORT_SYMBOL_GPL(__handle_mm_fault); /* For MOL */
328EXPORT_SYMBOL(disarm_decr); 328EXPORT_SYMBOL(disarm_decr);
329#ifdef CONFIG_PPC_STD_MMU 329#ifdef CONFIG_PPC_STD_MMU
330extern long mol_trampoline; 330extern long mol_trampoline;
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index a0612a86455a..f7c045764e04 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -68,6 +68,11 @@ choice
68 depends on 44x 68 depends on 44x
69 default EBONY 69 default EBONY
70 70
71config BAMBOO
72 bool "Bamboo"
73 help
74 This option enables support for the IBM PPC440EP evaluation board.
75
71config EBONY 76config EBONY
72 bool "Ebony" 77 bool "Ebony"
73 help 78 help
@@ -98,6 +103,12 @@ config NP405H
98 depends on ASH 103 depends on ASH
99 default y 104 default y
100 105
106config 440EP
107 bool
108 depends on BAMBOO
109 select PPC_FPU
110 default y
111
101config 440GP 112config 440GP
102 bool 113 bool
103 depends on EBONY 114 depends on EBONY
@@ -115,7 +126,7 @@ config 440SP
115 126
116config 440 127config 440
117 bool 128 bool
118 depends on 440GP || 440SP 129 depends on 440GP || 440SP || 440EP
119 default y 130 default y
120 131
121config 440A 132config 440A
@@ -123,6 +134,11 @@ config 440A
123 depends on 440GX 134 depends on 440GX
124 default y 135 default y
125 136
137config IBM440EP_ERR42
138 bool
139 depends on 440EP
140 default y
141
126# All 405-based cores up until the 405GPR and 405EP have this errata. 142# All 405-based cores up until the 405GPR and 405EP have this errata.
127config IBM405_ERR77 143config IBM405_ERR77
128 bool 144 bool
@@ -142,7 +158,7 @@ config BOOKE
142 158
143config IBM_OCP 159config IBM_OCP
144 bool 160 bool
145 depends on ASH || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT 161 depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
146 default y 162 default y
147 163
148config XILINX_OCP 164config XILINX_OCP
diff --git a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile
index ea470c6adbb6..844c3b5066e8 100644
--- a/arch/ppc/platforms/4xx/Makefile
+++ b/arch/ppc/platforms/4xx/Makefile
@@ -2,6 +2,7 @@
2# Makefile for the PowerPC 4xx linux kernel. 2# Makefile for the PowerPC 4xx linux kernel.
3 3
4obj-$(CONFIG_ASH) += ash.o 4obj-$(CONFIG_ASH) += ash.o
5obj-$(CONFIG_BAMBOO) += bamboo.o
5obj-$(CONFIG_CPCI405) += cpci405.o 6obj-$(CONFIG_CPCI405) += cpci405.o
6obj-$(CONFIG_EBONY) += ebony.o 7obj-$(CONFIG_EBONY) += ebony.o
7obj-$(CONFIG_EP405) += ep405.o 8obj-$(CONFIG_EP405) += ep405.o
@@ -19,6 +20,7 @@ obj-$(CONFIG_405GP) += ibm405gp.o
19obj-$(CONFIG_REDWOOD_5) += ibmstb4.o 20obj-$(CONFIG_REDWOOD_5) += ibmstb4.o
20obj-$(CONFIG_NP405H) += ibmnp405h.o 21obj-$(CONFIG_NP405H) += ibmnp405h.o
21obj-$(CONFIG_REDWOOD_6) += ibmstbx25.o 22obj-$(CONFIG_REDWOOD_6) += ibmstbx25.o
23obj-$(CONFIG_440EP) += ibm440ep.o
22obj-$(CONFIG_440GP) += ibm440gp.o 24obj-$(CONFIG_440GP) += ibm440gp.o
23obj-$(CONFIG_440GX) += ibm440gx.o 25obj-$(CONFIG_440GX) += ibm440gx.o
24obj-$(CONFIG_440SP) += ibm440sp.o 26obj-$(CONFIG_440SP) += ibm440sp.o
diff --git a/arch/ppc/platforms/4xx/bamboo.c b/arch/ppc/platforms/4xx/bamboo.c
new file mode 100644
index 000000000000..f116787b0b76
--- /dev/null
+++ b/arch/ppc/platforms/4xx/bamboo.c
@@ -0,0 +1,427 @@
1/*
2 * arch/ppc/platforms/4xx/bamboo.c
3 *
4 * Bamboo board specific routines
5 *
6 * Wade Farnsworth <wfarnsworth@mvista.com>
7 * Copyright 2004 MontaVista Software Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15#include <linux/config.h>
16#include <linux/stddef.h>
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/errno.h>
20#include <linux/reboot.h>
21#include <linux/pci.h>
22#include <linux/kdev_t.h>
23#include <linux/types.h>
24#include <linux/major.h>
25#include <linux/blkdev.h>
26#include <linux/console.h>
27#include <linux/delay.h>
28#include <linux/ide.h>
29#include <linux/initrd.h>
30#include <linux/irq.h>
31#include <linux/seq_file.h>
32#include <linux/root_dev.h>
33#include <linux/tty.h>
34#include <linux/serial.h>
35#include <linux/serial_core.h>
36#include <linux/ethtool.h>
37
38#include <asm/system.h>
39#include <asm/pgtable.h>
40#include <asm/page.h>
41#include <asm/dma.h>
42#include <asm/io.h>
43#include <asm/machdep.h>
44#include <asm/ocp.h>
45#include <asm/pci-bridge.h>
46#include <asm/time.h>
47#include <asm/todc.h>
48#include <asm/bootinfo.h>
49#include <asm/ppc4xx_pic.h>
50#include <asm/ppcboot.h>
51
52#include <syslib/gen550.h>
53#include <syslib/ibm440gx_common.h>
54
55/*
56 * This is a horrible kludge, we eventually need to abstract this
57 * generic PHY stuff, so the standard phy mode defines can be
58 * easily used from arch code.
59 */
60#include "../../../../drivers/net/ibm_emac/ibm_emac_phy.h"
61
62bd_t __res;
63
64static struct ibm44x_clocks clocks __initdata;
65
66/*
67 * Bamboo external IRQ triggering/polarity settings
68 */
69unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = {
70 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ0: Ethernet transceiver */
71 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ1: Expansion connector */
72 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ2: PCI slot 0 */
73 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ3: PCI slot 1 */
74 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ4: PCI slot 2 */
75 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ5: PCI slot 3 */
76 (IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE), /* IRQ6: SMI pushbutton */
77 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ7: EXT */
78 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ8: EXT */
79 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ9: EXT */
80};
81
82static void __init
83bamboo_calibrate_decr(void)
84{
85 unsigned int freq;
86
87 if (mfspr(SPRN_CCR1) & CCR1_TCS)
88 freq = BAMBOO_TMRCLK;
89 else
90 freq = clocks.cpu;
91
92 ibm44x_calibrate_decr(freq);
93
94}
95
96static int
97bamboo_show_cpuinfo(struct seq_file *m)
98{
99 seq_printf(m, "vendor\t\t: IBM\n");
100 seq_printf(m, "machine\t\t: PPC440EP EVB (Bamboo)\n");
101
102 return 0;
103}
104
105static inline int
106bamboo_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
107{
108 static char pci_irq_table[][4] =
109 /*
110 * PCI IDSEL/INTPIN->INTLINE
111 * A B C D
112 */
113 {
114 { 28, 28, 28, 28 }, /* IDSEL 1 - PCI Slot 0 */
115 { 27, 27, 27, 27 }, /* IDSEL 2 - PCI Slot 1 */
116 { 26, 26, 26, 26 }, /* IDSEL 3 - PCI Slot 2 */
117 { 25, 25, 25, 25 }, /* IDSEL 4 - PCI Slot 3 */
118 };
119
120 const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
121 return PCI_IRQ_TABLE_LOOKUP;
122}
123
124static void __init bamboo_set_emacdata(void)
125{
126 unsigned char * selection1_base;
127 struct ocp_def *def;
128 struct ocp_func_emac_data *emacdata;
129 u8 selection1_val;
130 int mode;
131
132 selection1_base = ioremap64(BAMBOO_FPGA_SELECTION1_REG_ADDR, 16);
133 selection1_val = readb(selection1_base);
134 iounmap((void *) selection1_base);
135 if (BAMBOO_SEL_MII(selection1_val))
136 mode = PHY_MODE_MII;
137 else if (BAMBOO_SEL_RMII(selection1_val))
138 mode = PHY_MODE_RMII;
139 else
140 mode = PHY_MODE_SMII;
141
142 /* Set mac_addr and phy mode for each EMAC */
143
144 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 0);
145 emacdata = def->additions;
146 memcpy(emacdata->mac_addr, __res.bi_enetaddr, 6);
147 emacdata->phy_mode = mode;
148
149 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 1);
150 emacdata = def->additions;
151 memcpy(emacdata->mac_addr, __res.bi_enet1addr, 6);
152 emacdata->phy_mode = mode;
153}
154
155static int
156bamboo_exclude_device(unsigned char bus, unsigned char devfn)
157{
158 return (bus == 0 && devfn == 0);
159}
160
161#define PCI_READW(offset) \
162 (readw((void *)((u32)pci_reg_base+offset)))
163
164#define PCI_WRITEW(value, offset) \
165 (writew(value, (void *)((u32)pci_reg_base+offset)))
166
167#define PCI_WRITEL(value, offset) \
168 (writel(value, (void *)((u32)pci_reg_base+offset)))
169
170static void __init
171bamboo_setup_pci(void)
172{
173 void *pci_reg_base;
174 unsigned long memory_size;
175 memory_size = ppc_md.find_end_of_memory();
176
177 pci_reg_base = ioremap64(BAMBOO_PCIL0_BASE, BAMBOO_PCIL0_SIZE);
178
179 /* Enable PCI I/O, Mem, and Busmaster cycles */
180 PCI_WRITEW(PCI_READW(PCI_COMMAND) |
181 PCI_COMMAND_MEMORY |
182 PCI_COMMAND_MASTER, PCI_COMMAND);
183
184 /* Disable region first */
185 PCI_WRITEL(0, BAMBOO_PCIL0_PMM0MA);
186
187 /* PLB starting addr: 0x00000000A0000000 */
188 PCI_WRITEL(BAMBOO_PCI_PHY_MEM_BASE, BAMBOO_PCIL0_PMM0LA);
189
190 /* PCI start addr, 0xA0000000 (PCI Address) */
191 PCI_WRITEL(BAMBOO_PCI_MEM_BASE, BAMBOO_PCIL0_PMM0PCILA);
192 PCI_WRITEL(0, BAMBOO_PCIL0_PMM0PCIHA);
193
194 /* Enable no pre-fetch, enable region */
195 PCI_WRITEL(((0xffffffff -
196 (BAMBOO_PCI_UPPER_MEM - BAMBOO_PCI_MEM_BASE)) | 0x01),
197 BAMBOO_PCIL0_PMM0MA);
198
199 /* Disable region one */
200 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1MA);
201 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1LA);
202 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1PCILA);
203 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1PCIHA);
204 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1MA);
205
206 /* Disable region two */
207 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2MA);
208 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2LA);
209 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2PCILA);
210 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2PCIHA);
211 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2MA);
212
213 /* Now configure the PCI->PLB windows, we only use PTM1
214 *
215 * For Inbound flow, set the window size to all available memory
216 * This is required because if size is smaller,
217 * then Eth/PCI DD would fail as PCI card not able to access
218 * the memory allocated by DD.
219 */
220
221 PCI_WRITEL(0, BAMBOO_PCIL0_PTM1MS); /* disabled region 1 */
222 PCI_WRITEL(0, BAMBOO_PCIL0_PTM1LA); /* begin of address map */
223
224 memory_size = 1 << fls(memory_size - 1);
225
226 /* Size low + Enabled */
227 PCI_WRITEL((0xffffffff - (memory_size - 1)) | 0x1, BAMBOO_PCIL0_PTM1MS);
228
229 eieio();
230 iounmap(pci_reg_base);
231}
232
233static void __init
234bamboo_setup_hose(void)
235{
236 unsigned int bar_response, bar;
237 struct pci_controller *hose;
238
239 bamboo_setup_pci();
240
241 hose = pcibios_alloc_controller();
242
243 if (!hose)
244 return;
245
246 hose->first_busno = 0;
247 hose->last_busno = 0xff;
248
249 hose->pci_mem_offset = BAMBOO_PCI_MEM_OFFSET;
250
251 pci_init_resource(&hose->io_resource,
252 BAMBOO_PCI_LOWER_IO,
253 BAMBOO_PCI_UPPER_IO,
254 IORESOURCE_IO,
255 "PCI host bridge");
256
257 pci_init_resource(&hose->mem_resources[0],
258 BAMBOO_PCI_LOWER_MEM,
259 BAMBOO_PCI_UPPER_MEM,
260 IORESOURCE_MEM,
261 "PCI host bridge");
262
263 ppc_md.pci_exclude_device = bamboo_exclude_device;
264
265 hose->io_space.start = BAMBOO_PCI_LOWER_IO;
266 hose->io_space.end = BAMBOO_PCI_UPPER_IO;
267 hose->mem_space.start = BAMBOO_PCI_LOWER_MEM;
268 hose->mem_space.end = BAMBOO_PCI_UPPER_MEM;
269 isa_io_base =
270 (unsigned long)ioremap64(BAMBOO_PCI_IO_BASE, BAMBOO_PCI_IO_SIZE);
271 hose->io_base_virt = (void *)isa_io_base;
272
273 setup_indirect_pci(hose,
274 BAMBOO_PCI_CFGA_PLB32,
275 BAMBOO_PCI_CFGD_PLB32);
276 hose->set_cfg_type = 1;
277
278 /* Zero config bars */
279 for (bar = PCI_BASE_ADDRESS_1; bar <= PCI_BASE_ADDRESS_2; bar += 4) {
280 early_write_config_dword(hose, hose->first_busno,
281 PCI_FUNC(hose->first_busno), bar,
282 0x00000000);
283 early_read_config_dword(hose, hose->first_busno,
284 PCI_FUNC(hose->first_busno), bar,
285 &bar_response);
286 }
287
288 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
289
290 ppc_md.pci_swizzle = common_swizzle;
291 ppc_md.pci_map_irq = bamboo_map_irq;
292}
293
294TODC_ALLOC();
295
296static void __init
297bamboo_early_serial_map(void)
298{
299 struct uart_port port;
300
301 /* Setup ioremapped serial port access */
302 memset(&port, 0, sizeof(port));
303 port.membase = ioremap64(PPC440EP_UART0_ADDR, 8);
304 port.irq = 0;
305 port.uartclk = clocks.uart0;
306 port.regshift = 0;
307 port.iotype = SERIAL_IO_MEM;
308 port.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
309 port.line = 0;
310
311 if (early_serial_setup(&port) != 0) {
312 printk("Early serial init of port 0 failed\n");
313 }
314
315#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
316 /* Configure debug serial access */
317 gen550_init(0, &port);
318#endif
319
320 port.membase = ioremap64(PPC440EP_UART1_ADDR, 8);
321 port.irq = 1;
322 port.uartclk = clocks.uart1;
323 port.line = 1;
324
325 if (early_serial_setup(&port) != 0) {
326 printk("Early serial init of port 1 failed\n");
327 }
328
329#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
330 /* Configure debug serial access */
331 gen550_init(1, &port);
332#endif
333
334 port.membase = ioremap64(PPC440EP_UART2_ADDR, 8);
335 port.irq = 3;
336 port.uartclk = clocks.uart2;
337 port.line = 2;
338
339 if (early_serial_setup(&port) != 0) {
340 printk("Early serial init of port 2 failed\n");
341 }
342
343#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
344 /* Configure debug serial access */
345 gen550_init(2, &port);
346#endif
347
348 port.membase = ioremap64(PPC440EP_UART3_ADDR, 8);
349 port.irq = 4;
350 port.uartclk = clocks.uart3;
351 port.line = 3;
352
353 if (early_serial_setup(&port) != 0) {
354 printk("Early serial init of port 3 failed\n");
355 }
356}
357
358static void __init
359bamboo_setup_arch(void)
360{
361
362 bamboo_set_emacdata();
363
364 ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200);
365 ocp_sys_info.opb_bus_freq = clocks.opb;
366
367 /* Setup TODC access */
368 TODC_INIT(TODC_TYPE_DS1743,
369 0,
370 0,
371 ioremap64(BAMBOO_RTC_ADDR, BAMBOO_RTC_SIZE),
372 8);
373
374 /* init to some ~sane value until calibrate_delay() runs */
375 loops_per_jiffy = 50000000/HZ;
376
377 /* Setup PCI host bridge */
378 bamboo_setup_hose();
379
380#ifdef CONFIG_BLK_DEV_INITRD
381 if (initrd_start)
382 ROOT_DEV = Root_RAM0;
383 else
384#endif
385#ifdef CONFIG_ROOT_NFS
386 ROOT_DEV = Root_NFS;
387#else
388 ROOT_DEV = Root_HDA1;
389#endif
390
391 bamboo_early_serial_map();
392
393 /* Identify the system */
394 printk("IBM Bamboo port (MontaVista Software, Inc. (source@mvista.com))\n");
395}
396
397void __init platform_init(unsigned long r3, unsigned long r4,
398 unsigned long r5, unsigned long r6, unsigned long r7)
399{
400 parse_bootinfo(find_bootinfo());
401
402 /*
403 * If we were passed in a board information, copy it into the
404 * residual data area.
405 */
406 if (r3)
407 __res = *(bd_t *)(r3 + KERNELBASE);
408
409
410 ibm44x_platform_init();
411
412 ppc_md.setup_arch = bamboo_setup_arch;
413 ppc_md.show_cpuinfo = bamboo_show_cpuinfo;
414 ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */
415
416 ppc_md.calibrate_decr = bamboo_calibrate_decr;
417 ppc_md.time_init = todc_time_init;
418 ppc_md.set_rtc_time = todc_set_rtc_time;
419 ppc_md.get_rtc_time = todc_get_rtc_time;
420
421 ppc_md.nvram_read_val = todc_direct_read_val;
422 ppc_md.nvram_write_val = todc_direct_write_val;
423#ifdef CONFIG_KGDB
424 ppc_md.early_serial_map = bamboo_early_serial_map;
425#endif
426}
427
diff --git a/arch/ppc/platforms/4xx/bamboo.h b/arch/ppc/platforms/4xx/bamboo.h
new file mode 100644
index 000000000000..63d714504148
--- /dev/null
+++ b/arch/ppc/platforms/4xx/bamboo.h
@@ -0,0 +1,136 @@
1/*
2 * arch/ppc/platforms/bamboo.h
3 *
4 * Bamboo board definitions
5 *
6 * Wade Farnsworth <wfarnsworth@mvista.com>
7 *
8 * Copyright 2004 MontaVista Software Inc.
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#ifdef __KERNEL__
17#ifndef __ASM_BAMBOO_H__
18#define __ASM_BAMBOO_H__
19
20#include <linux/config.h>
21#include <platforms/4xx/ibm440ep.h>
22
23/* F/W TLB mapping used in bootloader glue to reset EMAC */
24#define PPC44x_EMAC0_MR0 0x0EF600E00
25
26/* Location of MAC addresses in PIBS image */
27#define PIBS_FLASH_BASE 0xfff00000
28#define PIBS_MAC_BASE (PIBS_FLASH_BASE+0xc0400)
29#define PIBS_MAC_SIZE 0x200
30#define PIBS_MAC_OFFSET 0x100
31
32/* Default clock rate */
33#define BAMBOO_TMRCLK 25000000
34
35/* RTC/NVRAM location */
36#define BAMBOO_RTC_ADDR 0x080000000ULL
37#define BAMBOO_RTC_SIZE 0x2000
38
39/* FPGA Registers */
40#define BAMBOO_FPGA_ADDR 0x080002000ULL
41
42#define BAMBOO_FPGA_CONFIG2_REG_ADDR (BAMBOO_FPGA_ADDR + 0x1)
43#define BAMBOO_FULL_DUPLEX_EN(x) (x & 0x08)
44#define BAMBOO_FORCE_100Mbps(x) (x & 0x04)
45#define BAMBOO_AUTONEGOTIATE(x) (x & 0x02)
46
47#define BAMBOO_FPGA_SETTING_REG_ADDR (BAMBOO_FPGA_ADDR + 0x3)
48#define BAMBOO_BOOT_SMALL_FLASH(x) (!(x & 0x80))
49#define BAMBOO_LARGE_FLASH_EN(x) (!(x & 0x40))
50#define BAMBOO_BOOT_NAND_FLASH(x) (!(x & 0x20))
51
52#define BAMBOO_FPGA_SELECTION1_REG_ADDR (BAMBOO_FPGA_ADDR + 0x4)
53#define BAMBOO_SEL_MII(x) (x & 0x80)
54#define BAMBOO_SEL_RMII(x) (x & 0x40)
55#define BAMBOO_SEL_SMII(x) (x & 0x20)
56
57/* Flash */
58#define BAMBOO_SMALL_FLASH_LOW 0x087f00000ULL
59#define BAMBOO_SMALL_FLASH_HIGH 0x0fff00000ULL
60#define BAMBOO_SMALL_FLASH_SIZE 0x100000
61#define BAMBOO_LARGE_FLASH_LOW 0x087800000ULL
62#define BAMBOO_LARGE_FLASH_HIGH1 0x0ff800000ULL
63#define BAMBOO_LARGE_FLASH_HIGH2 0x0ffc00000ULL
64#define BAMBOO_LARGE_FLASH_SIZE 0x400000
65#define BAMBOO_SRAM_LOW 0x087f00000ULL
66#define BAMBOO_SRAM_HIGH1 0x0fff00000ULL
67#define BAMBOO_SRAM_HIGH2 0x0ff800000ULL
68#define BAMBOO_SRAM_SIZE 0x100000
69#define BAMBOO_NAND_FLASH_REG_ADDR 0x090000000ULL
70#define BAMBOO_NAND_FLASH_REG_SIZE 0x2000
71
72/*
73 * Serial port defines
74 */
75#define RS_TABLE_SIZE 4
76
77#define UART0_IO_BASE 0xEF600300
78#define UART1_IO_BASE 0xEF600400
79#define UART2_IO_BASE 0xEF600500
80#define UART3_IO_BASE 0xEF600600
81
82#define BASE_BAUD 33177600/3/16
83#define UART0_INT 0
84#define UART1_INT 1
85#define UART2_INT 3
86#define UART3_INT 4
87
88#define STD_UART_OP(num) \
89 { 0, BASE_BAUD, 0, UART##num##_INT, \
90 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
91 iomem_base: UART##num##_IO_BASE, \
92 io_type: SERIAL_IO_MEM},
93
94#define SERIAL_PORT_DFNS \
95 STD_UART_OP(0) \
96 STD_UART_OP(1) \
97 STD_UART_OP(2) \
98 STD_UART_OP(3)
99
100/* PCI support */
101#define BAMBOO_PCI_CFGA_PLB32 0xeec00000
102#define BAMBOO_PCI_CFGD_PLB32 0xeec00004
103
104#define BAMBOO_PCI_IO_BASE 0x00000000e8000000ULL
105#define BAMBOO_PCI_IO_SIZE 0x00010000
106#define BAMBOO_PCI_MEM_OFFSET 0x00000000
107#define BAMBOO_PCI_PHY_MEM_BASE 0x00000000a0000000ULL
108
109#define BAMBOO_PCI_LOWER_IO 0x00000000
110#define BAMBOO_PCI_UPPER_IO 0x0000ffff
111#define BAMBOO_PCI_LOWER_MEM 0xa0000000
112#define BAMBOO_PCI_UPPER_MEM 0xafffffff
113#define BAMBOO_PCI_MEM_BASE 0xa0000000
114
115#define BAMBOO_PCIL0_BASE 0x00000000ef400000ULL
116#define BAMBOO_PCIL0_SIZE 0x40
117
118#define BAMBOO_PCIL0_PMM0LA 0x000
119#define BAMBOO_PCIL0_PMM0MA 0x004
120#define BAMBOO_PCIL0_PMM0PCILA 0x008
121#define BAMBOO_PCIL0_PMM0PCIHA 0x00C
122#define BAMBOO_PCIL0_PMM1LA 0x010
123#define BAMBOO_PCIL0_PMM1MA 0x014
124#define BAMBOO_PCIL0_PMM1PCILA 0x018
125#define BAMBOO_PCIL0_PMM1PCIHA 0x01C
126#define BAMBOO_PCIL0_PMM2LA 0x020
127#define BAMBOO_PCIL0_PMM2MA 0x024
128#define BAMBOO_PCIL0_PMM2PCILA 0x028
129#define BAMBOO_PCIL0_PMM2PCIHA 0x02C
130#define BAMBOO_PCIL0_PTM1MS 0x030
131#define BAMBOO_PCIL0_PTM1LA 0x034
132#define BAMBOO_PCIL0_PTM2MS 0x038
133#define BAMBOO_PCIL0_PTM2LA 0x03C
134
135#endif /* __ASM_BAMBOO_H__ */
136#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c
index cd11734ef7c5..509e69a095f0 100644
--- a/arch/ppc/platforms/4xx/ebony.c
+++ b/arch/ppc/platforms/4xx/ebony.c
@@ -7,7 +7,7 @@
7 * Copyright 2002-2005 MontaVista Software Inc. 7 * Copyright 2002-2005 MontaVista Software Inc.
8 * 8 *
9 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> 9 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
10 * Copyright (c) 2003, 2004 Zultys Technologies 10 * Copyright (c) 2003-2005 Zultys Technologies
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify it 12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the 13 * under the terms of the GNU General Public License as published by the
@@ -50,6 +50,7 @@
50#include <asm/bootinfo.h> 50#include <asm/bootinfo.h>
51#include <asm/ppc4xx_pic.h> 51#include <asm/ppc4xx_pic.h>
52#include <asm/ppcboot.h> 52#include <asm/ppcboot.h>
53#include <asm/tlbflush.h>
53 54
54#include <syslib/gen550.h> 55#include <syslib/gen550.h>
55#include <syslib/ibm440gp_common.h> 56#include <syslib/ibm440gp_common.h>
@@ -248,6 +249,9 @@ ebony_early_serial_map(void)
248#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) 249#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
249 /* Configure debug serial access */ 250 /* Configure debug serial access */
250 gen550_init(0, &port); 251 gen550_init(0, &port);
252
253 /* Purge TLB entry added in head_44x.S for early serial access */
254 _tlbie(UART0_IO_BASE);
251#endif 255#endif
252 256
253 port.membase = ioremap64(PPC440GP_UART1_ADDR, 8); 257 port.membase = ioremap64(PPC440GP_UART1_ADDR, 8);
diff --git a/arch/ppc/platforms/4xx/ebony.h b/arch/ppc/platforms/4xx/ebony.h
index 47c391c9174d..d08faa46a0ae 100644
--- a/arch/ppc/platforms/4xx/ebony.h
+++ b/arch/ppc/platforms/4xx/ebony.h
@@ -56,9 +56,18 @@
56 * Serial port defines 56 * Serial port defines
57 */ 57 */
58 58
59/* OpenBIOS defined UART mappings, used before early_serial_setup */ 59#if defined(__BOOTER__)
60/* OpenBIOS defined UART mappings, used by bootloader shim */
60#define UART0_IO_BASE 0xE0000200 61#define UART0_IO_BASE 0xE0000200
61#define UART1_IO_BASE 0xE0000300 62#define UART1_IO_BASE 0xE0000300
63#else
64/* head_44x.S created UART mapping, used before early_serial_setup.
65 * We cannot use default OpenBIOS UART mappings because they
66 * don't work for configurations with more than 512M RAM. --ebs
67 */
68#define UART0_IO_BASE 0xF0000200
69#define UART1_IO_BASE 0xF0000300
70#endif
62 71
63/* external Epson SG-615P */ 72/* external Epson SG-615P */
64#define BASE_BAUD 691200 73#define BASE_BAUD 691200
@@ -66,7 +75,7 @@
66#define STD_UART_OP(num) \ 75#define STD_UART_OP(num) \
67 { 0, BASE_BAUD, 0, UART##num##_INT, \ 76 { 0, BASE_BAUD, 0, UART##num##_INT, \
68 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ 77 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
69 iomem_base: UART##num##_IO_BASE, \ 78 iomem_base: (void*)UART##num##_IO_BASE, \
70 io_type: SERIAL_IO_MEM}, 79 io_type: SERIAL_IO_MEM},
71 80
72#define SERIAL_PORT_DFNS \ 81#define SERIAL_PORT_DFNS \
diff --git a/arch/ppc/platforms/4xx/ibm440ep.c b/arch/ppc/platforms/4xx/ibm440ep.c
new file mode 100644
index 000000000000..284da01f1ffd
--- /dev/null
+++ b/arch/ppc/platforms/4xx/ibm440ep.c
@@ -0,0 +1,220 @@
1/*
2 * arch/ppc/platforms/4xx/ibm440ep.c
3 *
4 * PPC440EP I/O descriptions
5 *
6 * Wade Farnsworth <wfarnsworth@mvista.com>
7 * Copyright 2004 MontaVista Software Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15#include <linux/init.h>
16#include <linux/module.h>
17#include <platforms/4xx/ibm440ep.h>
18#include <asm/ocp.h>
19#include <asm/ppc4xx_pic.h>
20
21static struct ocp_func_emac_data ibm440ep_emac0_def = {
22 .rgmii_idx = -1, /* No RGMII */
23 .rgmii_mux = -1, /* No RGMII */
24 .zmii_idx = 0, /* ZMII device index */
25 .zmii_mux = 0, /* ZMII input of this EMAC */
26 .mal_idx = 0, /* MAL device index */
27 .mal_rx_chan = 0, /* MAL rx channel number */
28 .mal_tx_chan = 0, /* MAL tx channel number */
29 .wol_irq = 61, /* WOL interrupt number */
30 .mdio_idx = -1, /* No shared MDIO */
31 .tah_idx = -1, /* No TAH */
32};
33
34static struct ocp_func_emac_data ibm440ep_emac1_def = {
35 .rgmii_idx = -1, /* No RGMII */
36 .rgmii_mux = -1, /* No RGMII */
37 .zmii_idx = 0, /* ZMII device index */
38 .zmii_mux = 1, /* ZMII input of this EMAC */
39 .mal_idx = 0, /* MAL device index */
40 .mal_rx_chan = 1, /* MAL rx channel number */
41 .mal_tx_chan = 2, /* MAL tx channel number */
42 .wol_irq = 63, /* WOL interrupt number */
43 .mdio_idx = -1, /* No shared MDIO */
44 .tah_idx = -1, /* No TAH */
45};
46OCP_SYSFS_EMAC_DATA()
47
48static struct ocp_func_mal_data ibm440ep_mal0_def = {
49 .num_tx_chans = 4, /* Number of TX channels */
50 .num_rx_chans = 2, /* Number of RX channels */
51 .txeob_irq = 10, /* TX End Of Buffer IRQ */
52 .rxeob_irq = 11, /* RX End Of Buffer IRQ */
53 .txde_irq = 33, /* TX Descriptor Error IRQ */
54 .rxde_irq = 34, /* RX Descriptor Error IRQ */
55 .serr_irq = 32, /* MAL System Error IRQ */
56};
57OCP_SYSFS_MAL_DATA()
58
59static struct ocp_func_iic_data ibm440ep_iic0_def = {
60 .fast_mode = 0, /* Use standad mode (100Khz) */
61};
62
63static struct ocp_func_iic_data ibm440ep_iic1_def = {
64 .fast_mode = 0, /* Use standad mode (100Khz) */
65};
66OCP_SYSFS_IIC_DATA()
67
68struct ocp_def core_ocp[] = {
69 { .vendor = OCP_VENDOR_IBM,
70 .function = OCP_FUNC_OPB,
71 .index = 0,
72 .paddr = 0x0EF600000ULL,
73 .irq = OCP_IRQ_NA,
74 .pm = OCP_CPM_NA,
75 },
76 { .vendor = OCP_VENDOR_IBM,
77 .function = OCP_FUNC_16550,
78 .index = 0,
79 .paddr = PPC440EP_UART0_ADDR,
80 .irq = UART0_INT,
81 .pm = IBM_CPM_UART0,
82 },
83 { .vendor = OCP_VENDOR_IBM,
84 .function = OCP_FUNC_16550,
85 .index = 1,
86 .paddr = PPC440EP_UART1_ADDR,
87 .irq = UART1_INT,
88 .pm = IBM_CPM_UART1,
89 },
90 { .vendor = OCP_VENDOR_IBM,
91 .function = OCP_FUNC_16550,
92 .index = 2,
93 .paddr = PPC440EP_UART2_ADDR,
94 .irq = UART2_INT,
95 .pm = IBM_CPM_UART2,
96 },
97 { .vendor = OCP_VENDOR_IBM,
98 .function = OCP_FUNC_16550,
99 .index = 3,
100 .paddr = PPC440EP_UART3_ADDR,
101 .irq = UART3_INT,
102 .pm = IBM_CPM_UART3,
103 },
104 { .vendor = OCP_VENDOR_IBM,
105 .function = OCP_FUNC_IIC,
106 .index = 0,
107 .paddr = 0x0EF600700ULL,
108 .irq = 2,
109 .pm = IBM_CPM_IIC0,
110 .additions = &ibm440ep_iic0_def,
111 .show = &ocp_show_iic_data
112 },
113 { .vendor = OCP_VENDOR_IBM,
114 .function = OCP_FUNC_IIC,
115 .index = 1,
116 .paddr = 0x0EF600800ULL,
117 .irq = 7,
118 .pm = IBM_CPM_IIC1,
119 .additions = &ibm440ep_iic1_def,
120 .show = &ocp_show_iic_data
121 },
122 { .vendor = OCP_VENDOR_IBM,
123 .function = OCP_FUNC_GPIO,
124 .index = 0,
125 .paddr = 0x0EF600B00ULL,
126 .irq = OCP_IRQ_NA,
127 .pm = IBM_CPM_GPIO0,
128 },
129 { .vendor = OCP_VENDOR_IBM,
130 .function = OCP_FUNC_GPIO,
131 .index = 1,
132 .paddr = 0x0EF600C00ULL,
133 .irq = OCP_IRQ_NA,
134 .pm = OCP_CPM_NA,
135 },
136 { .vendor = OCP_VENDOR_IBM,
137 .function = OCP_FUNC_MAL,
138 .paddr = OCP_PADDR_NA,
139 .irq = OCP_IRQ_NA,
140 .pm = OCP_CPM_NA,
141 .additions = &ibm440ep_mal0_def,
142 .show = &ocp_show_mal_data,
143 },
144 { .vendor = OCP_VENDOR_IBM,
145 .function = OCP_FUNC_EMAC,
146 .index = 0,
147 .paddr = 0x0EF600E00ULL,
148 .irq = 60,
149 .pm = OCP_CPM_NA,
150 .additions = &ibm440ep_emac0_def,
151 .show = &ocp_show_emac_data,
152 },
153 { .vendor = OCP_VENDOR_IBM,
154 .function = OCP_FUNC_EMAC,
155 .index = 1,
156 .paddr = 0x0EF600F00ULL,
157 .irq = 62,
158 .pm = OCP_CPM_NA,
159 .additions = &ibm440ep_emac1_def,
160 .show = &ocp_show_emac_data,
161 },
162 { .vendor = OCP_VENDOR_IBM,
163 .function = OCP_FUNC_ZMII,
164 .paddr = 0x0EF600D00ULL,
165 .irq = OCP_IRQ_NA,
166 .pm = OCP_CPM_NA,
167 },
168 { .vendor = OCP_VENDOR_INVALID
169 }
170};
171
172/* Polarity and triggering settings for internal interrupt sources */
173struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
174 { .polarity = 0xffbffe03,
175 .triggering = 0xfffffe00,
176 .ext_irq_mask = 0x000001fc, /* IRQ0 - IRQ6 */
177 },
178 { .polarity = 0xffffc6ef,
179 .triggering = 0xffffc7ff,
180 .ext_irq_mask = 0x00003800, /* IRQ7 - IRQ9 */
181 },
182};
183
184static struct resource usb_gadget_resources[] = {
185 [0] = {
186 .start = 0x050000100ULL,
187 .end = 0x05000017FULL,
188 .flags = IORESOURCE_MEM,
189 },
190 [1] = {
191 .start = 55,
192 .end = 55,
193 .flags = IORESOURCE_IRQ,
194 },
195};
196
197static u64 dma_mask = 0xffffffffULL;
198
199static struct platform_device usb_gadget_device = {
200 .name = "musbhsfc",
201 .id = 0,
202 .num_resources = ARRAY_SIZE(usb_gadget_resources),
203 .resource = usb_gadget_resources,
204 .dev = {
205 .dma_mask = &dma_mask,
206 .coherent_dma_mask = 0xffffffffULL,
207 }
208};
209
210static struct platform_device *ibm440ep_devs[] __initdata = {
211 &usb_gadget_device,
212};
213
214static int __init
215ibm440ep_platform_add_devices(void)
216{
217 return platform_add_devices(ibm440ep_devs, ARRAY_SIZE(ibm440ep_devs));
218}
219arch_initcall(ibm440ep_platform_add_devices);
220
diff --git a/arch/ppc/platforms/4xx/ibm440ep.h b/arch/ppc/platforms/4xx/ibm440ep.h
new file mode 100644
index 000000000000..97c80b8e3e10
--- /dev/null
+++ b/arch/ppc/platforms/4xx/ibm440ep.h
@@ -0,0 +1,76 @@
1/*
2 * arch/ppc/platforms/4xx/ibm440ep.h
3 *
4 * PPC440EP definitions
5 *
6 * Wade Farnsworth <wfarnsworth@mvista.com>
7 *
8 * Copyright 2002 Roland Dreier
9 * Copyright 2004 MontaVista Software, Inc.
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 */
17
18#ifdef __KERNEL__
19#ifndef __PPC_PLATFORMS_IBM440EP_H
20#define __PPC_PLATFORMS_IBM440EP_H
21
22#include <linux/config.h>
23#include <asm/ibm44x.h>
24
25/* UART */
26#define PPC440EP_UART0_ADDR 0x0EF600300
27#define PPC440EP_UART1_ADDR 0x0EF600400
28#define PPC440EP_UART2_ADDR 0x0EF600500
29#define PPC440EP_UART3_ADDR 0x0EF600600
30#define UART0_INT 0
31#define UART1_INT 1
32#define UART2_INT 3
33#define UART3_INT 4
34
35/* Clock and Power Management */
36#define IBM_CPM_IIC0 0x80000000 /* IIC interface */
37#define IBM_CPM_IIC1 0x40000000 /* IIC interface */
38#define IBM_CPM_PCI 0x20000000 /* PCI bridge */
39#define IBM_CPM_USB1H 0x08000000 /* USB 1.1 Host */
40#define IBM_CPM_FPU 0x04000000 /* floating point unit */
41#define IBM_CPM_CPU 0x02000000 /* processor core */
42#define IBM_CPM_DMA 0x01000000 /* DMA controller */
43#define IBM_CPM_BGO 0x00800000 /* PLB to OPB bus arbiter */
44#define IBM_CPM_BGI 0x00400000 /* OPB to PLB bridge */
45#define IBM_CPM_EBC 0x00200000 /* External Bus Controller */
46#define IBM_CPM_EBM 0x00100000 /* Ext Bus Master Interface */
47#define IBM_CPM_DMC 0x00080000 /* SDRAM peripheral controller */
48#define IBM_CPM_PLB4 0x00040000 /* PLB4 bus arbiter */
49#define IBM_CPM_PLB4x3 0x00020000 /* PLB4 to PLB3 bridge controller */
50#define IBM_CPM_PLB3x4 0x00010000 /* PLB3 to PLB4 bridge controller */
51#define IBM_CPM_PLB3 0x00008000 /* PLB3 bus arbiter */
52#define IBM_CPM_PPM 0x00002000 /* PLB Performance Monitor */
53#define IBM_CPM_UIC1 0x00001000 /* Universal Interrupt Controller */
54#define IBM_CPM_GPIO0 0x00000800 /* General Purpose IO (??) */
55#define IBM_CPM_GPT 0x00000400 /* General Purpose Timers */
56#define IBM_CPM_UART0 0x00000200 /* serial port 0 */
57#define IBM_CPM_UART1 0x00000100 /* serial port 1 */
58#define IBM_CPM_UIC0 0x00000080 /* Universal Interrupt Controller */
59#define IBM_CPM_TMRCLK 0x00000040 /* CPU timers */
60#define IBM_CPM_EMAC0 0x00000020 /* ethernet port 0 */
61#define IBM_CPM_EMAC1 0x00000010 /* ethernet port 1 */
62#define IBM_CPM_UART2 0x00000008 /* serial port 2 */
63#define IBM_CPM_UART3 0x00000004 /* serial port 3 */
64#define IBM_CPM_USB2D 0x00000002 /* USB 2.0 Device */
65#define IBM_CPM_USB2H 0x00000001 /* USB 2.0 Host */
66
67#define DFLT_IBM4xx_PM ~(IBM_CPM_UIC0 | IBM_CPM_UIC1 | IBM_CPM_CPU \
68 | IBM_CPM_EBC | IBM_CPM_BGO | IBM_CPM_FPU \
69 | IBM_CPM_EBM | IBM_CPM_PLB4 | IBM_CPM_3x4 \
70 | IBM_CPM_PLB3 | IBM_CPM_PLB4x3 \
71 | IBM_CPM_EMAC0 | IBM_CPM_TMRCLK \
72 | IBM_CPM_DMA | IBM_CPM_PCI | IBM_CPM_EMAC1)
73
74
75#endif /* __PPC_PLATFORMS_IBM440EP_H */
76#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c
index 5f82a6bc7046..8fc34a344769 100644
--- a/arch/ppc/platforms/4xx/ocotea.c
+++ b/arch/ppc/platforms/4xx/ocotea.c
@@ -48,6 +48,7 @@
48#include <asm/bootinfo.h> 48#include <asm/bootinfo.h>
49#include <asm/ppc4xx_pic.h> 49#include <asm/ppc4xx_pic.h>
50#include <asm/ppcboot.h> 50#include <asm/ppcboot.h>
51#include <asm/tlbflush.h>
51 52
52#include <syslib/gen550.h> 53#include <syslib/gen550.h>
53#include <syslib/ibm440gx_common.h> 54#include <syslib/ibm440gx_common.h>
@@ -266,6 +267,9 @@ ocotea_early_serial_map(void)
266#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) 267#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
267 /* Configure debug serial access */ 268 /* Configure debug serial access */
268 gen550_init(0, &port); 269 gen550_init(0, &port);
270
271 /* Purge TLB entry added in head_44x.S for early serial access */
272 _tlbie(UART0_IO_BASE);
269#endif 273#endif
270 274
271 port.membase = ioremap64(PPC440GX_UART1_ADDR, 8); 275 port.membase = ioremap64(PPC440GX_UART1_ADDR, 8);
diff --git a/arch/ppc/platforms/4xx/ocotea.h b/arch/ppc/platforms/4xx/ocotea.h
index 202dc8251190..33251153ac5f 100644
--- a/arch/ppc/platforms/4xx/ocotea.h
+++ b/arch/ppc/platforms/4xx/ocotea.h
@@ -55,15 +55,24 @@
55 */ 55 */
56#define RS_TABLE_SIZE 2 56#define RS_TABLE_SIZE 2
57 57
58/* OpenBIOS defined UART mappings, used before early_serial_setup */ 58#if defined(__BOOTER__)
59/* OpenBIOS defined UART mappings, used by bootloader shim */
59#define UART0_IO_BASE 0xE0000200 60#define UART0_IO_BASE 0xE0000200
60#define UART1_IO_BASE 0xE0000300 61#define UART1_IO_BASE 0xE0000300
62#else
63/* head_44x.S created UART mapping, used before early_serial_setup.
64 * We cannot use default OpenBIOS UART mappings because they
65 * don't work for configurations with more than 512M RAM. --ebs
66 */
67#define UART0_IO_BASE 0xF0000200
68#define UART1_IO_BASE 0xF0000300
69#endif
61 70
62#define BASE_BAUD 11059200/16 71#define BASE_BAUD 11059200/16
63#define STD_UART_OP(num) \ 72#define STD_UART_OP(num) \
64 { 0, BASE_BAUD, 0, UART##num##_INT, \ 73 { 0, BASE_BAUD, 0, UART##num##_INT, \
65 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ 74 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
66 iomem_base: UART##num##_IO_BASE, \ 75 iomem_base: (void*)UART##num##_IO_BASE, \
67 io_type: SERIAL_IO_MEM}, 76 io_type: SERIAL_IO_MEM},
68 77
69#define SERIAL_PORT_DFNS \ 78#define SERIAL_PORT_DFNS \
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index dec5bf4f6879..220a65ab0a51 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_PPCBUG_NVRAM) += prep_nvram.o
11obj-$(CONFIG_PPC_OCP) += ocp.o 11obj-$(CONFIG_PPC_OCP) += ocp.o
12obj-$(CONFIG_IBM_OCP) += ibm_ocp.o 12obj-$(CONFIG_IBM_OCP) += ibm_ocp.o
13obj-$(CONFIG_44x) += ibm44x_common.o 13obj-$(CONFIG_44x) += ibm44x_common.o
14obj-$(CONFIG_440EP) += ibm440gx_common.o
14obj-$(CONFIG_440GP) += ibm440gp_common.o 15obj-$(CONFIG_440GP) += ibm440gp_common.o
15obj-$(CONFIG_440GX) += ibm440gx_common.o 16obj-$(CONFIG_440GX) += ibm440gx_common.o
16obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o 17obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o
@@ -44,6 +45,7 @@ obj-$(CONFIG_PPC_CHRP) += open_pic.o indirect_pci.o i8259.o
44obj-$(CONFIG_PPC_PREP) += open_pic.o indirect_pci.o i8259.o todc_time.o 45obj-$(CONFIG_PPC_PREP) += open_pic.o indirect_pci.o i8259.o todc_time.o
45obj-$(CONFIG_ADIR) += i8259.o indirect_pci.o pci_auto.o \ 46obj-$(CONFIG_ADIR) += i8259.o indirect_pci.o pci_auto.o \
46 todc_time.o 47 todc_time.o
48obj-$(CONFIG_BAMBOO) += indirect_pci.o pci_auto.o todc_time.o
47obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o 49obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o
48obj-$(CONFIG_EBONY) += indirect_pci.o pci_auto.o todc_time.o 50obj-$(CONFIG_EBONY) += indirect_pci.o pci_auto.o todc_time.o
49obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o 51obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o
diff --git a/arch/ppc/syslib/ibm440gx_common.c b/arch/ppc/syslib/ibm440gx_common.c
index 4ad85e0e0234..d4776af6a3ca 100644
--- a/arch/ppc/syslib/ibm440gx_common.c
+++ b/arch/ppc/syslib/ibm440gx_common.c
@@ -34,6 +34,10 @@ void __init ibm440gx_get_clocks(struct ibm44x_clocks* p, unsigned int sys_clk,
34 u32 plld = CPR_READ(DCRN_CPR_PLLD); 34 u32 plld = CPR_READ(DCRN_CPR_PLLD);
35 u32 uart0 = SDR_READ(DCRN_SDR_UART0); 35 u32 uart0 = SDR_READ(DCRN_SDR_UART0);
36 u32 uart1 = SDR_READ(DCRN_SDR_UART1); 36 u32 uart1 = SDR_READ(DCRN_SDR_UART1);
37#ifdef CONFIG_440EP
38 u32 uart2 = SDR_READ(DCRN_SDR_UART2);
39 u32 uart3 = SDR_READ(DCRN_SDR_UART3);
40#endif
37 41
38 /* Dividers */ 42 /* Dividers */
39 u32 fbdv = __fix_zero((plld >> 24) & 0x1f, 32); 43 u32 fbdv = __fix_zero((plld >> 24) & 0x1f, 32);
@@ -96,6 +100,17 @@ bypass:
96 p->uart1 = ser_clk; 100 p->uart1 = ser_clk;
97 else 101 else
98 p->uart1 = p->plb / __fix_zero(uart1 & 0xff, 256); 102 p->uart1 = p->plb / __fix_zero(uart1 & 0xff, 256);
103#ifdef CONFIG_440EP
104 if (uart2 & 0x00800000)
105 p->uart2 = ser_clk;
106 else
107 p->uart2 = p->plb / __fix_zero(uart2 & 0xff, 256);
108
109 if (uart3 & 0x00800000)
110 p->uart3 = ser_clk;
111 else
112 p->uart3 = p->plb / __fix_zero(uart3 & 0xff, 256);
113#endif
99} 114}
100 115
101/* Issue L2C diagnostic command */ 116/* Issue L2C diagnostic command */
diff --git a/arch/ppc/syslib/ibm44x_common.h b/arch/ppc/syslib/ibm44x_common.h
index b14eb603ce01..c16b6a5ac6ab 100644
--- a/arch/ppc/syslib/ibm44x_common.h
+++ b/arch/ppc/syslib/ibm44x_common.h
@@ -29,6 +29,10 @@ struct ibm44x_clocks {
29 unsigned int ebc; /* PerClk */ 29 unsigned int ebc; /* PerClk */
30 unsigned int uart0; 30 unsigned int uart0;
31 unsigned int uart1; 31 unsigned int uart1;
32#ifdef CONFIG_440EP
33 unsigned int uart2;
34 unsigned int uart3;
35#endif
32}; 36};
33 37
34/* common 44x platform init */ 38/* common 44x platform init */
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c
index c1db2ab1d154..55a381af4e37 100644
--- a/arch/ppc/syslib/m8xx_setup.c
+++ b/arch/ppc/syslib/m8xx_setup.c
@@ -57,7 +57,7 @@ unsigned char __res[sizeof(bd_t)];
57extern void m8xx_ide_init(void); 57extern void m8xx_ide_init(void);
58 58
59extern unsigned long find_available_memory(void); 59extern unsigned long find_available_memory(void);
60extern void m8xx_cpm_reset(uint cpm_page); 60extern void m8xx_cpm_reset();
61extern void m8xx_wdt_handler_install(bd_t *bp); 61extern void m8xx_wdt_handler_install(bd_t *bp);
62extern void rpxfb_alloc_pages(void); 62extern void rpxfb_alloc_pages(void);
63extern void cpm_interrupt_init(void); 63extern void cpm_interrupt_init(void);
@@ -70,13 +70,9 @@ board_init(void)
70void __init 70void __init
71m8xx_setup_arch(void) 71m8xx_setup_arch(void)
72{ 72{
73 int cpm_page;
74
75 cpm_page = (int) alloc_bootmem_pages(PAGE_SIZE);
76
77 /* Reset the Communication Processor Module. 73 /* Reset the Communication Processor Module.
78 */ 74 */
79 m8xx_cpm_reset(cpm_page); 75 m8xx_cpm_reset();
80 76
81#ifdef CONFIG_FB_RPX 77#ifdef CONFIG_FB_RPX
82 rpxfb_alloc_pages(); 78 rpxfb_alloc_pages();
diff --git a/arch/ppc/syslib/mpc83xx_devices.c b/arch/ppc/syslib/mpc83xx_devices.c
index 75c8e9834ae7..5aaf0e58e1f9 100644
--- a/arch/ppc/syslib/mpc83xx_devices.c
+++ b/arch/ppc/syslib/mpc83xx_devices.c
@@ -191,8 +191,8 @@ struct platform_device ppc_sys_platform_devices[] = {
191 .num_resources = 2, 191 .num_resources = 2,
192 .resource = (struct resource[]) { 192 .resource = (struct resource[]) {
193 { 193 {
194 .start = 0x22000, 194 .start = 0x23000,
195 .end = 0x22fff, 195 .end = 0x23fff,
196 .flags = IORESOURCE_MEM, 196 .flags = IORESOURCE_MEM,
197 }, 197 },
198 { 198 {
@@ -208,8 +208,8 @@ struct platform_device ppc_sys_platform_devices[] = {
208 .num_resources = 2, 208 .num_resources = 2,
209 .resource = (struct resource[]) { 209 .resource = (struct resource[]) {
210 { 210 {
211 .start = 0x23000, 211 .start = 0x22000,
212 .end = 0x23fff, 212 .end = 0x22fff,
213 .flags = IORESOURCE_MEM, 213 .flags = IORESOURCE_MEM,
214 }, 214 },
215 { 215 {
diff --git a/arch/ppc64/boot/zlib.c b/arch/ppc64/boot/zlib.c
index 9d5e4e9832d2..78837e884b8b 100644
--- a/arch/ppc64/boot/zlib.c
+++ b/arch/ppc64/boot/zlib.c
@@ -1307,7 +1307,7 @@ local int huft_build(
1307 { 1307 {
1308 *t = (inflate_huft *)Z_NULL; 1308 *t = (inflate_huft *)Z_NULL;
1309 *m = 0; 1309 *m = 0;
1310 return Z_OK; 1310 return Z_DATA_ERROR;
1311 } 1311 }
1312 1312
1313 1313
@@ -1351,6 +1351,7 @@ local int huft_build(
1351 if ((j = *p++) != 0) 1351 if ((j = *p++) != 0)
1352 v[x[j]++] = i; 1352 v[x[j]++] = i;
1353 } while (++i < n); 1353 } while (++i < n);
1354 n = x[g]; /* set n to length of v */
1354 1355
1355 1356
1356 /* Generate the Huffman codes and for each, make the table entries */ 1357 /* Generate the Huffman codes and for each, make the table entries */
diff --git a/arch/ppc64/configs/bpa_defconfig b/arch/ppc64/configs/bpa_defconfig
new file mode 100644
index 000000000000..46c5da41c3ae
--- /dev/null
+++ b/arch/ppc64/configs/bpa_defconfig
@@ -0,0 +1,987 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-rc6
4# Mon Aug 8 14:12:19 2005
5#
6CONFIG_64BIT=y
7CONFIG_MMU=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_GENERIC_ISA_DMA=y
11CONFIG_HAVE_DEC_LOCK=y
12CONFIG_EARLY_PRINTK=y
13CONFIG_COMPAT=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15CONFIG_FORCE_MAX_ZONEORDER=13
16
17#
18# Code maturity level options
19#
20CONFIG_EXPERIMENTAL=y
21CONFIG_CLEAN_COMPILE=y
22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
24
25#
26# General setup
27#
28CONFIG_LOCALVERSION=""
29CONFIG_SWAP=y
30CONFIG_SYSVIPC=y
31# CONFIG_POSIX_MQUEUE is not set
32# CONFIG_BSD_PROCESS_ACCT is not set
33CONFIG_SYSCTL=y
34# CONFIG_AUDIT is not set
35CONFIG_HOTPLUG=y
36CONFIG_KOBJECT_UEVENT=y
37# CONFIG_IKCONFIG is not set
38# CONFIG_CPUSETS is not set
39# CONFIG_EMBEDDED is not set
40CONFIG_KALLSYMS=y
41# CONFIG_KALLSYMS_ALL is not set
42# CONFIG_KALLSYMS_EXTRA_PASS is not set
43CONFIG_PRINTK=y
44CONFIG_BUG=y
45CONFIG_BASE_FULL=y
46CONFIG_FUTEX=y
47CONFIG_EPOLL=y
48CONFIG_SHMEM=y
49CONFIG_CC_ALIGN_FUNCTIONS=0
50CONFIG_CC_ALIGN_LABELS=0
51CONFIG_CC_ALIGN_LOOPS=0
52CONFIG_CC_ALIGN_JUMPS=0
53# CONFIG_TINY_SHMEM is not set
54CONFIG_BASE_SMALL=0
55
56#
57# Loadable module support
58#
59CONFIG_MODULES=y
60CONFIG_MODULE_UNLOAD=y
61# CONFIG_MODULE_FORCE_UNLOAD is not set
62CONFIG_OBSOLETE_MODPARM=y
63# CONFIG_MODVERSIONS is not set
64# CONFIG_MODULE_SRCVERSION_ALL is not set
65# CONFIG_KMOD is not set
66CONFIG_STOP_MACHINE=y
67CONFIG_SYSVIPC_COMPAT=y
68
69#
70# Platform support
71#
72# CONFIG_PPC_ISERIES is not set
73CONFIG_PPC_MULTIPLATFORM=y
74# CONFIG_PPC_PSERIES is not set
75CONFIG_PPC_BPA=y
76# CONFIG_PPC_PMAC is not set
77# CONFIG_PPC_MAPLE is not set
78CONFIG_PPC=y
79CONFIG_PPC64=y
80CONFIG_PPC_OF=y
81CONFIG_BPA_IIC=y
82CONFIG_ALTIVEC=y
83CONFIG_KEXEC=y
84# CONFIG_U3_DART is not set
85# CONFIG_BOOTX_TEXT is not set
86# CONFIG_POWER4_ONLY is not set
87# CONFIG_IOMMU_VMERGE is not set
88CONFIG_SMP=y
89CONFIG_NR_CPUS=4
90CONFIG_ARCH_SELECT_MEMORY_MODEL=y
91CONFIG_ARCH_FLATMEM_ENABLE=y
92CONFIG_SELECT_MEMORY_MODEL=y
93CONFIG_FLATMEM_MANUAL=y
94# CONFIG_DISCONTIGMEM_MANUAL is not set
95# CONFIG_SPARSEMEM_MANUAL is not set
96CONFIG_FLATMEM=y
97CONFIG_FLAT_NODE_MEM_MAP=y
98# CONFIG_NUMA is not set
99CONFIG_SCHED_SMT=y
100CONFIG_PREEMPT_NONE=y
101# CONFIG_PREEMPT_VOLUNTARY is not set
102# CONFIG_PREEMPT is not set
103CONFIG_PREEMPT_BKL=y
104# CONFIG_HZ_100 is not set
105CONFIG_HZ_250=y
106# CONFIG_HZ_1000 is not set
107CONFIG_HZ=250
108CONFIG_GENERIC_HARDIRQS=y
109CONFIG_PPC_RTAS=y
110CONFIG_RTAS_PROC=y
111CONFIG_RTAS_FLASH=y
112CONFIG_SECCOMP=y
113CONFIG_ISA_DMA_API=y
114
115#
116# General setup
117#
118CONFIG_PCI=y
119CONFIG_PCI_DOMAINS=y
120CONFIG_BINFMT_ELF=y
121# CONFIG_BINFMT_MISC is not set
122CONFIG_PCI_LEGACY_PROC=y
123CONFIG_PCI_NAMES=y
124# CONFIG_PCI_DEBUG is not set
125
126#
127# PCCARD (PCMCIA/CardBus) support
128#
129# CONFIG_PCCARD is not set
130
131#
132# PCI Hotplug Support
133#
134# CONFIG_HOTPLUG_PCI is not set
135CONFIG_PROC_DEVICETREE=y
136# CONFIG_CMDLINE_BOOL is not set
137
138#
139# Networking
140#
141CONFIG_NET=y
142
143#
144# Networking options
145#
146CONFIG_PACKET=y
147# CONFIG_PACKET_MMAP is not set
148CONFIG_UNIX=y
149CONFIG_XFRM=y
150# CONFIG_XFRM_USER is not set
151# CONFIG_NET_KEY is not set
152CONFIG_INET=y
153CONFIG_IP_MULTICAST=y
154# CONFIG_IP_ADVANCED_ROUTER is not set
155CONFIG_IP_FIB_HASH=y
156# CONFIG_IP_PNP is not set
157CONFIG_NET_IPIP=y
158# CONFIG_NET_IPGRE is not set
159# CONFIG_IP_MROUTE is not set
160# CONFIG_ARPD is not set
161CONFIG_SYN_COOKIES=y
162# CONFIG_INET_AH is not set
163# CONFIG_INET_ESP is not set
164# CONFIG_INET_IPCOMP is not set
165CONFIG_INET_TUNNEL=y
166CONFIG_IP_TCPDIAG=y
167CONFIG_IP_TCPDIAG_IPV6=y
168# CONFIG_TCP_CONG_ADVANCED is not set
169CONFIG_TCP_CONG_BIC=y
170
171#
172# IP: Virtual Server Configuration
173#
174# CONFIG_IP_VS is not set
175CONFIG_IPV6=y
176# CONFIG_IPV6_PRIVACY is not set
177CONFIG_INET6_AH=m
178CONFIG_INET6_ESP=m
179CONFIG_INET6_IPCOMP=m
180CONFIG_INET6_TUNNEL=m
181CONFIG_IPV6_TUNNEL=m
182CONFIG_NETFILTER=y
183# CONFIG_NETFILTER_DEBUG is not set
184
185#
186# IP: Netfilter Configuration
187#
188CONFIG_IP_NF_CONNTRACK=y
189# CONFIG_IP_NF_CT_ACCT is not set
190# CONFIG_IP_NF_CONNTRACK_MARK is not set
191CONFIG_IP_NF_CT_PROTO_SCTP=y
192CONFIG_IP_NF_FTP=m
193CONFIG_IP_NF_IRC=m
194CONFIG_IP_NF_TFTP=m
195CONFIG_IP_NF_AMANDA=m
196CONFIG_IP_NF_QUEUE=m
197CONFIG_IP_NF_IPTABLES=m
198CONFIG_IP_NF_MATCH_LIMIT=m
199CONFIG_IP_NF_MATCH_IPRANGE=m
200CONFIG_IP_NF_MATCH_MAC=m
201CONFIG_IP_NF_MATCH_PKTTYPE=m
202CONFIG_IP_NF_MATCH_MARK=m
203CONFIG_IP_NF_MATCH_MULTIPORT=m
204CONFIG_IP_NF_MATCH_TOS=m
205CONFIG_IP_NF_MATCH_RECENT=m
206CONFIG_IP_NF_MATCH_ECN=m
207CONFIG_IP_NF_MATCH_DSCP=m
208CONFIG_IP_NF_MATCH_AH_ESP=m
209CONFIG_IP_NF_MATCH_LENGTH=m
210CONFIG_IP_NF_MATCH_TTL=m
211CONFIG_IP_NF_MATCH_TCPMSS=m
212CONFIG_IP_NF_MATCH_HELPER=m
213CONFIG_IP_NF_MATCH_STATE=m
214CONFIG_IP_NF_MATCH_CONNTRACK=m
215CONFIG_IP_NF_MATCH_OWNER=m
216CONFIG_IP_NF_MATCH_ADDRTYPE=m
217CONFIG_IP_NF_MATCH_REALM=m
218CONFIG_IP_NF_MATCH_SCTP=m
219CONFIG_IP_NF_MATCH_COMMENT=m
220CONFIG_IP_NF_MATCH_HASHLIMIT=m
221CONFIG_IP_NF_FILTER=m
222CONFIG_IP_NF_TARGET_REJECT=m
223CONFIG_IP_NF_TARGET_LOG=m
224CONFIG_IP_NF_TARGET_ULOG=m
225CONFIG_IP_NF_TARGET_TCPMSS=m
226CONFIG_IP_NF_NAT=m
227CONFIG_IP_NF_NAT_NEEDED=y
228CONFIG_IP_NF_TARGET_MASQUERADE=m
229CONFIG_IP_NF_TARGET_REDIRECT=m
230CONFIG_IP_NF_TARGET_NETMAP=m
231CONFIG_IP_NF_TARGET_SAME=m
232CONFIG_IP_NF_NAT_SNMP_BASIC=m
233CONFIG_IP_NF_NAT_IRC=m
234CONFIG_IP_NF_NAT_FTP=m
235CONFIG_IP_NF_NAT_TFTP=m
236CONFIG_IP_NF_NAT_AMANDA=m
237CONFIG_IP_NF_MANGLE=m
238CONFIG_IP_NF_TARGET_TOS=m
239CONFIG_IP_NF_TARGET_ECN=m
240CONFIG_IP_NF_TARGET_DSCP=m
241CONFIG_IP_NF_TARGET_MARK=m
242CONFIG_IP_NF_TARGET_CLASSIFY=m
243CONFIG_IP_NF_RAW=m
244CONFIG_IP_NF_TARGET_NOTRACK=m
245CONFIG_IP_NF_ARPTABLES=m
246CONFIG_IP_NF_ARPFILTER=m
247CONFIG_IP_NF_ARP_MANGLE=m
248
249#
250# IPv6: Netfilter Configuration (EXPERIMENTAL)
251#
252# CONFIG_IP6_NF_QUEUE is not set
253# CONFIG_IP6_NF_IPTABLES is not set
254
255#
256# SCTP Configuration (EXPERIMENTAL)
257#
258# CONFIG_IP_SCTP is not set
259# CONFIG_ATM is not set
260# CONFIG_BRIDGE is not set
261# CONFIG_VLAN_8021Q is not set
262# CONFIG_DECNET is not set
263# CONFIG_LLC2 is not set
264# CONFIG_IPX is not set
265# CONFIG_ATALK is not set
266# CONFIG_X25 is not set
267# CONFIG_LAPB is not set
268# CONFIG_NET_DIVERT is not set
269# CONFIG_ECONET is not set
270# CONFIG_WAN_ROUTER is not set
271# CONFIG_NET_SCHED is not set
272CONFIG_NET_CLS_ROUTE=y
273
274#
275# Network testing
276#
277# CONFIG_NET_PKTGEN is not set
278# CONFIG_HAMRADIO is not set
279# CONFIG_IRDA is not set
280# CONFIG_BT is not set
281
282#
283# Device Drivers
284#
285
286#
287# Generic Driver Options
288#
289CONFIG_STANDALONE=y
290CONFIG_PREVENT_FIRMWARE_BUILD=y
291CONFIG_FW_LOADER=y
292# CONFIG_DEBUG_DRIVER is not set
293
294#
295# Memory Technology Devices (MTD)
296#
297# CONFIG_MTD is not set
298
299#
300# Parallel port support
301#
302# CONFIG_PARPORT is not set
303
304#
305# Plug and Play support
306#
307
308#
309# Block devices
310#
311# CONFIG_BLK_DEV_FD is not set
312# CONFIG_BLK_CPQ_DA is not set
313# CONFIG_BLK_CPQ_CISS_DA is not set
314# CONFIG_BLK_DEV_DAC960 is not set
315# CONFIG_BLK_DEV_UMEM is not set
316# CONFIG_BLK_DEV_COW_COMMON is not set
317CONFIG_BLK_DEV_LOOP=y
318# CONFIG_BLK_DEV_CRYPTOLOOP is not set
319CONFIG_BLK_DEV_NBD=y
320# CONFIG_BLK_DEV_SX8 is not set
321CONFIG_BLK_DEV_RAM=y
322CONFIG_BLK_DEV_RAM_COUNT=16
323CONFIG_BLK_DEV_RAM_SIZE=131072
324CONFIG_BLK_DEV_INITRD=y
325CONFIG_INITRAMFS_SOURCE=""
326# CONFIG_CDROM_PKTCDVD is not set
327
328#
329# IO Schedulers
330#
331CONFIG_IOSCHED_NOOP=y
332CONFIG_IOSCHED_AS=y
333CONFIG_IOSCHED_DEADLINE=y
334CONFIG_IOSCHED_CFQ=y
335# CONFIG_ATA_OVER_ETH is not set
336
337#
338# ATA/ATAPI/MFM/RLL support
339#
340CONFIG_IDE=y
341CONFIG_BLK_DEV_IDE=y
342
343#
344# Please see Documentation/ide.txt for help/info on IDE drives
345#
346# CONFIG_BLK_DEV_IDE_SATA is not set
347CONFIG_BLK_DEV_IDEDISK=y
348CONFIG_IDEDISK_MULTI_MODE=y
349# CONFIG_BLK_DEV_IDECD is not set
350# CONFIG_BLK_DEV_IDETAPE is not set
351# CONFIG_BLK_DEV_IDEFLOPPY is not set
352# CONFIG_IDE_TASK_IOCTL is not set
353
354#
355# IDE chipset support/bugfixes
356#
357CONFIG_IDE_GENERIC=y
358CONFIG_BLK_DEV_IDEPCI=y
359CONFIG_IDEPCI_SHARE_IRQ=y
360# CONFIG_BLK_DEV_OFFBOARD is not set
361CONFIG_BLK_DEV_GENERIC=y
362# CONFIG_BLK_DEV_OPTI621 is not set
363# CONFIG_BLK_DEV_SL82C105 is not set
364CONFIG_BLK_DEV_IDEDMA_PCI=y
365# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
366CONFIG_IDEDMA_PCI_AUTO=y
367# CONFIG_IDEDMA_ONLYDISK is not set
368CONFIG_BLK_DEV_AEC62XX=y
369# CONFIG_BLK_DEV_ALI15X3 is not set
370# CONFIG_BLK_DEV_AMD74XX is not set
371# CONFIG_BLK_DEV_CMD64X is not set
372# CONFIG_BLK_DEV_TRIFLEX is not set
373# CONFIG_BLK_DEV_CY82C693 is not set
374# CONFIG_BLK_DEV_CS5520 is not set
375# CONFIG_BLK_DEV_CS5530 is not set
376# CONFIG_BLK_DEV_HPT34X is not set
377# CONFIG_BLK_DEV_HPT366 is not set
378# CONFIG_BLK_DEV_SC1200 is not set
379# CONFIG_BLK_DEV_PIIX is not set
380# CONFIG_BLK_DEV_IT821X is not set
381# CONFIG_BLK_DEV_NS87415 is not set
382# CONFIG_BLK_DEV_PDC202XX_OLD is not set
383# CONFIG_BLK_DEV_PDC202XX_NEW is not set
384# CONFIG_BLK_DEV_SVWKS is not set
385CONFIG_BLK_DEV_SIIMAGE=y
386# CONFIG_BLK_DEV_SLC90E66 is not set
387# CONFIG_BLK_DEV_TRM290 is not set
388# CONFIG_BLK_DEV_VIA82CXXX is not set
389# CONFIG_IDE_ARM is not set
390CONFIG_BLK_DEV_IDEDMA=y
391# CONFIG_IDEDMA_IVB is not set
392CONFIG_IDEDMA_AUTO=y
393# CONFIG_BLK_DEV_HD is not set
394
395#
396# SCSI device support
397#
398# CONFIG_SCSI is not set
399
400#
401# Multi-device support (RAID and LVM)
402#
403# CONFIG_MD is not set
404
405#
406# Fusion MPT device support
407#
408# CONFIG_FUSION is not set
409
410#
411# IEEE 1394 (FireWire) support
412#
413# CONFIG_IEEE1394 is not set
414
415#
416# I2O device support
417#
418# CONFIG_I2O is not set
419
420#
421# Macintosh device drivers
422#
423
424#
425# Network device support
426#
427CONFIG_NETDEVICES=y
428# CONFIG_DUMMY is not set
429# CONFIG_BONDING is not set
430# CONFIG_EQUALIZER is not set
431# CONFIG_TUN is not set
432
433#
434# ARCnet devices
435#
436# CONFIG_ARCNET is not set
437
438#
439# Ethernet (10 or 100Mbit)
440#
441CONFIG_NET_ETHERNET=y
442CONFIG_MII=y
443# CONFIG_HAPPYMEAL is not set
444# CONFIG_SUNGEM is not set
445# CONFIG_NET_VENDOR_3COM is not set
446
447#
448# Tulip family network device support
449#
450# CONFIG_NET_TULIP is not set
451# CONFIG_HP100 is not set
452# CONFIG_NET_PCI is not set
453
454#
455# Ethernet (1000 Mbit)
456#
457# CONFIG_ACENIC is not set
458# CONFIG_DL2K is not set
459CONFIG_E1000=m
460# CONFIG_E1000_NAPI is not set
461# CONFIG_NS83820 is not set
462# CONFIG_HAMACHI is not set
463# CONFIG_YELLOWFIN is not set
464# CONFIG_R8169 is not set
465CONFIG_SKGE=m
466# CONFIG_SK98LIN is not set
467# CONFIG_TIGON3 is not set
468# CONFIG_BNX2 is not set
469# CONFIG_MV643XX_ETH is not set
470
471#
472# Ethernet (10000 Mbit)
473#
474# CONFIG_IXGB is not set
475# CONFIG_S2IO is not set
476
477#
478# Token Ring devices
479#
480# CONFIG_TR is not set
481
482#
483# Wireless LAN (non-hamradio)
484#
485# CONFIG_NET_RADIO is not set
486
487#
488# Wan interfaces
489#
490# CONFIG_WAN is not set
491# CONFIG_FDDI is not set
492# CONFIG_HIPPI is not set
493# CONFIG_PPP is not set
494# CONFIG_SLIP is not set
495# CONFIG_SHAPER is not set
496# CONFIG_NETCONSOLE is not set
497# CONFIG_NETPOLL is not set
498# CONFIG_NET_POLL_CONTROLLER is not set
499
500#
501# ISDN subsystem
502#
503# CONFIG_ISDN is not set
504
505#
506# Telephony Support
507#
508# CONFIG_PHONE is not set
509
510#
511# Input device support
512#
513CONFIG_INPUT=y
514
515#
516# Userland interfaces
517#
518CONFIG_INPUT_MOUSEDEV=y
519# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
520CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
521CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
522# CONFIG_INPUT_JOYDEV is not set
523# CONFIG_INPUT_TSDEV is not set
524# CONFIG_INPUT_EVDEV is not set
525# CONFIG_INPUT_EVBUG is not set
526
527#
528# Input Device Drivers
529#
530# CONFIG_INPUT_KEYBOARD is not set
531# CONFIG_INPUT_MOUSE is not set
532# CONFIG_INPUT_JOYSTICK is not set
533# CONFIG_INPUT_TOUCHSCREEN is not set
534# CONFIG_INPUT_MISC is not set
535
536#
537# Hardware I/O ports
538#
539CONFIG_SERIO=y
540# CONFIG_SERIO_I8042 is not set
541CONFIG_SERIO_SERPORT=y
542# CONFIG_SERIO_PCIPS2 is not set
543# CONFIG_SERIO_RAW is not set
544# CONFIG_GAMEPORT is not set
545
546#
547# Character devices
548#
549CONFIG_VT=y
550CONFIG_VT_CONSOLE=y
551CONFIG_HW_CONSOLE=y
552CONFIG_SERIAL_NONSTANDARD=y
553# CONFIG_ROCKETPORT is not set
554# CONFIG_CYCLADES is not set
555# CONFIG_MOXA_SMARTIO is not set
556# CONFIG_ISI is not set
557# CONFIG_SYNCLINK is not set
558# CONFIG_SYNCLINKMP is not set
559# CONFIG_N_HDLC is not set
560# CONFIG_SPECIALIX is not set
561# CONFIG_SX is not set
562# CONFIG_STALDRV is not set
563
564#
565# Serial drivers
566#
567CONFIG_SERIAL_8250=y
568CONFIG_SERIAL_8250_CONSOLE=y
569CONFIG_SERIAL_8250_NR_UARTS=4
570# CONFIG_SERIAL_8250_EXTENDED is not set
571
572#
573# Non-8250 serial port support
574#
575CONFIG_SERIAL_CORE=y
576CONFIG_SERIAL_CORE_CONSOLE=y
577# CONFIG_SERIAL_JSM is not set
578CONFIG_UNIX98_PTYS=y
579# CONFIG_LEGACY_PTYS is not set
580
581#
582# IPMI
583#
584# CONFIG_IPMI_HANDLER is not set
585
586#
587# Watchdog Cards
588#
589CONFIG_WATCHDOG=y
590# CONFIG_WATCHDOG_NOWAYOUT is not set
591
592#
593# Watchdog Device Drivers
594#
595# CONFIG_SOFT_WATCHDOG is not set
596CONFIG_WATCHDOG_RTAS=y
597
598#
599# PCI-based Watchdog Cards
600#
601# CONFIG_PCIPCWATCHDOG is not set
602# CONFIG_WDTPCI is not set
603# CONFIG_RTC is not set
604# CONFIG_DTLK is not set
605# CONFIG_R3964 is not set
606# CONFIG_APPLICOM is not set
607
608#
609# Ftape, the floppy tape device driver
610#
611# CONFIG_AGP is not set
612# CONFIG_DRM is not set
613# CONFIG_RAW_DRIVER is not set
614# CONFIG_HANGCHECK_TIMER is not set
615
616#
617# TPM devices
618#
619# CONFIG_TCG_TPM is not set
620
621#
622# I2C support
623#
624CONFIG_I2C=y
625# CONFIG_I2C_CHARDEV is not set
626
627#
628# I2C Algorithms
629#
630CONFIG_I2C_ALGOBIT=y
631# CONFIG_I2C_ALGOPCF is not set
632# CONFIG_I2C_ALGOPCA is not set
633
634#
635# I2C Hardware Bus support
636#
637# CONFIG_I2C_ALI1535 is not set
638# CONFIG_I2C_ALI1563 is not set
639# CONFIG_I2C_ALI15X3 is not set
640# CONFIG_I2C_AMD756 is not set
641# CONFIG_I2C_AMD8111 is not set
642# CONFIG_I2C_I801 is not set
643# CONFIG_I2C_I810 is not set
644# CONFIG_I2C_PIIX4 is not set
645# CONFIG_I2C_ISA is not set
646# CONFIG_I2C_NFORCE2 is not set
647# CONFIG_I2C_PARPORT_LIGHT is not set
648# CONFIG_I2C_PROSAVAGE is not set
649# CONFIG_I2C_SAVAGE4 is not set
650# CONFIG_SCx200_ACB is not set
651# CONFIG_I2C_SIS5595 is not set
652# CONFIG_I2C_SIS630 is not set
653# CONFIG_I2C_SIS96X is not set
654# CONFIG_I2C_STUB is not set
655# CONFIG_I2C_VIA is not set
656# CONFIG_I2C_VIAPRO is not set
657# CONFIG_I2C_VOODOO3 is not set
658# CONFIG_I2C_PCA_ISA is not set
659# CONFIG_I2C_SENSOR is not set
660
661#
662# Miscellaneous I2C Chip support
663#
664# CONFIG_SENSORS_DS1337 is not set
665# CONFIG_SENSORS_DS1374 is not set
666# CONFIG_SENSORS_EEPROM is not set
667# CONFIG_SENSORS_PCF8574 is not set
668# CONFIG_SENSORS_PCA9539 is not set
669# CONFIG_SENSORS_PCF8591 is not set
670# CONFIG_SENSORS_RTC8564 is not set
671# CONFIG_SENSORS_MAX6875 is not set
672# CONFIG_I2C_DEBUG_CORE is not set
673# CONFIG_I2C_DEBUG_ALGO is not set
674# CONFIG_I2C_DEBUG_BUS is not set
675# CONFIG_I2C_DEBUG_CHIP is not set
676
677#
678# Dallas's 1-wire bus
679#
680# CONFIG_W1 is not set
681
682#
683# Hardware Monitoring support
684#
685# CONFIG_HWMON is not set
686
687#
688# Misc devices
689#
690
691#
692# Multimedia devices
693#
694# CONFIG_VIDEO_DEV is not set
695
696#
697# Digital Video Broadcasting Devices
698#
699# CONFIG_DVB is not set
700
701#
702# Graphics support
703#
704# CONFIG_FB is not set
705
706#
707# Console display driver support
708#
709# CONFIG_VGA_CONSOLE is not set
710CONFIG_DUMMY_CONSOLE=y
711
712#
713# Sound
714#
715# CONFIG_SOUND is not set
716
717#
718# USB support
719#
720CONFIG_USB_ARCH_HAS_HCD=y
721CONFIG_USB_ARCH_HAS_OHCI=y
722# CONFIG_USB is not set
723
724#
725# USB Gadget Support
726#
727# CONFIG_USB_GADGET is not set
728
729#
730# MMC/SD Card support
731#
732# CONFIG_MMC is not set
733
734#
735# InfiniBand support
736#
737# CONFIG_INFINIBAND is not set
738
739#
740# SN Devices
741#
742
743#
744# File systems
745#
746CONFIG_EXT2_FS=y
747# CONFIG_EXT2_FS_XATTR is not set
748# CONFIG_EXT2_FS_XIP is not set
749CONFIG_EXT3_FS=y
750CONFIG_EXT3_FS_XATTR=y
751# CONFIG_EXT3_FS_POSIX_ACL is not set
752# CONFIG_EXT3_FS_SECURITY is not set
753CONFIG_JBD=y
754# CONFIG_JBD_DEBUG is not set
755CONFIG_FS_MBCACHE=y
756# CONFIG_REISERFS_FS is not set
757# CONFIG_JFS_FS is not set
758CONFIG_FS_POSIX_ACL=y
759
760#
761# XFS support
762#
763# CONFIG_XFS_FS is not set
764# CONFIG_MINIX_FS is not set
765# CONFIG_ROMFS_FS is not set
766CONFIG_INOTIFY=y
767# CONFIG_QUOTA is not set
768CONFIG_DNOTIFY=y
769# CONFIG_AUTOFS_FS is not set
770# CONFIG_AUTOFS4_FS is not set
771
772#
773# CD-ROM/DVD Filesystems
774#
775CONFIG_ISO9660_FS=m
776CONFIG_JOLIET=y
777# CONFIG_ZISOFS is not set
778CONFIG_UDF_FS=m
779CONFIG_UDF_NLS=y
780
781#
782# DOS/FAT/NT Filesystems
783#
784CONFIG_FAT_FS=m
785CONFIG_MSDOS_FS=m
786CONFIG_VFAT_FS=m
787CONFIG_FAT_DEFAULT_CODEPAGE=437
788CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
789# CONFIG_NTFS_FS is not set
790
791#
792# Pseudo filesystems
793#
794CONFIG_PROC_FS=y
795CONFIG_PROC_KCORE=y
796CONFIG_SYSFS=y
797# CONFIG_DEVPTS_FS_XATTR is not set
798CONFIG_TMPFS=y
799CONFIG_TMPFS_XATTR=y
800# CONFIG_TMPFS_SECURITY is not set
801CONFIG_HUGETLBFS=y
802CONFIG_HUGETLB_PAGE=y
803CONFIG_RAMFS=y
804
805#
806# Miscellaneous filesystems
807#
808# CONFIG_ADFS_FS is not set
809# CONFIG_AFFS_FS is not set
810# CONFIG_HFS_FS is not set
811# CONFIG_HFSPLUS_FS is not set
812# CONFIG_BEFS_FS is not set
813# CONFIG_BFS_FS is not set
814# CONFIG_EFS_FS is not set
815# CONFIG_CRAMFS is not set
816# CONFIG_VXFS_FS is not set
817# CONFIG_HPFS_FS is not set
818# CONFIG_QNX4FS_FS is not set
819# CONFIG_SYSV_FS is not set
820# CONFIG_UFS_FS is not set
821
822#
823# Network File Systems
824#
825CONFIG_NFS_FS=m
826CONFIG_NFS_V3=y
827CONFIG_NFS_V3_ACL=y
828# CONFIG_NFS_V4 is not set
829# CONFIG_NFS_DIRECTIO is not set
830CONFIG_NFSD=m
831CONFIG_NFSD_V2_ACL=y
832CONFIG_NFSD_V3=y
833CONFIG_NFSD_V3_ACL=y
834# CONFIG_NFSD_V4 is not set
835CONFIG_NFSD_TCP=y
836CONFIG_LOCKD=m
837CONFIG_LOCKD_V4=y
838CONFIG_EXPORTFS=m
839CONFIG_NFS_ACL_SUPPORT=m
840CONFIG_NFS_COMMON=y
841CONFIG_SUNRPC=m
842# CONFIG_RPCSEC_GSS_KRB5 is not set
843# CONFIG_RPCSEC_GSS_SPKM3 is not set
844# CONFIG_SMB_FS is not set
845# CONFIG_CIFS is not set
846# CONFIG_NCP_FS is not set
847# CONFIG_CODA_FS is not set
848# CONFIG_AFS_FS is not set
849
850#
851# Partition Types
852#
853CONFIG_PARTITION_ADVANCED=y
854# CONFIG_ACORN_PARTITION is not set
855# CONFIG_OSF_PARTITION is not set
856# CONFIG_AMIGA_PARTITION is not set
857# CONFIG_ATARI_PARTITION is not set
858# CONFIG_MAC_PARTITION is not set
859CONFIG_MSDOS_PARTITION=y
860# CONFIG_BSD_DISKLABEL is not set
861# CONFIG_MINIX_SUBPARTITION is not set
862# CONFIG_SOLARIS_X86_PARTITION is not set
863# CONFIG_UNIXWARE_DISKLABEL is not set
864# CONFIG_LDM_PARTITION is not set
865# CONFIG_SGI_PARTITION is not set
866# CONFIG_ULTRIX_PARTITION is not set
867# CONFIG_SUN_PARTITION is not set
868CONFIG_EFI_PARTITION=y
869
870#
871# Native Language Support
872#
873CONFIG_NLS=m
874CONFIG_NLS_DEFAULT="iso8859-1"
875# CONFIG_NLS_CODEPAGE_437 is not set
876# CONFIG_NLS_CODEPAGE_737 is not set
877# CONFIG_NLS_CODEPAGE_775 is not set
878# CONFIG_NLS_CODEPAGE_850 is not set
879# CONFIG_NLS_CODEPAGE_852 is not set
880# CONFIG_NLS_CODEPAGE_855 is not set
881# CONFIG_NLS_CODEPAGE_857 is not set
882# CONFIG_NLS_CODEPAGE_860 is not set
883# CONFIG_NLS_CODEPAGE_861 is not set
884# CONFIG_NLS_CODEPAGE_862 is not set
885# CONFIG_NLS_CODEPAGE_863 is not set
886# CONFIG_NLS_CODEPAGE_864 is not set
887# CONFIG_NLS_CODEPAGE_865 is not set
888# CONFIG_NLS_CODEPAGE_866 is not set
889# CONFIG_NLS_CODEPAGE_869 is not set
890# CONFIG_NLS_CODEPAGE_936 is not set
891# CONFIG_NLS_CODEPAGE_950 is not set
892# CONFIG_NLS_CODEPAGE_932 is not set
893# CONFIG_NLS_CODEPAGE_949 is not set
894# CONFIG_NLS_CODEPAGE_874 is not set
895# CONFIG_NLS_ISO8859_8 is not set
896# CONFIG_NLS_CODEPAGE_1250 is not set
897# CONFIG_NLS_CODEPAGE_1251 is not set
898# CONFIG_NLS_ASCII is not set
899CONFIG_NLS_ISO8859_1=m
900CONFIG_NLS_ISO8859_2=m
901CONFIG_NLS_ISO8859_3=m
902CONFIG_NLS_ISO8859_4=m
903CONFIG_NLS_ISO8859_5=m
904CONFIG_NLS_ISO8859_6=m
905CONFIG_NLS_ISO8859_7=m
906CONFIG_NLS_ISO8859_9=m
907CONFIG_NLS_ISO8859_13=m
908CONFIG_NLS_ISO8859_14=m
909CONFIG_NLS_ISO8859_15=m
910# CONFIG_NLS_KOI8_R is not set
911# CONFIG_NLS_KOI8_U is not set
912# CONFIG_NLS_UTF8 is not set
913
914#
915# Profiling support
916#
917# CONFIG_PROFILING is not set
918
919#
920# Kernel hacking
921#
922# CONFIG_PRINTK_TIME is not set
923CONFIG_DEBUG_KERNEL=y
924CONFIG_MAGIC_SYSRQ=y
925CONFIG_LOG_BUF_SHIFT=15
926# CONFIG_SCHEDSTATS is not set
927# CONFIG_DEBUG_SLAB is not set
928# CONFIG_DEBUG_SPINLOCK is not set
929CONFIG_DEBUG_SPINLOCK_SLEEP=y
930# CONFIG_DEBUG_KOBJECT is not set
931# CONFIG_DEBUG_INFO is not set
932CONFIG_DEBUG_FS=y
933# CONFIG_DEBUG_STACKOVERFLOW is not set
934# CONFIG_KPROBES is not set
935# CONFIG_DEBUG_STACK_USAGE is not set
936CONFIG_DEBUGGER=y
937# CONFIG_XMON is not set
938# CONFIG_PPCDBG is not set
939CONFIG_IRQSTACKS=y
940
941#
942# Security options
943#
944# CONFIG_KEYS is not set
945# CONFIG_SECURITY is not set
946
947#
948# Cryptographic options
949#
950CONFIG_CRYPTO=y
951CONFIG_CRYPTO_HMAC=y
952# CONFIG_CRYPTO_NULL is not set
953# CONFIG_CRYPTO_MD4 is not set
954CONFIG_CRYPTO_MD5=m
955CONFIG_CRYPTO_SHA1=m
956# CONFIG_CRYPTO_SHA256 is not set
957# CONFIG_CRYPTO_SHA512 is not set
958# CONFIG_CRYPTO_WP512 is not set
959# CONFIG_CRYPTO_TGR192 is not set
960CONFIG_CRYPTO_DES=m
961# CONFIG_CRYPTO_BLOWFISH is not set
962# CONFIG_CRYPTO_TWOFISH is not set
963# CONFIG_CRYPTO_SERPENT is not set
964# CONFIG_CRYPTO_AES is not set
965# CONFIG_CRYPTO_CAST5 is not set
966# CONFIG_CRYPTO_CAST6 is not set
967# CONFIG_CRYPTO_TEA is not set
968# CONFIG_CRYPTO_ARC4 is not set
969# CONFIG_CRYPTO_KHAZAD is not set
970# CONFIG_CRYPTO_ANUBIS is not set
971CONFIG_CRYPTO_DEFLATE=m
972# CONFIG_CRYPTO_MICHAEL_MIC is not set
973# CONFIG_CRYPTO_CRC32C is not set
974# CONFIG_CRYPTO_TEST is not set
975
976#
977# Hardware crypto devices
978#
979
980#
981# Library routines
982#
983# CONFIG_CRC_CCITT is not set
984CONFIG_CRC32=y
985# CONFIG_LIBCRC32C is not set
986CONFIG_ZLIB_INFLATE=m
987CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/ppc64/configs/g5_defconfig b/arch/ppc64/configs/g5_defconfig
index 9e0abe8392fc..ab567741e80e 100644
--- a/arch/ppc64/configs/g5_defconfig
+++ b/arch/ppc64/configs/g5_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-rc3 3# Linux kernel version: 2.6.13-rc6
4# Wed Jul 13 14:40:34 2005 4# Mon Aug 8 14:16:59 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -267,8 +267,6 @@ CONFIG_NET_CLS_ROUTE=y
267# Network testing 267# Network testing
268# 268#
269# CONFIG_NET_PKTGEN is not set 269# CONFIG_NET_PKTGEN is not set
270# CONFIG_NETPOLL is not set
271# CONFIG_NET_POLL_CONTROLLER is not set
272# CONFIG_HAMRADIO is not set 270# CONFIG_HAMRADIO is not set
273# CONFIG_IRDA is not set 271# CONFIG_IRDA is not set
274# CONFIG_BT is not set 272# CONFIG_BT is not set
@@ -468,6 +466,7 @@ CONFIG_SCSI_QLA2XXX=y
468# CONFIG_SCSI_QLA2300 is not set 466# CONFIG_SCSI_QLA2300 is not set
469# CONFIG_SCSI_QLA2322 is not set 467# CONFIG_SCSI_QLA2322 is not set
470# CONFIG_SCSI_QLA6312 is not set 468# CONFIG_SCSI_QLA6312 is not set
469# CONFIG_SCSI_QLA24XX is not set
471# CONFIG_SCSI_LPFC is not set 470# CONFIG_SCSI_LPFC is not set
472# CONFIG_SCSI_DC395x is not set 471# CONFIG_SCSI_DC395x is not set
473# CONFIG_SCSI_DC390T is not set 472# CONFIG_SCSI_DC390T is not set
@@ -539,11 +538,9 @@ CONFIG_IEEE1394_RAWIO=y
539# 538#
540# Macintosh device drivers 539# Macintosh device drivers
541# 540#
542CONFIG_ADB=y
543CONFIG_ADB_PMU=y 541CONFIG_ADB_PMU=y
544CONFIG_PMAC_SMU=y 542CONFIG_PMAC_SMU=y
545# CONFIG_PMAC_BACKLIGHT is not set 543# CONFIG_PMAC_BACKLIGHT is not set
546# CONFIG_INPUT_ADBHID is not set
547CONFIG_THERM_PM72=y 544CONFIG_THERM_PM72=y
548 545
549# 546#
@@ -631,6 +628,8 @@ CONFIG_PPPOE=m
631# CONFIG_NET_FC is not set 628# CONFIG_NET_FC is not set
632# CONFIG_SHAPER is not set 629# CONFIG_SHAPER is not set
633# CONFIG_NETCONSOLE is not set 630# CONFIG_NETCONSOLE is not set
631# CONFIG_NETPOLL is not set
632# CONFIG_NET_POLL_CONTROLLER is not set
634 633
635# 634#
636# ISDN subsystem 635# ISDN subsystem
@@ -718,7 +717,6 @@ CONFIG_LEGACY_PTY_COUNT=256
718# 717#
719# CONFIG_WATCHDOG is not set 718# CONFIG_WATCHDOG is not set
720# CONFIG_RTC is not set 719# CONFIG_RTC is not set
721# CONFIG_GEN_RTC is not set
722# CONFIG_DTLK is not set 720# CONFIG_DTLK is not set
723# CONFIG_R3964 is not set 721# CONFIG_R3964 is not set
724# CONFIG_APPLICOM is not set 722# CONFIG_APPLICOM is not set
diff --git a/arch/ppc64/configs/iSeries_defconfig b/arch/ppc64/configs/iSeries_defconfig
index dbd54d188c2b..394ba18b58c7 100644
--- a/arch/ppc64/configs/iSeries_defconfig
+++ b/arch/ppc64/configs/iSeries_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-rc3 3# Linux kernel version: 2.6.13-rc6
4# Wed Jul 13 14:43:39 2005 4# Mon Aug 8 14:17:02 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -257,10 +257,6 @@ CONFIG_NET_CLS_ROUTE=y
257# Network testing 257# Network testing
258# 258#
259# CONFIG_NET_PKTGEN is not set 259# CONFIG_NET_PKTGEN is not set
260CONFIG_NETPOLL=y
261CONFIG_NETPOLL_RX=y
262CONFIG_NETPOLL_TRAP=y
263CONFIG_NET_POLL_CONTROLLER=y
264# CONFIG_HAMRADIO is not set 260# CONFIG_HAMRADIO is not set
265# CONFIG_IRDA is not set 261# CONFIG_IRDA is not set
266# CONFIG_BT is not set 262# CONFIG_BT is not set
@@ -388,6 +384,7 @@ CONFIG_SCSI_QLA2XXX=y
388# CONFIG_SCSI_QLA2300 is not set 384# CONFIG_SCSI_QLA2300 is not set
389# CONFIG_SCSI_QLA2322 is not set 385# CONFIG_SCSI_QLA2322 is not set
390# CONFIG_SCSI_QLA6312 is not set 386# CONFIG_SCSI_QLA6312 is not set
387# CONFIG_SCSI_QLA24XX is not set
391# CONFIG_SCSI_LPFC is not set 388# CONFIG_SCSI_LPFC is not set
392# CONFIG_SCSI_DC395x is not set 389# CONFIG_SCSI_DC395x is not set
393# CONFIG_SCSI_DC390T is not set 390# CONFIG_SCSI_DC390T is not set
@@ -537,6 +534,10 @@ CONFIG_PPPOE=m
537# CONFIG_NET_FC is not set 534# CONFIG_NET_FC is not set
538# CONFIG_SHAPER is not set 535# CONFIG_SHAPER is not set
539CONFIG_NETCONSOLE=y 536CONFIG_NETCONSOLE=y
537CONFIG_NETPOLL=y
538CONFIG_NETPOLL_RX=y
539CONFIG_NETPOLL_TRAP=y
540CONFIG_NET_POLL_CONTROLLER=y
540 541
541# 542#
542# ISDN subsystem 543# ISDN subsystem
@@ -610,7 +611,6 @@ CONFIG_LEGACY_PTY_COUNT=256
610# 611#
611# CONFIG_WATCHDOG is not set 612# CONFIG_WATCHDOG is not set
612# CONFIG_RTC is not set 613# CONFIG_RTC is not set
613# CONFIG_GEN_RTC is not set
614# CONFIG_DTLK is not set 614# CONFIG_DTLK is not set
615# CONFIG_R3964 is not set 615# CONFIG_R3964 is not set
616# CONFIG_APPLICOM is not set 616# CONFIG_APPLICOM is not set
diff --git a/arch/ppc64/configs/maple_defconfig b/arch/ppc64/configs/maple_defconfig
index cda8e8cb6d1d..2033fe663dbe 100644
--- a/arch/ppc64/configs/maple_defconfig
+++ b/arch/ppc64/configs/maple_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-rc3 3# Linux kernel version: 2.6.13-rc6
4# Wed Jul 13 14:46:18 2005 4# Mon Aug 8 14:17:04 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -193,8 +193,6 @@ CONFIG_TCP_CONG_BIC=y
193# Network testing 193# Network testing
194# 194#
195# CONFIG_NET_PKTGEN is not set 195# CONFIG_NET_PKTGEN is not set
196# CONFIG_NETPOLL is not set
197# CONFIG_NET_POLL_CONTROLLER is not set
198# CONFIG_HAMRADIO is not set 196# CONFIG_HAMRADIO is not set
199# CONFIG_IRDA is not set 197# CONFIG_IRDA is not set
200# CONFIG_BT is not set 198# CONFIG_BT is not set
@@ -433,6 +431,8 @@ CONFIG_E1000=y
433# CONFIG_SLIP is not set 431# CONFIG_SLIP is not set
434# CONFIG_SHAPER is not set 432# CONFIG_SHAPER is not set
435# CONFIG_NETCONSOLE is not set 433# CONFIG_NETCONSOLE is not set
434# CONFIG_NETPOLL is not set
435# CONFIG_NET_POLL_CONTROLLER is not set
436 436
437# 437#
438# ISDN subsystem 438# ISDN subsystem
@@ -512,7 +512,6 @@ CONFIG_LEGACY_PTY_COUNT=256
512# 512#
513# CONFIG_WATCHDOG is not set 513# CONFIG_WATCHDOG is not set
514# CONFIG_RTC is not set 514# CONFIG_RTC is not set
515# CONFIG_GEN_RTC is not set
516# CONFIG_DTLK is not set 515# CONFIG_DTLK is not set
517# CONFIG_R3964 is not set 516# CONFIG_R3964 is not set
518# CONFIG_APPLICOM is not set 517# CONFIG_APPLICOM is not set
diff --git a/arch/ppc64/configs/pSeries_defconfig b/arch/ppc64/configs/pSeries_defconfig
index 5112edf18181..297fd5229487 100644
--- a/arch/ppc64/configs/pSeries_defconfig
+++ b/arch/ppc64/configs/pSeries_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-rc3 3# Linux kernel version: 2.6.13-rc6
4# Wed Jul 13 14:47:54 2005 4# Mon Aug 8 14:17:07 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -287,10 +287,6 @@ CONFIG_NET_CLS_ROUTE=y
287# Network testing 287# Network testing
288# 288#
289# CONFIG_NET_PKTGEN is not set 289# CONFIG_NET_PKTGEN is not set
290CONFIG_NETPOLL=y
291CONFIG_NETPOLL_RX=y
292CONFIG_NETPOLL_TRAP=y
293CONFIG_NET_POLL_CONTROLLER=y
294# CONFIG_HAMRADIO is not set 290# CONFIG_HAMRADIO is not set
295# CONFIG_IRDA is not set 291# CONFIG_IRDA is not set
296# CONFIG_BT is not set 292# CONFIG_BT is not set
@@ -488,6 +484,7 @@ CONFIG_SCSI_QLA22XX=m
488CONFIG_SCSI_QLA2300=m 484CONFIG_SCSI_QLA2300=m
489CONFIG_SCSI_QLA2322=m 485CONFIG_SCSI_QLA2322=m
490CONFIG_SCSI_QLA6312=m 486CONFIG_SCSI_QLA6312=m
487CONFIG_SCSI_QLA24XX=m
491CONFIG_SCSI_LPFC=m 488CONFIG_SCSI_LPFC=m
492# CONFIG_SCSI_DC395x is not set 489# CONFIG_SCSI_DC395x is not set
493# CONFIG_SCSI_DC390T is not set 490# CONFIG_SCSI_DC390T is not set
@@ -645,6 +642,10 @@ CONFIG_PPPOE=m
645# CONFIG_NET_FC is not set 642# CONFIG_NET_FC is not set
646# CONFIG_SHAPER is not set 643# CONFIG_SHAPER is not set
647CONFIG_NETCONSOLE=y 644CONFIG_NETCONSOLE=y
645CONFIG_NETPOLL=y
646CONFIG_NETPOLL_RX=y
647CONFIG_NETPOLL_TRAP=y
648CONFIG_NET_POLL_CONTROLLER=y
648 649
649# 650#
650# ISDN subsystem 651# ISDN subsystem
@@ -746,7 +747,6 @@ CONFIG_HVCS=m
746# 747#
747# CONFIG_WATCHDOG is not set 748# CONFIG_WATCHDOG is not set
748# CONFIG_RTC is not set 749# CONFIG_RTC is not set
749# CONFIG_GEN_RTC is not set
750# CONFIG_DTLK is not set 750# CONFIG_DTLK is not set
751# CONFIG_R3964 is not set 751# CONFIG_R3964 is not set
752# CONFIG_APPLICOM is not set 752# CONFIG_APPLICOM is not set
diff --git a/arch/ppc64/defconfig b/arch/ppc64/defconfig
index fbf1f427ad35..c361e7727b7a 100644
--- a/arch/ppc64/defconfig
+++ b/arch/ppc64/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-rc3 3# Linux kernel version: 2.6.13-rc6
4# Wed Jul 13 14:37:07 2005 4# Mon Aug 8 14:16:54 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -289,10 +289,6 @@ CONFIG_NET_CLS_ROUTE=y
289# Network testing 289# Network testing
290# 290#
291# CONFIG_NET_PKTGEN is not set 291# CONFIG_NET_PKTGEN is not set
292CONFIG_NETPOLL=y
293CONFIG_NETPOLL_RX=y
294CONFIG_NETPOLL_TRAP=y
295CONFIG_NET_POLL_CONTROLLER=y
296# CONFIG_HAMRADIO is not set 292# CONFIG_HAMRADIO is not set
297# CONFIG_IRDA is not set 293# CONFIG_IRDA is not set
298# CONFIG_BT is not set 294# CONFIG_BT is not set
@@ -506,6 +502,7 @@ CONFIG_SCSI_QLA22XX=m
506CONFIG_SCSI_QLA2300=m 502CONFIG_SCSI_QLA2300=m
507CONFIG_SCSI_QLA2322=m 503CONFIG_SCSI_QLA2322=m
508CONFIG_SCSI_QLA6312=m 504CONFIG_SCSI_QLA6312=m
505CONFIG_SCSI_QLA24XX=m
509CONFIG_SCSI_LPFC=m 506CONFIG_SCSI_LPFC=m
510# CONFIG_SCSI_DC395x is not set 507# CONFIG_SCSI_DC395x is not set
511# CONFIG_SCSI_DC390T is not set 508# CONFIG_SCSI_DC390T is not set
@@ -579,11 +576,9 @@ CONFIG_IEEE1394_AMDTP=m
579# 576#
580# Macintosh device drivers 577# Macintosh device drivers
581# 578#
582CONFIG_ADB=y
583CONFIG_ADB_PMU=y 579CONFIG_ADB_PMU=y
584CONFIG_PMAC_SMU=y 580CONFIG_PMAC_SMU=y
585# CONFIG_PMAC_BACKLIGHT is not set 581# CONFIG_PMAC_BACKLIGHT is not set
586# CONFIG_INPUT_ADBHID is not set
587CONFIG_THERM_PM72=y 582CONFIG_THERM_PM72=y
588 583
589# 584#
@@ -694,6 +689,10 @@ CONFIG_PPPOE=m
694# CONFIG_NET_FC is not set 689# CONFIG_NET_FC is not set
695# CONFIG_SHAPER is not set 690# CONFIG_SHAPER is not set
696CONFIG_NETCONSOLE=y 691CONFIG_NETCONSOLE=y
692CONFIG_NETPOLL=y
693CONFIG_NETPOLL_RX=y
694CONFIG_NETPOLL_TRAP=y
695CONFIG_NET_POLL_CONTROLLER=y
697 696
698# 697#
699# ISDN subsystem 698# ISDN subsystem
@@ -797,7 +796,6 @@ CONFIG_HVCS=m
797# 796#
798# CONFIG_WATCHDOG is not set 797# CONFIG_WATCHDOG is not set
799# CONFIG_RTC is not set 798# CONFIG_RTC is not set
800# CONFIG_GEN_RTC is not set
801# CONFIG_DTLK is not set 799# CONFIG_DTLK is not set
802# CONFIG_R3964 is not set 800# CONFIG_R3964 is not set
803# CONFIG_APPLICOM is not set 801# CONFIG_APPLICOM is not set
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S
index 74fc3bc68604..784f56d4684c 100644
--- a/arch/ppc64/kernel/head.S
+++ b/arch/ppc64/kernel/head.S
@@ -2071,7 +2071,7 @@ _GLOBAL(hmt_start_secondary)
2071 blr 2071 blr
2072#endif 2072#endif
2073 2073
2074#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES) 2074#if defined(CONFIG_KEXEC) || (defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES))
2075_GLOBAL(smp_release_cpus) 2075_GLOBAL(smp_release_cpus)
2076 /* All secondary cpus are spinning on a common 2076 /* All secondary cpus are spinning on a common
2077 * spinloop, release them all now so they can start 2077 * spinloop, release them all now so they can start
diff --git a/arch/ppc64/kernel/machine_kexec.c b/arch/ppc64/kernel/machine_kexec.c
index fdb2fc649d72..4775f12a013c 100644
--- a/arch/ppc64/kernel/machine_kexec.c
+++ b/arch/ppc64/kernel/machine_kexec.c
@@ -185,7 +185,7 @@ void kexec_copy_flush(struct kimage *image)
185void kexec_smp_down(void *arg) 185void kexec_smp_down(void *arg)
186{ 186{
187 if (ppc_md.cpu_irq_down) 187 if (ppc_md.cpu_irq_down)
188 ppc_md.cpu_irq_down(); 188 ppc_md.cpu_irq_down(1);
189 189
190 local_irq_disable(); 190 local_irq_disable();
191 kexec_smp_wait(); 191 kexec_smp_wait();
@@ -232,7 +232,7 @@ static void kexec_prepare_cpus(void)
232 232
233 /* after we tell the others to go down */ 233 /* after we tell the others to go down */
234 if (ppc_md.cpu_irq_down) 234 if (ppc_md.cpu_irq_down)
235 ppc_md.cpu_irq_down(); 235 ppc_md.cpu_irq_down(0);
236 236
237 put_cpu(); 237 put_cpu();
238 238
@@ -243,15 +243,19 @@ static void kexec_prepare_cpus(void)
243 243
244static void kexec_prepare_cpus(void) 244static void kexec_prepare_cpus(void)
245{ 245{
246 extern void smp_release_cpus(void);
246 /* 247 /*
247 * move the secondarys to us so that we can copy 248 * move the secondarys to us so that we can copy
248 * the new kernel 0-0x100 safely 249 * the new kernel 0-0x100 safely
249 * 250 *
250 * do this if kexec in setup.c ? 251 * do this if kexec in setup.c ?
252 *
253 * We need to release the cpus if we are ever going from an
254 * UP to an SMP kernel.
251 */ 255 */
252 smp_relase_cpus(); 256 smp_release_cpus();
253 if (ppc_md.cpu_irq_down) 257 if (ppc_md.cpu_irq_down)
254 ppc_md.cpu_irq_down(); 258 ppc_md.cpu_irq_down(0);
255 local_irq_disable(); 259 local_irq_disable();
256} 260}
257 261
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index 59f4f9973818..a05b50b738e9 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -1129,6 +1129,9 @@ _GLOBAL(sys_call_table32)
1129 .llong .compat_sys_waitid 1129 .llong .compat_sys_waitid
1130 .llong .sys32_ioprio_set 1130 .llong .sys32_ioprio_set
1131 .llong .sys32_ioprio_get 1131 .llong .sys32_ioprio_get
1132 .llong .sys_inotify_init /* 275 */
1133 .llong .sys_inotify_add_watch
1134 .llong .sys_inotify_rm_watch
1132 1135
1133 .balign 8 1136 .balign 8
1134_GLOBAL(sys_call_table) 1137_GLOBAL(sys_call_table)
@@ -1407,3 +1410,6 @@ _GLOBAL(sys_call_table)
1407 .llong .sys_waitid 1410 .llong .sys_waitid
1408 .llong .sys_ioprio_set 1411 .llong .sys_ioprio_set
1409 .llong .sys_ioprio_get 1412 .llong .sys_ioprio_get
1413 .llong .sys_inotify_init /* 275 */
1414 .llong .sys_inotify_add_watch
1415 .llong .sys_inotify_rm_watch
diff --git a/arch/ppc64/kernel/mpic.c b/arch/ppc64/kernel/mpic.c
index e8fbab1df37f..cc262a05ddb4 100644
--- a/arch/ppc64/kernel/mpic.c
+++ b/arch/ppc64/kernel/mpic.c
@@ -794,10 +794,10 @@ void mpic_setup_this_cpu(void)
794 794
795/* 795/*
796 * XXX: someone who knows mpic should check this. 796 * XXX: someone who knows mpic should check this.
797 * do we need to eoi the ipi here (see xics comments)? 797 * do we need to eoi the ipi including for kexec cpu here (see xics comments)?
798 * or can we reset the mpic in the new kernel? 798 * or can we reset the mpic in the new kernel?
799 */ 799 */
800void mpic_teardown_this_cpu(void) 800void mpic_teardown_this_cpu(int secondary)
801{ 801{
802 struct mpic *mpic = mpic_primary; 802 struct mpic *mpic = mpic_primary;
803 unsigned long flags; 803 unsigned long flags;
diff --git a/arch/ppc64/kernel/mpic.h b/arch/ppc64/kernel/mpic.h
index 99fbbc9a084c..ca78a7f10528 100644
--- a/arch/ppc64/kernel/mpic.h
+++ b/arch/ppc64/kernel/mpic.h
@@ -256,7 +256,7 @@ extern unsigned int mpic_irq_get_priority(unsigned int irq);
256extern void mpic_setup_this_cpu(void); 256extern void mpic_setup_this_cpu(void);
257 257
258/* Clean up for kexec (or cpu offline or ...) */ 258/* Clean up for kexec (or cpu offline or ...) */
259extern void mpic_teardown_this_cpu(void); 259extern void mpic_teardown_this_cpu(int secondary);
260 260
261/* Request IPIs on primary mpic */ 261/* Request IPIs on primary mpic */
262extern void mpic_request_ipis(void); 262extern void mpic_request_ipis(void);
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
index ae6f579d3fa0..d0d55c7908ef 100644
--- a/arch/ppc64/kernel/pci.c
+++ b/arch/ppc64/kernel/pci.c
@@ -108,8 +108,28 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region
108 region->end = res->end - offset; 108 region->end = res->end - offset;
109} 109}
110 110
111void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
112 struct pci_bus_region *region)
113{
114 unsigned long offset = 0;
115 struct pci_controller *hose = pci_bus_to_host(dev->bus);
116
117 if (!hose)
118 return;
119
120 if (res->flags & IORESOURCE_IO)
121 offset = (unsigned long)hose->io_base_virt - pci_io_base;
122
123 if (res->flags & IORESOURCE_MEM)
124 offset = hose->pci_mem_offset;
125
126 res->start = region->start + offset;
127 res->end = region->end + offset;
128}
129
111#ifdef CONFIG_HOTPLUG 130#ifdef CONFIG_HOTPLUG
112EXPORT_SYMBOL(pcibios_resource_to_bus); 131EXPORT_SYMBOL(pcibios_resource_to_bus);
132EXPORT_SYMBOL(pcibios_bus_to_resource);
113#endif 133#endif
114 134
115/* 135/*
diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c
index 47727a6f7346..5aca01ddd81f 100644
--- a/arch/ppc64/kernel/prom.c
+++ b/arch/ppc64/kernel/prom.c
@@ -916,6 +916,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
916 } 916 }
917 } 917 }
918 918
919#ifdef CONFIG_ALTIVEC
919 /* Check if we have a VMX and eventually update CPU features */ 920 /* Check if we have a VMX and eventually update CPU features */
920 prop = (u32 *)get_flat_dt_prop(node, "ibm,vmx", NULL); 921 prop = (u32 *)get_flat_dt_prop(node, "ibm,vmx", NULL);
921 if (prop && (*prop) > 0) { 922 if (prop && (*prop) > 0) {
@@ -929,6 +930,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
929 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC; 930 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC;
930 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC; 931 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC;
931 } 932 }
933#endif /* CONFIG_ALTIVEC */
932 934
933 /* 935 /*
934 * Check for an SMT capable CPU and set the CPU feature. We do 936 * Check for an SMT capable CPU and set the CPU feature. We do
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c
index e248a7950aeb..dbbe6c79d8da 100644
--- a/arch/ppc64/kernel/prom_init.c
+++ b/arch/ppc64/kernel/prom_init.c
@@ -1803,7 +1803,7 @@ static void __init fixup_device_tree(void)
1803 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev)) 1803 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev))
1804 == PROM_ERROR) 1804 == PROM_ERROR)
1805 return; 1805 return;
1806 if (u3_rev != 0x35) 1806 if (u3_rev != 0x35 && u3_rev != 0x37)
1807 return; 1807 return;
1808 /* does it need fixup ? */ 1808 /* does it need fixup ? */
1809 if (prom_getproplen(i2c, "interrupts") > 0) 1809 if (prom_getproplen(i2c, "interrupts") > 0)
diff --git a/arch/ppc64/kernel/xics.c b/arch/ppc64/kernel/xics.c
index 677c4450984a..d9dc6f28d050 100644
--- a/arch/ppc64/kernel/xics.c
+++ b/arch/ppc64/kernel/xics.c
@@ -647,29 +647,30 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask)
647 } 647 }
648} 648}
649 649
650void xics_teardown_cpu(void) 650void xics_teardown_cpu(int secondary)
651{ 651{
652 int cpu = smp_processor_id(); 652 int cpu = smp_processor_id();
653 int status;
654 653
655 ops->cppr_info(cpu, 0x00); 654 ops->cppr_info(cpu, 0x00);
656 iosync(); 655 iosync();
657 656
658 /* 657 /*
659 * we need to EOI the IPI if we got here from kexec down IPI 658 * Some machines need to have at least one cpu in the GIQ,
660 * 659 * so leave the master cpu in the group.
661 * xics doesn't care if we duplicate an EOI as long as we
662 * don't EOI and raise priority.
663 *
664 * probably need to check all the other interrupts too
665 * should we be flagging idle loop instead?
666 * or creating some task to be scheduled?
667 */ 660 */
668 ops->xirr_info_set(cpu, XICS_IPI); 661 if (secondary) {
669 662 /*
670 status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, 663 * we need to EOI the IPI if we got here from kexec down IPI
671 (1UL << interrupt_server_size) - 1 - default_distrib_server, 0); 664 *
672 WARN_ON(status != 0); 665 * probably need to check all the other interrupts too
666 * should we be flagging idle loop instead?
667 * or creating some task to be scheduled?
668 */
669 ops->xirr_info_set(cpu, XICS_IPI);
670 rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
671 (1UL << interrupt_server_size) - 1 -
672 default_distrib_server, 0);
673 }
673} 674}
674 675
675#ifdef CONFIG_HOTPLUG_CPU 676#ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/ppc64/mm/numa.c b/arch/ppc64/mm/numa.c
index cafd91aef289..0b191f2de016 100644
--- a/arch/ppc64/mm/numa.c
+++ b/arch/ppc64/mm/numa.c
@@ -647,7 +647,12 @@ void __init do_init_bootmem(void)
647new_range: 647new_range:
648 mem_start = read_n_cells(addr_cells, &memcell_buf); 648 mem_start = read_n_cells(addr_cells, &memcell_buf);
649 mem_size = read_n_cells(size_cells, &memcell_buf); 649 mem_size = read_n_cells(size_cells, &memcell_buf);
650 numa_domain = numa_enabled ? of_node_numa_domain(memory) : 0; 650 if (numa_enabled) {
651 numa_domain = of_node_numa_domain(memory);
652 if (numa_domain >= MAX_NUMNODES)
653 numa_domain = 0;
654 } else
655 numa_domain = 0;
651 656
652 if (numa_domain != nid) 657 if (numa_domain != nid)
653 continue; 658 continue;
diff --git a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c
index 7f6e13a4b71e..05539439e6bc 100644
--- a/arch/ppc64/xmon/xmon.c
+++ b/arch/ppc64/xmon/xmon.c
@@ -329,13 +329,16 @@ int xmon_core(struct pt_regs *regs, int fromipi)
329 printf("cpu 0x%x: Exception %lx %s in xmon, " 329 printf("cpu 0x%x: Exception %lx %s in xmon, "
330 "returning to main loop\n", 330 "returning to main loop\n",
331 cpu, regs->trap, getvecname(TRAP(regs))); 331 cpu, regs->trap, getvecname(TRAP(regs)));
332 release_output_lock();
332 longjmp(xmon_fault_jmp[cpu], 1); 333 longjmp(xmon_fault_jmp[cpu], 1);
333 } 334 }
334 335
335 if (setjmp(recurse_jmp) != 0) { 336 if (setjmp(recurse_jmp) != 0) {
336 if (!in_xmon || !xmon_gate) { 337 if (!in_xmon || !xmon_gate) {
338 get_output_lock();
337 printf("xmon: WARNING: bad recursive fault " 339 printf("xmon: WARNING: bad recursive fault "
338 "on cpu 0x%x\n", cpu); 340 "on cpu 0x%x\n", cpu);
341 release_output_lock();
339 goto waiting; 342 goto waiting;
340 } 343 }
341 secondary = !(xmon_taken && cpu == xmon_owner); 344 secondary = !(xmon_taken && cpu == xmon_owner);
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 799a98eac92d..23fe94e58688 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1449,3 +1449,29 @@ compat_sys_kexec_load_wrapper:
1449 llgtr %r4,%r4 # struct kexec_segment * 1449 llgtr %r4,%r4 # struct kexec_segment *
1450 llgfr %r5,%r5 # unsigned long 1450 llgfr %r5,%r5 # unsigned long
1451 jg compat_sys_kexec_load 1451 jg compat_sys_kexec_load
1452
1453 .globl sys_ioprio_set_wrapper
1454sys_ioprio_set_wrapper:
1455 lgfr %r2,%r2 # int
1456 lgfr %r3,%r3 # int
1457 lgfr %r4,%r4 # int
1458 jg sys_ioprio_set
1459
1460 .globl sys_ioprio_get_wrapper
1461sys_ioprio_get_wrapper:
1462 lgfr %r2,%r2 # int
1463 lgfr %r3,%r3 # int
1464 jg sys_ioprio_get
1465
1466 .globl sys_inotify_add_watch_wrapper
1467sys_inotify_add_watch_wrapper:
1468 lgfr %r2,%r2 # int
1469 llgtr %r3,%r3 # const char *
1470 llgfr %r4,%r4 # u32
1471 jg sys_inotify_add_watch
1472
1473 .globl sys_inotify_rm_watch_wrapper
1474sys_inotify_rm_watch_wrapper:
1475 lgfr %r2,%r2 # int
1476 llgfr %r3,%r3 # u32
1477 jg sys_inotify_rm_watch
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index 2721c3a32b84..5aa71b05b8ae 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -70,6 +70,8 @@ machine_kexec(struct kimage *image)
70 for (;;); 70 for (;;);
71} 71}
72 72
73extern void pfault_fini(void);
74
73static void 75static void
74kexec_halt_all_cpus(void *kernel_image) 76kexec_halt_all_cpus(void *kernel_image)
75{ 77{
@@ -78,6 +80,11 @@ kexec_halt_all_cpus(void *kernel_image)
78 struct kimage *image; 80 struct kimage *image;
79 relocate_kernel_t data_mover; 81 relocate_kernel_t data_mover;
80 82
83#ifdef CONFIG_PFAULT
84 if (MACHINE_IS_VM)
85 pfault_fini();
86#endif
87
81 if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid)) 88 if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid))
82 signal_processor(smp_processor_id(), sigp_stop); 89 signal_processor(smp_processor_id(), sigp_stop);
83 90
diff --git a/arch/s390/kernel/relocate_kernel.S b/arch/s390/kernel/relocate_kernel.S
index d5e4a62fbb79..2a25ec7147ff 100644
--- a/arch/s390/kernel/relocate_kernel.S
+++ b/arch/s390/kernel/relocate_kernel.S
@@ -4,6 +4,7 @@
4 * (C) Copyright IBM Corp. 2005 4 * (C) Copyright IBM Corp. 2005
5 * 5 *
6 * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com> 6 * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com>
7 * Heiko Carstens <heiko.carstens@de.ibm.com>
7 * 8 *
8 */ 9 */
9 10
@@ -25,8 +26,31 @@
25 relocate_kernel: 26 relocate_kernel:
26 basr %r13,0 #base address 27 basr %r13,0 #base address
27 .base: 28 .base:
28 spx zero64-.base(%r13) #absolute addressing mode
29 stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQ (external) 29 stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQ (external)
30 spx zero64-.base(%r13) #absolute addressing mode
31 stctl %c0,%c15,ctlregs-.base(%r13)
32 stm %r0,%r15,gprregs-.base(%r13)
33 la %r1,load_psw-.base(%r13)
34 mvc 0(8,%r0),0(%r1)
35 la %r0,.back-.base(%r13)
36 st %r0,4(%r0)
37 oi 4(%r0),0x80
38 mvc 0x68(8,%r0),0(%r1)
39 la %r0,.back_pgm-.base(%r13)
40 st %r0,0x6c(%r0)
41 oi 0x6c(%r0),0x80
42 lhi %r0,0
43 diag %r0,%r0,0x308
44 .back:
45 basr %r13,0
46 .back_base:
47 oi have_diag308-.back_base(%r13),0x01
48 lctl %c0,%c15,ctlregs-.back_base(%r13)
49 lm %r0,%r15,gprregs-.back_base(%r13)
50 j .start_reloc
51 .back_pgm:
52 lm %r0,%r15,gprregs-.base(%r13)
53 .start_reloc:
30 lhi %r10,-1 #preparing the mask 54 lhi %r10,-1 #preparing the mask
31 sll %r10,12 #shift it such that it becomes 0xf000 55 sll %r10,12 #shift it such that it becomes 0xf000
32 .top: 56 .top:
@@ -63,6 +87,10 @@
63 o %r3,4(%r4) #or load address into psw 87 o %r3,4(%r4) #or load address into psw
64 st %r3,4(%r4) 88 st %r3,4(%r4)
65 mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0 89 mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0
90 tm have_diag308-.base(%r13),0x01
91 jno .no_diag308
92 diag %r0,%r0,0x308
93 .no_diag308:
66 sr %r1,%r1 #clear %r1 94 sr %r1,%r1 #clear %r1
67 sr %r2,%r2 #clear %r2 95 sr %r2,%r2 #clear %r2
68 sigp %r1,%r2,0x12 #set cpuid to zero 96 sigp %r1,%r2,0x12 #set cpuid to zero
@@ -75,6 +103,17 @@
75 .long 0x00080000,0x80000000 103 .long 0x00080000,0x80000000
76 sys_msk: 104 sys_msk:
77 .quad 0 105 .quad 0
106 ctlregs:
107 .rept 16
108 .long 0
109 .endr
110 gprregs:
111 .rept 16
112 .long 0
113 .endr
114 have_diag308:
115 .byte 0
116 .align 8
78 relocate_kernel_end: 117 relocate_kernel_end:
79 .globl relocate_kernel_len 118 .globl relocate_kernel_len
80 relocate_kernel_len: 119 relocate_kernel_len:
diff --git a/arch/s390/kernel/relocate_kernel64.S b/arch/s390/kernel/relocate_kernel64.S
index 96290cc4eb3c..8cdb86e8911f 100644
--- a/arch/s390/kernel/relocate_kernel64.S
+++ b/arch/s390/kernel/relocate_kernel64.S
@@ -4,6 +4,7 @@
4 * (C) Copyright IBM Corp. 2005 4 * (C) Copyright IBM Corp. 2005
5 * 5 *
6 * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com> 6 * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com>
7 * Heiko Carstens <heiko.carstens@de.ibm.com>
7 * 8 *
8 */ 9 */
9 10
@@ -26,8 +27,34 @@
26 relocate_kernel: 27 relocate_kernel:
27 basr %r13,0 #base address 28 basr %r13,0 #base address
28 .base: 29 .base:
30 stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQs
29 spx zero64-.base(%r13) #absolute addressing mode 31 spx zero64-.base(%r13) #absolute addressing mode
30 stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQ (external) 32 stctg %c0,%c15,ctlregs-.base(%r13)
33 stmg %r0,%r15,gprregs-.base(%r13)
34 lghi %r0,3
35 sllg %r0,%r0,31
36 stg %r0,0x1d0(%r0)
37 la %r0,.back_pgm-.base(%r13)
38 stg %r0,0x1d8(%r0)
39 la %r1,load_psw-.base(%r13)
40 mvc 0(8,%r0),0(%r1)
41 la %r0,.back-.base(%r13)
42 st %r0,4(%r0)
43 oi 4(%r0),0x80
44 lghi %r0,0
45 diag %r0,%r0,0x308
46 .back:
47 lhi %r1,1 #mode 1 = esame
48 sigp %r1,%r0,0x12 #switch to esame mode
49 sam64 #switch to 64 bit addressing mode
50 basr %r13,0
51 .back_base:
52 oi have_diag308-.back_base(%r13),0x01
53 lctlg %c0,%c15,ctlregs-.back_base(%r13)
54 lmg %r0,%r15,gprregs-.back_base(%r13)
55 j .top
56 .back_pgm:
57 lmg %r0,%r15,gprregs-.base(%r13)
31 .top: 58 .top:
32 lghi %r7,4096 #load PAGE_SIZE in r7 59 lghi %r7,4096 #load PAGE_SIZE in r7
33 lghi %r9,4096 #load PAGE_SIZE in r9 60 lghi %r9,4096 #load PAGE_SIZE in r9
@@ -62,6 +89,10 @@
62 o %r3,4(%r4) #or load address into psw 89 o %r3,4(%r4) #or load address into psw
63 st %r3,4(%r4) 90 st %r3,4(%r4)
64 mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0 91 mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0
92 tm have_diag308-.base(%r13),0x01
93 jno .no_diag308
94 diag %r0,%r0,0x308
95 .no_diag308:
65 sam31 #31 bit mode 96 sam31 #31 bit mode
66 sr %r1,%r1 #erase register r1 97 sr %r1,%r1 #erase register r1
67 sr %r2,%r2 #erase register r2 98 sr %r2,%r2 #erase register r2
@@ -75,8 +106,18 @@
75 .long 0x00080000,0x80000000 106 .long 0x00080000,0x80000000
76 sys_msk: 107 sys_msk:
77 .quad 0 108 .quad 0
109 ctlregs:
110 .rept 16
111 .quad 0
112 .endr
113 gprregs:
114 .rept 16
115 .quad 0
116 .endr
117 have_diag308:
118 .byte 0
119 .align 8
78 relocate_kernel_end: 120 relocate_kernel_end:
79 .globl relocate_kernel_len 121 .globl relocate_kernel_len
80 relocate_kernel_len: 122 relocate_kernel_len:
81 .quad relocate_kernel_end - relocate_kernel 123 .quad relocate_kernel_end - relocate_kernel
82
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index da77f001af8d..85222fee4361 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -537,7 +537,8 @@ int __devinit start_secondary(void *cpuvoid)
537#endif 537#endif
538#ifdef CONFIG_PFAULT 538#ifdef CONFIG_PFAULT
539 /* Enable pfault pseudo page faults on this cpu. */ 539 /* Enable pfault pseudo page faults on this cpu. */
540 pfault_init(); 540 if (MACHINE_IS_VM)
541 pfault_init();
541#endif 542#endif
542 /* Mark this cpu as online */ 543 /* Mark this cpu as online */
543 cpu_set(smp_processor_id(), cpu_online_map); 544 cpu_set(smp_processor_id(), cpu_online_map);
@@ -690,7 +691,8 @@ __cpu_disable(void)
690 691
691#ifdef CONFIG_PFAULT 692#ifdef CONFIG_PFAULT
692 /* Disable pfault pseudo page faults on this cpu. */ 693 /* Disable pfault pseudo page faults on this cpu. */
693 pfault_fini(); 694 if (MACHINE_IS_VM)
695 pfault_fini();
694#endif 696#endif
695 697
696 /* disable all external interrupts */ 698 /* disable all external interrupts */
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index a8668afb5f87..426d7cafdab3 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -290,3 +290,8 @@ SYSCALL(sys_add_key,sys_add_key,compat_sys_add_key_wrapper)
290SYSCALL(sys_request_key,sys_request_key,compat_sys_request_key_wrapper) 290SYSCALL(sys_request_key,sys_request_key,compat_sys_request_key_wrapper)
291SYSCALL(sys_keyctl,sys_keyctl,compat_sys_keyctl) /* 280 */ 291SYSCALL(sys_keyctl,sys_keyctl,compat_sys_keyctl) /* 280 */
292SYSCALL(sys_waitid,sys_waitid,compat_sys_waitid_wrapper) 292SYSCALL(sys_waitid,sys_waitid,compat_sys_waitid_wrapper)
293SYSCALL(sys_ioprio_set,sys_ioprio_set,sys_ioprio_set_wrapper)
294SYSCALL(sys_ioprio_get,sys_ioprio_get,sys_ioprio_get_wrapper)
295SYSCALL(sys_inotify_init,sys_inotify_init,sys_inotify_init)
296SYSCALL(sys_inotify_add_watch,sys_inotify_add_watch,sys_inotify_add_watch_wrapper)
297SYSCALL(sys_inotify_rm_watch,sys_inotify_rm_watch,sys_inotify_rm_watch_wrapper)
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index bc7b7be7acbe..6b8703ec2ae6 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -29,6 +29,7 @@
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/kallsyms.h> 31#include <linux/kallsyms.h>
32#include <linux/reboot.h>
32 33
33#include <asm/system.h> 34#include <asm/system.h>
34#include <asm/uaccess.h> 35#include <asm/uaccess.h>
@@ -675,6 +676,19 @@ asmlinkage void kernel_stack_overflow(struct pt_regs * regs)
675 panic("Corrupt kernel stack, can't continue."); 676 panic("Corrupt kernel stack, can't continue.");
676} 677}
677 678
679#ifndef CONFIG_ARCH_S390X
680static int
681pagex_reboot_event(struct notifier_block *this, unsigned long event, void *ptr)
682{
683 if (MACHINE_IS_VM)
684 cpcmd("SET PAGEX OFF", NULL, 0, NULL);
685 return NOTIFY_DONE;
686}
687
688static struct notifier_block pagex_reboot_notifier = {
689 .notifier_call = &pagex_reboot_event,
690};
691#endif
678 692
679/* init is done in lowcore.S and head.S */ 693/* init is done in lowcore.S and head.S */
680 694
@@ -735,6 +749,7 @@ void __init trap_init(void)
735 &ext_int_pfault); 749 &ext_int_pfault);
736#endif 750#endif
737#ifndef CONFIG_ARCH_S390X 751#ifndef CONFIG_ARCH_S390X
752 register_reboot_notifier(&pagex_reboot_notifier);
738 cpcmd("SET PAGEX ON", NULL, 0, NULL); 753 cpcmd("SET PAGEX ON", NULL, 0, NULL);
739#endif 754#endif
740 } 755 }
diff --git a/arch/sh64/mm/fault.c b/arch/sh64/mm/fault.c
index a24932881dbb..f08d0eaf6497 100644
--- a/arch/sh64/mm/fault.c
+++ b/arch/sh64/mm/fault.c
@@ -223,13 +223,13 @@ good_area:
223 */ 223 */
224survive: 224survive:
225 switch (handle_mm_fault(mm, vma, address, writeaccess)) { 225 switch (handle_mm_fault(mm, vma, address, writeaccess)) {
226 case 1: 226 case VM_FAULT_MINOR:
227 tsk->min_flt++; 227 tsk->min_flt++;
228 break; 228 break;
229 case 2: 229 case VM_FAULT_MAJOR:
230 tsk->maj_flt++; 230 tsk->maj_flt++;
231 break; 231 break;
232 case 0: 232 case VM_FAULT_SIGBUS:
233 goto do_sigbus; 233 goto do_sigbus;
234 default: 234 default:
235 goto out_of_memory; 235 goto out_of_memory;
diff --git a/arch/sparc64/solaris/socket.c b/arch/sparc64/solaris/socket.c
index 06740582717e..d3a66ea74a7f 100644
--- a/arch/sparc64/solaris/socket.c
+++ b/arch/sparc64/solaris/socket.c
@@ -16,6 +16,7 @@
16#include <linux/net.h> 16#include <linux/net.h>
17#include <linux/compat.h> 17#include <linux/compat.h>
18#include <net/compat.h> 18#include <net/compat.h>
19#include <net/sock.h>
19 20
20#include <asm/uaccess.h> 21#include <asm/uaccess.h>
21#include <asm/string.h> 22#include <asm/string.h>
@@ -297,121 +298,165 @@ asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr __user *user_msg, unsi
297{ 298{
298 struct socket *sock; 299 struct socket *sock;
299 char address[MAX_SOCK_ADDR]; 300 char address[MAX_SOCK_ADDR];
300 struct iovec iov[UIO_FASTIOV]; 301 struct iovec iovstack[UIO_FASTIOV], *iov = iovstack;
301 unsigned char ctl[sizeof(struct cmsghdr) + 20]; 302 unsigned char ctl[sizeof(struct cmsghdr) + 20];
302 unsigned char *ctl_buf = ctl; 303 unsigned char *ctl_buf = ctl;
303 struct msghdr kern_msg; 304 struct msghdr msg_sys;
304 int err, total_len; 305 int err, ctl_len, iov_size, total_len;
305 306
306 if(msghdr_from_user32_to_kern(&kern_msg, user_msg)) 307 err = -EFAULT;
307 return -EFAULT; 308 if (msghdr_from_user32_to_kern(&msg_sys, user_msg))
308 if(kern_msg.msg_iovlen > UIO_MAXIOV) 309 goto out;
309 return -EINVAL; 310
310 err = verify_compat_iovec(&kern_msg, iov, address, VERIFY_READ); 311 sock = sockfd_lookup(fd, &err);
311 if (err < 0) 312 if (!sock)
312 goto out; 313 goto out;
314
315 /* do not move before msg_sys is valid */
316 err = -EMSGSIZE;
317 if (msg_sys.msg_iovlen > UIO_MAXIOV)
318 goto out_put;
319
320 /* Check whether to allocate the iovec area*/
321 err = -ENOMEM;
322 iov_size = msg_sys.msg_iovlen * sizeof(struct iovec);
323 if (msg_sys.msg_iovlen > UIO_FASTIOV) {
324 iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL);
325 if (!iov)
326 goto out_put;
327 }
328
329 err = verify_compat_iovec(&msg_sys, iov, address, VERIFY_READ);
330 if (err < 0)
331 goto out_freeiov;
313 total_len = err; 332 total_len = err;
314 333
315 if(kern_msg.msg_controllen) { 334 err = -ENOBUFS;
316 struct sol_cmsghdr __user *ucmsg = kern_msg.msg_control; 335 if (msg_sys.msg_controllen > INT_MAX)
336 goto out_freeiov;
337
338 ctl_len = msg_sys.msg_controllen;
339 if (ctl_len) {
340 struct sol_cmsghdr __user *ucmsg = msg_sys.msg_control;
317 unsigned long *kcmsg; 341 unsigned long *kcmsg;
318 compat_size_t cmlen; 342 compat_size_t cmlen;
319 343
320 if (kern_msg.msg_controllen <= sizeof(compat_size_t)) 344 err = -EINVAL;
321 return -EINVAL; 345 if (ctl_len <= sizeof(compat_size_t))
346 goto out_freeiov;
322 347
323 if(kern_msg.msg_controllen > sizeof(ctl)) { 348 if (ctl_len > sizeof(ctl)) {
324 err = -ENOBUFS; 349 err = -ENOBUFS;
325 ctl_buf = kmalloc(kern_msg.msg_controllen, GFP_KERNEL); 350 ctl_buf = kmalloc(ctl_len, GFP_KERNEL);
326 if(!ctl_buf) 351 if (!ctl_buf)
327 goto out_freeiov; 352 goto out_freeiov;
328 } 353 }
329 __get_user(cmlen, &ucmsg->cmsg_len); 354 __get_user(cmlen, &ucmsg->cmsg_len);
330 kcmsg = (unsigned long *) ctl_buf; 355 kcmsg = (unsigned long *) ctl_buf;
331 *kcmsg++ = (unsigned long)cmlen; 356 *kcmsg++ = (unsigned long)cmlen;
332 err = -EFAULT; 357 err = -EFAULT;
333 if(copy_from_user(kcmsg, &ucmsg->cmsg_level, 358 if (copy_from_user(kcmsg, &ucmsg->cmsg_level,
334 kern_msg.msg_controllen - sizeof(compat_size_t))) 359 ctl_len - sizeof(compat_size_t)))
335 goto out_freectl; 360 goto out_freectl;
336 kern_msg.msg_control = ctl_buf; 361 msg_sys.msg_control = ctl_buf;
337 } 362 }
338 kern_msg.msg_flags = solaris_to_linux_msgflags(user_flags); 363 msg_sys.msg_flags = solaris_to_linux_msgflags(user_flags);
339 364
340 lock_kernel(); 365 if (sock->file->f_flags & O_NONBLOCK)
341 sock = sockfd_lookup(fd, &err); 366 msg_sys.msg_flags |= MSG_DONTWAIT;
342 if (sock != NULL) { 367 err = sock_sendmsg(sock, &msg_sys, total_len);
343 if (sock->file->f_flags & O_NONBLOCK)
344 kern_msg.msg_flags |= MSG_DONTWAIT;
345 err = sock_sendmsg(sock, &kern_msg, total_len);
346 sockfd_put(sock);
347 }
348 unlock_kernel();
349 368
350out_freectl: 369out_freectl:
351 /* N.B. Use kfree here, as kern_msg.msg_controllen might change? */ 370 if (ctl_buf != ctl)
352 if(ctl_buf != ctl) 371 sock_kfree_s(sock->sk, ctl_buf, ctl_len);
353 kfree(ctl_buf);
354out_freeiov: 372out_freeiov:
355 if(kern_msg.msg_iov != iov) 373 if (iov != iovstack)
356 kfree(kern_msg.msg_iov); 374 sock_kfree_s(sock->sk, iov, iov_size);
357out: 375out_put:
376 sockfd_put(sock);
377out:
358 return err; 378 return err;
359} 379}
360 380
361asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned int user_flags) 381asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned int user_flags)
362{ 382{
363 struct iovec iovstack[UIO_FASTIOV];
364 struct msghdr kern_msg;
365 char addr[MAX_SOCK_ADDR];
366 struct socket *sock; 383 struct socket *sock;
384 struct iovec iovstack[UIO_FASTIOV];
367 struct iovec *iov = iovstack; 385 struct iovec *iov = iovstack;
386 struct msghdr msg_sys;
387 unsigned long cmsg_ptr;
388 int err, iov_size, total_len, len;
389
390 /* kernel mode address */
391 char addr[MAX_SOCK_ADDR];
392
393 /* user mode address pointers */
368 struct sockaddr __user *uaddr; 394 struct sockaddr __user *uaddr;
369 int __user *uaddr_len; 395 int __user *uaddr_len;
370 unsigned long cmsg_ptr;
371 int err, total_len, len = 0;
372 396
373 if(msghdr_from_user32_to_kern(&kern_msg, user_msg)) 397 if (msghdr_from_user32_to_kern(&msg_sys, user_msg))
374 return -EFAULT; 398 return -EFAULT;
375 if(kern_msg.msg_iovlen > UIO_MAXIOV)
376 return -EINVAL;
377 399
378 uaddr = kern_msg.msg_name; 400 sock = sockfd_lookup(fd, &err);
401 if (!sock)
402 goto out;
403
404 err = -EMSGSIZE;
405 if (msg_sys.msg_iovlen > UIO_MAXIOV)
406 goto out_put;
407
408 /* Check whether to allocate the iovec area*/
409 err = -ENOMEM;
410 iov_size = msg_sys.msg_iovlen * sizeof(struct iovec);
411 if (msg_sys.msg_iovlen > UIO_FASTIOV) {
412 iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL);
413 if (!iov)
414 goto out_put;
415 }
416
417 /*
418 * Save the user-mode address (verify_iovec will change the
419 * kernel msghdr to use the kernel address space)
420 */
421
422 uaddr = (void __user *) msg_sys.msg_name;
379 uaddr_len = &user_msg->msg_namelen; 423 uaddr_len = &user_msg->msg_namelen;
380 err = verify_compat_iovec(&kern_msg, iov, addr, VERIFY_WRITE); 424 err = verify_compat_iovec(&msg_sys, iov, addr, VERIFY_WRITE);
381 if (err < 0) 425 if (err < 0)
382 goto out; 426 goto out_freeiov;
383 total_len = err; 427 total_len = err;
384 428
385 cmsg_ptr = (unsigned long) kern_msg.msg_control; 429 cmsg_ptr = (unsigned long) msg_sys.msg_control;
386 kern_msg.msg_flags = 0; 430 msg_sys.msg_flags = MSG_CMSG_COMPAT;
387 431
388 lock_kernel(); 432 if (sock->file->f_flags & O_NONBLOCK)
389 sock = sockfd_lookup(fd, &err); 433 user_flags |= MSG_DONTWAIT;
390 if (sock != NULL) { 434
391 if (sock->file->f_flags & O_NONBLOCK) 435 err = sock_recvmsg(sock, &msg_sys, total_len, user_flags);
392 user_flags |= MSG_DONTWAIT; 436 if(err < 0)
393 err = sock_recvmsg(sock, &kern_msg, total_len, user_flags); 437 goto out_freeiov;
394 if(err >= 0) 438
395 len = err; 439 len = err;
396 sockfd_put(sock); 440
397 } 441 if (uaddr != NULL) {
398 unlock_kernel(); 442 err = move_addr_to_user(addr, msg_sys.msg_namelen, uaddr, uaddr_len);
399 443 if (err < 0)
400 if(uaddr != NULL && err >= 0) 444 goto out_freeiov;
401 err = move_addr_to_user(addr, kern_msg.msg_namelen, uaddr, uaddr_len);
402 if(err >= 0) {
403 err = __put_user(linux_to_solaris_msgflags(kern_msg.msg_flags), &user_msg->msg_flags);
404 if(!err) {
405 /* XXX Convert cmsg back into userspace 32-bit format... */
406 err = __put_user((unsigned long)kern_msg.msg_control - cmsg_ptr,
407 &user_msg->msg_controllen);
408 }
409 } 445 }
446 err = __put_user(linux_to_solaris_msgflags(msg_sys.msg_flags), &user_msg->msg_flags);
447 if (err)
448 goto out_freeiov;
449 err = __put_user((unsigned long)msg_sys.msg_control - cmsg_ptr,
450 &user_msg->msg_controllen);
451 if (err)
452 goto out_freeiov;
453 err = len;
410 454
411 if(kern_msg.msg_iov != iov) 455out_freeiov:
412 kfree(kern_msg.msg_iov); 456 if (iov != iovstack)
457 sock_kfree_s(sock->sk, iov, iov_size);
458out_put:
459 sockfd_put(sock);
413out: 460out:
414 if(err < 0) 461 return err;
415 return err;
416 return len;
417} 462}
diff --git a/arch/x86_64/crypto/aes.c b/arch/x86_64/crypto/aes.c
index 2b5c4010ce38..acfdaa28791e 100644
--- a/arch/x86_64/crypto/aes.c
+++ b/arch/x86_64/crypto/aes.c
@@ -322,3 +322,4 @@ module_exit(aes_fini);
322 322
323MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); 323MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm");
324MODULE_LICENSE("GPL"); 324MODULE_LICENSE("GPL");
325MODULE_ALIAS("aes");
diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c
index b98b6d2462f6..2a925e2af390 100644
--- a/arch/x86_64/ia32/ptrace32.c
+++ b/arch/x86_64/ia32/ptrace32.c
@@ -43,11 +43,11 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 val)
43 switch (regno) { 43 switch (regno) {
44 case offsetof(struct user32, regs.fs): 44 case offsetof(struct user32, regs.fs):
45 if (val && (val & 3) != 3) return -EIO; 45 if (val && (val & 3) != 3) return -EIO;
46 child->thread.fs = val & 0xffff; 46 child->thread.fsindex = val & 0xffff;
47 break; 47 break;
48 case offsetof(struct user32, regs.gs): 48 case offsetof(struct user32, regs.gs):
49 if (val && (val & 3) != 3) return -EIO; 49 if (val && (val & 3) != 3) return -EIO;
50 child->thread.gs = val & 0xffff; 50 child->thread.gsindex = val & 0xffff;
51 break; 51 break;
52 case offsetof(struct user32, regs.ds): 52 case offsetof(struct user32, regs.ds):
53 if (val && (val & 3) != 3) return -EIO; 53 if (val && (val & 3) != 3) return -EIO;
@@ -138,10 +138,10 @@ static int getreg32(struct task_struct *child, unsigned regno, u32 *val)
138 138
139 switch (regno) { 139 switch (regno) {
140 case offsetof(struct user32, regs.fs): 140 case offsetof(struct user32, regs.fs):
141 *val = child->thread.fs; 141 *val = child->thread.fsindex;
142 break; 142 break;
143 case offsetof(struct user32, regs.gs): 143 case offsetof(struct user32, regs.gs):
144 *val = child->thread.gs; 144 *val = child->thread.gsindex;
145 break; 145 break;
146 case offsetof(struct user32, regs.ds): 146 case offsetof(struct user32, regs.ds):
147 *val = child->thread.ds; 147 *val = child->thread.ds;
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index 3b267c91bb0c..8aa56736cde3 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -36,6 +36,7 @@ static unsigned long bank[NR_BANKS] = { [0 ... NR_BANKS-1] = ~0UL };
36static unsigned long console_logged; 36static unsigned long console_logged;
37static int notify_user; 37static int notify_user;
38static int rip_msr; 38static int rip_msr;
39static int mce_bootlog;
39 40
40/* 41/*
41 * Lockless MCE logging infrastructure. 42 * Lockless MCE logging infrastructure.
@@ -197,10 +198,11 @@ void do_machine_check(struct pt_regs * regs, long error_code)
197 rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr); 198 rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr);
198 199
199 mce_get_rip(&m, regs); 200 mce_get_rip(&m, regs);
200 if (error_code != -1) 201 if (error_code >= 0)
201 rdtscll(m.tsc); 202 rdtscll(m.tsc);
202 wrmsrl(MSR_IA32_MC0_STATUS + i*4, 0); 203 wrmsrl(MSR_IA32_MC0_STATUS + i*4, 0);
203 mce_log(&m); 204 if (error_code != -2)
205 mce_log(&m);
204 206
205 /* Did this bank cause the exception? */ 207 /* Did this bank cause the exception? */
206 /* Assume that the bank with uncorrectable errors did it, 208 /* Assume that the bank with uncorrectable errors did it,
@@ -315,7 +317,7 @@ static void mce_init(void *dummy)
315 317
316 /* Log the machine checks left over from the previous reset. 318 /* Log the machine checks left over from the previous reset.
317 This also clears all registers */ 319 This also clears all registers */
318 do_machine_check(NULL, -1); 320 do_machine_check(NULL, mce_bootlog ? -1 : -2);
319 321
320 set_in_cr4(X86_CR4_MCE); 322 set_in_cr4(X86_CR4_MCE);
321 323
@@ -476,11 +478,17 @@ static int __init mcheck_disable(char *str)
476} 478}
477 479
478/* mce=off disables machine check. Note you can reenable it later 480/* mce=off disables machine check. Note you can reenable it later
479 using sysfs */ 481 using sysfs.
482 mce=bootlog Log MCEs from before booting. Disabled by default to work
483 around buggy BIOS that leave bogus MCEs. */
480static int __init mcheck_enable(char *str) 484static int __init mcheck_enable(char *str)
481{ 485{
486 if (*str == '=')
487 str++;
482 if (!strcmp(str, "off")) 488 if (!strcmp(str, "off"))
483 mce_dont_init = 1; 489 mce_dont_init = 1;
490 else if (!strcmp(str, "bootlog"))
491 mce_bootlog = 1;
484 else 492 else
485 printk("mce= argument %s ignored. Please use /sys", str); 493 printk("mce= argument %s ignored. Please use /sys", str);
486 return 0; 494 return 0;
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index 08abf9f5b159..79c362d03e2e 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -970,8 +970,21 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low)
970 * due to unused I/O APIC pins. 970 * due to unused I/O APIC pins.
971 */ 971 */
972 int irq = gsi; 972 int irq = gsi;
973 gsi = pci_irq++; 973 if (gsi < MAX_GSI_NUM) {
974 gsi_to_irq[irq] = gsi; 974 if (gsi > 15)
975 gsi = pci_irq++;
976#ifdef CONFIG_ACPI_BUS
977 /*
978 * Don't assign IRQ used by ACPI SCI
979 */
980 if (gsi == acpi_fadt.sci_int)
981 gsi = pci_irq++;
982#endif
983 gsi_to_irq[irq] = gsi;
984 } else {
985 printk(KERN_ERR "GSI %u is too high\n", gsi);
986 return gsi;
987 }
975 } 988 }
976 989
977 io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, 990 io_apic_set_pci_routing(ioapic, ioapic_pin, gsi,
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 0aa526298e92..116a491e2961 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -645,15 +645,15 @@ void __init setup_arch(char **cmdline_p)
645 } 645 }
646 } 646 }
647#endif 647#endif
648
649 sparse_init();
650
651#ifdef CONFIG_KEXEC 648#ifdef CONFIG_KEXEC
652 if (crashk_res.start != crashk_res.end) { 649 if (crashk_res.start != crashk_res.end) {
653 reserve_bootmem(crashk_res.start, 650 reserve_bootmem(crashk_res.start,
654 crashk_res.end - crashk_res.start + 1); 651 crashk_res.end - crashk_res.start + 1);
655 } 652 }
656#endif 653#endif
654
655 sparse_init();
656
657 paging_init(); 657 paging_init();
658 658
659 check_ioapic(); 659 check_ioapic();
diff --git a/arch/x86_64/lib/csum-copy.S b/arch/x86_64/lib/csum-copy.S
index 01808ec37836..72fd55ee896e 100644
--- a/arch/x86_64/lib/csum-copy.S
+++ b/arch/x86_64/lib/csum-copy.S
@@ -188,8 +188,8 @@ csum_partial_copy_generic:
188 source 188 source
189 movw (%rdi),%bx 189 movw (%rdi),%bx
190 adcl %ebx,%eax 190 adcl %ebx,%eax
191 dest
192 decl %ecx 191 decl %ecx
192 dest
193 movw %bx,(%rsi) 193 movw %bx,(%rsi)
194 leaq 2(%rdi),%rdi 194 leaq 2(%rdi),%rdi
195 leaq 2(%rsi),%rsi 195 leaq 2(%rsi),%rsi
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index 13792721037e..493819e543a5 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -439,13 +439,13 @@ good_area:
439 * the fault. 439 * the fault.
440 */ 440 */
441 switch (handle_mm_fault(mm, vma, address, write)) { 441 switch (handle_mm_fault(mm, vma, address, write)) {
442 case 1: 442 case VM_FAULT_MINOR:
443 tsk->min_flt++; 443 tsk->min_flt++;
444 break; 444 break;
445 case 2: 445 case VM_FAULT_MAJOR:
446 tsk->maj_flt++; 446 tsk->maj_flt++;
447 break; 447 break;
448 case 0: 448 case VM_FAULT_SIGBUS:
449 goto do_sigbus; 449 goto do_sigbus;
450 default: 450 default:
451 goto out_of_memory; 451 goto out_of_memory;