aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-06-26 17:19:40 -0400
committerAnton Altaparmakov <aia21@cantab.net>2005-06-26 17:19:40 -0400
commit2a322e4c08be4e7cb0c04b427ddaaa679fd88863 (patch)
treead8cc17bfd3b5e57e36f07a249028667d72f0b96 /include
parentba6d2377c85c9b8a793f455d8c9b6cf31985d70f (diff)
parent8678887e7fb43cd6c9be6c9807b05e77848e0920 (diff)
Automatic merge with /usr/src/ntfs-2.6.git.
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-ixp2000/io.h20
-rw-r--r--include/asm-arm/arch-ixp2000/ixp2000-regs.h2
-rw-r--r--include/asm-arm/mach/time.h21
-rw-r--r--include/asm-arm/signal.h1
-rw-r--r--include/asm-arm/system.h30
-rw-r--r--include/asm-generic/vmlinux.lds.h2
-rw-r--r--include/asm-i386/apic.h15
-rw-r--r--include/asm-i386/apicdef.h3
-rw-r--r--include/asm-i386/cpu.h2
-rw-r--r--include/asm-i386/highmem.h1
-rw-r--r--include/asm-i386/irq.h6
-rw-r--r--include/asm-i386/kdebug.h2
-rw-r--r--include/asm-i386/kexec.h33
-rw-r--r--include/asm-i386/mach-default/mach_ipi.h27
-rw-r--r--include/asm-i386/page.h3
-rw-r--r--include/asm-i386/processor.h2
-rw-r--r--include/asm-i386/smp.h10
-rw-r--r--include/asm-i386/topology.h7
-rw-r--r--include/asm-ia64/system.h10
-rw-r--r--include/asm-ia64/topology.h61
-rw-r--r--include/asm-mips/mmzone.h4
-rw-r--r--include/asm-mips/page.h2
-rw-r--r--include/asm-mips/pgtable.h2
-rw-r--r--include/asm-mips/system.h10
-rw-r--r--include/asm-ppc/fsl_ocp.h54
-rw-r--r--include/asm-ppc/kexec.h38
-rw-r--r--include/asm-ppc/machdep.h31
-rw-r--r--include/asm-ppc/mmu.h2
-rw-r--r--include/asm-ppc/mmu_context.h2
-rw-r--r--include/asm-ppc/ocp.h4
-rw-r--r--include/asm-ppc/ppc_asm.h2
-rw-r--r--include/asm-ppc/reg.h1
-rw-r--r--include/asm-ppc/reg_booke.h18
-rw-r--r--include/asm-ppc64/kdebug.h2
-rw-r--r--include/asm-ppc64/kexec.h41
-rw-r--r--include/asm-ppc64/machdep.h1
-rw-r--r--include/asm-ppc64/mmu.h22
-rw-r--r--include/asm-ppc64/xics.h1
-rw-r--r--include/asm-s390/cpcmd.h18
-rw-r--r--include/asm-s390/debug.h48
-rw-r--r--include/asm-s390/kexec.h42
-rw-r--r--include/asm-s390/lowcore.h7
-rw-r--r--include/asm-s390/processor.h52
-rw-r--r--include/asm-s390/ptrace.h2
-rw-r--r--include/asm-s390/system.h38
-rw-r--r--include/asm-s390/thread_info.h2
-rw-r--r--include/asm-s390/unistd.h2
-rw-r--r--include/asm-sparc/system.h4
-rw-r--r--include/asm-sparc64/kdebug.h2
-rw-r--r--include/asm-sparc64/system.h14
-rw-r--r--include/asm-sparc64/termios.h78
-rw-r--r--include/asm-um/ptrace-i386.h4
-rw-r--r--include/asm-x86_64/apic.h2
-rw-r--r--include/asm-x86_64/apicdef.h2
-rw-r--r--include/asm-x86_64/irq.h5
-rw-r--r--include/asm-x86_64/kdebug.h2
-rw-r--r--include/asm-x86_64/kexec.h33
-rw-r--r--include/asm-x86_64/page.h6
-rw-r--r--include/asm-x86_64/smp.h4
-rw-r--r--include/asm-x86_64/suspend.h2
-rw-r--r--include/asm-x86_64/topology.h10
-rw-r--r--include/asm-x86_64/unistd.h2
-rw-r--r--include/linux/a.out.h2
-rw-r--r--include/linux/blkdev.h6
-rw-r--r--include/linux/bootmem.h4
-rw-r--r--include/linux/cpu.h1
-rw-r--r--include/linux/crash_dump.h18
-rw-r--r--include/linux/dmi.h1
-rw-r--r--include/linux/highmem.h1
-rw-r--r--include/linux/init.h12
-rw-r--r--include/linux/init_task.h1
-rw-r--r--include/linux/kernel.h18
-rw-r--r--include/linux/kexec.h135
-rw-r--r--include/linux/list.h2
-rw-r--r--include/linux/nvram.h2
-rw-r--r--include/linux/pm.h33
-rw-r--r--include/linux/proc_fs.h7
-rw-r--r--include/linux/reboot.h4
-rw-r--r--include/linux/sched.h111
-rw-r--r--include/linux/suspend.h2
-rw-r--r--include/linux/syscalls.h5
-rw-r--r--include/linux/topology.h14
82 files changed, 925 insertions, 330 deletions
diff --git a/include/asm-arm/arch-ixp2000/io.h b/include/asm-arm/arch-ixp2000/io.h
index 5e56b47446..3241cd6f07 100644
--- a/include/asm-arm/arch-ixp2000/io.h
+++ b/include/asm-arm/arch-ixp2000/io.h
@@ -17,16 +17,21 @@
17 17
18#define IO_SPACE_LIMIT 0xffffffff 18#define IO_SPACE_LIMIT 0xffffffff
19#define __mem_pci(a) (a) 19#define __mem_pci(a) (a)
20#define ___io(p) ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
21 20
22/* 21/*
23 * The IXP2400 before revision B0 asserts byte lanes for PCI I/O 22 * The A? revisions of the IXP2000s assert byte lanes for PCI I/O
24 * transactions the other way round (MEM transactions don't have this 23 * transactions the other way round (MEM transactions don't have this
25 * issue), so we need to override the standard functions. B0 and later 24 * issue), so if we want to support those models, we need to override
26 * have a bit that can be set to 1 to get the 'proper' behavior, but 25 * the standard I/O functions.
27 * since that isn't available on the A? revisions we just keep doing 26 *
28 * things manually. 27 * B0 and later have a bit that can be set to 1 to get the proper
28 * behavior for I/O transactions, which then allows us to use the
29 * standard I/O functions. This is what we do if the user does not
30 * explicitly ask for support for pre-B0.
29 */ 31 */
32#ifdef CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO
33#define ___io(p) ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
34
30#define alignb(addr) (void __iomem *)((unsigned long)(addr) ^ 3) 35#define alignb(addr) (void __iomem *)((unsigned long)(addr) ^ 3)
31#define alignw(addr) (void __iomem *)((unsigned long)(addr) ^ 2) 36#define alignw(addr) (void __iomem *)((unsigned long)(addr) ^ 2)
32 37
@@ -119,6 +124,9 @@
119#define ioport_map(port, nr) ___io(port) 124#define ioport_map(port, nr) ___io(port)
120 125
121#define ioport_unmap(addr) 126#define ioport_unmap(addr)
127#else
128#define __io(p) ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
129#endif
122 130
123 131
124#ifdef CONFIG_ARCH_IXDP2X01 132#ifdef CONFIG_ARCH_IXDP2X01
diff --git a/include/asm-arm/arch-ixp2000/ixp2000-regs.h b/include/asm-arm/arch-ixp2000/ixp2000-regs.h
index a1d9e181b1..5eb47d4bfb 100644
--- a/include/asm-arm/arch-ixp2000/ixp2000-regs.h
+++ b/include/asm-arm/arch-ixp2000/ixp2000-regs.h
@@ -241,7 +241,7 @@
241#define PCI_CONTROL_BE_DEI (1 << 21) /* Big Endian Data Enable In */ 241#define PCI_CONTROL_BE_DEI (1 << 21) /* Big Endian Data Enable In */
242#define PCI_CONTROL_BE_BEO (1 << 20) /* Big Endian Byte Enable Out */ 242#define PCI_CONTROL_BE_BEO (1 << 20) /* Big Endian Byte Enable Out */
243#define PCI_CONTROL_BE_BEI (1 << 19) /* Big Endian Byte Enable In */ 243#define PCI_CONTROL_BE_BEI (1 << 19) /* Big Endian Byte Enable In */
244#define PCI_CONTROL_PNR (1 << 17) /* PCI Not Reset bit */ 244#define PCI_CONTROL_IEE (1 << 17) /* I/O cycle Endian swap Enable */
245 245
246#define IXP2000_PCI_RST_REL (1 << 2) 246#define IXP2000_PCI_RST_REL (1 << 2)
247#define CFG_RST_DIR (*IXP2000_PCI_CONTROL & IXP2000_PCICNTL_PCF) 247#define CFG_RST_DIR (*IXP2000_PCI_CONTROL & IXP2000_PCICNTL_PCF)
diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h
index 5cf4fd659f..047980ad18 100644
--- a/include/asm-arm/mach/time.h
+++ b/include/asm-arm/mach/time.h
@@ -39,8 +39,29 @@ struct sys_timer {
39 void (*suspend)(void); 39 void (*suspend)(void);
40 void (*resume)(void); 40 void (*resume)(void);
41 unsigned long (*offset)(void); 41 unsigned long (*offset)(void);
42
43#ifdef CONFIG_NO_IDLE_HZ
44 struct dyn_tick_timer *dyn_tick;
45#endif
46};
47
48#ifdef CONFIG_NO_IDLE_HZ
49
50#define DYN_TICK_SKIPPING (1 << 2)
51#define DYN_TICK_ENABLED (1 << 1)
52#define DYN_TICK_SUITABLE (1 << 0)
53
54struct dyn_tick_timer {
55 unsigned int state; /* Current state */
56 int (*enable)(void); /* Enables dynamic tick */
57 int (*disable)(void); /* Disables dynamic tick */
58 void (*reprogram)(unsigned long); /* Reprograms the timer */
59 int (*handler)(int, void *, struct pt_regs *);
42}; 60};
43 61
62void timer_dyn_reprogram(void);
63#endif
64
44extern struct sys_timer *system_timer; 65extern struct sys_timer *system_timer;
45extern void timer_tick(struct pt_regs *); 66extern void timer_tick(struct pt_regs *);
46 67
diff --git a/include/asm-arm/signal.h b/include/asm-arm/signal.h
index 46e69ae395..760f6e65af 100644
--- a/include/asm-arm/signal.h
+++ b/include/asm-arm/signal.h
@@ -114,6 +114,7 @@ typedef unsigned long sigset_t;
114#define SIGSTKSZ 8192 114#define SIGSTKSZ 8192
115 115
116#ifdef __KERNEL__ 116#ifdef __KERNEL__
117#define SA_TIMER 0x40000000
117#define SA_IRQNOMASK 0x08000000 118#define SA_IRQNOMASK 0x08000000
118#endif 119#endif
119 120
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 39dd700801..3d0d2860b6 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -145,34 +145,12 @@ extern unsigned int user_debug;
145#define set_wmb(var, value) do { var = value; wmb(); } while (0) 145#define set_wmb(var, value) do { var = value; wmb(); } while (0)
146#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); 146#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
147 147
148#ifdef CONFIG_SMP
149/* 148/*
150 * Define our own context switch locking. This allows us to enable 149 * switch_mm() may do a full cache flush over the context switch,
151 * interrupts over the context switch, otherwise we end up with high 150 * so enable interrupts over the context switch to avoid high
152 * interrupt latency. The real problem area is switch_mm() which may 151 * latency.
153 * do a full cache flush.
154 */ 152 */
155#define prepare_arch_switch(rq,next) \ 153#define __ARCH_WANT_INTERRUPTS_ON_CTXSW
156do { \
157 spin_lock(&(next)->switch_lock); \
158 spin_unlock_irq(&(rq)->lock); \
159} while (0)
160
161#define finish_arch_switch(rq,prev) \
162 spin_unlock(&(prev)->switch_lock)
163
164#define task_running(rq,p) \
165 ((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock))
166#else
167/*
168 * Our UP-case is more simple, but we assume knowledge of how
169 * spin_unlock_irq() and friends are implemented. This avoids
170 * us needlessly decrementing and incrementing the preempt count.
171 */
172#define prepare_arch_switch(rq,next) local_irq_enable()
173#define finish_arch_switch(rq,prev) spin_unlock(&(rq)->lock)
174#define task_running(rq,p) ((rq)->curr == (p))
175#endif
176 154
177/* 155/*
178 * switch_to(prev, next) should switch from task `prev' to `next' 156 * switch_to(prev, next) should switch from task `prev' to `next'
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 99cef06a36..b3bb326ae5 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -73,7 +73,7 @@
73 } 73 }
74 74
75#define SECURITY_INIT \ 75#define SECURITY_INIT \
76 .security_initcall.init : { \ 76 .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
77 VMLINUX_SYMBOL(__security_initcall_start) = .; \ 77 VMLINUX_SYMBOL(__security_initcall_start) = .; \
78 *(.security_initcall.init) \ 78 *(.security_initcall.init) \
79 VMLINUX_SYMBOL(__security_initcall_end) = .; \ 79 VMLINUX_SYMBOL(__security_initcall_end) = .; \
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h
index a5810cf7b5..6a1b188228 100644
--- a/include/asm-i386/apic.h
+++ b/include/asm-i386/apic.h
@@ -5,6 +5,7 @@
5#include <linux/pm.h> 5#include <linux/pm.h>
6#include <asm/fixmap.h> 6#include <asm/fixmap.h>
7#include <asm/apicdef.h> 7#include <asm/apicdef.h>
8#include <asm/processor.h>
8#include <asm/system.h> 9#include <asm/system.h>
9 10
10#define Dprintk(x...) 11#define Dprintk(x...)
@@ -16,8 +17,20 @@
16#define APIC_VERBOSE 1 17#define APIC_VERBOSE 1
17#define APIC_DEBUG 2 18#define APIC_DEBUG 2
18 19
20extern int enable_local_apic;
19extern int apic_verbosity; 21extern int apic_verbosity;
20 22
23static inline void lapic_disable(void)
24{
25 enable_local_apic = -1;
26 clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
27}
28
29static inline void lapic_enable(void)
30{
31 enable_local_apic = 1;
32}
33
21/* 34/*
22 * Define the default level of output to be very little 35 * Define the default level of output to be very little
23 * This can be turned up by using apic=verbose for more 36 * This can be turned up by using apic=verbose for more
@@ -87,7 +100,7 @@ extern void (*wait_timer_tick)(void);
87extern int get_maxlvt(void); 100extern int get_maxlvt(void);
88extern void clear_local_APIC(void); 101extern void clear_local_APIC(void);
89extern void connect_bsp_APIC (void); 102extern void connect_bsp_APIC (void);
90extern void disconnect_bsp_APIC (void); 103extern void disconnect_bsp_APIC (int virt_wire_setup);
91extern void disable_local_APIC (void); 104extern void disable_local_APIC (void);
92extern void lapic_shutdown (void); 105extern void lapic_shutdown (void);
93extern int verify_local_APIC (void); 106extern int verify_local_APIC (void);
diff --git a/include/asm-i386/apicdef.h b/include/asm-i386/apicdef.h
index c689554ad5..0fed5e3c69 100644
--- a/include/asm-i386/apicdef.h
+++ b/include/asm-i386/apicdef.h
@@ -86,11 +86,12 @@
86#define APIC_LVT_REMOTE_IRR (1<<14) 86#define APIC_LVT_REMOTE_IRR (1<<14)
87#define APIC_INPUT_POLARITY (1<<13) 87#define APIC_INPUT_POLARITY (1<<13)
88#define APIC_SEND_PENDING (1<<12) 88#define APIC_SEND_PENDING (1<<12)
89#define APIC_MODE_MASK 0x700
89#define GET_APIC_DELIVERY_MODE(x) (((x)>>8)&0x7) 90#define GET_APIC_DELIVERY_MODE(x) (((x)>>8)&0x7)
90#define SET_APIC_DELIVERY_MODE(x,y) (((x)&~0x700)|((y)<<8)) 91#define SET_APIC_DELIVERY_MODE(x,y) (((x)&~0x700)|((y)<<8))
91#define APIC_MODE_FIXED 0x0 92#define APIC_MODE_FIXED 0x0
92#define APIC_MODE_NMI 0x4 93#define APIC_MODE_NMI 0x4
93#define APIC_MODE_EXINT 0x7 94#define APIC_MODE_EXTINT 0x7
94#define APIC_LVT1 0x360 95#define APIC_LVT1 0x360
95#define APIC_LVTERR 0x370 96#define APIC_LVTERR 0x370
96#define APIC_TMICT 0x380 97#define APIC_TMICT 0x380
diff --git a/include/asm-i386/cpu.h b/include/asm-i386/cpu.h
index 002740b219..e7252c216c 100644
--- a/include/asm-i386/cpu.h
+++ b/include/asm-i386/cpu.h
@@ -5,6 +5,7 @@
5#include <linux/cpu.h> 5#include <linux/cpu.h>
6#include <linux/topology.h> 6#include <linux/topology.h>
7#include <linux/nodemask.h> 7#include <linux/nodemask.h>
8#include <linux/percpu.h>
8 9
9#include <asm/node.h> 10#include <asm/node.h>
10 11
@@ -16,4 +17,5 @@ extern int arch_register_cpu(int num);
16extern void arch_unregister_cpu(int); 17extern void arch_unregister_cpu(int);
17#endif 18#endif
18 19
20DECLARE_PER_CPU(int, cpu_state);
19#endif /* _ASM_I386_CPU_H_ */ 21#endif /* _ASM_I386_CPU_H_ */
diff --git a/include/asm-i386/highmem.h b/include/asm-i386/highmem.h
index 1df42bf347..0fd331306b 100644
--- a/include/asm-i386/highmem.h
+++ b/include/asm-i386/highmem.h
@@ -70,6 +70,7 @@ void *kmap(struct page *page);
70void kunmap(struct page *page); 70void kunmap(struct page *page);
71void *kmap_atomic(struct page *page, enum km_type type); 71void *kmap_atomic(struct page *page, enum km_type type);
72void kunmap_atomic(void *kvaddr, enum km_type type); 72void kunmap_atomic(void *kvaddr, enum km_type type);
73void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
73struct page *kmap_atomic_to_page(void *ptr); 74struct page *kmap_atomic_to_page(void *ptr);
74 75
75#define flush_cache_kmaps() do { } while (0) 76#define flush_cache_kmaps() do { } while (0)
diff --git a/include/asm-i386/irq.h b/include/asm-i386/irq.h
index 05b9e61b0a..270f1986b1 100644
--- a/include/asm-i386/irq.h
+++ b/include/asm-i386/irq.h
@@ -29,13 +29,19 @@ extern void release_vm86_irqs(struct task_struct *);
29 29
30#ifdef CONFIG_4KSTACKS 30#ifdef CONFIG_4KSTACKS
31 extern void irq_ctx_init(int cpu); 31 extern void irq_ctx_init(int cpu);
32 extern void irq_ctx_exit(int cpu);
32# define __ARCH_HAS_DO_SOFTIRQ 33# define __ARCH_HAS_DO_SOFTIRQ
33#else 34#else
34# define irq_ctx_init(cpu) do { } while (0) 35# define irq_ctx_init(cpu) do { } while (0)
36# define irq_ctx_exit(cpu) do { } while (0)
35#endif 37#endif
36 38
37#ifdef CONFIG_IRQBALANCE 39#ifdef CONFIG_IRQBALANCE
38extern int irqbalance_disable(char *str); 40extern int irqbalance_disable(char *str);
39#endif 41#endif
40 42
43#ifdef CONFIG_HOTPLUG_CPU
44extern void fixup_irqs(cpumask_t map);
45#endif
46
41#endif /* _ASM_IRQ_H */ 47#endif /* _ASM_IRQ_H */
diff --git a/include/asm-i386/kdebug.h b/include/asm-i386/kdebug.h
index de6498b0d4..b3f8d5f59d 100644
--- a/include/asm-i386/kdebug.h
+++ b/include/asm-i386/kdebug.h
@@ -18,7 +18,7 @@ struct die_args {
18}; 18};
19 19
20/* Note - you should never unregister because that can race with NMIs. 20/* Note - you should never unregister because that can race with NMIs.
21 If you really want to do it first unregister - then synchronize_kernel - then free. 21 If you really want to do it first unregister - then synchronize_sched - then free.
22 */ 22 */
23int register_die_notifier(struct notifier_block *nb); 23int register_die_notifier(struct notifier_block *nb);
24extern struct notifier_block *i386die_chain; 24extern struct notifier_block *i386die_chain;
diff --git a/include/asm-i386/kexec.h b/include/asm-i386/kexec.h
new file mode 100644
index 0000000000..6ed2a03e37
--- /dev/null
+++ b/include/asm-i386/kexec.h
@@ -0,0 +1,33 @@
1#ifndef _I386_KEXEC_H
2#define _I386_KEXEC_H
3
4#include <asm/fixmap.h>
5
6/*
7 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
8 * I.e. Maximum page that is mapped directly into kernel memory,
9 * and kmap is not required.
10 *
11 * Someone correct me if FIXADDR_START - PAGEOFFSET is not the correct
12 * calculation for the amount of memory directly mappable into the
13 * kernel memory space.
14 */
15
16/* Maximum physical address we can use pages from */
17#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
18/* Maximum address we can reach in physical address mode */
19#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
20/* Maximum address we can use for the control code buffer */
21#define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
22
23#define KEXEC_CONTROL_CODE_SIZE 4096
24
25/* The native architecture */
26#define KEXEC_ARCH KEXEC_ARCH_386
27
28#define MAX_NOTE_BYTES 1024
29typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
30
31extern note_buf_t crash_notes[];
32
33#endif /* _I386_KEXEC_H */
diff --git a/include/asm-i386/mach-default/mach_ipi.h b/include/asm-i386/mach-default/mach_ipi.h
index 6f2b17a200..cc756a67cd 100644
--- a/include/asm-i386/mach-default/mach_ipi.h
+++ b/include/asm-i386/mach-default/mach_ipi.h
@@ -4,11 +4,34 @@
4void send_IPI_mask_bitmask(cpumask_t mask, int vector); 4void send_IPI_mask_bitmask(cpumask_t mask, int vector);
5void __send_IPI_shortcut(unsigned int shortcut, int vector); 5void __send_IPI_shortcut(unsigned int shortcut, int vector);
6 6
7extern int no_broadcast;
8
7static inline void send_IPI_mask(cpumask_t mask, int vector) 9static inline void send_IPI_mask(cpumask_t mask, int vector)
8{ 10{
9 send_IPI_mask_bitmask(mask, vector); 11 send_IPI_mask_bitmask(mask, vector);
10} 12}
11 13
14static inline void __local_send_IPI_allbutself(int vector)
15{
16 if (no_broadcast) {
17 cpumask_t mask = cpu_online_map;
18 int this_cpu = get_cpu();
19
20 cpu_clear(this_cpu, mask);
21 send_IPI_mask(mask, vector);
22 put_cpu();
23 } else
24 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
25}
26
27static inline void __local_send_IPI_all(int vector)
28{
29 if (no_broadcast)
30 send_IPI_mask(cpu_online_map, vector);
31 else
32 __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
33}
34
12static inline void send_IPI_allbutself(int vector) 35static inline void send_IPI_allbutself(int vector)
13{ 36{
14 /* 37 /*
@@ -18,13 +41,13 @@ static inline void send_IPI_allbutself(int vector)
18 if (!(num_online_cpus() > 1)) 41 if (!(num_online_cpus() > 1))
19 return; 42 return;
20 43
21 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector); 44 __local_send_IPI_allbutself(vector);
22 return; 45 return;
23} 46}
24 47
25static inline void send_IPI_all(int vector) 48static inline void send_IPI_all(int vector)
26{ 49{
27 __send_IPI_shortcut(APIC_DEST_ALLINC, vector); 50 __local_send_IPI_all(vector);
28} 51}
29 52
30#endif /* __ASM_MACH_IPI_H */ 53#endif /* __ASM_MACH_IPI_H */
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index dea8f8e6d8..8d93f732d7 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -126,9 +126,12 @@ extern int page_is_ram(unsigned long pagenr);
126 126
127#ifdef __ASSEMBLY__ 127#ifdef __ASSEMBLY__
128#define __PAGE_OFFSET (0xC0000000) 128#define __PAGE_OFFSET (0xC0000000)
129#define __PHYSICAL_START CONFIG_PHYSICAL_START
129#else 130#else
130#define __PAGE_OFFSET (0xC0000000UL) 131#define __PAGE_OFFSET (0xC0000000UL)
132#define __PHYSICAL_START ((unsigned long)CONFIG_PHYSICAL_START)
131#endif 133#endif
134#define __KERNEL_START (__PAGE_OFFSET + __PHYSICAL_START)
132 135
133 136
134#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) 137#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index c76c50e962..6f0f93d0d4 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -691,5 +691,7 @@ extern void select_idle_routine(const struct cpuinfo_x86 *c);
691#define cache_line_size() (boot_cpu_data.x86_cache_alignment) 691#define cache_line_size() (boot_cpu_data.x86_cache_alignment)
692 692
693extern unsigned long boot_option_idle_override; 693extern unsigned long boot_option_idle_override;
694extern void enable_sep_cpu(void);
695extern int sysenter_setup(void);
694 696
695#endif /* __ASM_I386_PROCESSOR_H */ 697#endif /* __ASM_I386_PROCESSOR_H */
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index 55ef31f66b..edad9b4712 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -42,10 +42,17 @@ extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs);
42extern void smp_invalidate_rcv(void); /* Process an NMI */ 42extern void smp_invalidate_rcv(void); /* Process an NMI */
43extern void (*mtrr_hook) (void); 43extern void (*mtrr_hook) (void);
44extern void zap_low_mappings (void); 44extern void zap_low_mappings (void);
45extern void lock_ipi_call_lock(void);
46extern void unlock_ipi_call_lock(void);
45 47
46#define MAX_APICID 256 48#define MAX_APICID 256
47extern u8 x86_cpu_to_apicid[]; 49extern u8 x86_cpu_to_apicid[];
48 50
51#ifdef CONFIG_HOTPLUG_CPU
52extern void cpu_exit_clear(void);
53extern void cpu_uninit(void);
54#endif
55
49/* 56/*
50 * This function is needed by all SMP systems. It must _always_ be valid 57 * This function is needed by all SMP systems. It must _always_ be valid
51 * from the initial startup. We map APIC_BASE very early in page_setup(), 58 * from the initial startup. We map APIC_BASE very early in page_setup(),
@@ -83,6 +90,9 @@ static __inline int logical_smp_processor_id(void)
83} 90}
84 91
85#endif 92#endif
93
94extern int __cpu_disable(void);
95extern void __cpu_die(unsigned int cpu);
86#endif /* !__ASSEMBLY__ */ 96#endif /* !__ASSEMBLY__ */
87 97
88#define NO_PROC_ID 0xFF /* No processor magic marker */ 98#define NO_PROC_ID 0xFF /* No processor magic marker */
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h
index 6d0f67507b..2461b73178 100644
--- a/include/asm-i386/topology.h
+++ b/include/asm-i386/topology.h
@@ -74,11 +74,14 @@ static inline int node_to_first_cpu(int node)
74 .imbalance_pct = 125, \ 74 .imbalance_pct = 125, \
75 .cache_hot_time = (10*1000000), \ 75 .cache_hot_time = (10*1000000), \
76 .cache_nice_tries = 1, \ 76 .cache_nice_tries = 1, \
77 .busy_idx = 3, \
78 .idle_idx = 1, \
79 .newidle_idx = 2, \
80 .wake_idx = 1, \
77 .per_cpu_gain = 100, \ 81 .per_cpu_gain = 100, \
78 .flags = SD_LOAD_BALANCE \ 82 .flags = SD_LOAD_BALANCE \
79 | SD_BALANCE_EXEC \ 83 | SD_BALANCE_EXEC \
80 | SD_BALANCE_NEWIDLE \ 84 | SD_BALANCE_FORK \
81 | SD_WAKE_IDLE \
82 | SD_WAKE_BALANCE, \ 85 | SD_WAKE_BALANCE, \
83 .last_balance = jiffies, \ 86 .last_balance = jiffies, \
84 .balance_interval = 1, \ 87 .balance_interval = 1, \
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
index 6f516e76d1..cd2cf76b2d 100644
--- a/include/asm-ia64/system.h
+++ b/include/asm-ia64/system.h
@@ -183,8 +183,6 @@ do { \
183 183
184#ifdef __KERNEL__ 184#ifdef __KERNEL__
185 185
186#define prepare_to_switch() do { } while(0)
187
188#ifdef CONFIG_IA32_SUPPORT 186#ifdef CONFIG_IA32_SUPPORT
189# define IS_IA32_PROCESS(regs) (ia64_psr(regs)->is != 0) 187# define IS_IA32_PROCESS(regs) (ia64_psr(regs)->is != 0)
190#else 188#else
@@ -274,13 +272,7 @@ extern void ia64_load_extra (struct task_struct *task);
274 * of that CPU which will not be released, because there we wait for the 272 * of that CPU which will not be released, because there we wait for the
275 * tasklist_lock to become available. 273 * tasklist_lock to become available.
276 */ 274 */
277#define prepare_arch_switch(rq, next) \ 275#define __ARCH_WANT_UNLOCKED_CTXSW
278do { \
279 spin_lock(&(next)->switch_lock); \
280 spin_unlock(&(rq)->lock); \
281} while (0)
282#define finish_arch_switch(rq, prev) spin_unlock_irq(&(prev)->switch_lock)
283#define task_running(rq, p) ((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock))
284 276
285#define ia64_platform_is(x) (strcmp(x, platform_name) == 0) 277#define ia64_platform_is(x) (strcmp(x, platform_name) == 0)
286 278
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h
index 21cf351fd0..4e64c2a6b3 100644
--- a/include/asm-ia64/topology.h
+++ b/include/asm-ia64/topology.h
@@ -42,25 +42,54 @@
42 42
43void build_cpu_to_node_map(void); 43void build_cpu_to_node_map(void);
44 44
45#define SD_CPU_INIT (struct sched_domain) { \
46 .span = CPU_MASK_NONE, \
47 .parent = NULL, \
48 .groups = NULL, \
49 .min_interval = 1, \
50 .max_interval = 4, \
51 .busy_factor = 64, \
52 .imbalance_pct = 125, \
53 .cache_hot_time = (10*1000000), \
54 .per_cpu_gain = 100, \
55 .cache_nice_tries = 2, \
56 .busy_idx = 2, \
57 .idle_idx = 1, \
58 .newidle_idx = 2, \
59 .wake_idx = 1, \
60 .forkexec_idx = 1, \
61 .flags = SD_LOAD_BALANCE \
62 | SD_BALANCE_NEWIDLE \
63 | SD_BALANCE_EXEC \
64 | SD_WAKE_AFFINE, \
65 .last_balance = jiffies, \
66 .balance_interval = 1, \
67 .nr_balance_failed = 0, \
68}
69
45/* sched_domains SD_NODE_INIT for IA64 NUMA machines */ 70/* sched_domains SD_NODE_INIT for IA64 NUMA machines */
46#define SD_NODE_INIT (struct sched_domain) { \ 71#define SD_NODE_INIT (struct sched_domain) { \
47 .span = CPU_MASK_NONE, \ 72 .span = CPU_MASK_NONE, \
48 .parent = NULL, \ 73 .parent = NULL, \
49 .groups = NULL, \ 74 .groups = NULL, \
50 .min_interval = 80, \ 75 .min_interval = 8, \
51 .max_interval = 320, \ 76 .max_interval = 8*(min(num_online_cpus(), 32)), \
52 .busy_factor = 320, \ 77 .busy_factor = 64, \
53 .imbalance_pct = 125, \ 78 .imbalance_pct = 125, \
54 .cache_hot_time = (10*1000000), \ 79 .cache_hot_time = (10*1000000), \
55 .cache_nice_tries = 1, \ 80 .cache_nice_tries = 2, \
81 .busy_idx = 3, \
82 .idle_idx = 2, \
83 .newidle_idx = 0, /* unused */ \
84 .wake_idx = 1, \
85 .forkexec_idx = 1, \
56 .per_cpu_gain = 100, \ 86 .per_cpu_gain = 100, \
57 .flags = SD_LOAD_BALANCE \ 87 .flags = SD_LOAD_BALANCE \
58 | SD_BALANCE_EXEC \ 88 | SD_BALANCE_EXEC \
59 | SD_BALANCE_NEWIDLE \ 89 | SD_BALANCE_FORK \
60 | SD_WAKE_IDLE \
61 | SD_WAKE_BALANCE, \ 90 | SD_WAKE_BALANCE, \
62 .last_balance = jiffies, \ 91 .last_balance = jiffies, \
63 .balance_interval = 1, \ 92 .balance_interval = 64, \
64 .nr_balance_failed = 0, \ 93 .nr_balance_failed = 0, \
65} 94}
66 95
@@ -69,17 +98,21 @@ void build_cpu_to_node_map(void);
69 .span = CPU_MASK_NONE, \ 98 .span = CPU_MASK_NONE, \
70 .parent = NULL, \ 99 .parent = NULL, \
71 .groups = NULL, \ 100 .groups = NULL, \
72 .min_interval = 80, \ 101 .min_interval = 64, \
73 .max_interval = 320, \ 102 .max_interval = 64*num_online_cpus(), \
74 .busy_factor = 320, \ 103 .busy_factor = 128, \
75 .imbalance_pct = 125, \ 104 .imbalance_pct = 133, \
76 .cache_hot_time = (10*1000000), \ 105 .cache_hot_time = (10*1000000), \
77 .cache_nice_tries = 1, \ 106 .cache_nice_tries = 1, \
107 .busy_idx = 3, \
108 .idle_idx = 3, \
109 .newidle_idx = 0, /* unused */ \
110 .wake_idx = 0, /* unused */ \
111 .forkexec_idx = 0, /* unused */ \
78 .per_cpu_gain = 100, \ 112 .per_cpu_gain = 100, \
79 .flags = SD_LOAD_BALANCE \ 113 .flags = SD_LOAD_BALANCE, \
80 | SD_BALANCE_EXEC, \
81 .last_balance = jiffies, \ 114 .last_balance = jiffies, \
82 .balance_interval = 100*(63+num_online_cpus())/64, \ 115 .balance_interval = 64, \
83 .nr_balance_failed = 0, \ 116 .nr_balance_failed = 0, \
84} 117}
85 118
diff --git a/include/asm-mips/mmzone.h b/include/asm-mips/mmzone.h
index 29ee13be0b..d721143dbd 100644
--- a/include/asm-mips/mmzone.h
+++ b/include/asm-mips/mmzone.h
@@ -8,6 +8,8 @@
8#include <asm/page.h> 8#include <asm/page.h>
9#include <mmzone.h> 9#include <mmzone.h>
10 10
11#ifdef CONFIG_DISCONTIGMEM
12
11#define kvaddr_to_nid(kvaddr) pa_to_nid(__pa(kvaddr)) 13#define kvaddr_to_nid(kvaddr) pa_to_nid(__pa(kvaddr))
12#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT) 14#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT)
13 15
@@ -36,4 +38,6 @@
36/* XXX: FIXME -- wli */ 38/* XXX: FIXME -- wli */
37#define kern_addr_valid(addr) (0) 39#define kern_addr_valid(addr) (0)
38 40
41#endif /* CONFIG_DISCONTIGMEM */
42
39#endif /* _ASM_MMZONE_H_ */ 43#endif /* _ASM_MMZONE_H_ */
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index d1bf8240e7..5cae35cd9b 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -127,7 +127,7 @@ static __inline__ int get_order(unsigned long size)
127 127
128#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 128#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
129 129
130#ifndef CONFIG_DISCONTIGMEM 130#ifndef CONFIG_NEED_MULTIPLE_NODES
131#define pfn_to_page(pfn) (mem_map + (pfn)) 131#define pfn_to_page(pfn) (mem_map + (pfn))
132#define page_to_pfn(page) ((unsigned long)((page) - mem_map)) 132#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
133#define pfn_valid(pfn) ((pfn) < max_mapnr) 133#define pfn_valid(pfn) ((pfn) < max_mapnr)
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index 878843203d..e76ccd6e3a 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -350,7 +350,7 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
350 __update_cache(vma, address, pte); 350 __update_cache(vma, address, pte);
351} 351}
352 352
353#ifndef CONFIG_DISCONTIGMEM 353#ifndef CONFIG_NEED_MULTIPLE_NODES
354#define kern_addr_valid(addr) (1) 354#define kern_addr_valid(addr) (1)
355#endif 355#endif
356 356
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 888fd89084..169f3d4265 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -422,16 +422,10 @@ extern void __die_if_kernel(const char *, struct pt_regs *, const char *file,
422extern int stop_a_enabled; 422extern int stop_a_enabled;
423 423
424/* 424/*
425 * Taken from include/asm-ia64/system.h; prevents deadlock on SMP 425 * See include/asm-ia64/system.h; prevents deadlock on SMP
426 * systems. 426 * systems.
427 */ 427 */
428#define prepare_arch_switch(rq, next) \ 428#define __ARCH_WANT_UNLOCKED_CTXSW
429do { \
430 spin_lock(&(next)->switch_lock); \
431 spin_unlock(&(rq)->lock); \
432} while (0)
433#define finish_arch_switch(rq, prev) spin_unlock_irq(&(prev)->switch_lock)
434#define task_running(rq, p) ((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock))
435 429
436#define arch_align_stack(x) (x) 430#define arch_align_stack(x) (x)
437 431
diff --git a/include/asm-ppc/fsl_ocp.h b/include/asm-ppc/fsl_ocp.h
deleted file mode 100644
index 050fbba8d0..0000000000
--- a/include/asm-ppc/fsl_ocp.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * include/asm-ppc/fsl_ocp.h
3 *
4 * Definitions for the on-chip peripherals on Freescale PPC processors
5 *
6 * Maintainer: Kumar Gala (kumar.gala@freescale.com)
7 *
8 * Copyright 2004 Freescale Semiconductor, Inc
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#ifdef __KERNEL__
17#ifndef __ASM_FS_OCP_H__
18#define __ASM_FS_OCP_H__
19
20/* A table of information for supporting the Gianfar Ethernet Controller
21 * This helps identify which enet controller we are dealing with,
22 * and what type of enet controller it is
23 */
24struct ocp_gfar_data {
25 uint interruptTransmit;
26 uint interruptError;
27 uint interruptReceive;
28 uint interruptPHY;
29 uint flags;
30 uint phyid;
31 uint phyregidx;
32 unsigned char mac_addr[6];
33};
34
35/* Flags in the flags field */
36#define GFAR_HAS_COALESCE 0x20
37#define GFAR_HAS_RMON 0x10
38#define GFAR_HAS_MULTI_INTR 0x08
39#define GFAR_FIRM_SET_MACADDR 0x04
40#define GFAR_HAS_PHY_INTR 0x02 /* if not set use a timer */
41#define GFAR_HAS_GIGABIT 0x01
42
43/* Data structure for I2C support. Just contains a couple flags
44 * to distinguish various I2C implementations*/
45struct ocp_fs_i2c_data {
46 uint flags;
47};
48
49/* Flags for I2C */
50#define FS_I2C_SEPARATE_DFSRR 0x02
51#define FS_I2C_CLOCK_5200 0x01
52
53#endif /* __ASM_FS_OCP_H__ */
54#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/kexec.h b/include/asm-ppc/kexec.h
new file mode 100644
index 0000000000..73191310d8
--- /dev/null
+++ b/include/asm-ppc/kexec.h
@@ -0,0 +1,38 @@
1#ifndef _PPC_KEXEC_H
2#define _PPC_KEXEC_H
3
4#ifdef CONFIG_KEXEC
5
6/*
7 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
8 * I.e. Maximum page that is mapped directly into kernel memory,
9 * and kmap is not required.
10 *
11 * Someone correct me if FIXADDR_START - PAGEOFFSET is not the correct
12 * calculation for the amount of memory directly mappable into the
13 * kernel memory space.
14 */
15
16/* Maximum physical address we can use pages from */
17#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
18/* Maximum address we can reach in physical address mode */
19#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
20/* Maximum address we can use for the control code buffer */
21#define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
22
23#define KEXEC_CONTROL_CODE_SIZE 4096
24
25/* The native architecture */
26#define KEXEC_ARCH KEXEC_ARCH_PPC
27
28#ifndef __ASSEMBLY__
29
30struct kimage;
31
32extern void machine_kexec_simple(struct kimage *image);
33
34#endif /* __ASSEMBLY__ */
35
36#endif /* CONFIG_KEXEC */
37
38#endif /* _PPC_KEXEC_H */
diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h
index b78d40870c..1d4ab70a56 100644
--- a/include/asm-ppc/machdep.h
+++ b/include/asm-ppc/machdep.h
@@ -4,6 +4,7 @@
4 4
5#include <linux/config.h> 5#include <linux/config.h>
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/kexec.h>
7 8
8#include <asm/setup.h> 9#include <asm/setup.h>
9#include <asm/page.h> 10#include <asm/page.h>
@@ -114,6 +115,36 @@ struct machdep_calls {
114 /* functions for dealing with other cpus */ 115 /* functions for dealing with other cpus */
115 struct smp_ops_t *smp_ops; 116 struct smp_ops_t *smp_ops;
116#endif /* CONFIG_SMP */ 117#endif /* CONFIG_SMP */
118
119#ifdef CONFIG_KEXEC
120 /* Called to shutdown machine specific hardware not already controlled
121 * by other drivers.
122 * XXX Should we move this one out of kexec scope?
123 */
124 void (*machine_shutdown)(void);
125
126 /* Called to do the minimal shutdown needed to run a kexec'd kernel
127 * to run successfully.
128 * XXX Should we move this one out of kexec scope?
129 */
130 void (*machine_crash_shutdown)(void);
131
132 /* Called to do what every setup is needed on image and the
133 * reboot code buffer. Returns 0 on success.
134 * Provide your own (maybe dummy) implementation if your platform
135 * claims to support kexec.
136 */
137 int (*machine_kexec_prepare)(struct kimage *image);
138
139 /* Called to handle any machine specific cleanup on image */
140 void (*machine_kexec_cleanup)(struct kimage *image);
141
142 /* Called to perform the _real_ kexec.
143 * Do NOT allocate memory or fail here. We are past the point of
144 * no return.
145 */
146 void (*machine_kexec)(struct kimage *image);
147#endif /* CONFIG_KEXEC */
117}; 148};
118 149
119extern struct machdep_calls ppc_md; 150extern struct machdep_calls ppc_md;
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index d465aee1c8..9205db404c 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -405,7 +405,7 @@ typedef struct _P601_BAT {
405 405
406#define MAS0_TLBSEL(x) ((x << 28) & 0x30000000) 406#define MAS0_TLBSEL(x) ((x << 28) & 0x30000000)
407#define MAS0_ESEL(x) ((x << 16) & 0x0FFF0000) 407#define MAS0_ESEL(x) ((x << 16) & 0x0FFF0000)
408#define MAS0_NV 0x00000FFF 408#define MAS0_NV(x) ((x) & 0x00000FFF)
409 409
410#define MAS1_VALID 0x80000000 410#define MAS1_VALID 0x80000000
411#define MAS1_IPROT 0x40000000 411#define MAS1_IPROT 0x40000000
diff --git a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
index 9222fa6ca1..ccabbce39d 100644
--- a/include/asm-ppc/mmu_context.h
+++ b/include/asm-ppc/mmu_context.h
@@ -63,7 +63,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
63#define LAST_CONTEXT 255 63#define LAST_CONTEXT 255
64#define FIRST_CONTEXT 1 64#define FIRST_CONTEXT 1
65 65
66#elif defined(CONFIG_E500) 66#elif defined(CONFIG_E200) || defined(CONFIG_E500)
67#define NO_CONTEXT 256 67#define NO_CONTEXT 256
68#define LAST_CONTEXT 255 68#define LAST_CONTEXT 255
69#define FIRST_CONTEXT 1 69#define FIRST_CONTEXT 1
diff --git a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h
index c726f18451..983116f59d 100644
--- a/include/asm-ppc/ocp.h
+++ b/include/asm-ppc/ocp.h
@@ -202,10 +202,6 @@ static DEVICE_ATTR(name##_##field, S_IRUGO, show_##name##_##field, NULL);
202#include <asm/ibm_ocp.h> 202#include <asm/ibm_ocp.h>
203#endif 203#endif
204 204
205#ifdef CONFIG_FSL_OCP
206#include <asm/fsl_ocp.h>
207#endif
208
209#endif /* CONFIG_PPC_OCP */ 205#endif /* CONFIG_PPC_OCP */
210#endif /* __OCP_H__ */ 206#endif /* __OCP_H__ */
211#endif /* __KERNEL__ */ 207#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/ppc_asm.h b/include/asm-ppc/ppc_asm.h
index 13fa8e7483..f76221def4 100644
--- a/include/asm-ppc/ppc_asm.h
+++ b/include/asm-ppc/ppc_asm.h
@@ -174,6 +174,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
174#define CLR_TOP32(r) 174#define CLR_TOP32(r)
175#endif /* CONFIG_PPC64BRIDGE */ 175#endif /* CONFIG_PPC64BRIDGE */
176 176
177#define RFCI .long 0x4c000066 /* rfci instruction */
178#define RFDI .long 0x4c00004e /* rfdi instruction */
177#define RFMCI .long 0x4c00004c /* rfmci instruction */ 179#define RFMCI .long 0x4c00004c /* rfmci instruction */
178 180
179#ifdef CONFIG_IBM405_ERR77 181#ifdef CONFIG_IBM405_ERR77
diff --git a/include/asm-ppc/reg.h b/include/asm-ppc/reg.h
index c418aab7cd..88b4222154 100644
--- a/include/asm-ppc/reg.h
+++ b/include/asm-ppc/reg.h
@@ -160,6 +160,7 @@
160#define HID0_ICFI (1<<11) /* Instr. Cache Flash Invalidate */ 160#define HID0_ICFI (1<<11) /* Instr. Cache Flash Invalidate */
161#define HID0_DCI (1<<10) /* Data Cache Invalidate */ 161#define HID0_DCI (1<<10) /* Data Cache Invalidate */
162#define HID0_SPD (1<<9) /* Speculative disable */ 162#define HID0_SPD (1<<9) /* Speculative disable */
163#define HID0_DAPUEN (1<<8) /* Debug APU enable */
163#define HID0_SGE (1<<7) /* Store Gathering Enable */ 164#define HID0_SGE (1<<7) /* Store Gathering Enable */
164#define HID0_SIED (1<<7) /* Serial Instr. Execution [Disable] */ 165#define HID0_SIED (1<<7) /* Serial Instr. Execution [Disable] */
165#define HID0_DFCA (1<<6) /* Data Cache Flush Assist */ 166#define HID0_DFCA (1<<6) /* Data Cache Flush Assist */
diff --git a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h
index 45c5e6f2b7..00ad9c754c 100644
--- a/include/asm-ppc/reg_booke.h
+++ b/include/asm-ppc/reg_booke.h
@@ -165,6 +165,8 @@ do { \
165#define SPRN_MCSRR1 0x23B /* Machine Check Save and Restore Register 1 */ 165#define SPRN_MCSRR1 0x23B /* Machine Check Save and Restore Register 1 */
166#define SPRN_MCSR 0x23C /* Machine Check Status Register */ 166#define SPRN_MCSR 0x23C /* Machine Check Status Register */
167#define SPRN_MCAR 0x23D /* Machine Check Address Register */ 167#define SPRN_MCAR 0x23D /* Machine Check Address Register */
168#define SPRN_DSRR0 0x23E /* Debug Save and Restore Register 0 */
169#define SPRN_DSRR1 0x23F /* Debug Save and Restore Register 1 */
168#define SPRN_MAS0 0x270 /* MMU Assist Register 0 */ 170#define SPRN_MAS0 0x270 /* MMU Assist Register 0 */
169#define SPRN_MAS1 0x271 /* MMU Assist Register 1 */ 171#define SPRN_MAS1 0x271 /* MMU Assist Register 1 */
170#define SPRN_MAS2 0x272 /* MMU Assist Register 2 */ 172#define SPRN_MAS2 0x272 /* MMU Assist Register 2 */
@@ -264,6 +266,17 @@ do { \
264#define MCSR_BUS_IPERR 0x00000002UL /* Instruction parity Error */ 266#define MCSR_BUS_IPERR 0x00000002UL /* Instruction parity Error */
265#define MCSR_BUS_RPERR 0x00000001UL /* Read parity Error */ 267#define MCSR_BUS_RPERR 0x00000001UL /* Read parity Error */
266#endif 268#endif
269#ifdef CONFIG_E200
270#define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */
271#define MCSR_CP_PERR 0x20000000UL /* Cache Push Parity Error */
272#define MCSR_CPERR 0x10000000UL /* Cache Parity Error */
273#define MCSR_EXCP_ERR 0x08000000UL /* ISI, ITLB, or Bus Error on 1st insn
274 fetch for an exception handler */
275#define MCSR_BUS_IRERR 0x00000010UL /* Read Bus Error on instruction fetch*/
276#define MCSR_BUS_DRERR 0x00000008UL /* Read Bus Error on data load */
277#define MCSR_BUS_WRERR 0x00000004UL /* Write Bus Error on buffered
278 store or cache line push */
279#endif
267 280
268/* Bit definitions for the DBSR. */ 281/* Bit definitions for the DBSR. */
269/* 282/*
@@ -311,6 +324,7 @@ do { \
311#define ESR_ST 0x00800000 /* Store Operation */ 324#define ESR_ST 0x00800000 /* Store Operation */
312#define ESR_DLK 0x00200000 /* Data Cache Locking */ 325#define ESR_DLK 0x00200000 /* Data Cache Locking */
313#define ESR_ILK 0x00100000 /* Instr. Cache Locking */ 326#define ESR_ILK 0x00100000 /* Instr. Cache Locking */
327#define ESR_PUO 0x00040000 /* Unimplemented Operation exception */
314#define ESR_BO 0x00020000 /* Byte Ordering */ 328#define ESR_BO 0x00020000 /* Byte Ordering */
315 329
316/* Bit definitions related to the DBCR0. */ 330/* Bit definitions related to the DBCR0. */
@@ -387,10 +401,12 @@ do { \
387#define ICCR_CACHE 1 /* Cacheable */ 401#define ICCR_CACHE 1 /* Cacheable */
388 402
389/* Bit definitions for L1CSR0. */ 403/* Bit definitions for L1CSR0. */
404#define L1CSR0_CLFC 0x00000100 /* Cache Lock Bits Flash Clear */
390#define L1CSR0_DCFI 0x00000002 /* Data Cache Flash Invalidate */ 405#define L1CSR0_DCFI 0x00000002 /* Data Cache Flash Invalidate */
406#define L1CSR0_CFI 0x00000002 /* Cache Flash Invalidate */
391#define L1CSR0_DCE 0x00000001 /* Data Cache Enable */ 407#define L1CSR0_DCE 0x00000001 /* Data Cache Enable */
392 408
393/* Bit definitions for L1CSR0. */ 409/* Bit definitions for L1CSR1. */
394#define L1CSR1_ICLFR 0x00000100 /* Instr Cache Lock Bits Flash Reset */ 410#define L1CSR1_ICLFR 0x00000100 /* Instr Cache Lock Bits Flash Reset */
395#define L1CSR1_ICFI 0x00000002 /* Instr Cache Flash Invalidate */ 411#define L1CSR1_ICFI 0x00000002 /* Instr Cache Flash Invalidate */
396#define L1CSR1_ICE 0x00000001 /* Instr Cache Enable */ 412#define L1CSR1_ICE 0x00000001 /* Instr Cache Enable */
diff --git a/include/asm-ppc64/kdebug.h b/include/asm-ppc64/kdebug.h
index 488634258a..d383d161cf 100644
--- a/include/asm-ppc64/kdebug.h
+++ b/include/asm-ppc64/kdebug.h
@@ -17,7 +17,7 @@ struct die_args {
17 17
18/* 18/*
19 Note - you should never unregister because that can race with NMIs. 19 Note - you should never unregister because that can race with NMIs.
20 If you really want to do it first unregister - then synchronize_kernel - 20 If you really want to do it first unregister - then synchronize_sched -
21 then free. 21 then free.
22 */ 22 */
23int register_die_notifier(struct notifier_block *nb); 23int register_die_notifier(struct notifier_block *nb);
diff --git a/include/asm-ppc64/kexec.h b/include/asm-ppc64/kexec.h
new file mode 100644
index 0000000000..511908afae
--- /dev/null
+++ b/include/asm-ppc64/kexec.h
@@ -0,0 +1,41 @@
1#ifndef _PPC64_KEXEC_H
2#define _PPC64_KEXEC_H
3
4/*
5 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
6 * I.e. Maximum page that is mapped directly into kernel memory,
7 * and kmap is not required.
8 */
9
10/* Maximum physical address we can use pages from */
11/* XXX: since we copy virt we can use any page we allocate */
12#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
13
14/* Maximum address we can reach in physical address mode */
15/* XXX: I want to allow initrd in highmem. otherwise set to rmo on lpar */
16#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
17
18/* Maximum address we can use for the control code buffer */
19/* XXX: unused today, ppc32 uses TASK_SIZE, probably left over from use_mm */
20#define KEXEC_CONTROL_MEMORY_LIMIT (-1UL)
21
22/* XXX: today we don't use this at all, althogh we have a static stack */
23#define KEXEC_CONTROL_CODE_SIZE 4096
24
25/* The native architecture */
26#define KEXEC_ARCH KEXEC_ARCH_PPC64
27
28#define MAX_NOTE_BYTES 1024
29
30#ifndef __ASSEMBLY__
31
32typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
33
34extern note_buf_t crash_notes[];
35
36extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
37 master to copy new code to 0 */
38
39#endif /* __ASSEMBLY__ */
40#endif /* _PPC_KEXEC_H */
41
diff --git a/include/asm-ppc64/machdep.h b/include/asm-ppc64/machdep.h
index 553b2ea23b..9cdad3ed15 100644
--- a/include/asm-ppc64/machdep.h
+++ b/include/asm-ppc64/machdep.h
@@ -86,6 +86,7 @@ struct machdep_calls {
86 86
87 void (*init_IRQ)(void); 87 void (*init_IRQ)(void);
88 int (*get_irq)(struct pt_regs *); 88 int (*get_irq)(struct pt_regs *);
89 void (*cpu_irq_down)(void);
89 90
90 /* PCI stuff */ 91 /* PCI stuff */
91 void (*pcibios_fixup)(void); 92 void (*pcibios_fixup)(void);
diff --git a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h
index 9d03a98a4f..f373de5e3d 100644
--- a/include/asm-ppc64/mmu.h
+++ b/include/asm-ppc64/mmu.h
@@ -181,6 +181,28 @@ static inline void tlbiel(unsigned long va)
181 asm volatile("ptesync": : :"memory"); 181 asm volatile("ptesync": : :"memory");
182} 182}
183 183
184static inline unsigned long slot2va(unsigned long avpn, unsigned long large,
185 unsigned long secondary, unsigned long slot)
186{
187 unsigned long va;
188
189 va = avpn << 23;
190
191 if (!large) {
192 unsigned long vpi, pteg;
193
194 pteg = slot / HPTES_PER_GROUP;
195 if (secondary)
196 pteg = ~pteg;
197
198 vpi = ((va >> 28) ^ pteg) & htab_hash_mask;
199
200 va |= vpi << PAGE_SHIFT;
201 }
202
203 return va;
204}
205
184/* 206/*
185 * Handle a fault by adding an HPTE. If the address can't be determined 207 * Handle a fault by adding an HPTE. If the address can't be determined
186 * to be valid via Linux page tables, return 1. If handled return 0 208 * to be valid via Linux page tables, return 1. If handled return 0
diff --git a/include/asm-ppc64/xics.h b/include/asm-ppc64/xics.h
index fdec5e7a7a..0c45e14e26 100644
--- a/include/asm-ppc64/xics.h
+++ b/include/asm-ppc64/xics.h
@@ -17,6 +17,7 @@
17void xics_init_IRQ(void); 17void xics_init_IRQ(void);
18int xics_get_irq(struct pt_regs *); 18int xics_get_irq(struct pt_regs *);
19void xics_setup_cpu(void); 19void xics_setup_cpu(void);
20void xics_teardown_cpu(void);
20void xics_cause_IPI(int cpu); 21void xics_cause_IPI(int cpu);
21void xics_request_IPIs(void); 22void xics_request_IPIs(void);
22void xics_migrate_irqs_away(void); 23void xics_migrate_irqs_away(void);
diff --git a/include/asm-s390/cpcmd.h b/include/asm-s390/cpcmd.h
index 1d33c5da08..1fcf65be7a 100644
--- a/include/asm-s390/cpcmd.h
+++ b/include/asm-s390/cpcmd.h
@@ -11,14 +11,28 @@
11#define __CPCMD__ 11#define __CPCMD__
12 12
13/* 13/*
14 * the lowlevel function for cpcmd
14 * the caller of __cpcmd has to ensure that the response buffer is below 2 GB 15 * the caller of __cpcmd has to ensure that the response buffer is below 2 GB
15 */ 16 */
16extern void __cpcmd(char *cmd, char *response, int rlen); 17extern int __cpcmd(const char *cmd, char *response, int rlen, int *response_code);
17 18
18#ifndef __s390x__ 19#ifndef __s390x__
19#define cpcmd __cpcmd 20#define cpcmd __cpcmd
20#else 21#else
21extern void cpcmd(char *cmd, char *response, int rlen); 22/*
23 * cpcmd is the in-kernel interface for issuing CP commands
24 *
25 * cmd: null-terminated command string, max 240 characters
26 * response: response buffer for VM's textual response
27 * rlen: size of the response buffer, cpcmd will not exceed this size
28 * but will cap the output, if its too large. Everything that
29 * did not fit into the buffer will be silently dropped
30 * response_code: return pointer for VM's error code
31 * return value: the size of the response. The caller can check if the buffer
32 * was large enough by comparing the return value and rlen
33 * NOTE: If the response buffer is not below 2 GB, cpcmd can sleep
34 */
35extern int cpcmd(const char *cmd, char *response, int rlen, int *response_code);
22#endif /*__s390x__*/ 36#endif /*__s390x__*/
23 37
24#endif 38#endif
diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h
index 6bbcdea42a..92360d9014 100644
--- a/include/asm-s390/debug.h
+++ b/include/asm-s390/debug.h
@@ -9,6 +9,8 @@
9#ifndef DEBUG_H 9#ifndef DEBUG_H
10#define DEBUG_H 10#define DEBUG_H
11 11
12#include <linux/config.h>
13#include <linux/fs.h>
12#include <linux/string.h> 14#include <linux/string.h>
13 15
14/* Note: 16/* Note:
@@ -31,19 +33,18 @@ struct __debug_entry{
31} __attribute__((packed)); 33} __attribute__((packed));
32 34
33 35
34#define __DEBUG_FEATURE_VERSION 1 /* version of debug feature */ 36#define __DEBUG_FEATURE_VERSION 2 /* version of debug feature */
35 37
36#ifdef __KERNEL__ 38#ifdef __KERNEL__
37#include <linux/spinlock.h> 39#include <linux/spinlock.h>
38#include <linux/kernel.h> 40#include <linux/kernel.h>
39#include <linux/time.h> 41#include <linux/time.h>
40#include <linux/proc_fs.h>
41 42
42#define DEBUG_MAX_LEVEL 6 /* debug levels range from 0 to 6 */ 43#define DEBUG_MAX_LEVEL 6 /* debug levels range from 0 to 6 */
43#define DEBUG_OFF_LEVEL -1 /* level where debug is switched off */ 44#define DEBUG_OFF_LEVEL -1 /* level where debug is switched off */
44#define DEBUG_FLUSH_ALL -1 /* parameter to flush all areas */ 45#define DEBUG_FLUSH_ALL -1 /* parameter to flush all areas */
45#define DEBUG_MAX_VIEWS 10 /* max number of views in proc fs */ 46#define DEBUG_MAX_VIEWS 10 /* max number of views in proc fs */
46#define DEBUG_MAX_PROCF_LEN 64 /* max length for a proc file name */ 47#define DEBUG_MAX_NAME_LEN 64 /* max length for a debugfs file name */
47#define DEBUG_DEFAULT_LEVEL 3 /* initial debug level */ 48#define DEBUG_DEFAULT_LEVEL 3 /* initial debug level */
48 49
49#define DEBUG_DIR_ROOT "s390dbf" /* name of debug root directory in proc fs */ 50#define DEBUG_DIR_ROOT "s390dbf" /* name of debug root directory in proc fs */
@@ -64,16 +65,17 @@ typedef struct debug_info {
64 spinlock_t lock; 65 spinlock_t lock;
65 int level; 66 int level;
66 int nr_areas; 67 int nr_areas;
67 int page_order; 68 int pages_per_area;
68 int buf_size; 69 int buf_size;
69 int entry_size; 70 int entry_size;
70 debug_entry_t** areas; 71 debug_entry_t*** areas;
71 int active_area; 72 int active_area;
72 int *active_entry; 73 int *active_pages;
73 struct proc_dir_entry* proc_root_entry; 74 int *active_entries;
74 struct proc_dir_entry* proc_entries[DEBUG_MAX_VIEWS]; 75 struct dentry* debugfs_root_entry;
76 struct dentry* debugfs_entries[DEBUG_MAX_VIEWS];
75 struct debug_view* views[DEBUG_MAX_VIEWS]; 77 struct debug_view* views[DEBUG_MAX_VIEWS];
76 char name[DEBUG_MAX_PROCF_LEN]; 78 char name[DEBUG_MAX_NAME_LEN];
77} debug_info_t; 79} debug_info_t;
78 80
79typedef int (debug_header_proc_t) (debug_info_t* id, 81typedef int (debug_header_proc_t) (debug_info_t* id,
@@ -98,7 +100,7 @@ int debug_dflt_header_fn(debug_info_t* id, struct debug_view* view,
98 int area, debug_entry_t* entry, char* out_buf); 100 int area, debug_entry_t* entry, char* out_buf);
99 101
100struct debug_view { 102struct debug_view {
101 char name[DEBUG_MAX_PROCF_LEN]; 103 char name[DEBUG_MAX_NAME_LEN];
102 debug_prolog_proc_t* prolog_proc; 104 debug_prolog_proc_t* prolog_proc;
103 debug_header_proc_t* header_proc; 105 debug_header_proc_t* header_proc;
104 debug_format_proc_t* format_proc; 106 debug_format_proc_t* format_proc;
@@ -120,7 +122,7 @@ debug_entry_t* debug_exception_common(debug_info_t* id, int level,
120 122
121/* Debug Feature API: */ 123/* Debug Feature API: */
122 124
123debug_info_t* debug_register(char* name, int pages_index, int nr_areas, 125debug_info_t* debug_register(char* name, int pages, int nr_areas,
124 int buf_size); 126 int buf_size);
125 127
126void debug_unregister(debug_info_t* id); 128void debug_unregister(debug_info_t* id);
@@ -132,7 +134,8 @@ void debug_stop_all(void);
132extern inline debug_entry_t* 134extern inline debug_entry_t*
133debug_event(debug_info_t* id, int level, void* data, int length) 135debug_event(debug_info_t* id, int level, void* data, int length)
134{ 136{
135 if ((!id) || (level > id->level)) return NULL; 137 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
138 return NULL;
136 return debug_event_common(id,level,data,length); 139 return debug_event_common(id,level,data,length);
137} 140}
138 141
@@ -140,7 +143,8 @@ extern inline debug_entry_t*
140debug_int_event(debug_info_t* id, int level, unsigned int tag) 143debug_int_event(debug_info_t* id, int level, unsigned int tag)
141{ 144{
142 unsigned int t=tag; 145 unsigned int t=tag;
143 if ((!id) || (level > id->level)) return NULL; 146 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
147 return NULL;
144 return debug_event_common(id,level,&t,sizeof(unsigned int)); 148 return debug_event_common(id,level,&t,sizeof(unsigned int));
145} 149}
146 150
@@ -148,14 +152,16 @@ extern inline debug_entry_t *
148debug_long_event (debug_info_t* id, int level, unsigned long tag) 152debug_long_event (debug_info_t* id, int level, unsigned long tag)
149{ 153{
150 unsigned long t=tag; 154 unsigned long t=tag;
151 if ((!id) || (level > id->level)) return NULL; 155 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
156 return NULL;
152 return debug_event_common(id,level,&t,sizeof(unsigned long)); 157 return debug_event_common(id,level,&t,sizeof(unsigned long));
153} 158}
154 159
155extern inline debug_entry_t* 160extern inline debug_entry_t*
156debug_text_event(debug_info_t* id, int level, const char* txt) 161debug_text_event(debug_info_t* id, int level, const char* txt)
157{ 162{
158 if ((!id) || (level > id->level)) return NULL; 163 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
164 return NULL;
159 return debug_event_common(id,level,txt,strlen(txt)); 165 return debug_event_common(id,level,txt,strlen(txt));
160} 166}
161 167
@@ -167,7 +173,8 @@ debug_sprintf_event(debug_info_t* id,int level,char *string,...)
167extern inline debug_entry_t* 173extern inline debug_entry_t*
168debug_exception(debug_info_t* id, int level, void* data, int length) 174debug_exception(debug_info_t* id, int level, void* data, int length)
169{ 175{
170 if ((!id) || (level > id->level)) return NULL; 176 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
177 return NULL;
171 return debug_exception_common(id,level,data,length); 178 return debug_exception_common(id,level,data,length);
172} 179}
173 180
@@ -175,7 +182,8 @@ extern inline debug_entry_t*
175debug_int_exception(debug_info_t* id, int level, unsigned int tag) 182debug_int_exception(debug_info_t* id, int level, unsigned int tag)
176{ 183{
177 unsigned int t=tag; 184 unsigned int t=tag;
178 if ((!id) || (level > id->level)) return NULL; 185 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
186 return NULL;
179 return debug_exception_common(id,level,&t,sizeof(unsigned int)); 187 return debug_exception_common(id,level,&t,sizeof(unsigned int));
180} 188}
181 189
@@ -183,14 +191,16 @@ extern inline debug_entry_t *
183debug_long_exception (debug_info_t* id, int level, unsigned long tag) 191debug_long_exception (debug_info_t* id, int level, unsigned long tag)
184{ 192{
185 unsigned long t=tag; 193 unsigned long t=tag;
186 if ((!id) || (level > id->level)) return NULL; 194 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
195 return NULL;
187 return debug_exception_common(id,level,&t,sizeof(unsigned long)); 196 return debug_exception_common(id,level,&t,sizeof(unsigned long));
188} 197}
189 198
190extern inline debug_entry_t* 199extern inline debug_entry_t*
191debug_text_exception(debug_info_t* id, int level, const char* txt) 200debug_text_exception(debug_info_t* id, int level, const char* txt)
192{ 201{
193 if ((!id) || (level > id->level)) return NULL; 202 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
203 return NULL;
194 return debug_exception_common(id,level,txt,strlen(txt)); 204 return debug_exception_common(id,level,txt,strlen(txt));
195} 205}
196 206
diff --git a/include/asm-s390/kexec.h b/include/asm-s390/kexec.h
new file mode 100644
index 0000000000..54cf7d9f25
--- /dev/null
+++ b/include/asm-s390/kexec.h
@@ -0,0 +1,42 @@
1/*
2 * include/asm-s390/kexec.h
3 *
4 * (C) Copyright IBM Corp. 2005
5 *
6 * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com>
7 *
8 */
9
10#ifndef _S390_KEXEC_H
11#define _S390_KEXEC_H
12
13#include <asm/page.h>
14#include <asm/processor.h>
15/*
16 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
17 * I.e. Maximum page that is mapped directly into kernel memory,
18 * and kmap is not required.
19 */
20
21/* Maximum physical address we can use pages from */
22#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
23
24/* Maximum address we can reach in physical address mode */
25#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
26
27/* Maximum address we can use for the control pages */
28/* Not more than 2GB */
29#define KEXEC_CONTROL_MEMORY_LIMIT (1<<31)
30
31/* Allocate one page for the pdp and the second for the code */
32#define KEXEC_CONTROL_CODE_SIZE 4096
33
34/* The native architecture */
35#define KEXEC_ARCH KEXEC_ARCH_S390
36
37#define MAX_NOTE_BYTES 1024
38typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
39
40extern note_buf_t crash_notes[];
41
42#endif /*_S390_KEXEC_H */
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h
index df5172fc58..76b5b19c0a 100644
--- a/include/asm-s390/lowcore.h
+++ b/include/asm-s390/lowcore.h
@@ -109,10 +109,14 @@
109 109
110#ifndef __s390x__ 110#ifndef __s390x__
111#define __LC_PFAULT_INTPARM 0x080 111#define __LC_PFAULT_INTPARM 0x080
112#define __LC_CPU_TIMER_SAVE_AREA 0x0D8
112#define __LC_AREGS_SAVE_AREA 0x120 113#define __LC_AREGS_SAVE_AREA 0x120
114#define __LC_GPREGS_SAVE_AREA 0x180
113#define __LC_CREGS_SAVE_AREA 0x1C0 115#define __LC_CREGS_SAVE_AREA 0x1C0
114#else /* __s390x__ */ 116#else /* __s390x__ */
115#define __LC_PFAULT_INTPARM 0x11B8 117#define __LC_PFAULT_INTPARM 0x11B8
118#define __LC_GPREGS_SAVE_AREA 0x1280
119#define __LC_CPU_TIMER_SAVE_AREA 0x1328
116#define __LC_AREGS_SAVE_AREA 0x1340 120#define __LC_AREGS_SAVE_AREA 0x1340
117#define __LC_CREGS_SAVE_AREA 0x1380 121#define __LC_CREGS_SAVE_AREA 0x1380
118#endif /* __s390x__ */ 122#endif /* __s390x__ */
@@ -167,7 +171,8 @@ struct _lowcore
167 __u16 subchannel_nr; /* 0x0ba */ 171 __u16 subchannel_nr; /* 0x0ba */
168 __u32 io_int_parm; /* 0x0bc */ 172 __u32 io_int_parm; /* 0x0bc */
169 __u32 io_int_word; /* 0x0c0 */ 173 __u32 io_int_word; /* 0x0c0 */
170 __u8 pad3[0xD8-0xC4]; /* 0x0c4 */ 174 __u8 pad3[0xD4-0xC4]; /* 0x0c4 */
175 __u32 extended_save_area_addr; /* 0x0d4 */
171 __u32 cpu_timer_save_area[2]; /* 0x0d8 */ 176 __u32 cpu_timer_save_area[2]; /* 0x0d8 */
172 __u32 clock_comp_save_area[2]; /* 0x0e0 */ 177 __u32 clock_comp_save_area[2]; /* 0x0e0 */
173 __u32 mcck_interruption_code[2]; /* 0x0e8 */ 178 __u32 mcck_interruption_code[2]; /* 0x0e8 */
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index fb46e9090b..8bd14de69e 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -207,6 +207,18 @@ unsigned long get_wchan(struct task_struct *p);
207#endif /* __s390x__ */ 207#endif /* __s390x__ */
208 208
209/* 209/*
210 * Set PSW to specified value.
211 */
212static inline void __load_psw(psw_t psw)
213{
214#ifndef __s390x__
215 asm volatile ("lpsw 0(%0)" : : "a" (&psw), "m" (psw) : "cc" );
216#else
217 asm volatile ("lpswe 0(%0)" : : "a" (&psw), "m" (psw) : "cc" );
218#endif
219}
220
221/*
210 * Set PSW mask to specified value, while leaving the 222 * Set PSW mask to specified value, while leaving the
211 * PSW addr pointing to the next instruction. 223 * PSW addr pointing to the next instruction.
212 */ 224 */
@@ -214,8 +226,8 @@ unsigned long get_wchan(struct task_struct *p);
214static inline void __load_psw_mask (unsigned long mask) 226static inline void __load_psw_mask (unsigned long mask)
215{ 227{
216 unsigned long addr; 228 unsigned long addr;
217
218 psw_t psw; 229 psw_t psw;
230
219 psw.mask = mask; 231 psw.mask = mask;
220 232
221#ifndef __s390x__ 233#ifndef __s390x__
@@ -241,30 +253,8 @@ static inline void __load_psw_mask (unsigned long mask)
241 */ 253 */
242static inline void enabled_wait(void) 254static inline void enabled_wait(void)
243{ 255{
244 unsigned long reg; 256 __load_psw_mask(PSW_BASE_BITS | PSW_MASK_IO | PSW_MASK_EXT |
245 psw_t wait_psw; 257 PSW_MASK_MCHECK | PSW_MASK_WAIT | PSW_DEFAULT_KEY);
246
247 wait_psw.mask = PSW_BASE_BITS | PSW_MASK_IO | PSW_MASK_EXT |
248 PSW_MASK_MCHECK | PSW_MASK_WAIT | PSW_DEFAULT_KEY;
249#ifndef __s390x__
250 asm volatile (
251 " basr %0,0\n"
252 "0: la %0,1f-0b(%0)\n"
253 " st %0,4(%1)\n"
254 " oi 4(%1),0x80\n"
255 " lpsw 0(%1)\n"
256 "1:"
257 : "=&a" (reg) : "a" (&wait_psw), "m" (wait_psw)
258 : "memory", "cc" );
259#else /* __s390x__ */
260 asm volatile (
261 " larl %0,0f\n"
262 " stg %0,8(%1)\n"
263 " lpswe 0(%1)\n"
264 "0:"
265 : "=&a" (reg) : "a" (&wait_psw), "m" (wait_psw)
266 : "memory", "cc" );
267#endif /* __s390x__ */
268} 258}
269 259
270/* 260/*
@@ -273,13 +263,11 @@ static inline void enabled_wait(void)
273 263
274static inline void disabled_wait(unsigned long code) 264static inline void disabled_wait(unsigned long code)
275{ 265{
276 char psw_buffer[2*sizeof(psw_t)];
277 unsigned long ctl_buf; 266 unsigned long ctl_buf;
278 psw_t *dw_psw = (psw_t *)(((unsigned long) &psw_buffer+sizeof(psw_t)-1) 267 psw_t dw_psw;
279 & -sizeof(psw_t));
280 268
281 dw_psw->mask = PSW_BASE_BITS | PSW_MASK_WAIT; 269 dw_psw.mask = PSW_BASE_BITS | PSW_MASK_WAIT;
282 dw_psw->addr = code; 270 dw_psw.addr = code;
283 /* 271 /*
284 * Store status and then load disabled wait psw, 272 * Store status and then load disabled wait psw,
285 * the processor is dead afterwards 273 * the processor is dead afterwards
@@ -301,7 +289,7 @@ static inline void disabled_wait(unsigned long code)
301 " oi 0x1c0,0x10\n" /* fake protection bit */ 289 " oi 0x1c0,0x10\n" /* fake protection bit */
302 " lpsw 0(%1)" 290 " lpsw 0(%1)"
303 : "=m" (ctl_buf) 291 : "=m" (ctl_buf)
304 : "a" (dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc" ); 292 : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc" );
305#else /* __s390x__ */ 293#else /* __s390x__ */
306 asm volatile (" stctg 0,0,0(%2)\n" 294 asm volatile (" stctg 0,0,0(%2)\n"
307 " ni 4(%2),0xef\n" /* switch off protection */ 295 " ni 4(%2),0xef\n" /* switch off protection */
@@ -333,7 +321,7 @@ static inline void disabled_wait(unsigned long code)
333 " oi 0x384(1),0x10\n" /* fake protection bit */ 321 " oi 0x384(1),0x10\n" /* fake protection bit */
334 " lpswe 0(%1)" 322 " lpswe 0(%1)"
335 : "=m" (ctl_buf) 323 : "=m" (ctl_buf)
336 : "a" (dw_psw), "a" (&ctl_buf), 324 : "a" (&dw_psw), "a" (&ctl_buf),
337 "m" (dw_psw) : "cc", "0", "1"); 325 "m" (dw_psw) : "cc", "0", "1");
338#endif /* __s390x__ */ 326#endif /* __s390x__ */
339} 327}
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h
index 4eff8f2e3b..fc7c96edc6 100644
--- a/include/asm-s390/ptrace.h
+++ b/include/asm-s390/ptrace.h
@@ -276,7 +276,7 @@ typedef struct
276#endif /* __s390x__ */ 276#endif /* __s390x__ */
277 277
278#define PSW_KERNEL_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY | \ 278#define PSW_KERNEL_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY | \
279 PSW_DEFAULT_KEY) 279 PSW_MASK_MCHECK | PSW_DEFAULT_KEY)
280#define PSW_USER_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \ 280#define PSW_USER_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \
281 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \ 281 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \
282 PSW_MASK_PSTATE | PSW_DEFAULT_KEY) 282 PSW_MASK_PSTATE | PSW_DEFAULT_KEY)
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index 81514d76ed..b4a9f05a93 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -16,6 +16,7 @@
16#include <asm/types.h> 16#include <asm/types.h>
17#include <asm/ptrace.h> 17#include <asm/ptrace.h>
18#include <asm/setup.h> 18#include <asm/setup.h>
19#include <asm/processor.h>
19 20
20#ifdef __KERNEL__ 21#ifdef __KERNEL__
21 22
@@ -103,29 +104,18 @@ static inline void restore_access_regs(unsigned int *acrs)
103 prev = __switch_to(prev,next); \ 104 prev = __switch_to(prev,next); \
104} while (0) 105} while (0)
105 106
106#define prepare_arch_switch(rq, next) do { } while(0)
107#define task_running(rq, p) ((rq)->curr == (p))
108
109#ifdef CONFIG_VIRT_CPU_ACCOUNTING 107#ifdef CONFIG_VIRT_CPU_ACCOUNTING
110extern void account_user_vtime(struct task_struct *); 108extern void account_user_vtime(struct task_struct *);
111extern void account_system_vtime(struct task_struct *); 109extern void account_system_vtime(struct task_struct *);
112
113#define finish_arch_switch(rq, prev) do { \
114 set_fs(current->thread.mm_segment); \
115 spin_unlock(&(rq)->lock); \
116 account_system_vtime(prev); \
117 local_irq_enable(); \
118} while (0)
119
120#else 110#else
111#define account_system_vtime(prev) do { } while (0)
112#endif
121 113
122#define finish_arch_switch(rq, prev) do { \ 114#define finish_arch_switch(rq, prev) do { \
123 set_fs(current->thread.mm_segment); \ 115 set_fs(current->thread.mm_segment); \
124 spin_unlock_irq(&(rq)->lock); \ 116 account_system_vtime(prev); \
125} while (0) 117} while (0)
126 118
127#endif
128
129#define nop() __asm__ __volatile__ ("nop") 119#define nop() __asm__ __volatile__ ("nop")
130 120
131#define xchg(ptr,x) \ 121#define xchg(ptr,x) \
@@ -331,9 +321,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
331 321
332#ifdef __s390x__ 322#ifdef __s390x__
333 323
334#define __load_psw(psw) \
335 __asm__ __volatile__("lpswe 0(%0)" : : "a" (&psw), "m" (psw) : "cc" );
336
337#define __ctl_load(array, low, high) ({ \ 324#define __ctl_load(array, low, high) ({ \
338 typedef struct { char _[sizeof(array)]; } addrtype; \ 325 typedef struct { char _[sizeof(array)]; } addrtype; \
339 __asm__ __volatile__ ( \ 326 __asm__ __volatile__ ( \
@@ -390,9 +377,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
390 377
391#else /* __s390x__ */ 378#else /* __s390x__ */
392 379
393#define __load_psw(psw) \
394 __asm__ __volatile__("lpsw 0(%0)" : : "a" (&psw) : "cc" );
395
396#define __ctl_load(array, low, high) ({ \ 380#define __ctl_load(array, low, high) ({ \
397 typedef struct { char _[sizeof(array)]; } addrtype; \ 381 typedef struct { char _[sizeof(array)]; } addrtype; \
398 __asm__ __volatile__ ( \ 382 __asm__ __volatile__ ( \
@@ -451,6 +435,20 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
451/* For spinlocks etc */ 435/* For spinlocks etc */
452#define local_irq_save(x) ((x) = local_irq_disable()) 436#define local_irq_save(x) ((x) = local_irq_disable())
453 437
438/*
439 * Use to set psw mask except for the first byte which
440 * won't be changed by this function.
441 */
442static inline void
443__set_psw_mask(unsigned long mask)
444{
445 local_save_flags(mask);
446 __load_psw_mask(mask);
447}
448
449#define local_mcck_enable() __set_psw_mask(PSW_KERNEL_BITS)
450#define local_mcck_disable() __set_psw_mask(PSW_KERNEL_BITS & ~PSW_MASK_MCHECK)
451
454#ifdef CONFIG_SMP 452#ifdef CONFIG_SMP
455 453
456extern void smp_ctl_set_bit(int cr, int bit); 454extern void smp_ctl_set_bit(int cr, int bit);
diff --git a/include/asm-s390/thread_info.h b/include/asm-s390/thread_info.h
index fe101d41e8..6c18a3f243 100644
--- a/include/asm-s390/thread_info.h
+++ b/include/asm-s390/thread_info.h
@@ -96,6 +96,7 @@ static inline struct thread_info *current_thread_info(void)
96#define TIF_RESTART_SVC 4 /* restart svc with new svc number */ 96#define TIF_RESTART_SVC 4 /* restart svc with new svc number */
97#define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */ 97#define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */
98#define TIF_SINGLE_STEP 6 /* deliver sigtrap on return to user */ 98#define TIF_SINGLE_STEP 6 /* deliver sigtrap on return to user */
99#define TIF_MCCK_PENDING 7 /* machine check handling is pending */
99#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 100#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
100#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling 101#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling
101 TIF_NEED_RESCHED */ 102 TIF_NEED_RESCHED */
@@ -109,6 +110,7 @@ static inline struct thread_info *current_thread_info(void)
109#define _TIF_RESTART_SVC (1<<TIF_RESTART_SVC) 110#define _TIF_RESTART_SVC (1<<TIF_RESTART_SVC)
110#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 111#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
111#define _TIF_SINGLE_STEP (1<<TIF_SINGLE_STEP) 112#define _TIF_SINGLE_STEP (1<<TIF_SINGLE_STEP)
113#define _TIF_MCCK_PENDING (1<<TIF_MCCK_PENDING)
112#define _TIF_USEDFPU (1<<TIF_USEDFPU) 114#define _TIF_USEDFPU (1<<TIF_USEDFPU)
113#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 115#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
114#define _TIF_31BIT (1<<TIF_31BIT) 116#define _TIF_31BIT (1<<TIF_31BIT)
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index f1a204f7c0..363db45f8d 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -269,7 +269,7 @@
269#define __NR_mq_timedreceive 274 269#define __NR_mq_timedreceive 274
270#define __NR_mq_notify 275 270#define __NR_mq_notify 275
271#define __NR_mq_getsetattr 276 271#define __NR_mq_getsetattr 276
272/* Number 277 is reserved for new sys_kexec_load */ 272#define __NR_kexec_load 277
273#define __NR_add_key 278 273#define __NR_add_key 278
274#define __NR_request_key 279 274#define __NR_request_key 279
275#define __NR_keyctl 280 275#define __NR_keyctl 280
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index 80cf20cfae..898562ebe9 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -101,7 +101,7 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
101 * SWITCH_ENTER and SWITH_DO_LAZY_FPU do not work yet (e.g. SMP does not work) 101 * SWITCH_ENTER and SWITH_DO_LAZY_FPU do not work yet (e.g. SMP does not work)
102 * XXX WTF is the above comment? Found in late teen 2.4.x. 102 * XXX WTF is the above comment? Found in late teen 2.4.x.
103 */ 103 */
104#define prepare_arch_switch(rq, next) do { \ 104#define prepare_arch_switch(next) do { \
105 __asm__ __volatile__( \ 105 __asm__ __volatile__( \
106 ".globl\tflush_patch_switch\nflush_patch_switch:\n\t" \ 106 ".globl\tflush_patch_switch\nflush_patch_switch:\n\t" \
107 "save %sp, -0x40, %sp; save %sp, -0x40, %sp; save %sp, -0x40, %sp\n\t" \ 107 "save %sp, -0x40, %sp; save %sp, -0x40, %sp; save %sp, -0x40, %sp\n\t" \
@@ -109,8 +109,6 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
109 "save %sp, -0x40, %sp\n\t" \ 109 "save %sp, -0x40, %sp\n\t" \
110 "restore; restore; restore; restore; restore; restore; restore"); \ 110 "restore; restore; restore; restore; restore; restore; restore"); \
111} while(0) 111} while(0)
112#define finish_arch_switch(rq, next) spin_unlock_irq(&(rq)->lock)
113#define task_running(rq, p) ((rq)->curr == (p))
114 112
115 /* Much care has gone into this code, do not touch it. 113 /* Much care has gone into this code, do not touch it.
116 * 114 *
diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h
index f70d3dad01..6321f5a019 100644
--- a/include/asm-sparc64/kdebug.h
+++ b/include/asm-sparc64/kdebug.h
@@ -16,7 +16,7 @@ struct die_args {
16}; 16};
17 17
18/* Note - you should never unregister because that can race with NMIs. 18/* Note - you should never unregister because that can race with NMIs.
19 * If you really want to do it first unregister - then synchronize_kernel 19 * If you really want to do it first unregister - then synchronize_sched
20 * - then free. 20 * - then free.
21 */ 21 */
22int register_die_notifier(struct notifier_block *nb); 22int register_die_notifier(struct notifier_block *nb);
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index fd12ca386f..f9be2c5b4d 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -139,19 +139,13 @@ extern void __flushw_user(void);
139#define flush_user_windows flushw_user 139#define flush_user_windows flushw_user
140#define flush_register_windows flushw_all 140#define flush_register_windows flushw_all
141 141
142#define prepare_arch_switch(rq, next) \ 142/* Don't hold the runqueue lock over context switch */
143do { spin_lock(&(next)->switch_lock); \ 143#define __ARCH_WANT_UNLOCKED_CTXSW
144 spin_unlock(&(rq)->lock); \ 144#define prepare_arch_switch(next) \
145do { \
145 flushw_all(); \ 146 flushw_all(); \
146} while (0) 147} while (0)
147 148
148#define finish_arch_switch(rq, prev) \
149do { spin_unlock_irq(&(prev)->switch_lock); \
150} while (0)
151
152#define task_running(rq, p) \
153 ((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock))
154
155 /* See what happens when you design the chip correctly? 149 /* See what happens when you design the chip correctly?
156 * 150 *
157 * We tell gcc we clobber all non-fixed-usage registers except 151 * We tell gcc we clobber all non-fixed-usage registers except
diff --git a/include/asm-sparc64/termios.h b/include/asm-sparc64/termios.h
index 8effce0da0..9777a9cca8 100644
--- a/include/asm-sparc64/termios.h
+++ b/include/asm-sparc64/termios.h
@@ -100,16 +100,17 @@ struct winsize {
100#define user_termio_to_kernel_termios(termios, termio) \ 100#define user_termio_to_kernel_termios(termios, termio) \
101({ \ 101({ \
102 unsigned short tmp; \ 102 unsigned short tmp; \
103 get_user(tmp, &(termio)->c_iflag); \ 103 int err; \
104 err = get_user(tmp, &(termio)->c_iflag); \
104 (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ 105 (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \
105 get_user(tmp, &(termio)->c_oflag); \ 106 err |= get_user(tmp, &(termio)->c_oflag); \
106 (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ 107 (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \
107 get_user(tmp, &(termio)->c_cflag); \ 108 err |= get_user(tmp, &(termio)->c_cflag); \
108 (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ 109 (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \
109 get_user(tmp, &(termio)->c_lflag); \ 110 err |= get_user(tmp, &(termio)->c_lflag); \
110 (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ 111 (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \
111 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ 112 err |= copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
112 0; \ 113 err; \
113}) 114})
114 115
115/* 116/*
@@ -119,53 +120,56 @@ struct winsize {
119 */ 120 */
120#define kernel_termios_to_user_termio(termio, termios) \ 121#define kernel_termios_to_user_termio(termio, termios) \
121({ \ 122({ \
122 put_user((termios)->c_iflag, &(termio)->c_iflag); \ 123 int err; \
123 put_user((termios)->c_oflag, &(termio)->c_oflag); \ 124 err = put_user((termios)->c_iflag, &(termio)->c_iflag); \
124 put_user((termios)->c_cflag, &(termio)->c_cflag); \ 125 err |= put_user((termios)->c_oflag, &(termio)->c_oflag); \
125 put_user((termios)->c_lflag, &(termio)->c_lflag); \ 126 err |= put_user((termios)->c_cflag, &(termio)->c_cflag); \
126 put_user((termios)->c_line, &(termio)->c_line); \ 127 err |= put_user((termios)->c_lflag, &(termio)->c_lflag); \
127 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 128 err |= put_user((termios)->c_line, &(termio)->c_line); \
129 err |= copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
128 if (!((termios)->c_lflag & ICANON)) { \ 130 if (!((termios)->c_lflag & ICANON)) { \
129 put_user((termios)->c_cc[VMIN], &(termio)->c_cc[_VMIN]); \ 131 err |= put_user((termios)->c_cc[VMIN], &(termio)->c_cc[_VMIN]); \
130 put_user((termios)->c_cc[VTIME], &(termio)->c_cc[_VTIME]); \ 132 err |= put_user((termios)->c_cc[VTIME], &(termio)->c_cc[_VTIME]); \
131 } \ 133 } \
132 0; \ 134 err; \
133}) 135})
134 136
135#define user_termios_to_kernel_termios(k, u) \ 137#define user_termios_to_kernel_termios(k, u) \
136({ \ 138({ \
137 get_user((k)->c_iflag, &(u)->c_iflag); \ 139 int err; \
138 get_user((k)->c_oflag, &(u)->c_oflag); \ 140 err = get_user((k)->c_iflag, &(u)->c_iflag); \
139 get_user((k)->c_cflag, &(u)->c_cflag); \ 141 err |= get_user((k)->c_oflag, &(u)->c_oflag); \
140 get_user((k)->c_lflag, &(u)->c_lflag); \ 142 err |= get_user((k)->c_cflag, &(u)->c_cflag); \
141 get_user((k)->c_line, &(u)->c_line); \ 143 err |= get_user((k)->c_lflag, &(u)->c_lflag); \
142 copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \ 144 err |= get_user((k)->c_line, &(u)->c_line); \
145 err |= copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \
143 if((k)->c_lflag & ICANON) { \ 146 if((k)->c_lflag & ICANON) { \
144 get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ 147 err |= get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
145 get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ 148 err |= get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
146 } else { \ 149 } else { \
147 get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ 150 err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
148 get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ 151 err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
149 } \ 152 } \
150 0; \ 153 err; \
151}) 154})
152 155
153#define kernel_termios_to_user_termios(u, k) \ 156#define kernel_termios_to_user_termios(u, k) \
154({ \ 157({ \
155 put_user((k)->c_iflag, &(u)->c_iflag); \ 158 int err; \
156 put_user((k)->c_oflag, &(u)->c_oflag); \ 159 err = put_user((k)->c_iflag, &(u)->c_iflag); \
157 put_user((k)->c_cflag, &(u)->c_cflag); \ 160 err |= put_user((k)->c_oflag, &(u)->c_oflag); \
158 put_user((k)->c_lflag, &(u)->c_lflag); \ 161 err |= put_user((k)->c_cflag, &(u)->c_cflag); \
159 put_user((k)->c_line, &(u)->c_line); \ 162 err |= put_user((k)->c_lflag, &(u)->c_lflag); \
160 copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \ 163 err |= put_user((k)->c_line, &(u)->c_line); \
164 err |= copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \
161 if(!((k)->c_lflag & ICANON)) { \ 165 if(!((k)->c_lflag & ICANON)) { \
162 put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ 166 err |= put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
163 put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ 167 err |= put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
164 } else { \ 168 } else { \
165 put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ 169 err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
166 put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ 170 err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
167 } \ 171 } \
168 0; \ 172 err; \
169}) 173})
170 174
171#endif /* __KERNEL__ */ 175#endif /* __KERNEL__ */
diff --git a/include/asm-um/ptrace-i386.h b/include/asm-um/ptrace-i386.h
index 04222f35c4..fe882b9d91 100644
--- a/include/asm-um/ptrace-i386.h
+++ b/include/asm-um/ptrace-i386.h
@@ -32,6 +32,10 @@
32#define PT_REGS_SYSCALL_RET(r) PT_REGS_EAX(r) 32#define PT_REGS_SYSCALL_RET(r) PT_REGS_EAX(r)
33#define PT_FIX_EXEC_STACK(sp) do ; while(0) 33#define PT_FIX_EXEC_STACK(sp) do ; while(0)
34 34
35/* Cope with a conditional i386 definition. */
36#undef profile_pc
37#define profile_pc(regs) PT_REGS_IP(regs)
38
35#define user_mode(r) UPT_IS_USER(&(r)->regs) 39#define user_mode(r) UPT_IS_USER(&(r)->regs)
36 40
37#endif 41#endif
diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h
index e4b1017b8b..16ec82e16b 100644
--- a/include/asm-x86_64/apic.h
+++ b/include/asm-x86_64/apic.h
@@ -77,7 +77,7 @@ static inline void ack_APIC_irq(void)
77extern int get_maxlvt (void); 77extern int get_maxlvt (void);
78extern void clear_local_APIC (void); 78extern void clear_local_APIC (void);
79extern void connect_bsp_APIC (void); 79extern void connect_bsp_APIC (void);
80extern void disconnect_bsp_APIC (void); 80extern void disconnect_bsp_APIC (int virt_wire_setup);
81extern void disable_local_APIC (void); 81extern void disable_local_APIC (void);
82extern int verify_local_APIC (void); 82extern int verify_local_APIC (void);
83extern void cache_APIC_registers (void); 83extern void cache_APIC_registers (void);
diff --git a/include/asm-x86_64/apicdef.h b/include/asm-x86_64/apicdef.h
index bfebdb6906..9388062c4f 100644
--- a/include/asm-x86_64/apicdef.h
+++ b/include/asm-x86_64/apicdef.h
@@ -94,7 +94,7 @@
94#define SET_APIC_DELIVERY_MODE(x,y) (((x)&~0x700)|((y)<<8)) 94#define SET_APIC_DELIVERY_MODE(x,y) (((x)&~0x700)|((y)<<8))
95#define APIC_MODE_FIXED 0x0 95#define APIC_MODE_FIXED 0x0
96#define APIC_MODE_NMI 0x4 96#define APIC_MODE_NMI 0x4
97#define APIC_MODE_EXINT 0x7 97#define APIC_MODE_EXTINT 0x7
98#define APIC_LVT1 0x360 98#define APIC_LVT1 0x360
99#define APIC_LVTERR 0x370 99#define APIC_LVTERR 0x370
100#define APIC_TMICT 0x380 100#define APIC_TMICT 0x380
diff --git a/include/asm-x86_64/irq.h b/include/asm-x86_64/irq.h
index 3af50b3c3b..eb3b7aa9eb 100644
--- a/include/asm-x86_64/irq.h
+++ b/include/asm-x86_64/irq.h
@@ -52,4 +52,9 @@ struct irqaction;
52struct pt_regs; 52struct pt_regs;
53int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); 53int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
54 54
55#ifdef CONFIG_HOTPLUG_CPU
56#include <linux/cpumask.h>
57extern void fixup_irqs(cpumask_t map);
58#endif
59
55#endif /* _ASM_IRQ_H */ 60#endif /* _ASM_IRQ_H */
diff --git a/include/asm-x86_64/kdebug.h b/include/asm-x86_64/kdebug.h
index 6277f75cbb..b90341994d 100644
--- a/include/asm-x86_64/kdebug.h
+++ b/include/asm-x86_64/kdebug.h
@@ -14,7 +14,7 @@ struct die_args {
14}; 14};
15 15
16/* Note - you should never unregister because that can race with NMIs. 16/* Note - you should never unregister because that can race with NMIs.
17 If you really want to do it first unregister - then synchronize_kernel - then free. 17 If you really want to do it first unregister - then synchronize_sched - then free.
18 */ 18 */
19int register_die_notifier(struct notifier_block *nb); 19int register_die_notifier(struct notifier_block *nb);
20extern struct notifier_block *die_chain; 20extern struct notifier_block *die_chain;
diff --git a/include/asm-x86_64/kexec.h b/include/asm-x86_64/kexec.h
new file mode 100644
index 0000000000..42d2ff15c5
--- /dev/null
+++ b/include/asm-x86_64/kexec.h
@@ -0,0 +1,33 @@
1#ifndef _X86_64_KEXEC_H
2#define _X86_64_KEXEC_H
3
4#include <asm/page.h>
5#include <asm/proto.h>
6
7/*
8 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
9 * I.e. Maximum page that is mapped directly into kernel memory,
10 * and kmap is not required.
11 *
12 * So far x86_64 is limited to 40 physical address bits.
13 */
14
15/* Maximum physical address we can use pages from */
16#define KEXEC_SOURCE_MEMORY_LIMIT (0xFFFFFFFFFFUL)
17/* Maximum address we can reach in physical address mode */
18#define KEXEC_DESTINATION_MEMORY_LIMIT (0xFFFFFFFFFFUL)
19/* Maximum address we can use for the control pages */
20#define KEXEC_CONTROL_MEMORY_LIMIT (0xFFFFFFFFFFUL)
21
22/* Allocate one page for the pdp and the second for the code */
23#define KEXEC_CONTROL_CODE_SIZE (4096UL + 4096UL)
24
25/* The native architecture */
26#define KEXEC_ARCH KEXEC_ARCH_X86_64
27
28#define MAX_NOTE_BYTES 1024
29typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
30
31extern note_buf_t crash_notes[];
32
33#endif /* _X86_64_KEXEC_H */
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h
index 60130f4ca9..431318764a 100644
--- a/include/asm-x86_64/page.h
+++ b/include/asm-x86_64/page.h
@@ -64,12 +64,14 @@ typedef struct { unsigned long pgprot; } pgprot_t;
64#define __pgd(x) ((pgd_t) { (x) } ) 64#define __pgd(x) ((pgd_t) { (x) } )
65#define __pgprot(x) ((pgprot_t) { (x) } ) 65#define __pgprot(x) ((pgprot_t) { (x) } )
66 66
67#define __START_KERNEL 0xffffffff80100000UL 67#define __PHYSICAL_START ((unsigned long)CONFIG_PHYSICAL_START)
68#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
68#define __START_KERNEL_map 0xffffffff80000000UL 69#define __START_KERNEL_map 0xffffffff80000000UL
69#define __PAGE_OFFSET 0xffff810000000000UL 70#define __PAGE_OFFSET 0xffff810000000000UL
70 71
71#else 72#else
72#define __START_KERNEL 0xffffffff80100000 73#define __PHYSICAL_START CONFIG_PHYSICAL_START
74#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
73#define __START_KERNEL_map 0xffffffff80000000 75#define __START_KERNEL_map 0xffffffff80000000
74#define __PAGE_OFFSET 0xffff810000000000 76#define __PAGE_OFFSET 0xffff810000000000
75#endif /* !__ASSEMBLY__ */ 77#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h
index a7425aa5a3..aeb1b73e21 100644
--- a/include/asm-x86_64/smp.h
+++ b/include/asm-x86_64/smp.h
@@ -43,6 +43,8 @@ extern cpumask_t cpu_callout_map;
43extern void smp_alloc_memory(void); 43extern void smp_alloc_memory(void);
44extern volatile unsigned long smp_invalidate_needed; 44extern volatile unsigned long smp_invalidate_needed;
45extern int pic_mode; 45extern int pic_mode;
46extern void lock_ipi_call_lock(void);
47extern void unlock_ipi_call_lock(void);
46extern int smp_num_siblings; 48extern int smp_num_siblings;
47extern void smp_flush_tlb(void); 49extern void smp_flush_tlb(void);
48extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs); 50extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs);
@@ -77,6 +79,8 @@ extern __inline int hard_smp_processor_id(void)
77} 79}
78 80
79extern int safe_smp_processor_id(void); 81extern int safe_smp_processor_id(void);
82extern int __cpu_disable(void);
83extern void __cpu_die(unsigned int cpu);
80 84
81#endif /* !ASSEMBLY */ 85#endif /* !ASSEMBLY */
82 86
diff --git a/include/asm-x86_64/suspend.h b/include/asm-x86_64/suspend.h
index ec745807fe..bb9f40597d 100644
--- a/include/asm-x86_64/suspend.h
+++ b/include/asm-x86_64/suspend.h
@@ -16,7 +16,7 @@ arch_prepare_suspend(void)
16struct saved_context { 16struct saved_context {
17 u16 ds, es, fs, gs, ss; 17 u16 ds, es, fs, gs, ss;
18 unsigned long gs_base, gs_kernel_base, fs_base; 18 unsigned long gs_base, gs_kernel_base, fs_base;
19 unsigned long cr0, cr2, cr3, cr4; 19 unsigned long cr0, cr2, cr3, cr4, cr8;
20 u16 gdt_pad; 20 u16 gdt_pad;
21 u16 gdt_limit; 21 u16 gdt_limit;
22 unsigned long gdt_base; 22 unsigned long gdt_base;
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index 8f77e9f6bc..c1bc3fad48 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -39,12 +39,16 @@ extern int __node_distance(int, int);
39 .busy_factor = 32, \ 39 .busy_factor = 32, \
40 .imbalance_pct = 125, \ 40 .imbalance_pct = 125, \
41 .cache_hot_time = (10*1000000), \ 41 .cache_hot_time = (10*1000000), \
42 .cache_nice_tries = 1, \ 42 .cache_nice_tries = 2, \
43 .busy_idx = 3, \
44 .idle_idx = 2, \
45 .newidle_idx = 0, \
46 .wake_idx = 1, \
47 .forkexec_idx = 1, \
43 .per_cpu_gain = 100, \ 48 .per_cpu_gain = 100, \
44 .flags = SD_LOAD_BALANCE \ 49 .flags = SD_LOAD_BALANCE \
45 | SD_BALANCE_NEWIDLE \ 50 | SD_BALANCE_FORK \
46 | SD_BALANCE_EXEC \ 51 | SD_BALANCE_EXEC \
47 | SD_WAKE_IDLE \
48 | SD_WAKE_BALANCE, \ 52 | SD_WAKE_BALANCE, \
49 .last_balance = jiffies, \ 53 .last_balance = jiffies, \
50 .balance_interval = 1, \ 54 .balance_interval = 1, \
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index 3c9af6fd43..d767adcbf0 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -552,7 +552,7 @@ __SYSCALL(__NR_mq_notify, sys_mq_notify)
552#define __NR_mq_getsetattr 245 552#define __NR_mq_getsetattr 245
553__SYSCALL(__NR_mq_getsetattr, sys_mq_getsetattr) 553__SYSCALL(__NR_mq_getsetattr, sys_mq_getsetattr)
554#define __NR_kexec_load 246 554#define __NR_kexec_load 246
555__SYSCALL(__NR_kexec_load, sys_ni_syscall) 555__SYSCALL(__NR_kexec_load, sys_kexec_load)
556#define __NR_waitid 247 556#define __NR_waitid 247
557__SYSCALL(__NR_waitid, sys_waitid) 557__SYSCALL(__NR_waitid, sys_waitid)
558#define __NR_add_key 248 558#define __NR_add_key 248
diff --git a/include/linux/a.out.h b/include/linux/a.out.h
index af8a1dfa5c..f913cc3e1b 100644
--- a/include/linux/a.out.h
+++ b/include/linux/a.out.h
@@ -138,7 +138,7 @@ enum machine_type {
138#endif 138#endif
139#endif 139#endif
140 140
141#define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1)) 141#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
142 142
143#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text) 143#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
144 144
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 60272141ff..b54a0348a8 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -539,15 +539,12 @@ extern void generic_make_request(struct bio *bio);
539extern void blk_put_request(struct request *); 539extern void blk_put_request(struct request *);
540extern void blk_end_sync_rq(struct request *rq); 540extern void blk_end_sync_rq(struct request *rq);
541extern void blk_attempt_remerge(request_queue_t *, struct request *); 541extern void blk_attempt_remerge(request_queue_t *, struct request *);
542extern void __blk_attempt_remerge(request_queue_t *, struct request *);
543extern struct request *blk_get_request(request_queue_t *, int, int); 542extern struct request *blk_get_request(request_queue_t *, int, int);
544extern void blk_insert_request(request_queue_t *, struct request *, int, void *); 543extern void blk_insert_request(request_queue_t *, struct request *, int, void *);
545extern void blk_requeue_request(request_queue_t *, struct request *); 544extern void blk_requeue_request(request_queue_t *, struct request *);
546extern void blk_plug_device(request_queue_t *); 545extern void blk_plug_device(request_queue_t *);
547extern int blk_remove_plug(request_queue_t *); 546extern int blk_remove_plug(request_queue_t *);
548extern void blk_recount_segments(request_queue_t *, struct bio *); 547extern void blk_recount_segments(request_queue_t *, struct bio *);
549extern int blk_phys_contig_segment(request_queue_t *q, struct bio *, struct bio *);
550extern int blk_hw_contig_segment(request_queue_t *q, struct bio *, struct bio *);
551extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); 548extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *);
552extern void blk_start_queue(request_queue_t *q); 549extern void blk_start_queue(request_queue_t *q);
553extern void blk_stop_queue(request_queue_t *q); 550extern void blk_stop_queue(request_queue_t *q);
@@ -631,7 +628,6 @@ extern void blk_queue_dma_alignment(request_queue_t *, int);
631extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); 628extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
632extern void blk_queue_ordered(request_queue_t *, int); 629extern void blk_queue_ordered(request_queue_t *, int);
633extern void blk_queue_issue_flush_fn(request_queue_t *, issue_flush_fn *); 630extern void blk_queue_issue_flush_fn(request_queue_t *, issue_flush_fn *);
634extern int blkdev_scsi_issue_flush_fn(request_queue_t *, struct gendisk *, sector_t *);
635extern struct request *blk_start_pre_flush(request_queue_t *,struct request *); 631extern struct request *blk_start_pre_flush(request_queue_t *,struct request *);
636extern int blk_complete_barrier_rq(request_queue_t *, struct request *, int); 632extern int blk_complete_barrier_rq(request_queue_t *, struct request *, int);
637extern int blk_complete_barrier_rq_locked(request_queue_t *, struct request *, int); 633extern int blk_complete_barrier_rq_locked(request_queue_t *, struct request *, int);
@@ -675,8 +671,6 @@ extern int blkdev_issue_flush(struct block_device *, sector_t *);
675 671
676#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) 672#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist)
677 673
678extern void drive_stat_acct(struct request *, int, int);
679
680static inline int queue_hardsect_size(request_queue_t *q) 674static inline int queue_hardsect_size(request_queue_t *q)
681{ 675{
682 int retval = 512; 676 int retval = 512;
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 500f451ce0..82bd8842d1 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -22,6 +22,10 @@ extern unsigned long min_low_pfn;
22 */ 22 */
23extern unsigned long max_pfn; 23extern unsigned long max_pfn;
24 24
25#ifdef CONFIG_CRASH_DUMP
26extern unsigned long saved_max_pfn;
27#endif
28
25/* 29/*
26 * node_bootmem_map is a map pointer - the bits represent all physical 30 * node_bootmem_map is a map pointer - the bits represent all physical
27 * memory pages (including holes) on the node. 31 * memory pages (including holes) on the node.
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index fe0298e5da..e8904c0da6 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -69,6 +69,7 @@ extern struct semaphore cpucontrol;
69 register_cpu_notifier(&fn##_nb); \ 69 register_cpu_notifier(&fn##_nb); \
70} 70}
71int cpu_down(unsigned int cpu); 71int cpu_down(unsigned int cpu);
72extern int __attribute__((weak)) smp_prepare_cpu(int cpu);
72#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) 73#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
73#else 74#else
74#define lock_cpu_hotplug() do { } while (0) 75#define lock_cpu_hotplug() do { } while (0)
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
new file mode 100644
index 0000000000..534d750d92
--- /dev/null
+++ b/include/linux/crash_dump.h
@@ -0,0 +1,18 @@
1#ifndef LINUX_CRASH_DUMP_H
2#define LINUX_CRASH_DUMP_H
3
4#ifdef CONFIG_CRASH_DUMP
5#include <linux/kexec.h>
6#include <linux/smp_lock.h>
7#include <linux/device.h>
8#include <linux/proc_fs.h>
9
10#define ELFCORE_ADDR_MAX (-1ULL)
11extern unsigned long long elfcorehdr_addr;
12extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
13 unsigned long, int);
14extern struct file_operations proc_vmcore_operations;
15extern struct proc_dir_entry *proc_vmcore;
16
17#endif /* CONFIG_CRASH_DUMP */
18#endif /* LINUX_CRASHDUMP_H */
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index d2bcf55608..5e93e6dce9 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -9,6 +9,7 @@ enum dmi_field {
9 DMI_SYS_VENDOR, 9 DMI_SYS_VENDOR,
10 DMI_PRODUCT_NAME, 10 DMI_PRODUCT_NAME,
11 DMI_PRODUCT_VERSION, 11 DMI_PRODUCT_VERSION,
12 DMI_PRODUCT_SERIAL,
12 DMI_BOARD_VENDOR, 13 DMI_BOARD_VENDOR,
13 DMI_BOARD_NAME, 14 DMI_BOARD_NAME,
14 DMI_BOARD_VERSION, 15 DMI_BOARD_VERSION,
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 2a7e6c65c8..6bece9280e 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -28,6 +28,7 @@ static inline void *kmap(struct page *page)
28 28
29#define kmap_atomic(page, idx) page_address(page) 29#define kmap_atomic(page, idx) page_address(page)
30#define kunmap_atomic(addr, idx) do { } while (0) 30#define kunmap_atomic(addr, idx) do { } while (0)
31#define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn))
31#define kmap_atomic_to_page(ptr) virt_to_page(ptr) 32#define kmap_atomic_to_page(ptr) virt_to_page(ptr)
32 33
33#endif /* CONFIG_HIGHMEM */ 34#endif /* CONFIG_HIGHMEM */
diff --git a/include/linux/init.h b/include/linux/init.h
index 05c83e0521..59008c3826 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -229,6 +229,18 @@ void __init parse_early_param(void);
229#define __devexitdata __exitdata 229#define __devexitdata __exitdata
230#endif 230#endif
231 231
232#ifdef CONFIG_HOTPLUG_CPU
233#define __cpuinit
234#define __cpuinitdata
235#define __cpuexit
236#define __cpuexitdata
237#else
238#define __cpuinit __init
239#define __cpuinitdata __initdata
240#define __cpuexit __exit
241#define __cpuexitdata __exitdata
242#endif
243
232/* Functions marked as __devexit may be discarded at kernel link time, depending 244/* Functions marked as __devexit may be discarded at kernel link time, depending
233 on config options. Newer versions of binutils detect references from 245 on config options. Newer versions of binutils detect references from
234 retained sections to discarded sections and flag an error. Pointers to 246 retained sections to discarded sections and flag an error. Pointers to
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index a6a8c1a38d..03206a425d 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -108,7 +108,6 @@ extern struct group_info init_groups;
108 .blocked = {{0}}, \ 108 .blocked = {{0}}, \
109 .alloc_lock = SPIN_LOCK_UNLOCKED, \ 109 .alloc_lock = SPIN_LOCK_UNLOCKED, \
110 .proc_lock = SPIN_LOCK_UNLOCKED, \ 110 .proc_lock = SPIN_LOCK_UNLOCKED, \
111 .switch_lock = SPIN_LOCK_UNLOCKED, \
112 .journal_info = NULL, \ 111 .journal_info = NULL, \
113 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ 112 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
114} 113}
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index e25b97062c..687ba8c997 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -58,15 +58,23 @@ struct completion;
58 * be biten later when the calling function happens to sleep when it is not 58 * be biten later when the calling function happens to sleep when it is not
59 * supposed to. 59 * supposed to.
60 */ 60 */
61#ifdef CONFIG_PREEMPT_VOLUNTARY
62extern int cond_resched(void);
63# define might_resched() cond_resched()
64#else
65# define might_resched() do { } while (0)
66#endif
67
61#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP 68#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
62#define might_sleep() __might_sleep(__FILE__, __LINE__) 69 void __might_sleep(char *file, int line);
63#define might_sleep_if(cond) do { if (unlikely(cond)) might_sleep(); } while (0) 70# define might_sleep() \
64void __might_sleep(char *file, int line); 71 do { __might_sleep(__FILE__, __LINE__); might_resched(); } while (0)
65#else 72#else
66#define might_sleep() do {} while(0) 73# define might_sleep() do { might_resched(); } while (0)
67#define might_sleep_if(cond) do {} while (0)
68#endif 74#endif
69 75
76#define might_sleep_if(cond) do { if (unlikely(cond)) might_sleep(); } while (0)
77
70#define abs(x) ({ \ 78#define abs(x) ({ \
71 int __x = (x); \ 79 int __x = (x); \
72 (__x < 0) ? -__x : __x; \ 80 (__x < 0) ? -__x : __x; \
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
new file mode 100644
index 0000000000..c8468472ae
--- /dev/null
+++ b/include/linux/kexec.h
@@ -0,0 +1,135 @@
1#ifndef LINUX_KEXEC_H
2#define LINUX_KEXEC_H
3
4#ifdef CONFIG_KEXEC
5#include <linux/types.h>
6#include <linux/list.h>
7#include <linux/linkage.h>
8#include <linux/compat.h>
9#include <asm/kexec.h>
10
11/* Verify architecture specific macros are defined */
12
13#ifndef KEXEC_SOURCE_MEMORY_LIMIT
14#error KEXEC_SOURCE_MEMORY_LIMIT not defined
15#endif
16
17#ifndef KEXEC_DESTINATION_MEMORY_LIMIT
18#error KEXEC_DESTINATION_MEMORY_LIMIT not defined
19#endif
20
21#ifndef KEXEC_CONTROL_MEMORY_LIMIT
22#error KEXEC_CONTROL_MEMORY_LIMIT not defined
23#endif
24
25#ifndef KEXEC_CONTROL_CODE_SIZE
26#error KEXEC_CONTROL_CODE_SIZE not defined
27#endif
28
29#ifndef KEXEC_ARCH
30#error KEXEC_ARCH not defined
31#endif
32
33/*
34 * This structure is used to hold the arguments that are used when loading
35 * kernel binaries.
36 */
37
38typedef unsigned long kimage_entry_t;
39#define IND_DESTINATION 0x1
40#define IND_INDIRECTION 0x2
41#define IND_DONE 0x4
42#define IND_SOURCE 0x8
43
44#define KEXEC_SEGMENT_MAX 8
45struct kexec_segment {
46 void __user *buf;
47 size_t bufsz;
48 unsigned long mem; /* User space sees this as a (void *) ... */
49 size_t memsz;
50};
51
52#ifdef CONFIG_COMPAT
53struct compat_kexec_segment {
54 compat_uptr_t buf;
55 compat_size_t bufsz;
56 compat_ulong_t mem; /* User space sees this as a (void *) ... */
57 compat_size_t memsz;
58};
59#endif
60
61struct kimage {
62 kimage_entry_t head;
63 kimage_entry_t *entry;
64 kimage_entry_t *last_entry;
65
66 unsigned long destination;
67
68 unsigned long start;
69 struct page *control_code_page;
70
71 unsigned long nr_segments;
72 struct kexec_segment segment[KEXEC_SEGMENT_MAX];
73
74 struct list_head control_pages;
75 struct list_head dest_pages;
76 struct list_head unuseable_pages;
77
78 /* Address of next control page to allocate for crash kernels. */
79 unsigned long control_page;
80
81 /* Flags to indicate special processing */
82 unsigned int type : 1;
83#define KEXEC_TYPE_DEFAULT 0
84#define KEXEC_TYPE_CRASH 1
85};
86
87
88
89/* kexec interface functions */
90extern NORET_TYPE void machine_kexec(struct kimage *image) ATTRIB_NORET;
91extern int machine_kexec_prepare(struct kimage *image);
92extern void machine_kexec_cleanup(struct kimage *image);
93extern asmlinkage long sys_kexec_load(unsigned long entry,
94 unsigned long nr_segments,
95 struct kexec_segment __user *segments,
96 unsigned long flags);
97#ifdef CONFIG_COMPAT
98extern asmlinkage long compat_sys_kexec_load(unsigned long entry,
99 unsigned long nr_segments,
100 struct compat_kexec_segment __user *segments,
101 unsigned long flags);
102#endif
103extern struct page *kimage_alloc_control_pages(struct kimage *image,
104 unsigned int order);
105extern void crash_kexec(struct pt_regs *);
106int kexec_should_crash(struct task_struct *);
107extern struct kimage *kexec_image;
108
109#define KEXEC_ON_CRASH 0x00000001
110#define KEXEC_ARCH_MASK 0xffff0000
111
112/* These values match the ELF architecture values.
113 * Unless there is a good reason that should continue to be the case.
114 */
115#define KEXEC_ARCH_DEFAULT ( 0 << 16)
116#define KEXEC_ARCH_386 ( 3 << 16)
117#define KEXEC_ARCH_X86_64 (62 << 16)
118#define KEXEC_ARCH_PPC (20 << 16)
119#define KEXEC_ARCH_PPC64 (21 << 16)
120#define KEXEC_ARCH_IA_64 (50 << 16)
121#define KEXEC_ARCH_S390 (22 << 16)
122
123#define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */
124
125/* Location of a reserved region to hold the crash kernel.
126 */
127extern struct resource crashk_res;
128
129#else /* !CONFIG_KEXEC */
130struct pt_regs;
131struct task_struct;
132static inline void crash_kexec(struct pt_regs *regs) { }
133static inline int kexec_should_crash(struct task_struct *p) { return 0; }
134#endif /* CONFIG_KEXEC */
135#endif /* LINUX_KEXEC_H */
diff --git a/include/linux/list.h b/include/linux/list.h
index 399b51d172..aab2db21b0 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -185,7 +185,7 @@ static inline void list_del(struct list_head *entry)
185 * list_for_each_entry_rcu(). 185 * list_for_each_entry_rcu().
186 * 186 *
187 * Note that the caller is not permitted to immediately free 187 * Note that the caller is not permitted to immediately free
188 * the newly deleted entry. Instead, either synchronize_kernel() 188 * the newly deleted entry. Instead, either synchronize_rcu()
189 * or call_rcu() must be used to defer freeing until an RCU 189 * or call_rcu() must be used to defer freeing until an RCU
190 * grace period has elapsed. 190 * grace period has elapsed.
191 */ 191 */
diff --git a/include/linux/nvram.h b/include/linux/nvram.h
index b031e41b5e..9189829c13 100644
--- a/include/linux/nvram.h
+++ b/include/linux/nvram.h
@@ -20,8 +20,6 @@ extern void __nvram_write_byte(unsigned char c, int i);
20extern void nvram_write_byte(unsigned char c, int i); 20extern void nvram_write_byte(unsigned char c, int i);
21extern int __nvram_check_checksum(void); 21extern int __nvram_check_checksum(void);
22extern int nvram_check_checksum(void); 22extern int nvram_check_checksum(void);
23extern void __nvram_set_checksum(void);
24extern void nvram_set_checksum(void);
25#endif 23#endif
26 24
27#endif /* _LINUX_NVRAM_H */ 25#endif /* _LINUX_NVRAM_H */
diff --git a/include/linux/pm.h b/include/linux/pm.h
index ed2b76e751..14479325e3 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -103,7 +103,8 @@ extern int pm_active;
103/* 103/*
104 * Register a device with power management 104 * Register a device with power management
105 */ 105 */
106struct pm_dev __deprecated *pm_register(pm_dev_t type, unsigned long id, pm_callback callback); 106struct pm_dev __deprecated *
107pm_register(pm_dev_t type, unsigned long id, pm_callback callback);
107 108
108/* 109/*
109 * Unregister a device with power management 110 * Unregister a device with power management
@@ -190,17 +191,18 @@ typedef u32 __bitwise pm_message_t;
190/* 191/*
191 * There are 4 important states driver can be in: 192 * There are 4 important states driver can be in:
192 * ON -- driver is working 193 * ON -- driver is working
193 * FREEZE -- stop operations and apply whatever policy is applicable to a suspended driver 194 * FREEZE -- stop operations and apply whatever policy is applicable to a
194 * of that class, freeze queues for block like IDE does, drop packets for 195 * suspended driver of that class, freeze queues for block like IDE
195 * ethernet, etc... stop DMA engine too etc... so a consistent image can be 196 * does, drop packets for ethernet, etc... stop DMA engine too etc...
196 * saved; but do not power any hardware down. 197 * so a consistent image can be saved; but do not power any hardware
197 * SUSPEND - like FREEZE, but hardware is doing as much powersaving as possible. Roughly 198 * down.
198 * pci D3. 199 * SUSPEND - like FREEZE, but hardware is doing as much powersaving as
200 * possible. Roughly pci D3.
199 * 201 *
200 * Unfortunately, current drivers only recognize numeric values 0 (ON) and 3 (SUSPEND). 202 * Unfortunately, current drivers only recognize numeric values 0 (ON) and 3
201 * We'll need to fix the drivers. So yes, putting 3 to all diferent defines is intentional, 203 * (SUSPEND). We'll need to fix the drivers. So yes, putting 3 to all different
202 * and will go away as soon as drivers are fixed. Also note that typedef is neccessary, 204 * defines is intentional, and will go away as soon as drivers are fixed. Also
203 * we'll probably want to switch to 205 * note that typedef is neccessary, we'll probably want to switch to
204 * typedef struct pm_message_t { int event; int flags; } pm_message_t 206 * typedef struct pm_message_t { int event; int flags; } pm_message_t
205 * or something similar soon. 207 * or something similar soon.
206 */ 208 */
@@ -222,11 +224,18 @@ struct dev_pm_info {
222 224
223extern void device_pm_set_parent(struct device * dev, struct device * parent); 225extern void device_pm_set_parent(struct device * dev, struct device * parent);
224 226
225extern int device_suspend(pm_message_t state);
226extern int device_power_down(pm_message_t state); 227extern int device_power_down(pm_message_t state);
227extern void device_power_up(void); 228extern void device_power_up(void);
228extern void device_resume(void); 229extern void device_resume(void);
229 230
231#ifdef CONFIG_PM
232extern int device_suspend(pm_message_t state);
233#else
234static inline int device_suspend(pm_message_t state)
235{
236 return 0;
237}
238#endif
230 239
231#endif /* __KERNEL__ */ 240#endif /* __KERNEL__ */
232 241
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 59e505261f..0563581e3a 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -74,6 +74,13 @@ struct kcore_list {
74 size_t size; 74 size_t size;
75}; 75};
76 76
77struct vmcore {
78 struct list_head list;
79 unsigned long long paddr;
80 unsigned long size;
81 loff_t offset;
82};
83
77#ifdef CONFIG_PROC_FS 84#ifdef CONFIG_PROC_FS
78 85
79extern struct proc_dir_entry proc_root; 86extern struct proc_dir_entry proc_root;
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index d60fafc8bd..2d4dd23168 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -51,6 +51,10 @@ extern void machine_restart(char *cmd);
51extern void machine_halt(void); 51extern void machine_halt(void);
52extern void machine_power_off(void); 52extern void machine_power_off(void);
53 53
54extern void machine_shutdown(void);
55struct pt_regs;
56extern void machine_crash_shutdown(struct pt_regs *);
57
54#endif 58#endif
55 59
56#endif /* _LINUX_REBOOT_H */ 60#endif /* _LINUX_REBOOT_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 2c69682b04..9530b19031 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -368,6 +368,11 @@ struct signal_struct {
368#endif 368#endif
369}; 369};
370 370
371/* Context switch must be unlocked if interrupts are to be enabled */
372#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW
373# define __ARCH_WANT_UNLOCKED_CTXSW
374#endif
375
371/* 376/*
372 * Bits in flags field of signal_struct. 377 * Bits in flags field of signal_struct.
373 */ 378 */
@@ -460,10 +465,11 @@ enum idle_type
460#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ 465#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */
461#define SD_BALANCE_NEWIDLE 2 /* Balance when about to become idle */ 466#define SD_BALANCE_NEWIDLE 2 /* Balance when about to become idle */
462#define SD_BALANCE_EXEC 4 /* Balance on exec */ 467#define SD_BALANCE_EXEC 4 /* Balance on exec */
463#define SD_WAKE_IDLE 8 /* Wake to idle CPU on task wakeup */ 468#define SD_BALANCE_FORK 8 /* Balance on fork, clone */
464#define SD_WAKE_AFFINE 16 /* Wake task to waking CPU */ 469#define SD_WAKE_IDLE 16 /* Wake to idle CPU on task wakeup */
465#define SD_WAKE_BALANCE 32 /* Perform balancing at task wakeup */ 470#define SD_WAKE_AFFINE 32 /* Wake task to waking CPU */
466#define SD_SHARE_CPUPOWER 64 /* Domain members share cpu power */ 471#define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */
472#define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */
467 473
468struct sched_group { 474struct sched_group {
469 struct sched_group *next; /* Must be a circular list */ 475 struct sched_group *next; /* Must be a circular list */
@@ -488,6 +494,11 @@ struct sched_domain {
488 unsigned long long cache_hot_time; /* Task considered cache hot (ns) */ 494 unsigned long long cache_hot_time; /* Task considered cache hot (ns) */
489 unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */ 495 unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */
490 unsigned int per_cpu_gain; /* CPU % gained by adding domain cpus */ 496 unsigned int per_cpu_gain; /* CPU % gained by adding domain cpus */
497 unsigned int busy_idx;
498 unsigned int idle_idx;
499 unsigned int newidle_idx;
500 unsigned int wake_idx;
501 unsigned int forkexec_idx;
491 int flags; /* See SD_* */ 502 int flags; /* See SD_* */
492 503
493 /* Runtime fields. */ 504 /* Runtime fields. */
@@ -511,10 +522,16 @@ struct sched_domain {
511 unsigned long alb_failed; 522 unsigned long alb_failed;
512 unsigned long alb_pushed; 523 unsigned long alb_pushed;
513 524
514 /* sched_balance_exec() stats */ 525 /* SD_BALANCE_EXEC stats */
515 unsigned long sbe_attempts; 526 unsigned long sbe_cnt;
527 unsigned long sbe_balanced;
516 unsigned long sbe_pushed; 528 unsigned long sbe_pushed;
517 529
530 /* SD_BALANCE_FORK stats */
531 unsigned long sbf_cnt;
532 unsigned long sbf_balanced;
533 unsigned long sbf_pushed;
534
518 /* try_to_wake_up() stats */ 535 /* try_to_wake_up() stats */
519 unsigned long ttwu_wake_remote; 536 unsigned long ttwu_wake_remote;
520 unsigned long ttwu_move_affine; 537 unsigned long ttwu_move_affine;
@@ -522,6 +539,8 @@ struct sched_domain {
522#endif 539#endif
523}; 540};
524 541
542extern void partition_sched_domains(cpumask_t *partition1,
543 cpumask_t *partition2);
525#ifdef ARCH_HAS_SCHED_DOMAIN 544#ifdef ARCH_HAS_SCHED_DOMAIN
526/* Useful helpers that arch setup code may use. Defined in kernel/sched.c */ 545/* Useful helpers that arch setup code may use. Defined in kernel/sched.c */
527extern cpumask_t cpu_isolated_map; 546extern cpumask_t cpu_isolated_map;
@@ -582,6 +601,9 @@ struct task_struct {
582 601
583 int lock_depth; /* BKL lock depth */ 602 int lock_depth; /* BKL lock depth */
584 603
604#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)
605 int oncpu;
606#endif
585 int prio, static_prio; 607 int prio, static_prio;
586 struct list_head run_list; 608 struct list_head run_list;
587 prio_array_t *array; 609 prio_array_t *array;
@@ -704,8 +726,6 @@ struct task_struct {
704 spinlock_t alloc_lock; 726 spinlock_t alloc_lock;
705/* Protection of proc_dentry: nesting proc_lock, dcache_lock, write_lock_irq(&tasklist_lock); */ 727/* Protection of proc_dentry: nesting proc_lock, dcache_lock, write_lock_irq(&tasklist_lock); */
706 spinlock_t proc_lock; 728 spinlock_t proc_lock;
707/* context-switch lock */
708 spinlock_t switch_lock;
709 729
710/* journalling filesystem info */ 730/* journalling filesystem info */
711 void *journal_info; 731 void *journal_info;
@@ -912,7 +932,7 @@ extern void FASTCALL(wake_up_new_task(struct task_struct * tsk,
912#else 932#else
913 static inline void kick_process(struct task_struct *tsk) { } 933 static inline void kick_process(struct task_struct *tsk) { }
914#endif 934#endif
915extern void FASTCALL(sched_fork(task_t * p)); 935extern void FASTCALL(sched_fork(task_t * p, int clone_flags));
916extern void FASTCALL(sched_exit(task_t * p)); 936extern void FASTCALL(sched_exit(task_t * p));
917 937
918extern int in_group_p(gid_t); 938extern int in_group_p(gid_t);
@@ -1245,33 +1265,78 @@ extern void normalize_rt_tasks(void);
1245 1265
1246#endif 1266#endif
1247 1267
1248/* try_to_freeze
1249 *
1250 * Checks whether we need to enter the refrigerator
1251 * and returns 1 if we did so.
1252 */
1253#ifdef CONFIG_PM 1268#ifdef CONFIG_PM
1254extern void refrigerator(unsigned long); 1269/*
1270 * Check if a process has been frozen
1271 */
1272static inline int frozen(struct task_struct *p)
1273{
1274 return p->flags & PF_FROZEN;
1275}
1276
1277/*
1278 * Check if there is a request to freeze a process
1279 */
1280static inline int freezing(struct task_struct *p)
1281{
1282 return p->flags & PF_FREEZE;
1283}
1284
1285/*
1286 * Request that a process be frozen
1287 * FIXME: SMP problem. We may not modify other process' flags!
1288 */
1289static inline void freeze(struct task_struct *p)
1290{
1291 p->flags |= PF_FREEZE;
1292}
1293
1294/*
1295 * Wake up a frozen process
1296 */
1297static inline int thaw_process(struct task_struct *p)
1298{
1299 if (frozen(p)) {
1300 p->flags &= ~PF_FROZEN;
1301 wake_up_process(p);
1302 return 1;
1303 }
1304 return 0;
1305}
1306
1307/*
1308 * freezing is complete, mark process as frozen
1309 */
1310static inline void frozen_process(struct task_struct *p)
1311{
1312 p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN;
1313}
1314
1315extern void refrigerator(void);
1255extern int freeze_processes(void); 1316extern int freeze_processes(void);
1256extern void thaw_processes(void); 1317extern void thaw_processes(void);
1257 1318
1258static inline int try_to_freeze(unsigned long refrigerator_flags) 1319static inline int try_to_freeze(void)
1259{ 1320{
1260 if (unlikely(current->flags & PF_FREEZE)) { 1321 if (freezing(current)) {
1261 refrigerator(refrigerator_flags); 1322 refrigerator();
1262 return 1; 1323 return 1;
1263 } else 1324 } else
1264 return 0; 1325 return 0;
1265} 1326}
1266#else 1327#else
1267static inline void refrigerator(unsigned long flag) {} 1328static inline int frozen(struct task_struct *p) { return 0; }
1329static inline int freezing(struct task_struct *p) { return 0; }
1330static inline void freeze(struct task_struct *p) { BUG(); }
1331static inline int thaw_process(struct task_struct *p) { return 1; }
1332static inline void frozen_process(struct task_struct *p) { BUG(); }
1333
1334static inline void refrigerator(void) {}
1268static inline int freeze_processes(void) { BUG(); return 0; } 1335static inline int freeze_processes(void) { BUG(); return 0; }
1269static inline void thaw_processes(void) {} 1336static inline void thaw_processes(void) {}
1270 1337
1271static inline int try_to_freeze(unsigned long refrigerator_flags) 1338static inline int try_to_freeze(void) { return 0; }
1272{ 1339
1273 return 0;
1274}
1275#endif /* CONFIG_PM */ 1340#endif /* CONFIG_PM */
1276#endif /* __KERNEL__ */ 1341#endif /* __KERNEL__ */
1277 1342
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 2bf0d5fabc..f2e96fdfaa 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -58,7 +58,7 @@ static inline int software_suspend(void)
58} 58}
59#endif 59#endif
60 60
61#ifdef CONFIG_SMP 61#ifdef CONFIG_SUSPEND_SMP
62extern void disable_nonboot_cpus(void); 62extern void disable_nonboot_cpus(void);
63extern void enable_nonboot_cpus(void); 63extern void enable_nonboot_cpus(void);
64#else 64#else
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index c39f6f72cb..52830b6d94 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -159,8 +159,9 @@ asmlinkage long sys_shutdown(int, int);
159asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, 159asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd,
160 void __user *arg); 160 void __user *arg);
161asmlinkage long sys_restart_syscall(void); 161asmlinkage long sys_restart_syscall(void);
162asmlinkage long sys_kexec_load(void *entry, unsigned long nr_segments, 162asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
163 struct kexec_segment *segments, unsigned long flags); 163 struct kexec_segment __user *segments,
164 unsigned long flags);
164 165
165asmlinkage long sys_exit(int error_code); 166asmlinkage long sys_exit(int error_code);
166asmlinkage void sys_exit_group(int error_code); 167asmlinkage void sys_exit_group(int error_code);
diff --git a/include/linux/topology.h b/include/linux/topology.h
index d70e8972c6..0320225e96 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -89,6 +89,11 @@
89 .cache_hot_time = 0, \ 89 .cache_hot_time = 0, \
90 .cache_nice_tries = 0, \ 90 .cache_nice_tries = 0, \
91 .per_cpu_gain = 25, \ 91 .per_cpu_gain = 25, \
92 .busy_idx = 0, \
93 .idle_idx = 0, \
94 .newidle_idx = 1, \
95 .wake_idx = 0, \
96 .forkexec_idx = 0, \
92 .flags = SD_LOAD_BALANCE \ 97 .flags = SD_LOAD_BALANCE \
93 | SD_BALANCE_NEWIDLE \ 98 | SD_BALANCE_NEWIDLE \
94 | SD_BALANCE_EXEC \ 99 | SD_BALANCE_EXEC \
@@ -115,12 +120,15 @@
115 .cache_hot_time = (5*1000000/2), \ 120 .cache_hot_time = (5*1000000/2), \
116 .cache_nice_tries = 1, \ 121 .cache_nice_tries = 1, \
117 .per_cpu_gain = 100, \ 122 .per_cpu_gain = 100, \
123 .busy_idx = 2, \
124 .idle_idx = 1, \
125 .newidle_idx = 2, \
126 .wake_idx = 1, \
127 .forkexec_idx = 1, \
118 .flags = SD_LOAD_BALANCE \ 128 .flags = SD_LOAD_BALANCE \
119 | SD_BALANCE_NEWIDLE \ 129 | SD_BALANCE_NEWIDLE \
120 | SD_BALANCE_EXEC \ 130 | SD_BALANCE_EXEC \
121 | SD_WAKE_AFFINE \ 131 | SD_WAKE_AFFINE, \
122 | SD_WAKE_IDLE \
123 | SD_WAKE_BALANCE, \
124 .last_balance = jiffies, \ 132 .last_balance = jiffies, \
125 .balance_interval = 1, \ 133 .balance_interval = 1, \
126 .nr_balance_failed = 0, \ 134 .nr_balance_failed = 0, \