aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig41
-rw-r--r--arch/arm/common/Kconfig3
-rw-r--r--arch/arm/common/Makefile1
-rw-r--r--arch/arm/common/gic.c166
-rw-r--r--arch/arm/kernel/calls.S6
-rw-r--r--arch/arm/kernel/entry-armv.S7
-rw-r--r--arch/arm/kernel/signal.c5
-rw-r--r--arch/arm/kernel/traps.c2
-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.c2
-rw-r--r--arch/arm/mach-s3c2410/s3c2410.c4
-rw-r--r--arch/arm/mach-s3c2410/usb-simtec.c18
-rw-r--r--arch/arm/mach-sa1100/assabet.c7
-rw-r--r--arch/arm/mach-sa1100/cerf.c7
-rw-r--r--arch/arm/mach-sa1100/generic.c5
-rw-r--r--arch/arm/mach-sa1100/generic.h3
-rw-r--r--arch/arm/mach-sa1100/lart.c12
-rw-r--r--arch/arm/mach-sa1100/shannon.c7
-rw-r--r--arch/arm/mach-sa1100/simpad.c7
-rw-r--r--arch/arm/mm/Kconfig2
-rw-r--r--arch/arm/mm/mm-armv.c17
-rw-r--r--arch/arm/mm/proc-v6.S24
-rw-r--r--arch/arm/nwfpe/fpopcode.h6
-rw-r--r--arch/arm/nwfpe/softfloat.c34
26 files changed, 296 insertions, 98 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 7bc4a583f4e1..4bf0e8737e1f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -310,7 +310,7 @@ menu "Kernel Features"
310 310
311config SMP 311config SMP
312 bool "Symmetric Multi-Processing (EXPERIMENTAL)" 312 bool "Symmetric Multi-Processing (EXPERIMENTAL)"
313 depends on EXPERIMENTAL #&& n 313 depends on EXPERIMENTAL && BROKEN #&& n
314 help 314 help
315 This enables support for systems with more than one CPU. If you have 315 This enables support for systems with more than one CPU. If you have
316 a system with only one CPU, like most personal computers, say N. If 316 a system with only one CPU, like most personal computers, say N. If
@@ -635,10 +635,6 @@ config PM
635 and the Battery Powered Linux mini-HOWTO, available from 635 and the Battery Powered Linux mini-HOWTO, available from
636 <http://www.tldp.org/docs.html#howto>. 636 <http://www.tldp.org/docs.html#howto>.
637 637
638 Note that, even if you say N here, Linux on the x86 architecture
639 will issue the hlt instruction if nothing is to be done, thereby
640 sending the processor to sleep and saving power.
641
642config APM 638config APM
643 tristate "Advanced Power Management Emulation" 639 tristate "Advanced Power Management Emulation"
644 depends on PM 640 depends on PM
@@ -650,12 +646,6 @@ config APM
650 battery status information, and user-space programs will receive 646 battery status information, and user-space programs will receive
651 notification of APM "events" (e.g. battery status change). 647 notification of APM "events" (e.g. battery status change).
652 648
653 If you select "Y" here, you can disable actual use of the APM
654 BIOS by passing the "apm=off" option to the kernel at boot time.
655
656 Note that the APM support is almost completely disabled for
657 machines with more than one CPU.
658
659 In order to use APM, you will need supporting software. For location 649 In order to use APM, you will need supporting software. For location
660 and more information, read <file:Documentation/pm.txt> and the 650 and more information, read <file:Documentation/pm.txt> and the
661 Battery Powered Linux mini-HOWTO, available from 651 Battery Powered Linux mini-HOWTO, available from
@@ -665,39 +655,12 @@ config APM
665 manpage ("man 8 hdparm") for that), and it doesn't turn off 655 manpage ("man 8 hdparm") for that), and it doesn't turn off
666 VESA-compliant "green" monitors. 656 VESA-compliant "green" monitors.
667 657
668 This driver does not support the TI 4000M TravelMate and the ACER
669 486/DX4/75 because they don't have compliant BIOSes. Many "green"
670 desktop machines also don't have compliant BIOSes, and this driver
671 may cause those machines to panic during the boot phase.
672
673 Generally, if you don't have a battery in your machine, there isn't 658 Generally, if you don't have a battery in your machine, there isn't
674 much point in using this driver and you should say N. If you get 659 much point in using this driver and you should say N. If you get
675 random kernel OOPSes or reboots that don't seem to be related to 660 random kernel OOPSes or reboots that don't seem to be related to
676 anything, try disabling/enabling this option (or disabling/enabling 661 anything, try disabling/enabling this option (or disabling/enabling
677 APM in your BIOS). 662 APM in your BIOS).
678 663
679 Some other things you should try when experiencing seemingly random,
680 "weird" problems:
681
682 1) make sure that you have enough swap space and that it is
683 enabled.
684 2) pass the "no-hlt" option to the kernel
685 3) switch on floating point emulation in the kernel and pass
686 the "no387" option to the kernel
687 4) pass the "floppy=nodma" option to the kernel
688 5) pass the "mem=4M" option to the kernel (thereby disabling
689 all but the first 4 MB of RAM)
690 6) make sure that the CPU is not over clocked.
691 7) read the sig11 FAQ at <http://www.bitwizard.nl/sig11/>
692 8) disable the cache from your BIOS settings
693 9) install a fan for the video card or exchange video RAM
694 10) install a better fan for the CPU
695 11) exchange RAM chips
696 12) exchange the motherboard.
697
698 To compile this driver as a module, choose M here: the
699 module will be called apm.
700
701endmenu 664endmenu
702 665
703source "net/Kconfig" 666source "net/Kconfig"
@@ -752,6 +715,8 @@ source "drivers/hwmon/Kconfig"
752 715
753source "drivers/misc/Kconfig" 716source "drivers/misc/Kconfig"
754 717
718source "drivers/mfd/Kconfig"
719
755source "drivers/media/Kconfig" 720source "drivers/media/Kconfig"
756 721
757source "drivers/video/Kconfig" 722source "drivers/video/Kconfig"
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
index 692af6b5e8ff..666ba393575b 100644
--- a/arch/arm/common/Kconfig
+++ b/arch/arm/common/Kconfig
@@ -1,6 +1,9 @@
1config ICST525 1config ICST525
2 bool 2 bool
3 3
4config ARM_GIC
5 bool
6
4config ICST307 7config ICST307
5 bool 8 bool
6 9
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index 11f20a43ee3a..a87886564b19 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -4,6 +4,7 @@
4 4
5obj-y += rtctime.o 5obj-y += rtctime.o
6obj-$(CONFIG_ARM_AMBA) += amba.o 6obj-$(CONFIG_ARM_AMBA) += amba.o
7obj-$(CONFIG_ARM_GIC) += gic.o
7obj-$(CONFIG_ICST525) += icst525.o 8obj-$(CONFIG_ICST525) += icst525.o
8obj-$(CONFIG_ICST307) += icst307.o 9obj-$(CONFIG_ICST307) += icst307.o
9obj-$(CONFIG_SA1111) += sa1111.o 10obj-$(CONFIG_SA1111) += sa1111.o
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
new file mode 100644
index 000000000000..51dbf5489b6b
--- /dev/null
+++ b/arch/arm/common/gic.c
@@ -0,0 +1,166 @@
1/*
2 * linux/arch/arm/common/gic.c
3 *
4 * Copyright (C) 2002 ARM Limited, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Interrupt architecture for the GIC:
11 *
12 * o There is one Interrupt Distributor, which receives interrupts
13 * from system devices and sends them to the Interrupt Controllers.
14 *
15 * o There is one CPU Interface per CPU, which sends interrupts sent
16 * by the Distributor, and interrupts generated locally, to the
17 * associated CPU.
18 *
19 * Note that IRQs 0-31 are special - they are local to each CPU.
20 * As such, the enable set/clear, pending set/clear and active bit
21 * registers are banked per-cpu for these sources.
22 */
23#include <linux/init.h>
24#include <linux/kernel.h>
25#include <linux/list.h>
26#include <linux/smp.h>
27
28#include <asm/irq.h>
29#include <asm/io.h>
30#include <asm/mach/irq.h>
31#include <asm/hardware/gic.h>
32
33static void __iomem *gic_dist_base;
34static void __iomem *gic_cpu_base;
35
36/*
37 * Routines to acknowledge, disable and enable interrupts
38 *
39 * Linux assumes that when we're done with an interrupt we need to
40 * unmask it, in the same way we need to unmask an interrupt when
41 * we first enable it.
42 *
43 * The GIC has a seperate notion of "end of interrupt" to re-enable
44 * an interrupt after handling, in order to support hardware
45 * prioritisation.
46 *
47 * We can make the GIC behave in the way that Linux expects by making
48 * our "acknowledge" routine disable the interrupt, then mark it as
49 * complete.
50 */
51static void gic_ack_irq(unsigned int irq)
52{
53 u32 mask = 1 << (irq % 32);
54 writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4);
55 writel(irq, gic_cpu_base + GIC_CPU_EOI);
56}
57
58static void gic_mask_irq(unsigned int irq)
59{
60 u32 mask = 1 << (irq % 32);
61 writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4);
62}
63
64static void gic_unmask_irq(unsigned int irq)
65{
66 u32 mask = 1 << (irq % 32);
67 writel(mask, gic_dist_base + GIC_DIST_ENABLE_SET + (irq / 32) * 4);
68}
69
70static void gic_set_cpu(struct irqdesc *desc, unsigned int irq, unsigned int cpu)
71{
72 void __iomem *reg = gic_dist_base + GIC_DIST_TARGET + (irq & ~3);
73 unsigned int shift = (irq % 4) * 8;
74 u32 val;
75
76 val = readl(reg) & ~(0xff << shift);
77 val |= 1 << (cpu + shift);
78 writel(val, reg);
79}
80
81static struct irqchip gic_chip = {
82 .ack = gic_ack_irq,
83 .mask = gic_mask_irq,
84 .unmask = gic_unmask_irq,
85#ifdef CONFIG_SMP
86 .set_cpu = gic_set_cpu,
87#endif
88};
89
90void __init gic_dist_init(void __iomem *base)
91{
92 unsigned int max_irq, i;
93 u32 cpumask = 1 << smp_processor_id();
94
95 cpumask |= cpumask << 8;
96 cpumask |= cpumask << 16;
97
98 gic_dist_base = base;
99
100 writel(0, base + GIC_DIST_CTRL);
101
102 /*
103 * Find out how many interrupts are supported.
104 */
105 max_irq = readl(base + GIC_DIST_CTR) & 0x1f;
106 max_irq = (max_irq + 1) * 32;
107
108 /*
109 * The GIC only supports up to 1020 interrupt sources.
110 * Limit this to either the architected maximum, or the
111 * platform maximum.
112 */
113 if (max_irq > max(1020, NR_IRQS))
114 max_irq = max(1020, NR_IRQS);
115
116 /*
117 * Set all global interrupts to be level triggered, active low.
118 */
119 for (i = 32; i < max_irq; i += 16)
120 writel(0, base + GIC_DIST_CONFIG + i * 4 / 16);
121
122 /*
123 * Set all global interrupts to this CPU only.
124 */
125 for (i = 32; i < max_irq; i += 4)
126 writel(cpumask, base + GIC_DIST_TARGET + i * 4 / 4);
127
128 /*
129 * Set priority on all interrupts.
130 */
131 for (i = 0; i < max_irq; i += 4)
132 writel(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4);
133
134 /*
135 * Disable all interrupts.
136 */
137 for (i = 0; i < max_irq; i += 32)
138 writel(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32);
139
140 /*
141 * Setup the Linux IRQ subsystem.
142 */
143 for (i = 29; i < max_irq; i++) {
144 set_irq_chip(i, &gic_chip);
145 set_irq_handler(i, do_level_IRQ);
146 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
147 }
148
149 writel(1, base + GIC_DIST_CTRL);
150}
151
152void __cpuinit gic_cpu_init(void __iomem *base)
153{
154 gic_cpu_base = base;
155 writel(0xf0, base + GIC_CPU_PRIMASK);
156 writel(1, base + GIC_CPU_CTRL);
157}
158
159#ifdef CONFIG_SMP
160void gic_raise_softirq(cpumask_t cpumask, unsigned int irq)
161{
162 unsigned long map = *cpus_addr(cpumask);
163
164 writel(map << 16 | irq, gic_dist_base + GIC_DIST_SOFTINT);
165}
166#endif
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index e5d370c235d7..2b6b4c786e65 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -327,6 +327,12 @@ __syscall_start:
327/* 310 */ .long sys_request_key 327/* 310 */ .long sys_request_key
328 .long sys_keyctl 328 .long sys_keyctl
329 .long sys_semtimedop 329 .long sys_semtimedop
330/* vserver */ .long sys_ni_syscall
331 .long sys_ioprio_set
332/* 315 */ .long sys_ioprio_get
333 .long sys_inotify_init
334 .long sys_inotify_add_watch
335 .long sys_inotify_rm_watch
330__syscall_end: 336__syscall_end:
331 337
332 .rept NR_syscalls - (__syscall_end - __syscall_start) / 4 338 .rept NR_syscalls - (__syscall_end - __syscall_start) / 4
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/kernel/signal.c b/arch/arm/kernel/signal.c
index 5e435e42dacd..a94d75fef598 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -658,11 +658,12 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
658 /* 658 /*
659 * Block the signal if we were unsuccessful. 659 * Block the signal if we were unsuccessful.
660 */ 660 */
661 if (ret != 0 || !(ka->sa.sa_flags & SA_NODEFER)) { 661 if (ret != 0) {
662 spin_lock_irq(&tsk->sighand->siglock); 662 spin_lock_irq(&tsk->sighand->siglock);
663 sigorsets(&tsk->blocked, &tsk->blocked, 663 sigorsets(&tsk->blocked, &tsk->blocked,
664 &ka->sa.sa_mask); 664 &ka->sa.sa_mask);
665 sigaddset(&tsk->blocked, sig); 665 if (!(ka->sa.sa_flags & SA_NODEFER))
666 sigaddset(&tsk->blocked, sig);
666 recalc_sigpending(); 667 recalc_sigpending();
667 spin_unlock_irq(&tsk->sighand->siglock); 668 spin_unlock_irq(&tsk->sighand->siglock);
668 } 669 }
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index d571c37ac30c..4554c961251c 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -617,7 +617,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs)
617 notify_die("unknown data abort code", regs, &info, instr, 0); 617 notify_die("unknown data abort code", regs, &info, instr, 0);
618} 618}
619 619
620volatile void __bug(const char *file, int line, void *data) 620void __attribute__((noreturn)) __bug(const char *file, int line, void *data)
621{ 621{
622 printk(KERN_CRIT"kernel BUG at %s:%d!", file, line); 622 printk(KERN_CRIT"kernel BUG at %s:%d!", file, line);
623 if (data) 623 if (data)
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 7f58afb27e71..411ea9996190 100644
--- a/arch/arm/mach-ixp4xx/coyote-setup.c
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -36,7 +36,7 @@ static struct flash_platform_data coyote_flash_data = {
36 36
37static struct resource coyote_flash_resource = { 37static struct resource coyote_flash_resource = {
38 .start = COYOTE_FLASH_BASE, 38 .start = COYOTE_FLASH_BASE,
39 .end = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE, 39 .end = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE - 1,
40 .flags = IORESOURCE_MEM, 40 .flags = IORESOURCE_MEM,
41}; 41};
42 42
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
index 65e356bd10d6..333459d6aa46 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -114,7 +114,7 @@ static struct flash_platform_data gtwx5715_flash_data = {
114 114
115static struct resource gtwx5715_flash_resource = { 115static struct resource gtwx5715_flash_resource = {
116 .start = GTWX5715_FLASH_BASE, 116 .start = GTWX5715_FLASH_BASE,
117 .end = GTWX5715_FLASH_BASE + GTWX5715_FLASH_SIZE, 117 .end = GTWX5715_FLASH_BASE + GTWX5715_FLASH_SIZE - 1,
118 .flags = IORESOURCE_MEM, 118 .flags = IORESOURCE_MEM,
119}; 119};
120 120
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index 4633470a6a37..fa0646c8693b 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -36,7 +36,7 @@ static struct flash_platform_data ixdp425_flash_data = {
36 36
37static struct resource ixdp425_flash_resource = { 37static struct resource ixdp425_flash_resource = {
38 .start = IXDP425_FLASH_BASE, 38 .start = IXDP425_FLASH_BASE,
39 .end = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE, 39 .end = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE - 1,
40 .flags = IORESOURCE_MEM, 40 .flags = IORESOURCE_MEM,
41}; 41};
42 42
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c
index ff2f25409e44..0b88993dfd27 100644
--- a/arch/arm/mach-s3c2410/s3c2410.c
+++ b/arch/arm/mach-s3c2410/s3c2410.c
@@ -18,6 +18,7 @@
18 * 28-Sep-2004 BJD Updates for new serial port bits 18 * 28-Sep-2004 BJD Updates for new serial port bits
19 * 04-Nov-2004 BJD Updated UART configuration process 19 * 04-Nov-2004 BJD Updated UART configuration process
20 * 10-Jan-2005 BJD Removed s3c2410_clock_tick_rate 20 * 10-Jan-2005 BJD Removed s3c2410_clock_tick_rate
21 * 13-Aug-2005 DA Removed UART from initial I/O mappings
21*/ 22*/
22 23
23#include <linux/kernel.h> 24#include <linux/kernel.h>
@@ -49,10 +50,9 @@ static struct map_desc s3c2410_iodesc[] __initdata = {
49 IODESC_ENT(USBHOST), 50 IODESC_ENT(USBHOST),
50 IODESC_ENT(CLKPWR), 51 IODESC_ENT(CLKPWR),
51 IODESC_ENT(LCD), 52 IODESC_ENT(LCD),
52 IODESC_ENT(UART),
53 IODESC_ENT(TIMER), 53 IODESC_ENT(TIMER),
54 IODESC_ENT(ADC), 54 IODESC_ENT(ADC),
55 IODESC_ENT(WATCHDOG) 55 IODESC_ENT(WATCHDOG),
56}; 56};
57 57
58static struct resource s3c_uart0_resource[] = { 58static struct resource s3c_uart0_resource[] = {
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/assabet.c b/arch/arm/mach-sa1100/assabet.c
index 4d4d303ee3a8..24687f511bf5 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -35,6 +35,7 @@
35#include <asm/mach/map.h> 35#include <asm/mach/map.h>
36#include <asm/mach/serial_sa1100.h> 36#include <asm/mach/serial_sa1100.h>
37#include <asm/arch/assabet.h> 37#include <asm/arch/assabet.h>
38#include <asm/arch/mcp.h>
38 39
39#include "generic.h" 40#include "generic.h"
40 41
@@ -198,6 +199,11 @@ static struct irda_platform_data assabet_irda_data = {
198 .set_speed = assabet_irda_set_speed, 199 .set_speed = assabet_irda_set_speed,
199}; 200};
200 201
202static struct mcp_plat_data assabet_mcp_data = {
203 .mccr0 = MCCR0_ADM,
204 .sclk_rate = 11981000,
205};
206
201static void __init assabet_init(void) 207static void __init assabet_init(void)
202{ 208{
203 /* 209 /*
@@ -246,6 +252,7 @@ static void __init assabet_init(void)
246 sa11x0_set_flash_data(&assabet_flash_data, assabet_flash_resources, 252 sa11x0_set_flash_data(&assabet_flash_data, assabet_flash_resources,
247 ARRAY_SIZE(assabet_flash_resources)); 253 ARRAY_SIZE(assabet_flash_resources));
248 sa11x0_set_irda_data(&assabet_irda_data); 254 sa11x0_set_irda_data(&assabet_irda_data);
255 sa11x0_set_mcp_data(&assabet_mcp_data);
249} 256}
250 257
251/* 258/*
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
index 0aa918e24c31..9484be7dc671 100644
--- a/arch/arm/mach-sa1100/cerf.c
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -29,6 +29,7 @@
29#include <asm/mach/serial_sa1100.h> 29#include <asm/mach/serial_sa1100.h>
30 30
31#include <asm/arch/cerf.h> 31#include <asm/arch/cerf.h>
32#include <asm/arch/mcp.h>
32#include "generic.h" 33#include "generic.h"
33 34
34static struct resource cerfuart2_resources[] = { 35static struct resource cerfuart2_resources[] = {
@@ -116,10 +117,16 @@ static void __init cerf_map_io(void)
116 GPDR |= CERF_GPIO_CF_RESET; 117 GPDR |= CERF_GPIO_CF_RESET;
117} 118}
118 119
120static struct mcp_plat_data cerf_mcp_data = {
121 .mccr0 = MCCR0_ADM,
122 .sclk_rate = 11981000,
123};
124
119static void __init cerf_init(void) 125static void __init cerf_init(void)
120{ 126{
121 platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices)); 127 platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
122 sa11x0_set_flash_data(&cerf_flash_data, &cerf_flash_resource, 1); 128 sa11x0_set_flash_data(&cerf_flash_data, &cerf_flash_resource, 1);
129 sa11x0_set_mcp_data(&cerf_mcp_data);
123} 130}
124 131
125MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube") 132MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 95ae217be1bc..3f1e358455e5 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -221,6 +221,11 @@ static struct platform_device sa11x0mcp_device = {
221 .resource = sa11x0mcp_resources, 221 .resource = sa11x0mcp_resources,
222}; 222};
223 223
224void sa11x0_set_mcp_data(struct mcp_plat_data *data)
225{
226 sa11x0mcp_device.dev.platform_data = data;
227}
228
224static struct resource sa11x0ssp_resources[] = { 229static struct resource sa11x0ssp_resources[] = {
225 [0] = { 230 [0] = {
226 .start = 0x80070000, 231 .start = 0x80070000,
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index bfe41da9923e..279e3afa3c39 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -34,5 +34,8 @@ struct resource;
34extern void sa11x0_set_flash_data(struct flash_platform_data *flash, 34extern void sa11x0_set_flash_data(struct flash_platform_data *flash,
35 struct resource *res, int nr); 35 struct resource *res, int nr);
36 36
37struct sa11x0_ssp_plat_ops;
38extern void sa11x0_set_ssp_data(struct sa11x0_ssp_plat_ops *ops);
39
37struct irda_platform_data; 40struct irda_platform_data;
38void sa11x0_set_irda_data(struct irda_platform_data *irda); 41void sa11x0_set_irda_data(struct irda_platform_data *irda);
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
index 870b488aeda4..ed6744d480af 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -13,12 +13,23 @@
13#include <asm/mach/arch.h> 13#include <asm/mach/arch.h>
14#include <asm/mach/map.h> 14#include <asm/mach/map.h>
15#include <asm/mach/serial_sa1100.h> 15#include <asm/mach/serial_sa1100.h>
16#include <asm/arch/mcp.h>
16 17
17#include "generic.h" 18#include "generic.h"
18 19
19 20
20#warning "include/asm/arch-sa1100/ide.h needs fixing for lart" 21#warning "include/asm/arch-sa1100/ide.h needs fixing for lart"
21 22
23static struct mcp_plat_data lart_mcp_data = {
24 .mccr0 = MCCR0_ADM,
25 .sclk_rate = 11981000,
26};
27
28static void __init lart_init(void)
29{
30 sa11x0_set_mcp_data(&lart_mcp_data);
31}
32
22static struct map_desc lart_io_desc[] __initdata = { 33static struct map_desc lart_io_desc[] __initdata = {
23 /* virtual physical length type */ 34 /* virtual physical length type */
24 { 0xe8000000, 0x00000000, 0x00400000, MT_DEVICE }, /* main flash memory */ 35 { 0xe8000000, 0x00000000, 0x00400000, MT_DEVICE }, /* main flash memory */
@@ -47,5 +58,6 @@ MACHINE_START(LART, "LART")
47 .boot_params = 0xc0000100, 58 .boot_params = 0xc0000100,
48 .map_io = lart_map_io, 59 .map_io = lart_map_io,
49 .init_irq = sa1100_init_irq, 60 .init_irq = sa1100_init_irq,
61 .init_machine = lart_init,
50 .timer = &sa1100_timer, 62 .timer = &sa1100_timer,
51MACHINE_END 63MACHINE_END
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index 43a00359fcdd..7482288278d9 100644
--- a/arch/arm/mach-sa1100/shannon.c
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -18,6 +18,7 @@
18#include <asm/mach/flash.h> 18#include <asm/mach/flash.h>
19#include <asm/mach/map.h> 19#include <asm/mach/map.h>
20#include <asm/mach/serial_sa1100.h> 20#include <asm/mach/serial_sa1100.h>
21#include <asm/arch/mcp.h>
21#include <asm/arch/shannon.h> 22#include <asm/arch/shannon.h>
22 23
23#include "generic.h" 24#include "generic.h"
@@ -52,9 +53,15 @@ static struct resource shannon_flash_resource = {
52 .flags = IORESOURCE_MEM, 53 .flags = IORESOURCE_MEM,
53}; 54};
54 55
56static struct mcp_plat_data shannon_mcp_data = {
57 .mccr0 = MCCR0_ADM,
58 .sclk_rate = 11981000,
59};
60
55static void __init shannon_init(void) 61static void __init shannon_init(void)
56{ 62{
57 sa11x0_set_flash_data(&shannon_flash_data, &shannon_flash_resource, 1); 63 sa11x0_set_flash_data(&shannon_flash_data, &shannon_flash_resource, 1);
64 sa11x0_set_mcp_data(&shannon_mcp_data);
58} 65}
59 66
60static void __init shannon_map_io(void) 67static void __init shannon_map_io(void)
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index 77978586b126..07f6d5fd7bb0 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -23,6 +23,7 @@
23#include <asm/mach/flash.h> 23#include <asm/mach/flash.h>
24#include <asm/mach/map.h> 24#include <asm/mach/map.h>
25#include <asm/mach/serial_sa1100.h> 25#include <asm/mach/serial_sa1100.h>
26#include <asm/arch/mcp.h>
26#include <asm/arch/simpad.h> 27#include <asm/arch/simpad.h>
27 28
28#include <linux/serial_core.h> 29#include <linux/serial_core.h>
@@ -123,6 +124,11 @@ static struct resource simpad_flash_resources [] = {
123 } 124 }
124}; 125};
125 126
127static struct mcp_plat_data simpad_mcp_data = {
128 .mccr0 = MCCR0_ADM,
129 .sclk_rate = 11981000,
130};
131
126 132
127 133
128static void __init simpad_map_io(void) 134static void __init simpad_map_io(void)
@@ -157,6 +163,7 @@ static void __init simpad_map_io(void)
157 163
158 sa11x0_set_flash_data(&simpad_flash_data, simpad_flash_resources, 164 sa11x0_set_flash_data(&simpad_flash_data, simpad_flash_resources,
159 ARRAY_SIZE(simpad_flash_resources)); 165 ARRAY_SIZE(simpad_flash_resources));
166 sa11x0_set_mcp_data(&simpad_mcp_data);
160} 167}
161 168
162static void simpad_power_off(void) 169static void simpad_power_off(void)
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index afbbeb6f4658..db5e47dfc303 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -384,7 +384,7 @@ config CPU_DCACHE_DISABLE
384 384
385config CPU_DCACHE_WRITETHROUGH 385config CPU_DCACHE_WRITETHROUGH
386 bool "Force write through D-cache" 386 bool "Force write through D-cache"
387 depends on (CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020) && !CPU_DISABLE_DCACHE 387 depends on (CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020) && !CPU_DCACHE_DISABLE
388 default y if CPU_ARM925T 388 default y if CPU_ARM925T
389 help 389 help
390 Say Y here to use the data cache in writethrough mode. Unless you 390 Say Y here to use the data cache in writethrough mode. Unless you
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..139a38670c5d 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -105,18 +105,12 @@ ENTRY(cpu_v6_dcache_clean_area)
105ENTRY(cpu_v6_switch_mm) 105ENTRY(cpu_v6_switch_mm)
106 mov r2, #0 106 mov r2, #0
107 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id 107 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id
108 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB 108 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
109 mcr p15, 0, r2, c7, c10, 4 @ drain write buffer 109 mcr p15, 0, r2, c7, c10, 4 @ drain write buffer
110 mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 110 mcr p15, 0, r0, c2, c0, 0 @ set TTB 0
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/nwfpe/fpopcode.h b/arch/arm/nwfpe/fpopcode.h
index 8035f4faafbf..1777e92a88e6 100644
--- a/arch/arm/nwfpe/fpopcode.h
+++ b/arch/arm/nwfpe/fpopcode.h
@@ -370,20 +370,20 @@ TABLE 5
370#define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5) 370#define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5)
371 371
372#ifdef CONFIG_FPE_NWFPE_XP 372#ifdef CONFIG_FPE_NWFPE_XP
373static inline const floatx80 getExtendedConstant(const unsigned int nIndex) 373static inline __attribute_pure__ floatx80 getExtendedConstant(const unsigned int nIndex)
374{ 374{
375 extern const floatx80 floatx80Constant[]; 375 extern const floatx80 floatx80Constant[];
376 return floatx80Constant[nIndex]; 376 return floatx80Constant[nIndex];
377} 377}
378#endif 378#endif
379 379
380static inline const float64 getDoubleConstant(const unsigned int nIndex) 380static inline __attribute_pure__ float64 getDoubleConstant(const unsigned int nIndex)
381{ 381{
382 extern const float64 float64Constant[]; 382 extern const float64 float64Constant[];
383 return float64Constant[nIndex]; 383 return float64Constant[nIndex];
384} 384}
385 385
386static inline const float32 getSingleConstant(const unsigned int nIndex) 386static inline __attribute_pure__ float32 getSingleConstant(const unsigned int nIndex)
387{ 387{
388 extern const float32 float32Constant[]; 388 extern const float32 float32Constant[];
389 return float32Constant[nIndex]; 389 return float32Constant[nIndex];
diff --git a/arch/arm/nwfpe/softfloat.c b/arch/arm/nwfpe/softfloat.c
index 8b75a6e7cb3a..f9f049132a17 100644
--- a/arch/arm/nwfpe/softfloat.c
+++ b/arch/arm/nwfpe/softfloat.c
@@ -1602,9 +1602,7 @@ flag float32_le_quiet( float32 a, float32 b )
1602 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) 1602 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
1603 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) 1603 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
1604 ) { 1604 ) {
1605 if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) { 1605 /* Do nothing, even if NaN as we're quiet */
1606 float_raise( float_flag_invalid );
1607 }
1608 return 0; 1606 return 0;
1609 } 1607 }
1610 aSign = extractFloat32Sign( a ); 1608 aSign = extractFloat32Sign( a );
@@ -1629,9 +1627,7 @@ flag float32_lt_quiet( float32 a, float32 b )
1629 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) 1627 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
1630 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) 1628 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
1631 ) { 1629 ) {
1632 if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) { 1630 /* Do nothing, even if NaN as we're quiet */
1633 float_raise( float_flag_invalid );
1634 }
1635 return 0; 1631 return 0;
1636 } 1632 }
1637 aSign = extractFloat32Sign( a ); 1633 aSign = extractFloat32Sign( a );
@@ -2493,9 +2489,7 @@ flag float64_le_quiet( float64 a, float64 b )
2493 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) 2489 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
2494 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) 2490 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
2495 ) { 2491 ) {
2496 if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) { 2492 /* Do nothing, even if NaN as we're quiet */
2497 float_raise( float_flag_invalid );
2498 }
2499 return 0; 2493 return 0;
2500 } 2494 }
2501 aSign = extractFloat64Sign( a ); 2495 aSign = extractFloat64Sign( a );
@@ -2520,9 +2514,7 @@ flag float64_lt_quiet( float64 a, float64 b )
2520 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) 2514 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
2521 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) 2515 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
2522 ) { 2516 ) {
2523 if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) { 2517 /* Do nothing, even if NaN as we're quiet */
2524 float_raise( float_flag_invalid );
2525 }
2526 return 0; 2518 return 0;
2527 } 2519 }
2528 aSign = extractFloat64Sign( a ); 2520 aSign = extractFloat64Sign( a );
@@ -3256,7 +3248,7 @@ flag floatx80_eq( floatx80 a, floatx80 b )
3256 ) { 3248 ) {
3257 if ( floatx80_is_signaling_nan( a ) 3249 if ( floatx80_is_signaling_nan( a )
3258 || floatx80_is_signaling_nan( b ) ) { 3250 || floatx80_is_signaling_nan( b ) ) {
3259 roundData->exception |= float_flag_invalid; 3251 float_raise( float_flag_invalid );
3260 } 3252 }
3261 return 0; 3253 return 0;
3262 } 3254 }
@@ -3286,7 +3278,7 @@ flag floatx80_le( floatx80 a, floatx80 b )
3286 || ( ( extractFloatx80Exp( b ) == 0x7FFF ) 3278 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3287 && (bits64) ( extractFloatx80Frac( b )<<1 ) ) 3279 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3288 ) { 3280 ) {
3289 roundData->exception |= float_flag_invalid; 3281 float_raise( float_flag_invalid );
3290 return 0; 3282 return 0;
3291 } 3283 }
3292 aSign = extractFloatx80Sign( a ); 3284 aSign = extractFloatx80Sign( a );
@@ -3320,7 +3312,7 @@ flag floatx80_lt( floatx80 a, floatx80 b )
3320 || ( ( extractFloatx80Exp( b ) == 0x7FFF ) 3312 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3321 && (bits64) ( extractFloatx80Frac( b )<<1 ) ) 3313 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3322 ) { 3314 ) {
3323 roundData->exception |= float_flag_invalid; 3315 float_raise( float_flag_invalid );
3324 return 0; 3316 return 0;
3325 } 3317 }
3326 aSign = extractFloatx80Sign( a ); 3318 aSign = extractFloatx80Sign( a );
@@ -3353,7 +3345,7 @@ flag floatx80_eq_signaling( floatx80 a, floatx80 b )
3353 || ( ( extractFloatx80Exp( b ) == 0x7FFF ) 3345 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3354 && (bits64) ( extractFloatx80Frac( b )<<1 ) ) 3346 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3355 ) { 3347 ) {
3356 roundData->exception |= float_flag_invalid; 3348 float_raise( float_flag_invalid );
3357 return 0; 3349 return 0;
3358 } 3350 }
3359 return 3351 return
@@ -3382,10 +3374,7 @@ flag floatx80_le_quiet( floatx80 a, floatx80 b )
3382 || ( ( extractFloatx80Exp( b ) == 0x7FFF ) 3374 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3383 && (bits64) ( extractFloatx80Frac( b )<<1 ) ) 3375 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3384 ) { 3376 ) {
3385 if ( floatx80_is_signaling_nan( a ) 3377 /* Do nothing, even if NaN as we're quiet */
3386 || floatx80_is_signaling_nan( b ) ) {
3387 roundData->exception |= float_flag_invalid;
3388 }
3389 return 0; 3378 return 0;
3390 } 3379 }
3391 aSign = extractFloatx80Sign( a ); 3380 aSign = extractFloatx80Sign( a );
@@ -3419,10 +3408,7 @@ flag floatx80_lt_quiet( floatx80 a, floatx80 b )
3419 || ( ( extractFloatx80Exp( b ) == 0x7FFF ) 3408 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3420 && (bits64) ( extractFloatx80Frac( b )<<1 ) ) 3409 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3421 ) { 3410 ) {
3422 if ( floatx80_is_signaling_nan( a ) 3411 /* Do nothing, even if NaN as we're quiet */
3423 || floatx80_is_signaling_nan( b ) ) {
3424 roundData->exception |= float_flag_invalid;
3425 }
3426 return 0; 3412 return 0;
3427 } 3413 }
3428 aSign = extractFloatx80Sign( a ); 3414 aSign = extractFloatx80Sign( a );