aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-i386
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-07-03 10:25:08 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-07-03 10:25:08 -0400
commit0a1340c185734a57fbf4775927966ad4a1347b02 (patch)
treed9ed8f0dd809a7c542a3356601125ea5b5aaa804 /include/asm-i386
parentaf18ddb8864b096e3ed4732e2d4b21c956dcfe3a (diff)
parent29454dde27d8e340bb1987bad9aa504af7081eba (diff)
Merge rsync://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: include/linux/kernel.h
Diffstat (limited to 'include/asm-i386')
-rw-r--r--include/asm-i386/alternative.h12
-rw-r--r--include/asm-i386/apic.h15
-rw-r--r--include/asm-i386/apicdef.h1
-rw-r--r--include/asm-i386/atomic.h1
-rw-r--r--include/asm-i386/bitops.h1
-rw-r--r--include/asm-i386/bug.h1
-rw-r--r--include/asm-i386/bugs.h1
-rw-r--r--include/asm-i386/byteorder.h1
-rw-r--r--include/asm-i386/cache.h1
-rw-r--r--include/asm-i386/cpu.h2
-rw-r--r--include/asm-i386/cpufeature.h13
-rw-r--r--include/asm-i386/delay.h2
-rw-r--r--include/asm-i386/dma.h1
-rw-r--r--include/asm-i386/dwarf2.h54
-rw-r--r--include/asm-i386/elf.h53
-rw-r--r--include/asm-i386/fixmap.h11
-rw-r--r--include/asm-i386/floppy.h7
-rw-r--r--include/asm-i386/hardirq.h1
-rw-r--r--include/asm-i386/highmem.h1
-rw-r--r--include/asm-i386/hpet.h1
-rw-r--r--include/asm-i386/hw_irq.h13
-rw-r--r--include/asm-i386/ide.h1
-rw-r--r--include/asm-i386/intel_arch_perfmon.h19
-rw-r--r--include/asm-i386/io.h1
-rw-r--r--include/asm-i386/io_apic.h1
-rw-r--r--include/asm-i386/irq.h1
-rw-r--r--include/asm-i386/k8.h1
-rw-r--r--include/asm-i386/kdebug.h2
-rw-r--r--include/asm-i386/kmap_types.h1
-rw-r--r--include/asm-i386/kprobes.h1
-rw-r--r--include/asm-i386/local.h26
-rw-r--r--include/asm-i386/mach-default/mach_ipi.h7
-rw-r--r--include/asm-i386/mach-default/mach_timer.h4
-rw-r--r--include/asm-i386/mach-default/setup_arch.h (renamed from include/asm-i386/mach-default/setup_arch_pre.h)0
-rw-r--r--include/asm-i386/mach-default/setup_arch_post.h40
-rw-r--r--include/asm-i386/mach-summit/mach_apic.h1
-rw-r--r--include/asm-i386/mach-summit/mach_mpparse.h3
-rw-r--r--include/asm-i386/mach-visws/setup_arch.h (renamed from include/asm-i386/mach-visws/setup_arch_pre.h)3
-rw-r--r--include/asm-i386/mach-visws/setup_arch_post.h49
-rw-r--r--include/asm-i386/mach-voyager/setup_arch.h (renamed from include/asm-i386/mach-voyager/setup_arch_pre.h)2
-rw-r--r--include/asm-i386/mach-voyager/setup_arch_post.h73
-rw-r--r--include/asm-i386/mce.h5
-rw-r--r--include/asm-i386/mmu.h1
-rw-r--r--include/asm-i386/mmu_context.h1
-rw-r--r--include/asm-i386/msi.h10
-rw-r--r--include/asm-i386/mtrr.h5
-rw-r--r--include/asm-i386/nmi.h28
-rw-r--r--include/asm-i386/node.h29
-rw-r--r--include/asm-i386/page.h8
-rw-r--r--include/asm-i386/param.h1
-rw-r--r--include/asm-i386/pci.h1
-rw-r--r--include/asm-i386/pgalloc.h1
-rw-r--r--include/asm-i386/pgtable.h1
-rw-r--r--include/asm-i386/processor.h26
-rw-r--r--include/asm-i386/serial.h1
-rw-r--r--include/asm-i386/setup.h15
-rw-r--r--include/asm-i386/signal.h2
-rw-r--r--include/asm-i386/smp.h1
-rw-r--r--include/asm-i386/socket.h1
-rw-r--r--include/asm-i386/spinlock.h1
-rw-r--r--include/asm-i386/string.h1
-rw-r--r--include/asm-i386/system.h3
-rw-r--r--include/asm-i386/thread_info.h19
-rw-r--r--include/asm-i386/timer.h57
-rw-r--r--include/asm-i386/timex.h35
-rw-r--r--include/asm-i386/tlbflush.h1
-rw-r--r--include/asm-i386/topology.h11
-rw-r--r--include/asm-i386/tsc.h49
-rw-r--r--include/asm-i386/types.h1
-rw-r--r--include/asm-i386/uaccess.h70
-rw-r--r--include/asm-i386/unistd.h10
-rw-r--r--include/asm-i386/unwind.h98
-rw-r--r--include/asm-i386/vga.h2
73 files changed, 490 insertions, 434 deletions
diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h
index e201decea0c9..96adbabec740 100644
--- a/include/asm-i386/alternative.h
+++ b/include/asm-i386/alternative.h
@@ -3,6 +3,10 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <asm/types.h>
7
8#include <linux/types.h>
9
6struct alt_instr { 10struct alt_instr {
7 u8 *instr; /* original instruction */ 11 u8 *instr; /* original instruction */
8 u8 *replacement; 12 u8 *replacement;
@@ -15,11 +19,19 @@ struct alt_instr {
15extern void apply_alternatives(struct alt_instr *start, struct alt_instr *end); 19extern void apply_alternatives(struct alt_instr *start, struct alt_instr *end);
16 20
17struct module; 21struct module;
22#ifdef CONFIG_SMP
18extern void alternatives_smp_module_add(struct module *mod, char *name, 23extern void alternatives_smp_module_add(struct module *mod, char *name,
19 void *locks, void *locks_end, 24 void *locks, void *locks_end,
20 void *text, void *text_end); 25 void *text, void *text_end);
21extern void alternatives_smp_module_del(struct module *mod); 26extern void alternatives_smp_module_del(struct module *mod);
22extern void alternatives_smp_switch(int smp); 27extern void alternatives_smp_switch(int smp);
28#else
29static inline void alternatives_smp_module_add(struct module *mod, char *name,
30 void *locks, void *locks_end,
31 void *text, void *text_end) {}
32static inline void alternatives_smp_module_del(struct module *mod) {}
33static inline void alternatives_smp_switch(int smp) {}
34#endif
23 35
24#endif 36#endif
25 37
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h
index 288233fd77d7..2c1e371cebb6 100644
--- a/include/asm-i386/apic.h
+++ b/include/asm-i386/apic.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_APIC_H 1#ifndef __ASM_APIC_H
2#define __ASM_APIC_H 2#define __ASM_APIC_H
3 3
4#include <linux/config.h>
5#include <linux/pm.h> 4#include <linux/pm.h>
6#include <asm/fixmap.h> 5#include <asm/fixmap.h>
7#include <asm/apicdef.h> 6#include <asm/apicdef.h>
@@ -112,24 +111,12 @@ extern void init_apic_mappings (void);
112extern void smp_local_timer_interrupt (struct pt_regs * regs); 111extern void smp_local_timer_interrupt (struct pt_regs * regs);
113extern void setup_boot_APIC_clock (void); 112extern void setup_boot_APIC_clock (void);
114extern void setup_secondary_APIC_clock (void); 113extern void setup_secondary_APIC_clock (void);
115extern void setup_apic_nmi_watchdog (void);
116extern int reserve_lapic_nmi(void);
117extern void release_lapic_nmi(void);
118extern void disable_timer_nmi_watchdog(void);
119extern void enable_timer_nmi_watchdog(void);
120extern void nmi_watchdog_tick (struct pt_regs * regs);
121extern int APIC_init_uniprocessor (void); 114extern int APIC_init_uniprocessor (void);
122extern void disable_APIC_timer(void); 115extern void disable_APIC_timer(void);
123extern void enable_APIC_timer(void); 116extern void enable_APIC_timer(void);
124 117
125extern void enable_NMI_through_LVT0 (void * dummy); 118extern void enable_NMI_through_LVT0 (void * dummy);
126 119
127extern unsigned int nmi_watchdog;
128#define NMI_NONE 0
129#define NMI_IO_APIC 1
130#define NMI_LOCAL_APIC 2
131#define NMI_INVALID 3
132
133extern int disable_timer_pin_1; 120extern int disable_timer_pin_1;
134 121
135void smp_send_timer_broadcast_ipi(struct pt_regs *regs); 122void smp_send_timer_broadcast_ipi(struct pt_regs *regs);
@@ -139,8 +126,6 @@ void switch_ipi_to_APIC_timer(void *cpumask);
139 126
140extern int timer_over_8254; 127extern int timer_over_8254;
141 128
142extern int modern_apic(void);
143
144#else /* !CONFIG_X86_LOCAL_APIC */ 129#else /* !CONFIG_X86_LOCAL_APIC */
145static inline void lapic_shutdown(void) { } 130static inline void lapic_shutdown(void) { }
146 131
diff --git a/include/asm-i386/apicdef.h b/include/asm-i386/apicdef.h
index 5e4a35af2921..9f6995341fdc 100644
--- a/include/asm-i386/apicdef.h
+++ b/include/asm-i386/apicdef.h
@@ -121,7 +121,6 @@
121 */ 121 */
122#define u32 unsigned int 122#define u32 unsigned int
123 123
124#define lapic ((volatile struct local_apic *)APIC_BASE)
125 124
126struct local_apic { 125struct local_apic {
127 126
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h
index 4ddce5296a78..4f061fa73794 100644
--- a/include/asm-i386/atomic.h
+++ b/include/asm-i386/atomic.h
@@ -1,7 +1,6 @@
1#ifndef __ARCH_I386_ATOMIC__ 1#ifndef __ARCH_I386_ATOMIC__
2#define __ARCH_I386_ATOMIC__ 2#define __ARCH_I386_ATOMIC__
3 3
4#include <linux/config.h>
5#include <linux/compiler.h> 4#include <linux/compiler.h>
6#include <asm/processor.h> 5#include <asm/processor.h>
7 6
diff --git a/include/asm-i386/bitops.h b/include/asm-i386/bitops.h
index 08deaeee6be9..1c780fa1e762 100644
--- a/include/asm-i386/bitops.h
+++ b/include/asm-i386/bitops.h
@@ -5,7 +5,6 @@
5 * Copyright 1992, Linus Torvalds. 5 * Copyright 1992, Linus Torvalds.
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/compiler.h> 8#include <linux/compiler.h>
10#include <asm/alternative.h> 9#include <asm/alternative.h>
11 10
diff --git a/include/asm-i386/bug.h b/include/asm-i386/bug.h
index 8f79de19eb94..8062cdbf2587 100644
--- a/include/asm-i386/bug.h
+++ b/include/asm-i386/bug.h
@@ -1,7 +1,6 @@
1#ifndef _I386_BUG_H 1#ifndef _I386_BUG_H
2#define _I386_BUG_H 2#define _I386_BUG_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * Tell the user there is some problem. 6 * Tell the user there is some problem.
diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h
index 50233e0345fb..2a9e4ee5904d 100644
--- a/include/asm-i386/bugs.h
+++ b/include/asm-i386/bugs.h
@@ -17,7 +17,6 @@
17 * void check_bugs(void); 17 * void check_bugs(void);
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <asm/processor.h> 21#include <asm/processor.h>
23#include <asm/i387.h> 22#include <asm/i387.h>
diff --git a/include/asm-i386/byteorder.h b/include/asm-i386/byteorder.h
index a0d73f48d5be..a45470a8b74a 100644
--- a/include/asm-i386/byteorder.h
+++ b/include/asm-i386/byteorder.h
@@ -8,7 +8,6 @@
8 8
9/* For avoiding bswap on i386 */ 9/* For avoiding bswap on i386 */
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11#include <linux/config.h>
12#endif 11#endif
13 12
14static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x) 13static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
diff --git a/include/asm-i386/cache.h b/include/asm-i386/cache.h
index ca15c9c665cf..57c62f414158 100644
--- a/include/asm-i386/cache.h
+++ b/include/asm-i386/cache.h
@@ -4,7 +4,6 @@
4#ifndef __ARCH_I386_CACHE_H 4#ifndef __ARCH_I386_CACHE_H
5#define __ARCH_I386_CACHE_H 5#define __ARCH_I386_CACHE_H
6 6
7#include <linux/config.h>
8 7
9/* L1 cache line size */ 8/* L1 cache line size */
10#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) 9#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
diff --git a/include/asm-i386/cpu.h b/include/asm-i386/cpu.h
index e7252c216ca8..b1bc7b1b64b0 100644
--- a/include/asm-i386/cpu.h
+++ b/include/asm-i386/cpu.h
@@ -7,8 +7,6 @@
7#include <linux/nodemask.h> 7#include <linux/nodemask.h>
8#include <linux/percpu.h> 8#include <linux/percpu.h>
9 9
10#include <asm/node.h>
11
12struct i386_cpu { 10struct i386_cpu {
13 struct cpu cpu; 11 struct cpu cpu;
14}; 12};
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h
index b44bfc6239cb..d314ebb3d59e 100644
--- a/include/asm-i386/cpufeature.h
+++ b/include/asm-i386/cpufeature.h
@@ -72,6 +72,7 @@
72#define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */ 72#define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */
73#define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */ 73#define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */
74#define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* FXSAVE leaks FOP/FIP/FOP */ 74#define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* FXSAVE leaks FOP/FIP/FOP */
75#define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */
75 76
76/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ 77/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
77#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ 78#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */
@@ -88,6 +89,12 @@
88#define X86_FEATURE_XSTORE_EN (5*32+ 3) /* on-CPU RNG enabled */ 89#define X86_FEATURE_XSTORE_EN (5*32+ 3) /* on-CPU RNG enabled */
89#define X86_FEATURE_XCRYPT (5*32+ 6) /* on-CPU crypto (xcrypt insn) */ 90#define X86_FEATURE_XCRYPT (5*32+ 6) /* on-CPU crypto (xcrypt insn) */
90#define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* on-CPU crypto enabled */ 91#define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* on-CPU crypto enabled */
92#define X86_FEATURE_ACE2 (5*32+ 8) /* Advanced Cryptography Engine v2 */
93#define X86_FEATURE_ACE2_EN (5*32+ 9) /* ACE v2 enabled */
94#define X86_FEATURE_PHE (5*32+ 10) /* PadLock Hash Engine */
95#define X86_FEATURE_PHE_EN (5*32+ 11) /* PHE enabled */
96#define X86_FEATURE_PMM (5*32+ 12) /* PadLock Montgomery Multiplier */
97#define X86_FEATURE_PMM_EN (5*32+ 13) /* PMM enabled */
91 98
92/* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */ 99/* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */
93#define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */ 100#define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */
@@ -121,6 +128,12 @@
121#define cpu_has_xstore_enabled boot_cpu_has(X86_FEATURE_XSTORE_EN) 128#define cpu_has_xstore_enabled boot_cpu_has(X86_FEATURE_XSTORE_EN)
122#define cpu_has_xcrypt boot_cpu_has(X86_FEATURE_XCRYPT) 129#define cpu_has_xcrypt boot_cpu_has(X86_FEATURE_XCRYPT)
123#define cpu_has_xcrypt_enabled boot_cpu_has(X86_FEATURE_XCRYPT_EN) 130#define cpu_has_xcrypt_enabled boot_cpu_has(X86_FEATURE_XCRYPT_EN)
131#define cpu_has_ace2 boot_cpu_has(X86_FEATURE_ACE2)
132#define cpu_has_ace2_enabled boot_cpu_has(X86_FEATURE_ACE2_EN)
133#define cpu_has_phe boot_cpu_has(X86_FEATURE_PHE)
134#define cpu_has_phe_enabled boot_cpu_has(X86_FEATURE_PHE_EN)
135#define cpu_has_pmm boot_cpu_has(X86_FEATURE_PMM)
136#define cpu_has_pmm_enabled boot_cpu_has(X86_FEATURE_PMM_EN)
124 137
125#endif /* __ASM_I386_CPUFEATURE_H */ 138#endif /* __ASM_I386_CPUFEATURE_H */
126 139
diff --git a/include/asm-i386/delay.h b/include/asm-i386/delay.h
index 456db8501c09..b1c7650dc7b9 100644
--- a/include/asm-i386/delay.h
+++ b/include/asm-i386/delay.h
@@ -23,4 +23,6 @@ extern void __delay(unsigned long loops);
23 ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \ 23 ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
24 __ndelay(n)) 24 __ndelay(n))
25 25
26void use_tsc_delay(void);
27
26#endif /* defined(_I386_DELAY_H) */ 28#endif /* defined(_I386_DELAY_H) */
diff --git a/include/asm-i386/dma.h b/include/asm-i386/dma.h
index f24b2bba2831..d23aac8e1a50 100644
--- a/include/asm-i386/dma.h
+++ b/include/asm-i386/dma.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_DMA_H 8#ifndef _ASM_DMA_H
9#define _ASM_DMA_H 9#define _ASM_DMA_H
10 10
11#include <linux/config.h>
12#include <linux/spinlock.h> /* And spinlocks */ 11#include <linux/spinlock.h> /* And spinlocks */
13#include <asm/io.h> /* need byte IO */ 12#include <asm/io.h> /* need byte IO */
14#include <linux/delay.h> 13#include <linux/delay.h>
diff --git a/include/asm-i386/dwarf2.h b/include/asm-i386/dwarf2.h
new file mode 100644
index 000000000000..2280f6272f80
--- /dev/null
+++ b/include/asm-i386/dwarf2.h
@@ -0,0 +1,54 @@
1#ifndef _DWARF2_H
2#define _DWARF2_H
3
4#include <linux/config.h>
5
6#ifndef __ASSEMBLY__
7#warning "asm/dwarf2.h should be only included in pure assembly files"
8#endif
9
10/*
11 Macros for dwarf2 CFI unwind table entries.
12 See "as.info" for details on these pseudo ops. Unfortunately
13 they are only supported in very new binutils, so define them
14 away for older version.
15 */
16
17#ifdef CONFIG_UNWIND_INFO
18
19#define CFI_STARTPROC .cfi_startproc
20#define CFI_ENDPROC .cfi_endproc
21#define CFI_DEF_CFA .cfi_def_cfa
22#define CFI_DEF_CFA_REGISTER .cfi_def_cfa_register
23#define CFI_DEF_CFA_OFFSET .cfi_def_cfa_offset
24#define CFI_ADJUST_CFA_OFFSET .cfi_adjust_cfa_offset
25#define CFI_OFFSET .cfi_offset
26#define CFI_REL_OFFSET .cfi_rel_offset
27#define CFI_REGISTER .cfi_register
28#define CFI_RESTORE .cfi_restore
29#define CFI_REMEMBER_STATE .cfi_remember_state
30#define CFI_RESTORE_STATE .cfi_restore_state
31
32#else
33
34/* Due to the structure of pre-exisiting code, don't use assembler line
35 comment character # to ignore the arguments. Instead, use a dummy macro. */
36.macro ignore a=0, b=0, c=0, d=0
37.endm
38
39#define CFI_STARTPROC ignore
40#define CFI_ENDPROC ignore
41#define CFI_DEF_CFA ignore
42#define CFI_DEF_CFA_REGISTER ignore
43#define CFI_DEF_CFA_OFFSET ignore
44#define CFI_ADJUST_CFA_OFFSET ignore
45#define CFI_OFFSET ignore
46#define CFI_REL_OFFSET ignore
47#define CFI_REGISTER ignore
48#define CFI_RESTORE ignore
49#define CFI_REMEMBER_STATE ignore
50#define CFI_RESTORE_STATE ignore
51
52#endif
53
54#endif
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index 4153d80e4d2b..1eac92cb5b16 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -10,6 +10,7 @@
10#include <asm/processor.h> 10#include <asm/processor.h>
11#include <asm/system.h> /* for savesegment */ 11#include <asm/system.h> /* for savesegment */
12#include <asm/auxvec.h> 12#include <asm/auxvec.h>
13#include <asm/desc.h>
13 14
14#include <linux/utsname.h> 15#include <linux/utsname.h>
15 16
@@ -129,15 +130,41 @@ extern int dump_task_extended_fpu (struct task_struct *, struct user_fxsr_struct
129#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) 130#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
130#define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs) 131#define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs)
131 132
132#define VSYSCALL_BASE (__fix_to_virt(FIX_VSYSCALL)) 133#define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO))
133#define VSYSCALL_EHDR ((const struct elfhdr *) VSYSCALL_BASE) 134#define VDSO_BASE ((unsigned long)current->mm->context.vdso)
134#define VSYSCALL_ENTRY ((unsigned long) &__kernel_vsyscall) 135
136#ifdef CONFIG_COMPAT_VDSO
137# define VDSO_COMPAT_BASE VDSO_HIGH_BASE
138# define VDSO_PRELINK VDSO_HIGH_BASE
139#else
140# define VDSO_COMPAT_BASE VDSO_BASE
141# define VDSO_PRELINK 0
142#endif
143
144#define VDSO_COMPAT_SYM(x) \
145 (VDSO_COMPAT_BASE + (unsigned long)(x) - VDSO_PRELINK)
146
147#define VDSO_SYM(x) \
148 (VDSO_BASE + (unsigned long)(x) - VDSO_PRELINK)
149
150#define VDSO_HIGH_EHDR ((const struct elfhdr *) VDSO_HIGH_BASE)
151#define VDSO_EHDR ((const struct elfhdr *) VDSO_COMPAT_BASE)
152
135extern void __kernel_vsyscall; 153extern void __kernel_vsyscall;
136 154
155#define VDSO_ENTRY VDSO_SYM(&__kernel_vsyscall)
156
157#define ARCH_HAS_SETUP_ADDITIONAL_PAGES
158struct linux_binprm;
159extern int arch_setup_additional_pages(struct linux_binprm *bprm,
160 int executable_stack);
161
162extern unsigned int vdso_enabled;
163
137#define ARCH_DLINFO \ 164#define ARCH_DLINFO \
138do { \ 165do if (vdso_enabled) { \
139 NEW_AUX_ENT(AT_SYSINFO, VSYSCALL_ENTRY); \ 166 NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \
140 NEW_AUX_ENT(AT_SYSINFO_EHDR, VSYSCALL_BASE); \ 167 NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_COMPAT_BASE); \
141} while (0) 168} while (0)
142 169
143/* 170/*
@@ -148,15 +175,15 @@ do { \
148 * Dumping its extra ELF program headers includes all the other information 175 * Dumping its extra ELF program headers includes all the other information
149 * a debugger needs to easily find how the vsyscall DSO was being used. 176 * a debugger needs to easily find how the vsyscall DSO was being used.
150 */ 177 */
151#define ELF_CORE_EXTRA_PHDRS (VSYSCALL_EHDR->e_phnum) 178#define ELF_CORE_EXTRA_PHDRS (VDSO_HIGH_EHDR->e_phnum)
152#define ELF_CORE_WRITE_EXTRA_PHDRS \ 179#define ELF_CORE_WRITE_EXTRA_PHDRS \
153do { \ 180do { \
154 const struct elf_phdr *const vsyscall_phdrs = \ 181 const struct elf_phdr *const vsyscall_phdrs = \
155 (const struct elf_phdr *) (VSYSCALL_BASE \ 182 (const struct elf_phdr *) (VDSO_HIGH_BASE \
156 + VSYSCALL_EHDR->e_phoff); \ 183 + VDSO_HIGH_EHDR->e_phoff); \
157 int i; \ 184 int i; \
158 Elf32_Off ofs = 0; \ 185 Elf32_Off ofs = 0; \
159 for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \ 186 for (i = 0; i < VDSO_HIGH_EHDR->e_phnum; ++i) { \
160 struct elf_phdr phdr = vsyscall_phdrs[i]; \ 187 struct elf_phdr phdr = vsyscall_phdrs[i]; \
161 if (phdr.p_type == PT_LOAD) { \ 188 if (phdr.p_type == PT_LOAD) { \
162 BUG_ON(ofs != 0); \ 189 BUG_ON(ofs != 0); \
@@ -174,10 +201,10 @@ do { \
174#define ELF_CORE_WRITE_EXTRA_DATA \ 201#define ELF_CORE_WRITE_EXTRA_DATA \
175do { \ 202do { \
176 const struct elf_phdr *const vsyscall_phdrs = \ 203 const struct elf_phdr *const vsyscall_phdrs = \
177 (const struct elf_phdr *) (VSYSCALL_BASE \ 204 (const struct elf_phdr *) (VDSO_HIGH_BASE \
178 + VSYSCALL_EHDR->e_phoff); \ 205 + VDSO_HIGH_EHDR->e_phoff); \
179 int i; \ 206 int i; \
180 for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \ 207 for (i = 0; i < VDSO_HIGH_EHDR->e_phnum; ++i) { \
181 if (vsyscall_phdrs[i].p_type == PT_LOAD) \ 208 if (vsyscall_phdrs[i].p_type == PT_LOAD) \
182 DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \ 209 DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \
183 PAGE_ALIGN(vsyscall_phdrs[i].p_memsz)); \ 210 PAGE_ALIGN(vsyscall_phdrs[i].p_memsz)); \
diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h
index cfb1c61d3b9c..a48cc3f7ccc6 100644
--- a/include/asm-i386/fixmap.h
+++ b/include/asm-i386/fixmap.h
@@ -13,7 +13,6 @@
13#ifndef _ASM_FIXMAP_H 13#ifndef _ASM_FIXMAP_H
14#define _ASM_FIXMAP_H 14#define _ASM_FIXMAP_H
15 15
16#include <linux/config.h>
17 16
18/* used by vmalloc.c, vsyscall.lds.S. 17/* used by vmalloc.c, vsyscall.lds.S.
19 * 18 *
@@ -52,7 +51,7 @@
52 */ 51 */
53enum fixed_addresses { 52enum fixed_addresses {
54 FIX_HOLE, 53 FIX_HOLE,
55 FIX_VSYSCALL, 54 FIX_VDSO,
56#ifdef CONFIG_X86_LOCAL_APIC 55#ifdef CONFIG_X86_LOCAL_APIC
57 FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ 56 FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */
58#endif 57#endif
@@ -116,14 +115,6 @@ extern void __set_fixmap (enum fixed_addresses idx,
116#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) 115#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
117#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) 116#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
118 117
119/*
120 * This is the range that is readable by user mode, and things
121 * acting like user mode such as get_user_pages.
122 */
123#define FIXADDR_USER_START (__fix_to_virt(FIX_VSYSCALL))
124#define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE)
125
126
127extern void __this_fixmap_does_not_exist(void); 118extern void __this_fixmap_does_not_exist(void);
128 119
129/* 120/*
diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h
index 03403045c182..359ead60b718 100644
--- a/include/asm-i386/floppy.h
+++ b/include/asm-i386/floppy.h
@@ -144,12 +144,11 @@ static int vdma_get_dma_residue(unsigned int dummy)
144static int fd_request_irq(void) 144static int fd_request_irq(void)
145{ 145{
146 if(can_use_virtual_dma) 146 if(can_use_virtual_dma)
147 return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, 147 return request_irq(FLOPPY_IRQ, floppy_hardint,
148 "floppy", NULL); 148 IRQF_DISABLED, "floppy", NULL);
149 else 149 else
150 return request_irq(FLOPPY_IRQ, floppy_interrupt, 150 return request_irq(FLOPPY_IRQ, floppy_interrupt,
151 SA_INTERRUPT|SA_SAMPLE_RANDOM, 151 IRQF_DISABLED, "floppy", NULL);
152 "floppy", NULL);
153 152
154} 153}
155 154
diff --git a/include/asm-i386/hardirq.h b/include/asm-i386/hardirq.h
index ee754d359734..0e358dc405f8 100644
--- a/include/asm-i386/hardirq.h
+++ b/include/asm-i386/hardirq.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_HARDIRQ_H 1#ifndef __ASM_HARDIRQ_H
2#define __ASM_HARDIRQ_H 2#define __ASM_HARDIRQ_H
3 3
4#include <linux/config.h>
5#include <linux/threads.h> 4#include <linux/threads.h>
6#include <linux/irq.h> 5#include <linux/irq.h>
7 6
diff --git a/include/asm-i386/highmem.h b/include/asm-i386/highmem.h
index 0fd331306b60..e9a34ebc25d5 100644
--- a/include/asm-i386/highmem.h
+++ b/include/asm-i386/highmem.h
@@ -20,7 +20,6 @@
20 20
21#ifdef __KERNEL__ 21#ifdef __KERNEL__
22 22
23#include <linux/config.h>
24#include <linux/interrupt.h> 23#include <linux/interrupt.h>
25#include <linux/threads.h> 24#include <linux/threads.h>
26#include <asm/kmap_types.h> 25#include <asm/kmap_types.h>
diff --git a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h
index 7f1a8a6ee32f..af5d435519d1 100644
--- a/include/asm-i386/hpet.h
+++ b/include/asm-i386/hpet.h
@@ -27,7 +27,6 @@
27#include <asm/processor.h> 27#include <asm/processor.h>
28 28
29#include <linux/timex.h> 29#include <linux/timex.h>
30#include <linux/config.h>
31 30
32#include <asm/fixmap.h> 31#include <asm/fixmap.h>
33 32
diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h
index 622815bf3243..87e5a351d881 100644
--- a/include/asm-i386/hw_irq.h
+++ b/include/asm-i386/hw_irq.h
@@ -12,7 +12,6 @@
12 * <tomsoft@informatik.tu-chemnitz.de> 12 * <tomsoft@informatik.tu-chemnitz.de>
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/profile.h> 15#include <linux/profile.h>
17#include <asm/atomic.h> 16#include <asm/atomic.h>
18#include <asm/irq.h> 17#include <asm/irq.h>
@@ -20,6 +19,8 @@
20 19
21struct hw_interrupt_type; 20struct hw_interrupt_type;
22 21
22#define NMI_VECTOR 0x02
23
23/* 24/*
24 * Various low-level irq details needed by irq.c, process.c, 25 * Various low-level irq details needed by irq.c, process.c,
25 * time.c, io_apic.c and smp.c 26 * time.c, io_apic.c and smp.c
@@ -68,14 +69,4 @@ extern atomic_t irq_mis_count;
68 69
69#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs)) 70#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
70 71
71#if defined(CONFIG_X86_IO_APIC)
72static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
73{
74 if (IO_APIC_IRQ(i))
75 send_IPI_self(IO_APIC_VECTOR(i));
76}
77#else
78static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
79#endif
80
81#endif /* _ASM_HW_IRQ_H */ 72#endif /* _ASM_HW_IRQ_H */
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
index 454440193eac..73465d2892b9 100644
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -13,7 +13,6 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <linux/config.h>
17 16
18#ifndef MAX_HWIFS 17#ifndef MAX_HWIFS
19# ifdef CONFIG_BLK_DEV_IDEPCI 18# ifdef CONFIG_BLK_DEV_IDEPCI
diff --git a/include/asm-i386/intel_arch_perfmon.h b/include/asm-i386/intel_arch_perfmon.h
new file mode 100644
index 000000000000..134ea9cc5283
--- /dev/null
+++ b/include/asm-i386/intel_arch_perfmon.h
@@ -0,0 +1,19 @@
1#ifndef X86_INTEL_ARCH_PERFMON_H
2#define X86_INTEL_ARCH_PERFMON_H 1
3
4#define MSR_ARCH_PERFMON_PERFCTR0 0xc1
5#define MSR_ARCH_PERFMON_PERFCTR1 0xc2
6
7#define MSR_ARCH_PERFMON_EVENTSEL0 0x186
8#define MSR_ARCH_PERFMON_EVENTSEL1 0x187
9
10#define ARCH_PERFMON_EVENTSEL0_ENABLE (1 << 22)
11#define ARCH_PERFMON_EVENTSEL_INT (1 << 20)
12#define ARCH_PERFMON_EVENTSEL_OS (1 << 17)
13#define ARCH_PERFMON_EVENTSEL_USR (1 << 16)
14
15#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL (0x3c)
16#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8)
17#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT (1 << 0)
18
19#endif /* X86_INTEL_ARCH_PERFMON_H */
diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h
index 79670bb4b0c7..b3724fe93ff1 100644
--- a/include/asm-i386/io.h
+++ b/include/asm-i386/io.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_IO_H 1#ifndef _ASM_IO_H
2#define _ASM_IO_H 2#define _ASM_IO_H
3 3
4#include <linux/config.h>
5#include <linux/string.h> 4#include <linux/string.h>
6#include <linux/compiler.h> 5#include <linux/compiler.h>
7 6
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h
index d92e253f7f6f..5092e819b8a2 100644
--- a/include/asm-i386/io_apic.h
+++ b/include/asm-i386/io_apic.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_IO_APIC_H 1#ifndef __ASM_IO_APIC_H
2#define __ASM_IO_APIC_H 2#define __ASM_IO_APIC_H
3 3
4#include <linux/config.h>
5#include <asm/types.h> 4#include <asm/types.h>
6#include <asm/mpspec.h> 5#include <asm/mpspec.h>
7 6
diff --git a/include/asm-i386/irq.h b/include/asm-i386/irq.h
index 5169d7af456f..331726b41128 100644
--- a/include/asm-i386/irq.h
+++ b/include/asm-i386/irq.h
@@ -10,7 +10,6 @@
10 * <tomsoft@informatik.tu-chemnitz.de> 10 * <tomsoft@informatik.tu-chemnitz.de>
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/sched.h> 13#include <linux/sched.h>
15/* include comes from machine specific directory */ 14/* include comes from machine specific directory */
16#include "irq_vectors.h" 15#include "irq_vectors.h"
diff --git a/include/asm-i386/k8.h b/include/asm-i386/k8.h
new file mode 100644
index 000000000000..dfd88a6e6040
--- /dev/null
+++ b/include/asm-i386/k8.h
@@ -0,0 +1 @@
#include <asm-x86_64/k8.h>
diff --git a/include/asm-i386/kdebug.h b/include/asm-i386/kdebug.h
index 96d0828ce096..d18cdb9fc9a6 100644
--- a/include/asm-i386/kdebug.h
+++ b/include/asm-i386/kdebug.h
@@ -19,6 +19,8 @@ struct die_args {
19 19
20extern int register_die_notifier(struct notifier_block *); 20extern int register_die_notifier(struct notifier_block *);
21extern int unregister_die_notifier(struct notifier_block *); 21extern int unregister_die_notifier(struct notifier_block *);
22extern int register_page_fault_notifier(struct notifier_block *);
23extern int unregister_page_fault_notifier(struct notifier_block *);
22extern struct atomic_notifier_head i386die_chain; 24extern struct atomic_notifier_head i386die_chain;
23 25
24 26
diff --git a/include/asm-i386/kmap_types.h b/include/asm-i386/kmap_types.h
index 6886a0c3fedf..806aae3c5338 100644
--- a/include/asm-i386/kmap_types.h
+++ b/include/asm-i386/kmap_types.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_KMAP_TYPES_H 1#ifndef _ASM_KMAP_TYPES_H
2#define _ASM_KMAP_TYPES_H 2#define _ASM_KMAP_TYPES_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_DEBUG_HIGHMEM 5#ifdef CONFIG_DEBUG_HIGHMEM
7# define D(n) __KM_FENCE_##n , 6# define D(n) __KM_FENCE_##n ,
diff --git a/include/asm-i386/kprobes.h b/include/asm-i386/kprobes.h
index 57d157c5cf89..0730a20f6db8 100644
--- a/include/asm-i386/kprobes.h
+++ b/include/asm-i386/kprobes.h
@@ -44,6 +44,7 @@ typedef u8 kprobe_opcode_t;
44 44
45#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 45#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
46#define ARCH_SUPPORTS_KRETPROBES 46#define ARCH_SUPPORTS_KRETPROBES
47#define ARCH_INACTIVE_KPROBE_COUNT 0
47 48
48void arch_remove_kprobe(struct kprobe *p); 49void arch_remove_kprobe(struct kprobe *p);
49void kretprobe_trampoline(void); 50void kretprobe_trampoline(void);
diff --git a/include/asm-i386/local.h b/include/asm-i386/local.h
index e67fa08260fe..3b4998c51d08 100644
--- a/include/asm-i386/local.h
+++ b/include/asm-i386/local.h
@@ -55,12 +55,26 @@ static __inline__ void local_sub(long i, local_t *v)
55 * much more efficient than these naive implementations. Note they take 55 * much more efficient than these naive implementations. Note they take
56 * a variable, not an address. 56 * a variable, not an address.
57 */ 57 */
58#define cpu_local_read(v) local_read(&__get_cpu_var(v)) 58
59#define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i)) 59/* Need to disable preemption for the cpu local counters otherwise we could
60#define cpu_local_inc(v) local_inc(&__get_cpu_var(v)) 60 still access a variable of a previous CPU in a non atomic way. */
61#define cpu_local_dec(v) local_dec(&__get_cpu_var(v)) 61#define cpu_local_wrap_v(v) \
62#define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v)) 62 ({ local_t res__; \
63#define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v)) 63 preempt_disable(); \
64 res__ = (v); \
65 preempt_enable(); \
66 res__; })
67#define cpu_local_wrap(v) \
68 ({ preempt_disable(); \
69 v; \
70 preempt_enable(); }) \
71
72#define cpu_local_read(v) cpu_local_wrap_v(local_read(&__get_cpu_var(v)))
73#define cpu_local_set(v, i) cpu_local_wrap(local_set(&__get_cpu_var(v), (i)))
74#define cpu_local_inc(v) cpu_local_wrap(local_inc(&__get_cpu_var(v)))
75#define cpu_local_dec(v) cpu_local_wrap(local_dec(&__get_cpu_var(v)))
76#define cpu_local_add(i, v) cpu_local_wrap(local_add((i), &__get_cpu_var(v)))
77#define cpu_local_sub(i, v) cpu_local_wrap(local_sub((i), &__get_cpu_var(v)))
64 78
65#define __cpu_local_inc(v) cpu_local_inc(v) 79#define __cpu_local_inc(v) cpu_local_inc(v)
66#define __cpu_local_dec(v) cpu_local_dec(v) 80#define __cpu_local_dec(v) cpu_local_dec(v)
diff --git a/include/asm-i386/mach-default/mach_ipi.h b/include/asm-i386/mach-default/mach_ipi.h
index a1d0072e36bc..0dba244c86db 100644
--- a/include/asm-i386/mach-default/mach_ipi.h
+++ b/include/asm-i386/mach-default/mach_ipi.h
@@ -1,6 +1,9 @@
1#ifndef __ASM_MACH_IPI_H 1#ifndef __ASM_MACH_IPI_H
2#define __ASM_MACH_IPI_H 2#define __ASM_MACH_IPI_H
3 3
4/* Avoid include hell */
5#define NMI_VECTOR 0x02
6
4void send_IPI_mask_bitmask(cpumask_t mask, int vector); 7void send_IPI_mask_bitmask(cpumask_t mask, int vector);
5void __send_IPI_shortcut(unsigned int shortcut, int vector); 8void __send_IPI_shortcut(unsigned int shortcut, int vector);
6 9
@@ -13,7 +16,7 @@ static inline void send_IPI_mask(cpumask_t mask, int vector)
13 16
14static inline void __local_send_IPI_allbutself(int vector) 17static inline void __local_send_IPI_allbutself(int vector)
15{ 18{
16 if (no_broadcast) { 19 if (no_broadcast || vector == NMI_VECTOR) {
17 cpumask_t mask = cpu_online_map; 20 cpumask_t mask = cpu_online_map;
18 21
19 cpu_clear(smp_processor_id(), mask); 22 cpu_clear(smp_processor_id(), mask);
@@ -24,7 +27,7 @@ static inline void __local_send_IPI_allbutself(int vector)
24 27
25static inline void __local_send_IPI_all(int vector) 28static inline void __local_send_IPI_all(int vector)
26{ 29{
27 if (no_broadcast) 30 if (no_broadcast || vector == NMI_VECTOR)
28 send_IPI_mask(cpu_online_map, vector); 31 send_IPI_mask(cpu_online_map, vector);
29 else 32 else
30 __send_IPI_shortcut(APIC_DEST_ALLINC, vector); 33 __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
diff --git a/include/asm-i386/mach-default/mach_timer.h b/include/asm-i386/mach-default/mach_timer.h
index 4b9703bb0288..807992fd4171 100644
--- a/include/asm-i386/mach-default/mach_timer.h
+++ b/include/asm-i386/mach-default/mach_timer.h
@@ -15,7 +15,9 @@
15#ifndef _MACH_TIMER_H 15#ifndef _MACH_TIMER_H
16#define _MACH_TIMER_H 16#define _MACH_TIMER_H
17 17
18#define CALIBRATE_LATCH (5 * LATCH) 18#define CALIBRATE_TIME_MSEC 30 /* 30 msecs */
19#define CALIBRATE_LATCH \
20 ((CLOCK_TICK_RATE * CALIBRATE_TIME_MSEC + 1000/2)/1000)
19 21
20static inline void mach_prepare_counter(void) 22static inline void mach_prepare_counter(void)
21{ 23{
diff --git a/include/asm-i386/mach-default/setup_arch_pre.h b/include/asm-i386/mach-default/setup_arch.h
index fb42099e7bd4..fb42099e7bd4 100644
--- a/include/asm-i386/mach-default/setup_arch_pre.h
+++ b/include/asm-i386/mach-default/setup_arch.h
diff --git a/include/asm-i386/mach-default/setup_arch_post.h b/include/asm-i386/mach-default/setup_arch_post.h
deleted file mode 100644
index 2fc4888721f6..000000000000
--- a/include/asm-i386/mach-default/setup_arch_post.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/**
2 * machine_specific_memory_setup - Hook for machine specific memory setup.
3 *
4 * Description:
5 * This is included late in kernel/setup.c so that it can make
6 * use of all of the static functions.
7 **/
8
9static char * __init machine_specific_memory_setup(void)
10{
11 char *who;
12
13
14 who = "BIOS-e820";
15
16 /*
17 * Try to copy the BIOS-supplied E820-map.
18 *
19 * Otherwise fake a memory map; one section from 0k->640k,
20 * the next section from 1mb->appropriate_mem_k
21 */
22 sanitize_e820_map(E820_MAP, &E820_MAP_NR);
23 if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) {
24 unsigned long mem_size;
25
26 /* compare results from other methods and take the greater */
27 if (ALT_MEM_K < EXT_MEM_K) {
28 mem_size = EXT_MEM_K;
29 who = "BIOS-88";
30 } else {
31 mem_size = ALT_MEM_K;
32 who = "BIOS-e801";
33 }
34
35 e820.nr_map = 0;
36 add_memory_region(0, LOWMEMSIZE(), E820_RAM);
37 add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
38 }
39 return who;
40}
diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h
index 3d6d12937e1f..9fd073286289 100644
--- a/include/asm-i386/mach-summit/mach_apic.h
+++ b/include/asm-i386/mach-summit/mach_apic.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_MACH_APIC_H 1#ifndef __ASM_MACH_APIC_H
2#define __ASM_MACH_APIC_H 2#define __ASM_MACH_APIC_H
3 3
4#include <linux/config.h>
5#include <asm/smp.h> 4#include <asm/smp.h>
6 5
7#define esr_disable (1) 6#define esr_disable (1)
diff --git a/include/asm-i386/mach-summit/mach_mpparse.h b/include/asm-i386/mach-summit/mach_mpparse.h
index 1cce2b924a80..94268399170d 100644
--- a/include/asm-i386/mach-summit/mach_mpparse.h
+++ b/include/asm-i386/mach-summit/mach_mpparse.h
@@ -2,6 +2,7 @@
2#define __ASM_MACH_MPPARSE_H 2#define __ASM_MACH_MPPARSE_H
3 3
4#include <mach_apic.h> 4#include <mach_apic.h>
5#include <asm/tsc.h>
5 6
6extern int use_cyclone; 7extern int use_cyclone;
7 8
@@ -29,6 +30,7 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
29 (!strncmp(productid, "VIGIL SMP", 9) 30 (!strncmp(productid, "VIGIL SMP", 9)
30 || !strncmp(productid, "EXA", 3) 31 || !strncmp(productid, "EXA", 3)
31 || !strncmp(productid, "RUTHLESS SMP", 12))){ 32 || !strncmp(productid, "RUTHLESS SMP", 12))){
33 mark_tsc_unstable();
32 use_cyclone = 1; /*enable cyclone-timer*/ 34 use_cyclone = 1; /*enable cyclone-timer*/
33 setup_summit(); 35 setup_summit();
34 return 1; 36 return 1;
@@ -42,6 +44,7 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
42 if (!strncmp(oem_id, "IBM", 3) && 44 if (!strncmp(oem_id, "IBM", 3) &&
43 (!strncmp(oem_table_id, "SERVIGIL", 8) 45 (!strncmp(oem_table_id, "SERVIGIL", 8)
44 || !strncmp(oem_table_id, "EXA", 3))){ 46 || !strncmp(oem_table_id, "EXA", 3))){
47 mark_tsc_unstable();
45 use_cyclone = 1; /*enable cyclone-timer*/ 48 use_cyclone = 1; /*enable cyclone-timer*/
46 setup_summit(); 49 setup_summit();
47 return 1; 50 return 1;
diff --git a/include/asm-i386/mach-visws/setup_arch_pre.h b/include/asm-i386/mach-visws/setup_arch.h
index b92d6d9a4d3c..33f700ef6831 100644
--- a/include/asm-i386/mach-visws/setup_arch_pre.h
+++ b/include/asm-i386/mach-visws/setup_arch.h
@@ -1,5 +1,8 @@
1/* Hook to call BIOS initialisation function */ 1/* Hook to call BIOS initialisation function */
2 2
3extern unsigned long sgivwfb_mem_phys;
4extern unsigned long sgivwfb_mem_size;
5
3/* no action for visws */ 6/* no action for visws */
4 7
5#define ARCH_SETUP 8#define ARCH_SETUP
diff --git a/include/asm-i386/mach-visws/setup_arch_post.h b/include/asm-i386/mach-visws/setup_arch_post.h
deleted file mode 100644
index cdbd895a54b1..000000000000
--- a/include/asm-i386/mach-visws/setup_arch_post.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/* Hook for machine specific memory setup.
2 *
3 * This is included late in kernel/setup.c so that it can make use of all of
4 * the static functions. */
5
6#define MB (1024 * 1024)
7
8unsigned long sgivwfb_mem_phys;
9unsigned long sgivwfb_mem_size;
10
11long long mem_size __initdata = 0;
12
13static char * __init machine_specific_memory_setup(void)
14{
15 long long gfx_mem_size = 8 * MB;
16
17 mem_size = ALT_MEM_K;
18
19 if (!mem_size) {
20 printk(KERN_WARNING "Bootloader didn't set memory size, upgrade it !\n");
21 mem_size = 128 * MB;
22 }
23
24 /*
25 * this hardcodes the graphics memory to 8 MB
26 * it really should be sized dynamically (or at least
27 * set as a boot param)
28 */
29 if (!sgivwfb_mem_size) {
30 printk(KERN_WARNING "Defaulting to 8 MB framebuffer size\n");
31 sgivwfb_mem_size = 8 * MB;
32 }
33
34 /*
35 * Trim to nearest MB
36 */
37 sgivwfb_mem_size &= ~((1 << 20) - 1);
38 sgivwfb_mem_phys = mem_size - gfx_mem_size;
39
40 add_memory_region(0, LOWMEMSIZE(), E820_RAM);
41 add_memory_region(HIGH_MEMORY, mem_size - sgivwfb_mem_size - HIGH_MEMORY, E820_RAM);
42 add_memory_region(sgivwfb_mem_phys, sgivwfb_mem_size, E820_RESERVED);
43
44 return "PROM";
45
46 /* Remove gcc warnings */
47 (void) sanitize_e820_map(NULL, NULL);
48 (void) copy_e820_map(NULL, 0);
49}
diff --git a/include/asm-i386/mach-voyager/setup_arch_pre.h b/include/asm-i386/mach-voyager/setup_arch.h
index 48f7e6ff49a5..84d01ad33459 100644
--- a/include/asm-i386/mach-voyager/setup_arch_pre.h
+++ b/include/asm-i386/mach-voyager/setup_arch.h
@@ -3,7 +3,7 @@
3 3
4/* Hook to call BIOS initialisation function */ 4/* Hook to call BIOS initialisation function */
5 5
6/* for voyager, pass the voyager BIOS/SUS info area to the detection 6/* for voyager, pass the voyager BIOS/SUS info area to the detection
7 * routines */ 7 * routines */
8 8
9#define ARCH_SETUP voyager_detect(VOYAGER_BIOS_INFO); 9#define ARCH_SETUP voyager_detect(VOYAGER_BIOS_INFO);
diff --git a/include/asm-i386/mach-voyager/setup_arch_post.h b/include/asm-i386/mach-voyager/setup_arch_post.h
deleted file mode 100644
index f6f6c2cbc75c..000000000000
--- a/include/asm-i386/mach-voyager/setup_arch_post.h
+++ /dev/null
@@ -1,73 +0,0 @@
1/* Hook for machine specific memory setup.
2 *
3 * This is included late in kernel/setup.c so that it can make use of all of
4 * the static functions. */
5
6static char * __init machine_specific_memory_setup(void)
7{
8 char *who;
9
10 who = "NOT VOYAGER";
11
12 if(voyager_level == 5) {
13 __u32 addr, length;
14 int i;
15
16 who = "Voyager-SUS";
17
18 e820.nr_map = 0;
19 for(i=0; voyager_memory_detect(i, &addr, &length); i++) {
20 add_memory_region(addr, length, E820_RAM);
21 }
22 return who;
23 } else if(voyager_level == 4) {
24 __u32 tom;
25 __u16 catbase = inb(VOYAGER_SSPB_RELOCATION_PORT)<<8;
26 /* select the DINO config space */
27 outb(VOYAGER_DINO, VOYAGER_CAT_CONFIG_PORT);
28 /* Read DINO top of memory register */
29 tom = ((inb(catbase + 0x4) & 0xf0) << 16)
30 + ((inb(catbase + 0x5) & 0x7f) << 24);
31
32 if(inb(catbase) != VOYAGER_DINO) {
33 printk(KERN_ERR "Voyager: Failed to get DINO for L4, setting tom to EXT_MEM_K\n");
34 tom = (EXT_MEM_K)<<10;
35 }
36 who = "Voyager-TOM";
37 add_memory_region(0, 0x9f000, E820_RAM);
38 /* map from 1M to top of memory */
39 add_memory_region(1*1024*1024, tom - 1*1024*1024, E820_RAM);
40 /* FIXME: Should check the ASICs to see if I need to
41 * take out the 8M window. Just do it at the moment
42 * */
43 add_memory_region(8*1024*1024, 8*1024*1024, E820_RESERVED);
44 return who;
45 }
46
47 who = "BIOS-e820";
48
49 /*
50 * Try to copy the BIOS-supplied E820-map.
51 *
52 * Otherwise fake a memory map; one section from 0k->640k,
53 * the next section from 1mb->appropriate_mem_k
54 */
55 sanitize_e820_map(E820_MAP, &E820_MAP_NR);
56 if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) {
57 unsigned long mem_size;
58
59 /* compare results from other methods and take the greater */
60 if (ALT_MEM_K < EXT_MEM_K) {
61 mem_size = EXT_MEM_K;
62 who = "BIOS-88";
63 } else {
64 mem_size = ALT_MEM_K;
65 who = "BIOS-e801";
66 }
67
68 e820.nr_map = 0;
69 add_memory_region(0, LOWMEMSIZE(), E820_RAM);
70 add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
71 }
72 return who;
73}
diff --git a/include/asm-i386/mce.h b/include/asm-i386/mce.h
new file mode 100644
index 000000000000..7cc1a973bf00
--- /dev/null
+++ b/include/asm-i386/mce.h
@@ -0,0 +1,5 @@
1#ifdef CONFIG_X86_MCE
2extern void mcheck_init(struct cpuinfo_x86 *c);
3#else
4#define mcheck_init(c) do {} while(0)
5#endif
diff --git a/include/asm-i386/mmu.h b/include/asm-i386/mmu.h
index f431a0b86d4c..8358dd3df7aa 100644
--- a/include/asm-i386/mmu.h
+++ b/include/asm-i386/mmu.h
@@ -12,6 +12,7 @@ typedef struct {
12 int size; 12 int size;
13 struct semaphore sem; 13 struct semaphore sem;
14 void *ldt; 14 void *ldt;
15 void *vdso;
15} mm_context_t; 16} mm_context_t;
16 17
17#endif 18#endif
diff --git a/include/asm-i386/mmu_context.h b/include/asm-i386/mmu_context.h
index bf08218357ea..62b7bf184094 100644
--- a/include/asm-i386/mmu_context.h
+++ b/include/asm-i386/mmu_context.h
@@ -1,7 +1,6 @@
1#ifndef __I386_SCHED_H 1#ifndef __I386_SCHED_H
2#define __I386_SCHED_H 2#define __I386_SCHED_H
3 3
4#include <linux/config.h>
5#include <asm/desc.h> 4#include <asm/desc.h>
6#include <asm/atomic.h> 5#include <asm/atomic.h>
7#include <asm/pgalloc.h> 6#include <asm/pgalloc.h>
diff --git a/include/asm-i386/msi.h b/include/asm-i386/msi.h
index f041d4495faf..b11c4b7dfaef 100644
--- a/include/asm-i386/msi.h
+++ b/include/asm-i386/msi.h
@@ -9,7 +9,15 @@
9#include <asm/desc.h> 9#include <asm/desc.h>
10#include <mach_apic.h> 10#include <mach_apic.h>
11 11
12#define LAST_DEVICE_VECTOR 232 12#define LAST_DEVICE_VECTOR (FIRST_SYSTEM_VECTOR - 1)
13#define MSI_TARGET_CPU_SHIFT 12 13#define MSI_TARGET_CPU_SHIFT 12
14 14
15extern struct msi_ops msi_apic_ops;
16
17static inline int msi_arch_init(void)
18{
19 msi_register(&msi_apic_ops);
20 return 0;
21}
22
15#endif /* ASM_MSI_H */ 23#endif /* ASM_MSI_H */
diff --git a/include/asm-i386/mtrr.h b/include/asm-i386/mtrr.h
index 64cf937c7e33..07f063ae26ea 100644
--- a/include/asm-i386/mtrr.h
+++ b/include/asm-i386/mtrr.h
@@ -23,7 +23,6 @@
23#ifndef _LINUX_MTRR_H 23#ifndef _LINUX_MTRR_H
24#define _LINUX_MTRR_H 24#define _LINUX_MTRR_H
25 25
26#include <linux/config.h>
27#include <linux/ioctl.h> 26#include <linux/ioctl.h>
28#include <linux/errno.h> 27#include <linux/errno.h>
29 28
@@ -77,6 +76,8 @@ extern int mtrr_add_page (unsigned long base, unsigned long size,
77extern int mtrr_del (int reg, unsigned long base, unsigned long size); 76extern int mtrr_del (int reg, unsigned long base, unsigned long size);
78extern int mtrr_del_page (int reg, unsigned long base, unsigned long size); 77extern int mtrr_del_page (int reg, unsigned long base, unsigned long size);
79extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi); 78extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi);
79extern void mtrr_ap_init(void);
80extern void mtrr_bp_init(void);
80# else 81# else
81static __inline__ int mtrr_add (unsigned long base, unsigned long size, 82static __inline__ int mtrr_add (unsigned long base, unsigned long size,
82 unsigned int type, char increment) 83 unsigned int type, char increment)
@@ -101,6 +102,8 @@ static __inline__ int mtrr_del_page (int reg, unsigned long base,
101 102
102static __inline__ void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi) {;} 103static __inline__ void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi) {;}
103 104
105#define mtrr_ap_init() do {} while (0)
106#define mtrr_bp_init() do {} while (0)
104# endif 107# endif
105 108
106#endif 109#endif
diff --git a/include/asm-i386/nmi.h b/include/asm-i386/nmi.h
index 21f16638fc61..67d994799999 100644
--- a/include/asm-i386/nmi.h
+++ b/include/asm-i386/nmi.h
@@ -5,24 +5,38 @@
5#define ASM_NMI_H 5#define ASM_NMI_H
6 6
7#include <linux/pm.h> 7#include <linux/pm.h>
8 8
9struct pt_regs; 9struct pt_regs;
10 10
11typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu); 11typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu);
12 12
13/** 13/**
14 * set_nmi_callback 14 * set_nmi_callback
15 * 15 *
16 * Set a handler for an NMI. Only one handler may be 16 * Set a handler for an NMI. Only one handler may be
17 * set. Return 1 if the NMI was handled. 17 * set. Return 1 if the NMI was handled.
18 */ 18 */
19void set_nmi_callback(nmi_callback_t callback); 19void set_nmi_callback(nmi_callback_t callback);
20 20
21/** 21/**
22 * unset_nmi_callback 22 * unset_nmi_callback
23 * 23 *
24 * Remove the handler previously set. 24 * Remove the handler previously set.
25 */ 25 */
26void unset_nmi_callback(void); 26void unset_nmi_callback(void);
27 27
28extern void setup_apic_nmi_watchdog (void);
29extern int reserve_lapic_nmi(void);
30extern void release_lapic_nmi(void);
31extern void disable_timer_nmi_watchdog(void);
32extern void enable_timer_nmi_watchdog(void);
33extern void nmi_watchdog_tick (struct pt_regs * regs);
34
35extern unsigned int nmi_watchdog;
36#define NMI_DEFAULT -1
37#define NMI_NONE 0
38#define NMI_IO_APIC 1
39#define NMI_LOCAL_APIC 2
40#define NMI_INVALID 3
41
28#endif /* ASM_NMI_H */ 42#endif /* ASM_NMI_H */
diff --git a/include/asm-i386/node.h b/include/asm-i386/node.h
deleted file mode 100644
index e13c6ffa72ae..000000000000
--- a/include/asm-i386/node.h
+++ /dev/null
@@ -1,29 +0,0 @@
1#ifndef _ASM_I386_NODE_H_
2#define _ASM_I386_NODE_H_
3
4#include <linux/device.h>
5#include <linux/mmzone.h>
6#include <linux/node.h>
7#include <linux/topology.h>
8#include <linux/nodemask.h>
9
10struct i386_node {
11 struct node node;
12};
13extern struct i386_node node_devices[MAX_NUMNODES];
14
15static inline int arch_register_node(int num){
16 int p_node;
17 struct node *parent = NULL;
18
19 if (!node_online(num))
20 return 0;
21 p_node = parent_node(num);
22
23 if (p_node != num)
24 parent = &node_devices[p_node].node;
25
26 return register_node(&node_devices[num].node, num, parent);
27}
28
29#endif /* _ASM_I386_NODE_H_ */
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index 30f52a2263ba..f5bf544c729a 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -12,7 +12,6 @@
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
14 14
15#include <linux/config.h>
16 15
17#ifdef CONFIG_X86_USE_3DNOW 16#ifdef CONFIG_X86_USE_3DNOW
18 17
@@ -97,6 +96,8 @@ typedef struct { unsigned long pgprot; } pgprot_t;
97 96
98#ifndef __ASSEMBLY__ 97#ifndef __ASSEMBLY__
99 98
99struct vm_area_struct;
100
100/* 101/*
101 * This much address space is reserved for vmalloc() and iomap() 102 * This much address space is reserved for vmalloc() and iomap()
102 * as well as fixmap mappings. 103 * as well as fixmap mappings.
@@ -137,9 +138,10 @@ extern int page_is_ram(unsigned long pagenr);
137 ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ 138 ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
138 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 139 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
139 140
140#endif /* __KERNEL__ */
141
142#include <asm-generic/memory_model.h> 141#include <asm-generic/memory_model.h>
143#include <asm-generic/page.h> 142#include <asm-generic/page.h>
144 143
144#define __HAVE_ARCH_GATE_AREA 1
145#endif /* __KERNEL__ */
146
145#endif /* _I386_PAGE_H */ 147#endif /* _I386_PAGE_H */
diff --git a/include/asm-i386/param.h b/include/asm-i386/param.h
index 095580f3a45c..745dc5bd0fbc 100644
--- a/include/asm-i386/param.h
+++ b/include/asm-i386/param.h
@@ -2,7 +2,6 @@
2#define _ASMi386_PARAM_H 2#define _ASMi386_PARAM_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5# include <linux/config.h>
6# define HZ CONFIG_HZ /* Internal kernel timer frequency */ 5# define HZ CONFIG_HZ /* Internal kernel timer frequency */
7# define USER_HZ 100 /* .. some user interfaces are in "ticks" */ 6# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
8# define CLOCKS_PER_SEC (USER_HZ) /* like times() */ 7# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index 78c85985aee3..64b6d0baedbc 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -1,7 +1,6 @@
1#ifndef __i386_PCI_H 1#ifndef __i386_PCI_H
2#define __i386_PCI_H 2#define __i386_PCI_H
3 3
4#include <linux/config.h>
5 4
6#ifdef __KERNEL__ 5#ifdef __KERNEL__
7#include <linux/mm.h> /* for struct page */ 6#include <linux/mm.h> /* for struct page */
diff --git a/include/asm-i386/pgalloc.h b/include/asm-i386/pgalloc.h
index 0380c3dc1f7e..4b1e61359f89 100644
--- a/include/asm-i386/pgalloc.h
+++ b/include/asm-i386/pgalloc.h
@@ -1,7 +1,6 @@
1#ifndef _I386_PGALLOC_H 1#ifndef _I386_PGALLOC_H
2#define _I386_PGALLOC_H 2#define _I386_PGALLOC_H
3 3
4#include <linux/config.h>
5#include <asm/fixmap.h> 4#include <asm/fixmap.h>
6#include <linux/threads.h> 5#include <linux/threads.h>
7#include <linux/mm.h> /* for struct page */ 6#include <linux/mm.h> /* for struct page */
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 672c3f76b9df..09697fec3d2b 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -1,7 +1,6 @@
1#ifndef _I386_PGTABLE_H 1#ifndef _I386_PGTABLE_H
2#define _I386_PGTABLE_H 2#define _I386_PGTABLE_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * The Linux memory management assumes a three-level page table setup. On 6 * The Linux memory management assumes a three-level page table setup. On
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index 805f0dcda468..b32346d62e10 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -17,7 +17,6 @@
17#include <asm/msr.h> 17#include <asm/msr.h>
18#include <asm/system.h> 18#include <asm/system.h>
19#include <linux/cache.h> 19#include <linux/cache.h>
20#include <linux/config.h>
21#include <linux/threads.h> 20#include <linux/threads.h>
22#include <asm/percpu.h> 21#include <asm/percpu.h>
23#include <linux/cpumask.h> 22#include <linux/cpumask.h>
@@ -72,8 +71,12 @@ struct cpuinfo_x86 {
72 cpumask_t llc_shared_map; /* cpus sharing the last level cache */ 71 cpumask_t llc_shared_map; /* cpus sharing the last level cache */
73#endif 72#endif
74 unsigned char x86_max_cores; /* cpuid returned max cores value */ 73 unsigned char x86_max_cores; /* cpuid returned max cores value */
75 unsigned char booted_cores; /* number of cores as seen by OS */
76 unsigned char apicid; 74 unsigned char apicid;
75#ifdef CONFIG_SMP
76 unsigned char booted_cores; /* number of cores as seen by OS */
77 __u8 phys_proc_id; /* Physical processor id. */
78 __u8 cpu_core_id; /* Core id */
79#endif
77} __attribute__((__aligned__(SMP_CACHE_BYTES))); 80} __attribute__((__aligned__(SMP_CACHE_BYTES)));
78 81
79#define X86_VENDOR_INTEL 0 82#define X86_VENDOR_INTEL 0
@@ -105,14 +108,13 @@ extern struct cpuinfo_x86 cpu_data[];
105#define current_cpu_data boot_cpu_data 108#define current_cpu_data boot_cpu_data
106#endif 109#endif
107 110
108extern int phys_proc_id[NR_CPUS];
109extern int cpu_core_id[NR_CPUS];
110extern int cpu_llc_id[NR_CPUS]; 111extern int cpu_llc_id[NR_CPUS];
111extern char ignore_fpu_irq; 112extern char ignore_fpu_irq;
112 113
113extern void identify_cpu(struct cpuinfo_x86 *); 114extern void identify_cpu(struct cpuinfo_x86 *);
114extern void print_cpu_info(struct cpuinfo_x86 *); 115extern void print_cpu_info(struct cpuinfo_x86 *);
115extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); 116extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
117extern unsigned short num_cache_leaves;
116 118
117#ifdef CONFIG_X86_HT 119#ifdef CONFIG_X86_HT
118extern void detect_ht(struct cpuinfo_x86 *c); 120extern void detect_ht(struct cpuinfo_x86 *c);
@@ -555,7 +557,7 @@ extern void prepare_to_copy(struct task_struct *tsk);
555extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); 557extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
556 558
557extern unsigned long thread_saved_pc(struct task_struct *tsk); 559extern unsigned long thread_saved_pc(struct task_struct *tsk);
558void show_trace(struct task_struct *task, unsigned long *stack); 560void show_trace(struct task_struct *task, struct pt_regs *regs, unsigned long *stack);
559 561
560unsigned long get_wchan(struct task_struct *p); 562unsigned long get_wchan(struct task_struct *p);
561 563
@@ -729,18 +731,4 @@ extern unsigned long boot_option_idle_override;
729extern void enable_sep_cpu(void); 731extern void enable_sep_cpu(void);
730extern int sysenter_setup(void); 732extern int sysenter_setup(void);
731 733
732#ifdef CONFIG_MTRR
733extern void mtrr_ap_init(void);
734extern void mtrr_bp_init(void);
735#else
736#define mtrr_ap_init() do {} while (0)
737#define mtrr_bp_init() do {} while (0)
738#endif
739
740#ifdef CONFIG_X86_MCE
741extern void mcheck_init(struct cpuinfo_x86 *c);
742#else
743#define mcheck_init(c) do {} while(0)
744#endif
745
746#endif /* __ASM_I386_PROCESSOR_H */ 734#endif /* __ASM_I386_PROCESSOR_H */
diff --git a/include/asm-i386/serial.h b/include/asm-i386/serial.h
index e1ecfccb743b..bd67480ca109 100644
--- a/include/asm-i386/serial.h
+++ b/include/asm-i386/serial.h
@@ -2,7 +2,6 @@
2 * include/asm-i386/serial.h 2 * include/asm-i386/serial.h
3 */ 3 */
4 4
5#include <linux/config.h>
6 5
7/* 6/*
8 * This assumes you have a 1.8432 MHz clock for your UART. 7 * This assumes you have a 1.8432 MHz clock for your UART.
diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h
index ee941457b55d..f737e423029e 100644
--- a/include/asm-i386/setup.h
+++ b/include/asm-i386/setup.h
@@ -59,6 +59,21 @@ extern unsigned char boot_params[PARAM_SIZE];
59#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF)) 59#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF))
60#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF)) 60#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF))
61 61
62/*
63 * Do NOT EVER look at the BIOS memory size location.
64 * It does not work on many machines.
65 */
66#define LOWMEMSIZE() (0x9f000)
67
68struct e820entry;
69
70char * __init machine_specific_memory_setup(void);
71
72int __init copy_e820_map(struct e820entry * biosmap, int nr_map);
73int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map);
74void __init add_memory_region(unsigned long long start,
75 unsigned long long size, int type);
76
62#endif /* __ASSEMBLY__ */ 77#endif /* __ASSEMBLY__ */
63 78
64#endif /* _i386_SETUP_H */ 79#endif /* _i386_SETUP_H */
diff --git a/include/asm-i386/signal.h b/include/asm-i386/signal.h
index 026fd231488d..3824a502351f 100644
--- a/include/asm-i386/signal.h
+++ b/include/asm-i386/signal.h
@@ -77,7 +77,6 @@ typedef unsigned long sigset_t;
77 * SA_FLAGS values: 77 * SA_FLAGS values:
78 * 78 *
79 * SA_ONSTACK indicates that a registered stack_t will be used. 79 * SA_ONSTACK indicates that a registered stack_t will be used.
80 * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
81 * SA_RESTART flag to get restarting signals (which were the default long ago) 80 * SA_RESTART flag to get restarting signals (which were the default long ago)
82 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. 81 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
83 * SA_RESETHAND clears the handler when the signal is delivered. 82 * SA_RESETHAND clears the handler when the signal is delivered.
@@ -97,7 +96,6 @@ typedef unsigned long sigset_t;
97 96
98#define SA_NOMASK SA_NODEFER 97#define SA_NOMASK SA_NODEFER
99#define SA_ONESHOT SA_RESETHAND 98#define SA_ONESHOT SA_RESETHAND
100#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
101 99
102#define SA_RESTORER 0x04000000 100#define SA_RESTORER 0x04000000
103 101
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index 61d3ab9db70c..142d10e34ade 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -5,7 +5,6 @@
5 * We need the APIC definitions automatically as part of 'smp.h' 5 * We need the APIC definitions automatically as part of 'smp.h'
6 */ 6 */
7#ifndef __ASSEMBLY__ 7#ifndef __ASSEMBLY__
8#include <linux/config.h>
9#include <linux/kernel.h> 8#include <linux/kernel.h>
10#include <linux/threads.h> 9#include <linux/threads.h>
11#include <linux/cpumask.h> 10#include <linux/cpumask.h>
diff --git a/include/asm-i386/socket.h b/include/asm-i386/socket.h
index 802ae76195b7..5755d57c4e95 100644
--- a/include/asm-i386/socket.h
+++ b/include/asm-i386/socket.h
@@ -48,5 +48,6 @@
48#define SO_ACCEPTCONN 30 48#define SO_ACCEPTCONN 30
49 49
50#define SO_PEERSEC 31 50#define SO_PEERSEC 31
51#define SO_PASSSEC 34
51 52
52#endif /* _ASM_SOCKET_H */ 53#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index d76b7693cf1d..04ba30234c48 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -4,7 +4,6 @@
4#include <asm/atomic.h> 4#include <asm/atomic.h>
5#include <asm/rwlock.h> 5#include <asm/rwlock.h>
6#include <asm/page.h> 6#include <asm/page.h>
7#include <linux/config.h>
8#include <linux/compiler.h> 7#include <linux/compiler.h>
9 8
10/* 9/*
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index bb5f88a27f7a..b9277361954b 100644
--- a/include/asm-i386/string.h
+++ b/include/asm-i386/string.h
@@ -2,7 +2,6 @@
2#define _I386_STRING_H_ 2#define _I386_STRING_H_
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5#include <linux/config.h>
6/* 5/*
7 * On a 486 or Pentium, we are better off not using the 6 * On a 486 or Pentium, we are better off not using the
8 * byte string operations. But on a 386 or a PPro the 7 * byte string operations. But on a 386 or a PPro the
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 19cc79c9a35d..cab0180567f9 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SYSTEM_H 1#ifndef __ASM_SYSTEM_H
2#define __ASM_SYSTEM_H 2#define __ASM_SYSTEM_H
3 3
4#include <linux/config.h>
5#include <linux/kernel.h> 4#include <linux/kernel.h>
6#include <asm/segment.h> 5#include <asm/segment.h>
7#include <asm/cpufeature.h> 6#include <asm/cpufeature.h>
@@ -428,7 +427,7 @@ static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long l
428 * does not enforce ordering, since there is no data dependency between 427 * does not enforce ordering, since there is no data dependency between
429 * the read of "a" and the read of "b". Therefore, on some CPUs, such 428 * the read of "a" and the read of "b". Therefore, on some CPUs, such
430 * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb() 429 * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb()
431 * in cases like thiswhere there are no data dependencies. 430 * in cases like this where there are no data dependencies.
432 **/ 431 **/
433 432
434#define read_barrier_depends() do { } while(0) 433#define read_barrier_depends() do { } while(0)
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index 1f7d48c9ba3f..2833fa2c0dd0 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -9,7 +9,6 @@
9 9
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11 11
12#include <linux/config.h>
13#include <linux/compiler.h> 12#include <linux/compiler.h>
14#include <asm/page.h> 13#include <asm/page.h>
15 14
@@ -38,6 +37,7 @@ struct thread_info {
38 0-0xBFFFFFFF for user-thead 37 0-0xBFFFFFFF for user-thead
39 0-0xFFFFFFFF for kernel-thread 38 0-0xFFFFFFFF for kernel-thread
40 */ 39 */
40 void *sysenter_return;
41 struct restart_block restart_block; 41 struct restart_block restart_block;
42 42
43 unsigned long previous_esp; /* ESP of the previous stack in case 43 unsigned long previous_esp; /* ESP of the previous stack in case
@@ -84,17 +84,15 @@ struct thread_info {
84#define init_stack (init_thread_union.stack) 84#define init_stack (init_thread_union.stack)
85 85
86 86
87/* how to get the current stack pointer from C */
88register unsigned long current_stack_pointer asm("esp") __attribute_used__;
89
87/* how to get the thread information struct from C */ 90/* how to get the thread information struct from C */
88static inline struct thread_info *current_thread_info(void) 91static inline struct thread_info *current_thread_info(void)
89{ 92{
90 struct thread_info *ti; 93 return (struct thread_info *)(current_stack_pointer & ~(THREAD_SIZE - 1));
91 __asm__("andl %%esp,%0; ":"=r" (ti) : "0" (~(THREAD_SIZE - 1)));
92 return ti;
93} 94}
94 95
95/* how to get the current stack pointer from C */
96register unsigned long current_stack_pointer asm("esp") __attribute_used__;
97
98/* thread information allocation */ 96/* thread information allocation */
99#ifdef CONFIG_DEBUG_STACK_USAGE 97#ifdef CONFIG_DEBUG_STACK_USAGE
100#define alloc_thread_info(tsk) \ 98#define alloc_thread_info(tsk) \
@@ -141,8 +139,7 @@ register unsigned long current_stack_pointer asm("esp") __attribute_used__;
141#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ 139#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
142#define TIF_SECCOMP 8 /* secure computing */ 140#define TIF_SECCOMP 8 /* secure computing */
143#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */ 141#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
144#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 142#define TIF_MEMDIE 16
145#define TIF_MEMDIE 17
146 143
147#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 144#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
148#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 145#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -154,7 +151,6 @@ register unsigned long current_stack_pointer asm("esp") __attribute_used__;
154#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 151#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
155#define _TIF_SECCOMP (1<<TIF_SECCOMP) 152#define _TIF_SECCOMP (1<<TIF_SECCOMP)
156#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 153#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
157#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
158 154
159/* work to do on interrupt/exception return */ 155/* work to do on interrupt/exception return */
160#define _TIF_WORK_MASK \ 156#define _TIF_WORK_MASK \
@@ -171,6 +167,9 @@ register unsigned long current_stack_pointer asm("esp") __attribute_used__;
171 * have to worry about atomic accesses. 167 * have to worry about atomic accesses.
172 */ 168 */
173#define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ 169#define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */
170#define TS_POLLING 0x0002 /* True if in idle loop and not sleeping */
171
172#define tsk_is_polling(t) ((t)->thread_info->status & TS_POLLING)
174 173
175#endif /* __KERNEL__ */ 174#endif /* __KERNEL__ */
176 175
diff --git a/include/asm-i386/timer.h b/include/asm-i386/timer.h
index aed16437479d..d0ebd05f8516 100644
--- a/include/asm-i386/timer.h
+++ b/include/asm-i386/timer.h
@@ -3,68 +3,11 @@
3#include <linux/init.h> 3#include <linux/init.h>
4#include <linux/pm.h> 4#include <linux/pm.h>
5 5
6/**
7 * struct timer_ops - used to define a timer source
8 *
9 * @name: name of the timer.
10 * @init: Probes and initializes the timer. Takes clock= override
11 * string as an argument. Returns 0 on success, anything else
12 * on failure.
13 * @mark_offset: called by the timer interrupt.
14 * @get_offset: called by gettimeofday(). Returns the number of microseconds
15 * since the last timer interupt.
16 * @monotonic_clock: returns the number of nanoseconds since the init of the
17 * timer.
18 * @delay: delays this many clock cycles.
19 */
20struct timer_opts {
21 char* name;
22 void (*mark_offset)(void);
23 unsigned long (*get_offset)(void);
24 unsigned long long (*monotonic_clock)(void);
25 void (*delay)(unsigned long);
26 unsigned long (*read_timer)(void);
27 int (*suspend)(pm_message_t state);
28 int (*resume)(void);
29};
30
31struct init_timer_opts {
32 int (*init)(char *override);
33 struct timer_opts *opts;
34};
35
36#define TICK_SIZE (tick_nsec / 1000) 6#define TICK_SIZE (tick_nsec / 1000)
37
38extern struct timer_opts* __init select_timer(void);
39extern void clock_fallback(void);
40void setup_pit_timer(void); 7void setup_pit_timer(void);
41
42/* Modifiers for buggy PIT handling */ 8/* Modifiers for buggy PIT handling */
43
44extern int pit_latch_buggy; 9extern int pit_latch_buggy;
45
46extern struct timer_opts *cur_timer;
47extern int timer_ack; 10extern int timer_ack;
48
49/* list of externed timers */
50extern struct timer_opts timer_none;
51extern struct timer_opts timer_pit;
52extern struct init_timer_opts timer_pit_init;
53extern struct init_timer_opts timer_tsc_init;
54#ifdef CONFIG_X86_CYCLONE_TIMER
55extern struct init_timer_opts timer_cyclone_init;
56#endif
57
58extern unsigned long calibrate_tsc(void);
59extern unsigned long read_timer_tsc(void);
60extern void init_cpu_khz(void);
61extern int recalibrate_cpu_khz(void); 11extern int recalibrate_cpu_khz(void);
62#ifdef CONFIG_HPET_TIMER
63extern struct init_timer_opts timer_hpet_init;
64extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr);
65#endif
66 12
67#ifdef CONFIG_X86_PM_TIMER
68extern struct init_timer_opts timer_pmtmr_init;
69#endif
70#endif 13#endif
diff --git a/include/asm-i386/timex.h b/include/asm-i386/timex.h
index 292b5a68f627..3666044409f0 100644
--- a/include/asm-i386/timex.h
+++ b/include/asm-i386/timex.h
@@ -6,8 +6,8 @@
6#ifndef _ASMi386_TIMEX_H 6#ifndef _ASMi386_TIMEX_H
7#define _ASMi386_TIMEX_H 7#define _ASMi386_TIMEX_H
8 8
9#include <linux/config.h>
10#include <asm/processor.h> 9#include <asm/processor.h>
10#include <asm/tsc.h>
11 11
12#ifdef CONFIG_X86_ELAN 12#ifdef CONFIG_X86_ELAN
13# define CLOCK_TICK_RATE 1189200 /* AMD Elan has different frequency! */ 13# define CLOCK_TICK_RATE 1189200 /* AMD Elan has different frequency! */
@@ -16,39 +16,6 @@
16#endif 16#endif
17 17
18 18
19/*
20 * Standard way to access the cycle counter on i586+ CPUs.
21 * Currently only used on SMP.
22 *
23 * If you really have a SMP machine with i486 chips or older,
24 * compile for that, and this will just always return zero.
25 * That's ok, it just means that the nicer scheduling heuristics
26 * won't work for you.
27 *
28 * We only use the low 32 bits, and we'd simply better make sure
29 * that we reschedule before that wraps. Scheduling at least every
30 * four billion cycles just basically sounds like a good idea,
31 * regardless of how fast the machine is.
32 */
33typedef unsigned long long cycles_t;
34
35static inline cycles_t get_cycles (void)
36{
37 unsigned long long ret=0;
38
39#ifndef CONFIG_X86_TSC
40 if (!cpu_has_tsc)
41 return 0;
42#endif
43
44#if defined(CONFIG_X86_GENERIC) || defined(CONFIG_X86_TSC)
45 rdtscll(ret);
46#endif
47 return ret;
48}
49
50extern unsigned int cpu_khz;
51
52extern int read_current_timer(unsigned long *timer_value); 19extern int read_current_timer(unsigned long *timer_value);
53#define ARCH_HAS_READ_CURRENT_TIMER 1 20#define ARCH_HAS_READ_CURRENT_TIMER 1
54 21
diff --git a/include/asm-i386/tlbflush.h b/include/asm-i386/tlbflush.h
index ab216e1370ef..d57ca5c540b6 100644
--- a/include/asm-i386/tlbflush.h
+++ b/include/asm-i386/tlbflush.h
@@ -1,7 +1,6 @@
1#ifndef _I386_TLBFLUSH_H 1#ifndef _I386_TLBFLUSH_H
2#define _I386_TLBFLUSH_H 2#define _I386_TLBFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6#include <asm/processor.h> 5#include <asm/processor.h>
7 6
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h
index b94e5eeef917..6adbd9b1ae88 100644
--- a/include/asm-i386/topology.h
+++ b/include/asm-i386/topology.h
@@ -28,10 +28,8 @@
28#define _ASM_I386_TOPOLOGY_H 28#define _ASM_I386_TOPOLOGY_H
29 29
30#ifdef CONFIG_X86_HT 30#ifdef CONFIG_X86_HT
31#define topology_physical_package_id(cpu) \ 31#define topology_physical_package_id(cpu) (cpu_data[cpu].phys_proc_id)
32 (phys_proc_id[cpu] == BAD_APICID ? -1 : phys_proc_id[cpu]) 32#define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id)
33#define topology_core_id(cpu) \
34 (cpu_core_id[cpu] == BAD_APICID ? 0 : cpu_core_id[cpu])
35#define topology_core_siblings(cpu) (cpu_core_map[cpu]) 33#define topology_core_siblings(cpu) (cpu_core_map[cpu])
36#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) 34#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu])
37#endif 35#endif
@@ -114,4 +112,9 @@ extern unsigned long node_remap_size[];
114 112
115extern cpumask_t cpu_coregroup_map(int cpu); 113extern cpumask_t cpu_coregroup_map(int cpu);
116 114
115#ifdef CONFIG_SMP
116#define mc_capable() (boot_cpu_data.x86_max_cores > 1)
117#define smt_capable() (smp_num_siblings > 1)
118#endif
119
117#endif /* _ASM_I386_TOPOLOGY_H */ 120#endif /* _ASM_I386_TOPOLOGY_H */
diff --git a/include/asm-i386/tsc.h b/include/asm-i386/tsc.h
new file mode 100644
index 000000000000..97b828ce31e0
--- /dev/null
+++ b/include/asm-i386/tsc.h
@@ -0,0 +1,49 @@
1/*
2 * linux/include/asm-i386/tsc.h
3 *
4 * i386 TSC related functions
5 */
6#ifndef _ASM_i386_TSC_H
7#define _ASM_i386_TSC_H
8
9#include <linux/config.h>
10#include <asm/processor.h>
11
12/*
13 * Standard way to access the cycle counter on i586+ CPUs.
14 * Currently only used on SMP.
15 *
16 * If you really have a SMP machine with i486 chips or older,
17 * compile for that, and this will just always return zero.
18 * That's ok, it just means that the nicer scheduling heuristics
19 * won't work for you.
20 *
21 * We only use the low 32 bits, and we'd simply better make sure
22 * that we reschedule before that wraps. Scheduling at least every
23 * four billion cycles just basically sounds like a good idea,
24 * regardless of how fast the machine is.
25 */
26typedef unsigned long long cycles_t;
27
28extern unsigned int cpu_khz;
29extern unsigned int tsc_khz;
30
31static inline cycles_t get_cycles(void)
32{
33 unsigned long long ret = 0;
34
35#ifndef CONFIG_X86_TSC
36 if (!cpu_has_tsc)
37 return 0;
38#endif
39
40#if defined(CONFIG_X86_GENERIC) || defined(CONFIG_X86_TSC)
41 rdtscll(ret);
42#endif
43 return ret;
44}
45
46extern void tsc_init(void);
47extern void mark_tsc_unstable(void);
48
49#endif
diff --git a/include/asm-i386/types.h b/include/asm-i386/types.h
index e50a08bd7ced..4b4b295ccdb9 100644
--- a/include/asm-i386/types.h
+++ b/include/asm-i386/types.h
@@ -35,7 +35,6 @@ typedef unsigned long long __u64;
35 35
36#ifndef __ASSEMBLY__ 36#ifndef __ASSEMBLY__
37 37
38#include <linux/config.h>
39 38
40typedef signed char s8; 39typedef signed char s8;
41typedef unsigned char u8; 40typedef unsigned char u8;
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index 371457b1ceb6..54d905ebc63d 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -4,7 +4,6 @@
4/* 4/*
5 * User space memory access functions 5 * User space memory access functions
6 */ 6 */
7#include <linux/config.h>
8#include <linux/errno.h> 7#include <linux/errno.h>
9#include <linux/thread_info.h> 8#include <linux/thread_info.h>
10#include <linux/prefetch.h> 9#include <linux/prefetch.h>
@@ -59,7 +58,7 @@ extern struct movsl_mask {
59 __chk_user_ptr(addr); \ 58 __chk_user_ptr(addr); \
60 asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \ 59 asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \
61 :"=&r" (flag), "=r" (sum) \ 60 :"=&r" (flag), "=r" (sum) \
62 :"1" (addr),"g" ((int)(size)),"g" (current_thread_info()->addr_limit.seg)); \ 61 :"1" (addr),"g" ((int)(size)),"rm" (current_thread_info()->addr_limit.seg)); \
63 flag; }) 62 flag; })
64 63
65/** 64/**
@@ -391,6 +390,12 @@ unsigned long __must_check __copy_to_user_ll(void __user *to,
391 const void *from, unsigned long n); 390 const void *from, unsigned long n);
392unsigned long __must_check __copy_from_user_ll(void *to, 391unsigned long __must_check __copy_from_user_ll(void *to,
393 const void __user *from, unsigned long n); 392 const void __user *from, unsigned long n);
393unsigned long __must_check __copy_from_user_ll_nozero(void *to,
394 const void __user *from, unsigned long n);
395unsigned long __must_check __copy_from_user_ll_nocache(void *to,
396 const void __user *from, unsigned long n);
397unsigned long __must_check __copy_from_user_ll_nocache_nozero(void *to,
398 const void __user *from, unsigned long n);
394 399
395/* 400/*
396 * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault 401 * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault
@@ -457,10 +462,41 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)
457 * 462 *
458 * If some data could not be copied, this function will pad the copied 463 * If some data could not be copied, this function will pad the copied
459 * data to the requested size using zero bytes. 464 * data to the requested size using zero bytes.
465 *
466 * An alternate version - __copy_from_user_inatomic() - may be called from
467 * atomic context and will fail rather than sleep. In this case the
468 * uncopied bytes will *NOT* be padded with zeros. See fs/filemap.h
469 * for explanation of why this is needed.
460 */ 470 */
461static __always_inline unsigned long 471static __always_inline unsigned long
462__copy_from_user_inatomic(void *to, const void __user *from, unsigned long n) 472__copy_from_user_inatomic(void *to, const void __user *from, unsigned long n)
463{ 473{
474 /* Avoid zeroing the tail if the copy fails..
475 * If 'n' is constant and 1, 2, or 4, we do still zero on a failure,
476 * but as the zeroing behaviour is only significant when n is not
477 * constant, that shouldn't be a problem.
478 */
479 if (__builtin_constant_p(n)) {
480 unsigned long ret;
481
482 switch (n) {
483 case 1:
484 __get_user_size(*(u8 *)to, from, 1, ret, 1);
485 return ret;
486 case 2:
487 __get_user_size(*(u16 *)to, from, 2, ret, 2);
488 return ret;
489 case 4:
490 __get_user_size(*(u32 *)to, from, 4, ret, 4);
491 return ret;
492 }
493 }
494 return __copy_from_user_ll_nozero(to, from, n);
495}
496static __always_inline unsigned long
497__copy_from_user(void *to, const void __user *from, unsigned long n)
498{
499 might_sleep();
464 if (__builtin_constant_p(n)) { 500 if (__builtin_constant_p(n)) {
465 unsigned long ret; 501 unsigned long ret;
466 502
@@ -479,12 +515,36 @@ __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n)
479 return __copy_from_user_ll(to, from, n); 515 return __copy_from_user_ll(to, from, n);
480} 516}
481 517
518#define ARCH_HAS_NOCACHE_UACCESS
519
520static __always_inline unsigned long __copy_from_user_nocache(void *to,
521 const void __user *from, unsigned long n)
522{
523 might_sleep();
524 if (__builtin_constant_p(n)) {
525 unsigned long ret;
526
527 switch (n) {
528 case 1:
529 __get_user_size(*(u8 *)to, from, 1, ret, 1);
530 return ret;
531 case 2:
532 __get_user_size(*(u16 *)to, from, 2, ret, 2);
533 return ret;
534 case 4:
535 __get_user_size(*(u32 *)to, from, 4, ret, 4);
536 return ret;
537 }
538 }
539 return __copy_from_user_ll_nocache(to, from, n);
540}
541
482static __always_inline unsigned long 542static __always_inline unsigned long
483__copy_from_user(void *to, const void __user *from, unsigned long n) 543__copy_from_user_inatomic_nocache(void *to, const void __user *from, unsigned long n)
484{ 544{
485 might_sleep(); 545 return __copy_from_user_ll_nocache_nozero(to, from, n);
486 return __copy_from_user_inatomic(to, from, n);
487} 546}
547
488unsigned long __must_check copy_to_user(void __user *to, 548unsigned long __must_check copy_to_user(void __user *to,
489 const void *from, unsigned long n); 549 const void *from, unsigned long n);
490unsigned long __must_check copy_from_user(void *to, 550unsigned long __must_check copy_from_user(void *to,
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index eb4b152c82fc..fc1c8ddae149 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -322,8 +322,11 @@
322#define __NR_sync_file_range 314 322#define __NR_sync_file_range 314
323#define __NR_tee 315 323#define __NR_tee 315
324#define __NR_vmsplice 316 324#define __NR_vmsplice 316
325#define __NR_move_pages 317
325 326
326#define NR_syscalls 317 327#ifdef __KERNEL__
328
329#define NR_syscalls 318
327 330
328/* 331/*
329 * user-visible error numbers are in the range -1 - -128: see 332 * user-visible error numbers are in the range -1 - -128: see
@@ -422,7 +425,6 @@ __asm__ volatile ("push %%ebp ; push %%ebx ; movl 4(%2),%%ebp ; " \
422__syscall_return(type,__res); \ 425__syscall_return(type,__res); \
423} 426}
424 427
425#ifdef __KERNEL__
426#define __ARCH_WANT_IPC_PARSE_VERSION 428#define __ARCH_WANT_IPC_PARSE_VERSION
427#define __ARCH_WANT_OLD_READDIR 429#define __ARCH_WANT_OLD_READDIR
428#define __ARCH_WANT_OLD_STAT 430#define __ARCH_WANT_OLD_STAT
@@ -446,7 +448,6 @@ __syscall_return(type,__res); \
446#define __ARCH_WANT_SYS_SIGPROCMASK 448#define __ARCH_WANT_SYS_SIGPROCMASK
447#define __ARCH_WANT_SYS_RT_SIGACTION 449#define __ARCH_WANT_SYS_RT_SIGACTION
448#define __ARCH_WANT_SYS_RT_SIGSUSPEND 450#define __ARCH_WANT_SYS_RT_SIGSUSPEND
449#endif
450 451
451#ifdef __KERNEL_SYSCALLS__ 452#ifdef __KERNEL_SYSCALLS__
452 453
@@ -485,7 +486,7 @@ asmlinkage long sys_rt_sigaction(int sig,
485 struct sigaction __user *oact, 486 struct sigaction __user *oact,
486 size_t sigsetsize); 487 size_t sigsetsize);
487 488
488#endif 489#endif /* __KERNEL_SYSCALLS__ */
489 490
490/* 491/*
491 * "Conditional" syscalls 492 * "Conditional" syscalls
@@ -497,4 +498,5 @@ asmlinkage long sys_rt_sigaction(int sig,
497#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 498#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
498#endif 499#endif
499 500
501#endif /* __KERNEL__ */
500#endif /* _ASM_I386_UNISTD_H_ */ 502#endif /* _ASM_I386_UNISTD_H_ */
diff --git a/include/asm-i386/unwind.h b/include/asm-i386/unwind.h
new file mode 100644
index 000000000000..69f0f1df6722
--- /dev/null
+++ b/include/asm-i386/unwind.h
@@ -0,0 +1,98 @@
1#ifndef _ASM_I386_UNWIND_H
2#define _ASM_I386_UNWIND_H
3
4/*
5 * Copyright (C) 2002-2006 Novell, Inc.
6 * Jan Beulich <jbeulich@novell.com>
7 * This code is released under version 2 of the GNU GPL.
8 */
9
10#ifdef CONFIG_STACK_UNWIND
11
12#include <linux/sched.h>
13#include <asm/fixmap.h>
14#include <asm/ptrace.h>
15#include <asm/uaccess.h>
16
17struct unwind_frame_info
18{
19 struct pt_regs regs;
20 struct task_struct *task;
21};
22
23#define UNW_PC(frame) (frame)->regs.eip
24#define UNW_SP(frame) (frame)->regs.esp
25#ifdef CONFIG_FRAME_POINTER
26#define UNW_FP(frame) (frame)->regs.ebp
27#define FRAME_RETADDR_OFFSET 4
28#define FRAME_LINK_OFFSET 0
29#define STACK_BOTTOM(tsk) STACK_LIMIT((tsk)->thread.esp0)
30#define STACK_TOP(tsk) ((tsk)->thread.esp0)
31#endif
32#define STACK_LIMIT(ptr) (((ptr) - 1) & ~(THREAD_SIZE - 1))
33
34#define UNW_REGISTER_INFO \
35 PTREGS_INFO(eax), \
36 PTREGS_INFO(ecx), \
37 PTREGS_INFO(edx), \
38 PTREGS_INFO(ebx), \
39 PTREGS_INFO(esp), \
40 PTREGS_INFO(ebp), \
41 PTREGS_INFO(esi), \
42 PTREGS_INFO(edi), \
43 PTREGS_INFO(eip)
44
45static inline void arch_unw_init_frame_info(struct unwind_frame_info *info,
46 /*const*/ struct pt_regs *regs)
47{
48 if (user_mode_vm(regs))
49 info->regs = *regs;
50 else {
51 memcpy(&info->regs, regs, offsetof(struct pt_regs, esp));
52 info->regs.esp = (unsigned long)&regs->esp;
53 info->regs.xss = __KERNEL_DS;
54 }
55}
56
57static inline void arch_unw_init_blocked(struct unwind_frame_info *info)
58{
59 memset(&info->regs, 0, sizeof(info->regs));
60 info->regs.eip = info->task->thread.eip;
61 info->regs.xcs = __KERNEL_CS;
62 __get_user(info->regs.ebp, (long *)info->task->thread.esp);
63 info->regs.esp = info->task->thread.esp;
64 info->regs.xss = __KERNEL_DS;
65 info->regs.xds = __USER_DS;
66 info->regs.xes = __USER_DS;
67}
68
69extern asmlinkage int arch_unwind_init_running(struct unwind_frame_info *,
70 asmlinkage int (*callback)(struct unwind_frame_info *,
71 void *arg),
72 void *arg);
73
74static inline int arch_unw_user_mode(const struct unwind_frame_info *info)
75{
76#if 0 /* This can only work when selector register and EFLAGS saves/restores
77 are properly annotated (and tracked in UNW_REGISTER_INFO). */
78 return user_mode_vm(&info->regs);
79#else
80 return info->regs.eip < PAGE_OFFSET
81 || (info->regs.eip >= __fix_to_virt(FIX_VDSO)
82 && info->regs.eip < __fix_to_virt(FIX_VDSO) + PAGE_SIZE)
83 || info->regs.esp < PAGE_OFFSET;
84#endif
85}
86
87#else
88
89#define UNW_PC(frame) ((void)(frame), 0)
90
91static inline int arch_unw_user_mode(const void *info)
92{
93 return 0;
94}
95
96#endif
97
98#endif /* _ASM_I386_UNWIND_H */
diff --git a/include/asm-i386/vga.h b/include/asm-i386/vga.h
index ef0c0e50cc95..0ecf68ac03aa 100644
--- a/include/asm-i386/vga.h
+++ b/include/asm-i386/vga.h
@@ -12,7 +12,7 @@
12 * access the videoram directly without any black magic. 12 * access the videoram directly without any black magic.
13 */ 13 */
14 14
15#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) 15#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
16 16
17#define vga_readb(x) (*(x)) 17#define vga_readb(x) (*(x))
18#define vga_writeb(x,y) (*(y) = (x)) 18#define vga_writeb(x,y) (*(y) = (x))