aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/irq.c7
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/kernel/time.c10
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-power.c3
-rw-r--r--arch/arm/mm/tlb-v6.S1
-rw-r--r--arch/h8300/kernel/process.c3
-rw-r--r--arch/i386/kernel/Makefile2
-rw-r--r--arch/i386/kernel/acpi/Makefile2
-rw-r--r--arch/i386/kernel/acpi/boot.c3
-rw-r--r--arch/i386/kernel/acpi/earlyquirk.c8
-rw-r--r--arch/i386/kernel/cpu/common.c4
-rw-r--r--arch/i386/kernel/efi.c14
-rw-r--r--arch/i386/kernel/io_apic.c19
-rw-r--r--arch/i386/kernel/machine_kexec.c14
-rw-r--r--arch/i386/kernel/nmi.c4
-rw-r--r--arch/i386/kernel/setup.c4
-rw-r--r--arch/i386/kernel/time.c4
-rw-r--r--arch/ia64/configs/gensparse_defconfig12
-rw-r--r--arch/ia64/kernel/cyclone.c2
-rw-r--r--arch/ia64/kernel/ivt.S15
-rw-r--r--arch/ia64/kernel/mca_drv.c16
-rw-r--r--arch/ia64/sn/kernel/sn2/sn2_smp.c2
-rw-r--r--arch/ia64/sn/kernel/tiocx.c2
-rw-r--r--arch/mips/Kconfig4
-rw-r--r--arch/mips/Makefile1
-rw-r--r--arch/mips/arc/arc_con.c2
-rw-r--r--arch/mips/kernel/irq-mv6434x.c8
-rw-r--r--arch/mips/kernel/vmlinux.lds.S4
-rw-r--r--arch/mips/mm/tlbex.c34
-rw-r--r--arch/mips/momentum/jaguar_atx/prom.c2
-rw-r--r--arch/mips/momentum/jaguar_atx/setup.c5
-rw-r--r--arch/mips/momentum/ocelot_c/irq.c2
-rw-r--r--arch/mips/momentum/ocelot_c/prom.c2
-rw-r--r--arch/mips/momentum/ocelot_c/setup.c27
-rw-r--r--arch/mips/pci/pci-ocelot-c.c6
-rw-r--r--arch/powerpc/kernel/asm-offsets.c1
-rw-r--r--arch/powerpc/kernel/cputable.c9
-rw-r--r--arch/powerpc/kernel/entry_32.S95
-rw-r--r--arch/powerpc/kernel/entry_64.S94
-rw-r--r--arch/powerpc/kernel/prom_init.c2
-rw-r--r--arch/powerpc/kernel/ptrace.c5
-rw-r--r--arch/powerpc/kernel/signal_32.c19
-rw-r--r--arch/powerpc/kernel/signal_64.c9
-rw-r--r--arch/powerpc/kernel/systbl.S2
-rw-r--r--arch/powerpc/kernel/traps.c2
-rw-r--r--arch/powerpc/platforms/powermac/pfunc_base.c5
-rw-r--r--arch/powerpc/platforms/powermac/pfunc_core.c6
-rw-r--r--arch/powerpc/platforms/powermac/smp.c2
-rw-r--r--arch/ppc/kernel/asm-offsets.c1
-rw-r--r--arch/ppc/kernel/entry.S95
-rw-r--r--arch/s390/lib/spinlock.c15
-rw-r--r--arch/s390/lib/uaccess.S6
-rw-r--r--arch/s390/lib/uaccess64.S6
-rw-r--r--arch/sh/Kconfig4
-rw-r--r--arch/sparc64/kernel/sys32.S2
-rw-r--r--arch/sparc64/kernel/una_asm.S4
-rw-r--r--arch/sparc64/lib/U1copy_from_user.S2
-rw-r--r--arch/sparc64/lib/U1copy_to_user.S2
-rw-r--r--arch/sparc64/lib/U3copy_from_user.S2
-rw-r--r--arch/sparc64/lib/U3copy_to_user.S2
-rw-r--r--arch/sparc64/lib/bzero.S2
-rw-r--r--arch/sparc64/lib/copy_in_user.S2
-rw-r--r--arch/sparc64/lib/csum_copy_from_user.S2
-rw-r--r--arch/sparc64/lib/csum_copy_to_user.S2
-rw-r--r--arch/sparc64/lib/strlen_user.S2
-rw-r--r--arch/sparc64/lib/strncpy_from_user.S2
-rw-r--r--arch/sparc64/solaris/entry64.S2
-rw-r--r--arch/v850/kernel/process.c3
-rw-r--r--arch/x86_64/kernel/machine_kexec.c2
-rw-r--r--arch/xtensa/Kconfig4
-rw-r--r--arch/xtensa/kernel/process.c3
71 files changed, 304 insertions, 364 deletions
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index 9006063e7369..da677f829f76 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -151,8 +151,13 @@ handle_irq(int irq, struct pt_regs * regs)
151 } 151 }
152 152
153 irq_enter(); 153 irq_enter();
154 /*
155 * __do_IRQ() must be called with IPL_MAX. Note that we do not
156 * explicitly enable interrupts afterwards - some MILO PALcode
157 * (namely LX164 one) seems to have severe problems with RTI
158 * at IPL 0.
159 */
154 local_irq_disable(); 160 local_irq_disable();
155 __do_IRQ(irq, regs); 161 __do_IRQ(irq, regs);
156 local_irq_enable();
157 irq_exit(); 162 irq_exit();
158} 163}
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 15dc1a0dffbb..9f80fa502f8f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -78,7 +78,7 @@ menu "System Type"
78 78
79choice 79choice
80 prompt "ARM system type" 80 prompt "ARM system type"
81 default ARCH_RPC 81 default ARCH_VERSATILE
82 82
83config ARCH_CLPS7500 83config ARCH_CLPS7500
84 bool "Cirrus-CL-PS7500FE" 84 bool "Cirrus-CL-PS7500FE"
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index d7d932c02866..d6bd435a6857 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -422,12 +422,14 @@ static int timer_dyn_tick_disable(void)
422void timer_dyn_reprogram(void) 422void timer_dyn_reprogram(void)
423{ 423{
424 struct dyn_tick_timer *dyn_tick = system_timer->dyn_tick; 424 struct dyn_tick_timer *dyn_tick = system_timer->dyn_tick;
425 unsigned long next, seq;
425 426
426 if (dyn_tick) { 427 if (dyn_tick && (dyn_tick->state & DYN_TICK_ENABLED)) {
427 write_seqlock(&xtime_lock); 428 next = next_timer_interrupt();
428 if (dyn_tick->state & DYN_TICK_ENABLED) 429 do {
430 seq = read_seqbegin(&xtime_lock);
429 dyn_tick->reprogram(next_timer_interrupt() - jiffies); 431 dyn_tick->reprogram(next_timer_interrupt() - jiffies);
430 write_sequnlock(&xtime_lock); 432 } while (read_seqretry(&xtime_lock, seq));
431 } 433 }
432} 434}
433 435
diff --git a/arch/arm/mach-ixp4xx/nas100d-power.c b/arch/arm/mach-ixp4xx/nas100d-power.c
index 2bec69bfa715..99d333d7ebdd 100644
--- a/arch/arm/mach-ixp4xx/nas100d-power.c
+++ b/arch/arm/mach-ixp4xx/nas100d-power.c
@@ -56,6 +56,9 @@ static int __init nas100d_power_init(void)
56 56
57static void __exit nas100d_power_exit(void) 57static void __exit nas100d_power_exit(void)
58{ 58{
59 if (!(machine_is_nas100d()))
60 return;
61
59 free_irq(NAS100D_RB_IRQ, NULL); 62 free_irq(NAS100D_RB_IRQ, NULL);
60} 63}
61 64
diff --git a/arch/arm/mm/tlb-v6.S b/arch/arm/mm/tlb-v6.S
index 6f76b89ef46e..fd6adde39091 100644
--- a/arch/arm/mm/tlb-v6.S
+++ b/arch/arm/mm/tlb-v6.S
@@ -80,6 +80,7 @@ ENTRY(v6wbi_flush_kern_tlb_range)
80 add r0, r0, #PAGE_SZ 80 add r0, r0, #PAGE_SZ
81 cmp r0, r1 81 cmp r0, r1
82 blo 1b 82 blo 1b
83 mcr p15, 0, r2, c7, c10, 4 @ data synchronization barrier
83 mov pc, lr 84 mov pc, lr
84 85
85 .section ".text.init", #alloc, #execinstr 86 .section ".text.init", #alloc, #execinstr
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index ed79ae20e88d..dd344f112cfe 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -45,6 +45,9 @@
45#include <asm/setup.h> 45#include <asm/setup.h>
46#include <asm/pgtable.h> 46#include <asm/pgtable.h>
47 47
48void (*pm_power_off)(void) = NULL;
49EXPORT_SYMBOL(pm_power_off);
50
48asmlinkage void ret_from_fork(void); 51asmlinkage void ret_from_fork(void);
49 52
50/* 53/*
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index 53bb9a79e274..65656c033d70 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -11,7 +11,7 @@ obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \
11 11
12obj-y += cpu/ 12obj-y += cpu/
13obj-y += timers/ 13obj-y += timers/
14obj-$(CONFIG_ACPI) += acpi/ 14obj-y += acpi/
15obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o 15obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o
16obj-$(CONFIG_MCA) += mca.o 16obj-$(CONFIG_MCA) += mca.o
17obj-$(CONFIG_X86_MSR) += msr.o 17obj-$(CONFIG_X86_MSR) += msr.o
diff --git a/arch/i386/kernel/acpi/Makefile b/arch/i386/kernel/acpi/Makefile
index d51c7313cae8..7e9ac99354f4 100644
--- a/arch/i386/kernel/acpi/Makefile
+++ b/arch/i386/kernel/acpi/Makefile
@@ -1,4 +1,4 @@
1obj-y := boot.o 1obj-$(CONFIG_ACPI) += boot.o
2obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o 2obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o
3obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o 3obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o
4 4
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 79577f0ace98..f1a21945963d 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -1111,9 +1111,6 @@ int __init acpi_boot_table_init(void)
1111 disable_acpi(); 1111 disable_acpi();
1112 return error; 1112 return error;
1113 } 1113 }
1114#ifdef __i386__
1115 check_acpi_pci();
1116#endif
1117 1114
1118 acpi_table_parse(ACPI_BOOT, acpi_parse_sbf); 1115 acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
1119 1116
diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/i386/kernel/acpi/earlyquirk.c
index f1b9d2a46dab..2e3b643a4dc4 100644
--- a/arch/i386/kernel/acpi/earlyquirk.c
+++ b/arch/i386/kernel/acpi/earlyquirk.c
@@ -7,14 +7,22 @@
7#include <linux/pci.h> 7#include <linux/pci.h>
8#include <asm/pci-direct.h> 8#include <asm/pci-direct.h>
9#include <asm/acpi.h> 9#include <asm/acpi.h>
10#include <asm/apic.h>
10 11
11static int __init check_bridge(int vendor, int device) 12static int __init check_bridge(int vendor, int device)
12{ 13{
14#ifdef CONFIG_ACPI
13 /* According to Nvidia all timer overrides are bogus. Just ignore 15 /* According to Nvidia all timer overrides are bogus. Just ignore
14 them all. */ 16 them all. */
15 if (vendor == PCI_VENDOR_ID_NVIDIA) { 17 if (vendor == PCI_VENDOR_ID_NVIDIA) {
16 acpi_skip_timer_override = 1; 18 acpi_skip_timer_override = 1;
17 } 19 }
20#endif
21 if (vendor == PCI_VENDOR_ID_ATI && timer_over_8254 == 1) {
22 timer_over_8254 = 0;
23 printk(KERN_INFO "ATI board detected. Disabling timer routing "
24 "over 8254.\n");
25 }
18 return 0; 26 return 0;
19} 27}
20 28
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index 4ecd4b326ded..e6bd095ae108 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -278,10 +278,10 @@ void __devinit generic_identify(struct cpuinfo_x86 * c)
278 c->x86_capability[4] = excap; 278 c->x86_capability[4] = excap;
279 c->x86 = (tfms >> 8) & 15; 279 c->x86 = (tfms >> 8) & 15;
280 c->x86_model = (tfms >> 4) & 15; 280 c->x86_model = (tfms >> 4) & 15;
281 if (c->x86 == 0xf) { 281 if (c->x86 == 0xf)
282 c->x86 += (tfms >> 20) & 0xff; 282 c->x86 += (tfms >> 20) & 0xff;
283 if (c->x86 >= 0x6)
283 c->x86_model += ((tfms >> 16) & 0xF) << 4; 284 c->x86_model += ((tfms >> 16) & 0xF) << 4;
284 }
285 c->x86_mask = tfms & 15; 285 c->x86_mask = tfms & 15;
286 } else { 286 } else {
287 /* Have CPUID level 0 only - unheard of */ 287 /* Have CPUID level 0 only - unheard of */
diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c
index e3e42fd62401..c9cad7ba0d2d 100644
--- a/arch/i386/kernel/efi.c
+++ b/arch/i386/kernel/efi.c
@@ -70,10 +70,13 @@ static void efi_call_phys_prelog(void)
70{ 70{
71 unsigned long cr4; 71 unsigned long cr4;
72 unsigned long temp; 72 unsigned long temp;
73 struct Xgt_desc_struct *cpu_gdt_descr;
73 74
74 spin_lock(&efi_rt_lock); 75 spin_lock(&efi_rt_lock);
75 local_irq_save(efi_rt_eflags); 76 local_irq_save(efi_rt_eflags);
76 77
78 cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0);
79
77 /* 80 /*
78 * If I don't have PSE, I should just duplicate two entries in page 81 * If I don't have PSE, I should just duplicate two entries in page
79 * directory. If I have PSE, I just need to duplicate one entry in 82 * directory. If I have PSE, I just need to duplicate one entry in
@@ -103,18 +106,17 @@ static void efi_call_phys_prelog(void)
103 */ 106 */
104 local_flush_tlb(); 107 local_flush_tlb();
105 108
106 per_cpu(cpu_gdt_descr, 0).address = 109 cpu_gdt_descr->address = __pa(cpu_gdt_descr->address);
107 __pa(per_cpu(cpu_gdt_descr, 0).address); 110 load_gdt(cpu_gdt_descr);
108 load_gdt((struct Xgt_desc_struct *)__pa(&per_cpu(cpu_gdt_descr, 0)));
109} 111}
110 112
111static void efi_call_phys_epilog(void) 113static void efi_call_phys_epilog(void)
112{ 114{
113 unsigned long cr4; 115 unsigned long cr4;
116 struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0);
114 117
115 per_cpu(cpu_gdt_descr, 0).address = 118 cpu_gdt_descr->address = __va(cpu_gdt_descr->address);
116 (unsigned long)__va(per_cpu(cpu_gdt_descr, 0).address); 119 load_gdt(cpu_gdt_descr);
117 load_gdt((struct Xgt_desc_struct *)__va(&per_cpu(cpu_gdt_descr, 0)));
118 120
119 cr4 = read_cr4(); 121 cr4 = read_cr4();
120 122
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 235822b3f41b..39d9a5fa907e 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -51,6 +51,8 @@ static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
51 51
52static DEFINE_SPINLOCK(ioapic_lock); 52static DEFINE_SPINLOCK(ioapic_lock);
53 53
54int timer_over_8254 __initdata = 1;
55
54/* 56/*
55 * Is the SiS APIC rmw bug present ? 57 * Is the SiS APIC rmw bug present ?
56 * -1 = don't know, 0 = no, 1 = yes 58 * -1 = don't know, 0 = no, 1 = yes
@@ -2267,7 +2269,8 @@ static inline void check_timer(void)
2267 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); 2269 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
2268 init_8259A(1); 2270 init_8259A(1);
2269 timer_ack = 1; 2271 timer_ack = 1;
2270 enable_8259A_irq(0); 2272 if (timer_over_8254 > 0)
2273 enable_8259A_irq(0);
2271 2274
2272 pin1 = find_isa_irq_pin(0, mp_INT); 2275 pin1 = find_isa_irq_pin(0, mp_INT);
2273 apic1 = find_isa_irq_apic(0, mp_INT); 2276 apic1 = find_isa_irq_apic(0, mp_INT);
@@ -2392,6 +2395,20 @@ void __init setup_IO_APIC(void)
2392 print_IO_APIC(); 2395 print_IO_APIC();
2393} 2396}
2394 2397
2398static int __init setup_disable_8254_timer(char *s)
2399{
2400 timer_over_8254 = -1;
2401 return 1;
2402}
2403static int __init setup_enable_8254_timer(char *s)
2404{
2405 timer_over_8254 = 2;
2406 return 1;
2407}
2408
2409__setup("disable_8254_timer", setup_disable_8254_timer);
2410__setup("enable_8254_timer", setup_enable_8254_timer);
2411
2395/* 2412/*
2396 * Called after all the initialization is done. If we didnt find any 2413 * Called after all the initialization is done. If we didnt find any
2397 * APIC bugs then we can allow the modify fast path 2414 * APIC bugs then we can allow the modify fast path
diff --git a/arch/i386/kernel/machine_kexec.c b/arch/i386/kernel/machine_kexec.c
index a912fed48482..f73d7374a2ba 100644
--- a/arch/i386/kernel/machine_kexec.c
+++ b/arch/i386/kernel/machine_kexec.c
@@ -116,13 +116,13 @@ static void load_segments(void)
116 __asm__ __volatile__ ( 116 __asm__ __volatile__ (
117 "\tljmp $"STR(__KERNEL_CS)",$1f\n" 117 "\tljmp $"STR(__KERNEL_CS)",$1f\n"
118 "\t1:\n" 118 "\t1:\n"
119 "\tmovl $"STR(__KERNEL_DS)",%eax\n" 119 "\tmovl $"STR(__KERNEL_DS)",%%eax\n"
120 "\tmovl %eax,%ds\n" 120 "\tmovl %%eax,%%ds\n"
121 "\tmovl %eax,%es\n" 121 "\tmovl %%eax,%%es\n"
122 "\tmovl %eax,%fs\n" 122 "\tmovl %%eax,%%fs\n"
123 "\tmovl %eax,%gs\n" 123 "\tmovl %%eax,%%gs\n"
124 "\tmovl %eax,%ss\n" 124 "\tmovl %%eax,%%ss\n"
125 ); 125 ::: "eax", "memory");
126#undef STR 126#undef STR
127#undef __STR 127#undef __STR
128} 128}
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index 63f39a7e2c96..be87c5e2ee95 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -357,7 +357,7 @@ static void clear_msr_range(unsigned int base, unsigned int n)
357 wrmsr(base+i, 0, 0); 357 wrmsr(base+i, 0, 0);
358} 358}
359 359
360static inline void write_watchdog_counter(const char *descr) 360static void write_watchdog_counter(const char *descr)
361{ 361{
362 u64 count = (u64)cpu_khz * 1000; 362 u64 count = (u64)cpu_khz * 1000;
363 363
@@ -544,7 +544,7 @@ void nmi_watchdog_tick (struct pt_regs * regs)
544 * die_nmi will return ONLY if NOTIFY_STOP happens.. 544 * die_nmi will return ONLY if NOTIFY_STOP happens..
545 */ 545 */
546 die_nmi(regs, "NMI Watchdog detected LOCKUP"); 546 die_nmi(regs, "NMI Watchdog detected LOCKUP");
547 547 } else {
548 last_irq_sums[cpu] = sum; 548 last_irq_sums[cpu] = sum;
549 alert_counter[cpu] = 0; 549 alert_counter[cpu] = 0;
550 } 550 }
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 51e513b4f72d..ab62a9f4701e 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -1599,6 +1599,10 @@ void __init setup_arch(char **cmdline_p)
1599 if (efi_enabled) 1599 if (efi_enabled)
1600 efi_map_memmap(); 1600 efi_map_memmap();
1601 1601
1602#ifdef CONFIG_X86_IO_APIC
1603 check_acpi_pci(); /* Checks more than just ACPI actually */
1604#endif
1605
1602#ifdef CONFIG_ACPI 1606#ifdef CONFIG_ACPI
1603 /* 1607 /*
1604 * Parse the ACPI tables for possible boot-time SMP configuration. 1608 * Parse the ACPI tables for possible boot-time SMP configuration.
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
index a14d594bfbeb..9d3074759856 100644
--- a/arch/i386/kernel/time.c
+++ b/arch/i386/kernel/time.c
@@ -412,9 +412,9 @@ static int timer_resume(struct sys_device *dev)
412 write_seqlock_irqsave(&xtime_lock, flags); 412 write_seqlock_irqsave(&xtime_lock, flags);
413 xtime.tv_sec = sec; 413 xtime.tv_sec = sec;
414 xtime.tv_nsec = 0; 414 xtime.tv_nsec = 0;
415 write_sequnlock_irqrestore(&xtime_lock, flags); 415 jiffies_64 += sleep_length;
416 jiffies += sleep_length;
417 wall_jiffies += sleep_length; 416 wall_jiffies += sleep_length;
417 write_sequnlock_irqrestore(&xtime_lock, flags);
418 if (last_timer->resume) 418 if (last_timer->resume)
419 last_timer->resume(); 419 last_timer->resume();
420 cur_timer = last_timer; 420 cur_timer = last_timer;
diff --git a/arch/ia64/configs/gensparse_defconfig b/arch/ia64/configs/gensparse_defconfig
index 184678fe7832..744fd2f79f61 100644
--- a/arch/ia64/configs/gensparse_defconfig
+++ b/arch/ia64/configs/gensparse_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc5 3# Linux kernel version: 2.6.16-rc5
4# Mon Feb 27 16:15:43 2006 4# Thu Mar 2 16:39:10 2006
5# 5#
6 6
7# 7#
@@ -312,7 +312,13 @@ CONFIG_FW_LOADER=m
312# 312#
313# Plug and Play support 313# Plug and Play support
314# 314#
315# CONFIG_PNP is not set 315CONFIG_PNP=y
316# CONFIG_PNP_DEBUG is not set
317
318#
319# Protocols
320#
321CONFIG_PNPACPI=y
316 322
317# 323#
318# Block devices 324# Block devices
@@ -357,6 +363,7 @@ CONFIG_BLK_DEV_IDESCSI=m
357# IDE chipset support/bugfixes 363# IDE chipset support/bugfixes
358# 364#
359CONFIG_IDE_GENERIC=y 365CONFIG_IDE_GENERIC=y
366# CONFIG_BLK_DEV_IDEPNP is not set
360CONFIG_BLK_DEV_IDEPCI=y 367CONFIG_BLK_DEV_IDEPCI=y
361# CONFIG_IDEPCI_SHARE_IRQ is not set 368# CONFIG_IDEPCI_SHARE_IRQ is not set
362# CONFIG_BLK_DEV_OFFBOARD is not set 369# CONFIG_BLK_DEV_OFFBOARD is not set
@@ -525,6 +532,7 @@ CONFIG_DUMMY=m
525# CONFIG_BONDING is not set 532# CONFIG_BONDING is not set
526# CONFIG_EQUALIZER is not set 533# CONFIG_EQUALIZER is not set
527# CONFIG_TUN is not set 534# CONFIG_TUN is not set
535# CONFIG_NET_SB1000 is not set
528 536
529# 537#
530# ARCnet devices 538# ARCnet devices
diff --git a/arch/ia64/kernel/cyclone.c b/arch/ia64/kernel/cyclone.c
index 6ade3790ce07..e00b21514f7c 100644
--- a/arch/ia64/kernel/cyclone.c
+++ b/arch/ia64/kernel/cyclone.c
@@ -36,7 +36,7 @@ int __init init_cyclone_clock(void)
36 u32* volatile cyclone_timer; /* Cyclone MPMC0 register */ 36 u32* volatile cyclone_timer; /* Cyclone MPMC0 register */
37 37
38 if (!use_cyclone) 38 if (!use_cyclone)
39 return -ENODEV; 39 return 0;
40 40
41 printk(KERN_INFO "Summit chipset: Starting Cyclone Counter.\n"); 41 printk(KERN_INFO "Summit chipset: Starting Cyclone Counter.\n");
42 42
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
index 9f80569a32b0..dcd906fe5749 100644
--- a/arch/ia64/kernel/ivt.S
+++ b/arch/ia64/kernel/ivt.S
@@ -561,11 +561,12 @@ ENTRY(dirty_bit)
561 ;; // avoid RAW on r18 561 ;; // avoid RAW on r18
562 mov ar.ccv=r18 // set compare value for cmpxchg 562 mov ar.ccv=r18 // set compare value for cmpxchg
563 or r25=_PAGE_D|_PAGE_A,r18 // set the dirty and accessed bits 563 or r25=_PAGE_D|_PAGE_A,r18 // set the dirty and accessed bits
564 tbit.z p7,p6 = r18,_PAGE_P_BIT // Check present bit
564 ;; 565 ;;
565 cmpxchg8.acq r26=[r17],r25,ar.ccv 566(p6) cmpxchg8.acq r26=[r17],r25,ar.ccv // Only update if page is present
566 mov r24=PAGE_SHIFT<<2 567 mov r24=PAGE_SHIFT<<2
567 ;; 568 ;;
568 cmp.eq p6,p7=r26,r18 569(p6) cmp.eq p6,p7=r26,r18 // Only compare if page is present
569 ;; 570 ;;
570(p6) itc.d r25 // install updated PTE 571(p6) itc.d r25 // install updated PTE
571 ;; 572 ;;
@@ -626,11 +627,12 @@ ENTRY(iaccess_bit)
626 ;; 627 ;;
627 mov ar.ccv=r18 // set compare value for cmpxchg 628 mov ar.ccv=r18 // set compare value for cmpxchg
628 or r25=_PAGE_A,r18 // set the accessed bit 629 or r25=_PAGE_A,r18 // set the accessed bit
630 tbit.z p7,p6 = r18,_PAGE_P_BIT // Check present bit
629 ;; 631 ;;
630 cmpxchg8.acq r26=[r17],r25,ar.ccv 632(p6) cmpxchg8.acq r26=[r17],r25,ar.ccv // Only if page present
631 mov r24=PAGE_SHIFT<<2 633 mov r24=PAGE_SHIFT<<2
632 ;; 634 ;;
633 cmp.eq p6,p7=r26,r18 635(p6) cmp.eq p6,p7=r26,r18 // Only if page present
634 ;; 636 ;;
635(p6) itc.i r25 // install updated PTE 637(p6) itc.i r25 // install updated PTE
636 ;; 638 ;;
@@ -680,11 +682,12 @@ ENTRY(daccess_bit)
680 ;; // avoid RAW on r18 682 ;; // avoid RAW on r18
681 mov ar.ccv=r18 // set compare value for cmpxchg 683 mov ar.ccv=r18 // set compare value for cmpxchg
682 or r25=_PAGE_A,r18 // set the dirty bit 684 or r25=_PAGE_A,r18 // set the dirty bit
685 tbit.z p7,p6 = r18,_PAGE_P_BIT // Check present bit
683 ;; 686 ;;
684 cmpxchg8.acq r26=[r17],r25,ar.ccv 687(p6) cmpxchg8.acq r26=[r17],r25,ar.ccv // Only if page is present
685 mov r24=PAGE_SHIFT<<2 688 mov r24=PAGE_SHIFT<<2
686 ;; 689 ;;
687 cmp.eq p6,p7=r26,r18 690(p6) cmp.eq p6,p7=r26,r18 // Only if page is present
688 ;; 691 ;;
689(p6) itc.d r25 // install updated PTE 692(p6) itc.d r25 // install updated PTE
690 /* 693 /*
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index 8fd93afa75a7..e883d85906db 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -123,8 +123,9 @@ mca_page_isolate(unsigned long paddr)
123void 123void
124mca_handler_bh(unsigned long paddr) 124mca_handler_bh(unsigned long paddr)
125{ 125{
126 printk(KERN_DEBUG "OS_MCA: process [pid: %d](%s) encounters MCA.\n", 126 printk(KERN_ERR
127 current->pid, current->comm); 127 "OS_MCA: process [pid: %d](%s) encounters MCA (paddr=%lx)\n",
128 current->pid, current->comm, paddr);
128 129
129 spin_lock(&mca_bh_lock); 130 spin_lock(&mca_bh_lock);
130 switch (mca_page_isolate(paddr)) { 131 switch (mca_page_isolate(paddr)) {
@@ -132,7 +133,7 @@ mca_handler_bh(unsigned long paddr)
132 printk(KERN_DEBUG "Page isolation: ( %lx ) success.\n", paddr); 133 printk(KERN_DEBUG "Page isolation: ( %lx ) success.\n", paddr);
133 break; 134 break;
134 case ISOLATE_NG: 135 case ISOLATE_NG:
135 printk(KERN_DEBUG "Page isolation: ( %lx ) failure.\n", paddr); 136 printk(KERN_CRIT "Page isolation: ( %lx ) failure.\n", paddr);
136 break; 137 break;
137 default: 138 default:
138 break; 139 break;
@@ -567,10 +568,15 @@ recover_from_processor_error(int platform, slidx_table_t *slidx,
567 return 0; 568 return 0;
568 569
569 /* 570 /*
570 * If there is no bus error, record is weird but we need not to recover. 571 * The cache check and bus check bits have four possible states
572 * cc bc
573 * 0 0 Weird record, not recovered
574 * 1 0 Cache error, not recovered
575 * 0 1 I/O error, attempt recovery
576 * 1 1 Memory error, attempt recovery
571 */ 577 */
572 if (psp->bc == 0 || pbci == NULL) 578 if (psp->bc == 0 || pbci == NULL)
573 return 1; 579 return 0;
574 580
575 /* 581 /*
576 * Sorry, we cannot handle so many. 582 * Sorry, we cannot handle so many.
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index 24eefb2fc55f..b2e1e746b47f 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -446,7 +446,7 @@ static struct proc_dir_entry *proc_sn2_ptc;
446static int __init sn2_ptc_init(void) 446static int __init sn2_ptc_init(void)
447{ 447{
448 if (!ia64_platform_is("sn2")) 448 if (!ia64_platform_is("sn2"))
449 return -ENOSYS; 449 return 0;
450 450
451 if (!(proc_sn2_ptc = create_proc_entry(PTC_BASENAME, 0444, NULL))) { 451 if (!(proc_sn2_ptc = create_proc_entry(PTC_BASENAME, 0444, NULL))) {
452 printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME); 452 printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME);
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c
index 8a56f8b5ffa2..99cb28e74295 100644
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@ -484,7 +484,7 @@ static int __init tiocx_init(void)
484 int found_tiocx_device = 0; 484 int found_tiocx_device = 0;
485 485
486 if (!ia64_platform_is("sn2")) 486 if (!ia64_platform_is("sn2"))
487 return -ENODEV; 487 return 0;
488 488
489 bus_register(&tiocx_bus_type); 489 bus_register(&tiocx_bus_type);
490 490
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 767de847b4ab..3a0f89d2c8dc 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1053,6 +1053,7 @@ config CPU_MIPS32_R1
1053 depends on SYS_HAS_CPU_MIPS32_R1 1053 depends on SYS_HAS_CPU_MIPS32_R1
1054 select CPU_HAS_PREFETCH 1054 select CPU_HAS_PREFETCH
1055 select CPU_SUPPORTS_32BIT_KERNEL 1055 select CPU_SUPPORTS_32BIT_KERNEL
1056 select CPU_SUPPORTS_HIGHMEM
1056 help 1057 help
1057 Choose this option to build a kernel for release 1 or later of the 1058 Choose this option to build a kernel for release 1 or later of the
1058 MIPS32 architecture. Most modern embedded systems with a 32-bit 1059 MIPS32 architecture. Most modern embedded systems with a 32-bit
@@ -1069,6 +1070,7 @@ config CPU_MIPS32_R2
1069 depends on SYS_HAS_CPU_MIPS32_R2 1070 depends on SYS_HAS_CPU_MIPS32_R2
1070 select CPU_HAS_PREFETCH 1071 select CPU_HAS_PREFETCH
1071 select CPU_SUPPORTS_32BIT_KERNEL 1072 select CPU_SUPPORTS_32BIT_KERNEL
1073 select CPU_SUPPORTS_HIGHMEM
1072 help 1074 help
1073 Choose this option to build a kernel for release 2 or later of the 1075 Choose this option to build a kernel for release 2 or later of the
1074 MIPS32 architecture. Most modern embedded systems with a 32-bit 1076 MIPS32 architecture. Most modern embedded systems with a 32-bit
@@ -1082,6 +1084,7 @@ config CPU_MIPS64_R1
1082 select CPU_HAS_PREFETCH 1084 select CPU_HAS_PREFETCH
1083 select CPU_SUPPORTS_32BIT_KERNEL 1085 select CPU_SUPPORTS_32BIT_KERNEL
1084 select CPU_SUPPORTS_64BIT_KERNEL 1086 select CPU_SUPPORTS_64BIT_KERNEL
1087 select CPU_SUPPORTS_HIGHMEM
1085 help 1088 help
1086 Choose this option to build a kernel for release 1 or later of the 1089 Choose this option to build a kernel for release 1 or later of the
1087 MIPS64 architecture. Many modern embedded systems with a 64-bit 1090 MIPS64 architecture. Many modern embedded systems with a 64-bit
@@ -1099,6 +1102,7 @@ config CPU_MIPS64_R2
1099 select CPU_HAS_PREFETCH 1102 select CPU_HAS_PREFETCH
1100 select CPU_SUPPORTS_32BIT_KERNEL 1103 select CPU_SUPPORTS_32BIT_KERNEL
1101 select CPU_SUPPORTS_64BIT_KERNEL 1104 select CPU_SUPPORTS_64BIT_KERNEL
1105 select CPU_SUPPORTS_HIGHMEM
1102 help 1106 help
1103 Choose this option to build a kernel for release 2 or later of the 1107 Choose this option to build a kernel for release 2 or later of the
1104 MIPS64 architecture. Many modern embedded systems with a 64-bit 1108 MIPS64 architecture. Many modern embedded systems with a 64-bit
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 38c0f3360d51..fe9da16f3a40 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -95,6 +95,7 @@ endif
95# crossformat linking we rely on the elf2ecoff tool for format conversion. 95# crossformat linking we rely on the elf2ecoff tool for format conversion.
96# 96#
97cflags-y += -G 0 -mno-abicalls -fno-pic -pipe 97cflags-y += -G 0 -mno-abicalls -fno-pic -pipe
98cflags-y += -msoft-float
98LDFLAGS_vmlinux += -G 0 -static -n -nostdlib 99LDFLAGS_vmlinux += -G 0 -static -n -nostdlib
99MODFLAGS += -mlong-calls 100MODFLAGS += -mlong-calls
100 101
diff --git a/arch/mips/arc/arc_con.c b/arch/mips/arc/arc_con.c
index 51785a6a7328..bc32fe64f42a 100644
--- a/arch/mips/arc/arc_con.c
+++ b/arch/mips/arc/arc_con.c
@@ -24,7 +24,7 @@ static void prom_console_write(struct console *co, const char *s,
24 } 24 }
25} 25}
26 26
27static int __init prom_console_setup(struct console *co, char *options) 27static int prom_console_setup(struct console *co, char *options)
28{ 28{
29 return !(prom_flags & PROM_FLAG_USE_AS_CONSOLE); 29 return !(prom_flags & PROM_FLAG_USE_AS_CONSOLE);
30} 30}
diff --git a/arch/mips/kernel/irq-mv6434x.c b/arch/mips/kernel/irq-mv6434x.c
index 0ac067f45cf5..0613f1f36b1b 100644
--- a/arch/mips/kernel/irq-mv6434x.c
+++ b/arch/mips/kernel/irq-mv6434x.c
@@ -11,12 +11,14 @@
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <asm/ptrace.h>
15#include <linux/sched.h>
16#include <linux/kernel_stat.h> 14#include <linux/kernel_stat.h>
15#include <linux/mv643xx.h>
16#include <linux/sched.h>
17
18#include <asm/ptrace.h>
17#include <asm/io.h> 19#include <asm/io.h>
18#include <asm/irq.h> 20#include <asm/irq.h>
19#include <linux/mv643xx.h> 21#include <asm/marvell.h>
20 22
21static unsigned int irq_base; 23static unsigned int irq_base;
22 24
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index ff699dbb99f7..2ad0cedf29fe 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -106,6 +106,9 @@ SECTIONS
106 .con_initcall.init : { *(.con_initcall.init) } 106 .con_initcall.init : { *(.con_initcall.init) }
107 __con_initcall_end = .; 107 __con_initcall_end = .;
108 SECURITY_INIT 108 SECURITY_INIT
109 /* .exit.text is discarded at runtime, not link time, to deal with
110 references from .rodata */
111 .exit.text : { *(.exit.text) }
109 . = ALIGN(_PAGE_SIZE); 112 . = ALIGN(_PAGE_SIZE);
110 __initramfs_start = .; 113 __initramfs_start = .;
111 .init.ramfs : { *(.init.ramfs) } 114 .init.ramfs : { *(.init.ramfs) }
@@ -133,7 +136,6 @@ SECTIONS
133 136
134 /* Sections to be discarded */ 137 /* Sections to be discarded */
135 /DISCARD/ : { 138 /DISCARD/ : {
136 *(.exit.text)
137 *(.exit.data) 139 *(.exit.data)
138 *(.exitcall.exit) 140 *(.exitcall.exit)
139 141
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 0f9485806bac..ac4f4bfaae50 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -280,69 +280,69 @@ static void __init build_insn(u32 **buf, enum opcode opc, ...)
280} 280}
281 281
282#define I_u1u2u3(op) \ 282#define I_u1u2u3(op) \
283 static inline void i##op(u32 **buf, unsigned int a, \ 283 static inline void __init i##op(u32 **buf, unsigned int a, \
284 unsigned int b, unsigned int c) \ 284 unsigned int b, unsigned int c) \
285 { \ 285 { \
286 build_insn(buf, insn##op, a, b, c); \ 286 build_insn(buf, insn##op, a, b, c); \
287 } 287 }
288 288
289#define I_u2u1u3(op) \ 289#define I_u2u1u3(op) \
290 static inline void i##op(u32 **buf, unsigned int a, \ 290 static inline void __init i##op(u32 **buf, unsigned int a, \
291 unsigned int b, unsigned int c) \ 291 unsigned int b, unsigned int c) \
292 { \ 292 { \
293 build_insn(buf, insn##op, b, a, c); \ 293 build_insn(buf, insn##op, b, a, c); \
294 } 294 }
295 295
296#define I_u3u1u2(op) \ 296#define I_u3u1u2(op) \
297 static inline void i##op(u32 **buf, unsigned int a, \ 297 static inline void __init i##op(u32 **buf, unsigned int a, \
298 unsigned int b, unsigned int c) \ 298 unsigned int b, unsigned int c) \
299 { \ 299 { \
300 build_insn(buf, insn##op, b, c, a); \ 300 build_insn(buf, insn##op, b, c, a); \
301 } 301 }
302 302
303#define I_u1u2s3(op) \ 303#define I_u1u2s3(op) \
304 static inline void i##op(u32 **buf, unsigned int a, \ 304 static inline void __init i##op(u32 **buf, unsigned int a, \
305 unsigned int b, signed int c) \ 305 unsigned int b, signed int c) \
306 { \ 306 { \
307 build_insn(buf, insn##op, a, b, c); \ 307 build_insn(buf, insn##op, a, b, c); \
308 } 308 }
309 309
310#define I_u2s3u1(op) \ 310#define I_u2s3u1(op) \
311 static inline void i##op(u32 **buf, unsigned int a, \ 311 static inline void __init i##op(u32 **buf, unsigned int a, \
312 signed int b, unsigned int c) \ 312 signed int b, unsigned int c) \
313 { \ 313 { \
314 build_insn(buf, insn##op, c, a, b); \ 314 build_insn(buf, insn##op, c, a, b); \
315 } 315 }
316 316
317#define I_u2u1s3(op) \ 317#define I_u2u1s3(op) \
318 static inline void i##op(u32 **buf, unsigned int a, \ 318 static inline void __init i##op(u32 **buf, unsigned int a, \
319 unsigned int b, signed int c) \ 319 unsigned int b, signed int c) \
320 { \ 320 { \
321 build_insn(buf, insn##op, b, a, c); \ 321 build_insn(buf, insn##op, b, a, c); \
322 } 322 }
323 323
324#define I_u1u2(op) \ 324#define I_u1u2(op) \
325 static inline void i##op(u32 **buf, unsigned int a, \ 325 static inline void __init i##op(u32 **buf, unsigned int a, \
326 unsigned int b) \ 326 unsigned int b) \
327 { \ 327 { \
328 build_insn(buf, insn##op, a, b); \ 328 build_insn(buf, insn##op, a, b); \
329 } 329 }
330 330
331#define I_u1s2(op) \ 331#define I_u1s2(op) \
332 static inline void i##op(u32 **buf, unsigned int a, \ 332 static inline void __init i##op(u32 **buf, unsigned int a, \
333 signed int b) \ 333 signed int b) \
334 { \ 334 { \
335 build_insn(buf, insn##op, a, b); \ 335 build_insn(buf, insn##op, a, b); \
336 } 336 }
337 337
338#define I_u1(op) \ 338#define I_u1(op) \
339 static inline void i##op(u32 **buf, unsigned int a) \ 339 static inline void __init i##op(u32 **buf, unsigned int a) \
340 { \ 340 { \
341 build_insn(buf, insn##op, a); \ 341 build_insn(buf, insn##op, a); \
342 } 342 }
343 343
344#define I_0(op) \ 344#define I_0(op) \
345 static inline void i##op(u32 **buf) \ 345 static inline void __init i##op(u32 **buf) \
346 { \ 346 { \
347 build_insn(buf, insn##op); \ 347 build_insn(buf, insn##op); \
348 } 348 }
@@ -623,42 +623,42 @@ static __init int __attribute__((unused)) insn_has_bdelay(struct reloc *rel,
623} 623}
624 624
625/* convenience functions for labeled branches */ 625/* convenience functions for labeled branches */
626static void __attribute__((unused)) il_bltz(u32 **p, struct reloc **r, 626static void __init __attribute__((unused))
627 unsigned int reg, enum label_id l) 627 il_bltz(u32 **p, struct reloc **r, unsigned int reg, enum label_id l)
628{ 628{
629 r_mips_pc16(r, *p, l); 629 r_mips_pc16(r, *p, l);
630 i_bltz(p, reg, 0); 630 i_bltz(p, reg, 0);
631} 631}
632 632
633static void __attribute__((unused)) il_b(u32 **p, struct reloc **r, 633static void __init __attribute__((unused)) il_b(u32 **p, struct reloc **r,
634 enum label_id l) 634 enum label_id l)
635{ 635{
636 r_mips_pc16(r, *p, l); 636 r_mips_pc16(r, *p, l);
637 i_b(p, 0); 637 i_b(p, 0);
638} 638}
639 639
640static void il_beqz(u32 **p, struct reloc **r, unsigned int reg, 640static void __init il_beqz(u32 **p, struct reloc **r, unsigned int reg,
641 enum label_id l) 641 enum label_id l)
642{ 642{
643 r_mips_pc16(r, *p, l); 643 r_mips_pc16(r, *p, l);
644 i_beqz(p, reg, 0); 644 i_beqz(p, reg, 0);
645} 645}
646 646
647static void __attribute__((unused)) 647static void __init __attribute__((unused))
648il_beqzl(u32 **p, struct reloc **r, unsigned int reg, enum label_id l) 648il_beqzl(u32 **p, struct reloc **r, unsigned int reg, enum label_id l)
649{ 649{
650 r_mips_pc16(r, *p, l); 650 r_mips_pc16(r, *p, l);
651 i_beqzl(p, reg, 0); 651 i_beqzl(p, reg, 0);
652} 652}
653 653
654static void il_bnez(u32 **p, struct reloc **r, unsigned int reg, 654static void __init il_bnez(u32 **p, struct reloc **r, unsigned int reg,
655 enum label_id l) 655 enum label_id l)
656{ 656{
657 r_mips_pc16(r, *p, l); 657 r_mips_pc16(r, *p, l);
658 i_bnez(p, reg, 0); 658 i_bnez(p, reg, 0);
659} 659}
660 660
661static void il_bgezl(u32 **p, struct reloc **r, unsigned int reg, 661static void __init il_bgezl(u32 **p, struct reloc **r, unsigned int reg,
662 enum label_id l) 662 enum label_id l)
663{ 663{
664 r_mips_pc16(r, *p, l); 664 r_mips_pc16(r, *p, l);
diff --git a/arch/mips/momentum/jaguar_atx/prom.c b/arch/mips/momentum/jaguar_atx/prom.c
index aae7a802767a..1cadaa92946a 100644
--- a/arch/mips/momentum/jaguar_atx/prom.c
+++ b/arch/mips/momentum/jaguar_atx/prom.c
@@ -21,10 +21,10 @@
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/sched.h> 22#include <linux/sched.h>
23#include <linux/bootmem.h> 23#include <linux/bootmem.h>
24#include <linux/mv643xx.h>
24 25
25#include <asm/addrspace.h> 26#include <asm/addrspace.h>
26#include <asm/bootinfo.h> 27#include <asm/bootinfo.h>
27#include <asm/mv64340.h>
28#include <asm/pmon.h> 28#include <asm/pmon.h>
29 29
30#include "jaguar_atx_fpga.h" 30#include "jaguar_atx_fpga.h"
diff --git a/arch/mips/momentum/jaguar_atx/setup.c b/arch/mips/momentum/jaguar_atx/setup.c
index 301d67226d72..2699917b640a 100644
--- a/arch/mips/momentum/jaguar_atx/setup.c
+++ b/arch/mips/momentum/jaguar_atx/setup.c
@@ -2,7 +2,7 @@
2 * BRIEF MODULE DESCRIPTION 2 * BRIEF MODULE DESCRIPTION
3 * Momentum Computer Jaguar-ATX board dependent boot routines 3 * Momentum Computer Jaguar-ATX board dependent boot routines
4 * 4 *
5 * Copyright (C) 1996, 1997, 2001, 2004 Ralf Baechle (ralf@linux-mips.org) 5 * Copyright (C) 1996, 1997, 2001, 04, 06 Ralf Baechle (ralf@linux-mips.org)
6 * Copyright (C) 2000 RidgeRun, Inc. 6 * Copyright (C) 2000 RidgeRun, Inc.
7 * Copyright (C) 2001 Red Hat, Inc. 7 * Copyright (C) 2001 Red Hat, Inc.
8 * Copyright (C) 2002 Momentum Computer 8 * Copyright (C) 2002 Momentum Computer
@@ -55,6 +55,8 @@
55#include <linux/interrupt.h> 55#include <linux/interrupt.h>
56#include <linux/timex.h> 56#include <linux/timex.h>
57#include <linux/vmalloc.h> 57#include <linux/vmalloc.h>
58#include <linux/mv643xx.h>
59
58#include <asm/time.h> 60#include <asm/time.h>
59#include <asm/bootinfo.h> 61#include <asm/bootinfo.h>
60#include <asm/page.h> 62#include <asm/page.h>
@@ -64,7 +66,6 @@
64#include <asm/ptrace.h> 66#include <asm/ptrace.h>
65#include <asm/reboot.h> 67#include <asm/reboot.h>
66#include <asm/tlbflush.h> 68#include <asm/tlbflush.h>
67#include <asm/mv64340.h>
68 69
69#include "jaguar_atx_fpga.h" 70#include "jaguar_atx_fpga.h"
70 71
diff --git a/arch/mips/momentum/ocelot_c/irq.c b/arch/mips/momentum/ocelot_c/irq.c
index 300fe8e4fbe8..a5764bc20e36 100644
--- a/arch/mips/momentum/ocelot_c/irq.c
+++ b/arch/mips/momentum/ocelot_c/irq.c
@@ -41,11 +41,11 @@
41#include <linux/slab.h> 41#include <linux/slab.h>
42#include <linux/random.h> 42#include <linux/random.h>
43#include <linux/bitops.h> 43#include <linux/bitops.h>
44#include <linux/mv643xx.h>
44#include <asm/bootinfo.h> 45#include <asm/bootinfo.h>
45#include <asm/io.h> 46#include <asm/io.h>
46#include <asm/irq_cpu.h> 47#include <asm/irq_cpu.h>
47#include <asm/mipsregs.h> 48#include <asm/mipsregs.h>
48#include <asm/mv64340.h>
49#include <asm/system.h> 49#include <asm/system.h>
50 50
51extern asmlinkage void ocelot_handle_int(void); 51extern asmlinkage void ocelot_handle_int(void);
diff --git a/arch/mips/momentum/ocelot_c/prom.c b/arch/mips/momentum/ocelot_c/prom.c
index 5b6809724b15..e92364482c7b 100644
--- a/arch/mips/momentum/ocelot_c/prom.c
+++ b/arch/mips/momentum/ocelot_c/prom.c
@@ -19,10 +19,10 @@
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/bootmem.h> 21#include <linux/bootmem.h>
22#include <linux/mv643xx.h>
22 23
23#include <asm/addrspace.h> 24#include <asm/addrspace.h>
24#include <asm/bootinfo.h> 25#include <asm/bootinfo.h>
25#include <asm/mv64340.h>
26#include <asm/pmon.h> 26#include <asm/pmon.h>
27 27
28#include "ocelot_c_fpga.h" 28#include "ocelot_c_fpga.h"
diff --git a/arch/mips/momentum/ocelot_c/setup.c b/arch/mips/momentum/ocelot_c/setup.c
index 15998d8a9341..bd02e60d037a 100644
--- a/arch/mips/momentum/ocelot_c/setup.c
+++ b/arch/mips/momentum/ocelot_c/setup.c
@@ -54,6 +54,7 @@
54#include <linux/pm.h> 54#include <linux/pm.h>
55#include <linux/timex.h> 55#include <linux/timex.h>
56#include <linux/vmalloc.h> 56#include <linux/vmalloc.h>
57#include <linux/mv643xx.h>
57 58
58#include <asm/time.h> 59#include <asm/time.h>
59#include <asm/bootinfo.h> 60#include <asm/bootinfo.h>
@@ -64,9 +65,9 @@
64#include <asm/processor.h> 65#include <asm/processor.h>
65#include <asm/ptrace.h> 66#include <asm/ptrace.h>
66#include <asm/reboot.h> 67#include <asm/reboot.h>
68#include <asm/marvell.h>
67#include <linux/bootmem.h> 69#include <linux/bootmem.h>
68#include <linux/blkdev.h> 70#include <linux/blkdev.h>
69#include <asm/mv64340.h>
70#include "ocelot_c_fpga.h" 71#include "ocelot_c_fpga.h"
71 72
72unsigned long marvell_base; 73unsigned long marvell_base;
@@ -252,22 +253,22 @@ void __init plat_setup(void)
252 /* shut down ethernet ports, just to be sure our memory doesn't get 253 /* shut down ethernet ports, just to be sure our memory doesn't get
253 * corrupted by random ethernet traffic. 254 * corrupted by random ethernet traffic.
254 */ 255 */
255 MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(0), 0xff << 8); 256 MV_WRITE(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(0), 0xff << 8);
256 MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(1), 0xff << 8); 257 MV_WRITE(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(1), 0xff << 8);
257 MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(0), 0xff << 8); 258 MV_WRITE(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(0), 0xff << 8);
258 MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(1), 0xff << 8); 259 MV_WRITE(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(1), 0xff << 8);
259 do {} 260 do {}
260 while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(0)) & 0xff); 261 while (MV_READ(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(0)) & 0xff);
261 do {} 262 do {}
262 while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(1)) & 0xff); 263 while (MV_READ(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(1)) & 0xff);
263 do {} 264 do {}
264 while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(0)) & 0xff); 265 while (MV_READ(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(0)) & 0xff);
265 do {} 266 do {}
266 while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(1)) & 0xff); 267 while (MV_READ(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(1)) & 0xff);
267 MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(0), 268 MV_WRITE(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(0),
268 MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(0)) & ~1); 269 MV_READ(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(0)) & ~1);
269 MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(1), 270 MV_WRITE(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(1),
270 MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(1)) & ~1); 271 MV_READ(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(1)) & ~1);
271 272
272 /* Turn off the Bit-Error LED */ 273 /* Turn off the Bit-Error LED */
273 OCELOT_FPGA_WRITE(0x80, CLR); 274 OCELOT_FPGA_WRITE(0x80, CLR);
diff --git a/arch/mips/pci/pci-ocelot-c.c b/arch/mips/pci/pci-ocelot-c.c
index 1d84d36e034d..027759f7c904 100644
--- a/arch/mips/pci/pci-ocelot-c.c
+++ b/arch/mips/pci/pci-ocelot-c.c
@@ -3,15 +3,17 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) 6 * Copyright (C) 2004, 06 by Ralf Baechle (ralf@linux-mips.org)
7 */ 7 */
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/pci.h> 10#include <linux/pci.h>
11#include <asm/mv64340.h> 11#include <linux/mv643xx.h>
12 12
13#include <linux/init.h> 13#include <linux/init.h>
14 14
15#include <asm/marvell.h>
16
15/* 17/*
16 * We assume the address ranges have already been setup appropriately by 18 * We assume the address ranges have already been setup appropriately by
17 * the firmware. PMON in case of the Ocelot C does that. 19 * the firmware. PMON in case of the Ocelot C does that.
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 840aad43a98b..c9a660e4c2db 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -92,7 +92,6 @@ int main(void)
92 92
93 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 93 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
94 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); 94 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
95 DEFINE(TI_SIGFRAME, offsetof(struct thread_info, nvgprs_frame));
96 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 95 DEFINE(TI_TASK, offsetof(struct thread_info, task));
97#ifdef CONFIG_PPC32 96#ifdef CONFIG_PPC32
98 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); 97 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 10696456a4c6..e4e81374cb9a 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -53,8 +53,10 @@ extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
53 PPC_FEATURE_HAS_MMU) 53 PPC_FEATURE_HAS_MMU)
54#define COMMON_USER_PPC64 (COMMON_USER | PPC_FEATURE_64) 54#define COMMON_USER_PPC64 (COMMON_USER | PPC_FEATURE_64)
55#define COMMON_USER_POWER4 (COMMON_USER_PPC64 | PPC_FEATURE_POWER4) 55#define COMMON_USER_POWER4 (COMMON_USER_PPC64 | PPC_FEATURE_POWER4)
56#define COMMON_USER_POWER5 (COMMON_USER_PPC64 | PPC_FEATURE_POWER5) 56#define COMMON_USER_POWER5 (COMMON_USER_PPC64 | PPC_FEATURE_POWER5 |\
57#define COMMON_USER_POWER5_PLUS (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS) 57 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
58#define COMMON_USER_POWER5_PLUS (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\
59 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
58#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \ 60#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
59 PPC_FEATURE_BOOKE) 61 PPC_FEATURE_BOOKE)
60 62
@@ -267,7 +269,8 @@ struct cpu_spec cpu_specs[] = {
267 .cpu_name = "Cell Broadband Engine", 269 .cpu_name = "Cell Broadband Engine",
268 .cpu_features = CPU_FTRS_CELL, 270 .cpu_features = CPU_FTRS_CELL,
269 .cpu_user_features = COMMON_USER_PPC64 | 271 .cpu_user_features = COMMON_USER_PPC64 |
270 PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP, 272 PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
273 PPC_FEATURE_SMT,
271 .icache_bsize = 128, 274 .icache_bsize = 128,
272 .dcache_bsize = 128, 275 .dcache_bsize = 128,
273 .cpu_setup = __setup_cpu_be, 276 .cpu_setup = __setup_cpu_be,
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index f20a67261ec7..4827ca1ec89b 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -227,7 +227,7 @@ ret_from_syscall:
227 MTMSRD(r10) 227 MTMSRD(r10)
228 lwz r9,TI_FLAGS(r12) 228 lwz r9,TI_FLAGS(r12)
229 li r8,-_LAST_ERRNO 229 li r8,-_LAST_ERRNO
230 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL|_TIF_RESTORE_SIGMASK) 230 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK)
231 bne- syscall_exit_work 231 bne- syscall_exit_work
232 cmplw 0,r3,r8 232 cmplw 0,r3,r8
233 blt+ syscall_exit_cont 233 blt+ syscall_exit_cont
@@ -287,8 +287,10 @@ syscall_dotrace:
287 287
288syscall_exit_work: 288syscall_exit_work:
289 andi. r0,r9,_TIF_RESTOREALL 289 andi. r0,r9,_TIF_RESTOREALL
290 bne- 2f 290 beq+ 0f
291 cmplw 0,r3,r8 291 REST_NVGPRS(r1)
292 b 2f
2930: cmplw 0,r3,r8
292 blt+ 1f 294 blt+ 1f
293 andi. r0,r9,_TIF_NOERROR 295 andi. r0,r9,_TIF_NOERROR
294 bne- 1f 296 bne- 1f
@@ -302,9 +304,7 @@ syscall_exit_work:
3022: andi. r0,r9,(_TIF_PERSYSCALL_MASK) 3042: andi. r0,r9,(_TIF_PERSYSCALL_MASK)
303 beq 4f 305 beq 4f
304 306
305 /* Clear per-syscall TIF flags if any are set, but _leave_ 307 /* Clear per-syscall TIF flags if any are set. */
306 _TIF_SAVE_NVGPRS set in r9 since we haven't dealt with that
307 yet. */
308 308
309 li r11,_TIF_PERSYSCALL_MASK 309 li r11,_TIF_PERSYSCALL_MASK
310 addi r12,r12,TI_FLAGS 310 addi r12,r12,TI_FLAGS
@@ -318,8 +318,13 @@ syscall_exit_work:
318 subi r12,r12,TI_FLAGS 318 subi r12,r12,TI_FLAGS
319 319
3204: /* Anything which requires enabling interrupts? */ 3204: /* Anything which requires enabling interrupts? */
321 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SAVE_NVGPRS) 321 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
322 beq 7f 322 beq ret_from_except
323
324 /* Re-enable interrupts */
325 ori r10,r10,MSR_EE
326 SYNC
327 MTMSRD(r10)
323 328
324 /* Save NVGPRS if they're not saved already */ 329 /* Save NVGPRS if they're not saved already */
325 lwz r4,_TRAP(r1) 330 lwz r4,_TRAP(r1)
@@ -328,71 +333,11 @@ syscall_exit_work:
328 SAVE_NVGPRS(r1) 333 SAVE_NVGPRS(r1)
329 li r4,0xc00 334 li r4,0xc00
330 stw r4,_TRAP(r1) 335 stw r4,_TRAP(r1)
331 3365:
332 /* Re-enable interrupts */
3335: ori r10,r10,MSR_EE
334 SYNC
335 MTMSRD(r10)
336
337 andi. r0,r9,_TIF_SAVE_NVGPRS
338 bne save_user_nvgprs
339
340save_user_nvgprs_cont:
341 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
342 beq 7f
343
344 addi r3,r1,STACK_FRAME_OVERHEAD 337 addi r3,r1,STACK_FRAME_OVERHEAD
345 bl do_syscall_trace_leave 338 bl do_syscall_trace_leave
346 REST_NVGPRS(r1) 339 b ret_from_except_full
347
3486: lwz r3,GPR3(r1)
349 LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
350 SYNC
351 MTMSRD(r10) /* disable interrupts again */
352 rlwinm r12,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */
353 lwz r9,TI_FLAGS(r12)
3547:
355 andi. r0,r9,_TIF_NEED_RESCHED
356 bne 8f
357 lwz r5,_MSR(r1)
358 andi. r5,r5,MSR_PR
359 beq ret_from_except
360 andi. r0,r9,_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK
361 beq ret_from_except
362 b do_user_signal
3638:
364 ori r10,r10,MSR_EE
365 SYNC
366 MTMSRD(r10) /* re-enable interrupts */
367 bl schedule
368 b 6b
369
370save_user_nvgprs:
371 lwz r8,TI_SIGFRAME(r12)
372
373.macro savewords start, end
374 1: stw \start,4*(\start)(r8)
375 .section __ex_table,"a"
376 .align 2
377 .long 1b,save_user_nvgprs_fault
378 .previous
379 .if \end - \start
380 savewords "(\start+1)",\end
381 .endif
382.endm
383 savewords 14,31
384 b save_user_nvgprs_cont
385
386
387save_user_nvgprs_fault:
388 li r3,11 /* SIGSEGV */
389 lwz r4,TI_TASK(r12)
390 bl force_sigsegv
391 340
392 rlwinm r12,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */
393 lwz r9,TI_FLAGS(r12)
394 b save_user_nvgprs_cont
395
396#ifdef SHOW_SYSCALLS 341#ifdef SHOW_SYSCALLS
397do_show_syscall: 342do_show_syscall:
398#ifdef SHOW_SYSCALLS_TASK 343#ifdef SHOW_SYSCALLS_TASK
@@ -490,6 +435,14 @@ ppc_clone:
490 stw r0,_TRAP(r1) /* register set saved */ 435 stw r0,_TRAP(r1) /* register set saved */
491 b sys_clone 436 b sys_clone
492 437
438 .globl ppc_swapcontext
439ppc_swapcontext:
440 SAVE_NVGPRS(r1)
441 lwz r0,_TRAP(r1)
442 rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
443 stw r0,_TRAP(r1) /* register set saved */
444 b sys_swapcontext
445
493/* 446/*
494 * Top-level page fault handling. 447 * Top-level page fault handling.
495 * This is in assembler because if do_page_fault tells us that 448 * This is in assembler because if do_page_fault tells us that
@@ -683,7 +636,7 @@ user_exc_return: /* r10 contains MSR_KERNEL here */
683 /* Check current_thread_info()->flags */ 636 /* Check current_thread_info()->flags */
684 rlwinm r9,r1,0,0,(31-THREAD_SHIFT) 637 rlwinm r9,r1,0,0,(31-THREAD_SHIFT)
685 lwz r9,TI_FLAGS(r9) 638 lwz r9,TI_FLAGS(r9)
686 andi. r0,r9,(_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL|_TIF_RESTORE_SIGMASK) 639 andi. r0,r9,(_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_NEED_RESCHED)
687 bne do_work 640 bne do_work
688 641
689restore_user: 642restore_user:
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 388f861b8ed1..24be0cf86d7f 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -160,7 +160,7 @@ syscall_exit:
160 mtmsrd r10,1 160 mtmsrd r10,1
161 ld r9,TI_FLAGS(r12) 161 ld r9,TI_FLAGS(r12)
162 li r11,-_LAST_ERRNO 162 li r11,-_LAST_ERRNO
163 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL|_TIF_SAVE_NVGPRS|_TIF_NOERROR|_TIF_RESTORE_SIGMASK) 163 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK)
164 bne- syscall_exit_work 164 bne- syscall_exit_work
165 cmpld r3,r11 165 cmpld r3,r11
166 ld r5,_CCR(r1) 166 ld r5,_CCR(r1)
@@ -216,8 +216,10 @@ syscall_exit_work:
216 If TIF_NOERROR is set, just save r3 as it is. */ 216 If TIF_NOERROR is set, just save r3 as it is. */
217 217
218 andi. r0,r9,_TIF_RESTOREALL 218 andi. r0,r9,_TIF_RESTOREALL
219 bne- 2f 219 beq+ 0f
220 cmpld r3,r11 /* r10 is -LAST_ERRNO */ 220 REST_NVGPRS(r1)
221 b 2f
2220: cmpld r3,r11 /* r10 is -LAST_ERRNO */
221 blt+ 1f 223 blt+ 1f
222 andi. r0,r9,_TIF_NOERROR 224 andi. r0,r9,_TIF_NOERROR
223 bne- 1f 225 bne- 1f
@@ -229,9 +231,7 @@ syscall_exit_work:
2292: andi. r0,r9,(_TIF_PERSYSCALL_MASK) 2312: andi. r0,r9,(_TIF_PERSYSCALL_MASK)
230 beq 4f 232 beq 4f
231 233
232 /* Clear per-syscall TIF flags if any are set, but _leave_ 234 /* Clear per-syscall TIF flags if any are set. */
233 _TIF_SAVE_NVGPRS set in r9 since we haven't dealt with that
234 yet. */
235 235
236 li r11,_TIF_PERSYSCALL_MASK 236 li r11,_TIF_PERSYSCALL_MASK
237 addi r12,r12,TI_FLAGS 237 addi r12,r12,TI_FLAGS
@@ -240,10 +240,9 @@ syscall_exit_work:
240 stdcx. r10,0,r12 240 stdcx. r10,0,r12
241 bne- 3b 241 bne- 3b
242 subi r12,r12,TI_FLAGS 242 subi r12,r12,TI_FLAGS
243 243
2444: bl .save_nvgprs 2444: /* Anything else left to do? */
245 /* Anything else left to do? */ 245 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
246 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SAVE_NVGPRS)
247 beq .ret_from_except_lite 246 beq .ret_from_except_lite
248 247
249 /* Re-enable interrupts */ 248 /* Re-enable interrupts */
@@ -251,26 +250,10 @@ syscall_exit_work:
251 ori r10,r10,MSR_EE 250 ori r10,r10,MSR_EE
252 mtmsrd r10,1 251 mtmsrd r10,1
253 252
254 andi. r0,r9,_TIF_SAVE_NVGPRS 253 bl .save_nvgprs
255 bne save_user_nvgprs
256
257 /* If tracing, re-enable interrupts and do it */
258save_user_nvgprs_cont:
259 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
260 beq 5f
261
262 addi r3,r1,STACK_FRAME_OVERHEAD 254 addi r3,r1,STACK_FRAME_OVERHEAD
263 bl .do_syscall_trace_leave 255 bl .do_syscall_trace_leave
264 REST_NVGPRS(r1) 256 b .ret_from_except
265 clrrdi r12,r1,THREAD_SHIFT
266
267 /* Disable interrupts again and handle other work if any */
2685: mfmsr r10
269 rldicl r10,r10,48,1
270 rotldi r10,r10,16
271 mtmsrd r10,1
272
273 b .ret_from_except_lite
274 257
275/* Save non-volatile GPRs, if not already saved. */ 258/* Save non-volatile GPRs, if not already saved. */
276_GLOBAL(save_nvgprs) 259_GLOBAL(save_nvgprs)
@@ -282,51 +265,6 @@ _GLOBAL(save_nvgprs)
282 std r0,_TRAP(r1) 265 std r0,_TRAP(r1)
283 blr 266 blr
284 267
285
286save_user_nvgprs:
287 ld r10,TI_SIGFRAME(r12)
288 andi. r0,r9,_TIF_32BIT
289 beq- save_user_nvgprs_64
290
291 /* 32-bit save to userspace */
292
293.macro savewords start, end
294 1: stw \start,4*(\start)(r10)
295 .section __ex_table,"a"
296 .align 3
297 .llong 1b,save_user_nvgprs_fault
298 .previous
299 .if \end - \start
300 savewords "(\start+1)",\end
301 .endif
302.endm
303 savewords 14,31
304 b save_user_nvgprs_cont
305
306save_user_nvgprs_64:
307 /* 64-bit save to userspace */
308
309.macro savelongs start, end
310 1: std \start,8*(\start)(r10)
311 .section __ex_table,"a"
312 .align 3
313 .llong 1b,save_user_nvgprs_fault
314 .previous
315 .if \end - \start
316 savelongs "(\start+1)",\end
317 .endif
318.endm
319 savelongs 14,31
320 b save_user_nvgprs_cont
321
322save_user_nvgprs_fault:
323 li r3,11 /* SIGSEGV */
324 ld r4,TI_TASK(r12)
325 bl .force_sigsegv
326
327 clrrdi r12,r1,THREAD_SHIFT
328 ld r9,TI_FLAGS(r12)
329 b save_user_nvgprs_cont
330 268
331/* 269/*
332 * The sigsuspend and rt_sigsuspend system calls can call do_signal 270 * The sigsuspend and rt_sigsuspend system calls can call do_signal
@@ -352,6 +290,16 @@ _GLOBAL(ppc_clone)
352 bl .sys_clone 290 bl .sys_clone
353 b syscall_exit 291 b syscall_exit
354 292
293_GLOBAL(ppc32_swapcontext)
294 bl .save_nvgprs
295 bl .compat_sys_swapcontext
296 b syscall_exit
297
298_GLOBAL(ppc64_swapcontext)
299 bl .save_nvgprs
300 bl .sys_swapcontext
301 b syscall_exit
302
355_GLOBAL(ret_from_fork) 303_GLOBAL(ret_from_fork)
356 bl .schedule_tail 304 bl .schedule_tail
357 REST_NVGPRS(r1) 305 REST_NVGPRS(r1)
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index d34fe537400e..813c2cd194c2 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -978,7 +978,7 @@ static void __init prom_init_mem(void)
978 if (size == 0) 978 if (size == 0)
979 continue; 979 continue;
980 prom_debug(" %x %x\n", base, size); 980 prom_debug(" %x %x\n", base, size);
981 if (base == 0) 981 if (base == 0 && (RELOC(of_platform) & PLATFORM_LPAR))
982 RELOC(rmo_top) = size; 982 RELOC(rmo_top) = size;
983 if ((base + size) > RELOC(ram_top)) 983 if ((base + size) > RELOC(ram_top))
984 RELOC(ram_top) = base + size; 984 RELOC(ram_top) = base + size;
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 400793c71304..bcb83574335b 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -561,10 +561,7 @@ void do_syscall_trace_leave(struct pt_regs *regs)
561 regs->result); 561 regs->result);
562 562
563 if ((test_thread_flag(TIF_SYSCALL_TRACE) 563 if ((test_thread_flag(TIF_SYSCALL_TRACE)
564#ifdef CONFIG_PPC64 564 || test_thread_flag(TIF_SINGLESTEP))
565 || test_thread_flag(TIF_SINGLESTEP)
566#endif
567 )
568 && (current->ptrace & PT_PTRACED)) 565 && (current->ptrace & PT_PTRACED))
569 do_syscall_trace(); 566 do_syscall_trace();
570} 567}
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index bd837b5dbf06..d7a4e814974d 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -151,10 +151,7 @@ static inline int save_general_regs(struct pt_regs *regs,
151 elf_greg_t64 *gregs = (elf_greg_t64 *)regs; 151 elf_greg_t64 *gregs = (elf_greg_t64 *)regs;
152 int i; 152 int i;
153 153
154 if (!FULL_REGS(regs)) { 154 WARN_ON(!FULL_REGS(regs));
155 set_thread_flag(TIF_SAVE_NVGPRS);
156 current_thread_info()->nvgprs_frame = frame->mc_gregs;
157 }
158 155
159 for (i = 0; i <= PT_RESULT; i ++) { 156 for (i = 0; i <= PT_RESULT; i ++) {
160 if (i == 14 && !FULL_REGS(regs)) 157 if (i == 14 && !FULL_REGS(regs))
@@ -215,15 +212,7 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka,
215static inline int save_general_regs(struct pt_regs *regs, 212static inline int save_general_regs(struct pt_regs *regs,
216 struct mcontext __user *frame) 213 struct mcontext __user *frame)
217{ 214{
218 if (!FULL_REGS(regs)) { 215 WARN_ON(!FULL_REGS(regs));
219 /* Zero out the unsaved GPRs to avoid information
220 leak, and set TIF_SAVE_NVGPRS to ensure that the
221 registers do actually get saved later. */
222 memset(&regs->gpr[14], 0, 18 * sizeof(unsigned long));
223 current_thread_info()->nvgprs_frame = &frame->mc_gregs;
224 set_thread_flag(TIF_SAVE_NVGPRS);
225 }
226
227 return __copy_to_user(&frame->mc_gregs, regs, GP_REGS_SIZE); 216 return __copy_to_user(&frame->mc_gregs, regs, GP_REGS_SIZE);
228} 217}
229 218
@@ -826,8 +815,8 @@ static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int
826} 815}
827 816
828long sys_swapcontext(struct ucontext __user *old_ctx, 817long sys_swapcontext(struct ucontext __user *old_ctx,
829 struct ucontext __user *new_ctx, 818 struct ucontext __user *new_ctx,
830 int ctx_size, int r6, int r7, int r8, struct pt_regs *regs) 819 int ctx_size, int r6, int r7, int r8, struct pt_regs *regs)
831{ 820{
832 unsigned char tmp; 821 unsigned char tmp;
833 822
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 497a5d3df359..4324f8a8ba24 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -118,14 +118,7 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
118 err |= __put_user(0, &sc->v_regs); 118 err |= __put_user(0, &sc->v_regs);
119#endif /* CONFIG_ALTIVEC */ 119#endif /* CONFIG_ALTIVEC */
120 err |= __put_user(&sc->gp_regs, &sc->regs); 120 err |= __put_user(&sc->gp_regs, &sc->regs);
121 if (!FULL_REGS(regs)) { 121 WARN_ON(!FULL_REGS(regs));
122 /* Zero out the unsaved GPRs to avoid information
123 leak, and set TIF_SAVE_NVGPRS to ensure that the
124 registers do actually get saved later. */
125 memset(&regs->gpr[14], 0, 18 * sizeof(unsigned long));
126 set_thread_flag(TIF_SAVE_NVGPRS);
127 current_thread_info()->nvgprs_frame = &sc->gp_regs;
128 }
129 err |= __copy_to_user(&sc->gp_regs, regs, GP_REGS_SIZE); 122 err |= __copy_to_user(&sc->gp_regs, regs, GP_REGS_SIZE);
130 err |= __copy_to_user(&sc->fp_regs, &current->thread.fpr, FP_REGS_SIZE); 123 err |= __copy_to_user(&sc->fp_regs, &current->thread.fpr, FP_REGS_SIZE);
131 err |= __put_user(signr, &sc->signal); 124 err |= __put_user(signr, &sc->signal);
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
index 8a9f994ed917..1ad55f0466fd 100644
--- a/arch/powerpc/kernel/systbl.S
+++ b/arch/powerpc/kernel/systbl.S
@@ -288,7 +288,7 @@ COMPAT_SYS(clock_settime)
288COMPAT_SYS(clock_gettime) 288COMPAT_SYS(clock_gettime)
289COMPAT_SYS(clock_getres) 289COMPAT_SYS(clock_getres)
290COMPAT_SYS(clock_nanosleep) 290COMPAT_SYS(clock_nanosleep)
291COMPAT_SYS(swapcontext) 291SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext)
292COMPAT_SYS(tgkill) 292COMPAT_SYS(tgkill)
293COMPAT_SYS(utimes) 293COMPAT_SYS(utimes)
294COMPAT_SYS(statfs64) 294COMPAT_SYS(statfs64)
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 7509aa6474f2..98660aedeeb7 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -814,6 +814,8 @@ void __kprobes program_check_exception(struct pt_regs *regs)
814 return; 814 return;
815 } 815 }
816 816
817 local_irq_enable();
818
817 /* Try to emulate it if we should. */ 819 /* Try to emulate it if we should. */
818 if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) { 820 if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) {
819 switch (emulate_instruction(regs)) { 821 switch (emulate_instruction(regs)) {
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c
index 4ffd2a9832a0..9b7150f10414 100644
--- a/arch/powerpc/platforms/powermac/pfunc_base.c
+++ b/arch/powerpc/platforms/powermac/pfunc_base.c
@@ -9,7 +9,12 @@
9#include <asm/pmac_feature.h> 9#include <asm/pmac_feature.h>
10#include <asm/pmac_pfunc.h> 10#include <asm/pmac_pfunc.h>
11 11
12#undef DEBUG
13#ifdef DEBUG
12#define DBG(fmt...) printk(fmt) 14#define DBG(fmt...) printk(fmt)
15#else
16#define DBG(fmt...)
17#endif
13 18
14static irqreturn_t macio_gpio_irq(int irq, void *data, struct pt_regs *regs) 19static irqreturn_t macio_gpio_irq(int irq, void *data, struct pt_regs *regs)
15{ 20{
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c
index 356a739e52b2..4baa75b1d36f 100644
--- a/arch/powerpc/platforms/powermac/pfunc_core.c
+++ b/arch/powerpc/platforms/powermac/pfunc_core.c
@@ -20,7 +20,13 @@
20#define LOG_PARSE(fmt...) 20#define LOG_PARSE(fmt...)
21#define LOG_ERROR(fmt...) printk(fmt) 21#define LOG_ERROR(fmt...) printk(fmt)
22#define LOG_BLOB(t,b,c) 22#define LOG_BLOB(t,b,c)
23
24#undef DEBUG
25#ifdef DEBUG
23#define DBG(fmt...) printk(fmt) 26#define DBG(fmt...) printk(fmt)
27#else
28#define DBG(fmt...)
29#endif
24 30
25/* Command numbers */ 31/* Command numbers */
26#define PMF_CMD_LIST 0 32#define PMF_CMD_LIST 0
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 0df2cdcd805c..6d64a9bf3474 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -435,7 +435,7 @@ struct smp_ops_t psurge_smp_ops = {
435 */ 435 */
436 436
437static void (*pmac_tb_freeze)(int freeze); 437static void (*pmac_tb_freeze)(int freeze);
438static unsigned long timebase; 438static u64 timebase;
439static int tb_req; 439static int tb_req;
440 440
441static void smp_core99_give_timebase(void) 441static void smp_core99_give_timebase(void)
diff --git a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c
index 7964bf660e92..77e4dc780f8c 100644
--- a/arch/ppc/kernel/asm-offsets.c
+++ b/arch/ppc/kernel/asm-offsets.c
@@ -131,7 +131,6 @@ main(void)
131 DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); 131 DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features));
132 DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); 132 DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
133 133
134 DEFINE(TI_SIGFRAME, offsetof(struct thread_info, nvgprs_frame));
135 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 134 DEFINE(TI_TASK, offsetof(struct thread_info, task));
136 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); 135 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
137 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 136 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index a48b950722a1..3a2815978488 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -227,7 +227,7 @@ ret_from_syscall:
227 MTMSRD(r10) 227 MTMSRD(r10)
228 lwz r9,TI_FLAGS(r12) 228 lwz r9,TI_FLAGS(r12)
229 li r8,-_LAST_ERRNO 229 li r8,-_LAST_ERRNO
230 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL) 230 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK)
231 bne- syscall_exit_work 231 bne- syscall_exit_work
232 cmplw 0,r3,r8 232 cmplw 0,r3,r8
233 blt+ syscall_exit_cont 233 blt+ syscall_exit_cont
@@ -287,8 +287,10 @@ syscall_dotrace:
287 287
288syscall_exit_work: 288syscall_exit_work:
289 andi. r0,r9,_TIF_RESTOREALL 289 andi. r0,r9,_TIF_RESTOREALL
290 bne- 2f 290 beq+ 0f
291 cmplw 0,r3,r8 291 REST_NVGPRS(r1)
292 b 2f
2930: cmplw 0,r3,r8
292 blt+ 1f 294 blt+ 1f
293 andi. r0,r9,_TIF_NOERROR 295 andi. r0,r9,_TIF_NOERROR
294 bne- 1f 296 bne- 1f
@@ -302,9 +304,7 @@ syscall_exit_work:
3022: andi. r0,r9,(_TIF_PERSYSCALL_MASK) 3042: andi. r0,r9,(_TIF_PERSYSCALL_MASK)
303 beq 4f 305 beq 4f
304 306
305 /* Clear per-syscall TIF flags if any are set, but _leave_ 307 /* Clear per-syscall TIF flags if any are set. */
306 _TIF_SAVE_NVGPRS set in r9 since we haven't dealt with that
307 yet. */
308 308
309 li r11,_TIF_PERSYSCALL_MASK 309 li r11,_TIF_PERSYSCALL_MASK
310 addi r12,r12,TI_FLAGS 310 addi r12,r12,TI_FLAGS
@@ -318,8 +318,13 @@ syscall_exit_work:
318 subi r12,r12,TI_FLAGS 318 subi r12,r12,TI_FLAGS
319 319
3204: /* Anything which requires enabling interrupts? */ 3204: /* Anything which requires enabling interrupts? */
321 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SAVE_NVGPRS) 321 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
322 beq 7f 322 beq ret_from_except
323
324 /* Re-enable interrupts */
325 ori r10,r10,MSR_EE
326 SYNC
327 MTMSRD(r10)
323 328
324 /* Save NVGPRS if they're not saved already */ 329 /* Save NVGPRS if they're not saved already */
325 lwz r4,TRAP(r1) 330 lwz r4,TRAP(r1)
@@ -328,71 +333,11 @@ syscall_exit_work:
328 SAVE_NVGPRS(r1) 333 SAVE_NVGPRS(r1)
329 li r4,0xc00 334 li r4,0xc00
330 stw r4,TRAP(r1) 335 stw r4,TRAP(r1)
331 3365:
332 /* Re-enable interrupts */
3335: ori r10,r10,MSR_EE
334 SYNC
335 MTMSRD(r10)
336
337 andi. r0,r9,_TIF_SAVE_NVGPRS
338 bne save_user_nvgprs
339
340save_user_nvgprs_cont:
341 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
342 beq 7f
343
344 addi r3,r1,STACK_FRAME_OVERHEAD 337 addi r3,r1,STACK_FRAME_OVERHEAD
345 bl do_syscall_trace_leave 338 bl do_syscall_trace_leave
346 REST_NVGPRS(r1) 339 b ret_from_except_full
347
3486: lwz r3,GPR3(r1)
349 LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
350 SYNC
351 MTMSRD(r10) /* disable interrupts again */
352 rlwinm r12,r1,0,0,18 /* current_thread_info() */
353 lwz r9,TI_FLAGS(r12)
3547:
355 andi. r0,r9,_TIF_NEED_RESCHED
356 bne 8f
357 lwz r5,_MSR(r1)
358 andi. r5,r5,MSR_PR
359 beq ret_from_except
360 andi. r0,r9,_TIF_SIGPENDING
361 beq ret_from_except
362 b do_user_signal
3638:
364 ori r10,r10,MSR_EE
365 SYNC
366 MTMSRD(r10) /* re-enable interrupts */
367 bl schedule
368 b 6b
369
370save_user_nvgprs:
371 lwz r8,TI_SIGFRAME(r12)
372
373.macro savewords start, end
374 1: stw \start,4*(\start)(r8)
375 .section __ex_table,"a"
376 .align 2
377 .long 1b,save_user_nvgprs_fault
378 .previous
379 .if \end - \start
380 savewords "(\start+1)",\end
381 .endif
382.endm
383 savewords 14,31
384 b save_user_nvgprs_cont
385
386
387save_user_nvgprs_fault:
388 li r3,11 /* SIGSEGV */
389 lwz r4,TI_TASK(r12)
390 bl force_sigsegv
391 340
392 rlwinm r12,r1,0,0,18 /* current_thread_info() */
393 lwz r9,TI_FLAGS(r12)
394 b save_user_nvgprs_cont
395
396#ifdef SHOW_SYSCALLS 341#ifdef SHOW_SYSCALLS
397do_show_syscall: 342do_show_syscall:
398#ifdef SHOW_SYSCALLS_TASK 343#ifdef SHOW_SYSCALLS_TASK
@@ -490,6 +435,14 @@ ppc_clone:
490 stw r0,TRAP(r1) /* register set saved */ 435 stw r0,TRAP(r1) /* register set saved */
491 b sys_clone 436 b sys_clone
492 437
438 .globl ppc_swapcontext
439ppc_swapcontext:
440 SAVE_NVGPRS(r1)
441 lwz r0,TRAP(r1)
442 rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
443 stw r0,TRAP(r1) /* register set saved */
444 b sys_swapcontext
445
493/* 446/*
494 * Top-level page fault handling. 447 * Top-level page fault handling.
495 * This is in assembler because if do_page_fault tells us that 448 * This is in assembler because if do_page_fault tells us that
@@ -683,7 +636,7 @@ user_exc_return: /* r10 contains MSR_KERNEL here */
683 /* Check current_thread_info()->flags */ 636 /* Check current_thread_info()->flags */
684 rlwinm r9,r1,0,0,18 637 rlwinm r9,r1,0,0,18
685 lwz r9,TI_FLAGS(r9) 638 lwz r9,TI_FLAGS(r9)
686 andi. r0,r9,(_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL) 639 andi. r0,r9,(_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_NEED_RESCHED)
687 bne do_work 640 bne do_work
688 641
689restore_user: 642restore_user:
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
index 60f80a4eed4e..b9b7958a226a 100644
--- a/arch/s390/lib/spinlock.c
+++ b/arch/s390/lib/spinlock.c
@@ -2,8 +2,7 @@
2 * arch/s390/lib/spinlock.c 2 * arch/s390/lib/spinlock.c
3 * Out of line spinlock code. 3 * Out of line spinlock code.
4 * 4 *
5 * S390 version 5 * Copyright (C) IBM Corp. 2004, 2006
6 * Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation
7 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) 6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
8 */ 7 */
9 8
@@ -44,6 +43,8 @@ _raw_spin_lock_wait(raw_spinlock_t *lp, unsigned int pc)
44 _diag44(); 43 _diag44();
45 count = spin_retry; 44 count = spin_retry;
46 } 45 }
46 if (__raw_spin_is_locked(lp))
47 continue;
47 if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0) 48 if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0)
48 return; 49 return;
49 } 50 }
@@ -56,6 +57,8 @@ _raw_spin_trylock_retry(raw_spinlock_t *lp, unsigned int pc)
56 int count = spin_retry; 57 int count = spin_retry;
57 58
58 while (count-- > 0) { 59 while (count-- > 0) {
60 if (__raw_spin_is_locked(lp))
61 continue;
59 if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0) 62 if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0)
60 return 1; 63 return 1;
61 } 64 }
@@ -74,6 +77,8 @@ _raw_read_lock_wait(raw_rwlock_t *rw)
74 _diag44(); 77 _diag44();
75 count = spin_retry; 78 count = spin_retry;
76 } 79 }
80 if (!__raw_read_can_lock(rw))
81 continue;
77 old = rw->lock & 0x7fffffffU; 82 old = rw->lock & 0x7fffffffU;
78 if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old) 83 if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old)
79 return; 84 return;
@@ -88,6 +93,8 @@ _raw_read_trylock_retry(raw_rwlock_t *rw)
88 int count = spin_retry; 93 int count = spin_retry;
89 94
90 while (count-- > 0) { 95 while (count-- > 0) {
96 if (!__raw_read_can_lock(rw))
97 continue;
91 old = rw->lock & 0x7fffffffU; 98 old = rw->lock & 0x7fffffffU;
92 if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old) 99 if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old)
93 return 1; 100 return 1;
@@ -106,6 +113,8 @@ _raw_write_lock_wait(raw_rwlock_t *rw)
106 _diag44(); 113 _diag44();
107 count = spin_retry; 114 count = spin_retry;
108 } 115 }
116 if (!__raw_write_can_lock(rw))
117 continue;
109 if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) 118 if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0)
110 return; 119 return;
111 } 120 }
@@ -118,6 +127,8 @@ _raw_write_trylock_retry(raw_rwlock_t *rw)
118 int count = spin_retry; 127 int count = spin_retry;
119 128
120 while (count-- > 0) { 129 while (count-- > 0) {
130 if (!__raw_write_can_lock(rw))
131 continue;
121 if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) 132 if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0)
122 return 1; 133 return 1;
123 } 134 }
diff --git a/arch/s390/lib/uaccess.S b/arch/s390/lib/uaccess.S
index 88fc94fe6488..5d59e2625048 100644
--- a/arch/s390/lib/uaccess.S
+++ b/arch/s390/lib/uaccess.S
@@ -198,12 +198,12 @@ __strnlen_user_asm:
1980: srst %r2,%r1 1980: srst %r2,%r1
199 jo 0b 199 jo 0b
200 sacf 0 200 sacf 0
201 jh 1f # \0 found in string ?
202 ahi %r2,1 # strnlen_user result includes the \0 201 ahi %r2,1 # strnlen_user result includes the \0
2031: slr %r2,%r3 202 # or return count+1 if \0 not found
203 slr %r2,%r3
204 br %r14 204 br %r14
2052: sacf 0 2052: sacf 0
206 lhi %r2,-EFAULT 206 slr %r2,%r2 # return 0 on exception
207 br %r14 207 br %r14
208 .section __ex_table,"a" 208 .section __ex_table,"a"
209 .long 0b,2b 209 .long 0b,2b
diff --git a/arch/s390/lib/uaccess64.S b/arch/s390/lib/uaccess64.S
index 50219786fc7a..19b41a33c230 100644
--- a/arch/s390/lib/uaccess64.S
+++ b/arch/s390/lib/uaccess64.S
@@ -194,12 +194,12 @@ __strnlen_user_asm:
1940: srst %r2,%r1 1940: srst %r2,%r1
195 jo 0b 195 jo 0b
196 sacf 0 196 sacf 0
197 jh 1f # \0 found in string ?
198 aghi %r2,1 # strnlen_user result includes the \0 197 aghi %r2,1 # strnlen_user result includes the \0
1991: slgr %r2,%r3 198 # or return count+1 if \0 not found
199 slgr %r2,%r3
200 br %r14 200 br %r14
2012: sacf 0 2012: sacf 0
202 lghi %r2,-EFAULT 202 slgr %r2,%r2 # return 0 on exception
203 br %r14 203 br %r14
204 .section __ex_table,"a" 204 .section __ex_table,"a"
205 .quad 0b,2b 205 .quad 0b,2b
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index e73621d03a28..e9b275d90737 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -392,9 +392,9 @@ config SH_TMU
392 392
393endmenu 393endmenu
394 394
395source "arch/sh/boards/renesas/hs7751rvoip/Kconfig" 395#source "arch/sh/boards/renesas/hs7751rvoip/Kconfig"
396 396
397source "arch/sh/boards/renesas/rts7751r2d/Kconfig" 397#source "arch/sh/boards/renesas/rts7751r2d/Kconfig"
398 398
399config SH_PCLK_FREQ 399config SH_PCLK_FREQ
400 int "Peripheral clock frequency (in Hz)" 400 int "Peripheral clock frequency (in Hz)"
diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S
index 60b59375aa78..c4a1cef4b1e5 100644
--- a/arch/sparc64/kernel/sys32.S
+++ b/arch/sparc64/kernel/sys32.S
@@ -318,7 +318,7 @@ do_sys_recvmsg: /* compat_sys_recvmsg(int, struct compat_msghdr *, unsigned int)
318 nop 318 nop
319 nop 319 nop
320 320
321 .section __ex_table 321 .section __ex_table,"a"
322 .align 4 322 .align 4
323 .word 1b, __retl_efault, 2b, __retl_efault 323 .word 1b, __retl_efault, 2b, __retl_efault
324 .word 3b, __retl_efault, 4b, __retl_efault 324 .word 3b, __retl_efault, 4b, __retl_efault
diff --git a/arch/sparc64/kernel/una_asm.S b/arch/sparc64/kernel/una_asm.S
index 1f5b5b708ce7..be183fe41443 100644
--- a/arch/sparc64/kernel/una_asm.S
+++ b/arch/sparc64/kernel/una_asm.S
@@ -47,7 +47,7 @@ __do_int_store:
47 mov 0, %o0 47 mov 0, %o0
48 .size __do_int_store, .-__do_int_store 48 .size __do_int_store, .-__do_int_store
49 49
50 .section __ex_table 50 .section __ex_table,"a"
51 .word 4b, __retl_efault 51 .word 4b, __retl_efault
52 .word 5b, __retl_efault 52 .word 5b, __retl_efault
53 .word 6b, __retl_efault 53 .word 6b, __retl_efault
@@ -129,7 +129,7 @@ do_int_load:
129 mov 0, %o0 129 mov 0, %o0
130 .size __do_int_load, .-__do_int_load 130 .size __do_int_load, .-__do_int_load
131 131
132 .section __ex_table 132 .section __ex_table,"a"
133 .word 4b, __retl_efault 133 .word 4b, __retl_efault
134 .word 5b, __retl_efault 134 .word 5b, __retl_efault
135 .word 6b, __retl_efault 135 .word 6b, __retl_efault
diff --git a/arch/sparc64/lib/U1copy_from_user.S b/arch/sparc64/lib/U1copy_from_user.S
index 93146a81e2d3..3192b0bf4fab 100644
--- a/arch/sparc64/lib/U1copy_from_user.S
+++ b/arch/sparc64/lib/U1copy_from_user.S
@@ -9,7 +9,7 @@
9 .align 4; \ 9 .align 4; \
1099: retl; \ 1099: retl; \
11 mov 1, %o0; \ 11 mov 1, %o0; \
12 .section __ex_table; \ 12 .section __ex_table,"a";\
13 .align 4; \ 13 .align 4; \
14 .word 98b, 99b; \ 14 .word 98b, 99b; \
15 .text; \ 15 .text; \
diff --git a/arch/sparc64/lib/U1copy_to_user.S b/arch/sparc64/lib/U1copy_to_user.S
index 1fccc521e2bd..d1210ffb0b82 100644
--- a/arch/sparc64/lib/U1copy_to_user.S
+++ b/arch/sparc64/lib/U1copy_to_user.S
@@ -9,7 +9,7 @@
9 .align 4; \ 9 .align 4; \
1099: retl; \ 1099: retl; \
11 mov 1, %o0; \ 11 mov 1, %o0; \
12 .section __ex_table; \ 12 .section __ex_table,"a";\
13 .align 4; \ 13 .align 4; \
14 .word 98b, 99b; \ 14 .word 98b, 99b; \
15 .text; \ 15 .text; \
diff --git a/arch/sparc64/lib/U3copy_from_user.S b/arch/sparc64/lib/U3copy_from_user.S
index df600b667e48..f5bfc8d9d216 100644
--- a/arch/sparc64/lib/U3copy_from_user.S
+++ b/arch/sparc64/lib/U3copy_from_user.S
@@ -9,7 +9,7 @@
9 .align 4; \ 9 .align 4; \
1099: retl; \ 1099: retl; \
11 mov 1, %o0; \ 11 mov 1, %o0; \
12 .section __ex_table; \ 12 .section __ex_table,"a";\
13 .align 4; \ 13 .align 4; \
14 .word 98b, 99b; \ 14 .word 98b, 99b; \
15 .text; \ 15 .text; \
diff --git a/arch/sparc64/lib/U3copy_to_user.S b/arch/sparc64/lib/U3copy_to_user.S
index f337f22ed82e..2334f111bb0c 100644
--- a/arch/sparc64/lib/U3copy_to_user.S
+++ b/arch/sparc64/lib/U3copy_to_user.S
@@ -9,7 +9,7 @@
9 .align 4; \ 9 .align 4; \
1099: retl; \ 1099: retl; \
11 mov 1, %o0; \ 11 mov 1, %o0; \
12 .section __ex_table; \ 12 .section __ex_table,"a";\
13 .align 4; \ 13 .align 4; \
14 .word 98b, 99b; \ 14 .word 98b, 99b; \
15 .text; \ 15 .text; \
diff --git a/arch/sparc64/lib/bzero.S b/arch/sparc64/lib/bzero.S
index 21a933ffb7c2..1d2abcfa4e52 100644
--- a/arch/sparc64/lib/bzero.S
+++ b/arch/sparc64/lib/bzero.S
@@ -92,7 +92,7 @@ __bzero_done:
92 .align 4; \ 92 .align 4; \
9399: retl; \ 9399: retl; \
94 mov %o1, %o0; \ 94 mov %o1, %o0; \
95 .section __ex_table; \ 95 .section __ex_table,"a";\
96 .align 4; \ 96 .align 4; \
97 .word 98b, 99b; \ 97 .word 98b, 99b; \
98 .text; \ 98 .text; \
diff --git a/arch/sparc64/lib/copy_in_user.S b/arch/sparc64/lib/copy_in_user.S
index 816076c0bc06..650af3f21f78 100644
--- a/arch/sparc64/lib/copy_in_user.S
+++ b/arch/sparc64/lib/copy_in_user.S
@@ -13,7 +13,7 @@
13 .align 4; \ 13 .align 4; \
1499: retl; \ 1499: retl; \
15 mov 1, %o0; \ 15 mov 1, %o0; \
16 .section __ex_table; \ 16 .section __ex_table,"a";\
17 .align 4; \ 17 .align 4; \
18 .word 98b, 99b; \ 18 .word 98b, 99b; \
19 .text; \ 19 .text; \
diff --git a/arch/sparc64/lib/csum_copy_from_user.S b/arch/sparc64/lib/csum_copy_from_user.S
index 817ebdae39f8..a22eddbe5dba 100644
--- a/arch/sparc64/lib/csum_copy_from_user.S
+++ b/arch/sparc64/lib/csum_copy_from_user.S
@@ -9,7 +9,7 @@
9 .align 4; \ 9 .align 4; \
1099: retl; \ 1099: retl; \
11 mov -1, %o0; \ 11 mov -1, %o0; \
12 .section __ex_table; \ 12 .section __ex_table,"a";\
13 .align 4; \ 13 .align 4; \
14 .word 98b, 99b; \ 14 .word 98b, 99b; \
15 .text; \ 15 .text; \
diff --git a/arch/sparc64/lib/csum_copy_to_user.S b/arch/sparc64/lib/csum_copy_to_user.S
index c2f9463ea1e2..d5b12f441f02 100644
--- a/arch/sparc64/lib/csum_copy_to_user.S
+++ b/arch/sparc64/lib/csum_copy_to_user.S
@@ -9,7 +9,7 @@
9 .align 4; \ 9 .align 4; \
1099: retl; \ 1099: retl; \
11 mov -1, %o0; \ 11 mov -1, %o0; \
12 .section __ex_table; \ 12 .section __ex_table,"a";\
13 .align 4; \ 13 .align 4; \
14 .word 98b, 99b; \ 14 .word 98b, 99b; \
15 .text; \ 15 .text; \
diff --git a/arch/sparc64/lib/strlen_user.S b/arch/sparc64/lib/strlen_user.S
index 9ed54ba14fc6..114ed111e251 100644
--- a/arch/sparc64/lib/strlen_user.S
+++ b/arch/sparc64/lib/strlen_user.S
@@ -85,7 +85,7 @@ __strnlen_user:
85 retl 85 retl
86 clr %o0 86 clr %o0
87 87
88 .section __ex_table,#alloc 88 .section __ex_table,"a"
89 .align 4 89 .align 4
90 90
91 .word 10b, 30b 91 .word 10b, 30b
diff --git a/arch/sparc64/lib/strncpy_from_user.S b/arch/sparc64/lib/strncpy_from_user.S
index e1264650ca7a..b2f499f79427 100644
--- a/arch/sparc64/lib/strncpy_from_user.S
+++ b/arch/sparc64/lib/strncpy_from_user.S
@@ -125,7 +125,7 @@ __strncpy_from_user:
125 add %o2, %o3, %o0 125 add %o2, %o3, %o0
126 .size __strncpy_from_user, .-__strncpy_from_user 126 .size __strncpy_from_user, .-__strncpy_from_user
127 127
128 .section __ex_table,#alloc 128 .section __ex_table,"a"
129 .align 4 129 .align 4
130 .word 60b, __retl_efault 130 .word 60b, __retl_efault
131 .word 61b, __retl_efault 131 .word 61b, __retl_efault
diff --git a/arch/sparc64/solaris/entry64.S b/arch/sparc64/solaris/entry64.S
index eb314ed23cdb..f170324e8bf2 100644
--- a/arch/sparc64/solaris/entry64.S
+++ b/arch/sparc64/solaris/entry64.S
@@ -217,7 +217,7 @@ solaris_unimplemented:
217 ba,pt %xcc, ret_from_solaris 217 ba,pt %xcc, ret_from_solaris
218 nop 218 nop
219 219
220 .section __ex_table,#alloc 220 .section __ex_table,"a"
221 .align 4 221 .align 4
222 .word exen, exenf 222 .word exen, exenf
223 223
diff --git a/arch/v850/kernel/process.c b/arch/v850/kernel/process.c
index eb909937958b..621111ddf907 100644
--- a/arch/v850/kernel/process.c
+++ b/arch/v850/kernel/process.c
@@ -30,6 +30,9 @@
30#include <asm/system.h> 30#include <asm/system.h>
31#include <asm/pgtable.h> 31#include <asm/pgtable.h>
32 32
33void (*pm_power_off)(void) = NULL;
34EXPORT_SYMBOL(pm_power_off);
35
33extern void ret_from_fork (void); 36extern void ret_from_fork (void);
34 37
35 38
diff --git a/arch/x86_64/kernel/machine_kexec.c b/arch/x86_64/kernel/machine_kexec.c
index 89fab51e20f4..25ac8a3faae6 100644
--- a/arch/x86_64/kernel/machine_kexec.c
+++ b/arch/x86_64/kernel/machine_kexec.c
@@ -140,7 +140,7 @@ static void load_segments(void)
140 "\tmovl %0,%%ss\n" 140 "\tmovl %0,%%ss\n"
141 "\tmovl %0,%%fs\n" 141 "\tmovl %0,%%fs\n"
142 "\tmovl %0,%%gs\n" 142 "\tmovl %0,%%gs\n"
143 : : "a" (__KERNEL_DS) 143 : : "a" (__KERNEL_DS) : "memory"
144 ); 144 );
145} 145}
146 146
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 7ee4a14ec3b1..e90ef5db8913 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -26,6 +26,10 @@ config GENERIC_HARDIRQS
26 bool 26 bool
27 default y 27 default y
28 28
29config RWSEM_GENERIC_SPINLOCK
30 bool
31 default y
32
29source "init/Kconfig" 33source "init/Kconfig"
30 34
31menu "Processor type and features" 35menu "Processor type and features"
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c
index f1f596644bfc..64a649eb883f 100644
--- a/arch/xtensa/kernel/process.c
+++ b/arch/xtensa/kernel/process.c
@@ -64,6 +64,9 @@ EXPORT_SYMBOL(init_task);
64 64
65struct task_struct *current_set[NR_CPUS] = {&init_task, }; 65struct task_struct *current_set[NR_CPUS] = {&init_task, };
66 66
67void (*pm_power_off)(void) = NULL;
68EXPORT_SYMBOL(pm_power_off);
69
67 70
68#if XCHAL_CP_NUM > 0 71#if XCHAL_CP_NUM > 0
69 72