aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86_64
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:59:11 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:59:11 -0500
commit4522d58275f124105819723e24e912c8e5bf3cdd (patch)
treeb92c29014fadffe049c1925676037f0092b8d112 /include/asm-x86_64
parent6cf24f031bc97cb5a7c9df3b6e73c45b628b2b28 (diff)
parent64a26a731235b59c9d73bbe82c1f896d57400d37 (diff)
Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6
* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: (156 commits) [PATCH] x86-64: Export smp_call_function_single [PATCH] i386: Clean up smp_tune_scheduling() [PATCH] unwinder: move .eh_frame to RODATA [PATCH] unwinder: fully support linker generated .eh_frame_hdr section [PATCH] x86-64: don't use set_irq_regs() [PATCH] x86-64: check vector in setup_ioapic_dest to verify if need setup_IO_APIC_irq [PATCH] x86-64: Make ix86 default to HIGHMEM4G instead of NOHIGHMEM [PATCH] i386: replace kmalloc+memset with kzalloc [PATCH] x86-64: remove remaining pc98 code [PATCH] x86-64: remove unused variable [PATCH] x86-64: Fix constraints in atomic_add_return() [PATCH] x86-64: fix asm constraints in i386 atomic_add_return [PATCH] x86-64: Correct documentation for bzImage protocol v2.05 [PATCH] x86-64: replace kmalloc+memset with kzalloc in MTRR code [PATCH] x86-64: Fix numaq build error [PATCH] x86-64: include/asm-x86_64/cpufeature.h isn't a userspace header [PATCH] unwinder: Add debugging output to the Dwarf2 unwinder [PATCH] x86-64: Clarify error message in GART code [PATCH] x86-64: Fix interrupt race in idle callback (3rd try) [PATCH] x86-64: Remove unwind stack pointer alignment forcing again ... Fixed conflict in include/linux/uaccess.h manually Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-x86_64')
-rw-r--r--include/asm-x86_64/Kbuild1
-rw-r--r--include/asm-x86_64/alternative.h12
-rw-r--r--include/asm-x86_64/atomic.h6
-rw-r--r--include/asm-x86_64/calgary.h2
-rw-r--r--include/asm-x86_64/cpufeature.h7
-rw-r--r--include/asm-x86_64/delay.h7
-rw-r--r--include/asm-x86_64/desc.h53
-rw-r--r--include/asm-x86_64/desc_defs.h69
-rw-r--r--include/asm-x86_64/genapic.h2
-rw-r--r--include/asm-x86_64/msr.h17
-rw-r--r--include/asm-x86_64/nmi.h3
-rw-r--r--include/asm-x86_64/pci-direct.h1
-rw-r--r--include/asm-x86_64/pgtable.h22
-rw-r--r--include/asm-x86_64/processor.h8
-rw-r--r--include/asm-x86_64/proto.h2
-rw-r--r--include/asm-x86_64/rio.h74
-rw-r--r--include/asm-x86_64/smp.h5
-rw-r--r--include/asm-x86_64/spinlock.h29
-rw-r--r--include/asm-x86_64/stacktrace.h2
-rw-r--r--include/asm-x86_64/unwind.h8
-rw-r--r--include/asm-x86_64/vsyscall.h1
21 files changed, 244 insertions, 87 deletions
diff --git a/include/asm-x86_64/Kbuild b/include/asm-x86_64/Kbuild
index 763521358fb8..ebd7117782a6 100644
--- a/include/asm-x86_64/Kbuild
+++ b/include/asm-x86_64/Kbuild
@@ -6,7 +6,6 @@ ALTARCHDEF := defined __i386__
6 6
7header-y += boot.h 7header-y += boot.h
8header-y += bootsetup.h 8header-y += bootsetup.h
9header-y += cpufeature.h
10header-y += debugreg.h 9header-y += debugreg.h
11header-y += ldt.h 10header-y += ldt.h
12header-y += msr.h 11header-y += msr.h
diff --git a/include/asm-x86_64/alternative.h b/include/asm-x86_64/alternative.h
index a584826cc570..a6657b4f3e0e 100644
--- a/include/asm-x86_64/alternative.h
+++ b/include/asm-x86_64/alternative.h
@@ -4,6 +4,7 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/stddef.h>
7#include <asm/cpufeature.h> 8#include <asm/cpufeature.h>
8 9
9struct alt_instr { 10struct alt_instr {
@@ -133,4 +134,15 @@ static inline void alternatives_smp_switch(int smp) {}
133#define LOCK_PREFIX "" 134#define LOCK_PREFIX ""
134#endif 135#endif
135 136
137struct paravirt_patch;
138#ifdef CONFIG_PARAVIRT
139void apply_paravirt(struct paravirt_patch *start, struct paravirt_patch *end);
140#else
141static inline void
142apply_paravirt(struct paravirt_patch *start, struct paravirt_patch *end)
143{}
144#define __start_parainstructions NULL
145#define __stop_parainstructions NULL
146#endif
147
136#endif /* _X86_64_ALTERNATIVE_H */ 148#endif /* _X86_64_ALTERNATIVE_H */
diff --git a/include/asm-x86_64/atomic.h b/include/asm-x86_64/atomic.h
index 93849f7abc24..706ca4b60000 100644
--- a/include/asm-x86_64/atomic.h
+++ b/include/asm-x86_64/atomic.h
@@ -189,9 +189,9 @@ static __inline__ int atomic_add_return(int i, atomic_t *v)
189{ 189{
190 int __i = i; 190 int __i = i;
191 __asm__ __volatile__( 191 __asm__ __volatile__(
192 LOCK_PREFIX "xaddl %0, %1;" 192 LOCK_PREFIX "xaddl %0, %1"
193 :"=r"(i) 193 :"+r" (i), "+m" (v->counter)
194 :"m"(v->counter), "0"(i)); 194 : : "memory");
195 return i + __i; 195 return i + __i;
196} 196}
197 197
diff --git a/include/asm-x86_64/calgary.h b/include/asm-x86_64/calgary.h
index 6b93f5a3a5c8..7ee900645719 100644
--- a/include/asm-x86_64/calgary.h
+++ b/include/asm-x86_64/calgary.h
@@ -51,6 +51,8 @@ struct iommu_table {
51#define TCE_TABLE_SIZE_4M 6 51#define TCE_TABLE_SIZE_4M 6
52#define TCE_TABLE_SIZE_8M 7 52#define TCE_TABLE_SIZE_8M 7
53 53
54extern int use_calgary;
55
54#ifdef CONFIG_CALGARY_IOMMU 56#ifdef CONFIG_CALGARY_IOMMU
55extern int calgary_iommu_init(void); 57extern int calgary_iommu_init(void);
56extern void detect_calgary(void); 58extern void detect_calgary(void);
diff --git a/include/asm-x86_64/cpufeature.h b/include/asm-x86_64/cpufeature.h
index ee792faaca01..0b3c686139f1 100644
--- a/include/asm-x86_64/cpufeature.h
+++ b/include/asm-x86_64/cpufeature.h
@@ -29,7 +29,7 @@
29#define X86_FEATURE_PSE36 (0*32+17) /* 36-bit PSEs */ 29#define X86_FEATURE_PSE36 (0*32+17) /* 36-bit PSEs */
30#define X86_FEATURE_PN (0*32+18) /* Processor serial number */ 30#define X86_FEATURE_PN (0*32+18) /* Processor serial number */
31#define X86_FEATURE_CLFLSH (0*32+19) /* Supports the CLFLUSH instruction */ 31#define X86_FEATURE_CLFLSH (0*32+19) /* Supports the CLFLUSH instruction */
32#define X86_FEATURE_DTES (0*32+21) /* Debug Trace Store */ 32#define X86_FEATURE_DS (0*32+21) /* Debug Store */
33#define X86_FEATURE_ACPI (0*32+22) /* ACPI via MSR */ 33#define X86_FEATURE_ACPI (0*32+22) /* ACPI via MSR */
34#define X86_FEATURE_MMX (0*32+23) /* Multimedia Extensions */ 34#define X86_FEATURE_MMX (0*32+23) /* Multimedia Extensions */
35#define X86_FEATURE_FXSR (0*32+24) /* FXSAVE and FXRSTOR instructions (fast save and restore */ 35#define X86_FEATURE_FXSR (0*32+24) /* FXSAVE and FXRSTOR instructions (fast save and restore */
@@ -68,6 +68,8 @@
68#define X86_FEATURE_FXSAVE_LEAK (3*32+7) /* FIP/FOP/FDP leaks through FXSAVE */ 68#define X86_FEATURE_FXSAVE_LEAK (3*32+7) /* FIP/FOP/FDP leaks through FXSAVE */
69#define X86_FEATURE_UP (3*32+8) /* SMP kernel running on UP */ 69#define X86_FEATURE_UP (3*32+8) /* SMP kernel running on UP */
70#define X86_FEATURE_ARCH_PERFMON (3*32+9) /* Intel Architectural PerfMon */ 70#define X86_FEATURE_ARCH_PERFMON (3*32+9) /* Intel Architectural PerfMon */
71#define X86_FEATURE_PEBS (3*32+10) /* Precise-Event Based Sampling */
72#define X86_FEATURE_BTS (3*32+11) /* Branch Trace Store */
71 73
72/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ 74/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
73#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ 75#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */
@@ -112,5 +114,8 @@
112#define cpu_has_cyrix_arr 0 114#define cpu_has_cyrix_arr 0
113#define cpu_has_centaur_mcr 0 115#define cpu_has_centaur_mcr 0
114#define cpu_has_clflush boot_cpu_has(X86_FEATURE_CLFLSH) 116#define cpu_has_clflush boot_cpu_has(X86_FEATURE_CLFLSH)
117#define cpu_has_ds boot_cpu_has(X86_FEATURE_DS)
118#define cpu_has_pebs boot_cpu_has(X86_FEATURE_PEBS)
119#define cpu_has_bts boot_cpu_has(X86_FEATURE_BTS)
115 120
116#endif /* __ASM_X8664_CPUFEATURE_H */ 121#endif /* __ASM_X8664_CPUFEATURE_H */
diff --git a/include/asm-x86_64/delay.h b/include/asm-x86_64/delay.h
index 65f64acc5319..c2669f1f5529 100644
--- a/include/asm-x86_64/delay.h
+++ b/include/asm-x86_64/delay.h
@@ -7,18 +7,21 @@
7 * Delay routines calling functions in arch/x86_64/lib/delay.c 7 * Delay routines calling functions in arch/x86_64/lib/delay.c
8 */ 8 */
9 9
10/* Undefined functions to get compile-time errors */
10extern void __bad_udelay(void); 11extern void __bad_udelay(void);
11extern void __bad_ndelay(void); 12extern void __bad_ndelay(void);
12 13
13extern void __udelay(unsigned long usecs); 14extern void __udelay(unsigned long usecs);
14extern void __ndelay(unsigned long usecs); 15extern void __ndelay(unsigned long nsecs);
15extern void __const_udelay(unsigned long usecs); 16extern void __const_udelay(unsigned long usecs);
16extern void __delay(unsigned long loops); 17extern void __delay(unsigned long loops);
17 18
19/* 0x10c7 is 2**32 / 1000000 (rounded up) */
18#define udelay(n) (__builtin_constant_p(n) ? \ 20#define udelay(n) (__builtin_constant_p(n) ? \
19 ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \ 21 ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \
20 __udelay(n)) 22 __udelay(n))
21 23
24/* 0x5 is 2**32 / 1000000000 (rounded up) */
22#define ndelay(n) (__builtin_constant_p(n) ? \ 25#define ndelay(n) (__builtin_constant_p(n) ? \
23 ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \ 26 ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
24 __ndelay(n)) 27 __ndelay(n))
diff --git a/include/asm-x86_64/desc.h b/include/asm-x86_64/desc.h
index eb7723a46790..913d6ac00033 100644
--- a/include/asm-x86_64/desc.h
+++ b/include/asm-x86_64/desc.h
@@ -9,64 +9,13 @@
9 9
10#include <linux/string.h> 10#include <linux/string.h>
11#include <linux/smp.h> 11#include <linux/smp.h>
12#include <asm/desc_defs.h>
12 13
13#include <asm/segment.h> 14#include <asm/segment.h>
14#include <asm/mmu.h> 15#include <asm/mmu.h>
15 16
16// 8 byte segment descriptor
17struct desc_struct {
18 u16 limit0;
19 u16 base0;
20 unsigned base1 : 8, type : 4, s : 1, dpl : 2, p : 1;
21 unsigned limit : 4, avl : 1, l : 1, d : 1, g : 1, base2 : 8;
22} __attribute__((packed));
23
24struct n_desc_struct {
25 unsigned int a,b;
26};
27
28extern struct desc_struct cpu_gdt_table[GDT_ENTRIES]; 17extern struct desc_struct cpu_gdt_table[GDT_ENTRIES];
29 18
30enum {
31 GATE_INTERRUPT = 0xE,
32 GATE_TRAP = 0xF,
33 GATE_CALL = 0xC,
34};
35
36// 16byte gate
37struct gate_struct {
38 u16 offset_low;
39 u16 segment;
40 unsigned ist : 3, zero0 : 5, type : 5, dpl : 2, p : 1;
41 u16 offset_middle;
42 u32 offset_high;
43 u32 zero1;
44} __attribute__((packed));
45
46#define PTR_LOW(x) ((unsigned long)(x) & 0xFFFF)
47#define PTR_MIDDLE(x) (((unsigned long)(x) >> 16) & 0xFFFF)
48#define PTR_HIGH(x) ((unsigned long)(x) >> 32)
49
50enum {
51 DESC_TSS = 0x9,
52 DESC_LDT = 0x2,
53};
54
55// LDT or TSS descriptor in the GDT. 16 bytes.
56struct ldttss_desc {
57 u16 limit0;
58 u16 base0;
59 unsigned base1 : 8, type : 5, dpl : 2, p : 1;
60 unsigned limit1 : 4, zero0 : 3, g : 1, base2 : 8;
61 u32 base3;
62 u32 zero1;
63} __attribute__((packed));
64
65struct desc_ptr {
66 unsigned short size;
67 unsigned long address;
68} __attribute__((packed)) ;
69
70#define load_TR_desc() asm volatile("ltr %w0"::"r" (GDT_ENTRY_TSS*8)) 19#define load_TR_desc() asm volatile("ltr %w0"::"r" (GDT_ENTRY_TSS*8))
71#define load_LDT_desc() asm volatile("lldt %w0"::"r" (GDT_ENTRY_LDT*8)) 20#define load_LDT_desc() asm volatile("lldt %w0"::"r" (GDT_ENTRY_LDT*8))
72#define clear_LDT() asm volatile("lldt %w0"::"r" (0)) 21#define clear_LDT() asm volatile("lldt %w0"::"r" (0))
diff --git a/include/asm-x86_64/desc_defs.h b/include/asm-x86_64/desc_defs.h
new file mode 100644
index 000000000000..089004070099
--- /dev/null
+++ b/include/asm-x86_64/desc_defs.h
@@ -0,0 +1,69 @@
1/* Written 2000 by Andi Kleen */
2#ifndef __ARCH_DESC_DEFS_H
3#define __ARCH_DESC_DEFS_H
4
5/*
6 * Segment descriptor structure definitions, usable from both x86_64 and i386
7 * archs.
8 */
9
10#ifndef __ASSEMBLY__
11
12#include <linux/types.h>
13
14// 8 byte segment descriptor
15struct desc_struct {
16 u16 limit0;
17 u16 base0;
18 unsigned base1 : 8, type : 4, s : 1, dpl : 2, p : 1;
19 unsigned limit : 4, avl : 1, l : 1, d : 1, g : 1, base2 : 8;
20} __attribute__((packed));
21
22struct n_desc_struct {
23 unsigned int a,b;
24};
25
26enum {
27 GATE_INTERRUPT = 0xE,
28 GATE_TRAP = 0xF,
29 GATE_CALL = 0xC,
30};
31
32// 16byte gate
33struct gate_struct {
34 u16 offset_low;
35 u16 segment;
36 unsigned ist : 3, zero0 : 5, type : 5, dpl : 2, p : 1;
37 u16 offset_middle;
38 u32 offset_high;
39 u32 zero1;
40} __attribute__((packed));
41
42#define PTR_LOW(x) ((unsigned long)(x) & 0xFFFF)
43#define PTR_MIDDLE(x) (((unsigned long)(x) >> 16) & 0xFFFF)
44#define PTR_HIGH(x) ((unsigned long)(x) >> 32)
45
46enum {
47 DESC_TSS = 0x9,
48 DESC_LDT = 0x2,
49};
50
51// LDT or TSS descriptor in the GDT. 16 bytes.
52struct ldttss_desc {
53 u16 limit0;
54 u16 base0;
55 unsigned base1 : 8, type : 5, dpl : 2, p : 1;
56 unsigned limit1 : 4, zero0 : 3, g : 1, base2 : 8;
57 u32 base3;
58 u32 zero1;
59} __attribute__((packed));
60
61struct desc_ptr {
62 unsigned short size;
63 unsigned long address;
64} __attribute__((packed)) ;
65
66
67#endif /* !__ASSEMBLY__ */
68
69#endif
diff --git a/include/asm-x86_64/genapic.h b/include/asm-x86_64/genapic.h
index a0e9a4b93484..b80f4bb5f273 100644
--- a/include/asm-x86_64/genapic.h
+++ b/include/asm-x86_64/genapic.h
@@ -30,6 +30,6 @@ struct genapic {
30}; 30};
31 31
32 32
33extern struct genapic *genapic; 33extern struct genapic *genapic, *genapic_force, apic_flat;
34 34
35#endif 35#endif
diff --git a/include/asm-x86_64/msr.h b/include/asm-x86_64/msr.h
index 37e194169fac..952783d35c7b 100644
--- a/include/asm-x86_64/msr.h
+++ b/include/asm-x86_64/msr.h
@@ -169,8 +169,8 @@ static inline unsigned int cpuid_edx(unsigned int op)
169#define MSR_LSTAR 0xc0000082 /* long mode SYSCALL target */ 169#define MSR_LSTAR 0xc0000082 /* long mode SYSCALL target */
170#define MSR_CSTAR 0xc0000083 /* compatibility mode SYSCALL target */ 170#define MSR_CSTAR 0xc0000083 /* compatibility mode SYSCALL target */
171#define MSR_SYSCALL_MASK 0xc0000084 /* EFLAGS mask for syscall */ 171#define MSR_SYSCALL_MASK 0xc0000084 /* EFLAGS mask for syscall */
172#define MSR_FS_BASE 0xc0000100 /* 64bit GS base */ 172#define MSR_FS_BASE 0xc0000100 /* 64bit FS base */
173#define MSR_GS_BASE 0xc0000101 /* 64bit FS base */ 173#define MSR_GS_BASE 0xc0000101 /* 64bit GS base */
174#define MSR_KERNEL_GS_BASE 0xc0000102 /* SwapGS GS shadow (or USER_GS from kernel) */ 174#define MSR_KERNEL_GS_BASE 0xc0000102 /* SwapGS GS shadow (or USER_GS from kernel) */
175/* EFER bits: */ 175/* EFER bits: */
176#define _EFER_SCE 0 /* SYSCALL/SYSRET */ 176#define _EFER_SCE 0 /* SYSCALL/SYSRET */
@@ -210,6 +210,10 @@ static inline unsigned int cpuid_edx(unsigned int op)
210#define MSR_IA32_LASTINTFROMIP 0x1dd 210#define MSR_IA32_LASTINTFROMIP 0x1dd
211#define MSR_IA32_LASTINTTOIP 0x1de 211#define MSR_IA32_LASTINTTOIP 0x1de
212 212
213#define MSR_IA32_PEBS_ENABLE 0x3f1
214#define MSR_IA32_DS_AREA 0x600
215#define MSR_IA32_PERF_CAPABILITIES 0x345
216
213#define MSR_MTRRfix64K_00000 0x250 217#define MSR_MTRRfix64K_00000 0x250
214#define MSR_MTRRfix16K_80000 0x258 218#define MSR_MTRRfix16K_80000 0x258
215#define MSR_MTRRfix16K_A0000 0x259 219#define MSR_MTRRfix16K_A0000 0x259
@@ -407,4 +411,13 @@ static inline unsigned int cpuid_edx(unsigned int op)
407#define MSR_P4_U2L_ESCR0 0x3b0 411#define MSR_P4_U2L_ESCR0 0x3b0
408#define MSR_P4_U2L_ESCR1 0x3b1 412#define MSR_P4_U2L_ESCR1 0x3b1
409 413
414/* Intel Core-based CPU performance counters */
415#define MSR_CORE_PERF_FIXED_CTR0 0x309
416#define MSR_CORE_PERF_FIXED_CTR1 0x30a
417#define MSR_CORE_PERF_FIXED_CTR2 0x30b
418#define MSR_CORE_PERF_FIXED_CTR_CTRL 0x38d
419#define MSR_CORE_PERF_GLOBAL_STATUS 0x38e
420#define MSR_CORE_PERF_GLOBAL_CTRL 0x38f
421#define MSR_CORE_PERF_GLOBAL_OVF_CTRL 0x390
422
410#endif 423#endif
diff --git a/include/asm-x86_64/nmi.h b/include/asm-x86_64/nmi.h
index f367d4014b42..72375e7d32a8 100644
--- a/include/asm-x86_64/nmi.h
+++ b/include/asm-x86_64/nmi.h
@@ -77,4 +77,7 @@ extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
77 77
78extern int unknown_nmi_panic; 78extern int unknown_nmi_panic;
79 79
80void __trigger_all_cpu_backtrace(void);
81#define trigger_all_cpu_backtrace() __trigger_all_cpu_backtrace()
82
80#endif /* ASM_NMI_H */ 83#endif /* ASM_NMI_H */
diff --git a/include/asm-x86_64/pci-direct.h b/include/asm-x86_64/pci-direct.h
index eba9cb471df3..6823fa4f1afa 100644
--- a/include/asm-x86_64/pci-direct.h
+++ b/include/asm-x86_64/pci-direct.h
@@ -10,6 +10,7 @@ extern u32 read_pci_config(u8 bus, u8 slot, u8 func, u8 offset);
10extern u8 read_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset); 10extern u8 read_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset);
11extern u16 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset); 11extern u16 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset);
12extern void write_pci_config(u8 bus, u8 slot, u8 func, u8 offset, u32 val); 12extern void write_pci_config(u8 bus, u8 slot, u8 func, u8 offset, u32 val);
13extern void write_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset, u8 val);
13 14
14extern int early_pci_allowed(void); 15extern int early_pci_allowed(void);
15 16
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 0555c1c4d8fa..59901c690a0d 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -221,20 +221,19 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long
221#define __S110 PAGE_SHARED_EXEC 221#define __S110 PAGE_SHARED_EXEC
222#define __S111 PAGE_SHARED_EXEC 222#define __S111 PAGE_SHARED_EXEC
223 223
224static inline unsigned long pgd_bad(pgd_t pgd) 224static inline unsigned long pgd_bad(pgd_t pgd)
225{ 225{
226 unsigned long val = pgd_val(pgd); 226 return pgd_val(pgd) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER);
227 val &= ~PTE_MASK; 227}
228 val &= ~(_PAGE_USER | _PAGE_DIRTY);
229 return val & ~(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED);
230}
231 228
232static inline unsigned long pud_bad(pud_t pud) 229static inline unsigned long pud_bad(pud_t pud)
233{ 230{
234 unsigned long val = pud_val(pud); 231 return pud_val(pud) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER);
235 val &= ~PTE_MASK; 232}
236 val &= ~(_PAGE_USER | _PAGE_DIRTY); 233
237 return val & ~(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED); 234static inline unsigned long pmd_bad(pmd_t pmd)
235{
236 return pmd_val(pmd) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER);
238} 237}
239 238
240#define pte_none(x) (!pte_val(x)) 239#define pte_none(x) (!pte_val(x))
@@ -347,7 +346,6 @@ static inline int pmd_large(pmd_t pte) {
347#define pmd_none(x) (!pmd_val(x)) 346#define pmd_none(x) (!pmd_val(x))
348#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) 347#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT)
349#define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) 348#define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0)
350#define pmd_bad(x) ((pmd_val(x) & (~PTE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE )
351#define pfn_pmd(nr,prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val(prot))) 349#define pfn_pmd(nr,prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val(prot)))
352#define pmd_pfn(x) ((pmd_val(x) & __PHYSICAL_MASK) >> PAGE_SHIFT) 350#define pmd_pfn(x) ((pmd_val(x) & __PHYSICAL_MASK) >> PAGE_SHIFT)
353 351
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
index cef17e0f828c..76552d72804c 100644
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -475,6 +475,14 @@ static inline void __mwait(unsigned long eax, unsigned long ecx)
475 : :"a" (eax), "c" (ecx)); 475 : :"a" (eax), "c" (ecx));
476} 476}
477 477
478static inline void __sti_mwait(unsigned long eax, unsigned long ecx)
479{
480 /* "mwait %eax,%ecx;" */
481 asm volatile(
482 "sti; .byte 0x0f,0x01,0xc9;"
483 : :"a" (eax), "c" (ecx));
484}
485
478extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx); 486extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx);
479 487
480#define stack_current() \ 488#define stack_current() \
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h
index e72cfcdf5344..6d324b838972 100644
--- a/include/asm-x86_64/proto.h
+++ b/include/asm-x86_64/proto.h
@@ -61,7 +61,6 @@ extern void numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn);
61extern unsigned long numa_free_all_bootmem(void); 61extern unsigned long numa_free_all_bootmem(void);
62 62
63extern void reserve_bootmem_generic(unsigned long phys, unsigned len); 63extern void reserve_bootmem_generic(unsigned long phys, unsigned len);
64extern void free_bootmem_generic(unsigned long phys, unsigned len);
65 64
66extern void load_gs_index(unsigned gs); 65extern void load_gs_index(unsigned gs);
67 66
@@ -88,6 +87,7 @@ extern void syscall32_cpu_init(void);
88extern void setup_node_bootmem(int nodeid, unsigned long start, unsigned long end); 87extern void setup_node_bootmem(int nodeid, unsigned long start, unsigned long end);
89 88
90extern void early_quirks(void); 89extern void early_quirks(void);
90extern void quirk_intel_irqbalance(void);
91extern void check_efer(void); 91extern void check_efer(void);
92 92
93extern int unhandled_signal(struct task_struct *tsk, int sig); 93extern int unhandled_signal(struct task_struct *tsk, int sig);
diff --git a/include/asm-x86_64/rio.h b/include/asm-x86_64/rio.h
new file mode 100644
index 000000000000..c7350f6d2015
--- /dev/null
+++ b/include/asm-x86_64/rio.h
@@ -0,0 +1,74 @@
1/*
2 * Derived from include/asm-i386/mach-summit/mach_mpparse.h
3 * and include/asm-i386/mach-default/bios_ebda.h
4 *
5 * Author: Laurent Vivier <Laurent.Vivier@bull.net>
6 */
7
8#ifndef __ASM_RIO_H
9#define __ASM_RIO_H
10
11#define RIO_TABLE_VERSION 3
12
13struct rio_table_hdr {
14 u8 version; /* Version number of this data structure */
15 u8 num_scal_dev; /* # of Scalability devices */
16 u8 num_rio_dev; /* # of RIO I/O devices */
17} __attribute__((packed));
18
19struct scal_detail {
20 u8 node_id; /* Scalability Node ID */
21 u32 CBAR; /* Address of 1MB register space */
22 u8 port0node; /* Node ID port connected to: 0xFF=None */
23 u8 port0port; /* Port num port connected to: 0,1,2, or */
24 /* 0xFF=None */
25 u8 port1node; /* Node ID port connected to: 0xFF = None */
26 u8 port1port; /* Port num port connected to: 0,1,2, or */
27 /* 0xFF=None */
28 u8 port2node; /* Node ID port connected to: 0xFF = None */
29 u8 port2port; /* Port num port connected to: 0,1,2, or */
30 /* 0xFF=None */
31 u8 chassis_num; /* 1 based Chassis number (1 = boot node) */
32} __attribute__((packed));
33
34struct rio_detail {
35 u8 node_id; /* RIO Node ID */
36 u32 BBAR; /* Address of 1MB register space */
37 u8 type; /* Type of device */
38 u8 owner_id; /* Node ID of Hurricane that owns this */
39 /* node */
40 u8 port0node; /* Node ID port connected to: 0xFF=None */
41 u8 port0port; /* Port num port connected to: 0,1,2, or */
42 /* 0xFF=None */
43 u8 port1node; /* Node ID port connected to: 0xFF=None */
44 u8 port1port; /* Port num port connected to: 0,1,2, or */
45 /* 0xFF=None */
46 u8 first_slot; /* Lowest slot number below this Calgary */
47 u8 status; /* Bit 0 = 1 : the XAPIC is used */
48 /* = 0 : the XAPIC is not used, ie: */
49 /* ints fwded to another XAPIC */
50 /* Bits1:7 Reserved */
51 u8 WP_index; /* instance index - lower ones have */
52 /* lower slot numbers/PCI bus numbers */
53 u8 chassis_num; /* 1 based Chassis number */
54} __attribute__((packed));
55
56enum {
57 HURR_SCALABILTY = 0, /* Hurricane Scalability info */
58 HURR_RIOIB = 2, /* Hurricane RIOIB info */
59 COMPAT_CALGARY = 4, /* Compatibility Calgary */
60 ALT_CALGARY = 5, /* Second Planar Calgary */
61};
62
63/*
64 * there is a real-mode segmented pointer pointing to the
65 * 4K EBDA area at 0x40E.
66 */
67static inline unsigned long get_bios_ebda(void)
68{
69 unsigned long address = *(unsigned short *)phys_to_virt(0x40EUL);
70 address <<= 4;
71 return address;
72}
73
74#endif /* __ASM_RIO_H */
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h
index f1bdd500d7ac..e17b9ec42e98 100644
--- a/include/asm-x86_64/smp.h
+++ b/include/asm-x86_64/smp.h
@@ -82,11 +82,6 @@ extern u8 x86_cpu_to_apicid[NR_CPUS]; /* physical ID */
82extern u8 x86_cpu_to_log_apicid[NR_CPUS]; 82extern u8 x86_cpu_to_log_apicid[NR_CPUS];
83extern u8 bios_cpu_apicid[]; 83extern u8 bios_cpu_apicid[];
84 84
85static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
86{
87 return cpus_addr(cpumask)[0];
88}
89
90static inline int cpu_present_to_apicid(int mps_cpu) 85static inline int cpu_present_to_apicid(int mps_cpu)
91{ 86{
92 if (mps_cpu < NR_CPUS) 87 if (mps_cpu < NR_CPUS)
diff --git a/include/asm-x86_64/spinlock.h b/include/asm-x86_64/spinlock.h
index 05ef097ba55b..88bf981e73cf 100644
--- a/include/asm-x86_64/spinlock.h
+++ b/include/asm-x86_64/spinlock.h
@@ -36,7 +36,34 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
36 "2:\t" : "=m" (lock->slock) : : "memory"); 36 "2:\t" : "=m" (lock->slock) : : "memory");
37} 37}
38 38
39#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) 39/*
40 * Same as __raw_spin_lock, but reenable interrupts during spinning.
41 */
42#ifndef CONFIG_PROVE_LOCKING
43static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags)
44{
45 asm volatile(
46 "\n1:\t"
47 LOCK_PREFIX " ; decl %0\n\t"
48 "jns 5f\n"
49 "testl $0x200, %1\n\t" /* interrupts were disabled? */
50 "jz 4f\n\t"
51 "sti\n"
52 "3:\t"
53 "rep;nop\n\t"
54 "cmpl $0, %0\n\t"
55 "jle 3b\n\t"
56 "cli\n\t"
57 "jmp 1b\n"
58 "4:\t"
59 "rep;nop\n\t"
60 "cmpl $0, %0\n\t"
61 "jg 1b\n\t"
62 "jmp 4b\n"
63 "5:\n\t"
64 : "+m" (lock->slock) : "r" ((unsigned)flags) : "memory");
65}
66#endif
40 67
41static inline int __raw_spin_trylock(raw_spinlock_t *lock) 68static inline int __raw_spin_trylock(raw_spinlock_t *lock)
42{ 69{
diff --git a/include/asm-x86_64/stacktrace.h b/include/asm-x86_64/stacktrace.h
index 5eb9799bef76..6f0b54594307 100644
--- a/include/asm-x86_64/stacktrace.h
+++ b/include/asm-x86_64/stacktrace.h
@@ -1,6 +1,8 @@
1#ifndef _ASM_STACKTRACE_H 1#ifndef _ASM_STACKTRACE_H
2#define _ASM_STACKTRACE_H 1 2#define _ASM_STACKTRACE_H 1
3 3
4extern int kstack_depth_to_print;
5
4/* Generic stack tracer with callbacks */ 6/* Generic stack tracer with callbacks */
5 7
6struct stacktrace_ops { 8struct stacktrace_ops {
diff --git a/include/asm-x86_64/unwind.h b/include/asm-x86_64/unwind.h
index 2e7ff10fd775..2f6349e48717 100644
--- a/include/asm-x86_64/unwind.h
+++ b/include/asm-x86_64/unwind.h
@@ -87,14 +87,10 @@ extern int arch_unwind_init_running(struct unwind_frame_info *,
87 87
88static inline int arch_unw_user_mode(const struct unwind_frame_info *info) 88static inline int arch_unw_user_mode(const struct unwind_frame_info *info)
89{ 89{
90#if 0 /* This can only work when selector register saves/restores 90 return user_mode(&info->regs)
91 are properly annotated (and tracked in UNW_REGISTER_INFO). */ 91 || (long)info->regs.rip >= 0
92 return user_mode(&info->regs);
93#else
94 return (long)info->regs.rip >= 0
95 || (info->regs.rip >= VSYSCALL_START && info->regs.rip < VSYSCALL_END) 92 || (info->regs.rip >= VSYSCALL_START && info->regs.rip < VSYSCALL_END)
96 || (long)info->regs.rsp >= 0; 93 || (long)info->regs.rsp >= 0;
97#endif
98} 94}
99 95
100#else 96#else
diff --git a/include/asm-x86_64/vsyscall.h b/include/asm-x86_64/vsyscall.h
index 01d1c17e2849..05cb8dd200de 100644
--- a/include/asm-x86_64/vsyscall.h
+++ b/include/asm-x86_64/vsyscall.h
@@ -10,6 +10,7 @@ enum vsyscall_num {
10#define VSYSCALL_START (-10UL << 20) 10#define VSYSCALL_START (-10UL << 20)
11#define VSYSCALL_SIZE 1024 11#define VSYSCALL_SIZE 1024
12#define VSYSCALL_END (-2UL << 20) 12#define VSYSCALL_END (-2UL << 20)
13#define VSYSCALL_MAPPED_PAGES 1
13#define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr)) 14#define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr))
14 15
15#ifdef __KERNEL__ 16#ifdef __KERNEL__