aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/alpha_ksyms.c1
-rw-r--r--arch/alpha/kernel/process.c6
-rw-r--r--arch/alpha/kernel/smp.c14
-rw-r--r--arch/alpha/kernel/sys_titan.c2
-rw-r--r--arch/arm/Kconfig.debug2
-rw-r--r--arch/arm/mach-ixp23xx/core.c18
-rw-r--r--arch/arm/mach-ixp4xx/Kconfig2
-rw-r--r--arch/arm/mach-pxa/mainstone.c1
-rw-r--r--arch/arm/mach-s3c2410/Kconfig2
-rw-r--r--arch/arm/mm/mm-armv.c4
-rw-r--r--arch/arm/mm/proc-xsc3.S3
-rw-r--r--arch/i386/kernel/acpi/boot.c8
-rw-r--r--arch/i386/kernel/syscall_table.S1
-rw-r--r--arch/i386/mach-generic/probe.c16
-rw-r--r--arch/mips/Kconfig96
-rw-r--r--arch/mips/au1000/common/irq.c1
-rw-r--r--arch/mips/au1000/common/prom.c24
-rw-r--r--arch/mips/au1000/common/sleeper.S5
-rw-r--r--arch/mips/au1000/common/time.c1
-rw-r--r--arch/mips/ddb5xxx/ddb5476/dbg_io.c2
-rw-r--r--arch/mips/ddb5xxx/ddb5477/kgdb_io.c2
-rw-r--r--arch/mips/gt64120/ev64120/serialGT.c2
-rw-r--r--arch/mips/gt64120/momenco_ocelot/dbg_io.c2
-rw-r--r--arch/mips/ite-boards/generic/dbg_io.c2
-rw-r--r--arch/mips/kernel/asm-offsets.c4
-rw-r--r--arch/mips/kernel/cpu-bugs64.c8
-rw-r--r--arch/mips/kernel/cpu-probe.c15
-rw-r--r--arch/mips/kernel/entry.S2
-rw-r--r--arch/mips/kernel/gdb-low.S8
-rw-r--r--arch/mips/kernel/module.c6
-rw-r--r--arch/mips/kernel/proc.c2
-rw-r--r--arch/mips/kernel/scall64-o32.S2
-rw-r--r--arch/mips/kernel/setup.c18
-rw-r--r--arch/mips/kernel/signal-common.h30
-rw-r--r--arch/mips/kernel/smp.c5
-rw-r--r--arch/mips/kernel/syscall.c27
-rw-r--r--arch/mips/kernel/traps.c20
-rw-r--r--arch/mips/kernel/vmlinux.lds.S20
-rw-r--r--arch/mips/math-emu/dp_fint.c4
-rw-r--r--arch/mips/math-emu/dp_flong.c4
-rw-r--r--arch/mips/math-emu/sp_fint.c4
-rw-r--r--arch/mips/math-emu/sp_flong.c4
-rw-r--r--arch/mips/mm/c-r4k.c78
-rw-r--r--arch/mips/mm/init.c2
-rw-r--r--arch/mips/mm/pg-r4k.c1
-rw-r--r--arch/mips/mm/tlbex.c2
-rw-r--r--arch/mips/momentum/jaguar_atx/dbg_io.c2
-rw-r--r--arch/mips/momentum/ocelot_c/dbg_io.c2
-rw-r--r--arch/mips/momentum/ocelot_g/dbg_io.c2
-rw-r--r--arch/mips/oprofile/common.c9
-rw-r--r--arch/mips/oprofile/op_model_mipsxx.c34
-rw-r--r--arch/mips/oprofile/op_model_rm9000.c2
-rw-r--r--arch/mips/sgi-ip32/ip32-irq.c4
-rw-r--r--arch/powerpc/kernel/prom_init.c48
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c12
-rw-r--r--arch/powerpc/platforms/powermac/pfunc_core.c18
-rw-r--r--arch/powerpc/platforms/powermac/setup.c12
-rw-r--r--arch/ppc/kernel/asm-offsets.c2
-rw-r--r--arch/ppc/platforms/mpc8272ads_setup.c10
-rw-r--r--arch/ppc/syslib/pq2_devices.c16
-rw-r--r--arch/ppc/syslib/pq2_sys.c8
-rw-r--r--arch/s390/kernel/time.c2
-rw-r--r--arch/sparc64/kernel/head.S30
-rw-r--r--arch/sparc64/kernel/setup.c23
-rw-r--r--arch/sparc64/kernel/smp.c16
-rw-r--r--arch/sparc64/lib/checksum.S5
-rw-r--r--arch/sparc64/lib/csum_copy.S5
-rw-r--r--arch/um/Makefile-i3864
-rw-r--r--arch/um/include/kern_util.h13
-rw-r--r--arch/um/kernel/time_kern.c10
-rw-r--r--arch/um/os-Linux/main.c2
-rw-r--r--arch/um/os-Linux/time.c10
-rw-r--r--arch/um/sys-i386/syscalls.c9
-rw-r--r--arch/um/sys-x86_64/signal.c24
-rw-r--r--arch/um/sys-x86_64/syscalls.c2
-rw-r--r--arch/x86_64/ia32/ia32_binfmt.c4
-rw-r--r--arch/x86_64/kernel/e820.c2
-rw-r--r--arch/x86_64/kernel/entry.S7
-rw-r--r--arch/x86_64/kernel/pci-dma.c4
-rw-r--r--arch/x86_64/kernel/pci-gart.c6
-rw-r--r--arch/x86_64/kernel/pmtimer.c2
-rw-r--r--arch/x86_64/kernel/setup.c2
-rw-r--r--arch/x86_64/mm/srat.c4
83 files changed, 500 insertions, 350 deletions
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
index c645c5e14786..2b245ad731ee 100644
--- a/arch/alpha/kernel/alpha_ksyms.c
+++ b/arch/alpha/kernel/alpha_ksyms.c
@@ -182,7 +182,6 @@ EXPORT_SYMBOL(smp_num_cpus);
182EXPORT_SYMBOL(smp_call_function); 182EXPORT_SYMBOL(smp_call_function);
183EXPORT_SYMBOL(smp_call_function_on_cpu); 183EXPORT_SYMBOL(smp_call_function_on_cpu);
184EXPORT_SYMBOL(_atomic_dec_and_lock); 184EXPORT_SYMBOL(_atomic_dec_and_lock);
185EXPORT_SYMBOL(cpu_present_mask);
186#endif /* CONFIG_SMP */ 185#endif /* CONFIG_SMP */
187 186
188/* 187/*
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 9924fd07743a..c760a831fd1a 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -94,7 +94,7 @@ common_shutdown_1(void *generic_ptr)
94 if (cpuid != boot_cpuid) { 94 if (cpuid != boot_cpuid) {
95 flags |= 0x00040000UL; /* "remain halted" */ 95 flags |= 0x00040000UL; /* "remain halted" */
96 *pflags = flags; 96 *pflags = flags;
97 clear_bit(cpuid, &cpu_present_mask); 97 cpu_clear(cpuid, cpu_present_map);
98 halt(); 98 halt();
99 } 99 }
100#endif 100#endif
@@ -120,8 +120,8 @@ common_shutdown_1(void *generic_ptr)
120 120
121#ifdef CONFIG_SMP 121#ifdef CONFIG_SMP
122 /* Wait for the secondaries to halt. */ 122 /* Wait for the secondaries to halt. */
123 cpu_clear(boot_cpuid, cpu_possible_map); 123 cpu_clear(boot_cpuid, cpu_present_map);
124 while (cpus_weight(cpu_possible_map)) 124 while (cpus_weight(cpu_present_map))
125 barrier(); 125 barrier();
126#endif 126#endif
127 127
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 185255416e85..4dc273e537fd 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -68,7 +68,6 @@ enum ipi_message_type {
68static int smp_secondary_alive __initdata = 0; 68static int smp_secondary_alive __initdata = 0;
69 69
70/* Which cpus ids came online. */ 70/* Which cpus ids came online. */
71cpumask_t cpu_present_mask;
72cpumask_t cpu_online_map; 71cpumask_t cpu_online_map;
73 72
74EXPORT_SYMBOL(cpu_online_map); 73EXPORT_SYMBOL(cpu_online_map);
@@ -439,7 +438,7 @@ setup_smp(void)
439 if ((cpu->flags & 0x1cc) == 0x1cc) { 438 if ((cpu->flags & 0x1cc) == 0x1cc) {
440 smp_num_probed++; 439 smp_num_probed++;
441 /* Assume here that "whami" == index */ 440 /* Assume here that "whami" == index */
442 cpu_set(i, cpu_present_mask); 441 cpu_set(i, cpu_present_map);
443 cpu->pal_revision = boot_cpu_palrev; 442 cpu->pal_revision = boot_cpu_palrev;
444 } 443 }
445 444
@@ -450,11 +449,10 @@ setup_smp(void)
450 } 449 }
451 } else { 450 } else {
452 smp_num_probed = 1; 451 smp_num_probed = 1;
453 cpu_set(boot_cpuid, cpu_present_mask);
454 } 452 }
455 453
456 printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", 454 printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_map = %lx\n",
457 smp_num_probed, cpu_possible_map.bits[0]); 455 smp_num_probed, cpu_present_map.bits[0]);
458} 456}
459 457
460/* 458/*
@@ -473,7 +471,7 @@ smp_prepare_cpus(unsigned int max_cpus)
473 471
474 /* Nothing to do on a UP box, or when told not to. */ 472 /* Nothing to do on a UP box, or when told not to. */
475 if (smp_num_probed == 1 || max_cpus == 0) { 473 if (smp_num_probed == 1 || max_cpus == 0) {
476 cpu_present_mask = cpumask_of_cpu(boot_cpuid); 474 cpu_present_map = cpumask_of_cpu(boot_cpuid);
477 printk(KERN_INFO "SMP mode deactivated.\n"); 475 printk(KERN_INFO "SMP mode deactivated.\n");
478 return; 476 return;
479 } 477 }
@@ -486,10 +484,6 @@ smp_prepare_cpus(unsigned int max_cpus)
486void __devinit 484void __devinit
487smp_prepare_boot_cpu(void) 485smp_prepare_boot_cpu(void)
488{ 486{
489 /*
490 * Mark the boot cpu (current cpu) as online
491 */
492 cpu_set(smp_processor_id(), cpu_online_map);
493} 487}
494 488
495int __devinit 489int __devinit
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c
index 5f84417eeb7b..2551fb49ae09 100644
--- a/arch/alpha/kernel/sys_titan.c
+++ b/arch/alpha/kernel/sys_titan.c
@@ -66,7 +66,7 @@ titan_update_irq_hw(unsigned long mask)
66 register int bcpu = boot_cpuid; 66 register int bcpu = boot_cpuid;
67 67
68#ifdef CONFIG_SMP 68#ifdef CONFIG_SMP
69 cpumask_t cpm = cpu_present_mask; 69 cpumask_t cpm = cpu_present_map;
70 volatile unsigned long *dim0, *dim1, *dim2, *dim3; 70 volatile unsigned long *dim0, *dim1, *dim2, *dim3;
71 unsigned long mask0, mask1, mask2, mask3, dummy; 71 unsigned long mask0, mask1, mask2, mask3, dummy;
72 72
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 5d3acff8c596..d22f38b957db 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -101,7 +101,7 @@ config DEBUG_S3C2410_UART
101 help 101 help
102 Choice for UART for kernel low-level using S3C2410 UARTS, 102 Choice for UART for kernel low-level using S3C2410 UARTS,
103 should be between zero and two. The port must have been 103 should be between zero and two. The port must have been
104 initalised by the boot-loader before use. 104 initialised by the boot-loader before use.
105 105
106 The uncompressor code port configuration is now handled 106 The uncompressor code port configuration is now handled
107 by CONFIG_S3C2410_LOWLEVEL_UART_PORT. 107 by CONFIG_S3C2410_LOWLEVEL_UART_PORT.
diff --git a/arch/arm/mach-ixp23xx/core.c b/arch/arm/mach-ixp23xx/core.c
index 092ee12ced42..affd1d5d7440 100644
--- a/arch/arm/mach-ixp23xx/core.c
+++ b/arch/arm/mach-ixp23xx/core.c
@@ -178,8 +178,12 @@ static int ixp23xx_irq_set_type(unsigned int irq, unsigned int type)
178 178
179static void ixp23xx_irq_mask(unsigned int irq) 179static void ixp23xx_irq_mask(unsigned int irq)
180{ 180{
181 volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32); 181 volatile unsigned long *intr_reg;
182 182
183 if (irq >= 56)
184 irq += 8;
185
186 intr_reg = IXP23XX_INTR_EN1 + (irq / 32);
183 *intr_reg &= ~(1 << (irq % 32)); 187 *intr_reg &= ~(1 << (irq % 32));
184} 188}
185 189
@@ -199,17 +203,25 @@ static void ixp23xx_irq_ack(unsigned int irq)
199 */ 203 */
200static void ixp23xx_irq_level_unmask(unsigned int irq) 204static void ixp23xx_irq_level_unmask(unsigned int irq)
201{ 205{
202 volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32); 206 volatile unsigned long *intr_reg;
203 207
204 ixp23xx_irq_ack(irq); 208 ixp23xx_irq_ack(irq);
205 209
210 if (irq >= 56)
211 irq += 8;
212
213 intr_reg = IXP23XX_INTR_EN1 + (irq / 32);
206 *intr_reg |= (1 << (irq % 32)); 214 *intr_reg |= (1 << (irq % 32));
207} 215}
208 216
209static void ixp23xx_irq_edge_unmask(unsigned int irq) 217static void ixp23xx_irq_edge_unmask(unsigned int irq)
210{ 218{
211 volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32); 219 volatile unsigned long *intr_reg;
220
221 if (irq >= 56)
222 irq += 8;
212 223
224 intr_reg = IXP23XX_INTR_EN1 + (irq / 32);
213 *intr_reg |= (1 << (irq % 32)); 225 *intr_reg |= (1 << (irq % 32));
214} 226}
215 227
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
index 2a39f9e481ad..3b23f43cb160 100644
--- a/arch/arm/mach-ixp4xx/Kconfig
+++ b/arch/arm/mach-ixp4xx/Kconfig
@@ -141,7 +141,7 @@ config IXP4XX_INDIRECT_PCI
141 2) If > 64MB of memory space is required, the IXP4xx can be 141 2) If > 64MB of memory space is required, the IXP4xx can be
142 configured to use indirect registers to access PCI This allows 142 configured to use indirect registers to access PCI This allows
143 for up to 128MB (0x48000000 to 0x4fffffff) of memory on the bus. 143 for up to 128MB (0x48000000 to 0x4fffffff) of memory on the bus.
144 The disadvantadge of this is that every PCI access requires 144 The disadvantage of this is that every PCI access requires
145 three local register accesses plus a spinlock, but in some 145 three local register accesses plus a spinlock, but in some
146 cases the performance hit is acceptable. In addition, you cannot 146 cases the performance hit is acceptable. In addition, you cannot
147 mmap() PCI devices in this case due to the indirect nature 147 mmap() PCI devices in this case due to the indirect nature
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 02e188d98e7d..b307f11951df 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -493,6 +493,7 @@ static void __init mainstone_map_io(void)
493MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") 493MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
494 /* Maintainer: MontaVista Software Inc. */ 494 /* Maintainer: MontaVista Software Inc. */
495 .phys_io = 0x40000000, 495 .phys_io = 0x40000000,
496 .boot_params = 0xa0000100, /* BLOB boot parameter setting */
496 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 497 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
497 .map_io = mainstone_map_io, 498 .map_io = mainstone_map_io,
498 .init_irq = mainstone_init_irq, 499 .init_irq = mainstone_init_irq,
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index ce7d81000695..970f98dadffc 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -170,7 +170,7 @@ config S3C2410_PM_DEBUG
170 depends on ARCH_S3C2410 && PM 170 depends on ARCH_S3C2410 && PM
171 help 171 help
172 Say Y here if you want verbose debugging from the PM Suspend and 172 Say Y here if you want verbose debugging from the PM Suspend and
173 Resume code. See `Documentation/arm/Samsing-S3C24XX/Suspend.txt` 173 Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
174 for more information. 174 for more information.
175 175
176config S3C2410_PM_CHECK 176config S3C2410_PM_CHECK
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
index f14b2d0f3690..95273de4f772 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -376,7 +376,7 @@ void __init build_mem_type_table(void)
376 ecc_mask = 0; 376 ecc_mask = 0;
377 } 377 }
378 378
379 if (cpu_arch <= CPU_ARCH_ARMv5TEJ) { 379 if (cpu_arch <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) {
380 for (i = 0; i < ARRAY_SIZE(mem_types); i++) { 380 for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
381 if (mem_types[i].prot_l1) 381 if (mem_types[i].prot_l1)
382 mem_types[i].prot_l1 |= PMD_BIT4; 382 mem_types[i].prot_l1 |= PMD_BIT4;
@@ -631,7 +631,7 @@ void setup_mm_for_reboot(char mode)
631 pgd = init_mm.pgd; 631 pgd = init_mm.pgd;
632 632
633 base_pmdval = PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT; 633 base_pmdval = PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT;
634 if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ) 634 if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale())
635 base_pmdval |= PMD_BIT4; 635 base_pmdval |= PMD_BIT4;
636 636
637 for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++, pgd++) { 637 for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++, pgd++) {
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S
index 80873b36c3f7..8d32e21fe151 100644
--- a/arch/arm/mm/proc-xsc3.S
+++ b/arch/arm/mm/proc-xsc3.S
@@ -427,12 +427,13 @@ __xsc3_setup:
427#endif 427#endif
428 mcr p15, 0, r0, c1, c0, 1 @ set auxiliary control reg 428 mcr p15, 0, r0, c1, c0, 1 @ set auxiliary control reg
429 mrc p15, 0, r0, c1, c0, 0 @ get control register 429 mrc p15, 0, r0, c1, c0, 0 @ get control register
430 bic r0, r0, #0x0200 @ .... ..R. .... ....
431 bic r0, r0, #0x0002 @ .... .... .... ..A. 430 bic r0, r0, #0x0002 @ .... .... .... ..A.
432 orr r0, r0, #0x0005 @ .... .... .... .C.M 431 orr r0, r0, #0x0005 @ .... .... .... .C.M
433#if BTB_ENABLE 432#if BTB_ENABLE
433 bic r0, r0, #0x0200 @ .... ..R. .... ....
434 orr r0, r0, #0x3900 @ ..VI Z..S .... .... 434 orr r0, r0, #0x3900 @ ..VI Z..S .... ....
435#else 435#else
436 bic r0, r0, #0x0a00 @ .... Z.R. .... ....
436 orr r0, r0, #0x3100 @ ..VI ...S .... .... 437 orr r0, r0, #0x3100 @ ..VI ...S .... ....
437#endif 438#endif
438#if L2_CACHE_ENABLE 439#if L2_CACHE_ENABLE
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index daee69579b1c..40e5aba3ad3d 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -1066,14 +1066,6 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
1066 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), 1066 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
1067 }, 1067 },
1068 }, 1068 },
1069 {
1070 .callback = disable_acpi_pci,
1071 .ident = "HP xw9300",
1072 .matches = {
1073 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1074 DMI_MATCH(DMI_PRODUCT_NAME, "HP xw9300 Workstation"),
1075 },
1076 },
1077 {} 1069 {}
1078}; 1070};
1079 1071
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
index f48bef15b4f0..af56987f69b0 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -315,3 +315,4 @@ ENTRY(sys_call_table)
315 .long sys_splice 315 .long sys_splice
316 .long sys_sync_file_range 316 .long sys_sync_file_range
317 .long sys_tee /* 315 */ 317 .long sys_tee /* 315 */
318 .long sys_vmsplice
diff --git a/arch/i386/mach-generic/probe.c b/arch/i386/mach-generic/probe.c
index cea5b3ce4b57..d55fa7b187ab 100644
--- a/arch/i386/mach-generic/probe.c
+++ b/arch/i386/mach-generic/probe.c
@@ -93,9 +93,11 @@ int __init mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid
93 int i; 93 int i;
94 for (i = 0; apic_probe[i]; ++i) { 94 for (i = 0; apic_probe[i]; ++i) {
95 if (apic_probe[i]->mps_oem_check(mpc,oem,productid)) { 95 if (apic_probe[i]->mps_oem_check(mpc,oem,productid)) {
96 genapic = apic_probe[i]; 96 if (!cmdline_apic) {
97 printk(KERN_INFO "Switched to APIC driver `%s'.\n", 97 genapic = apic_probe[i];
98 genapic->name); 98 printk(KERN_INFO "Switched to APIC driver `%s'.\n",
99 genapic->name);
100 }
99 return 1; 101 return 1;
100 } 102 }
101 } 103 }
@@ -107,9 +109,11 @@ int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
107 int i; 109 int i;
108 for (i = 0; apic_probe[i]; ++i) { 110 for (i = 0; apic_probe[i]; ++i) {
109 if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) { 111 if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) {
110 genapic = apic_probe[i]; 112 if (!cmdline_apic) {
111 printk(KERN_INFO "Switched to APIC driver `%s'.\n", 113 genapic = apic_probe[i];
112 genapic->name); 114 printk(KERN_INFO "Switched to APIC driver `%s'.\n",
115 genapic->name);
116 }
113 return 1; 117 return 1;
114 } 118 }
115 } 119 }
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index ee5fbb02b28f..e8ff09fe73d9 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -13,7 +13,7 @@ choice
13 default SGI_IP22 13 default SGI_IP22
14 14
15config MIPS_MTX1 15config MIPS_MTX1
16 bool "Support for 4G Systems MTX-1 board" 16 bool "4G Systems MTX-1 board"
17 select DMA_NONCOHERENT 17 select DMA_NONCOHERENT
18 select HW_HAS_PCI 18 select HW_HAS_PCI
19 select SOC_AU1500 19 select SOC_AU1500
@@ -120,7 +120,7 @@ config MIPS_MIRAGE
120 select SYS_SUPPORTS_LITTLE_ENDIAN 120 select SYS_SUPPORTS_LITTLE_ENDIAN
121 121
122config MIPS_COBALT 122config MIPS_COBALT
123 bool "Support for Cobalt Server" 123 bool "Cobalt Server"
124 select DMA_NONCOHERENT 124 select DMA_NONCOHERENT
125 select HW_HAS_PCI 125 select HW_HAS_PCI
126 select I8259 126 select I8259
@@ -132,7 +132,7 @@ config MIPS_COBALT
132 select SYS_SUPPORTS_LITTLE_ENDIAN 132 select SYS_SUPPORTS_LITTLE_ENDIAN
133 133
134config MACH_DECSTATION 134config MACH_DECSTATION
135 bool "Support for DECstations" 135 bool "DECstations"
136 select BOOT_ELF32 136 select BOOT_ELF32
137 select DMA_NONCOHERENT 137 select DMA_NONCOHERENT
138 select EARLY_PRINTK 138 select EARLY_PRINTK
@@ -158,7 +158,7 @@ config MACH_DECSTATION
158 otherwise choose R3000. 158 otherwise choose R3000.
159 159
160config MIPS_EV64120 160config MIPS_EV64120
161 bool "Support for Galileo EV64120 Evaluation board (EXPERIMENTAL)" 161 bool "Galileo EV64120 Evaluation board (EXPERIMENTAL)"
162 depends on EXPERIMENTAL 162 depends on EXPERIMENTAL
163 select DMA_NONCOHERENT 163 select DMA_NONCOHERENT
164 select HW_HAS_PCI 164 select HW_HAS_PCI
@@ -175,7 +175,7 @@ config MIPS_EV64120
175 kernel for this platform. 175 kernel for this platform.
176 176
177config MIPS_EV96100 177config MIPS_EV96100
178 bool "Support for Galileo EV96100 Evaluation board (EXPERIMENTAL)" 178 bool "Galileo EV96100 Evaluation board (EXPERIMENTAL)"
179 depends on EXPERIMENTAL 179 depends on EXPERIMENTAL
180 select DMA_NONCOHERENT 180 select DMA_NONCOHERENT
181 select HW_HAS_PCI 181 select HW_HAS_PCI
@@ -195,7 +195,7 @@ config MIPS_EV96100
195 here if you wish to build a kernel for this platform. 195 here if you wish to build a kernel for this platform.
196 196
197config MIPS_IVR 197config MIPS_IVR
198 bool "Support for Globespan IVR board" 198 bool "Globespan IVR board"
199 select DMA_NONCOHERENT 199 select DMA_NONCOHERENT
200 select HW_HAS_PCI 200 select HW_HAS_PCI
201 select ITE_BOARD_GEN 201 select ITE_BOARD_GEN
@@ -211,7 +211,7 @@ config MIPS_IVR
211 build a kernel for this platform. 211 build a kernel for this platform.
212 212
213config MIPS_ITE8172 213config MIPS_ITE8172
214 bool "Support for ITE 8172G board" 214 bool "ITE 8172G board"
215 select DMA_NONCOHERENT 215 select DMA_NONCOHERENT
216 select HW_HAS_PCI 216 select HW_HAS_PCI
217 select ITE_BOARD_GEN 217 select ITE_BOARD_GEN
@@ -228,7 +228,7 @@ config MIPS_ITE8172
228 a kernel for this platform. 228 a kernel for this platform.
229 229
230config MACH_JAZZ 230config MACH_JAZZ
231 bool "Support for the Jazz family of machines" 231 bool "Jazz family of machines"
232 select ARC 232 select ARC
233 select ARC32 233 select ARC32
234 select ARCH_MAY_HAVE_PC_FDC 234 select ARCH_MAY_HAVE_PC_FDC
@@ -246,7 +246,7 @@ config MACH_JAZZ
246 Olivetti M700-10 workstations. 246 Olivetti M700-10 workstations.
247 247
248config LASAT 248config LASAT
249 bool "Support for LASAT Networks platforms" 249 bool "LASAT Networks platforms"
250 select DMA_NONCOHERENT 250 select DMA_NONCOHERENT
251 select HW_HAS_PCI 251 select HW_HAS_PCI
252 select MIPS_GT64120 252 select MIPS_GT64120
@@ -258,7 +258,7 @@ config LASAT
258 select SYS_SUPPORTS_LITTLE_ENDIAN 258 select SYS_SUPPORTS_LITTLE_ENDIAN
259 259
260config MIPS_ATLAS 260config MIPS_ATLAS
261 bool "Support for MIPS Atlas board" 261 bool "MIPS Atlas board"
262 select BOOT_ELF32 262 select BOOT_ELF32
263 select DMA_NONCOHERENT 263 select DMA_NONCOHERENT
264 select IRQ_CPU 264 select IRQ_CPU
@@ -283,7 +283,7 @@ config MIPS_ATLAS
283 board. 283 board.
284 284
285config MIPS_MALTA 285config MIPS_MALTA
286 bool "Support for MIPS Malta board" 286 bool "MIPS Malta board"
287 select ARCH_MAY_HAVE_PC_FDC 287 select ARCH_MAY_HAVE_PC_FDC
288 select BOOT_ELF32 288 select BOOT_ELF32
289 select HAVE_STD_PC_SERIAL_PORT 289 select HAVE_STD_PC_SERIAL_PORT
@@ -311,7 +311,7 @@ config MIPS_MALTA
311 board. 311 board.
312 312
313config MIPS_SEAD 313config MIPS_SEAD
314 bool "Support for MIPS SEAD board (EXPERIMENTAL)" 314 bool "MIPS SEAD board (EXPERIMENTAL)"
315 depends on EXPERIMENTAL 315 depends on EXPERIMENTAL
316 select IRQ_CPU 316 select IRQ_CPU
317 select DMA_NONCOHERENT 317 select DMA_NONCOHERENT
@@ -328,7 +328,7 @@ config MIPS_SEAD
328 board. 328 board.
329 329
330config MIPS_SIM 330config MIPS_SIM
331 bool 'Support for MIPS simulator (MIPSsim)' 331 bool 'MIPS simulator (MIPSsim)'
332 select DMA_NONCOHERENT 332 select DMA_NONCOHERENT
333 select IRQ_CPU 333 select IRQ_CPU
334 select SYS_HAS_CPU_MIPS32_R1 334 select SYS_HAS_CPU_MIPS32_R1
@@ -341,7 +341,7 @@ config MIPS_SIM
341 emulator. 341 emulator.
342 342
343config MOMENCO_JAGUAR_ATX 343config MOMENCO_JAGUAR_ATX
344 bool "Support for Momentum Jaguar board" 344 bool "Momentum Jaguar board"
345 select BOOT_ELF32 345 select BOOT_ELF32
346 select DMA_NONCOHERENT 346 select DMA_NONCOHERENT
347 select HW_HAS_PCI 347 select HW_HAS_PCI
@@ -361,7 +361,7 @@ config MOMENCO_JAGUAR_ATX
361 Momentum Computer <http://www.momenco.com/>. 361 Momentum Computer <http://www.momenco.com/>.
362 362
363config MOMENCO_OCELOT 363config MOMENCO_OCELOT
364 bool "Support for Momentum Ocelot board" 364 bool "Momentum Ocelot board"
365 select DMA_NONCOHERENT 365 select DMA_NONCOHERENT
366 select HW_HAS_PCI 366 select HW_HAS_PCI
367 select IRQ_CPU 367 select IRQ_CPU
@@ -378,7 +378,7 @@ config MOMENCO_OCELOT
378 Momentum Computer <http://www.momenco.com/>. 378 Momentum Computer <http://www.momenco.com/>.
379 379
380config MOMENCO_OCELOT_3 380config MOMENCO_OCELOT_3
381 bool "Support for Momentum Ocelot-3 board" 381 bool "Momentum Ocelot-3 board"
382 select BOOT_ELF32 382 select BOOT_ELF32
383 select DMA_NONCOHERENT 383 select DMA_NONCOHERENT
384 select HW_HAS_PCI 384 select HW_HAS_PCI
@@ -397,7 +397,7 @@ config MOMENCO_OCELOT_3
397 PMC-Sierra Rm79000 core. 397 PMC-Sierra Rm79000 core.
398 398
399config MOMENCO_OCELOT_C 399config MOMENCO_OCELOT_C
400 bool "Support for Momentum Ocelot-C board" 400 bool "Momentum Ocelot-C board"
401 select DMA_NONCOHERENT 401 select DMA_NONCOHERENT
402 select HW_HAS_PCI 402 select HW_HAS_PCI
403 select IRQ_CPU 403 select IRQ_CPU
@@ -414,7 +414,7 @@ config MOMENCO_OCELOT_C
414 Momentum Computer <http://www.momenco.com/>. 414 Momentum Computer <http://www.momenco.com/>.
415 415
416config MOMENCO_OCELOT_G 416config MOMENCO_OCELOT_G
417 bool "Support for Momentum Ocelot-G board" 417 bool "Momentum Ocelot-G board"
418 select DMA_NONCOHERENT 418 select DMA_NONCOHERENT
419 select HW_HAS_PCI 419 select HW_HAS_PCI
420 select IRQ_CPU 420 select IRQ_CPU
@@ -431,23 +431,23 @@ config MOMENCO_OCELOT_G
431 Momentum Computer <http://www.momenco.com/>. 431 Momentum Computer <http://www.momenco.com/>.
432 432
433config MIPS_XXS1500 433config MIPS_XXS1500
434 bool "Support for MyCable XXS1500 board" 434 bool "MyCable XXS1500 board"
435 select DMA_NONCOHERENT 435 select DMA_NONCOHERENT
436 select SOC_AU1500 436 select SOC_AU1500
437 select SYS_SUPPORTS_LITTLE_ENDIAN 437 select SYS_SUPPORTS_LITTLE_ENDIAN
438 438
439config PNX8550_V2PCI 439config PNX8550_V2PCI
440 bool "Support for Philips PNX8550 based Viper2-PCI board" 440 bool "Philips PNX8550 based Viper2-PCI board"
441 select PNX8550 441 select PNX8550
442 select SYS_SUPPORTS_LITTLE_ENDIAN 442 select SYS_SUPPORTS_LITTLE_ENDIAN
443 443
444config PNX8550_JBS 444config PNX8550_JBS
445 bool "Support for Philips PNX8550 based JBS board" 445 bool "Philips PNX8550 based JBS board"
446 select PNX8550 446 select PNX8550
447 select SYS_SUPPORTS_LITTLE_ENDIAN 447 select SYS_SUPPORTS_LITTLE_ENDIAN
448 448
449config DDB5074 449config DDB5074
450 bool "Support for NEC DDB Vrc-5074 (EXPERIMENTAL)" 450 bool "NEC DDB Vrc-5074 (EXPERIMENTAL)"
451 depends on EXPERIMENTAL 451 depends on EXPERIMENTAL
452 select DDB5XXX_COMMON 452 select DDB5XXX_COMMON
453 select DMA_NONCOHERENT 453 select DMA_NONCOHERENT
@@ -465,7 +465,7 @@ config DDB5074
465 evaluation board. 465 evaluation board.
466 466
467config DDB5476 467config DDB5476
468 bool "Support for NEC DDB Vrc-5476" 468 bool "NEC DDB Vrc-5476"
469 select DDB5XXX_COMMON 469 select DDB5XXX_COMMON
470 select DMA_NONCOHERENT 470 select DMA_NONCOHERENT
471 select HAVE_STD_PC_SERIAL_PORT 471 select HAVE_STD_PC_SERIAL_PORT
@@ -486,7 +486,7 @@ config DDB5476
486 IDE controller, PS2 keyboard, PS2 mouse, etc. 486 IDE controller, PS2 keyboard, PS2 mouse, etc.
487 487
488config DDB5477 488config DDB5477
489 bool "Support for NEC DDB Vrc-5477" 489 bool "NEC DDB Vrc-5477"
490 select DDB5XXX_COMMON 490 select DDB5XXX_COMMON
491 select DMA_NONCOHERENT 491 select DMA_NONCOHERENT
492 select HW_HAS_PCI 492 select HW_HAS_PCI
@@ -504,13 +504,13 @@ config DDB5477
504 ether port USB, AC97, PCI, etc. 504 ether port USB, AC97, PCI, etc.
505 505
506config MACH_VR41XX 506config MACH_VR41XX
507 bool "Support for NEC VR4100 series based machines" 507 bool "NEC VR41XX-based machines"
508 select SYS_HAS_CPU_VR41XX 508 select SYS_HAS_CPU_VR41XX
509 select SYS_SUPPORTS_32BIT_KERNEL 509 select SYS_SUPPORTS_32BIT_KERNEL
510 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL 510 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
511 511
512config PMC_YOSEMITE 512config PMC_YOSEMITE
513 bool "Support for PMC-Sierra Yosemite eval board" 513 bool "PMC-Sierra Yosemite eval board"
514 select DMA_COHERENT 514 select DMA_COHERENT
515 select HW_HAS_PCI 515 select HW_HAS_PCI
516 select IRQ_CPU 516 select IRQ_CPU
@@ -527,7 +527,7 @@ config PMC_YOSEMITE
527 manufactured by PMC-Sierra. 527 manufactured by PMC-Sierra.
528 528
529config QEMU 529config QEMU
530 bool "Support for Qemu" 530 bool "Qemu"
531 select DMA_COHERENT 531 select DMA_COHERENT
532 select GENERIC_ISA_DMA 532 select GENERIC_ISA_DMA
533 select HAVE_STD_PC_SERIAL_PORT 533 select HAVE_STD_PC_SERIAL_PORT
@@ -547,7 +547,7 @@ config QEMU
547 can be found at http://www.linux-mips.org/wiki/Qemu. 547 can be found at http://www.linux-mips.org/wiki/Qemu.
548 548
549config SGI_IP22 549config SGI_IP22
550 bool "Support for SGI IP22 (Indy/Indigo2)" 550 bool "SGI IP22 (Indy/Indigo2)"
551 select ARC 551 select ARC
552 select ARC32 552 select ARC32
553 select BOOT_ELF32 553 select BOOT_ELF32
@@ -567,7 +567,7 @@ config SGI_IP22
567 that runs on these, say Y here. 567 that runs on these, say Y here.
568 568
569config SGI_IP27 569config SGI_IP27
570 bool "Support for SGI IP27 (Origin200/2000)" 570 bool "SGI IP27 (Origin200/2000)"
571 select ARC 571 select ARC
572 select ARC64 572 select ARC64
573 select BOOT_ELF64 573 select BOOT_ELF64
@@ -583,7 +583,7 @@ config SGI_IP27
583 here. 583 here.
584 584
585config SGI_IP32 585config SGI_IP32
586 bool "Support for SGI IP32 (O2) (EXPERIMENTAL)" 586 bool "SGI IP32 (O2) (EXPERIMENTAL)"
587 depends on EXPERIMENTAL 587 depends on EXPERIMENTAL
588 select ARC 588 select ARC
589 select ARC32 589 select ARC32
@@ -604,7 +604,7 @@ config SGI_IP32
604 If you want this kernel to run on SGI O2 workstation, say Y here. 604 If you want this kernel to run on SGI O2 workstation, say Y here.
605 605
606config SIBYTE_BIGSUR 606config SIBYTE_BIGSUR
607 bool "Support for Sibyte BCM91480B-BigSur" 607 bool "Sibyte BCM91480B-BigSur"
608 select BOOT_ELF32 608 select BOOT_ELF32
609 select DMA_COHERENT 609 select DMA_COHERENT
610 select PCI_DOMAINS 610 select PCI_DOMAINS
@@ -615,7 +615,7 @@ config SIBYTE_BIGSUR
615 select SYS_SUPPORTS_LITTLE_ENDIAN 615 select SYS_SUPPORTS_LITTLE_ENDIAN
616 616
617config SIBYTE_SWARM 617config SIBYTE_SWARM
618 bool "Support for Sibyte BCM91250A-SWARM" 618 bool "Sibyte BCM91250A-SWARM"
619 select BOOT_ELF32 619 select BOOT_ELF32
620 select DMA_COHERENT 620 select DMA_COHERENT
621 select SIBYTE_SB1250 621 select SIBYTE_SB1250
@@ -626,7 +626,7 @@ config SIBYTE_SWARM
626 select SYS_SUPPORTS_LITTLE_ENDIAN 626 select SYS_SUPPORTS_LITTLE_ENDIAN
627 627
628config SIBYTE_SENTOSA 628config SIBYTE_SENTOSA
629 bool "Support for Sibyte BCM91250E-Sentosa" 629 bool "Sibyte BCM91250E-Sentosa"
630 depends on EXPERIMENTAL 630 depends on EXPERIMENTAL
631 select BOOT_ELF32 631 select BOOT_ELF32
632 select DMA_COHERENT 632 select DMA_COHERENT
@@ -637,7 +637,7 @@ config SIBYTE_SENTOSA
637 select SYS_SUPPORTS_LITTLE_ENDIAN 637 select SYS_SUPPORTS_LITTLE_ENDIAN
638 638
639config SIBYTE_RHONE 639config SIBYTE_RHONE
640 bool "Support for Sibyte BCM91125E-Rhone" 640 bool "Sibyte BCM91125E-Rhone"
641 depends on EXPERIMENTAL 641 depends on EXPERIMENTAL
642 select BOOT_ELF32 642 select BOOT_ELF32
643 select DMA_COHERENT 643 select DMA_COHERENT
@@ -648,7 +648,7 @@ config SIBYTE_RHONE
648 select SYS_SUPPORTS_LITTLE_ENDIAN 648 select SYS_SUPPORTS_LITTLE_ENDIAN
649 649
650config SIBYTE_CARMEL 650config SIBYTE_CARMEL
651 bool "Support for Sibyte BCM91120x-Carmel" 651 bool "Sibyte BCM91120x-Carmel"
652 depends on EXPERIMENTAL 652 depends on EXPERIMENTAL
653 select BOOT_ELF32 653 select BOOT_ELF32
654 select DMA_COHERENT 654 select DMA_COHERENT
@@ -659,7 +659,7 @@ config SIBYTE_CARMEL
659 select SYS_SUPPORTS_LITTLE_ENDIAN 659 select SYS_SUPPORTS_LITTLE_ENDIAN
660 660
661config SIBYTE_PTSWARM 661config SIBYTE_PTSWARM
662 bool "Support for Sibyte BCM91250PT-PTSWARM" 662 bool "Sibyte BCM91250PT-PTSWARM"
663 depends on EXPERIMENTAL 663 depends on EXPERIMENTAL
664 select BOOT_ELF32 664 select BOOT_ELF32
665 select DMA_COHERENT 665 select DMA_COHERENT
@@ -671,7 +671,7 @@ config SIBYTE_PTSWARM
671 select SYS_SUPPORTS_LITTLE_ENDIAN 671 select SYS_SUPPORTS_LITTLE_ENDIAN
672 672
673config SIBYTE_LITTLESUR 673config SIBYTE_LITTLESUR
674 bool "Support for Sibyte BCM91250C2-LittleSur" 674 bool "Sibyte BCM91250C2-LittleSur"
675 depends on EXPERIMENTAL 675 depends on EXPERIMENTAL
676 select BOOT_ELF32 676 select BOOT_ELF32
677 select DMA_COHERENT 677 select DMA_COHERENT
@@ -683,7 +683,7 @@ config SIBYTE_LITTLESUR
683 select SYS_SUPPORTS_LITTLE_ENDIAN 683 select SYS_SUPPORTS_LITTLE_ENDIAN
684 684
685config SIBYTE_CRHINE 685config SIBYTE_CRHINE
686 bool "Support for Sibyte BCM91120C-CRhine" 686 bool "Sibyte BCM91120C-CRhine"
687 depends on EXPERIMENTAL 687 depends on EXPERIMENTAL
688 select BOOT_ELF32 688 select BOOT_ELF32
689 select DMA_COHERENT 689 select DMA_COHERENT
@@ -694,7 +694,7 @@ config SIBYTE_CRHINE
694 select SYS_SUPPORTS_LITTLE_ENDIAN 694 select SYS_SUPPORTS_LITTLE_ENDIAN
695 695
696config SIBYTE_CRHONE 696config SIBYTE_CRHONE
697 bool "Support for Sibyte BCM91125C-CRhone" 697 bool "Sibyte BCM91125C-CRhone"
698 depends on EXPERIMENTAL 698 depends on EXPERIMENTAL
699 select BOOT_ELF32 699 select BOOT_ELF32
700 select DMA_COHERENT 700 select DMA_COHERENT
@@ -706,7 +706,7 @@ config SIBYTE_CRHONE
706 select SYS_SUPPORTS_LITTLE_ENDIAN 706 select SYS_SUPPORTS_LITTLE_ENDIAN
707 707
708config SNI_RM200_PCI 708config SNI_RM200_PCI
709 bool "Support for SNI RM200 PCI" 709 bool "SNI RM200 PCI"
710 select ARC 710 select ARC
711 select ARC32 711 select ARC32
712 select ARCH_MAY_HAVE_PC_FDC 712 select ARCH_MAY_HAVE_PC_FDC
@@ -732,7 +732,7 @@ config SNI_RM200_PCI
732 support this machine type. 732 support this machine type.
733 733
734config TOSHIBA_JMR3927 734config TOSHIBA_JMR3927
735 bool "Support for Toshiba JMR-TX3927 board" 735 bool "Toshiba JMR-TX3927 board"
736 select DMA_NONCOHERENT 736 select DMA_NONCOHERENT
737 select HW_HAS_PCI 737 select HW_HAS_PCI
738 select MIPS_TX3927 738 select MIPS_TX3927
@@ -743,7 +743,7 @@ config TOSHIBA_JMR3927
743 select TOSHIBA_BOARDS 743 select TOSHIBA_BOARDS
744 744
745config TOSHIBA_RBTX4927 745config TOSHIBA_RBTX4927
746 bool "Support for Toshiba TBTX49[23]7 board" 746 bool "Toshiba TBTX49[23]7 board"
747 select DMA_NONCOHERENT 747 select DMA_NONCOHERENT
748 select HAS_TXX9_SERIAL 748 select HAS_TXX9_SERIAL
749 select HW_HAS_PCI 749 select HW_HAS_PCI
@@ -760,7 +760,7 @@ config TOSHIBA_RBTX4927
760 support this machine type 760 support this machine type
761 761
762config TOSHIBA_RBTX4938 762config TOSHIBA_RBTX4938
763 bool "Support for Toshiba RBTX4938 board" 763 bool "Toshiba RBTX4938 board"
764 select HAVE_STD_PC_SERIAL_PORT 764 select HAVE_STD_PC_SERIAL_PORT
765 select DMA_NONCOHERENT 765 select DMA_NONCOHERENT
766 select GENERIC_ISA_DMA 766 select GENERIC_ISA_DMA
@@ -1411,13 +1411,12 @@ config PAGE_SIZE_8KB
1411 1411
1412config PAGE_SIZE_16KB 1412config PAGE_SIZE_16KB
1413 bool "16kB" 1413 bool "16kB"
1414 depends on EXPERIMENTAL && !CPU_R3000 && !CPU_TX39XX 1414 depends on !CPU_R3000 && !CPU_TX39XX
1415 help 1415 help
1416 Using 16kB page size will result in higher performance kernel at 1416 Using 16kB page size will result in higher performance kernel at
1417 the price of higher memory consumption. This option is available on 1417 the price of higher memory consumption. This option is available on
1418 all non-R3000 family processor. Not that at the time of this 1418 all non-R3000 family processors. Note that you will need a suitable
1419 writing this option is still high experimental; there are also 1419 Linux distribution to support this.
1420 issues with compatibility of user applications.
1421 1420
1422config PAGE_SIZE_64KB 1421config PAGE_SIZE_64KB
1423 bool "64kB" 1422 bool "64kB"
@@ -1426,8 +1425,7 @@ config PAGE_SIZE_64KB
1426 Using 64kB page size will result in higher performance kernel at 1425 Using 64kB page size will result in higher performance kernel at
1427 the price of higher memory consumption. This option is available on 1426 the price of higher memory consumption. This option is available on
1428 all non-R3000 family processor. Not that at the time of this 1427 all non-R3000 family processor. Not that at the time of this
1429 writing this option is still high experimental; there are also 1428 writing this option is still high experimental.
1430 issues with compatibility of user applications.
1431 1429
1432endchoice 1430endchoice
1433 1431
diff --git a/arch/mips/au1000/common/irq.c b/arch/mips/au1000/common/irq.c
index da61de776154..afe05ec12c27 100644
--- a/arch/mips/au1000/common/irq.c
+++ b/arch/mips/au1000/common/irq.c
@@ -68,6 +68,7 @@
68 68
69extern void set_debug_traps(void); 69extern void set_debug_traps(void);
70extern irq_cpustat_t irq_stat [NR_CPUS]; 70extern irq_cpustat_t irq_stat [NR_CPUS];
71extern void mips_timer_interrupt(struct pt_regs *regs);
71 72
72static void setup_local_irq(unsigned int irq, int type, int int_req); 73static void setup_local_irq(unsigned int irq, int type, int int_req);
73static unsigned int startup_irq(unsigned int irq); 74static unsigned int startup_irq(unsigned int irq);
diff --git a/arch/mips/au1000/common/prom.c b/arch/mips/au1000/common/prom.c
index 9c171afd9a53..ae7d8c57bf3f 100644
--- a/arch/mips/au1000/common/prom.c
+++ b/arch/mips/au1000/common/prom.c
@@ -1,10 +1,9 @@
1/* 1/*
2 * 2 *
3 * BRIEF MODULE DESCRIPTION 3 * BRIEF MODULE DESCRIPTION
4 * PROM library initialisation code, assuming a version of 4 * PROM library initialisation code, assuming YAMON is the boot loader.
5 * pmon is the boot code.
6 * 5 *
7 * Copyright 2000,2001 MontaVista Software Inc. 6 * Copyright 2000, 2001, 2006 MontaVista Software Inc.
8 * Author: MontaVista Software, Inc. 7 * Author: MontaVista Software, Inc.
9 * ppopov@mvista.com or source@mvista.com 8 * ppopov@mvista.com or source@mvista.com
10 * 9 *
@@ -49,9 +48,9 @@ extern char **prom_argv, **prom_envp;
49 48
50typedef struct 49typedef struct
51{ 50{
52 char *name; 51 char *name;
53/* char *val; */ 52 char *val;
54}t_env_var; 53} t_env_var;
55 54
56 55
57char * prom_getcmdline(void) 56char * prom_getcmdline(void)
@@ -85,21 +84,16 @@ char *prom_getenv(char *envname)
85{ 84{
86 /* 85 /*
87 * Return a pointer to the given environment variable. 86 * Return a pointer to the given environment variable.
88 * Environment variables are stored in the form of "memsize=64".
89 */ 87 */
90 88
91 t_env_var *env = (t_env_var *)prom_envp; 89 t_env_var *env = (t_env_var *)prom_envp;
92 int i;
93
94 i = strlen(envname);
95 90
96 while(env->name) { 91 while (env->name) {
97 if(strncmp(envname, env->name, i) == 0) { 92 if (strcmp(envname, env->name) == 0)
98 return(env->name + strlen(envname) + 1); 93 return env->val;
99 }
100 env++; 94 env++;
101 } 95 }
102 return(NULL); 96 return NULL;
103} 97}
104 98
105inline unsigned char str2hexnum(unsigned char c) 99inline unsigned char str2hexnum(unsigned char c)
diff --git a/arch/mips/au1000/common/sleeper.S b/arch/mips/au1000/common/sleeper.S
index 44dac3b0df3b..683d9da84b66 100644
--- a/arch/mips/au1000/common/sleeper.S
+++ b/arch/mips/au1000/common/sleeper.S
@@ -112,6 +112,11 @@ sdsleep:
112 mtc0 k0, CP0_PAGEMASK 112 mtc0 k0, CP0_PAGEMASK
113 lw k0, 0x14(sp) 113 lw k0, 0x14(sp)
114 mtc0 k0, CP0_CONFIG 114 mtc0 k0, CP0_CONFIG
115
116 /* We need to catch the ealry Alchemy SOCs with
117 * the write-only Config[OD] bit and set it back to one...
118 */
119 jal au1x00_fixup_config_od
115 lw $1, PT_R1(sp) 120 lw $1, PT_R1(sp)
116 lw $2, PT_R2(sp) 121 lw $2, PT_R2(sp)
117 lw $3, PT_R3(sp) 122 lw $3, PT_R3(sp)
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index f85f1524b366..f74d66a58a21 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -116,6 +116,7 @@ void mips_timer_interrupt(struct pt_regs *regs)
116 116
117null: 117null:
118 ack_r4ktimer(0); 118 ack_r4ktimer(0);
119 irq_exit();
119} 120}
120 121
121#ifdef CONFIG_PM 122#ifdef CONFIG_PM
diff --git a/arch/mips/ddb5xxx/ddb5476/dbg_io.c b/arch/mips/ddb5xxx/ddb5476/dbg_io.c
index 85e9e5013679..f2296a999953 100644
--- a/arch/mips/ddb5xxx/ddb5476/dbg_io.c
+++ b/arch/mips/ddb5xxx/ddb5476/dbg_io.c
@@ -86,7 +86,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
86 /* disable interrupts */ 86 /* disable interrupts */
87 UART16550_WRITE(OFS_INTR_ENABLE, 0); 87 UART16550_WRITE(OFS_INTR_ENABLE, 0);
88 88
89 /* set up buad rate */ 89 /* set up baud rate */
90 { 90 {
91 uint32 divisor; 91 uint32 divisor;
92 92
diff --git a/arch/mips/ddb5xxx/ddb5477/kgdb_io.c b/arch/mips/ddb5xxx/ddb5477/kgdb_io.c
index 1d18d590495b..385bbdb10170 100644
--- a/arch/mips/ddb5xxx/ddb5477/kgdb_io.c
+++ b/arch/mips/ddb5xxx/ddb5477/kgdb_io.c
@@ -86,7 +86,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
86 /* disable interrupts */ 86 /* disable interrupts */
87 UART16550_WRITE(OFS_INTR_ENABLE, 0); 87 UART16550_WRITE(OFS_INTR_ENABLE, 0);
88 88
89 /* set up buad rate */ 89 /* set up baud rate */
90 { 90 {
91 uint32 divisor; 91 uint32 divisor;
92 92
diff --git a/arch/mips/gt64120/ev64120/serialGT.c b/arch/mips/gt64120/ev64120/serialGT.c
index 16e34a546e54..8f0d835491ff 100644
--- a/arch/mips/gt64120/ev64120/serialGT.c
+++ b/arch/mips/gt64120/ev64120/serialGT.c
@@ -149,7 +149,7 @@ void serial_set(int channel, unsigned long baud)
149#else 149#else
150 /* 150 /*
151 * Note: Set baud rate, hardcoded here for rate of 115200 151 * Note: Set baud rate, hardcoded here for rate of 115200
152 * since became unsure of above "buad rate" algorithm (??). 152 * since became unsure of above "baud rate" algorithm (??).
153 */ 153 */
154 outreg(channel, LCR, 0x83); 154 outreg(channel, LCR, 0x83);
155 outreg(channel, DLM, 0x00); // See note above 155 outreg(channel, DLM, 0x00); // See note above
diff --git a/arch/mips/gt64120/momenco_ocelot/dbg_io.c b/arch/mips/gt64120/momenco_ocelot/dbg_io.c
index 8720bccfdea2..f0a6a38fcf4d 100644
--- a/arch/mips/gt64120/momenco_ocelot/dbg_io.c
+++ b/arch/mips/gt64120/momenco_ocelot/dbg_io.c
@@ -73,7 +73,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
73 /* disable interrupts */ 73 /* disable interrupts */
74 UART16550_WRITE(OFS_INTR_ENABLE, 0); 74 UART16550_WRITE(OFS_INTR_ENABLE, 0);
75 75
76 /* set up buad rate */ 76 /* set up baud rate */
77 { 77 {
78 uint32 divisor; 78 uint32 divisor;
79 79
diff --git a/arch/mips/ite-boards/generic/dbg_io.c b/arch/mips/ite-boards/generic/dbg_io.c
index c4f8530fd07e..6a7ccaf93502 100644
--- a/arch/mips/ite-boards/generic/dbg_io.c
+++ b/arch/mips/ite-boards/generic/dbg_io.c
@@ -72,7 +72,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
72 /* disable interrupts */ 72 /* disable interrupts */
73 UART16550_WRITE(OFS_INTR_ENABLE, 0); 73 UART16550_WRITE(OFS_INTR_ENABLE, 0);
74 74
75 /* set up buad rate */ 75 /* set up baud rate */
76 { 76 {
77 uint32 divisor; 77 uint32 divisor;
78 78
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index 92b28b674d6f..0facfaf4e950 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -272,8 +272,8 @@ void output_sc_defines(void)
272 text("/* Linux sigcontext offsets. */"); 272 text("/* Linux sigcontext offsets. */");
273 offset("#define SC_REGS ", struct sigcontext, sc_regs); 273 offset("#define SC_REGS ", struct sigcontext, sc_regs);
274 offset("#define SC_FPREGS ", struct sigcontext, sc_fpregs); 274 offset("#define SC_FPREGS ", struct sigcontext, sc_fpregs);
275 offset("#define SC_MDHI ", struct sigcontext, sc_hi); 275 offset("#define SC_MDHI ", struct sigcontext, sc_mdhi);
276 offset("#define SC_MDLO ", struct sigcontext, sc_lo); 276 offset("#define SC_MDLO ", struct sigcontext, sc_mdlo);
277 offset("#define SC_PC ", struct sigcontext, sc_pc); 277 offset("#define SC_PC ", struct sigcontext, sc_pc);
278 offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr); 278 offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr);
279 linefeed; 279 linefeed;
diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/cpu-bugs64.c
index 47a087b6c11b..d268827c62bd 100644
--- a/arch/mips/kernel/cpu-bugs64.c
+++ b/arch/mips/kernel/cpu-bugs64.c
@@ -206,7 +206,7 @@ static inline void check_daddi(void)
206 "daddi %0, %1, %3\n\t" 206 "daddi %0, %1, %3\n\t"
207 ".set pop" 207 ".set pop"
208 : "=r" (v), "=&r" (tmp) 208 : "=r" (v), "=&r" (tmp)
209 : "I" (0xffffffffffffdb9a), "I" (0x1234)); 209 : "I" (0xffffffffffffdb9aUL), "I" (0x1234));
210 set_except_vector(12, handler); 210 set_except_vector(12, handler);
211 local_irq_restore(flags); 211 local_irq_restore(flags);
212 212
@@ -224,7 +224,7 @@ static inline void check_daddi(void)
224 "dsrl %1, %1, 1\n\t" 224 "dsrl %1, %1, 1\n\t"
225 "daddi %0, %1, %3" 225 "daddi %0, %1, %3"
226 : "=r" (v), "=&r" (tmp) 226 : "=r" (v), "=&r" (tmp)
227 : "I" (0xffffffffffffdb9a), "I" (0x1234)); 227 : "I" (0xffffffffffffdb9aUL), "I" (0x1234));
228 set_except_vector(12, handler); 228 set_except_vector(12, handler);
229 local_irq_restore(flags); 229 local_irq_restore(flags);
230 230
@@ -280,7 +280,7 @@ static inline void check_daddiu(void)
280 "daddu %1, %2\n\t" 280 "daddu %1, %2\n\t"
281 ".set pop" 281 ".set pop"
282 : "=&r" (v), "=&r" (w), "=&r" (tmp) 282 : "=&r" (v), "=&r" (w), "=&r" (tmp)
283 : "I" (0xffffffffffffdb9a), "I" (0x1234)); 283 : "I" (0xffffffffffffdb9aUL), "I" (0x1234));
284 284
285 if (v == w) { 285 if (v == w) {
286 printk("no.\n"); 286 printk("no.\n");
@@ -296,7 +296,7 @@ static inline void check_daddiu(void)
296 "addiu %1, $0, %4\n\t" 296 "addiu %1, $0, %4\n\t"
297 "daddu %1, %2" 297 "daddu %1, %2"
298 : "=&r" (v), "=&r" (w), "=&r" (tmp) 298 : "=&r" (v), "=&r" (w), "=&r" (tmp)
299 : "I" (0xffffffffffffdb9a), "I" (0x1234)); 299 : "I" (0xffffffffffffdb9aUL), "I" (0x1234));
300 300
301 if (v == w) { 301 if (v == w) {
302 printk("yes.\n"); 302 printk("yes.\n");
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 58b3b14873cb..8c2c359a05f4 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -121,6 +121,7 @@ static inline void check_wait(void)
121 case CPU_24K: 121 case CPU_24K:
122 case CPU_25KF: 122 case CPU_25KF:
123 case CPU_34K: 123 case CPU_34K:
124 case CPU_74K:
124 case CPU_PR4450: 125 case CPU_PR4450:
125 cpu_wait = r4k_wait; 126 cpu_wait = r4k_wait;
126 printk(" available.\n"); 127 printk(" available.\n");
@@ -432,6 +433,15 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
432 MIPS_CPU_LLSC; 433 MIPS_CPU_LLSC;
433 c->tlbsize = 64; 434 c->tlbsize = 64;
434 break; 435 break;
436 case PRID_IMP_R14000:
437 c->cputype = CPU_R14000;
438 c->isa_level = MIPS_CPU_ISA_IV;
439 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX |
440 MIPS_CPU_FPU | MIPS_CPU_32FPR |
441 MIPS_CPU_COUNTER | MIPS_CPU_WATCH |
442 MIPS_CPU_LLSC;
443 c->tlbsize = 64;
444 break;
435 } 445 }
436} 446}
437 447
@@ -593,6 +603,9 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c)
593 case PRID_IMP_34K: 603 case PRID_IMP_34K:
594 c->cputype = CPU_34K; 604 c->cputype = CPU_34K;
595 break; 605 break;
606 case PRID_IMP_74K:
607 c->cputype = CPU_74K;
608 break;
596 } 609 }
597} 610}
598 611
@@ -642,7 +655,7 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c)
642 case PRID_IMP_SB1: 655 case PRID_IMP_SB1:
643 c->cputype = CPU_SB1; 656 c->cputype = CPU_SB1;
644 /* FPU in pass1 is known to have issues. */ 657 /* FPU in pass1 is known to have issues. */
645 if ((c->processor_id & 0xff) < 0x20) 658 if ((c->processor_id & 0xff) < 0x02)
646 c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR); 659 c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR);
647 break; 660 break;
648 case PRID_IMP_SB1A: 661 case PRID_IMP_SB1A:
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S
index d101d2fb24ca..a9c6de1b9542 100644
--- a/arch/mips/kernel/entry.S
+++ b/arch/mips/kernel/entry.S
@@ -101,7 +101,7 @@ FEXPORT(restore_all) # restore full frame
101 EMT 101 EMT
1021: 1021:
103 mfc0 v1, CP0_TCSTATUS 103 mfc0 v1, CP0_TCSTATUS
104 /* We set IXMT above, XOR should cler it here */ 104 /* We set IXMT above, XOR should clear it here */
105 xori v1, v1, TCSTATUS_IXMT 105 xori v1, v1, TCSTATUS_IXMT
106 or v1, v0, v1 106 or v1, v0, v1
107 mtc0 v1, CP0_TCSTATUS 107 mtc0 v1, CP0_TCSTATUS
diff --git a/arch/mips/kernel/gdb-low.S b/arch/mips/kernel/gdb-low.S
index 10f28fb9f008..5fd7a8af0c62 100644
--- a/arch/mips/kernel/gdb-low.S
+++ b/arch/mips/kernel/gdb-low.S
@@ -54,9 +54,11 @@
54 */ 54 */
55 mfc0 k0, CP0_CAUSE 55 mfc0 k0, CP0_CAUSE
56 andi k0, k0, 0x7c 56 andi k0, k0, 0x7c
57 add k1, k1, k0 57#ifdef CONFIG_64BIT
58 PTR_L k0, saved_vectors(k1) 58 dsll k0, k0, 1
59 jr k0 59#endif
60 PTR_L k1, saved_vectors(k0)
61 jr k1
60 nop 62 nop
611: 631:
62 move k0, sp 64 move k0, sp
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c
index e54a7f442f8a..d7bf0215bc1d 100644
--- a/arch/mips/kernel/module.c
+++ b/arch/mips/kernel/module.c
@@ -288,6 +288,9 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
288 sym = (Elf_Sym *)sechdrs[symindex].sh_addr 288 sym = (Elf_Sym *)sechdrs[symindex].sh_addr
289 + ELF_MIPS_R_SYM(rel[i]); 289 + ELF_MIPS_R_SYM(rel[i]);
290 if (!sym->st_value) { 290 if (!sym->st_value) {
291 /* Ignore unresolved weak symbol */
292 if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
293 continue;
291 printk(KERN_WARNING "%s: Unknown symbol %s\n", 294 printk(KERN_WARNING "%s: Unknown symbol %s\n",
292 me->name, strtab + sym->st_name); 295 me->name, strtab + sym->st_name);
293 return -ENOENT; 296 return -ENOENT;
@@ -325,6 +328,9 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
325 sym = (Elf_Sym *)sechdrs[symindex].sh_addr 328 sym = (Elf_Sym *)sechdrs[symindex].sh_addr
326 + ELF_MIPS_R_SYM(rel[i]); 329 + ELF_MIPS_R_SYM(rel[i]);
327 if (!sym->st_value) { 330 if (!sym->st_value) {
331 /* Ignore unresolved weak symbol */
332 if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
333 continue;
328 printk(KERN_WARNING "%s: Unknown symbol %s\n", 334 printk(KERN_WARNING "%s: Unknown symbol %s\n",
329 me->name, strtab + sym->st_name); 335 me->name, strtab + sym->st_name);
330 return -ENOENT; 336 return -ENOENT;
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
index 84ab959f924a..9def554f335b 100644
--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -42,6 +42,7 @@ static const char *cpu_name[] = {
42 [CPU_R8000] = "R8000", 42 [CPU_R8000] = "R8000",
43 [CPU_R10000] = "R10000", 43 [CPU_R10000] = "R10000",
44 [CPU_R12000] = "R12000", 44 [CPU_R12000] = "R12000",
45 [CPU_R14000] = "R14000",
45 [CPU_R4300] = "R4300", 46 [CPU_R4300] = "R4300",
46 [CPU_R4650] = "R4650", 47 [CPU_R4650] = "R4650",
47 [CPU_R4700] = "R4700", 48 [CPU_R4700] = "R4700",
@@ -74,6 +75,7 @@ static const char *cpu_name[] = {
74 [CPU_24K] = "MIPS 24K", 75 [CPU_24K] = "MIPS 24K",
75 [CPU_25KF] = "MIPS 25Kf", 76 [CPU_25KF] = "MIPS 25Kf",
76 [CPU_34K] = "MIPS 34K", 77 [CPU_34K] = "MIPS 34K",
78 [CPU_74K] = "MIPS 74K",
77 [CPU_VR4111] = "NEC VR4111", 79 [CPU_VR4111] = "NEC VR4111",
78 [CPU_VR4121] = "NEC VR4121", 80 [CPU_VR4121] = "NEC VR4121",
79 [CPU_VR4122] = "NEC VR4122", 81 [CPU_VR4122] = "NEC VR4122",
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index b53a9207f530..8efb23a84131 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -209,7 +209,7 @@ sys_call_table:
209 PTR sys_fork 209 PTR sys_fork
210 PTR sys_read 210 PTR sys_read
211 PTR sys_write 211 PTR sys_write
212 PTR sys_open /* 4005 */ 212 PTR compat_sys_open /* 4005 */
213 PTR sys_close 213 PTR sys_close
214 PTR sys_waitpid 214 PTR sys_waitpid
215 PTR sys_creat 215 PTR sys_creat
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index bcf1b10e518f..397a70e651b5 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -246,7 +246,7 @@ static inline int parse_rd_cmdline(unsigned long* rd_start, unsigned long* rd_en
246#ifdef CONFIG_64BIT 246#ifdef CONFIG_64BIT
247 /* HACK: Guess if the sign extension was forgotten */ 247 /* HACK: Guess if the sign extension was forgotten */
248 if (start > 0x0000000080000000 && start < 0x00000000ffffffff) 248 if (start > 0x0000000080000000 && start < 0x00000000ffffffff)
249 start |= 0xffffffff00000000; 249 start |= 0xffffffff00000000UL;
250#endif 250#endif
251 251
252 end = start + size; 252 end = start + size;
@@ -355,8 +355,6 @@ static inline void bootmem_init(void)
355 } 355 }
356#endif 356#endif
357 357
358 memory_present(0, first_usable_pfn, max_low_pfn);
359
360 /* Initialize the boot-time allocator with low memory only. */ 358 /* Initialize the boot-time allocator with low memory only. */
361 bootmap_size = init_bootmem(first_usable_pfn, max_low_pfn); 359 bootmap_size = init_bootmem(first_usable_pfn, max_low_pfn);
362 360
@@ -410,6 +408,7 @@ static inline void bootmem_init(void)
410 408
411 /* Register lowmem ranges */ 409 /* Register lowmem ranges */
412 free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(size)); 410 free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(size));
411 memory_present(0, curr_pfn, curr_pfn + size - 1);
413 } 412 }
414 413
415 /* Reserve the bootmap memory. */ 414 /* Reserve the bootmap memory. */
@@ -419,17 +418,20 @@ static inline void bootmem_init(void)
419#ifdef CONFIG_BLK_DEV_INITRD 418#ifdef CONFIG_BLK_DEV_INITRD
420 initrd_below_start_ok = 1; 419 initrd_below_start_ok = 1;
421 if (initrd_start) { 420 if (initrd_start) {
422 unsigned long initrd_size = ((unsigned char *)initrd_end) - ((unsigned char *)initrd_start); 421 unsigned long initrd_size = ((unsigned char *)initrd_end) -
422 ((unsigned char *)initrd_start);
423 const int width = sizeof(long) * 2;
424
423 printk("Initial ramdisk at: 0x%p (%lu bytes)\n", 425 printk("Initial ramdisk at: 0x%p (%lu bytes)\n",
424 (void *)initrd_start, initrd_size); 426 (void *)initrd_start, initrd_size);
425 427
426 if (CPHYSADDR(initrd_end) > PFN_PHYS(max_low_pfn)) { 428 if (CPHYSADDR(initrd_end) > PFN_PHYS(max_low_pfn)) {
427 printk("initrd extends beyond end of memory " 429 printk("initrd extends beyond end of memory "
428 "(0x%0*Lx > 0x%0*Lx)\ndisabling initrd\n", 430 "(0x%0*Lx > 0x%0*Lx)\ndisabling initrd\n",
429 sizeof(long) * 2, 431 width,
430 (unsigned long long)CPHYSADDR(initrd_end), 432 (unsigned long long) CPHYSADDR(initrd_end),
431 sizeof(long) * 2, 433 width,
432 (unsigned long long)PFN_PHYS(max_low_pfn)); 434 (unsigned long long) PFN_PHYS(max_low_pfn));
433 initrd_start = initrd_end = 0; 435 initrd_start = initrd_end = 0;
434 initrd_reserve_bootmem = 0; 436 initrd_reserve_bootmem = 0;
435 } 437 }
diff --git a/arch/mips/kernel/signal-common.h b/arch/mips/kernel/signal-common.h
index 3ca786215d48..ce6cb915c0a7 100644
--- a/arch/mips/kernel/signal-common.h
+++ b/arch/mips/kernel/signal-common.h
@@ -31,7 +31,6 @@ setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
31 save_gp_reg(31); 31 save_gp_reg(31);
32#undef save_gp_reg 32#undef save_gp_reg
33 33
34#ifdef CONFIG_32BIT
35 err |= __put_user(regs->hi, &sc->sc_mdhi); 34 err |= __put_user(regs->hi, &sc->sc_mdhi);
36 err |= __put_user(regs->lo, &sc->sc_mdlo); 35 err |= __put_user(regs->lo, &sc->sc_mdlo);
37 if (cpu_has_dsp) { 36 if (cpu_has_dsp) {
@@ -43,20 +42,6 @@ setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
43 err |= __put_user(mflo3(), &sc->sc_lo3); 42 err |= __put_user(mflo3(), &sc->sc_lo3);
44 err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp); 43 err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp);
45 } 44 }
46#endif
47#ifdef CONFIG_64BIT
48 err |= __put_user(regs->hi, &sc->sc_hi[0]);
49 err |= __put_user(regs->lo, &sc->sc_lo[0]);
50 if (cpu_has_dsp) {
51 err |= __put_user(mfhi1(), &sc->sc_hi[1]);
52 err |= __put_user(mflo1(), &sc->sc_lo[1]);
53 err |= __put_user(mfhi2(), &sc->sc_hi[2]);
54 err |= __put_user(mflo2(), &sc->sc_lo[2]);
55 err |= __put_user(mfhi3(), &sc->sc_hi[3]);
56 err |= __put_user(mflo3(), &sc->sc_lo[3]);
57 err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp);
58 }
59#endif
60 45
61 err |= __put_user(!!used_math(), &sc->sc_used_math); 46 err |= __put_user(!!used_math(), &sc->sc_used_math);
62 47
@@ -92,7 +77,6 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
92 current_thread_info()->restart_block.fn = do_no_restart_syscall; 77 current_thread_info()->restart_block.fn = do_no_restart_syscall;
93 78
94 err |= __get_user(regs->cp0_epc, &sc->sc_pc); 79 err |= __get_user(regs->cp0_epc, &sc->sc_pc);
95#ifdef CONFIG_32BIT
96 err |= __get_user(regs->hi, &sc->sc_mdhi); 80 err |= __get_user(regs->hi, &sc->sc_mdhi);
97 err |= __get_user(regs->lo, &sc->sc_mdlo); 81 err |= __get_user(regs->lo, &sc->sc_mdlo);
98 if (cpu_has_dsp) { 82 if (cpu_has_dsp) {
@@ -104,20 +88,6 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
104 err |= __get_user(treg, &sc->sc_lo3); mtlo3(treg); 88 err |= __get_user(treg, &sc->sc_lo3); mtlo3(treg);
105 err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK); 89 err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK);
106 } 90 }
107#endif
108#ifdef CONFIG_64BIT
109 err |= __get_user(regs->hi, &sc->sc_hi[0]);
110 err |= __get_user(regs->lo, &sc->sc_lo[0]);
111 if (cpu_has_dsp) {
112 err |= __get_user(treg, &sc->sc_hi[1]); mthi1(treg);
113 err |= __get_user(treg, &sc->sc_lo[1]); mthi1(treg);
114 err |= __get_user(treg, &sc->sc_hi[2]); mthi2(treg);
115 err |= __get_user(treg, &sc->sc_lo[2]); mthi2(treg);
116 err |= __get_user(treg, &sc->sc_hi[3]); mthi3(treg);
117 err |= __get_user(treg, &sc->sc_lo[3]); mthi3(treg);
118 err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK);
119 }
120#endif
121 91
122#define restore_gp_reg(i) do { \ 92#define restore_gp_reg(i) do { \
123 err |= __get_user(regs->regs[i], &sc->sc_regs[i]); \ 93 err |= __get_user(regs->regs[i], &sc->sc_regs[i]); \
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index d42f358754ad..298f82fe8440 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -247,6 +247,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
247 current_thread_info()->cpu = 0; 247 current_thread_info()->cpu = 0;
248 smp_tune_scheduling(); 248 smp_tune_scheduling();
249 plat_prepare_cpus(max_cpus); 249 plat_prepare_cpus(max_cpus);
250#ifndef CONFIG_HOTPLUG_CPU
251 cpu_present_map = cpu_possible_map;
252#endif
250} 253}
251 254
252/* preload SMP state for boot cpu */ 255/* preload SMP state for boot cpu */
@@ -442,7 +445,7 @@ static int __init topology_init(void)
442 int cpu; 445 int cpu;
443 int ret; 446 int ret;
444 447
445 for_each_cpu(cpu) { 448 for_each_present_cpu(cpu) {
446 ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL); 449 ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL);
447 if (ret) 450 if (ret)
448 printk(KERN_WARNING "topology_init: register_cpu %d " 451 printk(KERN_WARNING "topology_init: register_cpu %d "
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 2aeaa2fd4b32..5e8a18a8e2bd 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -276,31 +276,9 @@ void sys_set_thread_area(unsigned long addr)
276 276
277asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) 277asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
278{ 278{
279 int tmp, len; 279 int tmp;
280 char __user *name;
281 280
282 switch(cmd) { 281 switch(cmd) {
283 case SETNAME: {
284 char nodename[__NEW_UTS_LEN + 1];
285
286 if (!capable(CAP_SYS_ADMIN))
287 return -EPERM;
288
289 name = (char __user *) arg1;
290
291 len = strncpy_from_user(nodename, name, __NEW_UTS_LEN);
292 if (len < 0)
293 return -EFAULT;
294
295 down_write(&uts_sem);
296 strncpy(system_utsname.nodename, nodename, len);
297 nodename[__NEW_UTS_LEN] = '\0';
298 strlcpy(system_utsname.nodename, nodename,
299 sizeof(system_utsname.nodename));
300 up_write(&uts_sem);
301 return 0;
302 }
303
304 case MIPS_ATOMIC_SET: 282 case MIPS_ATOMIC_SET:
305 printk(KERN_CRIT "How did I get here?\n"); 283 printk(KERN_CRIT "How did I get here?\n");
306 return -EINVAL; 284 return -EINVAL;
@@ -313,9 +291,6 @@ asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
313 case FLUSH_CACHE: 291 case FLUSH_CACHE:
314 __flush_cache_all(); 292 __flush_cache_all();
315 return 0; 293 return 0;
316
317 case MIPS_RDNVRAM:
318 return -EIO;
319 } 294 }
320 295
321 return -EINVAL; 296 return -EINVAL;
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 4901f0a37fca..a7564b08eb4d 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -819,15 +819,30 @@ asmlinkage void do_watch(struct pt_regs *regs)
819 819
820asmlinkage void do_mcheck(struct pt_regs *regs) 820asmlinkage void do_mcheck(struct pt_regs *regs)
821{ 821{
822 const int field = 2 * sizeof(unsigned long);
823 int multi_match = regs->cp0_status & ST0_TS;
824
822 show_regs(regs); 825 show_regs(regs);
823 dump_tlb_all(); 826
827 if (multi_match) {
828 printk("Index : %0x\n", read_c0_index());
829 printk("Pagemask: %0x\n", read_c0_pagemask());
830 printk("EntryHi : %0*lx\n", field, read_c0_entryhi());
831 printk("EntryLo0: %0*lx\n", field, read_c0_entrylo0());
832 printk("EntryLo1: %0*lx\n", field, read_c0_entrylo1());
833 printk("\n");
834 dump_tlb_all();
835 }
836
837 show_code((unsigned int *) regs->cp0_epc);
838
824 /* 839 /*
825 * Some chips may have other causes of machine check (e.g. SB1 840 * Some chips may have other causes of machine check (e.g. SB1
826 * graduation timer) 841 * graduation timer)
827 */ 842 */
828 panic("Caught Machine Check exception - %scaused by multiple " 843 panic("Caught Machine Check exception - %scaused by multiple "
829 "matching entries in the TLB.", 844 "matching entries in the TLB.",
830 (regs->cp0_status & ST0_TS) ? "" : "not "); 845 (multi_match) ? "" : "not ");
831} 846}
832 847
833asmlinkage void do_mt(struct pt_regs *regs) 848asmlinkage void do_mt(struct pt_regs *regs)
@@ -902,6 +917,7 @@ static inline void parity_protection_init(void)
902{ 917{
903 switch (current_cpu_data.cputype) { 918 switch (current_cpu_data.cputype) {
904 case CPU_24K: 919 case CPU_24K:
920 case CPU_34K:
905 case CPU_5KC: 921 case CPU_5KC:
906 write_c0_ecc(0x80000000); 922 write_c0_ecc(0x80000000);
907 back_to_back_c0_hazard(); 923 back_to_back_c0_hazard();
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 14fa00e3cdfa..b84d1f9ce28e 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -151,23 +151,13 @@ SECTIONS
151 151
152 /* This is the MIPS specific mdebug section. */ 152 /* This is the MIPS specific mdebug section. */
153 .mdebug : { *(.mdebug) } 153 .mdebug : { *(.mdebug) }
154 /* These are needed for ELF backends which have not yet been 154
155 converted to the new style linker. */ 155 STABS_DEBUG
156 .stab 0 : { *(.stab) } 156
157 .stabstr 0 : { *(.stabstr) } 157 DWARF_DEBUG
158 /* DWARF debug sections. 158
159 Symbols in the .debug DWARF section are relative to the beginning of the
160 section so we begin .debug at 0. It's not clear yet what needs to happen
161 for the others. */
162 .debug 0 : { *(.debug) }
163 .debug_srcinfo 0 : { *(.debug_srcinfo) }
164 .debug_aranges 0 : { *(.debug_aranges) }
165 .debug_pubnames 0 : { *(.debug_pubnames) }
166 .debug_sfnames 0 : { *(.debug_sfnames) }
167 .line 0 : { *(.line) }
168 /* These must appear regardless of . */ 159 /* These must appear regardless of . */
169 .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } 160 .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
170 .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } 161 .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
171 .comment : { *(.comment) }
172 .note : { *(.note) } 162 .note : { *(.note) }
173} 163}
diff --git a/arch/mips/math-emu/dp_fint.c b/arch/mips/math-emu/dp_fint.c
index a1962eb460f8..39a71de16f47 100644
--- a/arch/mips/math-emu/dp_fint.c
+++ b/arch/mips/math-emu/dp_fint.c
@@ -29,7 +29,9 @@
29 29
30ieee754dp ieee754dp_fint(int x) 30ieee754dp ieee754dp_fint(int x)
31{ 31{
32 COMPXDP; 32 u64 xm;
33 int xe;
34 int xs;
33 35
34 CLEARCX; 36 CLEARCX;
35 37
diff --git a/arch/mips/math-emu/dp_flong.c b/arch/mips/math-emu/dp_flong.c
index eae90a866aa1..f08f223e488a 100644
--- a/arch/mips/math-emu/dp_flong.c
+++ b/arch/mips/math-emu/dp_flong.c
@@ -29,7 +29,9 @@
29 29
30ieee754dp ieee754dp_flong(s64 x) 30ieee754dp ieee754dp_flong(s64 x)
31{ 31{
32 COMPXDP; 32 u64 xm;
33 int xe;
34 int xs;
33 35
34 CLEARCX; 36 CLEARCX;
35 37
diff --git a/arch/mips/math-emu/sp_fint.c b/arch/mips/math-emu/sp_fint.c
index 7aac13afb09a..e88e125e01c2 100644
--- a/arch/mips/math-emu/sp_fint.c
+++ b/arch/mips/math-emu/sp_fint.c
@@ -29,7 +29,9 @@
29 29
30ieee754sp ieee754sp_fint(int x) 30ieee754sp ieee754sp_fint(int x)
31{ 31{
32 COMPXSP; 32 unsigned xm;
33 int xe;
34 int xs;
33 35
34 CLEARCX; 36 CLEARCX;
35 37
diff --git a/arch/mips/math-emu/sp_flong.c b/arch/mips/math-emu/sp_flong.c
index 3d6c1d11c178..26d6919a269a 100644
--- a/arch/mips/math-emu/sp_flong.c
+++ b/arch/mips/math-emu/sp_flong.c
@@ -29,7 +29,9 @@
29 29
30ieee754sp ieee754sp_flong(s64 x) 30ieee754sp ieee754sp_flong(s64 x)
31{ 31{
32 COMPXDP; /* <--- need 64-bit mantissa temp */ 32 u64 xm; /* <--- need 64-bit mantissa temp */
33 int xe;
34 int xs;
33 35
34 CLEARCX; 36 CLEARCX;
35 37
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 4182e1176fae..4a43924cd4fc 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -29,6 +29,27 @@
29#include <asm/war.h> 29#include <asm/war.h>
30#include <asm/cacheflush.h> /* for run_uncached() */ 30#include <asm/cacheflush.h> /* for run_uncached() */
31 31
32
33/*
34 * Special Variant of smp_call_function for use by cache functions:
35 *
36 * o No return value
37 * o collapses to normal function call on UP kernels
38 * o collapses to normal function call on systems with a single shared
39 * primary cache.
40 */
41static inline void r4k_on_each_cpu(void (*func) (void *info), void *info,
42 int retry, int wait)
43{
44 preempt_disable();
45
46#if !defined(CONFIG_MIPS_MT_SMP) && !defined(CONFIG_MIPS_MT_SMTC)
47 smp_call_function(func, info, retry, wait);
48#endif
49 func(info);
50 preempt_enable();
51}
52
32/* 53/*
33 * Must die. 54 * Must die.
34 */ 55 */
@@ -299,7 +320,7 @@ static void r4k_flush_cache_all(void)
299 if (!cpu_has_dc_aliases) 320 if (!cpu_has_dc_aliases)
300 return; 321 return;
301 322
302 on_each_cpu(local_r4k_flush_cache_all, NULL, 1, 1); 323 r4k_on_each_cpu(local_r4k_flush_cache_all, NULL, 1, 1);
303} 324}
304 325
305static inline void local_r4k___flush_cache_all(void * args) 326static inline void local_r4k___flush_cache_all(void * args)
@@ -314,13 +335,14 @@ static inline void local_r4k___flush_cache_all(void * args)
314 case CPU_R4400MC: 335 case CPU_R4400MC:
315 case CPU_R10000: 336 case CPU_R10000:
316 case CPU_R12000: 337 case CPU_R12000:
338 case CPU_R14000:
317 r4k_blast_scache(); 339 r4k_blast_scache();
318 } 340 }
319} 341}
320 342
321static void r4k___flush_cache_all(void) 343static void r4k___flush_cache_all(void)
322{ 344{
323 on_each_cpu(local_r4k___flush_cache_all, NULL, 1, 1); 345 r4k_on_each_cpu(local_r4k___flush_cache_all, NULL, 1, 1);
324} 346}
325 347
326static inline void local_r4k_flush_cache_range(void * args) 348static inline void local_r4k_flush_cache_range(void * args)
@@ -341,7 +363,7 @@ static inline void local_r4k_flush_cache_range(void * args)
341static void r4k_flush_cache_range(struct vm_area_struct *vma, 363static void r4k_flush_cache_range(struct vm_area_struct *vma,
342 unsigned long start, unsigned long end) 364 unsigned long start, unsigned long end)
343{ 365{
344 on_each_cpu(local_r4k_flush_cache_range, vma, 1, 1); 366 r4k_on_each_cpu(local_r4k_flush_cache_range, vma, 1, 1);
345} 367}
346 368
347static inline void local_r4k_flush_cache_mm(void * args) 369static inline void local_r4k_flush_cache_mm(void * args)
@@ -370,7 +392,7 @@ static void r4k_flush_cache_mm(struct mm_struct *mm)
370 if (!cpu_has_dc_aliases) 392 if (!cpu_has_dc_aliases)
371 return; 393 return;
372 394
373 on_each_cpu(local_r4k_flush_cache_mm, mm, 1, 1); 395 r4k_on_each_cpu(local_r4k_flush_cache_mm, mm, 1, 1);
374} 396}
375 397
376struct flush_cache_page_args { 398struct flush_cache_page_args {
@@ -461,7 +483,7 @@ static void r4k_flush_cache_page(struct vm_area_struct *vma,
461 args.addr = addr; 483 args.addr = addr;
462 args.pfn = pfn; 484 args.pfn = pfn;
463 485
464 on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1); 486 r4k_on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1);
465} 487}
466 488
467static inline void local_r4k_flush_data_cache_page(void * addr) 489static inline void local_r4k_flush_data_cache_page(void * addr)
@@ -471,7 +493,7 @@ static inline void local_r4k_flush_data_cache_page(void * addr)
471 493
472static void r4k_flush_data_cache_page(unsigned long addr) 494static void r4k_flush_data_cache_page(unsigned long addr)
473{ 495{
474 on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr, 1, 1); 496 r4k_on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr, 1, 1);
475} 497}
476 498
477struct flush_icache_range_args { 499struct flush_icache_range_args {
@@ -514,7 +536,7 @@ static void r4k_flush_icache_range(unsigned long start, unsigned long end)
514 args.start = start; 536 args.start = start;
515 args.end = end; 537 args.end = end;
516 538
517 on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1); 539 r4k_on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1);
518 instruction_hazard(); 540 instruction_hazard();
519} 541}
520 542
@@ -590,7 +612,7 @@ static void r4k_flush_icache_page(struct vm_area_struct *vma,
590 args.vma = vma; 612 args.vma = vma;
591 args.page = page; 613 args.page = page;
592 614
593 on_each_cpu(local_r4k_flush_icache_page, &args, 1, 1); 615 r4k_on_each_cpu(local_r4k_flush_icache_page, &args, 1, 1);
594} 616}
595 617
596 618
@@ -689,7 +711,7 @@ static void local_r4k_flush_cache_sigtramp(void * arg)
689 711
690static void r4k_flush_cache_sigtramp(unsigned long addr) 712static void r4k_flush_cache_sigtramp(unsigned long addr)
691{ 713{
692 on_each_cpu(local_r4k_flush_cache_sigtramp, (void *) addr, 1, 1); 714 r4k_on_each_cpu(local_r4k_flush_cache_sigtramp, (void *) addr, 1, 1);
693} 715}
694 716
695static void r4k_flush_icache_all(void) 717static void r4k_flush_icache_all(void)
@@ -812,6 +834,7 @@ static void __init probe_pcache(void)
812 834
813 case CPU_R10000: 835 case CPU_R10000:
814 case CPU_R12000: 836 case CPU_R12000:
837 case CPU_R14000:
815 icache_size = 1 << (12 + ((config & R10K_CONF_IC) >> 29)); 838 icache_size = 1 << (12 + ((config & R10K_CONF_IC) >> 29));
816 c->icache.linesz = 64; 839 c->icache.linesz = 64;
817 c->icache.ways = 2; 840 c->icache.ways = 2;
@@ -965,9 +988,11 @@ static void __init probe_pcache(void)
965 c->dcache.flags |= MIPS_CACHE_PINDEX; 988 c->dcache.flags |= MIPS_CACHE_PINDEX;
966 case CPU_R10000: 989 case CPU_R10000:
967 case CPU_R12000: 990 case CPU_R12000:
991 case CPU_R14000:
968 case CPU_SB1: 992 case CPU_SB1:
969 break; 993 break;
970 case CPU_24K: 994 case CPU_24K:
995 case CPU_34K:
971 if (!(read_c0_config7() & (1 << 16))) 996 if (!(read_c0_config7() & (1 << 16)))
972 default: 997 default:
973 if (c->dcache.waysize > PAGE_SIZE) 998 if (c->dcache.waysize > PAGE_SIZE)
@@ -1091,6 +1116,7 @@ static void __init setup_scache(void)
1091 1116
1092 case CPU_R10000: 1117 case CPU_R10000:
1093 case CPU_R12000: 1118 case CPU_R12000:
1119 case CPU_R14000:
1094 scache_size = 0x80000 << ((config & R10K_CONF_SS) >> 16); 1120 scache_size = 0x80000 << ((config & R10K_CONF_SS) >> 16);
1095 c->scache.linesz = 64 << ((config >> 13) & 1); 1121 c->scache.linesz = 64 << ((config >> 13) & 1);
1096 c->scache.ways = 2; 1122 c->scache.ways = 2;
@@ -1135,6 +1161,31 @@ static void __init setup_scache(void)
1135 c->options |= MIPS_CPU_SUBSET_CACHES; 1161 c->options |= MIPS_CPU_SUBSET_CACHES;
1136} 1162}
1137 1163
1164void au1x00_fixup_config_od(void)
1165{
1166 /*
1167 * c0_config.od (bit 19) was write only (and read as 0)
1168 * on the early revisions of Alchemy SOCs. It disables the bus
1169 * transaction overlapping and needs to be set to fix various errata.
1170 */
1171 switch (read_c0_prid()) {
1172 case 0x00030100: /* Au1000 DA */
1173 case 0x00030201: /* Au1000 HA */
1174 case 0x00030202: /* Au1000 HB */
1175 case 0x01030200: /* Au1500 AB */
1176 /*
1177 * Au1100 errata actually keeps silence about this bit, so we set it
1178 * just in case for those revisions that require it to be set according
1179 * to arch/mips/au1000/common/cputable.c
1180 */
1181 case 0x02030200: /* Au1100 AB */
1182 case 0x02030201: /* Au1100 BA */
1183 case 0x02030202: /* Au1100 BC */
1184 set_c0_config(1 << 19);
1185 break;
1186 }
1187}
1188
1138static inline void coherency_setup(void) 1189static inline void coherency_setup(void)
1139{ 1190{
1140 change_c0_config(CONF_CM_CMASK, CONF_CM_DEFAULT); 1191 change_c0_config(CONF_CM_CMASK, CONF_CM_DEFAULT);
@@ -1155,6 +1206,15 @@ static inline void coherency_setup(void)
1155 case CPU_R4400MC: 1206 case CPU_R4400MC:
1156 clear_c0_config(CONF_CU); 1207 clear_c0_config(CONF_CU);
1157 break; 1208 break;
1209 /*
1210 * We need to catch the ealry Alchemy SOCs with
1211 * the write-only co_config.od bit and set it back to one...
1212 */
1213 case CPU_AU1000: /* rev. DA, HA, HB */
1214 case CPU_AU1100: /* rev. AB, BA, BC ?? */
1215 case CPU_AU1500: /* rev. AB */
1216 au1x00_fixup_config_od();
1217 break;
1158 } 1218 }
1159} 1219}
1160 1220
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index c22308b93ff0..33f6e1cdfd5b 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -227,7 +227,7 @@ void __init mem_init(void)
227 for (tmp = 0; tmp < max_low_pfn; tmp++) 227 for (tmp = 0; tmp < max_low_pfn; tmp++)
228 if (page_is_ram(tmp)) { 228 if (page_is_ram(tmp)) {
229 ram++; 229 ram++;
230 if (PageReserved(mem_map+tmp)) 230 if (PageReserved(pfn_to_page(tmp)))
231 reservedpages++; 231 reservedpages++;
232 } 232 }
233 233
diff --git a/arch/mips/mm/pg-r4k.c b/arch/mips/mm/pg-r4k.c
index e4390dc3eb48..b7c749232ffe 100644
--- a/arch/mips/mm/pg-r4k.c
+++ b/arch/mips/mm/pg-r4k.c
@@ -357,6 +357,7 @@ void __init build_clear_page(void)
357 357
358 case CPU_R10000: 358 case CPU_R10000:
359 case CPU_R12000: 359 case CPU_R12000:
360 case CPU_R14000:
360 pref_src_mode = Pref_LoadStreamed; 361 pref_src_mode = Pref_LoadStreamed;
361 pref_dst_mode = Pref_StoreStreamed; 362 pref_dst_mode = Pref_StoreStreamed;
362 break; 363 break;
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 053dbacac56b..54507be2ab5b 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -875,6 +875,7 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
875 875
876 case CPU_R10000: 876 case CPU_R10000:
877 case CPU_R12000: 877 case CPU_R12000:
878 case CPU_R14000:
878 case CPU_4KC: 879 case CPU_4KC:
879 case CPU_SB1: 880 case CPU_SB1:
880 case CPU_SB1A: 881 case CPU_SB1A:
@@ -906,6 +907,7 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
906 case CPU_4KEC: 907 case CPU_4KEC:
907 case CPU_24K: 908 case CPU_24K:
908 case CPU_34K: 909 case CPU_34K:
910 case CPU_74K:
909 i_ehb(p); 911 i_ehb(p);
910 tlbw(p); 912 tlbw(p);
911 break; 913 break;
diff --git a/arch/mips/momentum/jaguar_atx/dbg_io.c b/arch/mips/momentum/jaguar_atx/dbg_io.c
index 542eac82b63c..d7dea0a136aa 100644
--- a/arch/mips/momentum/jaguar_atx/dbg_io.c
+++ b/arch/mips/momentum/jaguar_atx/dbg_io.c
@@ -73,7 +73,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
73 /* disable interrupts */ 73 /* disable interrupts */
74 UART16550_WRITE(OFS_INTR_ENABLE, 0); 74 UART16550_WRITE(OFS_INTR_ENABLE, 0);
75 75
76 /* set up buad rate */ 76 /* set up baud rate */
77 { 77 {
78 uint32 divisor; 78 uint32 divisor;
79 79
diff --git a/arch/mips/momentum/ocelot_c/dbg_io.c b/arch/mips/momentum/ocelot_c/dbg_io.c
index 8720bccfdea2..f0a6a38fcf4d 100644
--- a/arch/mips/momentum/ocelot_c/dbg_io.c
+++ b/arch/mips/momentum/ocelot_c/dbg_io.c
@@ -73,7 +73,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
73 /* disable interrupts */ 73 /* disable interrupts */
74 UART16550_WRITE(OFS_INTR_ENABLE, 0); 74 UART16550_WRITE(OFS_INTR_ENABLE, 0);
75 75
76 /* set up buad rate */ 76 /* set up baud rate */
77 { 77 {
78 uint32 divisor; 78 uint32 divisor;
79 79
diff --git a/arch/mips/momentum/ocelot_g/dbg_io.c b/arch/mips/momentum/ocelot_g/dbg_io.c
index 8720bccfdea2..f0a6a38fcf4d 100644
--- a/arch/mips/momentum/ocelot_g/dbg_io.c
+++ b/arch/mips/momentum/ocelot_g/dbg_io.c
@@ -73,7 +73,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
73 /* disable interrupts */ 73 /* disable interrupts */
74 UART16550_WRITE(OFS_INTR_ENABLE, 0); 74 UART16550_WRITE(OFS_INTR_ENABLE, 0);
75 75
76 /* set up buad rate */ 76 /* set up baud rate */
77 { 77 {
78 uint32 divisor; 78 uint32 divisor;
79 79
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c
index f2b4862aaae5..c31e4cff64e0 100644
--- a/arch/mips/oprofile/common.c
+++ b/arch/mips/oprofile/common.c
@@ -14,8 +14,8 @@
14 14
15#include "op_impl.h" 15#include "op_impl.h"
16 16
17extern struct op_mips_model op_model_mipsxx __attribute__((weak)); 17extern struct op_mips_model op_model_mipsxx_ops __attribute__((weak));
18extern struct op_mips_model op_model_rm9000 __attribute__((weak)); 18extern struct op_mips_model op_model_rm9000_ops __attribute__((weak));
19 19
20static struct op_mips_model *model; 20static struct op_mips_model *model;
21 21
@@ -80,13 +80,14 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
80 case CPU_24K: 80 case CPU_24K:
81 case CPU_25KF: 81 case CPU_25KF:
82 case CPU_34K: 82 case CPU_34K:
83 case CPU_74K:
83 case CPU_SB1: 84 case CPU_SB1:
84 case CPU_SB1A: 85 case CPU_SB1A:
85 lmodel = &op_model_mipsxx; 86 lmodel = &op_model_mipsxx_ops;
86 break; 87 break;
87 88
88 case CPU_RM9000: 89 case CPU_RM9000:
89 lmodel = &op_model_rm9000; 90 lmodel = &op_model_rm9000_ops;
90 break; 91 break;
91 }; 92 };
92 93
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
index 95d488ca0754..f26a00e13204 100644
--- a/arch/mips/oprofile/op_model_mipsxx.c
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -23,7 +23,7 @@
23 23
24#define M_COUNTER_OVERFLOW (1UL << 31) 24#define M_COUNTER_OVERFLOW (1UL << 31)
25 25
26struct op_mips_model op_model_mipsxx; 26struct op_mips_model op_model_mipsxx_ops;
27 27
28static struct mipsxx_register_config { 28static struct mipsxx_register_config {
29 unsigned int control[4]; 29 unsigned int control[4];
@@ -34,7 +34,7 @@ static struct mipsxx_register_config {
34 34
35static void mipsxx_reg_setup(struct op_counter_config *ctr) 35static void mipsxx_reg_setup(struct op_counter_config *ctr)
36{ 36{
37 unsigned int counters = op_model_mipsxx.num_counters; 37 unsigned int counters = op_model_mipsxx_ops.num_counters;
38 int i; 38 int i;
39 39
40 /* Compute the performance counter control word. */ 40 /* Compute the performance counter control word. */
@@ -62,7 +62,7 @@ static void mipsxx_reg_setup(struct op_counter_config *ctr)
62 62
63static void mipsxx_cpu_setup (void *args) 63static void mipsxx_cpu_setup (void *args)
64{ 64{
65 unsigned int counters = op_model_mipsxx.num_counters; 65 unsigned int counters = op_model_mipsxx_ops.num_counters;
66 66
67 switch (counters) { 67 switch (counters) {
68 case 4: 68 case 4:
@@ -83,7 +83,7 @@ static void mipsxx_cpu_setup (void *args)
83/* Start all counters on current CPU */ 83/* Start all counters on current CPU */
84static void mipsxx_cpu_start(void *args) 84static void mipsxx_cpu_start(void *args)
85{ 85{
86 unsigned int counters = op_model_mipsxx.num_counters; 86 unsigned int counters = op_model_mipsxx_ops.num_counters;
87 87
88 switch (counters) { 88 switch (counters) {
89 case 4: 89 case 4:
@@ -100,7 +100,7 @@ static void mipsxx_cpu_start(void *args)
100/* Stop all counters on current CPU */ 100/* Stop all counters on current CPU */
101static void mipsxx_cpu_stop(void *args) 101static void mipsxx_cpu_stop(void *args)
102{ 102{
103 unsigned int counters = op_model_mipsxx.num_counters; 103 unsigned int counters = op_model_mipsxx_ops.num_counters;
104 104
105 switch (counters) { 105 switch (counters) {
106 case 4: 106 case 4:
@@ -116,7 +116,7 @@ static void mipsxx_cpu_stop(void *args)
116 116
117static int mipsxx_perfcount_handler(struct pt_regs *regs) 117static int mipsxx_perfcount_handler(struct pt_regs *regs)
118{ 118{
119 unsigned int counters = op_model_mipsxx.num_counters; 119 unsigned int counters = op_model_mipsxx_ops.num_counters;
120 unsigned int control; 120 unsigned int control;
121 unsigned int counter; 121 unsigned int counter;
122 int handled = 0; 122 int handled = 0;
@@ -187,33 +187,37 @@ static int __init mipsxx_init(void)
187 187
188 reset_counters(counters); 188 reset_counters(counters);
189 189
190 op_model_mipsxx.num_counters = counters; 190 op_model_mipsxx_ops.num_counters = counters;
191 switch (current_cpu_data.cputype) { 191 switch (current_cpu_data.cputype) {
192 case CPU_20KC: 192 case CPU_20KC:
193 op_model_mipsxx.cpu_type = "mips/20K"; 193 op_model_mipsxx_ops.cpu_type = "mips/20K";
194 break; 194 break;
195 195
196 case CPU_24K: 196 case CPU_24K:
197 op_model_mipsxx.cpu_type = "mips/24K"; 197 op_model_mipsxx_ops.cpu_type = "mips/24K";
198 break; 198 break;
199 199
200 case CPU_25KF: 200 case CPU_25KF:
201 op_model_mipsxx.cpu_type = "mips/25K"; 201 op_model_mipsxx_ops.cpu_type = "mips/25K";
202 break; 202 break;
203 203
204#ifndef CONFIG_SMP 204#ifndef CONFIG_SMP
205 case CPU_34K: 205 case CPU_34K:
206 op_model_mipsxx.cpu_type = "mips/34K"; 206 op_model_mipsxx_ops.cpu_type = "mips/34K";
207 break;
208
209 case CPU_74K:
210 op_model_mipsxx_ops.cpu_type = "mips/74K";
207 break; 211 break;
208#endif 212#endif
209 213
210 case CPU_5KC: 214 case CPU_5KC:
211 op_model_mipsxx.cpu_type = "mips/5K"; 215 op_model_mipsxx_ops.cpu_type = "mips/5K";
212 break; 216 break;
213 217
214 case CPU_SB1: 218 case CPU_SB1:
215 case CPU_SB1A: 219 case CPU_SB1A:
216 op_model_mipsxx.cpu_type = "mips/sb1"; 220 op_model_mipsxx_ops.cpu_type = "mips/sb1";
217 break; 221 break;
218 222
219 default: 223 default:
@@ -229,12 +233,12 @@ static int __init mipsxx_init(void)
229 233
230static void mipsxx_exit(void) 234static void mipsxx_exit(void)
231{ 235{
232 reset_counters(op_model_mipsxx.num_counters); 236 reset_counters(op_model_mipsxx_ops.num_counters);
233 237
234 perf_irq = null_perf_irq; 238 perf_irq = null_perf_irq;
235} 239}
236 240
237struct op_mips_model op_model_mipsxx = { 241struct op_mips_model op_model_mipsxx_ops = {
238 .reg_setup = mipsxx_reg_setup, 242 .reg_setup = mipsxx_reg_setup,
239 .cpu_setup = mipsxx_cpu_setup, 243 .cpu_setup = mipsxx_cpu_setup,
240 .init = mipsxx_init, 244 .init = mipsxx_init,
diff --git a/arch/mips/oprofile/op_model_rm9000.c b/arch/mips/oprofile/op_model_rm9000.c
index 9b75e41c78ef..b7063fefa65b 100644
--- a/arch/mips/oprofile/op_model_rm9000.c
+++ b/arch/mips/oprofile/op_model_rm9000.c
@@ -126,7 +126,7 @@ static void rm9000_exit(void)
126 free_irq(rm9000_perfcount_irq, NULL); 126 free_irq(rm9000_perfcount_irq, NULL);
127} 127}
128 128
129struct op_mips_model op_model_rm9000 = { 129struct op_mips_model op_model_rm9000_ops = {
130 .reg_setup = rm9000_reg_setup, 130 .reg_setup = rm9000_reg_setup,
131 .cpu_setup = rm9000_cpu_setup, 131 .cpu_setup = rm9000_cpu_setup,
132 .init = rm9000_init, 132 .init = rm9000_init,
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index de01c9815bdd..8ba08047d164 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -31,12 +31,12 @@
31/* issue a PIO read to make sure no PIO writes are pending */ 31/* issue a PIO read to make sure no PIO writes are pending */
32static void inline flush_crime_bus(void) 32static void inline flush_crime_bus(void)
33{ 33{
34 volatile unsigned long junk = crime->control; 34 crime->control;
35} 35}
36 36
37static void inline flush_mace_bus(void) 37static void inline flush_mace_bus(void)
38{ 38{
39 volatile unsigned long junk = mace->perif.ctrl.misc; 39 mace->perif.ctrl.misc;
40} 40}
41 41
42#undef DEBUG_IRQ 42#undef DEBUG_IRQ
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 2d80653aa2af..41e9ab40cd54 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2057,10 +2057,45 @@ static void __init flatten_device_tree(void)
2057 2057
2058} 2058}
2059 2059
2060 2060#ifdef CONFIG_PPC_MAPLE
2061static void __init fixup_device_tree(void) 2061/* PIBS Version 1.05.0000 04/26/2005 has an incorrect /ht/isa/ranges property.
2062 * The values are bad, and it doesn't even have the right number of cells. */
2063static void __init fixup_device_tree_maple(void)
2062{ 2064{
2065 phandle isa;
2066 u32 isa_ranges[6];
2067
2068 isa = call_prom("finddevice", 1, 1, ADDR("/ht@0/isa@4"));
2069 if (!PHANDLE_VALID(isa))
2070 return;
2071
2072 if (prom_getprop(isa, "ranges", isa_ranges, sizeof(isa_ranges))
2073 == PROM_ERROR)
2074 return;
2075
2076 if (isa_ranges[0] != 0x1 ||
2077 isa_ranges[1] != 0xf4000000 ||
2078 isa_ranges[2] != 0x00010000)
2079 return;
2080
2081 prom_printf("fixing up bogus ISA range on Maple...\n");
2082
2083 isa_ranges[0] = 0x1;
2084 isa_ranges[1] = 0x0;
2085 isa_ranges[2] = 0x01002000; /* IO space; PCI device = 4 */
2086 isa_ranges[3] = 0x0;
2087 isa_ranges[4] = 0x0;
2088 isa_ranges[5] = 0x00010000;
2089 prom_setprop(isa, "/ht@0/isa@4", "ranges",
2090 isa_ranges, sizeof(isa_ranges));
2091}
2092#else
2093#define fixup_device_tree_maple()
2094#endif
2095
2063#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC) 2096#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
2097static void __init fixup_device_tree_pmac(void)
2098{
2064 phandle u3, i2c, mpic; 2099 phandle u3, i2c, mpic;
2065 u32 u3_rev; 2100 u32 u3_rev;
2066 u32 interrupts[2]; 2101 u32 interrupts[2];
@@ -2097,9 +2132,16 @@ static void __init fixup_device_tree(void)
2097 parent = (u32)mpic; 2132 parent = (u32)mpic;
2098 prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent", 2133 prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent",
2099 &parent, sizeof(parent)); 2134 &parent, sizeof(parent));
2100#endif
2101} 2135}
2136#else
2137#define fixup_device_tree_pmac()
2138#endif
2102 2139
2140static void __init fixup_device_tree(void)
2141{
2142 fixup_device_tree_maple();
2143 fixup_device_tree_pmac();
2144}
2103 2145
2104static void __init prom_find_boot_cpu(void) 2146static void __init prom_find_boot_cpu(void)
2105{ 2147{
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index df2343e1956b..c896ce83d412 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -1157,6 +1157,7 @@ EXPORT_SYMBOL_GPL(pmac_i2c_xfer);
1157/* some quirks for platform function decoding */ 1157/* some quirks for platform function decoding */
1158enum { 1158enum {
1159 pmac_i2c_quirk_invmask = 0x00000001u, 1159 pmac_i2c_quirk_invmask = 0x00000001u,
1160 pmac_i2c_quirk_skip = 0x00000002u,
1160}; 1161};
1161 1162
1162static void pmac_i2c_devscan(void (*callback)(struct device_node *dev, 1163static void pmac_i2c_devscan(void (*callback)(struct device_node *dev,
@@ -1172,6 +1173,15 @@ static void pmac_i2c_devscan(void (*callback)(struct device_node *dev,
1172 /* XXX Study device-tree's & apple drivers are get the quirks 1173 /* XXX Study device-tree's & apple drivers are get the quirks
1173 * right ! 1174 * right !
1174 */ 1175 */
1176 /* Workaround: It seems that running the clockspreading
1177 * properties on the eMac will cause lockups during boot.
1178 * The machine seems to work fine without that. So for now,
1179 * let's make sure i2c-hwclock doesn't match about "imic"
1180 * clocks and we'll figure out if we really need to do
1181 * something special about those later.
1182 */
1183 { "i2c-hwclock", "imic5002", pmac_i2c_quirk_skip },
1184 { "i2c-hwclock", "imic5003", pmac_i2c_quirk_skip },
1175 { "i2c-hwclock", NULL, pmac_i2c_quirk_invmask }, 1185 { "i2c-hwclock", NULL, pmac_i2c_quirk_invmask },
1176 { "i2c-cpu-voltage", NULL, 0}, 1186 { "i2c-cpu-voltage", NULL, 0},
1177 { "temp-monitor", NULL, 0 }, 1187 { "temp-monitor", NULL, 0 },
@@ -1198,6 +1208,8 @@ static void pmac_i2c_devscan(void (*callback)(struct device_node *dev,
1198 if (p->compatible && 1208 if (p->compatible &&
1199 !device_is_compatible(np, p->compatible)) 1209 !device_is_compatible(np, p->compatible))
1200 continue; 1210 continue;
1211 if (p->quirks & pmac_i2c_quirk_skip)
1212 break;
1201 callback(np, p->quirks); 1213 callback(np, p->quirks);
1202 break; 1214 break;
1203 } 1215 }
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c
index 4baa75b1d36f..f08173b0f065 100644
--- a/arch/powerpc/platforms/powermac/pfunc_core.c
+++ b/arch/powerpc/platforms/powermac/pfunc_core.c
@@ -11,6 +11,7 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/spinlock.h> 12#include <linux/spinlock.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/mutex.h>
14 15
15#include <asm/semaphore.h> 16#include <asm/semaphore.h>
16#include <asm/prom.h> 17#include <asm/prom.h>
@@ -546,6 +547,7 @@ struct pmf_device {
546 547
547static LIST_HEAD(pmf_devices); 548static LIST_HEAD(pmf_devices);
548static spinlock_t pmf_lock = SPIN_LOCK_UNLOCKED; 549static spinlock_t pmf_lock = SPIN_LOCK_UNLOCKED;
550static DEFINE_MUTEX(pmf_irq_mutex);
549 551
550static void pmf_release_device(struct kref *kref) 552static void pmf_release_device(struct kref *kref)
551{ 553{
@@ -864,15 +866,17 @@ int pmf_register_irq_client(struct device_node *target,
864 866
865 spin_lock_irqsave(&pmf_lock, flags); 867 spin_lock_irqsave(&pmf_lock, flags);
866 func = __pmf_find_function(target, name, PMF_FLAGS_INT_GEN); 868 func = __pmf_find_function(target, name, PMF_FLAGS_INT_GEN);
867 if (func == NULL) { 869 if (func)
868 spin_unlock_irqrestore(&pmf_lock, flags); 870 func = pmf_get_function(func);
871 spin_unlock_irqrestore(&pmf_lock, flags);
872 if (func == NULL)
869 return -ENODEV; 873 return -ENODEV;
870 } 874 mutex_lock(&pmf_irq_mutex);
871 if (list_empty(&func->irq_clients)) 875 if (list_empty(&func->irq_clients))
872 func->dev->handlers->irq_enable(func); 876 func->dev->handlers->irq_enable(func);
873 list_add(&client->link, &func->irq_clients); 877 list_add(&client->link, &func->irq_clients);
874 client->func = func; 878 client->func = func;
875 spin_unlock_irqrestore(&pmf_lock, flags); 879 mutex_unlock(&pmf_irq_mutex);
876 880
877 return 0; 881 return 0;
878} 882}
@@ -881,16 +885,16 @@ EXPORT_SYMBOL_GPL(pmf_register_irq_client);
881void pmf_unregister_irq_client(struct pmf_irq_client *client) 885void pmf_unregister_irq_client(struct pmf_irq_client *client)
882{ 886{
883 struct pmf_function *func = client->func; 887 struct pmf_function *func = client->func;
884 unsigned long flags;
885 888
886 BUG_ON(func == NULL); 889 BUG_ON(func == NULL);
887 890
888 spin_lock_irqsave(&pmf_lock, flags); 891 mutex_lock(&pmf_irq_mutex);
889 client->func = NULL; 892 client->func = NULL;
890 list_del(&client->link); 893 list_del(&client->link);
891 if (list_empty(&func->irq_clients)) 894 if (list_empty(&func->irq_clients))
892 func->dev->handlers->irq_disable(func); 895 func->dev->handlers->irq_disable(func);
893 spin_unlock_irqrestore(&pmf_lock, flags); 896 mutex_unlock(&pmf_irq_mutex);
897 pmf_put_function(func);
894} 898}
895EXPORT_SYMBOL_GPL(pmf_unregister_irq_client); 899EXPORT_SYMBOL_GPL(pmf_unregister_irq_client);
896 900
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 4d15e396655c..b9200fb07815 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -463,11 +463,23 @@ static int pmac_pm_finish(suspend_state_t state)
463 return 0; 463 return 0;
464} 464}
465 465
466static int pmac_pm_valid(suspend_state_t state)
467{
468 switch (state) {
469 case PM_SUSPEND_DISK:
470 return 1;
471 /* can't do any other states via generic mechanism yet */
472 default:
473 return 0;
474 }
475}
476
466static struct pm_ops pmac_pm_ops = { 477static struct pm_ops pmac_pm_ops = {
467 .pm_disk_mode = PM_DISK_SHUTDOWN, 478 .pm_disk_mode = PM_DISK_SHUTDOWN,
468 .prepare = pmac_pm_prepare, 479 .prepare = pmac_pm_prepare,
469 .enter = pmac_pm_enter, 480 .enter = pmac_pm_enter,
470 .finish = pmac_pm_finish, 481 .finish = pmac_pm_finish,
482 .valid = pmac_pm_valid,
471}; 483};
472 484
473#endif /* CONFIG_SOFTWARE_SUSPEND */ 485#endif /* CONFIG_SOFTWARE_SUSPEND */
diff --git a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c
index cc7c4aea9397..2f5c5e157617 100644
--- a/arch/ppc/kernel/asm-offsets.c
+++ b/arch/ppc/kernel/asm-offsets.c
@@ -134,7 +134,7 @@ main(void)
134 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 134 DEFINE(TI_TASK, offsetof(struct thread_info, task));
135 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); 135 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
136 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 136 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
137 DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, flags)); 137 DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
138 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 138 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
139 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); 139 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
140 140
diff --git a/arch/ppc/platforms/mpc8272ads_setup.c b/arch/ppc/platforms/mpc8272ads_setup.c
index e62b75707f7a..abb7154de2c7 100644
--- a/arch/ppc/platforms/mpc8272ads_setup.c
+++ b/arch/ppc/platforms/mpc8272ads_setup.c
@@ -279,11 +279,11 @@ static int mpc8272ads_platform_notify(struct device *dev)
279 static const struct platform_notify_dev_map dev_map[] = { 279 static const struct platform_notify_dev_map dev_map[] = {
280 { 280 {
281 .bus_id = "fsl-cpm-fcc", 281 .bus_id = "fsl-cpm-fcc",
282 .rtn = mpc8272ads_fixup_enet_pdata 282 .rtn = mpc8272ads_fixup_enet_pdata,
283 }, 283 },
284 { 284 {
285 .bus_id = "fsl-cpm-scc:uart", 285 .bus_id = "fsl-cpm-scc:uart",
286 .rtn = mpc 286 .rtn = mpc8272ads_fixup_uart_pdata,
287 }, 287 },
288 { 288 {
289 .bus_id = NULL 289 .bus_id = NULL
@@ -335,15 +335,15 @@ struct platform_device* early_uart_get_pdev(int index)
335 struct platform_device* pdev = NULL; 335 struct platform_device* pdev = NULL;
336 if(index) { /*assume SCC4 here*/ 336 if(index) { /*assume SCC4 here*/
337 pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC4]; 337 pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC4];
338 pinfo = &mpc8272<F12>_uart_pdata[1]; 338 pinfo = &mpc8272_uart_pdata[fsid_scc4_uart];
339 } else { /*over SCC1*/ 339 } else { /*over SCC1*/
340 pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC1]; 340 pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC1];
341 pinfo = &mpc8272_uart_pdata[0]; 341 pinfo = &mpc8272_uart_pdata[fsid_scc1_uart];
342 } 342 }
343 343
344 pinfo->uart_clk = bd->bi_intfreq; 344 pinfo->uart_clk = bd->bi_intfreq;
345 pdev->dev.platform_data = pinfo; 345 pdev->dev.platform_data = pinfo;
346 ppc_sys_fixup_mem_resource(pdev, IMAP_ADDR); 346 ppc_sys_fixup_mem_resource(pdev, CPM_MAP_ADDR);
347 return NULL; 347 return NULL;
348} 348}
349 349
diff --git a/arch/ppc/syslib/pq2_devices.c b/arch/ppc/syslib/pq2_devices.c
index 0636aed7b827..8692d00c08c4 100644
--- a/arch/ppc/syslib/pq2_devices.c
+++ b/arch/ppc/syslib/pq2_devices.c
@@ -121,13 +121,13 @@ struct platform_device ppc_sys_platform_devices[] = {
121 .num_resources = 3, 121 .num_resources = 3,
122 .resource = (struct resource[]) { 122 .resource = (struct resource[]) {
123 { 123 {
124 .name = "scc_mem", 124 .name = "regs",
125 .start = 0x11A00, 125 .start = 0x11A00,
126 .end = 0x11A1F, 126 .end = 0x11A1F,
127 .flags = IORESOURCE_MEM, 127 .flags = IORESOURCE_MEM,
128 }, 128 },
129 { 129 {
130 .name = "scc_pram", 130 .name = "pram",
131 .start = 0x8000, 131 .start = 0x8000,
132 .end = 0x80ff, 132 .end = 0x80ff,
133 .flags = IORESOURCE_MEM, 133 .flags = IORESOURCE_MEM,
@@ -145,13 +145,13 @@ struct platform_device ppc_sys_platform_devices[] = {
145 .num_resources = 3, 145 .num_resources = 3,
146 .resource = (struct resource[]) { 146 .resource = (struct resource[]) {
147 { 147 {
148 .name = "scc_mem", 148 .name = "regs",
149 .start = 0x11A20, 149 .start = 0x11A20,
150 .end = 0x11A3F, 150 .end = 0x11A3F,
151 .flags = IORESOURCE_MEM, 151 .flags = IORESOURCE_MEM,
152 }, 152 },
153 { 153 {
154 .name = "scc_pram", 154 .name = "pram",
155 .start = 0x8100, 155 .start = 0x8100,
156 .end = 0x81ff, 156 .end = 0x81ff,
157 .flags = IORESOURCE_MEM, 157 .flags = IORESOURCE_MEM,
@@ -169,13 +169,13 @@ struct platform_device ppc_sys_platform_devices[] = {
169 .num_resources = 3, 169 .num_resources = 3,
170 .resource = (struct resource[]) { 170 .resource = (struct resource[]) {
171 { 171 {
172 .name = "scc_mem", 172 .name = "regs",
173 .start = 0x11A40, 173 .start = 0x11A40,
174 .end = 0x11A5F, 174 .end = 0x11A5F,
175 .flags = IORESOURCE_MEM, 175 .flags = IORESOURCE_MEM,
176 }, 176 },
177 { 177 {
178 .name = "scc_pram", 178 .name = "pram",
179 .start = 0x8200, 179 .start = 0x8200,
180 .end = 0x82ff, 180 .end = 0x82ff,
181 .flags = IORESOURCE_MEM, 181 .flags = IORESOURCE_MEM,
@@ -193,13 +193,13 @@ struct platform_device ppc_sys_platform_devices[] = {
193 .num_resources = 3, 193 .num_resources = 3,
194 .resource = (struct resource[]) { 194 .resource = (struct resource[]) {
195 { 195 {
196 .name = "scc_mem", 196 .name = "regs",
197 .start = 0x11A60, 197 .start = 0x11A60,
198 .end = 0x11A7F, 198 .end = 0x11A7F,
199 .flags = IORESOURCE_MEM, 199 .flags = IORESOURCE_MEM,
200 }, 200 },
201 { 201 {
202 .name = "scc_pram", 202 .name = "pram",
203 .start = 0x8300, 203 .start = 0x8300,
204 .end = 0x83ff, 204 .end = 0x83ff,
205 .flags = IORESOURCE_MEM, 205 .flags = IORESOURCE_MEM,
diff --git a/arch/ppc/syslib/pq2_sys.c b/arch/ppc/syslib/pq2_sys.c
index 433b0fa203e1..fee8948162b9 100644
--- a/arch/ppc/syslib/pq2_sys.c
+++ b/arch/ppc/syslib/pq2_sys.c
@@ -139,13 +139,13 @@ struct ppc_sys_spec ppc_sys_specs[] = {
139 .ppc_sys_name = "8272", 139 .ppc_sys_name = "8272",
140 .mask = 0x0000ff00, 140 .mask = 0x0000ff00,
141 .value = 0x00000c00, 141 .value = 0x00000c00,
142 .num_devices = 11, 142 .num_devices = 12,
143 .device_list = (enum ppc_sys_devices[]) 143 .device_list = (enum ppc_sys_devices[])
144 { 144 {
145 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1, 145 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
146 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1, 146 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4,
147 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C, 147 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
148 MPC82xx_CPM_USB, MPC82xx_SEC1, 148 MPC82xx_CPM_I2C, MPC82xx_CPM_USB, MPC82xx_SEC1,
149 }, 149 },
150 }, 150 },
151 /* below is a list of the 8280 family of processors */ 151 /* below is a list of the 8280 family of processors */
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index ce19ad4e92ec..2a6c6efb6865 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -272,7 +272,7 @@ static inline void stop_hz_timer(void)
272 next = next_timer_interrupt(); 272 next = next_timer_interrupt();
273 do { 273 do {
274 seq = read_seqbegin_irqsave(&xtime_lock, flags); 274 seq = read_seqbegin_irqsave(&xtime_lock, flags);
275 timer = (__u64 next) - (__u64 jiffies) + jiffies_64; 275 timer = ((__u64) next) - ((__u64) jiffies) + jiffies_64;
276 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); 276 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
277 todval = -1ULL; 277 todval = -1ULL;
278 /* Be careful about overflows. */ 278 /* Be careful about overflows. */
diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
index 3eadac5e171e..31c5892f5acc 100644
--- a/arch/sparc64/kernel/head.S
+++ b/arch/sparc64/kernel/head.S
@@ -10,6 +10,7 @@
10#include <linux/config.h> 10#include <linux/config.h>
11#include <linux/version.h> 11#include <linux/version.h>
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/threads.h>
13#include <asm/thread_info.h> 14#include <asm/thread_info.h>
14#include <asm/asi.h> 15#include <asm/asi.h>
15#include <asm/pstate.h> 16#include <asm/pstate.h>
@@ -493,6 +494,35 @@ tlb_fixup_done:
493 call prom_init 494 call prom_init
494 mov %l7, %o0 ! OpenPROM cif handler 495 mov %l7, %o0 ! OpenPROM cif handler
495 496
497 /* Initialize current_thread_info()->cpu as early as possible.
498 * In order to do that accurately we have to patch up the get_cpuid()
499 * assembler sequences. And that, in turn, requires that we know
500 * if we are on a Starfire box or not. While we're here, patch up
501 * the sun4v sequences as well.
502 */
503 call check_if_starfire
504 nop
505 call per_cpu_patch
506 nop
507 call sun4v_patch
508 nop
509
510#ifdef CONFIG_SMP
511 call hard_smp_processor_id
512 nop
513 cmp %o0, NR_CPUS
514 blu,pt %xcc, 1f
515 nop
516 call boot_cpu_id_too_large
517 nop
518 /* Not reached... */
519
5201:
521#else
522 mov 0, %o0
523#endif
524 stb %o0, [%g6 + TI_CPU]
525
496 /* Off we go.... */ 526 /* Off we go.... */
497 call start_kernel 527 call start_kernel
498 nop 528 nop
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index 005167f82419..9cf1c88cd774 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -220,7 +220,7 @@ char reboot_command[COMMAND_LINE_SIZE];
220 220
221static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 }; 221static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 };
222 222
223static void __init per_cpu_patch(void) 223void __init per_cpu_patch(void)
224{ 224{
225 struct cpuid_patch_entry *p; 225 struct cpuid_patch_entry *p;
226 unsigned long ver; 226 unsigned long ver;
@@ -280,7 +280,7 @@ static void __init per_cpu_patch(void)
280 } 280 }
281} 281}
282 282
283static void __init sun4v_patch(void) 283void __init sun4v_patch(void)
284{ 284{
285 struct sun4v_1insn_patch_entry *p1; 285 struct sun4v_1insn_patch_entry *p1;
286 struct sun4v_2insn_patch_entry *p2; 286 struct sun4v_2insn_patch_entry *p2;
@@ -315,6 +315,15 @@ static void __init sun4v_patch(void)
315 } 315 }
316} 316}
317 317
318#ifdef CONFIG_SMP
319void __init boot_cpu_id_too_large(int cpu)
320{
321 prom_printf("Serious problem, boot cpu id (%d) >= NR_CPUS (%d)\n",
322 cpu, NR_CPUS);
323 prom_halt();
324}
325#endif
326
318void __init setup_arch(char **cmdline_p) 327void __init setup_arch(char **cmdline_p)
319{ 328{
320 /* Initialize PROM console and command line. */ 329 /* Initialize PROM console and command line. */
@@ -332,16 +341,6 @@ void __init setup_arch(char **cmdline_p)
332 conswitchp = &prom_con; 341 conswitchp = &prom_con;
333#endif 342#endif
334 343
335 /* Work out if we are starfire early on */
336 check_if_starfire();
337
338 /* Now we know enough to patch the get_cpuid sequences
339 * used by trap code.
340 */
341 per_cpu_patch();
342
343 sun4v_patch();
344
345 boot_flags_init(*cmdline_p); 344 boot_flags_init(*cmdline_p);
346 345
347 idprom_init(); 346 idprom_init();
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 90eaca3ec9a6..4e8cd79156e0 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -1264,7 +1264,6 @@ void __init smp_tick_init(void)
1264 boot_cpu_id = hard_smp_processor_id(); 1264 boot_cpu_id = hard_smp_processor_id();
1265 current_tick_offset = timer_tick_offset; 1265 current_tick_offset = timer_tick_offset;
1266 1266
1267 cpu_set(boot_cpu_id, cpu_online_map);
1268 prof_counter(boot_cpu_id) = prof_multiplier(boot_cpu_id) = 1; 1267 prof_counter(boot_cpu_id) = prof_multiplier(boot_cpu_id) = 1;
1269} 1268}
1270 1269
@@ -1345,18 +1344,6 @@ void __init smp_setup_cpu_possible_map(void)
1345 1344
1346void __devinit smp_prepare_boot_cpu(void) 1345void __devinit smp_prepare_boot_cpu(void)
1347{ 1346{
1348 int cpu = hard_smp_processor_id();
1349
1350 if (cpu >= NR_CPUS) {
1351 prom_printf("Serious problem, boot cpu id >= NR_CPUS\n");
1352 prom_halt();
1353 }
1354
1355 current_thread_info()->cpu = cpu;
1356 __local_per_cpu_offset = __per_cpu_offset(cpu);
1357
1358 cpu_set(smp_processor_id(), cpu_online_map);
1359 cpu_set(smp_processor_id(), phys_cpu_present_map);
1360} 1347}
1361 1348
1362int __devinit __cpu_up(unsigned int cpu) 1349int __devinit __cpu_up(unsigned int cpu)
@@ -1433,4 +1420,7 @@ void __init setup_per_cpu_areas(void)
1433 1420
1434 for (i = 0; i < NR_CPUS; i++, ptr += size) 1421 for (i = 0; i < NR_CPUS; i++, ptr += size)
1435 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); 1422 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
1423
1424 /* Setup %g5 for the boot cpu. */
1425 __local_per_cpu_offset = __per_cpu_offset(smp_processor_id());
1436} 1426}
diff --git a/arch/sparc64/lib/checksum.S b/arch/sparc64/lib/checksum.S
index ba9cd3ccc2b2..1d230f693dc4 100644
--- a/arch/sparc64/lib/checksum.S
+++ b/arch/sparc64/lib/checksum.S
@@ -165,8 +165,9 @@ csum_partial_end_cruft:
165 sll %g1, 8, %g1 165 sll %g1, 8, %g1
166 or %o5, %g1, %o4 166 or %o5, %g1, %o4
167 167
1681: add %o2, %o4, %o2 1681: addcc %o2, %o4, %o2
169 addc %g0, %o2, %o2
169 170
170csum_partial_finish: 171csum_partial_finish:
171 retl 172 retl
172 mov %o2, %o0 173 srl %o2, 0, %o0
diff --git a/arch/sparc64/lib/csum_copy.S b/arch/sparc64/lib/csum_copy.S
index 71af48839064..e566c770a0f6 100644
--- a/arch/sparc64/lib/csum_copy.S
+++ b/arch/sparc64/lib/csum_copy.S
@@ -221,11 +221,12 @@ FUNC_NAME: /* %o0=src, %o1=dst, %o2=len, %o3=sum */
221 sll %g1, 8, %g1 221 sll %g1, 8, %g1
222 or %o5, %g1, %o4 222 or %o5, %g1, %o4
223 223
2241: add %o3, %o4, %o3 2241: addcc %o3, %o4, %o3
225 addc %g0, %o3, %o3
225 226
22670: 22770:
227 retl 228 retl
228 mov %o3, %o0 229 srl %o3, 0, %o0
229 230
23095: mov 0, GLOBAL_SPARE 23195: mov 0, GLOBAL_SPARE
231 brlez,pn %o2, 4f 232 brlez,pn %o2, 4f
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386
index 7a0e04e34bf9..b65ca115ef77 100644
--- a/arch/um/Makefile-i386
+++ b/arch/um/Makefile-i386
@@ -33,5 +33,9 @@ include $(srctree)/arch/i386/Makefile.cpu
33# prevent gcc from keeping the stack 16 byte aligned. Taken from i386. 33# prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
34cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) 34cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
35 35
36# Prevent sprintf in nfsd from being converted to strcpy and resulting in
37# an unresolved reference.
38cflags-y += -ffreestanding
39
36CFLAGS += $(cflags-y) 40CFLAGS += $(cflags-y)
37USER_CFLAGS += $(cflags-y) 41USER_CFLAGS += $(cflags-y)
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h
index efa3d33c0be6..310980b32173 100644
--- a/arch/um/include/kern_util.h
+++ b/arch/um/include/kern_util.h
@@ -120,20 +120,11 @@ extern int is_syscall(unsigned long addr);
120extern void free_irq(unsigned int, void *); 120extern void free_irq(unsigned int, void *);
121extern int cpu(void); 121extern int cpu(void);
122 122
123extern void time_init_kern(void);
124
123/* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */ 125/* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */
124extern int __cant_sleep(void); 126extern int __cant_sleep(void);
125extern void segv_handler(int sig, union uml_pt_regs *regs); 127extern void segv_handler(int sig, union uml_pt_regs *regs);
126extern void sigio_handler(int sig, union uml_pt_regs *regs); 128extern void sigio_handler(int sig, union uml_pt_regs *regs);
127 129
128#endif 130#endif
129
130/*
131 * Overrides for Emacs so that we follow Linus's tabbing style.
132 * Emacs will notice this stuff at the end of the file and automatically
133 * adjust the settings for this buffer only. This must remain at the end
134 * of the file.
135 * ---------------------------------------------------------------------------
136 * Local variables:
137 * c-file-style: "linux"
138 * End:
139 */
diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c
index 528cf623f8b4..86f51d04c98d 100644
--- a/arch/um/kernel/time_kern.c
+++ b/arch/um/kernel/time_kern.c
@@ -84,6 +84,16 @@ void timer_irq(union uml_pt_regs *regs)
84 } 84 }
85} 85}
86 86
87
88void time_init_kern(void)
89{
90 unsigned long long nsecs;
91
92 nsecs = os_nsecs();
93 set_normalized_timespec(&wall_to_monotonic, -nsecs / BILLION,
94 -nsecs % BILLION);
95}
96
87void do_boot_timer_handler(struct sigcontext * sc) 97void do_boot_timer_handler(struct sigcontext * sc)
88{ 98{
89 struct pt_regs regs; 99 struct pt_regs regs;
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
index 3a0ac38e978b..90912aaca7aa 100644
--- a/arch/um/os-Linux/main.c
+++ b/arch/um/os-Linux/main.c
@@ -59,7 +59,7 @@ static __init void do_uml_initcalls(void)
59 initcall_t *call; 59 initcall_t *call;
60 60
61 call = &__uml_initcall_start; 61 call = &__uml_initcall_start;
62 while (call < &__uml_initcall_end){; 62 while (call < &__uml_initcall_end){
63 (*call)(); 63 (*call)();
64 call++; 64 call++;
65 } 65 }
diff --git a/arch/um/os-Linux/time.c b/arch/um/os-Linux/time.c
index 6f7626775acb..280c4fb9b585 100644
--- a/arch/um/os-Linux/time.c
+++ b/arch/um/os-Linux/time.c
@@ -81,20 +81,12 @@ void uml_idle_timer(void)
81 set_interval(ITIMER_REAL); 81 set_interval(ITIMER_REAL);
82} 82}
83 83
84extern void ktime_get_ts(struct timespec *ts);
85#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
86
87void time_init(void) 84void time_init(void)
88{ 85{
89 struct timespec now;
90
91 if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR) 86 if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR)
92 panic("Couldn't set SIGVTALRM handler"); 87 panic("Couldn't set SIGVTALRM handler");
93 set_interval(ITIMER_VIRTUAL); 88 set_interval(ITIMER_VIRTUAL);
94 89 time_init_kern();
95 do_posix_clock_monotonic_gettime(&now);
96 wall_to_monotonic.tv_sec = -now.tv_sec;
97 wall_to_monotonic.tv_nsec = -now.tv_nsec;
98} 90}
99 91
100unsigned long long os_nsecs(void) 92unsigned long long os_nsecs(void)
diff --git a/arch/um/sys-i386/syscalls.c b/arch/um/sys-i386/syscalls.c
index 749dd1bfe60f..710d5fb807e1 100644
--- a/arch/um/sys-i386/syscalls.c
+++ b/arch/um/sys-i386/syscalls.c
@@ -99,11 +99,12 @@ long sys_ipc (uint call, int first, int second,
99 99
100 switch (call) { 100 switch (call) {
101 case SEMOP: 101 case SEMOP:
102 return sys_semtimedop(first, (struct sembuf *) ptr, second, 102 return sys_semtimedop(first, (struct sembuf __user *) ptr,
103 NULL); 103 second, NULL);
104 case SEMTIMEDOP: 104 case SEMTIMEDOP:
105 return sys_semtimedop(first, (struct sembuf *) ptr, second, 105 return sys_semtimedop(first, (struct sembuf __user *) ptr,
106 (const struct timespec *) fifth); 106 second,
107 (const struct timespec __user *) fifth);
107 case SEMGET: 108 case SEMGET:
108 return sys_semget (first, second, third); 109 return sys_semget (first, second, third);
109 case SEMCTL: { 110 case SEMCTL: {
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index a4c46a8af008..9edf114faf79 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -21,7 +21,7 @@
21#include "skas.h" 21#include "skas.h"
22 22
23static int copy_sc_from_user_skas(struct pt_regs *regs, 23static int copy_sc_from_user_skas(struct pt_regs *regs,
24 struct sigcontext *from) 24 struct sigcontext __user *from)
25{ 25{
26 int err = 0; 26 int err = 0;
27 27
@@ -54,7 +54,8 @@ static int copy_sc_from_user_skas(struct pt_regs *regs,
54 return(err); 54 return(err);
55} 55}
56 56
57int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp, 57int copy_sc_to_user_skas(struct sigcontext __user *to,
58 struct _fpstate __user *to_fp,
58 struct pt_regs *regs, unsigned long mask, 59 struct pt_regs *regs, unsigned long mask,
59 unsigned long sp) 60 unsigned long sp)
60{ 61{
@@ -106,10 +107,11 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
106#endif 107#endif
107 108
108#ifdef CONFIG_MODE_TT 109#ifdef CONFIG_MODE_TT
109int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from, 110int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext __user *from,
110 int fpsize) 111 int fpsize)
111{ 112{
112 struct _fpstate *to_fp, *from_fp; 113 struct _fpstate *to_fp;
114 struct _fpstate __user *from_fp;
113 unsigned long sigs; 115 unsigned long sigs;
114 int err; 116 int err;
115 117
@@ -124,13 +126,14 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
124 return(err); 126 return(err);
125} 127}
126 128
127int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp, 129int copy_sc_to_user_tt(struct sigcontext __user *to, struct _fpstate __user *fp,
128 struct sigcontext *from, int fpsize, unsigned long sp) 130 struct sigcontext *from, int fpsize, unsigned long sp)
129{ 131{
130 struct _fpstate *to_fp, *from_fp; 132 struct _fpstate __user *to_fp;
133 struct _fpstate *from_fp;
131 int err; 134 int err;
132 135
133 to_fp = (fp ? fp : (struct _fpstate *) (to + 1)); 136 to_fp = (fp ? fp : (struct _fpstate __user *) (to + 1));
134 from_fp = from->fpstate; 137 from_fp = from->fpstate;
135 err = copy_to_user(to, from, sizeof(*to)); 138 err = copy_to_user(to, from, sizeof(*to));
136 /* The SP in the sigcontext is the updated one for the signal 139 /* The SP in the sigcontext is the updated one for the signal
@@ -158,7 +161,8 @@ static int copy_sc_from_user(struct pt_regs *to, void __user *from)
158 return(ret); 161 return(ret);
159} 162}
160 163
161static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp, 164static int copy_sc_to_user(struct sigcontext __user *to,
165 struct _fpstate __user *fp,
162 struct pt_regs *from, unsigned long mask, 166 struct pt_regs *from, unsigned long mask,
163 unsigned long sp) 167 unsigned long sp)
164{ 168{
@@ -169,7 +173,7 @@ static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp,
169 173
170struct rt_sigframe 174struct rt_sigframe
171{ 175{
172 char *pretcode; 176 char __user *pretcode;
173 struct ucontext uc; 177 struct ucontext uc;
174 struct siginfo info; 178 struct siginfo info;
175}; 179};
@@ -188,7 +192,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
188 192
189 frame = (struct rt_sigframe __user *) 193 frame = (struct rt_sigframe __user *)
190 round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; 194 round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8;
191 frame = (struct rt_sigframe *) ((unsigned long) frame - 128); 195 frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128);
192 196
193 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) 197 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate)))
194 goto out; 198 goto out;
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c
index 6acee5c4ada6..6fce9f45dfdc 100644
--- a/arch/um/sys-x86_64/syscalls.c
+++ b/arch/um/sys-x86_64/syscalls.c
@@ -45,7 +45,7 @@ static long arch_prctl_tt(int code, unsigned long addr)
45 case ARCH_GET_GS: 45 case ARCH_GET_GS:
46 ret = arch_prctl(code, (unsigned long) &tmp); 46 ret = arch_prctl(code, (unsigned long) &tmp);
47 if(!ret) 47 if(!ret)
48 ret = put_user(tmp, &addr); 48 ret = put_user(tmp, (long __user *)addr);
49 break; 49 break;
50 default: 50 default:
51 ret = -EINVAL; 51 ret = -EINVAL;
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c
index e776139afb20..926c4743d13b 100644
--- a/arch/x86_64/ia32/ia32_binfmt.c
+++ b/arch/x86_64/ia32/ia32_binfmt.c
@@ -339,7 +339,7 @@ int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top,
339 struct mm_struct *mm = current->mm; 339 struct mm_struct *mm = current->mm;
340 int i, ret; 340 int i, ret;
341 341
342 stack_base = IA32_STACK_TOP - MAX_ARG_PAGES * PAGE_SIZE; 342 stack_base = stack_top - MAX_ARG_PAGES * PAGE_SIZE;
343 mm->arg_start = bprm->p + stack_base; 343 mm->arg_start = bprm->p + stack_base;
344 344
345 bprm->p += stack_base; 345 bprm->p += stack_base;
@@ -357,7 +357,7 @@ int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top,
357 { 357 {
358 mpnt->vm_mm = mm; 358 mpnt->vm_mm = mm;
359 mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p; 359 mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p;
360 mpnt->vm_end = IA32_STACK_TOP; 360 mpnt->vm_end = stack_top;
361 if (executable_stack == EXSTACK_ENABLE_X) 361 if (executable_stack == EXSTACK_ENABLE_X)
362 mpnt->vm_flags = VM_STACK_FLAGS | VM_EXEC; 362 mpnt->vm_flags = VM_STACK_FLAGS | VM_EXEC;
363 else if (executable_stack == EXSTACK_DISABLE_X) 363 else if (executable_stack == EXSTACK_DISABLE_X)
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
index 222b5b46d2b2..1ef6028f721e 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86_64/kernel/e820.c
@@ -149,7 +149,7 @@ unsigned long __init find_e820_area(unsigned long start, unsigned long end, unsi
149 addr = start; 149 addr = start;
150 if (addr > ei->addr + ei->size) 150 if (addr > ei->addr + ei->size)
151 continue; 151 continue;
152 while (bad_addr(&addr, size) && addr+size < ei->addr + ei->size) 152 while (bad_addr(&addr, size) && addr+size <= ei->addr+ei->size)
153 ; 153 ;
154 last = addr + size; 154 last = addr + size;
155 if (last > ei->addr + ei->size) 155 if (last > ei->addr + ei->size)
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index c946e4fe67a7..586b34c00c48 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -281,12 +281,7 @@ tracesys:
281 ja 1f 281 ja 1f
282 movq %r10,%rcx /* fixup for C */ 282 movq %r10,%rcx /* fixup for C */
283 call *sys_call_table(,%rax,8) 283 call *sys_call_table(,%rax,8)
284 movq %rax,RAX-ARGOFFSET(%rsp) 2841: movq %rax,RAX-ARGOFFSET(%rsp)
2851: SAVE_REST
286 movq %rsp,%rdi
287 call syscall_trace_leave
288 RESTORE_TOP_OF_STACK %rbx
289 RESTORE_REST
290 /* Use IRET because user could have changed frame */ 285 /* Use IRET because user could have changed frame */
291 jmp int_ret_from_sys_call 286 jmp int_ret_from_sys_call
292 CFI_ENDPROC 287 CFI_ENDPROC
diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c
index af035ede70cd..a9275c9557cf 100644
--- a/arch/x86_64/kernel/pci-dma.c
+++ b/arch/x86_64/kernel/pci-dma.c
@@ -54,6 +54,10 @@ dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order)
54 else 54 else
55#endif 55#endif
56 node = numa_node_id(); 56 node = numa_node_id();
57
58 if (node < first_node(node_online_map))
59 node = first_node(node_online_map);
60
57 page = alloc_pages_node(node, gfp, order); 61 page = alloc_pages_node(node, gfp, order);
58 return page ? page_address(page) : NULL; 62 return page ? page_address(page) : NULL;
59} 63}
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
index 2480d3f08a47..82a7c9bfdfa0 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86_64/kernel/pci-gart.c
@@ -631,10 +631,8 @@ static int __init pci_iommu_init(void)
631 printk(KERN_INFO "PCI-DMA: Disabling IOMMU.\n"); 631 printk(KERN_INFO "PCI-DMA: Disabling IOMMU.\n");
632 if (end_pfn > MAX_DMA32_PFN) { 632 if (end_pfn > MAX_DMA32_PFN) {
633 printk(KERN_ERR "WARNING more than 4GB of memory " 633 printk(KERN_ERR "WARNING more than 4GB of memory "
634 "but IOMMU not compiled in.\n" 634 "but IOMMU not available.\n"
635 KERN_ERR "WARNING 32bit PCI may malfunction.\n" 635 KERN_ERR "WARNING 32bit PCI may malfunction.\n");
636 KERN_ERR "You might want to enable "
637 "CONFIG_GART_IOMMU\n");
638 } 636 }
639 return -1; 637 return -1;
640 } 638 }
diff --git a/arch/x86_64/kernel/pmtimer.c b/arch/x86_64/kernel/pmtimer.c
index b0444a415bd6..bf421ed26808 100644
--- a/arch/x86_64/kernel/pmtimer.c
+++ b/arch/x86_64/kernel/pmtimer.c
@@ -68,7 +68,7 @@ int pmtimer_mark_offset(void)
68 offset_delay = delta % (USEC_PER_SEC / HZ); 68 offset_delay = delta % (USEC_PER_SEC / HZ);
69 69
70 rdtscll(tsc); 70 rdtscll(tsc);
71 vxtime.last_tsc = tsc - offset_delay * cpu_khz; 71 vxtime.last_tsc = tsc - offset_delay * (u64)cpu_khz / 1000;
72 72
73 /* don't calculate delay for first run, 73 /* don't calculate delay for first run,
74 or if we've got less then a tick */ 74 or if we've got less then a tick */
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index f0870bef24d1..655b9192eeb3 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -1051,7 +1051,7 @@ static void srat_detect_node(void)
1051 for now. */ 1051 for now. */
1052 node = apicid_to_node[hard_smp_processor_id()]; 1052 node = apicid_to_node[hard_smp_processor_id()];
1053 if (node == NUMA_NO_NODE) 1053 if (node == NUMA_NO_NODE)
1054 node = 0; 1054 node = first_node(node_online_map);
1055 numa_set_node(cpu, node); 1055 numa_set_node(cpu, node);
1056 1056
1057 if (acpi_numa > 0) 1057 if (acpi_numa > 0)
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index e1513532df29..474df22c6ed2 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -399,8 +399,10 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
399 /* First clean up the node list */ 399 /* First clean up the node list */
400 for (i = 0; i < MAX_NUMNODES; i++) { 400 for (i = 0; i < MAX_NUMNODES; i++) {
401 cutoff_node(i, start, end); 401 cutoff_node(i, start, end);
402 if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) 402 if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) {
403 unparse_node(i); 403 unparse_node(i);
404 node_set_offline(i);
405 }
404 } 406 }
405 407
406 if (acpi_numa <= 0) 408 if (acpi_numa <= 0)