aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-09-25 08:51:50 -0400
committerPaul Mackerras <paulus@samba.org>2005-09-25 08:51:50 -0400
commite5baa396af7560382d2cf3f0871d616b61fc284c (patch)
tree6afc166894b8c8b3b2cf6add72a726be14ae2443 /arch
parentd6a4c847e43c851cc0ddf73087a730227223f989 (diff)
parentef6bd6eb90ad72ee8ee7ba8b271f27102e9a90c1 (diff)
Merge from Linus' tree.
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/process.c4
-rw-r--r--arch/alpha/kernel/sys_dp264.c41
-rw-r--r--arch/arm/boot/compressed/ofw-shark.c2
-rw-r--r--arch/arm/kernel/entry-armv.S2
-rw-r--r--arch/arm/kernel/io.c6
-rw-r--r--arch/arm/kernel/semaphore.c2
-rw-r--r--arch/arm/kernel/traps.c3
-rw-r--r--arch/arm/kernel/vmlinux.lds.S8
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c6
-rw-r--r--arch/arm/mach-s3c2410/mach-anubis.c3
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c3
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c7
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c6
-rw-r--r--arch/arm/mach-s3c2410/mach-nexcoder.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-otom.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-rx3715.c5
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2410.c5
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2440.c5
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c3
-rw-r--r--arch/arm/mach-sa1100/generic.h3
-rw-r--r--arch/arm/mm/fault.c12
-rw-r--r--arch/arm/mm/proc-arm1020.S2
-rw-r--r--arch/arm/mm/proc-arm1020e.S2
-rw-r--r--arch/arm/mm/proc-arm1022.S2
-rw-r--r--arch/arm/mm/proc-arm1026.S2
-rw-r--r--arch/arm/mm/proc-arm6_7.S2
-rw-r--r--arch/arm/mm/proc-arm720.S2
-rw-r--r--arch/arm/mm/proc-arm920.S2
-rw-r--r--arch/arm/mm/proc-arm922.S2
-rw-r--r--arch/arm/mm/proc-arm925.S2
-rw-r--r--arch/arm/mm/proc-arm926.S2
-rw-r--r--arch/arm/mm/proc-sa110.S2
-rw-r--r--arch/arm/mm/proc-sa1100.S2
-rw-r--r--arch/arm/mm/proc-v6.S2
-rw-r--r--arch/arm/mm/proc-xscale.S2
-rw-r--r--arch/ia64/hp/sim/simscsi.c29
-rw-r--r--arch/ia64/kernel/mca_asm.S96
-rw-r--r--arch/ia64/kernel/mca_drv.c21
-rw-r--r--arch/ppc/kernel/Makefile3
-rw-r--r--arch/ppc/kernel/perfmon.c6
-rw-r--r--arch/ppc/platforms/pmac_setup.c10
-rw-r--r--arch/ppc/syslib/of_device.c6
-rw-r--r--arch/ppc/syslib/ppc85xx_setup.c8
-rw-r--r--arch/ppc64/Makefile2
-rw-r--r--arch/ppc64/kernel/of_device.c7
-rw-r--r--arch/ppc64/kernel/pSeries_iommu.c181
-rw-r--r--arch/ppc64/kernel/pci.c9
-rw-r--r--arch/ppc64/kernel/pmac_setup.c18
-rw-r--r--arch/ppc64/kernel/pmac_time.c4
-rw-r--r--arch/ppc64/kernel/prom_init.c3
-rw-r--r--arch/ppc64/kernel/ptrace.c1
-rw-r--r--arch/ppc64/mm/hash_native.c5
-rw-r--r--arch/ppc64/mm/hugetlbpage.c7
-rw-r--r--arch/sparc64/kernel/entry.S39
-rw-r--r--arch/sparc64/kernel/ptrace.c7
-rw-r--r--arch/sparc64/kernel/una_asm.S2
-rw-r--r--arch/sparc64/kernel/unaligned.c64
-rw-r--r--arch/um/Makefile6
-rw-r--r--arch/um/drivers/chan_kern.c60
-rw-r--r--arch/um/drivers/mconsole_user.c2
-rw-r--r--arch/um/include/common-offsets.h4
-rw-r--r--arch/um/include/user.h4
-rw-r--r--arch/um/kernel/process_kern.c3
-rw-r--r--arch/um/kernel/sigio_user.c2
-rw-r--r--arch/um/kernel/skas/include/uaccess-skas.h6
-rw-r--r--arch/um/kernel/tlb.c12
-rw-r--r--arch/um/kernel/trap_kern.c18
-rw-r--r--arch/um/kernel/tt/include/uaccess-tt.h6
-rw-r--r--arch/um/kernel/tt/process_kern.c3
-rw-r--r--arch/um/kernel/tt/uaccess_user.c11
-rw-r--r--arch/um/kernel/umid.c41
-rw-r--r--arch/um/kernel/user_util.c6
-rw-r--r--arch/um/os-Linux/aio.c1
-rw-r--r--arch/um/os-Linux/elf_aux.c3
-rw-r--r--arch/um/os-Linux/process.c1
-rw-r--r--arch/um/sys-i386/ldt.c1
-rw-r--r--arch/x86_64/Kconfig2
-rw-r--r--arch/xtensa/kernel/pci.c4
-rw-r--r--arch/xtensa/kernel/platform.c2
-rw-r--r--arch/xtensa/kernel/process.c2
-rw-r--r--arch/xtensa/kernel/setup.c2
-rw-r--r--arch/xtensa/kernel/signal.c2
-rw-r--r--arch/xtensa/kernel/time.c2
-rw-r--r--arch/xtensa/mm/init.c2
84 files changed, 589 insertions, 305 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index fa98dae3cd98..eb20c3afff58 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -127,6 +127,10 @@ common_shutdown_1(void *generic_ptr)
127 /* If booted from SRM, reset some of the original environment. */ 127 /* If booted from SRM, reset some of the original environment. */
128 if (alpha_using_srm) { 128 if (alpha_using_srm) {
129#ifdef CONFIG_DUMMY_CONSOLE 129#ifdef CONFIG_DUMMY_CONSOLE
130 /* If we've gotten here after SysRq-b, leave interrupt
131 context before taking over the console. */
132 if (in_interrupt())
133 irq_exit();
130 /* This has the effect of resetting the VGA video origin. */ 134 /* This has the effect of resetting the VGA video origin. */
131 take_over_console(&dummy_con, 0, MAX_NR_CONSOLES-1, 1); 135 take_over_console(&dummy_con, 0, MAX_NR_CONSOLES-1, 1);
132#endif 136#endif
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c
index 9e36b07fa940..d5da6b1b28ee 100644
--- a/arch/alpha/kernel/sys_dp264.c
+++ b/arch/alpha/kernel/sys_dp264.c
@@ -395,6 +395,22 @@ clipper_init_irq(void)
395 */ 395 */
396 396
397static int __init 397static int __init
398isa_irq_fixup(struct pci_dev *dev, int irq)
399{
400 u8 irq8;
401
402 if (irq > 0)
403 return irq;
404
405 /* This interrupt is routed via ISA bridge, so we'll
406 just have to trust whatever value the console might
407 have assigned. */
408 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq8);
409
410 return irq8 & 0xf;
411}
412
413static int __init
398dp264_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 414dp264_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
399{ 415{
400 static char irq_tab[6][5] __initdata = { 416 static char irq_tab[6][5] __initdata = {
@@ -407,25 +423,13 @@ dp264_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
407 { 16+ 3, 16+ 3, 16+ 2, 16+ 1, 16+ 0} /* IdSel 10 slot 3 */ 423 { 16+ 3, 16+ 3, 16+ 2, 16+ 1, 16+ 0} /* IdSel 10 slot 3 */
408 }; 424 };
409 const long min_idsel = 5, max_idsel = 10, irqs_per_slot = 5; 425 const long min_idsel = 5, max_idsel = 10, irqs_per_slot = 5;
410
411 struct pci_controller *hose = dev->sysdata; 426 struct pci_controller *hose = dev->sysdata;
412 int irq = COMMON_TABLE_LOOKUP; 427 int irq = COMMON_TABLE_LOOKUP;
413 428
414 if (irq > 0) { 429 if (irq > 0)
415 irq += 16 * hose->index; 430 irq += 16 * hose->index;
416 } else {
417 /* ??? The Contaq IDE controller on the ISA bridge uses
418 "legacy" interrupts 14 and 15. I don't know if anything
419 can wind up at the same slot+pin on hose1, so we'll
420 just have to trust whatever value the console might
421 have assigned. */
422
423 u8 irq8;
424 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq8);
425 irq = irq8;
426 }
427 431
428 return irq; 432 return isa_irq_fixup(dev, irq);
429} 433}
430 434
431static int __init 435static int __init
@@ -453,7 +457,8 @@ monet_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
453 { 24, 24, 25, 26, 27} /* IdSel 15 slot 5 PCI2*/ 457 { 24, 24, 25, 26, 27} /* IdSel 15 slot 5 PCI2*/
454 }; 458 };
455 const long min_idsel = 3, max_idsel = 15, irqs_per_slot = 5; 459 const long min_idsel = 3, max_idsel = 15, irqs_per_slot = 5;
456 return COMMON_TABLE_LOOKUP; 460
461 return isa_irq_fixup(dev, COMMON_TABLE_LOOKUP);
457} 462}
458 463
459static u8 __init 464static u8 __init
@@ -507,7 +512,8 @@ webbrick_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
507 { 47, 47, 46, 45, 44}, /* IdSel 17 slot 3 */ 512 { 47, 47, 46, 45, 44}, /* IdSel 17 slot 3 */
508 }; 513 };
509 const long min_idsel = 7, max_idsel = 17, irqs_per_slot = 5; 514 const long min_idsel = 7, max_idsel = 17, irqs_per_slot = 5;
510 return COMMON_TABLE_LOOKUP; 515
516 return isa_irq_fixup(dev, COMMON_TABLE_LOOKUP);
511} 517}
512 518
513static int __init 519static int __init
@@ -524,14 +530,13 @@ clipper_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
524 { -1, -1, -1, -1, -1} /* IdSel 7 ISA Bridge */ 530 { -1, -1, -1, -1, -1} /* IdSel 7 ISA Bridge */
525 }; 531 };
526 const long min_idsel = 1, max_idsel = 7, irqs_per_slot = 5; 532 const long min_idsel = 1, max_idsel = 7, irqs_per_slot = 5;
527
528 struct pci_controller *hose = dev->sysdata; 533 struct pci_controller *hose = dev->sysdata;
529 int irq = COMMON_TABLE_LOOKUP; 534 int irq = COMMON_TABLE_LOOKUP;
530 535
531 if (irq > 0) 536 if (irq > 0)
532 irq += 16 * hose->index; 537 irq += 16 * hose->index;
533 538
534 return irq; 539 return isa_irq_fixup(dev, irq);
535} 540}
536 541
537static void __init 542static void __init
diff --git a/arch/arm/boot/compressed/ofw-shark.c b/arch/arm/boot/compressed/ofw-shark.c
index 7f6f5db0d060..465c54b6b128 100644
--- a/arch/arm/boot/compressed/ofw-shark.c
+++ b/arch/arm/boot/compressed/ofw-shark.c
@@ -256,5 +256,5 @@ asmlinkage void ofw_init(ofw_handle_t o, int *nomr, int *pointer)
256 temp[11]='\0'; 256 temp[11]='\0';
257 mem_len = OF_getproplen(o,phandle, temp); 257 mem_len = OF_getproplen(o,phandle, temp);
258 OF_getprop(o,phandle, temp, buffer, mem_len); 258 OF_getprop(o,phandle, temp, buffer, mem_len);
259 (unsigned char) pointer[32] = ((unsigned char *) buffer)[mem_len-2]; 259 * ((unsigned char *) &pointer[32]) = ((unsigned char *) buffer)[mem_len-2];
260} 260}
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 7152bfbee581..93b5e8e5292e 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -537,7 +537,7 @@ ENTRY(__switch_to)
537#ifdef CONFIG_CPU_MPCORE 537#ifdef CONFIG_CPU_MPCORE
538 clrex 538 clrex
539#else 539#else
540 strex r3, r4, [ip] @ Clear exclusive monitor 540 strex r5, r4, [ip] @ Clear exclusive monitor
541#endif 541#endif
542#endif 542#endif
543#if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT) 543#if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT)
diff --git a/arch/arm/kernel/io.c b/arch/arm/kernel/io.c
index 6c20c1188b60..1f6822dfae74 100644
--- a/arch/arm/kernel/io.c
+++ b/arch/arm/kernel/io.c
@@ -7,7 +7,7 @@
7 * Copy data from IO memory space to "real" memory space. 7 * Copy data from IO memory space to "real" memory space.
8 * This needs to be optimized. 8 * This needs to be optimized.
9 */ 9 */
10void _memcpy_fromio(void *to, void __iomem *from, size_t count) 10void _memcpy_fromio(void *to, const volatile void __iomem *from, size_t count)
11{ 11{
12 unsigned char *t = to; 12 unsigned char *t = to;
13 while (count) { 13 while (count) {
@@ -22,7 +22,7 @@ void _memcpy_fromio(void *to, void __iomem *from, size_t count)
22 * Copy data from "real" memory space to IO memory space. 22 * Copy data from "real" memory space to IO memory space.
23 * This needs to be optimized. 23 * This needs to be optimized.
24 */ 24 */
25void _memcpy_toio(void __iomem *to, const void *from, size_t count) 25void _memcpy_toio(volatile void __iomem *to, const void *from, size_t count)
26{ 26{
27 const unsigned char *f = from; 27 const unsigned char *f = from;
28 while (count) { 28 while (count) {
@@ -37,7 +37,7 @@ void _memcpy_toio(void __iomem *to, const void *from, size_t count)
37 * "memset" on IO memory space. 37 * "memset" on IO memory space.
38 * This needs to be optimized. 38 * This needs to be optimized.
39 */ 39 */
40void _memset_io(void __iomem *dst, int c, size_t count) 40void _memset_io(volatile void __iomem *dst, int c, size_t count)
41{ 41{
42 while (count) { 42 while (count) {
43 count--; 43 count--;
diff --git a/arch/arm/kernel/semaphore.c b/arch/arm/kernel/semaphore.c
index ac423e3e224b..4c31f2923055 100644
--- a/arch/arm/kernel/semaphore.c
+++ b/arch/arm/kernel/semaphore.c
@@ -178,7 +178,7 @@ int __down_trylock(struct semaphore * sem)
178 * registers (r0 to r3 and lr), but not ip, as we use it as a return 178 * registers (r0 to r3 and lr), but not ip, as we use it as a return
179 * value in some cases.. 179 * value in some cases..
180 */ 180 */
181asm(" .section .sched.text,\"ax\" \n\ 181asm(" .section .sched.text,\"ax\",%progbits \n\
182 .align 5 \n\ 182 .align 5 \n\
183 .globl __down_failed \n\ 183 .globl __down_failed \n\
184__down_failed: \n\ 184__down_failed: \n\
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 4554c961251c..e7d22dbcb691 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -624,6 +624,9 @@ void __attribute__((noreturn)) __bug(const char *file, int line, void *data)
624 printk(" - extra data = %p", data); 624 printk(" - extra data = %p", data);
625 printk("\n"); 625 printk("\n");
626 *(int *)0 = 0; 626 *(int *)0 = 0;
627
628 /* Avoid "noreturn function does return" */
629 for (;;);
627} 630}
628EXPORT_SYMBOL(__bug); 631EXPORT_SYMBOL(__bug);
629 632
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index ad2d66c93a5c..08e58ecd44be 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -23,20 +23,20 @@ SECTIONS
23 *(.init.text) 23 *(.init.text)
24 _einittext = .; 24 _einittext = .;
25 __proc_info_begin = .; 25 __proc_info_begin = .;
26 *(.proc.info) 26 *(.proc.info.init)
27 __proc_info_end = .; 27 __proc_info_end = .;
28 __arch_info_begin = .; 28 __arch_info_begin = .;
29 *(.arch.info) 29 *(.arch.info.init)
30 __arch_info_end = .; 30 __arch_info_end = .;
31 __tagtable_begin = .; 31 __tagtable_begin = .;
32 *(.taglist) 32 *(.taglist.init)
33 __tagtable_end = .; 33 __tagtable_end = .;
34 . = ALIGN(16); 34 . = ALIGN(16);
35 __setup_start = .; 35 __setup_start = .;
36 *(.init.setup) 36 *(.init.setup)
37 __setup_end = .; 37 __setup_end = .;
38 __early_begin = .; 38 __early_begin = .;
39 *(__early_param) 39 *(.early_param.init)
40 __early_end = .; 40 __early_end = .;
41 __initcall_start = .; 41 __initcall_start = .;
42 *(.initcall1.init) 42 *(.initcall1.init)
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index ae1fa099d5fa..39b06ed80646 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -123,6 +123,7 @@ static void __init ixdp425_init(void)
123 platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); 123 platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices));
124} 124}
125 125
126#ifdef CONFIG_ARCH_IXDP465
126MACHINE_START(IXDP425, "Intel IXDP425 Development Platform") 127MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
127 /* Maintainer: MontaVista Software, Inc. */ 128 /* Maintainer: MontaVista Software, Inc. */
128 .phys_ram = PHYS_OFFSET, 129 .phys_ram = PHYS_OFFSET,
@@ -134,7 +135,9 @@ MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
134 .boot_params = 0x0100, 135 .boot_params = 0x0100,
135 .init_machine = ixdp425_init, 136 .init_machine = ixdp425_init,
136MACHINE_END 137MACHINE_END
138#endif
137 139
140#ifdef CONFIG_MACH_IXDP465
138MACHINE_START(IXDP465, "Intel IXDP465 Development Platform") 141MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
139 /* Maintainer: MontaVista Software, Inc. */ 142 /* Maintainer: MontaVista Software, Inc. */
140 .phys_ram = PHYS_OFFSET, 143 .phys_ram = PHYS_OFFSET,
@@ -146,7 +149,9 @@ MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
146 .boot_params = 0x0100, 149 .boot_params = 0x0100,
147 .init_machine = ixdp425_init, 150 .init_machine = ixdp425_init,
148MACHINE_END 151MACHINE_END
152#endif
149 153
154#ifdef CONFIG_ARCH_PRPMC1100
150MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform") 155MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
151 /* Maintainer: MontaVista Software, Inc. */ 156 /* Maintainer: MontaVista Software, Inc. */
152 .phys_ram = PHYS_OFFSET, 157 .phys_ram = PHYS_OFFSET,
@@ -158,6 +163,7 @@ MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
158 .boot_params = 0x0100, 163 .boot_params = 0x0100,
159 .init_machine = ixdp425_init, 164 .init_machine = ixdp425_init,
160MACHINE_END 165MACHINE_END
166#endif
161 167
162/* 168/*
163 * Avila is functionally equivalent to IXDP425 except that it adds 169 * Avila is functionally equivalent to IXDP425 except that it adds
diff --git a/arch/arm/mach-s3c2410/mach-anubis.c b/arch/arm/mach-s3c2410/mach-anubis.c
index f87aa0b669ad..7c05f27fe1d6 100644
--- a/arch/arm/mach-s3c2410/mach-anubis.c
+++ b/arch/arm/mach-s3c2410/mach-anubis.c
@@ -12,6 +12,7 @@
12 * 12 *
13 * Modifications: 13 * Modifications:
14 * 02-May-2005 BJD Copied from mach-bast.c 14 * 02-May-2005 BJD Copied from mach-bast.c
15 * 20-Sep-2005 BJD Added static to non-exported items
15*/ 16*/
16 17
17#include <linux/kernel.h> 18#include <linux/kernel.h>
@@ -232,7 +233,7 @@ static struct s3c24xx_board anubis_board __initdata = {
232 .clocks_count = ARRAY_SIZE(anubis_clocks) 233 .clocks_count = ARRAY_SIZE(anubis_clocks)
233}; 234};
234 235
235void __init anubis_map_io(void) 236static void __init anubis_map_io(void)
236{ 237{
237 /* initialise the clocks */ 238 /* initialise the clocks */
238 239
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 1a3367da6408..ed1f07d7252f 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -31,6 +31,7 @@
31 * 17-Jul-2005 BJD Changed to platform device for SuperIO 16550s 31 * 17-Jul-2005 BJD Changed to platform device for SuperIO 16550s
32 * 25-Jul-2005 BJD Removed ASIX static mappings 32 * 25-Jul-2005 BJD Removed ASIX static mappings
33 * 27-Jul-2005 BJD Ensure maximum frequency of i2c bus 33 * 27-Jul-2005 BJD Ensure maximum frequency of i2c bus
34 * 20-Sep-2005 BJD Added static to non-exported items
34*/ 35*/
35 36
36#include <linux/kernel.h> 37#include <linux/kernel.h>
@@ -428,7 +429,7 @@ static struct s3c24xx_board bast_board __initdata = {
428 .clocks_count = ARRAY_SIZE(bast_clocks) 429 .clocks_count = ARRAY_SIZE(bast_clocks)
429}; 430};
430 431
431void __init bast_map_io(void) 432static void __init bast_map_io(void)
432{ 433{
433 /* initialise the clocks */ 434 /* initialise the clocks */
434 435
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 6ff1889fbd21..fb3cb01266e5 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -24,6 +24,7 @@
24 * 10-Jan-2005 BJD Removed include of s3c2410.h 24 * 10-Jan-2005 BJD Removed include of s3c2410.h
25 * 14-Jan-2005 BJD Added clock init 25 * 14-Jan-2005 BJD Added clock init
26 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 26 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
27 * 20-Sep-2005 BJD Added static to non-exported items
27*/ 28*/
28 29
29#include <linux/kernel.h> 30#include <linux/kernel.h>
@@ -147,7 +148,7 @@ static struct s3c24xx_board h1940_board __initdata = {
147 .devices_count = ARRAY_SIZE(h1940_devices) 148 .devices_count = ARRAY_SIZE(h1940_devices)
148}; 149};
149 150
150void __init h1940_map_io(void) 151static void __init h1940_map_io(void)
151{ 152{
152 s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc)); 153 s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc));
153 s3c24xx_init_clocks(0); 154 s3c24xx_init_clocks(0);
@@ -155,13 +156,13 @@ void __init h1940_map_io(void)
155 s3c24xx_set_board(&h1940_board); 156 s3c24xx_set_board(&h1940_board);
156} 157}
157 158
158void __init h1940_init_irq(void) 159static void __init h1940_init_irq(void)
159{ 160{
160 s3c24xx_init_irq(); 161 s3c24xx_init_irq();
161 162
162} 163}
163 164
164void __init h1940_init(void) 165static void __init h1940_init(void)
165{ 166{
166 set_s3c2410fb_info(&h1940_lcdcfg); 167 set_s3c2410fb_info(&h1940_lcdcfg);
167} 168}
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 66bf5bb2b3db..5c0f2b091f95 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -97,7 +97,7 @@ static struct s3c24xx_board n30_board __initdata = {
97 .devices_count = ARRAY_SIZE(n30_devices) 97 .devices_count = ARRAY_SIZE(n30_devices)
98}; 98};
99 99
100void __init n30_map_io(void) 100static void __init n30_map_io(void)
101{ 101{
102 s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc)); 102 s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc));
103 s3c24xx_init_clocks(0); 103 s3c24xx_init_clocks(0);
@@ -105,14 +105,14 @@ void __init n30_map_io(void)
105 s3c24xx_set_board(&n30_board); 105 s3c24xx_set_board(&n30_board);
106} 106}
107 107
108void __init n30_init_irq(void) 108static void __init n30_init_irq(void)
109{ 109{
110 s3c24xx_init_irq(); 110 s3c24xx_init_irq();
111} 111}
112 112
113/* GPB3 is the line that controls the pull-up for the USB D+ line */ 113/* GPB3 is the line that controls the pull-up for the USB D+ line */
114 114
115void __init n30_init(void) 115static void __init n30_init(void)
116{ 116{
117 s3c_device_i2c.dev.platform_data = &n30_i2ccfg; 117 s3c_device_i2c.dev.platform_data = &n30_i2ccfg;
118 118
diff --git a/arch/arm/mach-s3c2410/mach-nexcoder.c b/arch/arm/mach-s3c2410/mach-nexcoder.c
index d24c242414ca..c22f8216032d 100644
--- a/arch/arm/mach-s3c2410/mach-nexcoder.c
+++ b/arch/arm/mach-s3c2410/mach-nexcoder.c
@@ -136,7 +136,7 @@ static void __init nexcoder_sensorboard_init(void)
136 s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP); // CAM_GPIO6 => CAM_PWRDN 136 s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP); // CAM_GPIO6 => CAM_PWRDN
137} 137}
138 138
139void __init nexcoder_map_io(void) 139static void __init nexcoder_map_io(void)
140{ 140{
141 s3c24xx_init_io(nexcoder_iodesc, ARRAY_SIZE(nexcoder_iodesc)); 141 s3c24xx_init_io(nexcoder_iodesc, ARRAY_SIZE(nexcoder_iodesc));
142 s3c24xx_init_clocks(0); 142 s3c24xx_init_clocks(0);
diff --git a/arch/arm/mach-s3c2410/mach-otom.c b/arch/arm/mach-s3c2410/mach-otom.c
index d901ed492ff5..ad1459e402e2 100644
--- a/arch/arm/mach-s3c2410/mach-otom.c
+++ b/arch/arm/mach-s3c2410/mach-otom.c
@@ -105,7 +105,7 @@ static struct s3c24xx_board otom11_board __initdata = {
105}; 105};
106 106
107 107
108void __init otom11_map_io(void) 108static void __init otom11_map_io(void)
109{ 109{
110 s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc)); 110 s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc));
111 s3c24xx_init_clocks(0); 111 s3c24xx_init_clocks(0);
diff --git a/arch/arm/mach-s3c2410/mach-rx3715.c b/arch/arm/mach-s3c2410/mach-rx3715.c
index a73d61c1de46..22d9e070fd68 100644
--- a/arch/arm/mach-s3c2410/mach-rx3715.c
+++ b/arch/arm/mach-s3c2410/mach-rx3715.c
@@ -16,6 +16,7 @@
16 * 14-Jan-2005 BJD Added new clock init 16 * 14-Jan-2005 BJD Added new clock init
17 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 17 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
18 * 14-Mar-2005 BJD Fixed __iomem warnings 18 * 14-Mar-2005 BJD Fixed __iomem warnings
19 * 20-Sep-2005 BJD Added static to non-exported items
19*/ 20*/
20 21
21#include <linux/kernel.h> 22#include <linux/kernel.h>
@@ -108,7 +109,7 @@ static struct s3c24xx_board rx3715_board __initdata = {
108 .devices_count = ARRAY_SIZE(rx3715_devices) 109 .devices_count = ARRAY_SIZE(rx3715_devices)
109}; 110};
110 111
111void __init rx3715_map_io(void) 112static void __init rx3715_map_io(void)
112{ 113{
113 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc)); 114 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
114 s3c24xx_init_clocks(16934000); 115 s3c24xx_init_clocks(16934000);
@@ -116,7 +117,7 @@ void __init rx3715_map_io(void)
116 s3c24xx_set_board(&rx3715_board); 117 s3c24xx_set_board(&rx3715_board);
117} 118}
118 119
119void __init rx3715_init_irq(void) 120static void __init rx3715_init_irq(void)
120{ 121{
121 s3c24xx_init_irq(); 122 s3c24xx_init_irq();
122} 123}
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c
index 67e903a700d3..2eda55a6b678 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2410.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2410.c
@@ -28,6 +28,7 @@
28 * Ben Dooks <ben@simtec.co.uk> 28 * Ben Dooks <ben@simtec.co.uk>
29 * 29 *
30 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 30 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
31 * 20-Sep-2005 BJD Added static to non-exported items
31 * 32 *
32 ***********************************************************************/ 33 ***********************************************************************/
33 34
@@ -97,7 +98,7 @@ static struct s3c24xx_board smdk2410_board __initdata = {
97 .devices_count = ARRAY_SIZE(smdk2410_devices) 98 .devices_count = ARRAY_SIZE(smdk2410_devices)
98}; 99};
99 100
100void __init smdk2410_map_io(void) 101static void __init smdk2410_map_io(void)
101{ 102{
102 s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc)); 103 s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));
103 s3c24xx_init_clocks(0); 104 s3c24xx_init_clocks(0);
@@ -105,7 +106,7 @@ void __init smdk2410_map_io(void)
105 s3c24xx_set_board(&smdk2410_board); 106 s3c24xx_set_board(&smdk2410_board);
106} 107}
107 108
108void __init smdk2410_init_irq(void) 109static void __init smdk2410_init_irq(void)
109{ 110{
110 s3c24xx_init_irq(); 111 s3c24xx_init_irq();
111} 112}
diff --git a/arch/arm/mach-s3c2410/mach-smdk2440.c b/arch/arm/mach-s3c2410/mach-smdk2440.c
index 357522106f68..722ef46b630a 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2440.c
@@ -18,6 +18,7 @@
18 * 22-Feb-2005 BJD Updated for 2.6.11-rc5 relesa 18 * 22-Feb-2005 BJD Updated for 2.6.11-rc5 relesa
19 * 10-Mar-2005 LCVR Replaced S3C2410_VA by S3C24XX_VA 19 * 10-Mar-2005 LCVR Replaced S3C2410_VA by S3C24XX_VA
20 * 14-Mar-2005 BJD void __iomem fixes 20 * 14-Mar-2005 BJD void __iomem fixes
21 * 20-Sep-2005 BJD Added static to non-exported items
21*/ 22*/
22 23
23#include <linux/kernel.h> 24#include <linux/kernel.h>
@@ -98,7 +99,7 @@ static struct s3c24xx_board smdk2440_board __initdata = {
98 .devices_count = ARRAY_SIZE(smdk2440_devices) 99 .devices_count = ARRAY_SIZE(smdk2440_devices)
99}; 100};
100 101
101void __init smdk2440_map_io(void) 102static void __init smdk2440_map_io(void)
102{ 103{
103 s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc)); 104 s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
104 s3c24xx_init_clocks(16934400); 105 s3c24xx_init_clocks(16934400);
@@ -106,7 +107,7 @@ void __init smdk2440_map_io(void)
106 s3c24xx_set_board(&smdk2440_board); 107 s3c24xx_set_board(&smdk2440_board);
107} 108}
108 109
109void __init smdk2440_machine_init(void) 110static void __init smdk2440_machine_init(void)
110{ 111{
111 /* Configure the LEDs (even if we have no LED support)*/ 112 /* Configure the LEDs (even if we have no LED support)*/
112 113
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 8f9ab2893df4..663a7f98fc0b 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -28,6 +28,7 @@
28 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 28 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
29 * 14-Mar-2006 BJD void __iomem fixes 29 * 14-Mar-2006 BJD void __iomem fixes
30 * 22-Jun-2006 BJD Added DM9000 platform information 30 * 22-Jun-2006 BJD Added DM9000 platform information
31 * 20-Sep-2005 BJD Added static to non-exported items
31*/ 32*/
32 33
33#include <linux/kernel.h> 34#include <linux/kernel.h>
@@ -347,7 +348,7 @@ static void vr1000_power_off(void)
347 s3c2410_gpio_setpin(S3C2410_GPB9, 1); 348 s3c2410_gpio_setpin(S3C2410_GPB9, 1);
348} 349}
349 350
350void __init vr1000_map_io(void) 351static void __init vr1000_map_io(void)
351{ 352{
352 /* initialise clock sources */ 353 /* initialise clock sources */
353 354
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index 279e3afa3c39..f085d68e568e 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -39,3 +39,6 @@ extern void sa11x0_set_ssp_data(struct sa11x0_ssp_plat_ops *ops);
39 39
40struct irda_platform_data; 40struct irda_platform_data;
41void sa11x0_set_irda_data(struct irda_platform_data *irda); 41void sa11x0_set_irda_data(struct irda_platform_data *irda);
42
43struct mcp_plat_data;
44void sa11x0_set_mcp_data(struct mcp_plat_data *data);
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 0b6c4db44e08..4a884baf3b9c 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -233,7 +233,17 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
233 if (in_interrupt() || !mm) 233 if (in_interrupt() || !mm)
234 goto no_context; 234 goto no_context;
235 235
236 down_read(&mm->mmap_sem); 236 /*
237 * As per x86, we may deadlock here. However, since the kernel only
238 * validly references user space from well defined areas of the code,
239 * we can bug out early if this is from code which shouldn't.
240 */
241 if (!down_read_trylock(&mm->mmap_sem)) {
242 if (!user_mode(regs) && !search_exception_tables(regs->ARM_pc))
243 goto no_context;
244 down_read(&mm->mmap_sem);
245 }
246
237 fault = __do_page_fault(mm, addr, fsr, tsk); 247 fault = __do_page_fault(mm, addr, fsr, tsk);
238 up_read(&mm->mmap_sem); 248 up_read(&mm->mmap_sem);
239 249
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S
index 1d739d282a45..82ec954e45b6 100644
--- a/arch/arm/mm/proc-arm1020.S
+++ b/arch/arm/mm/proc-arm1020.S
@@ -509,7 +509,7 @@ cpu_arm1020_name:
509 509
510 .align 510 .align
511 511
512 .section ".proc.info", #alloc, #execinstr 512 .section ".proc.info.init", #alloc, #execinstr
513 513
514 .type __arm1020_proc_info,#object 514 .type __arm1020_proc_info,#object
515__arm1020_proc_info: 515__arm1020_proc_info:
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S
index 9b725665b5c7..7375fe930f72 100644
--- a/arch/arm/mm/proc-arm1020e.S
+++ b/arch/arm/mm/proc-arm1020e.S
@@ -491,7 +491,7 @@ cpu_arm1020e_name:
491 491
492 .align 492 .align
493 493
494 .section ".proc.info", #alloc, #execinstr 494 .section ".proc.info.init", #alloc, #execinstr
495 495
496 .type __arm1020e_proc_info,#object 496 .type __arm1020e_proc_info,#object
497__arm1020e_proc_info: 497__arm1020e_proc_info:
diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S
index 37b70fa21c76..6ca639094d6f 100644
--- a/arch/arm/mm/proc-arm1022.S
+++ b/arch/arm/mm/proc-arm1022.S
@@ -473,7 +473,7 @@ cpu_arm1022_name:
473 473
474 .align 474 .align
475 475
476 .section ".proc.info", #alloc, #execinstr 476 .section ".proc.info.init", #alloc, #execinstr
477 477
478 .type __arm1022_proc_info,#object 478 .type __arm1022_proc_info,#object
479__arm1022_proc_info: 479__arm1022_proc_info:
diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S
index 931b690d1be2..10317e4f55d2 100644
--- a/arch/arm/mm/proc-arm1026.S
+++ b/arch/arm/mm/proc-arm1026.S
@@ -469,7 +469,7 @@ cpu_arm1026_name:
469 469
470 .align 470 .align
471 471
472 .section ".proc.info", #alloc, #execinstr 472 .section ".proc.info.init", #alloc, #execinstr
473 473
474 .type __arm1026_proc_info,#object 474 .type __arm1026_proc_info,#object
475__arm1026_proc_info: 475__arm1026_proc_info:
diff --git a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S
index d0f1bbb48f6c..8e7e1e70ab05 100644
--- a/arch/arm/mm/proc-arm6_7.S
+++ b/arch/arm/mm/proc-arm6_7.S
@@ -332,7 +332,7 @@ cpu_arm710_name:
332 332
333 .align 333 .align
334 334
335 .section ".proc.info", #alloc, #execinstr 335 .section ".proc.info.init", #alloc, #execinstr
336 336
337 .type __arm6_proc_info, #object 337 .type __arm6_proc_info, #object
338__arm6_proc_info: 338__arm6_proc_info:
diff --git a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S
index c69c9de32391..a13e0184d343 100644
--- a/arch/arm/mm/proc-arm720.S
+++ b/arch/arm/mm/proc-arm720.S
@@ -222,7 +222,7 @@ cpu_arm720_name:
222 * See linux/include/asm-arm/procinfo.h for a definition of this structure. 222 * See linux/include/asm-arm/procinfo.h for a definition of this structure.
223 */ 223 */
224 224
225 .section ".proc.info", #alloc, #execinstr 225 .section ".proc.info.init", #alloc, #execinstr
226 226
227 .type __arm710_proc_info, #object 227 .type __arm710_proc_info, #object
228__arm710_proc_info: 228__arm710_proc_info:
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
index 0f490a0fcb71..d16513899999 100644
--- a/arch/arm/mm/proc-arm920.S
+++ b/arch/arm/mm/proc-arm920.S
@@ -452,7 +452,7 @@ cpu_arm920_name:
452 452
453 .align 453 .align
454 454
455 .section ".proc.info", #alloc, #execinstr 455 .section ".proc.info.init", #alloc, #execinstr
456 456
457 .type __arm920_proc_info,#object 457 .type __arm920_proc_info,#object
458__arm920_proc_info: 458__arm920_proc_info:
diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S
index 62bc34a139ee..23b8ed97f4e3 100644
--- a/arch/arm/mm/proc-arm922.S
+++ b/arch/arm/mm/proc-arm922.S
@@ -456,7 +456,7 @@ cpu_arm922_name:
456 456
457 .align 457 .align
458 458
459 .section ".proc.info", #alloc, #execinstr 459 .section ".proc.info.init", #alloc, #execinstr
460 460
461 .type __arm922_proc_info,#object 461 .type __arm922_proc_info,#object
462__arm922_proc_info: 462__arm922_proc_info:
diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S
index ee49aa2ca781..ee95c52db513 100644
--- a/arch/arm/mm/proc-arm925.S
+++ b/arch/arm/mm/proc-arm925.S
@@ -521,7 +521,7 @@ cpu_arm925_name:
521 521
522 .align 522 .align
523 523
524 .section ".proc.info", #alloc, #execinstr 524 .section ".proc.info.init", #alloc, #execinstr
525 525
526 .type __arm925_proc_info,#object 526 .type __arm925_proc_info,#object
527__arm925_proc_info: 527__arm925_proc_info:
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
index bb95cc9fed03..7d042dc20c47 100644
--- a/arch/arm/mm/proc-arm926.S
+++ b/arch/arm/mm/proc-arm926.S
@@ -471,7 +471,7 @@ cpu_arm926_name:
471 471
472 .align 472 .align
473 473
474 .section ".proc.info", #alloc, #execinstr 474 .section ".proc.info.init", #alloc, #execinstr
475 475
476 .type __arm926_proc_info,#object 476 .type __arm926_proc_info,#object
477__arm926_proc_info: 477__arm926_proc_info:
diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S
index 34f7e7d3f419..bd330c4075a1 100644
--- a/arch/arm/mm/proc-sa110.S
+++ b/arch/arm/mm/proc-sa110.S
@@ -249,7 +249,7 @@ cpu_sa110_name:
249 249
250 .align 250 .align
251 251
252 .section ".proc.info", #alloc, #execinstr 252 .section ".proc.info.init", #alloc, #execinstr
253 253
254 .type __sa110_proc_info,#object 254 .type __sa110_proc_info,#object
255__sa110_proc_info: 255__sa110_proc_info:
diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S
index ca14f80d5ab4..91b89124c0d7 100644
--- a/arch/arm/mm/proc-sa1100.S
+++ b/arch/arm/mm/proc-sa1100.S
@@ -280,7 +280,7 @@ cpu_sa1110_name:
280 280
281 .align 281 .align
282 282
283 .section ".proc.info", #alloc, #execinstr 283 .section ".proc.info.init", #alloc, #execinstr
284 284
285 .type __sa1100_proc_info,#object 285 .type __sa1100_proc_info,#object
286__sa1100_proc_info: 286__sa1100_proc_info:
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index eb34823c9dbf..caf3b19b167f 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -240,7 +240,7 @@ cpu_elf_name:
240 .size cpu_elf_name, . - cpu_elf_name 240 .size cpu_elf_name, . - cpu_elf_name
241 .align 241 .align
242 242
243 .section ".proc.info", #alloc, #execinstr 243 .section ".proc.info.init", #alloc, #execinstr
244 244
245 /* 245 /*
246 * Match any ARMv6 processor core. 246 * Match any ARMv6 processor core.
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index b88de2700146..861b35947280 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -578,7 +578,7 @@ cpu_pxa270_name:
578 578
579 .align 579 .align
580 580
581 .section ".proc.info", #alloc, #execinstr 581 .section ".proc.info.init", #alloc, #execinstr
582 582
583 .type __80200_proc_info,#object 583 .type __80200_proc_info,#object
584__80200_proc_info: 584__80200_proc_info:
diff --git a/arch/ia64/hp/sim/simscsi.c b/arch/ia64/hp/sim/simscsi.c
index 56405dbfd739..a18983a3c934 100644
--- a/arch/ia64/hp/sim/simscsi.c
+++ b/arch/ia64/hp/sim/simscsi.c
@@ -233,6 +233,23 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode)
233 simscsi_readwrite(sc, mode, offset, ((sc->cmnd[7] << 8) | sc->cmnd[8])*512); 233 simscsi_readwrite(sc, mode, offset, ((sc->cmnd[7] << 8) | sc->cmnd[8])*512);
234} 234}
235 235
236static void simscsi_fillresult(struct scsi_cmnd *sc, char *buf, unsigned len)
237{
238
239 int scatterlen = sc->use_sg;
240 struct scatterlist *slp;
241
242 if (scatterlen == 0)
243 memcpy(sc->request_buffer, buf, len);
244 else for (slp = (struct scatterlist *)sc->buffer; scatterlen-- > 0 && len > 0; slp++) {
245 unsigned thislen = min(len, slp->length);
246
247 memcpy(page_address(slp->page) + slp->offset, buf, thislen);
248 slp++;
249 len -= thislen;
250 }
251}
252
236static int 253static int
237simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 254simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
238{ 255{
@@ -240,6 +257,7 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
240 char fname[MAX_ROOT_LEN+16]; 257 char fname[MAX_ROOT_LEN+16];
241 size_t disk_size; 258 size_t disk_size;
242 char *buf; 259 char *buf;
260 char localbuf[36];
243#if DEBUG_SIMSCSI 261#if DEBUG_SIMSCSI
244 register long sp asm ("sp"); 262 register long sp asm ("sp");
245 263
@@ -263,7 +281,7 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
263 /* disk doesn't exist... */ 281 /* disk doesn't exist... */
264 break; 282 break;
265 } 283 }
266 buf = sc->request_buffer; 284 buf = localbuf;
267 buf[0] = 0; /* magnetic disk */ 285 buf[0] = 0; /* magnetic disk */
268 buf[1] = 0; /* not a removable medium */ 286 buf[1] = 0; /* not a removable medium */
269 buf[2] = 2; /* SCSI-2 compliant device */ 287 buf[2] = 2; /* SCSI-2 compliant device */
@@ -273,6 +291,7 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
273 buf[6] = 0; /* reserved */ 291 buf[6] = 0; /* reserved */
274 buf[7] = 0; /* various flags */ 292 buf[7] = 0; /* various flags */
275 memcpy(buf + 8, "HP SIMULATED DISK 0.00", 28); 293 memcpy(buf + 8, "HP SIMULATED DISK 0.00", 28);
294 simscsi_fillresult(sc, buf, 36);
276 sc->result = GOOD; 295 sc->result = GOOD;
277 break; 296 break;
278 297
@@ -304,16 +323,13 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
304 simscsi_readwrite10(sc, SSC_WRITE); 323 simscsi_readwrite10(sc, SSC_WRITE);
305 break; 324 break;
306 325
307
308 case READ_CAPACITY: 326 case READ_CAPACITY:
309 if (desc[target_id] < 0 || sc->request_bufflen < 8) { 327 if (desc[target_id] < 0 || sc->request_bufflen < 8) {
310 break; 328 break;
311 } 329 }
312 buf = sc->request_buffer; 330 buf = localbuf;
313
314 disk_size = simscsi_get_disk_size(desc[target_id]); 331 disk_size = simscsi_get_disk_size(desc[target_id]);
315 332
316 /* pretend to be a 1GB disk (partition table contains real stuff): */
317 buf[0] = (disk_size >> 24) & 0xff; 333 buf[0] = (disk_size >> 24) & 0xff;
318 buf[1] = (disk_size >> 16) & 0xff; 334 buf[1] = (disk_size >> 16) & 0xff;
319 buf[2] = (disk_size >> 8) & 0xff; 335 buf[2] = (disk_size >> 8) & 0xff;
@@ -323,13 +339,14 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
323 buf[5] = 0; 339 buf[5] = 0;
324 buf[6] = 2; 340 buf[6] = 2;
325 buf[7] = 0; 341 buf[7] = 0;
342 simscsi_fillresult(sc, buf, 8);
326 sc->result = GOOD; 343 sc->result = GOOD;
327 break; 344 break;
328 345
329 case MODE_SENSE: 346 case MODE_SENSE:
330 case MODE_SENSE_10: 347 case MODE_SENSE_10:
331 /* sd.c uses this to determine whether disk does write-caching. */ 348 /* sd.c uses this to determine whether disk does write-caching. */
332 memset(sc->request_buffer, 0, 128); 349 simscsi_fillresult(sc, (char *)empty_zero_page, sc->request_bufflen);
333 sc->result = GOOD; 350 sc->result = GOOD;
334 break; 351 break;
335 352
diff --git a/arch/ia64/kernel/mca_asm.S b/arch/ia64/kernel/mca_asm.S
index 499a065f4e60..db32fc1d3935 100644
--- a/arch/ia64/kernel/mca_asm.S
+++ b/arch/ia64/kernel/mca_asm.S
@@ -489,24 +489,27 @@ ia64_state_save:
489 ;; 489 ;;
490 st8 [temp1]=r17,16 // pal_min_state 490 st8 [temp1]=r17,16 // pal_min_state
491 st8 [temp2]=r6,16 // prev_IA64_KR_CURRENT 491 st8 [temp2]=r6,16 // prev_IA64_KR_CURRENT
492 mov r6=IA64_KR(CURRENT_STACK)
493 ;;
494 st8 [temp1]=r6,16 // prev_IA64_KR_CURRENT_STACK
495 st8 [temp2]=r0,16 // prev_task, starts off as NULL
492 mov r6=cr.ifa 496 mov r6=cr.ifa
493 ;; 497 ;;
494 st8 [temp1]=r0,16 // prev_task, starts off as NULL 498 st8 [temp1]=r12,16 // cr.isr
495 st8 [temp2]=r12,16 // cr.isr 499 st8 [temp2]=r6,16 // cr.ifa
496 mov r12=cr.itir 500 mov r12=cr.itir
497 ;; 501 ;;
498 st8 [temp1]=r6,16 // cr.ifa 502 st8 [temp1]=r12,16 // cr.itir
499 st8 [temp2]=r12,16 // cr.itir 503 st8 [temp2]=r11,16 // cr.iipa
500 mov r12=cr.iim 504 mov r12=cr.iim
501 ;; 505 ;;
502 st8 [temp1]=r11,16 // cr.iipa 506 st8 [temp1]=r12,16 // cr.iim
503 st8 [temp2]=r12,16 // cr.iim
504 mov r6=cr.iha
505(p1) mov r12=IA64_MCA_COLD_BOOT 507(p1) mov r12=IA64_MCA_COLD_BOOT
506(p2) mov r12=IA64_INIT_WARM_BOOT 508(p2) mov r12=IA64_INIT_WARM_BOOT
509 mov r6=cr.iha
507 ;; 510 ;;
508 st8 [temp1]=r6,16 // cr.iha 511 st8 [temp2]=r6,16 // cr.iha
509 st8 [temp2]=r12 // os_status, default is cold boot 512 st8 [temp1]=r12 // os_status, default is cold boot
510 mov r6=IA64_MCA_SAME_CONTEXT 513 mov r6=IA64_MCA_SAME_CONTEXT
511 ;; 514 ;;
512 st8 [temp1]=r6 // context, default is same context 515 st8 [temp1]=r6 // context, default is same context
@@ -823,9 +826,12 @@ ia64_state_restore:
823 ld8 r12=[temp1],16 // sal_ra 826 ld8 r12=[temp1],16 // sal_ra
824 ld8 r9=[temp2],16 // sal_gp 827 ld8 r9=[temp2],16 // sal_gp
825 ;; 828 ;;
826 ld8 r22=[temp1],24 // pal_min_state, virtual. skip prev_task 829 ld8 r22=[temp1],16 // pal_min_state, virtual
827 ld8 r21=[temp2],16 // prev_IA64_KR_CURRENT 830 ld8 r21=[temp2],16 // prev_IA64_KR_CURRENT
828 ;; 831 ;;
832 ld8 r16=[temp1],16 // prev_IA64_KR_CURRENT_STACK
833 ld8 r20=[temp2],16 // prev_task
834 ;;
829 ld8 temp3=[temp1],16 // cr.isr 835 ld8 temp3=[temp1],16 // cr.isr
830 ld8 temp4=[temp2],16 // cr.ifa 836 ld8 temp4=[temp2],16 // cr.ifa
831 ;; 837 ;;
@@ -846,6 +852,45 @@ ia64_state_restore:
846 ld8 r8=[temp1] // os_status 852 ld8 r8=[temp1] // os_status
847 ld8 r10=[temp2] // context 853 ld8 r10=[temp2] // context
848 854
855 /* Wire IA64_TR_CURRENT_STACK to the stack that we are resuming to. To
856 * avoid any dependencies on the algorithm in ia64_switch_to(), just
857 * purge any existing CURRENT_STACK mapping and insert the new one.
858 *
859 * r16 contains prev_IA64_KR_CURRENT_STACK, r21 contains
860 * prev_IA64_KR_CURRENT, these values may have been changed by the C
861 * code. Do not use r8, r9, r10, r22, they contain values ready for
862 * the return to SAL.
863 */
864
865 mov r15=IA64_KR(CURRENT_STACK) // physical granule mapped by IA64_TR_CURRENT_STACK
866 ;;
867 shl r15=r15,IA64_GRANULE_SHIFT
868 ;;
869 dep r15=-1,r15,61,3 // virtual granule
870 mov r18=IA64_GRANULE_SHIFT<<2 // for cr.itir.ps
871 ;;
872 ptr.d r15,r18
873 ;;
874 srlz.d
875
876 extr.u r19=r21,61,3 // r21 = prev_IA64_KR_CURRENT
877 shl r20=r16,IA64_GRANULE_SHIFT // r16 = prev_IA64_KR_CURRENT_STACK
878 movl r21=PAGE_KERNEL // page properties
879 ;;
880 mov IA64_KR(CURRENT_STACK)=r16
881 cmp.ne p6,p0=RGN_KERNEL,r19 // new stack is in the kernel region?
882 or r21=r20,r21 // construct PA | page properties
883(p6) br.spnt 1f // the dreaded cpu 0 idle task in region 5:(
884 ;;
885 mov cr.itir=r18
886 mov cr.ifa=r21
887 mov r20=IA64_TR_CURRENT_STACK
888 ;;
889 itr.d dtr[r20]=r21
890 ;;
891 srlz.d
8921:
893
849 br.sptk b0 894 br.sptk b0
850 895
851//EndStub////////////////////////////////////////////////////////////////////// 896//EndStub//////////////////////////////////////////////////////////////////////
@@ -982,6 +1027,7 @@ ia64_set_kernel_registers:
982 add temp4=temp4, temp1 // &struct ia64_sal_os_state.os_gp 1027 add temp4=temp4, temp1 // &struct ia64_sal_os_state.os_gp
983 add r12=temp1, temp3 // kernel stack pointer on MCA/INIT stack 1028 add r12=temp1, temp3 // kernel stack pointer on MCA/INIT stack
984 add r13=temp1, r3 // set current to start of MCA/INIT stack 1029 add r13=temp1, r3 // set current to start of MCA/INIT stack
1030 add r20=temp1, r3 // physical start of MCA/INIT stack
985 ;; 1031 ;;
986 ld8 r1=[temp4] // OS GP from SAL OS state 1032 ld8 r1=[temp4] // OS GP from SAL OS state
987 ;; 1033 ;;
@@ -991,7 +1037,35 @@ ia64_set_kernel_registers:
991 ;; 1037 ;;
992 mov IA64_KR(CURRENT)=r13 1038 mov IA64_KR(CURRENT)=r13
993 1039
994 // FIXME: do I need to wire IA64_KR_CURRENT_STACK and IA64_TR_CURRENT_STACK? 1040 /* Wire IA64_TR_CURRENT_STACK to the MCA/INIT handler stack. To avoid
1041 * any dependencies on the algorithm in ia64_switch_to(), just purge
1042 * any existing CURRENT_STACK mapping and insert the new one.
1043 */
1044
1045 mov r16=IA64_KR(CURRENT_STACK) // physical granule mapped by IA64_TR_CURRENT_STACK
1046 ;;
1047 shl r16=r16,IA64_GRANULE_SHIFT
1048 ;;
1049 dep r16=-1,r16,61,3 // virtual granule
1050 mov r18=IA64_GRANULE_SHIFT<<2 // for cr.itir.ps
1051 ;;
1052 ptr.d r16,r18
1053 ;;
1054 srlz.d
1055
1056 shr.u r16=r20,IA64_GRANULE_SHIFT // r20 = physical start of MCA/INIT stack
1057 movl r21=PAGE_KERNEL // page properties
1058 ;;
1059 mov IA64_KR(CURRENT_STACK)=r16
1060 or r21=r20,r21 // construct PA | page properties
1061 ;;
1062 mov cr.itir=r18
1063 mov cr.ifa=r13
1064 mov r20=IA64_TR_CURRENT_STACK
1065 ;;
1066 itr.d dtr[r20]=r21
1067 ;;
1068 srlz.d
995 1069
996 br.sptk b0 1070 br.sptk b0
997 1071
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index 80f83d6cdbfc..f081c60ab206 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -56,8 +56,9 @@ static struct page *page_isolate[MAX_PAGE_ISOLATE];
56static int num_page_isolate = 0; 56static int num_page_isolate = 0;
57 57
58typedef enum { 58typedef enum {
59 ISOLATE_NG = 0, 59 ISOLATE_NG,
60 ISOLATE_OK = 1 60 ISOLATE_OK,
61 ISOLATE_NONE
61} isolate_status_t; 62} isolate_status_t;
62 63
63/* 64/*
@@ -74,7 +75,7 @@ static struct {
74 * @paddr: poisoned memory location 75 * @paddr: poisoned memory location
75 * 76 *
76 * Return value: 77 * Return value:
77 * ISOLATE_OK / ISOLATE_NG 78 * one of isolate_status_t, ISOLATE_OK/NG/NONE.
78 */ 79 */
79 80
80static isolate_status_t 81static isolate_status_t
@@ -85,7 +86,10 @@ mca_page_isolate(unsigned long paddr)
85 86
86 /* whether physical address is valid or not */ 87 /* whether physical address is valid or not */
87 if (!ia64_phys_addr_valid(paddr)) 88 if (!ia64_phys_addr_valid(paddr))
88 return ISOLATE_NG; 89 return ISOLATE_NONE;
90
91 if (!pfn_valid(paddr))
92 return ISOLATE_NONE;
89 93
90 /* convert physical address to physical page number */ 94 /* convert physical address to physical page number */
91 p = pfn_to_page(paddr>>PAGE_SHIFT); 95 p = pfn_to_page(paddr>>PAGE_SHIFT);
@@ -122,10 +126,15 @@ mca_handler_bh(unsigned long paddr)
122 current->pid, current->comm); 126 current->pid, current->comm);
123 127
124 spin_lock(&mca_bh_lock); 128 spin_lock(&mca_bh_lock);
125 if (mca_page_isolate(paddr) == ISOLATE_OK) { 129 switch (mca_page_isolate(paddr)) {
130 case ISOLATE_OK:
126 printk(KERN_DEBUG "Page isolation: ( %lx ) success.\n", paddr); 131 printk(KERN_DEBUG "Page isolation: ( %lx ) success.\n", paddr);
127 } else { 132 break;
133 case ISOLATE_NG:
128 printk(KERN_DEBUG "Page isolation: ( %lx ) failure.\n", paddr); 134 printk(KERN_DEBUG "Page isolation: ( %lx ) failure.\n", paddr);
135 break;
136 default:
137 break;
129 } 138 }
130 spin_unlock(&mca_bh_lock); 139 spin_unlock(&mca_bh_lock);
131 140
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
index abf10dcb787b..ce166e3de53b 100644
--- a/arch/ppc/kernel/Makefile
+++ b/arch/ppc/kernel/Makefile
@@ -15,9 +15,8 @@ extra-y += vmlinux.lds
15obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ 15obj-y := entry.o traps.o irq.o idle.o time.o misc.o \
16 process.o signal.o ptrace.o align.o \ 16 process.o signal.o ptrace.o align.o \
17 semaphore.o syscalls.o setup.o \ 17 semaphore.o syscalls.o setup.o \
18 cputable.o ppc_htab.o 18 cputable.o ppc_htab.o perfmon.o
19obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o 19obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o
20obj-$(CONFIG_E500) += perfmon.o
21obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o 20obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o
22obj-$(CONFIG_POWER4) += cpu_setup_power4.o 21obj-$(CONFIG_POWER4) += cpu_setup_power4.o
23obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o 22obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o
diff --git a/arch/ppc/kernel/perfmon.c b/arch/ppc/kernel/perfmon.c
index 91e2786ea097..f9b27d939f76 100644
--- a/arch/ppc/kernel/perfmon.c
+++ b/arch/ppc/kernel/perfmon.c
@@ -45,7 +45,7 @@ static void dummy_perf(struct pt_regs *regs)
45 mtpmr(PMRN_PMGC0, pmgc0); 45 mtpmr(PMRN_PMGC0, pmgc0);
46} 46}
47 47
48#else 48#elif CONFIG_6xx
49/* Ensure exceptions are disabled */ 49/* Ensure exceptions are disabled */
50 50
51static void dummy_perf(struct pt_regs *regs) 51static void dummy_perf(struct pt_regs *regs)
@@ -55,6 +55,10 @@ static void dummy_perf(struct pt_regs *regs)
55 mmcr0 &= ~MMCR0_PMXE; 55 mmcr0 &= ~MMCR0_PMXE;
56 mtspr(SPRN_MMCR0, mmcr0); 56 mtspr(SPRN_MMCR0, mmcr0);
57} 57}
58#else
59static void dummy_perf(struct pt_regs *regs)
60{
61}
58#endif 62#endif
59 63
60void (*perf_irq)(struct pt_regs *) = dummy_perf; 64void (*perf_irq)(struct pt_regs *) = dummy_perf;
diff --git a/arch/ppc/platforms/pmac_setup.c b/arch/ppc/platforms/pmac_setup.c
index 12cbc85555d9..1ad779ecc8fc 100644
--- a/arch/ppc/platforms/pmac_setup.c
+++ b/arch/ppc/platforms/pmac_setup.c
@@ -719,7 +719,8 @@ pmac_declare_of_platform_devices(void)
719 if (np) { 719 if (np) {
720 for (np = np->child; np != NULL; np = np->sibling) 720 for (np = np->child; np != NULL; np = np->sibling)
721 if (strncmp(np->name, "i2c", 3) == 0) { 721 if (strncmp(np->name, "i2c", 3) == 0) {
722 of_platform_device_create(np, "uni-n-i2c"); 722 of_platform_device_create(np, "uni-n-i2c",
723 NULL);
723 break; 724 break;
724 } 725 }
725 } 726 }
@@ -727,17 +728,18 @@ pmac_declare_of_platform_devices(void)
727 if (np) { 728 if (np) {
728 for (np = np->child; np != NULL; np = np->sibling) 729 for (np = np->child; np != NULL; np = np->sibling)
729 if (strncmp(np->name, "i2c", 3) == 0) { 730 if (strncmp(np->name, "i2c", 3) == 0) {
730 of_platform_device_create(np, "u3-i2c"); 731 of_platform_device_create(np, "u3-i2c",
732 NULL);
731 break; 733 break;
732 } 734 }
733 } 735 }
734 736
735 np = find_devices("valkyrie"); 737 np = find_devices("valkyrie");
736 if (np) 738 if (np)
737 of_platform_device_create(np, "valkyrie"); 739 of_platform_device_create(np, "valkyrie", NULL);
738 np = find_devices("platinum"); 740 np = find_devices("platinum");
739 if (np) 741 if (np)
740 of_platform_device_create(np, "platinum"); 742 of_platform_device_create(np, "platinum", NULL);
741 743
742 return 0; 744 return 0;
743} 745}
diff --git a/arch/ppc/syslib/of_device.c b/arch/ppc/syslib/of_device.c
index da8a0f2128dc..93c7231ea709 100644
--- a/arch/ppc/syslib/of_device.c
+++ b/arch/ppc/syslib/of_device.c
@@ -234,7 +234,9 @@ void of_device_unregister(struct of_device *ofdev)
234 device_unregister(&ofdev->dev); 234 device_unregister(&ofdev->dev);
235} 235}
236 236
237struct of_device* of_platform_device_create(struct device_node *np, const char *bus_id) 237struct of_device* of_platform_device_create(struct device_node *np,
238 const char *bus_id,
239 struct device *parent)
238{ 240{
239 struct of_device *dev; 241 struct of_device *dev;
240 u32 *reg; 242 u32 *reg;
@@ -247,7 +249,7 @@ struct of_device* of_platform_device_create(struct device_node *np, const char *
247 dev->node = of_node_get(np); 249 dev->node = of_node_get(np);
248 dev->dma_mask = 0xffffffffUL; 250 dev->dma_mask = 0xffffffffUL;
249 dev->dev.dma_mask = &dev->dma_mask; 251 dev->dev.dma_mask = &dev->dma_mask;
250 dev->dev.parent = NULL; 252 dev->dev.parent = parent;
251 dev->dev.bus = &of_platform_bus_type; 253 dev->dev.bus = &of_platform_bus_type;
252 dev->dev.release = of_release_dev; 254 dev->dev.release = of_release_dev;
253 255
diff --git a/arch/ppc/syslib/ppc85xx_setup.c b/arch/ppc/syslib/ppc85xx_setup.c
index b7242f1bd931..832b8bf99ae7 100644
--- a/arch/ppc/syslib/ppc85xx_setup.c
+++ b/arch/ppc/syslib/ppc85xx_setup.c
@@ -184,8 +184,8 @@ mpc85xx_setup_pci1(struct pci_controller *hose)
184 pci->powar1 = 0x80044000 | 184 pci->powar1 = 0x80044000 |
185 (__ilog2(MPC85XX_PCI1_UPPER_MEM - MPC85XX_PCI1_LOWER_MEM + 1) - 1); 185 (__ilog2(MPC85XX_PCI1_UPPER_MEM - MPC85XX_PCI1_LOWER_MEM + 1) - 1);
186 186
187 /* Setup outboud IO windows @ MPC85XX_PCI1_IO_BASE */ 187 /* Setup outbound IO windows @ MPC85XX_PCI1_IO_BASE */
188 pci->potar2 = 0x00000000; 188 pci->potar2 = (MPC85XX_PCI1_LOWER_IO >> 12) & 0x000fffff;
189 pci->potear2 = 0x00000000; 189 pci->potear2 = 0x00000000;
190 pci->powbar2 = (MPC85XX_PCI1_IO_BASE >> 12) & 0x000fffff; 190 pci->powbar2 = (MPC85XX_PCI1_IO_BASE >> 12) & 0x000fffff;
191 /* Enable, IO R/W */ 191 /* Enable, IO R/W */
@@ -235,8 +235,8 @@ mpc85xx_setup_pci2(struct pci_controller *hose)
235 pci->powar1 = 0x80044000 | 235 pci->powar1 = 0x80044000 |
236 (__ilog2(MPC85XX_PCI2_UPPER_MEM - MPC85XX_PCI2_LOWER_MEM + 1) - 1); 236 (__ilog2(MPC85XX_PCI2_UPPER_MEM - MPC85XX_PCI2_LOWER_MEM + 1) - 1);
237 237
238 /* Setup outboud IO windows @ MPC85XX_PCI2_IO_BASE */ 238 /* Setup outbound IO windows @ MPC85XX_PCI2_IO_BASE */
239 pci->potar2 = 0x00000000; 239 pci->potar2 = (MPC85XX_PCI2_LOWER_IO >> 12) & 0x000fffff;;
240 pci->potear2 = 0x00000000; 240 pci->potear2 = 0x00000000;
241 pci->powbar2 = (MPC85XX_PCI2_IO_BASE >> 12) & 0x000fffff; 241 pci->powbar2 = (MPC85XX_PCI2_IO_BASE >> 12) & 0x000fffff;
242 /* Enable, IO R/W */ 242 /* Enable, IO R/W */
diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile
index a8877881bb48..40675b3f924d 100644
--- a/arch/ppc64/Makefile
+++ b/arch/ppc64/Makefile
@@ -107,7 +107,7 @@ install: vmlinux
107 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ 107 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
108 108
109defaultimage-$(CONFIG_PPC_PSERIES) := zImage 109defaultimage-$(CONFIG_PPC_PSERIES) := zImage
110defaultimage-$(CONFIG_PPC_PMAC) := vmlinux 110defaultimage-$(CONFIG_PPC_PMAC) := zImage.vmode
111defaultimage-$(CONFIG_PPC_MAPLE) := zImage 111defaultimage-$(CONFIG_PPC_MAPLE) := zImage
112defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux 112defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
113KBUILD_IMAGE := $(defaultimage-y) 113KBUILD_IMAGE := $(defaultimage-y)
diff --git a/arch/ppc64/kernel/of_device.c b/arch/ppc64/kernel/of_device.c
index da580812ddfe..9f200f0f2ad5 100644
--- a/arch/ppc64/kernel/of_device.c
+++ b/arch/ppc64/kernel/of_device.c
@@ -233,7 +233,9 @@ void of_device_unregister(struct of_device *ofdev)
233 device_unregister(&ofdev->dev); 233 device_unregister(&ofdev->dev);
234} 234}
235 235
236struct of_device* of_platform_device_create(struct device_node *np, const char *bus_id) 236struct of_device* of_platform_device_create(struct device_node *np,
237 const char *bus_id,
238 struct device *parent)
237{ 239{
238 struct of_device *dev; 240 struct of_device *dev;
239 241
@@ -245,7 +247,7 @@ struct of_device* of_platform_device_create(struct device_node *np, const char *
245 dev->node = np; 247 dev->node = np;
246 dev->dma_mask = 0xffffffffUL; 248 dev->dma_mask = 0xffffffffUL;
247 dev->dev.dma_mask = &dev->dma_mask; 249 dev->dev.dma_mask = &dev->dma_mask;
248 dev->dev.parent = NULL; 250 dev->dev.parent = parent;
249 dev->dev.bus = &of_platform_bus_type; 251 dev->dev.bus = &of_platform_bus_type;
250 dev->dev.release = of_release_dev; 252 dev->dev.release = of_release_dev;
251 253
@@ -259,6 +261,7 @@ struct of_device* of_platform_device_create(struct device_node *np, const char *
259 return dev; 261 return dev;
260} 262}
261 263
264
262EXPORT_SYMBOL(of_match_device); 265EXPORT_SYMBOL(of_match_device);
263EXPORT_SYMBOL(of_platform_bus_type); 266EXPORT_SYMBOL(of_platform_bus_type);
264EXPORT_SYMBOL(of_register_driver); 267EXPORT_SYMBOL(of_register_driver);
diff --git a/arch/ppc64/kernel/pSeries_iommu.c b/arch/ppc64/kernel/pSeries_iommu.c
index 2b5e622732f4..5914f61a152e 100644
--- a/arch/ppc64/kernel/pSeries_iommu.c
+++ b/arch/ppc64/kernel/pSeries_iommu.c
@@ -281,8 +281,10 @@ static void iommu_table_setparms(struct pci_controller *phb,
281 tbl->it_offset = phb->dma_window_base_cur >> PAGE_SHIFT; 281 tbl->it_offset = phb->dma_window_base_cur >> PAGE_SHIFT;
282 282
283 /* Test if we are going over 2GB of DMA space */ 283 /* Test if we are going over 2GB of DMA space */
284 if (phb->dma_window_base_cur + phb->dma_window_size > (1L << 31)) 284 if (phb->dma_window_base_cur + phb->dma_window_size > 0x80000000ul) {
285 udbg_printf("PCI_DMA: Unexpected number of IOAs under this PHB.\n");
285 panic("PCI_DMA: Unexpected number of IOAs under this PHB.\n"); 286 panic("PCI_DMA: Unexpected number of IOAs under this PHB.\n");
287 }
286 288
287 phb->dma_window_base_cur += phb->dma_window_size; 289 phb->dma_window_base_cur += phb->dma_window_size;
288 290
@@ -326,92 +328,85 @@ static void iommu_table_setparms_lpar(struct pci_controller *phb,
326 328
327static void iommu_bus_setup_pSeries(struct pci_bus *bus) 329static void iommu_bus_setup_pSeries(struct pci_bus *bus)
328{ 330{
329 struct device_node *dn, *pdn; 331 struct device_node *dn;
330 struct pci_dn *pci;
331 struct iommu_table *tbl; 332 struct iommu_table *tbl;
333 struct device_node *isa_dn, *isa_dn_orig;
334 struct device_node *tmp;
335 struct pci_dn *pci;
336 int children;
332 337
333 DBG("iommu_bus_setup_pSeries, bus %p, bus->self %p\n", bus, bus->self); 338 DBG("iommu_bus_setup_pSeries, bus %p, bus->self %p\n", bus, bus->self);
334 339
335 /* For each (root) bus, we carve up the available DMA space in 256MB 340 dn = pci_bus_to_OF_node(bus);
336 * pieces. Since each piece is used by one (sub) bus/device, that would 341 pci = PCI_DN(dn);
337 * give a maximum of 7 devices per PHB. In most cases, this is plenty. 342
338 * 343 if (bus->self) {
339 * The exception is on Python PHBs (pre-POWER4). Here we don't have EADS 344 /* This is not a root bus, any setup will be done for the
340 * bridges below the PHB to allocate the sectioned tables to, so instead 345 * device-side of the bridge in iommu_dev_setup_pSeries().
341 * we allocate a 1GB table at the PHB level. 346 */
347 return;
348 }
349
350 /* Check if the ISA bus on the system is under
351 * this PHB.
342 */ 352 */
353 isa_dn = isa_dn_orig = of_find_node_by_type(NULL, "isa");
343 354
344 dn = pci_bus_to_OF_node(bus); 355 while (isa_dn && isa_dn != dn)
345 pci = dn->data; 356 isa_dn = isa_dn->parent;
346 357
347 if (!bus->self) { 358 if (isa_dn_orig)
348 /* Root bus */ 359 of_node_put(isa_dn_orig);
349 if (is_python(dn)) {
350 unsigned int *iohole;
351
352 DBG("Python root bus %s\n", bus->name);
353
354 iohole = (unsigned int *)get_property(dn, "io-hole", 0);
355
356 if (iohole) {
357 /* On first bus we need to leave room for the
358 * ISA address space. Just skip the first 256MB
359 * alltogether. This leaves 768MB for the window.
360 */
361 DBG("PHB has io-hole, reserving 256MB\n");
362 pci->phb->dma_window_size = 3 << 28;
363 pci->phb->dma_window_base_cur = 1 << 28;
364 } else {
365 /* 1GB window by default */
366 pci->phb->dma_window_size = 1 << 30;
367 pci->phb->dma_window_base_cur = 0;
368 }
369
370 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
371
372 iommu_table_setparms(pci->phb, dn, tbl);
373 pci->iommu_table = iommu_init_table(tbl);
374 } else {
375 /* Do a 128MB table at root. This is used for the IDE
376 * controller on some SMP-mode POWER4 machines. It
377 * doesn't hurt to allocate it on other machines
378 * -- it'll just be unused since new tables are
379 * allocated on the EADS level.
380 *
381 * Allocate at offset 128MB to avoid having to deal
382 * with ISA holes; 128MB table for IDE is plenty.
383 */
384 pci->phb->dma_window_size = 1 << 27;
385 pci->phb->dma_window_base_cur = 1 << 27;
386
387 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
388
389 iommu_table_setparms(pci->phb, dn, tbl);
390 pci->iommu_table = iommu_init_table(tbl);
391
392 /* All child buses have 256MB tables */
393 pci->phb->dma_window_size = 1 << 28;
394 }
395 } else {
396 pdn = pci_bus_to_OF_node(bus->parent);
397 360
398 if (!bus->parent->self && !is_python(pdn)) { 361 /* Count number of direct PCI children of the PHB.
399 struct iommu_table *tbl; 362 * All PCI device nodes have class-code property, so it's
400 /* First child and not python means this is the EADS 363 * an easy way to find them.
401 * level. Allocate new table for this slot with 256MB 364 */
402 * window. 365 for (children = 0, tmp = dn->child; tmp; tmp = tmp->sibling)
403 */ 366 if (get_property(tmp, "class-code", NULL))
367 children++;
404 368
405 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); 369 DBG("Children: %d\n", children);
406 370
407 iommu_table_setparms(pci->phb, dn, tbl); 371 /* Calculate amount of DMA window per slot. Each window must be
372 * a power of two (due to pci_alloc_consistent requirements).
373 *
374 * Keep 256MB aside for PHBs with ISA.
375 */
408 376
409 pci->iommu_table = iommu_init_table(tbl); 377 if (!isa_dn) {
410 } else { 378 /* No ISA/IDE - just set window size and return */
411 /* Lower than first child or under python, use parent table */ 379 pci->phb->dma_window_size = 0x80000000ul; /* To be divided */
412 pci->iommu_table = PCI_DN(pdn)->iommu_table; 380
413 } 381 while (pci->phb->dma_window_size * children > 0x80000000ul)
382 pci->phb->dma_window_size >>= 1;
383 DBG("No ISA/IDE, window size is 0x%lx\n",
384 pci->phb->dma_window_size);
385 pci->phb->dma_window_base_cur = 0;
386
387 return;
414 } 388 }
389
390 /* If we have ISA, then we probably have an IDE
391 * controller too. Allocate a 128MB table but
392 * skip the first 128MB to avoid stepping on ISA
393 * space.
394 */
395 pci->phb->dma_window_size = 0x8000000ul;
396 pci->phb->dma_window_base_cur = 0x8000000ul;
397
398 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
399
400 iommu_table_setparms(pci->phb, dn, tbl);
401 pci->iommu_table = iommu_init_table(tbl);
402
403 /* Divide the rest (1.75GB) among the children */
404 pci->phb->dma_window_size = 0x80000000ul;
405 while (pci->phb->dma_window_size * children > 0x70000000ul)
406 pci->phb->dma_window_size >>= 1;
407
408 DBG("ISA/IDE, window size is 0x%lx\n", pci->phb->dma_window_size);
409
415} 410}
416 411
417 412
@@ -462,21 +457,36 @@ static void iommu_bus_setup_pSeriesLP(struct pci_bus *bus)
462static void iommu_dev_setup_pSeries(struct pci_dev *dev) 457static void iommu_dev_setup_pSeries(struct pci_dev *dev)
463{ 458{
464 struct device_node *dn, *mydn; 459 struct device_node *dn, *mydn;
460 struct iommu_table *tbl;
461
462 DBG("iommu_dev_setup_pSeries, dev %p (%s)\n", dev, pci_name(dev));
465 463
466 DBG("iommu_dev_setup_pSeries, dev %p (%s)\n", dev, dev->pretty_name);
467 /* Now copy the iommu_table ptr from the bus device down to the
468 * pci device_node. This means get_iommu_table() won't need to search
469 * up the device tree to find it.
470 */
471 mydn = dn = pci_device_to_OF_node(dev); 464 mydn = dn = pci_device_to_OF_node(dev);
472 465
466 /* If we're the direct child of a root bus, then we need to allocate
467 * an iommu table ourselves. The bus setup code should have setup
468 * the window sizes already.
469 */
470 if (!dev->bus->self) {
471 DBG(" --> first child, no bridge. Allocating iommu table.\n");
472 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
473 iommu_table_setparms(PCI_DN(dn)->phb, dn, tbl);
474 PCI_DN(mydn)->iommu_table = iommu_init_table(tbl);
475
476 return;
477 }
478
479 /* If this device is further down the bus tree, search upwards until
480 * an already allocated iommu table is found and use that.
481 */
482
473 while (dn && dn->data && PCI_DN(dn)->iommu_table == NULL) 483 while (dn && dn->data && PCI_DN(dn)->iommu_table == NULL)
474 dn = dn->parent; 484 dn = dn->parent;
475 485
476 if (dn && dn->data) { 486 if (dn && dn->data) {
477 PCI_DN(mydn)->iommu_table = PCI_DN(dn)->iommu_table; 487 PCI_DN(mydn)->iommu_table = PCI_DN(dn)->iommu_table;
478 } else { 488 } else {
479 DBG("iommu_dev_setup_pSeries, dev %p (%s) has no iommu table\n", dev, dev->pretty_name); 489 DBG("iommu_dev_setup_pSeries, dev %p (%s) has no iommu table\n", dev, pci_name(dev));
480 } 490 }
481} 491}
482 492
@@ -510,7 +520,7 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
510 int *dma_window = NULL; 520 int *dma_window = NULL;
511 struct pci_dn *pci; 521 struct pci_dn *pci;
512 522
513 DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, dev->pretty_name); 523 DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, pci_name(dev));
514 524
515 /* dev setup for LPAR is a little tricky, since the device tree might 525 /* dev setup for LPAR is a little tricky, since the device tree might
516 * contain the dma-window properties per-device and not neccesarily 526 * contain the dma-window properties per-device and not neccesarily
@@ -532,9 +542,8 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
532 * slots on POWER4 machines. 542 * slots on POWER4 machines.
533 */ 543 */
534 if (dma_window == NULL || pdn->parent == NULL) { 544 if (dma_window == NULL || pdn->parent == NULL) {
535 /* Fall back to regular (non-LPAR) dev setup */ 545 DBG("No dma window for device, linking to parent\n");
536 DBG("No dma window for device, falling back to regular setup\n"); 546 PCI_DN(dn)->iommu_table = PCI_DN(pdn)->iommu_table;
537 iommu_dev_setup_pSeries(dev);
538 return; 547 return;
539 } else { 548 } else {
540 DBG("Found DMA window, allocating table\n"); 549 DBG("Found DMA window, allocating table\n");
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
index 861138ad092c..ff4be1da69d5 100644
--- a/arch/ppc64/kernel/pci.c
+++ b/arch/ppc64/kernel/pci.c
@@ -246,11 +246,14 @@ static unsigned int pci_parse_of_flags(u32 addr0)
246 unsigned int flags = 0; 246 unsigned int flags = 0;
247 247
248 if (addr0 & 0x02000000) { 248 if (addr0 & 0x02000000) {
249 flags |= IORESOURCE_MEM; 249 flags = IORESOURCE_MEM | PCI_BASE_ADDRESS_SPACE_MEMORY;
250 flags |= (addr0 >> 22) & PCI_BASE_ADDRESS_MEM_TYPE_64;
251 flags |= (addr0 >> 28) & PCI_BASE_ADDRESS_MEM_TYPE_1M;
250 if (addr0 & 0x40000000) 252 if (addr0 & 0x40000000)
251 flags |= IORESOURCE_PREFETCH; 253 flags |= IORESOURCE_PREFETCH
254 | PCI_BASE_ADDRESS_MEM_PREFETCH;
252 } else if (addr0 & 0x01000000) 255 } else if (addr0 & 0x01000000)
253 flags |= IORESOURCE_IO; 256 flags = IORESOURCE_IO | PCI_BASE_ADDRESS_SPACE_IO;
254 return flags; 257 return flags;
255} 258}
256 259
diff --git a/arch/ppc64/kernel/pmac_setup.c b/arch/ppc64/kernel/pmac_setup.c
index 1f5118078f7d..bb0c3bfbb7e2 100644
--- a/arch/ppc64/kernel/pmac_setup.c
+++ b/arch/ppc64/kernel/pmac_setup.c
@@ -434,15 +434,23 @@ static int pmac_check_legacy_ioport(unsigned int baseport)
434 434
435static int __init pmac_declare_of_platform_devices(void) 435static int __init pmac_declare_of_platform_devices(void)
436{ 436{
437 struct device_node *np; 437 struct device_node *np, *npp;
438 438
439 np = find_devices("u3"); 439 npp = of_find_node_by_name(NULL, "u3");
440 if (np) { 440 if (npp) {
441 for (np = np->child; np != NULL; np = np->sibling) 441 for (np = NULL; (np = of_get_next_child(npp, np)) != NULL;) {
442 if (strncmp(np->name, "i2c", 3) == 0) { 442 if (strncmp(np->name, "i2c", 3) == 0) {
443 of_platform_device_create(np, "u3-i2c"); 443 of_platform_device_create(np, "u3-i2c", NULL);
444 of_node_put(np);
444 break; 445 break;
445 } 446 }
447 }
448 of_node_put(npp);
449 }
450 npp = of_find_node_by_type(NULL, "smu");
451 if (npp) {
452 of_platform_device_create(npp, "smu", NULL);
453 of_node_put(npp);
446 } 454 }
447 455
448 return 0; 456 return 0;
diff --git a/arch/ppc64/kernel/pmac_time.c b/arch/ppc64/kernel/pmac_time.c
index 6c8c99295e7a..9d8c97decd32 100644
--- a/arch/ppc64/kernel/pmac_time.c
+++ b/arch/ppc64/kernel/pmac_time.c
@@ -84,7 +84,7 @@ void pmac_get_rtc_time(struct rtc_time *tm)
84 84
85#ifdef CONFIG_PMAC_SMU 85#ifdef CONFIG_PMAC_SMU
86 case SYS_CTRLER_SMU: 86 case SYS_CTRLER_SMU:
87 smu_get_rtc_time(tm); 87 smu_get_rtc_time(tm, 1);
88 break; 88 break;
89#endif /* CONFIG_PMAC_SMU */ 89#endif /* CONFIG_PMAC_SMU */
90 default: 90 default:
@@ -128,7 +128,7 @@ int pmac_set_rtc_time(struct rtc_time *tm)
128 128
129#ifdef CONFIG_PMAC_SMU 129#ifdef CONFIG_PMAC_SMU
130 case SYS_CTRLER_SMU: 130 case SYS_CTRLER_SMU:
131 return smu_set_rtc_time(tm); 131 return smu_set_rtc_time(tm, 1);
132#endif /* CONFIG_PMAC_SMU */ 132#endif /* CONFIG_PMAC_SMU */
133 default: 133 default:
134 return -ENODEV; 134 return -ENODEV;
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c
index 9979919cdf92..f252670874a4 100644
--- a/arch/ppc64/kernel/prom_init.c
+++ b/arch/ppc64/kernel/prom_init.c
@@ -1711,6 +1711,7 @@ static void __init flatten_device_tree(void)
1711 unsigned long offset = reloc_offset(); 1711 unsigned long offset = reloc_offset();
1712 unsigned long mem_start, mem_end, room; 1712 unsigned long mem_start, mem_end, room;
1713 struct boot_param_header *hdr; 1713 struct boot_param_header *hdr;
1714 struct prom_t *_prom = PTRRELOC(&prom);
1714 char *namep; 1715 char *namep;
1715 u64 *rsvmap; 1716 u64 *rsvmap;
1716 1717
@@ -1765,6 +1766,7 @@ static void __init flatten_device_tree(void)
1765 RELOC(dt_struct_end) = PAGE_ALIGN(mem_start); 1766 RELOC(dt_struct_end) = PAGE_ALIGN(mem_start);
1766 1767
1767 /* Finish header */ 1768 /* Finish header */
1769 hdr->boot_cpuid_phys = _prom->cpu;
1768 hdr->magic = OF_DT_HEADER; 1770 hdr->magic = OF_DT_HEADER;
1769 hdr->totalsize = RELOC(dt_struct_end) - RELOC(dt_header_start); 1771 hdr->totalsize = RELOC(dt_struct_end) - RELOC(dt_header_start);
1770 hdr->off_dt_struct = RELOC(dt_struct_start) - RELOC(dt_header_start); 1772 hdr->off_dt_struct = RELOC(dt_struct_start) - RELOC(dt_header_start);
@@ -1854,7 +1856,6 @@ static void __init prom_find_boot_cpu(void)
1854 1856
1855 cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu); 1857 cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu);
1856 1858
1857 prom_setprop(cpu_pkg, "linux,boot-cpu", NULL, 0);
1858 prom_getprop(cpu_pkg, "reg", &getprop_rval, sizeof(getprop_rval)); 1859 prom_getprop(cpu_pkg, "reg", &getprop_rval, sizeof(getprop_rval));
1859 _prom->cpu = getprop_rval; 1860 _prom->cpu = getprop_rval;
1860 1861
diff --git a/arch/ppc64/kernel/ptrace.c b/arch/ppc64/kernel/ptrace.c
index 85ed3188a91d..b1c044ca5756 100644
--- a/arch/ppc64/kernel/ptrace.c
+++ b/arch/ppc64/kernel/ptrace.c
@@ -219,6 +219,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
219 219
220 case PTRACE_SET_DEBUGREG: 220 case PTRACE_SET_DEBUGREG:
221 ret = ptrace_set_debugreg(child, addr, data); 221 ret = ptrace_set_debugreg(child, addr, data);
222 break;
222 223
223 case PTRACE_DETACH: 224 case PTRACE_DETACH:
224 ret = ptrace_detach(child, data); 225 ret = ptrace_detach(child, data);
diff --git a/arch/ppc64/mm/hash_native.c b/arch/ppc64/mm/hash_native.c
index 29b074505d3e..874cf96938ff 100644
--- a/arch/ppc64/mm/hash_native.c
+++ b/arch/ppc64/mm/hash_native.c
@@ -342,15 +342,14 @@ static void native_flush_hash_range(unsigned long number, int local)
342 hpte_t *hptep; 342 hpte_t *hptep;
343 unsigned long hpte_v; 343 unsigned long hpte_v;
344 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); 344 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
345 345 unsigned long large;
346 /* XXX fix for large ptes */
347 unsigned long large = 0;
348 346
349 local_irq_save(flags); 347 local_irq_save(flags);
350 348
351 j = 0; 349 j = 0;
352 for (i = 0; i < number; i++) { 350 for (i = 0; i < number; i++) {
353 va = batch->vaddr[j]; 351 va = batch->vaddr[j];
352 large = pte_huge(batch->pte[i]);
354 if (large) 353 if (large)
355 vpn = va >> HPAGE_SHIFT; 354 vpn = va >> HPAGE_SHIFT;
356 else 355 else
diff --git a/arch/ppc64/mm/hugetlbpage.c b/arch/ppc64/mm/hugetlbpage.c
index 338771ec70d7..0ea0994ed974 100644
--- a/arch/ppc64/mm/hugetlbpage.c
+++ b/arch/ppc64/mm/hugetlbpage.c
@@ -710,10 +710,13 @@ repeat:
710 hpte_group = ((~hash & htab_hash_mask) * 710 hpte_group = ((~hash & htab_hash_mask) *
711 HPTES_PER_GROUP) & ~0x7UL; 711 HPTES_PER_GROUP) & ~0x7UL;
712 slot = ppc_md.hpte_insert(hpte_group, va, prpn, 712 slot = ppc_md.hpte_insert(hpte_group, va, prpn,
713 HPTE_V_LARGE, rflags); 713 HPTE_V_LARGE |
714 HPTE_V_SECONDARY,
715 rflags);
714 if (slot == -1) { 716 if (slot == -1) {
715 if (mftb() & 0x1) 717 if (mftb() & 0x1)
716 hpte_group = ((hash & htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL; 718 hpte_group = ((hash & htab_hash_mask) *
719 HPTES_PER_GROUP)&~0x7UL;
717 720
718 ppc_md.hpte_remove(hpte_group); 721 ppc_md.hpte_remove(hpte_group);
719 goto repeat; 722 goto repeat;
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index 3e0badb820c5..b48349527853 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -42,19 +42,15 @@
42 * executing (see inherit_locked_prom_mappings() rant). 42 * executing (see inherit_locked_prom_mappings() rant).
43 */ 43 */
44sparc64_vpte_nucleus: 44sparc64_vpte_nucleus:
45 /* Load 0xf0000000, which is LOW_OBP_ADDRESS. */ 45 /* Note that kvmap below has verified that the address is
46 mov 0xf, %g5 46 * in the range MODULES_VADDR --> VMALLOC_END already. So
47 sllx %g5, 28, %g5 47 * here we need only check if it is an OBP address or not.
48 48 */
49 /* Is addr >= LOW_OBP_ADDRESS? */ 49 sethi %hi(LOW_OBP_ADDRESS), %g5
50 cmp %g4, %g5 50 cmp %g4, %g5
51 blu,pn %xcc, sparc64_vpte_patchme1 51 blu,pn %xcc, sparc64_vpte_patchme1
52 mov 0x1, %g5 52 mov 0x1, %g5
53
54 /* Load 0x100000000, which is HI_OBP_ADDRESS. */
55 sllx %g5, 32, %g5 53 sllx %g5, 32, %g5
56
57 /* Is addr < HI_OBP_ADDRESS? */
58 cmp %g4, %g5 54 cmp %g4, %g5
59 blu,pn %xcc, obp_iaddr_patch 55 blu,pn %xcc, obp_iaddr_patch
60 nop 56 nop
@@ -156,26 +152,29 @@ obp_daddr_patch:
156 * rather, use information saved during inherit_prom_mappings() using 8k 152 * rather, use information saved during inherit_prom_mappings() using 8k
157 * pagesize. 153 * pagesize.
158 */ 154 */
155 .align 32
159kvmap: 156kvmap:
160 /* Load 0xf0000000, which is LOW_OBP_ADDRESS. */ 157 sethi %hi(MODULES_VADDR), %g5
161 mov 0xf, %g5 158 cmp %g4, %g5
162 sllx %g5, 28, %g5 159 blu,pn %xcc, longpath
160 mov (VMALLOC_END >> 24), %g5
161 sllx %g5, 24, %g5
162 cmp %g4, %g5
163 bgeu,pn %xcc, longpath
164 nop
163 165
164 /* Is addr >= LOW_OBP_ADDRESS? */ 166kvmap_check_obp:
167 sethi %hi(LOW_OBP_ADDRESS), %g5
165 cmp %g4, %g5 168 cmp %g4, %g5
166 blu,pn %xcc, vmalloc_addr 169 blu,pn %xcc, kvmap_vmalloc_addr
167 mov 0x1, %g5 170 mov 0x1, %g5
168
169 /* Load 0x100000000, which is HI_OBP_ADDRESS. */
170 sllx %g5, 32, %g5 171 sllx %g5, 32, %g5
171
172 /* Is addr < HI_OBP_ADDRESS? */
173 cmp %g4, %g5 172 cmp %g4, %g5
174 blu,pn %xcc, obp_daddr_patch 173 blu,pn %xcc, obp_daddr_patch
175 nop 174 nop
176 175
177vmalloc_addr: 176kvmap_vmalloc_addr:
178 /* If we get here, a vmalloc addr accessed, load kernel VPTE. */ 177 /* If we get here, a vmalloc addr was accessed, load kernel VPTE. */
179 ldxa [%g3 + %g6] ASI_N, %g5 178 ldxa [%g3 + %g6] ASI_N, %g5
180 brgez,pn %g5, longpath 179 brgez,pn %g5, longpath
181 nop 180 nop
diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
index 23ad839d113f..5efbff90d668 100644
--- a/arch/sparc64/kernel/ptrace.c
+++ b/arch/sparc64/kernel/ptrace.c
@@ -30,6 +30,7 @@
30#include <asm/psrcompat.h> 30#include <asm/psrcompat.h>
31#include <asm/visasm.h> 31#include <asm/visasm.h>
32#include <asm/spitfire.h> 32#include <asm/spitfire.h>
33#include <asm/page.h>
33 34
34/* Returning from ptrace is a bit tricky because the syscall return 35/* Returning from ptrace is a bit tricky because the syscall return
35 * low level code assumes any value returned which is negative and 36 * low level code assumes any value returned which is negative and
@@ -128,20 +129,20 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
128 * is mapped to in the user's address space, we can skip the 129 * is mapped to in the user's address space, we can skip the
129 * D-cache flush. 130 * D-cache flush.
130 */ 131 */
131 if ((uaddr ^ kaddr) & (1UL << 13)) { 132 if ((uaddr ^ (unsigned long) kaddr) & (1UL << 13)) {
132 unsigned long start = __pa(kaddr); 133 unsigned long start = __pa(kaddr);
133 unsigned long end = start + len; 134 unsigned long end = start + len;
134 135
135 if (tlb_type == spitfire) { 136 if (tlb_type == spitfire) {
136 for (; start < end; start += 32) 137 for (; start < end; start += 32)
137 spitfire_put_dcache_tag(va & 0x3fe0, 0x0); 138 spitfire_put_dcache_tag(start & 0x3fe0, 0x0);
138 } else { 139 } else {
139 for (; start < end; start += 32) 140 for (; start < end; start += 32)
140 __asm__ __volatile__( 141 __asm__ __volatile__(
141 "stxa %%g0, [%0] %1\n\t" 142 "stxa %%g0, [%0] %1\n\t"
142 "membar #Sync" 143 "membar #Sync"
143 : /* no outputs */ 144 : /* no outputs */
144 : "r" (va), 145 : "r" (start),
145 "i" (ASI_DCACHE_INVALIDATE)); 146 "i" (ASI_DCACHE_INVALIDATE));
146 } 147 }
147 } 148 }
diff --git a/arch/sparc64/kernel/una_asm.S b/arch/sparc64/kernel/una_asm.S
index cbb40585253c..da48400bcc95 100644
--- a/arch/sparc64/kernel/una_asm.S
+++ b/arch/sparc64/kernel/una_asm.S
@@ -17,7 +17,7 @@ kernel_unaligned_trap_fault:
17__do_int_store: 17__do_int_store:
18 rd %asi, %o4 18 rd %asi, %o4
19 wr %o3, 0, %asi 19 wr %o3, 0, %asi
20 ldx [%o2], %g3 20 mov %o2, %g3
21 cmp %o1, 2 21 cmp %o1, 2
22 be,pn %icc, 2f 22 be,pn %icc, 2f
23 cmp %o1, 4 23 cmp %o1, 4
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c
index da9739f0d437..42718f6a7d36 100644
--- a/arch/sparc64/kernel/unaligned.c
+++ b/arch/sparc64/kernel/unaligned.c
@@ -184,13 +184,14 @@ extern void do_int_load(unsigned long *dest_reg, int size,
184 unsigned long *saddr, int is_signed, int asi); 184 unsigned long *saddr, int is_signed, int asi);
185 185
186extern void __do_int_store(unsigned long *dst_addr, int size, 186extern void __do_int_store(unsigned long *dst_addr, int size,
187 unsigned long *src_val, int asi); 187 unsigned long src_val, int asi);
188 188
189static inline void do_int_store(int reg_num, int size, unsigned long *dst_addr, 189static inline void do_int_store(int reg_num, int size, unsigned long *dst_addr,
190 struct pt_regs *regs, int asi) 190 struct pt_regs *regs, int asi, int orig_asi)
191{ 191{
192 unsigned long zero = 0; 192 unsigned long zero = 0;
193 unsigned long *src_val = &zero; 193 unsigned long *src_val_p = &zero;
194 unsigned long src_val;
194 195
195 if (size == 16) { 196 if (size == 16) {
196 size = 8; 197 size = 8;
@@ -198,7 +199,25 @@ static inline void do_int_store(int reg_num, int size, unsigned long *dst_addr,
198 (unsigned)fetch_reg(reg_num, regs) : 0)) << 32) | 199 (unsigned)fetch_reg(reg_num, regs) : 0)) << 32) |
199 (unsigned)fetch_reg(reg_num + 1, regs); 200 (unsigned)fetch_reg(reg_num + 1, regs);
200 } else if (reg_num) { 201 } else if (reg_num) {
201 src_val = fetch_reg_addr(reg_num, regs); 202 src_val_p = fetch_reg_addr(reg_num, regs);
203 }
204 src_val = *src_val_p;
205 if (unlikely(asi != orig_asi)) {
206 switch (size) {
207 case 2:
208 src_val = swab16(src_val);
209 break;
210 case 4:
211 src_val = swab32(src_val);
212 break;
213 case 8:
214 src_val = swab64(src_val);
215 break;
216 case 16:
217 default:
218 BUG();
219 break;
220 };
202 } 221 }
203 __do_int_store(dst_addr, size, src_val, asi); 222 __do_int_store(dst_addr, size, src_val, asi);
204} 223}
@@ -276,6 +295,7 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, u
276 kernel_mna_trap_fault(); 295 kernel_mna_trap_fault();
277 } else { 296 } else {
278 unsigned long addr; 297 unsigned long addr;
298 int orig_asi, asi;
279 299
280 addr = compute_effective_address(regs, insn, 300 addr = compute_effective_address(regs, insn,
281 ((insn >> 25) & 0x1f)); 301 ((insn >> 25) & 0x1f));
@@ -285,18 +305,48 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, u
285 regs->tpc, dirstrings[dir], addr, size, 305 regs->tpc, dirstrings[dir], addr, size,
286 regs->u_regs[UREG_RETPC]); 306 regs->u_regs[UREG_RETPC]);
287#endif 307#endif
308 orig_asi = asi = decode_asi(insn, regs);
309 switch (asi) {
310 case ASI_NL:
311 case ASI_AIUPL:
312 case ASI_AIUSL:
313 case ASI_PL:
314 case ASI_SL:
315 case ASI_PNFL:
316 case ASI_SNFL:
317 asi &= ~0x08;
318 break;
319 };
288 switch (dir) { 320 switch (dir) {
289 case load: 321 case load:
290 do_int_load(fetch_reg_addr(((insn>>25)&0x1f), regs), 322 do_int_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
291 size, (unsigned long *) addr, 323 size, (unsigned long *) addr,
292 decode_signedness(insn), 324 decode_signedness(insn), asi);
293 decode_asi(insn, regs)); 325 if (unlikely(asi != orig_asi)) {
326 unsigned long val_in = *(unsigned long *) addr;
327 switch (size) {
328 case 2:
329 val_in = swab16(val_in);
330 break;
331 case 4:
332 val_in = swab32(val_in);
333 break;
334 case 8:
335 val_in = swab64(val_in);
336 break;
337 case 16:
338 default:
339 BUG();
340 break;
341 };
342 *(unsigned long *) addr = val_in;
343 }
294 break; 344 break;
295 345
296 case store: 346 case store:
297 do_int_store(((insn>>25)&0x1f), size, 347 do_int_store(((insn>>25)&0x1f), size,
298 (unsigned long *) addr, regs, 348 (unsigned long *) addr, regs,
299 decode_asi(insn, regs)); 349 asi, orig_asi);
300 break; 350 break;
301 351
302 default: 352 default:
diff --git a/arch/um/Makefile b/arch/um/Makefile
index ce987266dac6..5b5af95721ab 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -53,9 +53,13 @@ SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH)
53 53
54# -Dvmap=kernel_vmap affects everything, and prevents anything from 54# -Dvmap=kernel_vmap affects everything, and prevents anything from
55# referencing the libpcap.o symbol so named. 55# referencing the libpcap.o symbol so named.
56#
57# Same things for in6addr_loopback - found in libc.
56 58
57CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ 59CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
58 $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap 60 $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \
61 -Din6addr_loopback=kernel_in6addr_loopback
62
59AFLAGS += $(ARCH_INCLUDE) 63AFLAGS += $(ARCH_INCLUDE)
60 64
61USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) 65USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c
index 14a12d6b3df6..16e7dc89f61d 100644
--- a/arch/um/drivers/chan_kern.c
+++ b/arch/um/drivers/chan_kern.c
@@ -19,18 +19,44 @@
19#include "line.h" 19#include "line.h"
20#include "os.h" 20#include "os.h"
21 21
22#ifdef CONFIG_NOCONFIG_CHAN 22/* XXX: could well be moved to somewhere else, if needed. */
23static int my_printf(const char * fmt, ...)
24 __attribute__ ((format (printf, 1, 2)));
25
26static int my_printf(const char * fmt, ...)
27{
28 /* Yes, can be called on atomic context.*/
29 char *buf = kmalloc(4096, GFP_ATOMIC);
30 va_list args;
31 int r;
32
33 if (!buf) {
34 /* We print directly fmt.
35 * Yes, yes, yes, feel free to complain. */
36 r = strlen(fmt);
37 } else {
38 va_start(args, fmt);
39 r = vsprintf(buf, fmt, args);
40 va_end(args);
41 fmt = buf;
42 }
23 43
24/* The printk's here are wrong because we are complaining that there is no 44 if (r)
25 * output device, but printk is printing to that output device. The user will 45 r = os_write_file(1, fmt, r);
26 * never see the error. printf would be better, except it can't run on a 46 return r;
27 * kernel stack because it will overflow it. 47
28 * Use printk for now since that will avoid crashing. 48}
29 */ 49
50#ifdef CONFIG_NOCONFIG_CHAN
51/* Despite its name, there's no added trailing newline. */
52static int my_puts(const char * buf)
53{
54 return os_write_file(1, buf, strlen(buf));
55}
30 56
31static void *not_configged_init(char *str, int device, struct chan_opts *opts) 57static void *not_configged_init(char *str, int device, struct chan_opts *opts)
32{ 58{
33 printk(KERN_ERR "Using a channel type which is configured out of " 59 my_puts("Using a channel type which is configured out of "
34 "UML\n"); 60 "UML\n");
35 return(NULL); 61 return(NULL);
36} 62}
@@ -38,27 +64,27 @@ static void *not_configged_init(char *str, int device, struct chan_opts *opts)
38static int not_configged_open(int input, int output, int primary, void *data, 64static int not_configged_open(int input, int output, int primary, void *data,
39 char **dev_out) 65 char **dev_out)
40{ 66{
41 printk(KERN_ERR "Using a channel type which is configured out of " 67 my_puts("Using a channel type which is configured out of "
42 "UML\n"); 68 "UML\n");
43 return(-ENODEV); 69 return(-ENODEV);
44} 70}
45 71
46static void not_configged_close(int fd, void *data) 72static void not_configged_close(int fd, void *data)
47{ 73{
48 printk(KERN_ERR "Using a channel type which is configured out of " 74 my_puts("Using a channel type which is configured out of "
49 "UML\n"); 75 "UML\n");
50} 76}
51 77
52static int not_configged_read(int fd, char *c_out, void *data) 78static int not_configged_read(int fd, char *c_out, void *data)
53{ 79{
54 printk(KERN_ERR "Using a channel type which is configured out of " 80 my_puts("Using a channel type which is configured out of "
55 "UML\n"); 81 "UML\n");
56 return(-EIO); 82 return(-EIO);
57} 83}
58 84
59static int not_configged_write(int fd, const char *buf, int len, void *data) 85static int not_configged_write(int fd, const char *buf, int len, void *data)
60{ 86{
61 printk(KERN_ERR "Using a channel type which is configured out of " 87 my_puts("Using a channel type which is configured out of "
62 "UML\n"); 88 "UML\n");
63 return(-EIO); 89 return(-EIO);
64} 90}
@@ -66,7 +92,7 @@ static int not_configged_write(int fd, const char *buf, int len, void *data)
66static int not_configged_console_write(int fd, const char *buf, int len, 92static int not_configged_console_write(int fd, const char *buf, int len,
67 void *data) 93 void *data)
68{ 94{
69 printk(KERN_ERR "Using a channel type which is configured out of " 95 my_puts("Using a channel type which is configured out of "
70 "UML\n"); 96 "UML\n");
71 return(-EIO); 97 return(-EIO);
72} 98}
@@ -74,14 +100,14 @@ static int not_configged_console_write(int fd, const char *buf, int len,
74static int not_configged_window_size(int fd, void *data, unsigned short *rows, 100static int not_configged_window_size(int fd, void *data, unsigned short *rows,
75 unsigned short *cols) 101 unsigned short *cols)
76{ 102{
77 printk(KERN_ERR "Using a channel type which is configured out of " 103 my_puts("Using a channel type which is configured out of "
78 "UML\n"); 104 "UML\n");
79 return(-ENODEV); 105 return(-ENODEV);
80} 106}
81 107
82static void not_configged_free(void *data) 108static void not_configged_free(void *data)
83{ 109{
84 printf(KERN_ERR "Using a channel type which is configured out of " 110 my_puts("Using a channel type which is configured out of "
85 "UML\n"); 111 "UML\n");
86} 112}
87 113
@@ -457,7 +483,7 @@ static struct chan *parse_chan(char *str, int pri, int device,
457 } 483 }
458 } 484 }
459 if(ops == NULL){ 485 if(ops == NULL){
460 printk(KERN_ERR "parse_chan couldn't parse \"%s\"\n", 486 my_printf("parse_chan couldn't parse \"%s\"\n",
461 str); 487 str);
462 return(NULL); 488 return(NULL);
463 } 489 }
@@ -465,7 +491,7 @@ static struct chan *parse_chan(char *str, int pri, int device,
465 data = (*ops->init)(str, device, opts); 491 data = (*ops->init)(str, device, opts);
466 if(data == NULL) return(NULL); 492 if(data == NULL) return(NULL);
467 493
468 chan = kmalloc(sizeof(*chan), GFP_KERNEL); 494 chan = kmalloc(sizeof(*chan), GFP_ATOMIC);
469 if(chan == NULL) return(NULL); 495 if(chan == NULL) return(NULL);
470 *chan = ((struct chan) { .list = LIST_HEAD_INIT(chan->list), 496 *chan = ((struct chan) { .list = LIST_HEAD_INIT(chan->list),
471 .primary = 1, 497 .primary = 1,
diff --git a/arch/um/drivers/mconsole_user.c b/arch/um/drivers/mconsole_user.c
index 310c1f823f26..04383f98f4d5 100644
--- a/arch/um/drivers/mconsole_user.c
+++ b/arch/um/drivers/mconsole_user.c
@@ -23,7 +23,7 @@ static struct mconsole_command commands[] = {
23 { "reboot", mconsole_reboot, MCONSOLE_PROC }, 23 { "reboot", mconsole_reboot, MCONSOLE_PROC },
24 { "config", mconsole_config, MCONSOLE_PROC }, 24 { "config", mconsole_config, MCONSOLE_PROC },
25 { "remove", mconsole_remove, MCONSOLE_PROC }, 25 { "remove", mconsole_remove, MCONSOLE_PROC },
26 { "sysrq", mconsole_sysrq, MCONSOLE_INTR }, 26 { "sysrq", mconsole_sysrq, MCONSOLE_PROC },
27 { "help", mconsole_help, MCONSOLE_INTR }, 27 { "help", mconsole_help, MCONSOLE_INTR },
28 { "cad", mconsole_cad, MCONSOLE_INTR }, 28 { "cad", mconsole_cad, MCONSOLE_INTR },
29 { "stop", mconsole_stop, MCONSOLE_PROC }, 29 { "stop", mconsole_stop, MCONSOLE_PROC },
diff --git a/arch/um/include/common-offsets.h b/arch/um/include/common-offsets.h
index 0aa620970adb..782ac3a3baf9 100644
--- a/arch/um/include/common-offsets.h
+++ b/arch/um/include/common-offsets.h
@@ -12,4 +12,6 @@ DEFINE_STR(UM_KERN_WARNING, KERN_WARNING);
12DEFINE_STR(UM_KERN_NOTICE, KERN_NOTICE); 12DEFINE_STR(UM_KERN_NOTICE, KERN_NOTICE);
13DEFINE_STR(UM_KERN_INFO, KERN_INFO); 13DEFINE_STR(UM_KERN_INFO, KERN_INFO);
14DEFINE_STR(UM_KERN_DEBUG, KERN_DEBUG); 14DEFINE_STR(UM_KERN_DEBUG, KERN_DEBUG);
15DEFINE(HOST_ELF_CLASS, ELF_CLASS); 15DEFINE(UM_ELF_CLASS, ELF_CLASS);
16DEFINE(UM_ELFCLASS32, ELFCLASS32);
17DEFINE(UM_ELFCLASS64, ELFCLASS64);
diff --git a/arch/um/include/user.h b/arch/um/include/user.h
index 57ee9e261228..0f865ef46918 100644
--- a/arch/um/include/user.h
+++ b/arch/um/include/user.h
@@ -14,7 +14,9 @@ extern void *um_kmalloc_atomic(int size);
14extern void kfree(void *ptr); 14extern void kfree(void *ptr);
15extern int in_aton(char *str); 15extern int in_aton(char *str);
16extern int open_gdb_chan(void); 16extern int open_gdb_chan(void);
17extern int strlcpy(char *, const char *, int); 17/* These use size_t, however unsigned long is correct on both i386 and x86_64. */
18extern unsigned long strlcpy(char *, const char *, unsigned long);
19extern unsigned long strlcat(char *, const char *, unsigned long);
18extern void *um_vmalloc(int size); 20extern void *um_vmalloc(int size);
19extern void vfree(void *ptr); 21extern void vfree(void *ptr);
20 22
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c
index 39cf568ccfaf..ea65db679e9c 100644
--- a/arch/um/kernel/process_kern.c
+++ b/arch/um/kernel/process_kern.c
@@ -82,7 +82,8 @@ unsigned long alloc_stack(int order, int atomic)
82 unsigned long page; 82 unsigned long page;
83 int flags = GFP_KERNEL; 83 int flags = GFP_KERNEL;
84 84
85 if(atomic) flags |= GFP_ATOMIC; 85 if (atomic)
86 flags = GFP_ATOMIC;
86 page = __get_free_pages(flags, order); 87 page = __get_free_pages(flags, order);
87 if(page == 0) 88 if(page == 0)
88 return(0); 89 return(0);
diff --git a/arch/um/kernel/sigio_user.c b/arch/um/kernel/sigio_user.c
index e89218958f38..a52751108aa1 100644
--- a/arch/um/kernel/sigio_user.c
+++ b/arch/um/kernel/sigio_user.c
@@ -340,7 +340,7 @@ static int setup_initial_poll(int fd)
340{ 340{
341 struct pollfd *p; 341 struct pollfd *p;
342 342
343 p = um_kmalloc(sizeof(struct pollfd)); 343 p = um_kmalloc_atomic(sizeof(struct pollfd));
344 if(p == NULL){ 344 if(p == NULL){
345 printk("setup_initial_poll : failed to allocate poll\n"); 345 printk("setup_initial_poll : failed to allocate poll\n");
346 return(-1); 346 return(-1);
diff --git a/arch/um/kernel/skas/include/uaccess-skas.h b/arch/um/kernel/skas/include/uaccess-skas.h
index 6ee3f3902e68..7da0c2def0ef 100644
--- a/arch/um/kernel/skas/include/uaccess-skas.h
+++ b/arch/um/kernel/skas/include/uaccess-skas.h
@@ -18,12 +18,6 @@
18 ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \ 18 ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \
19 ((unsigned long) (addr) + (size) >= (unsigned long)(addr)))) 19 ((unsigned long) (addr) + (size) >= (unsigned long)(addr))))
20 20
21static inline int verify_area_skas(int type, const void __user * addr,
22 unsigned long size)
23{
24 return(access_ok_skas(type, addr, size) ? 0 : -EFAULT);
25}
26
27extern int copy_from_user_skas(void *to, const void __user *from, int n); 21extern int copy_from_user_skas(void *to, const void __user *from, int n);
28extern int copy_to_user_skas(void __user *to, const void *from, int n); 22extern int copy_to_user_skas(void __user *to, const void *from, int n);
29extern int strncpy_from_user_skas(char *dst, const char __user *src, int count); 23extern int strncpy_from_user_skas(char *dst, const char __user *src, int count);
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index 0a562c3c0fd8..f5b0636f9ad7 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -193,12 +193,12 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
193 r = pte_read(*npte); 193 r = pte_read(*npte);
194 w = pte_write(*npte); 194 w = pte_write(*npte);
195 x = pte_exec(*npte); 195 x = pte_exec(*npte);
196 if(!pte_dirty(*npte)) 196 if (!pte_young(*npte)) {
197 w = 0; 197 r = 0;
198 if(!pte_young(*npte)){ 198 w = 0;
199 r = 0; 199 } else if (!pte_dirty(*npte)) {
200 w = 0; 200 w = 0;
201 } 201 }
202 if(force || pte_newpage(*npte)){ 202 if(force || pte_newpage(*npte)){
203 if(pte_present(*npte)) 203 if(pte_present(*npte))
204 ret = add_mmap(addr, 204 ret = add_mmap(addr,
diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c
index 87cc6fd76ced..d297429ac360 100644
--- a/arch/um/kernel/trap_kern.c
+++ b/arch/um/kernel/trap_kern.c
@@ -18,6 +18,7 @@
18#include "asm/a.out.h" 18#include "asm/a.out.h"
19#include "asm/current.h" 19#include "asm/current.h"
20#include "asm/irq.h" 20#include "asm/irq.h"
21#include "sysdep/sigcontext.h"
21#include "user_util.h" 22#include "user_util.h"
22#include "kern_util.h" 23#include "kern_util.h"
23#include "kern.h" 24#include "kern.h"
@@ -39,6 +40,12 @@ int handle_page_fault(unsigned long address, unsigned long ip,
39 int err = -EFAULT; 40 int err = -EFAULT;
40 41
41 *code_out = SEGV_MAPERR; 42 *code_out = SEGV_MAPERR;
43
44 /* If the fault was during atomic operation, don't take the fault, just
45 * fail. */
46 if (in_atomic())
47 goto out_nosemaphore;
48
42 down_read(&mm->mmap_sem); 49 down_read(&mm->mmap_sem);
43 vma = find_vma(mm, address); 50 vma = find_vma(mm, address);
44 if(!vma) 51 if(!vma)
@@ -89,6 +96,7 @@ survive:
89 flush_tlb_page(vma, address); 96 flush_tlb_page(vma, address);
90out: 97out:
91 up_read(&mm->mmap_sem); 98 up_read(&mm->mmap_sem);
99out_nosemaphore:
92 return(err); 100 return(err);
93 101
94/* 102/*
@@ -125,7 +133,15 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, void *sc)
125 } 133 }
126 else if(current->mm == NULL) 134 else if(current->mm == NULL)
127 panic("Segfault with no mm"); 135 panic("Segfault with no mm");
128 err = handle_page_fault(address, ip, is_write, is_user, &si.si_code); 136
137 if (SEGV_IS_FIXABLE(&fi))
138 err = handle_page_fault(address, ip, is_write, is_user, &si.si_code);
139 else {
140 err = -EFAULT;
141 /* A thread accessed NULL, we get a fault, but CR2 is invalid.
142 * This code is used in __do_copy_from_user() of TT mode. */
143 address = 0;
144 }
129 145
130 catcher = current->thread.fault_catcher; 146 catcher = current->thread.fault_catcher;
131 if(!err) 147 if(!err)
diff --git a/arch/um/kernel/tt/include/uaccess-tt.h b/arch/um/kernel/tt/include/uaccess-tt.h
index aa6db384af80..dc2ebfa8c54f 100644
--- a/arch/um/kernel/tt/include/uaccess-tt.h
+++ b/arch/um/kernel/tt/include/uaccess-tt.h
@@ -33,12 +33,6 @@ extern unsigned long uml_physmem;
33 (((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) && \ 33 (((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) && \
34 (under_task_size(addr, size) || is_stack(addr, size)))) 34 (under_task_size(addr, size) || is_stack(addr, size))))
35 35
36static inline int verify_area_tt(int type, const void __user * addr,
37 unsigned long size)
38{
39 return(access_ok_tt(type, addr, size) ? 0 : -EFAULT);
40}
41
42extern unsigned long get_fault_addr(void); 36extern unsigned long get_fault_addr(void);
43 37
44extern int __do_copy_from_user(void *to, const void *from, int n, 38extern int __do_copy_from_user(void *to, const void *from, int n,
diff --git a/arch/um/kernel/tt/process_kern.c b/arch/um/kernel/tt/process_kern.c
index 0de05a268b22..cfaa373a6e77 100644
--- a/arch/um/kernel/tt/process_kern.c
+++ b/arch/um/kernel/tt/process_kern.c
@@ -23,10 +23,11 @@
23#include "mem_user.h" 23#include "mem_user.h"
24#include "tlb.h" 24#include "tlb.h"
25#include "mode.h" 25#include "mode.h"
26#include "mode_kern.h"
26#include "init.h" 27#include "init.h"
27#include "tt.h" 28#include "tt.h"
28 29
29int switch_to_tt(void *prev, void *next, void *last) 30void switch_to_tt(void *prev, void *next)
30{ 31{
31 struct task_struct *from, *to, *prev_sched; 32 struct task_struct *from, *to, *prev_sched;
32 unsigned long flags; 33 unsigned long flags;
diff --git a/arch/um/kernel/tt/uaccess_user.c b/arch/um/kernel/tt/uaccess_user.c
index f01475512ecb..8c220f054b61 100644
--- a/arch/um/kernel/tt/uaccess_user.c
+++ b/arch/um/kernel/tt/uaccess_user.c
@@ -22,8 +22,15 @@ int __do_copy_from_user(void *to, const void *from, int n,
22 __do_copy, &faulted); 22 __do_copy, &faulted);
23 TASK_REGS(get_current())->tt = save; 23 TASK_REGS(get_current())->tt = save;
24 24
25 if(!faulted) return(0); 25 if(!faulted)
26 else return(n - (fault - (unsigned long) from)); 26 return 0;
27 else if (fault)
28 return n - (fault - (unsigned long) from);
29 else
30 /* In case of a general protection fault, we don't have the
31 * fault address, so NULL is used instead. Pretend we didn't
32 * copy anything. */
33 return n;
27} 34}
28 35
29static void __do_strncpy(void *dst, const void *src, int count) 36static void __do_strncpy(void *dst, const void *src, int count)
diff --git a/arch/um/kernel/umid.c b/arch/um/kernel/umid.c
index 186c28885016..0b21d59ba0cd 100644
--- a/arch/um/kernel/umid.c
+++ b/arch/um/kernel/umid.c
@@ -31,6 +31,8 @@ static char *uml_dir = UML_DIR;
31/* Changed by set_umid */ 31/* Changed by set_umid */
32static int umid_is_random = 1; 32static int umid_is_random = 1;
33static int umid_inited = 0; 33static int umid_inited = 0;
34/* Have we created the files? Should we remove them? */
35static int umid_owned = 0;
34 36
35static int make_umid(int (*printer)(const char *fmt, ...)); 37static int make_umid(int (*printer)(const char *fmt, ...));
36 38
@@ -82,20 +84,21 @@ int __init umid_file_name(char *name, char *buf, int len)
82 84
83extern int tracing_pid; 85extern int tracing_pid;
84 86
85static int __init create_pid_file(void) 87static void __init create_pid_file(void)
86{ 88{
87 char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")]; 89 char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")];
88 char pid[sizeof("nnnnn\0")]; 90 char pid[sizeof("nnnnn\0")];
89 int fd, n; 91 int fd, n;
90 92
91 if(umid_file_name("pid", file, sizeof(file))) return 0; 93 if(umid_file_name("pid", file, sizeof(file)))
94 return;
92 95
93 fd = os_open_file(file, of_create(of_excl(of_rdwr(OPENFLAGS()))), 96 fd = os_open_file(file, of_create(of_excl(of_rdwr(OPENFLAGS()))),
94 0644); 97 0644);
95 if(fd < 0){ 98 if(fd < 0){
96 printf("Open of machine pid file \"%s\" failed: %s\n", 99 printf("Open of machine pid file \"%s\" failed: %s\n",
97 file, strerror(-fd)); 100 file, strerror(-fd));
98 return 0; 101 return;
99 } 102 }
100 103
101 sprintf(pid, "%d\n", os_getpid()); 104 sprintf(pid, "%d\n", os_getpid());
@@ -103,7 +106,6 @@ static int __init create_pid_file(void)
103 if(n != strlen(pid)) 106 if(n != strlen(pid))
104 printf("Write of pid file failed - err = %d\n", -n); 107 printf("Write of pid file failed - err = %d\n", -n);
105 os_close_file(fd); 108 os_close_file(fd);
106 return 0;
107} 109}
108 110
109static int actually_do_remove(char *dir) 111static int actually_do_remove(char *dir)
@@ -147,7 +149,8 @@ static int actually_do_remove(char *dir)
147void remove_umid_dir(void) 149void remove_umid_dir(void)
148{ 150{
149 char dir[strlen(uml_dir) + UMID_LEN + 1]; 151 char dir[strlen(uml_dir) + UMID_LEN + 1];
150 if(!umid_inited) return; 152 if (!umid_owned)
153 return;
151 154
152 sprintf(dir, "%s%s", uml_dir, umid); 155 sprintf(dir, "%s%s", uml_dir, umid);
153 actually_do_remove(dir); 156 actually_do_remove(dir);
@@ -155,11 +158,12 @@ void remove_umid_dir(void)
155 158
156char *get_umid(int only_if_set) 159char *get_umid(int only_if_set)
157{ 160{
158 if(only_if_set && umid_is_random) return(NULL); 161 if(only_if_set && umid_is_random)
159 return(umid); 162 return NULL;
163 return umid;
160} 164}
161 165
162int not_dead_yet(char *dir) 166static int not_dead_yet(char *dir)
163{ 167{
164 char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")]; 168 char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")];
165 char pid[sizeof("nnnnn\0")], *end; 169 char pid[sizeof("nnnnn\0")], *end;
@@ -193,7 +197,8 @@ int not_dead_yet(char *dir)
193 (p == CHOOSE_MODE(tracing_pid, os_getpid()))) 197 (p == CHOOSE_MODE(tracing_pid, os_getpid())))
194 dead = 1; 198 dead = 1;
195 } 199 }
196 if(!dead) return(1); 200 if(!dead)
201 return(1);
197 return(actually_do_remove(dir)); 202 return(actually_do_remove(dir));
198} 203}
199 204
@@ -232,16 +237,13 @@ static int __init make_uml_dir(void)
232 strlcpy(dir, home, sizeof(dir)); 237 strlcpy(dir, home, sizeof(dir));
233 uml_dir++; 238 uml_dir++;
234 } 239 }
240 strlcat(dir, uml_dir, sizeof(dir));
235 len = strlen(dir); 241 len = strlen(dir);
236 strncat(dir, uml_dir, sizeof(dir) - len); 242 if (len > 0 && dir[len - 1] != '/')
237 len = strlen(dir); 243 strlcat(dir, "/", sizeof(dir));
238 if((len > 0) && (len < sizeof(dir) - 1) && (dir[len - 1] != '/')){
239 dir[len] = '/';
240 dir[len + 1] = '\0';
241 }
242 244
243 uml_dir = malloc(strlen(dir) + 1); 245 uml_dir = malloc(strlen(dir) + 1);
244 if(uml_dir == NULL){ 246 if (uml_dir == NULL) {
245 printf("make_uml_dir : malloc failed, errno = %d\n", errno); 247 printf("make_uml_dir : malloc failed, errno = %d\n", errno);
246 exit(1); 248 exit(1);
247 } 249 }
@@ -286,6 +288,7 @@ static int __init make_umid(int (*printer)(const char *fmt, ...))
286 if(errno == EEXIST){ 288 if(errno == EEXIST){
287 if(not_dead_yet(tmp)){ 289 if(not_dead_yet(tmp)){
288 (*printer)("umid '%s' is in use\n", umid); 290 (*printer)("umid '%s' is in use\n", umid);
291 umid_owned = 0;
289 return(-1); 292 return(-1);
290 } 293 }
291 err = mkdir(tmp, 0777); 294 err = mkdir(tmp, 0777);
@@ -296,7 +299,8 @@ static int __init make_umid(int (*printer)(const char *fmt, ...))
296 return(-1); 299 return(-1);
297 } 300 }
298 301
299 return(0); 302 umid_owned = 1;
303 return 0;
300} 304}
301 305
302__uml_setup("uml_dir=", set_uml_dir, 306__uml_setup("uml_dir=", set_uml_dir,
@@ -309,7 +313,8 @@ static int __init make_umid_setup(void)
309 /* one function with the ordering we need ... */ 313 /* one function with the ordering we need ... */
310 make_uml_dir(); 314 make_uml_dir();
311 make_umid(printf); 315 make_umid(printf);
312 return create_pid_file(); 316 create_pid_file();
317 return 0;
313} 318}
314__uml_postsetup(make_umid_setup); 319__uml_postsetup(make_umid_setup);
315 320
diff --git a/arch/um/kernel/user_util.c b/arch/um/kernel/user_util.c
index a25f3ea11fd7..41d17c71511c 100644
--- a/arch/um/kernel/user_util.c
+++ b/arch/um/kernel/user_util.c
@@ -128,6 +128,12 @@ void setup_machinename(char *machine_out)
128 struct utsname host; 128 struct utsname host;
129 129
130 uname(&host); 130 uname(&host);
131#if defined(UML_CONFIG_UML_X86) && !defined(UML_CONFIG_64BIT)
132 if (!strcmp(host.machine, "x86_64")) {
133 strcpy(machine_out, "i686");
134 return;
135 }
136#endif
131 strcpy(machine_out, host.machine); 137 strcpy(machine_out, host.machine);
132} 138}
133 139
diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c
index 298d5632128b..f6e64026f995 100644
--- a/arch/um/os-Linux/aio.c
+++ b/arch/um/os-Linux/aio.c
@@ -144,6 +144,7 @@ static int aio_thread(void *arg)
144 "errno = %d\n", errno); 144 "errno = %d\n", errno);
145 } 145 }
146 else { 146 else {
147 /* This is safe as we've just a pointer here. */
147 aio = (struct aio_context *) (long) event.data; 148 aio = (struct aio_context *) (long) event.data;
148 if(update_aio(aio, event.res)){ 149 if(update_aio(aio, event.res)){
149 do_aio(ctx, aio); 150 do_aio(ctx, aio);
diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c
index e770cb029578..ab33cb3c74ec 100644
--- a/arch/um/os-Linux/elf_aux.c
+++ b/arch/um/os-Linux/elf_aux.c
@@ -14,7 +14,8 @@
14#include "mem_user.h" 14#include "mem_user.h"
15#include <kernel-offsets.h> 15#include <kernel-offsets.h>
16 16
17#if HOST_ELF_CLASS == ELFCLASS32 17/* Use the one from the kernel - the host may miss it, if having old headers. */
18#if UM_ELF_CLASS == UM_ELFCLASS32
18typedef Elf32_auxv_t elf_auxv_t; 19typedef Elf32_auxv_t elf_auxv_t;
19#else 20#else
20typedef Elf64_auxv_t elf_auxv_t; 21typedef Elf64_auxv_t elf_auxv_t;
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index d32413e4b4ce..d9c52387c4a1 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -3,6 +3,7 @@
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include <unistd.h>
6#include <stdio.h> 7#include <stdio.h>
7#include <errno.h> 8#include <errno.h>
8#include <signal.h> 9#include <signal.h>
diff --git a/arch/um/sys-i386/ldt.c b/arch/um/sys-i386/ldt.c
index bd3c34aa52e5..36b5c2c13289 100644
--- a/arch/um/sys-i386/ldt.c
+++ b/arch/um/sys-i386/ldt.c
@@ -83,6 +83,7 @@ int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount)
83 goto out; 83 goto out;
84 } 84 }
85 p = buf; 85 p = buf;
86 break;
86 default: 87 default:
87 res = -ENOSYS; 88 res = -ENOSYS;
88 goto out; 89 goto out;
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 0969d570f3b5..21afa69a086d 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -308,7 +308,7 @@ config HPET_TIMER
308 present. The HPET provides a stable time base on SMP 308 present. The HPET provides a stable time base on SMP
309 systems, unlike the TSC, but it is more expensive to access, 309 systems, unlike the TSC, but it is more expensive to access,
310 as it is off-chip. You can find the HPET spec at 310 as it is off-chip. You can find the HPET spec at
311 <http://www.intel.com/labs/platcomp/hpet/hpetspec.htm>. 311 <http://www.intel.com/hardwaredesign/hpetspec.htm>.
312 312
313config X86_PM_TIMER 313config X86_PM_TIMER
314 bool "PM timer" 314 bool "PM timer"
diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c
index 09887c96e9a1..de19501aa809 100644
--- a/arch/xtensa/kernel/pci.c
+++ b/arch/xtensa/kernel/pci.c
@@ -402,8 +402,8 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
402 __pci_mmap_set_flags(dev, vma, mmap_state); 402 __pci_mmap_set_flags(dev, vma, mmap_state);
403 __pci_mmap_set_pgprot(dev, vma, mmap_state, write_combine); 403 __pci_mmap_set_pgprot(dev, vma, mmap_state, write_combine);
404 404
405 ret = io_remap_page_range(vma, vma->vm_start, vma->vm_pgoff<<PAGE_SHIFT, 405 ret = io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
406 vma->vm_end - vma->vm_start, vma->vm_page_prot); 406 vma->vm_end - vma->vm_start,vma->vm_page_prot);
407 407
408 return ret; 408 return ret;
409} 409}
diff --git a/arch/xtensa/kernel/platform.c b/arch/xtensa/kernel/platform.c
index cf1362784443..03674daabc66 100644
--- a/arch/xtensa/kernel/platform.c
+++ b/arch/xtensa/kernel/platform.c
@@ -39,7 +39,7 @@ _F(int, pcibios_fixup, (void), { return 0; });
39_F(int, get_rtc_time, (time_t* t), { return 0; }); 39_F(int, get_rtc_time, (time_t* t), { return 0; });
40_F(int, set_rtc_time, (time_t t), { return 0; }); 40_F(int, set_rtc_time, (time_t t), { return 0; });
41 41
42#if CONFIG_XTENSA_CALIBRATE_CCOUNT 42#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
43_F(void, calibrate_ccount, (void), 43_F(void, calibrate_ccount, (void),
44{ 44{
45 printk ("ERROR: Cannot calibrate cpu frequency! Assuming 100MHz.\n"); 45 printk ("ERROR: Cannot calibrate cpu frequency! Assuming 100MHz.\n");
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c
index c83bb0d41787..08ef6d82ee51 100644
--- a/arch/xtensa/kernel/process.c
+++ b/arch/xtensa/kernel/process.c
@@ -457,7 +457,7 @@ int
457dump_task_fpu(struct pt_regs *regs, struct task_struct *task, elf_fpregset_t *r) 457dump_task_fpu(struct pt_regs *regs, struct task_struct *task, elf_fpregset_t *r)
458{ 458{
459/* see asm/coprocessor.h for this magic number 16 */ 459/* see asm/coprocessor.h for this magic number 16 */
460#if TOTAL_CPEXTRA_SIZE > 16 460#if XTENSA_CP_EXTRA_SIZE > 16
461 do_save_fpregs (r, regs, task); 461 do_save_fpregs (r, regs, task);
462 462
463 /* For now, bit 16 means some extra state may be present: */ 463 /* For now, bit 16 means some extra state may be present: */
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
index 1f5bf5d624e4..513ed8d67766 100644
--- a/arch/xtensa/kernel/setup.c
+++ b/arch/xtensa/kernel/setup.c
@@ -304,7 +304,7 @@ void __init setup_arch(char **cmdline_p)
304# endif 304# endif
305#endif 305#endif
306 306
307#if CONFIG_PCI 307#ifdef CONFIG_PCI
308 platform_pcibios_init(); 308 platform_pcibios_init();
309#endif 309#endif
310} 310}
diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c
index dc42cede9394..e252b61e45a5 100644
--- a/arch/xtensa/kernel/signal.c
+++ b/arch/xtensa/kernel/signal.c
@@ -182,7 +182,7 @@ restore_cpextra (struct _cpstate *buf)
182 182
183 struct task_struct *tsk = current; 183 struct task_struct *tsk = current;
184 release_all_cp(tsk); 184 release_all_cp(tsk);
185 return __copy_from_user(tsk->thread.cpextra, buf, TOTAL_CPEXTRA_SIZE); 185 return __copy_from_user(tsk->thread.cpextra, buf, XTENSA_CP_EXTRA_SIZE);
186#endif 186#endif
187 return 0; 187 return 0;
188} 188}
diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c
index 1ac7d5ce7456..8e423d1335ce 100644
--- a/arch/xtensa/kernel/time.c
+++ b/arch/xtensa/kernel/time.c
@@ -68,7 +68,7 @@ void __init time_init(void)
68 * speed for the CALIBRATE. 68 * speed for the CALIBRATE.
69 */ 69 */
70 70
71#if CONFIG_XTENSA_CALIBRATE_CCOUNT 71#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
72 printk("Calibrating CPU frequency "); 72 printk("Calibrating CPU frequency ");
73 platform_calibrate_ccount(); 73 platform_calibrate_ccount();
74 printk("%d.%02d MHz\n", (int)ccount_per_jiffy/(1000000/HZ), 74 printk("%d.%02d MHz\n", (int)ccount_per_jiffy/(1000000/HZ),
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
index 56aace84aaeb..5a91d6c9e66d 100644
--- a/arch/xtensa/mm/init.c
+++ b/arch/xtensa/mm/init.c
@@ -239,7 +239,7 @@ void __init mem_init(void)
239 high_memory = (void *) __va(max_mapnr << PAGE_SHIFT); 239 high_memory = (void *) __va(max_mapnr << PAGE_SHIFT);
240 highmemsize = 0; 240 highmemsize = 0;
241 241
242#if CONFIG_HIGHMEM 242#ifdef CONFIG_HIGHMEM
243#error HIGHGMEM not implemented in init.c 243#error HIGHGMEM not implemented in init.c
244#endif 244#endif
245 245