diff options
Diffstat (limited to 'include/asm-x86_64')
-rw-r--r-- | include/asm-x86_64/apicdef.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/bitops.h | 42 | ||||
-rw-r--r-- | include/asm-x86_64/dmi.h | 27 | ||||
-rw-r--r-- | include/asm-x86_64/elf.h | 4 | ||||
-rw-r--r-- | include/asm-x86_64/floppy.h | 2 | ||||
-rw-r--r-- | include/asm-x86_64/futex.h | 27 | ||||
-rw-r--r-- | include/asm-x86_64/io.h | 26 | ||||
-rw-r--r-- | include/asm-x86_64/kdebug.h | 23 | ||||
-rw-r--r-- | include/asm-x86_64/local.h | 10 | ||||
-rw-r--r-- | include/asm-x86_64/mmzone.h | 13 | ||||
-rw-r--r-- | include/asm-x86_64/numa.h | 4 | ||||
-rw-r--r-- | include/asm-x86_64/page.h | 3 | ||||
-rw-r--r-- | include/asm-x86_64/pda.h | 2 | ||||
-rw-r--r-- | include/asm-x86_64/pgalloc.h | 28 | ||||
-rw-r--r-- | include/asm-x86_64/pgtable.h | 4 | ||||
-rw-r--r-- | include/asm-x86_64/poll.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/processor.h | 7 | ||||
-rw-r--r-- | include/asm-x86_64/proto.h | 3 | ||||
-rw-r--r-- | include/asm-x86_64/smp.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/string.h | 17 | ||||
-rw-r--r-- | include/asm-x86_64/suspend.h | 4 | ||||
-rw-r--r-- | include/asm-x86_64/system.h | 6 | ||||
-rw-r--r-- | include/asm-x86_64/topology.h | 2 | ||||
-rw-r--r-- | include/asm-x86_64/unistd.h | 6 |
24 files changed, 145 insertions, 118 deletions
diff --git a/include/asm-x86_64/apicdef.h b/include/asm-x86_64/apicdef.h index decaa2d540e8..5a48e9bcf218 100644 --- a/include/asm-x86_64/apicdef.h +++ b/include/asm-x86_64/apicdef.h | |||
@@ -39,6 +39,7 @@ | |||
39 | #define APIC_SPIV_FOCUS_DISABLED (1<<9) | 39 | #define APIC_SPIV_FOCUS_DISABLED (1<<9) |
40 | #define APIC_SPIV_APIC_ENABLED (1<<8) | 40 | #define APIC_SPIV_APIC_ENABLED (1<<8) |
41 | #define APIC_ISR 0x100 | 41 | #define APIC_ISR 0x100 |
42 | #define APIC_ISR_NR 0x8 /* Number of 32 bit ISR registers. */ | ||
42 | #define APIC_TMR 0x180 | 43 | #define APIC_TMR 0x180 |
43 | #define APIC_IRR 0x200 | 44 | #define APIC_IRR 0x200 |
44 | #define APIC_ESR 0x280 | 45 | #define APIC_ESR 0x280 |
diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h index eb4df23e1e41..79212128d0f7 100644 --- a/include/asm-x86_64/bitops.h +++ b/include/asm-x86_64/bitops.h | |||
@@ -356,14 +356,7 @@ static __inline__ unsigned long __fls(unsigned long word) | |||
356 | 356 | ||
357 | #ifdef __KERNEL__ | 357 | #ifdef __KERNEL__ |
358 | 358 | ||
359 | static inline int sched_find_first_bit(const unsigned long *b) | 359 | #include <asm-generic/bitops/sched.h> |
360 | { | ||
361 | if (b[0]) | ||
362 | return __ffs(b[0]); | ||
363 | if (b[1]) | ||
364 | return __ffs(b[1]) + 64; | ||
365 | return __ffs(b[2]) + 128; | ||
366 | } | ||
367 | 360 | ||
368 | /** | 361 | /** |
369 | * ffs - find first bit set | 362 | * ffs - find first bit set |
@@ -412,43 +405,20 @@ static __inline__ int fls(int x) | |||
412 | return r+1; | 405 | return r+1; |
413 | } | 406 | } |
414 | 407 | ||
415 | /** | 408 | #include <asm-generic/bitops/hweight.h> |
416 | * hweightN - returns the hamming weight of a N-bit word | ||
417 | * @x: the word to weigh | ||
418 | * | ||
419 | * The Hamming Weight of a number is the total number of bits set in it. | ||
420 | */ | ||
421 | |||
422 | #define hweight64(x) generic_hweight64(x) | ||
423 | #define hweight32(x) generic_hweight32(x) | ||
424 | #define hweight16(x) generic_hweight16(x) | ||
425 | #define hweight8(x) generic_hweight8(x) | ||
426 | 409 | ||
427 | #endif /* __KERNEL__ */ | 410 | #endif /* __KERNEL__ */ |
428 | 411 | ||
429 | #ifdef __KERNEL__ | 412 | #ifdef __KERNEL__ |
430 | 413 | ||
431 | #define ext2_set_bit(nr,addr) \ | 414 | #include <asm-generic/bitops/ext2-non-atomic.h> |
432 | __test_and_set_bit((nr),(unsigned long*)addr) | 415 | |
433 | #define ext2_set_bit_atomic(lock,nr,addr) \ | 416 | #define ext2_set_bit_atomic(lock,nr,addr) \ |
434 | test_and_set_bit((nr),(unsigned long*)addr) | 417 | test_and_set_bit((nr),(unsigned long*)addr) |
435 | #define ext2_clear_bit(nr, addr) \ | ||
436 | __test_and_clear_bit((nr),(unsigned long*)addr) | ||
437 | #define ext2_clear_bit_atomic(lock,nr,addr) \ | 418 | #define ext2_clear_bit_atomic(lock,nr,addr) \ |
438 | test_and_clear_bit((nr),(unsigned long*)addr) | 419 | test_and_clear_bit((nr),(unsigned long*)addr) |
439 | #define ext2_test_bit(nr, addr) test_bit((nr),(unsigned long*)addr) | 420 | |
440 | #define ext2_find_first_zero_bit(addr, size) \ | 421 | #include <asm-generic/bitops/minix.h> |
441 | find_first_zero_bit((unsigned long*)addr, size) | ||
442 | #define ext2_find_next_zero_bit(addr, size, off) \ | ||
443 | find_next_zero_bit((unsigned long*)addr, size, off) | ||
444 | |||
445 | /* Bitmap functions for the minix filesystem. */ | ||
446 | #define minix_test_and_set_bit(nr,addr) __test_and_set_bit(nr,(void*)addr) | ||
447 | #define minix_set_bit(nr,addr) __set_bit(nr,(void*)addr) | ||
448 | #define minix_test_and_clear_bit(nr,addr) __test_and_clear_bit(nr,(void*)addr) | ||
449 | #define minix_test_bit(nr,addr) test_bit(nr,(void*)addr) | ||
450 | #define minix_find_first_zero_bit(addr,size) \ | ||
451 | find_first_zero_bit((void*)addr,size) | ||
452 | 422 | ||
453 | #endif /* __KERNEL__ */ | 423 | #endif /* __KERNEL__ */ |
454 | 424 | ||
diff --git a/include/asm-x86_64/dmi.h b/include/asm-x86_64/dmi.h new file mode 100644 index 000000000000..93b2b15d4325 --- /dev/null +++ b/include/asm-x86_64/dmi.h | |||
@@ -0,0 +1,27 @@ | |||
1 | #ifndef _ASM_DMI_H | ||
2 | #define _ASM_DMI_H 1 | ||
3 | |||
4 | #include <asm/io.h> | ||
5 | |||
6 | extern void *dmi_ioremap(unsigned long addr, unsigned long size); | ||
7 | extern void dmi_iounmap(void *addr, unsigned long size); | ||
8 | |||
9 | #define DMI_MAX_DATA 2048 | ||
10 | |||
11 | extern int dmi_alloc_index; | ||
12 | extern char dmi_alloc_data[DMI_MAX_DATA]; | ||
13 | |||
14 | /* This is so early that there is no good way to allocate dynamic memory. | ||
15 | Allocate data in an BSS array. */ | ||
16 | static inline void *dmi_alloc(unsigned len) | ||
17 | { | ||
18 | int idx = dmi_alloc_index; | ||
19 | if ((dmi_alloc_index += len) > DMI_MAX_DATA) | ||
20 | return NULL; | ||
21 | return dmi_alloc_data + idx; | ||
22 | } | ||
23 | |||
24 | #define dmi_ioremap early_ioremap | ||
25 | #define dmi_iounmap early_iounmap | ||
26 | |||
27 | #endif | ||
diff --git a/include/asm-x86_64/elf.h b/include/asm-x86_64/elf.h index 43862cd6a569..c98633af07d2 100644 --- a/include/asm-x86_64/elf.h +++ b/include/asm-x86_64/elf.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <asm/ptrace.h> | 8 | #include <asm/ptrace.h> |
9 | #include <asm/user.h> | 9 | #include <asm/user.h> |
10 | #include <asm/processor.h> | 10 | #include <asm/processor.h> |
11 | #include <asm/compat.h> | ||
11 | 12 | ||
12 | /* x86-64 relocation types */ | 13 | /* x86-64 relocation types */ |
13 | #define R_X86_64_NONE 0 /* No reloc */ | 14 | #define R_X86_64_NONE 0 /* No reloc */ |
@@ -157,6 +158,9 @@ extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *); | |||
157 | #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) | 158 | #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) |
158 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) | 159 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) |
159 | 160 | ||
161 | /* 1GB for 64bit, 8MB for 32bit */ | ||
162 | #define STACK_RND_MASK (is_compat_task() ? 0x7ff : 0x3fffff) | ||
163 | |||
160 | #endif | 164 | #endif |
161 | 165 | ||
162 | #endif | 166 | #endif |
diff --git a/include/asm-x86_64/floppy.h b/include/asm-x86_64/floppy.h index af7ded63b517..52825ce689f2 100644 --- a/include/asm-x86_64/floppy.h +++ b/include/asm-x86_64/floppy.h | |||
@@ -155,7 +155,7 @@ static int fd_request_irq(void) | |||
155 | 155 | ||
156 | static unsigned long dma_mem_alloc(unsigned long size) | 156 | static unsigned long dma_mem_alloc(unsigned long size) |
157 | { | 157 | { |
158 | return __get_dma_pages(GFP_KERNEL,get_order(size)); | 158 | return __get_dma_pages(GFP_KERNEL|__GFP_NORETRY,get_order(size)); |
159 | } | 159 | } |
160 | 160 | ||
161 | 161 | ||
diff --git a/include/asm-x86_64/futex.h b/include/asm-x86_64/futex.h index 8602c09bf89e..9804bf07b092 100644 --- a/include/asm-x86_64/futex.h +++ b/include/asm-x86_64/futex.h | |||
@@ -94,5 +94,32 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
94 | return ret; | 94 | return ret; |
95 | } | 95 | } |
96 | 96 | ||
97 | static inline int | ||
98 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | ||
99 | { | ||
100 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | ||
101 | return -EFAULT; | ||
102 | |||
103 | __asm__ __volatile__( | ||
104 | "1: " LOCK_PREFIX "cmpxchgl %3, %1 \n" | ||
105 | |||
106 | "2: .section .fixup, \"ax\" \n" | ||
107 | "3: mov %2, %0 \n" | ||
108 | " jmp 2b \n" | ||
109 | " .previous \n" | ||
110 | |||
111 | " .section __ex_table, \"a\" \n" | ||
112 | " .align 8 \n" | ||
113 | " .quad 1b,3b \n" | ||
114 | " .previous \n" | ||
115 | |||
116 | : "=a" (oldval), "=m" (*uaddr) | ||
117 | : "i" (-EFAULT), "r" (newval), "0" (oldval) | ||
118 | : "memory" | ||
119 | ); | ||
120 | |||
121 | return oldval; | ||
122 | } | ||
123 | |||
97 | #endif | 124 | #endif |
98 | #endif | 125 | #endif |
diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h index a85fe8370820..cafdfb37f0d8 100644 --- a/include/asm-x86_64/io.h +++ b/include/asm-x86_64/io.h | |||
@@ -135,6 +135,9 @@ static inline void __iomem * ioremap (unsigned long offset, unsigned long size) | |||
135 | return __ioremap(offset, size, 0); | 135 | return __ioremap(offset, size, 0); |
136 | } | 136 | } |
137 | 137 | ||
138 | extern void *early_ioremap(unsigned long addr, unsigned long size); | ||
139 | extern void early_iounmap(void *addr, unsigned long size); | ||
140 | |||
138 | /* | 141 | /* |
139 | * This one maps high address device memory and turns off caching for that area. | 142 | * This one maps high address device memory and turns off caching for that area. |
140 | * it's useful if some control registers are in such an area and write combining | 143 | * it's useful if some control registers are in such an area and write combining |
@@ -143,11 +146,6 @@ static inline void __iomem * ioremap (unsigned long offset, unsigned long size) | |||
143 | extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); | 146 | extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); |
144 | extern void iounmap(volatile void __iomem *addr); | 147 | extern void iounmap(volatile void __iomem *addr); |
145 | 148 | ||
146 | /* Use normal IO mappings for DMI */ | ||
147 | #define dmi_ioremap ioremap | ||
148 | #define dmi_iounmap(x,l) iounmap(x) | ||
149 | #define dmi_alloc(l) kmalloc(l, GFP_ATOMIC) | ||
150 | |||
151 | /* | 149 | /* |
152 | * ISA I/O bus memory addresses are 1:1 with the physical address. | 150 | * ISA I/O bus memory addresses are 1:1 with the physical address. |
153 | */ | 151 | */ |
@@ -202,23 +200,6 @@ static inline __u64 __readq(const volatile void __iomem *addr) | |||
202 | 200 | ||
203 | #define mmiowb() | 201 | #define mmiowb() |
204 | 202 | ||
205 | #ifdef CONFIG_UNORDERED_IO | ||
206 | static inline void __writel(__u32 val, volatile void __iomem *addr) | ||
207 | { | ||
208 | volatile __u32 __iomem *target = addr; | ||
209 | asm volatile("movnti %1,%0" | ||
210 | : "=m" (*target) | ||
211 | : "r" (val) : "memory"); | ||
212 | } | ||
213 | |||
214 | static inline void __writeq(__u64 val, volatile void __iomem *addr) | ||
215 | { | ||
216 | volatile __u64 __iomem *target = addr; | ||
217 | asm volatile("movnti %1,%0" | ||
218 | : "=m" (*target) | ||
219 | : "r" (val) : "memory"); | ||
220 | } | ||
221 | #else | ||
222 | static inline void __writel(__u32 b, volatile void __iomem *addr) | 203 | static inline void __writel(__u32 b, volatile void __iomem *addr) |
223 | { | 204 | { |
224 | *(__force volatile __u32 *)addr = b; | 205 | *(__force volatile __u32 *)addr = b; |
@@ -227,7 +208,6 @@ static inline void __writeq(__u64 b, volatile void __iomem *addr) | |||
227 | { | 208 | { |
228 | *(__force volatile __u64 *)addr = b; | 209 | *(__force volatile __u64 *)addr = b; |
229 | } | 210 | } |
230 | #endif | ||
231 | static inline void __writeb(__u8 b, volatile void __iomem *addr) | 211 | static inline void __writeb(__u8 b, volatile void __iomem *addr) |
232 | { | 212 | { |
233 | *(__force volatile __u8 *)addr = b; | 213 | *(__force volatile __u8 *)addr = b; |
diff --git a/include/asm-x86_64/kdebug.h b/include/asm-x86_64/kdebug.h index b9ed4c0c8783..cf795631d9b4 100644 --- a/include/asm-x86_64/kdebug.h +++ b/include/asm-x86_64/kdebug.h | |||
@@ -5,21 +5,20 @@ | |||
5 | 5 | ||
6 | struct pt_regs; | 6 | struct pt_regs; |
7 | 7 | ||
8 | struct die_args { | 8 | struct die_args { |
9 | struct pt_regs *regs; | 9 | struct pt_regs *regs; |
10 | const char *str; | 10 | const char *str; |
11 | long err; | 11 | long err; |
12 | int trapnr; | 12 | int trapnr; |
13 | int signr; | 13 | int signr; |
14 | }; | 14 | }; |
15 | |||
16 | extern int register_die_notifier(struct notifier_block *); | ||
17 | extern int unregister_die_notifier(struct notifier_block *); | ||
18 | extern struct atomic_notifier_head die_chain; | ||
15 | 19 | ||
16 | /* Note - you should never unregister because that can race with NMIs. | ||
17 | If you really want to do it first unregister - then synchronize_sched - then free. | ||
18 | */ | ||
19 | int register_die_notifier(struct notifier_block *nb); | ||
20 | extern struct notifier_block *die_chain; | ||
21 | /* Grossly misnamed. */ | 20 | /* Grossly misnamed. */ |
22 | enum die_val { | 21 | enum die_val { |
23 | DIE_OOPS = 1, | 22 | DIE_OOPS = 1, |
24 | DIE_INT3, | 23 | DIE_INT3, |
25 | DIE_DEBUG, | 24 | DIE_DEBUG, |
@@ -33,8 +32,8 @@ enum die_val { | |||
33 | DIE_CALL, | 32 | DIE_CALL, |
34 | DIE_NMI_IPI, | 33 | DIE_NMI_IPI, |
35 | DIE_PAGE_FAULT, | 34 | DIE_PAGE_FAULT, |
36 | }; | 35 | }; |
37 | 36 | ||
38 | static inline int notify_die(enum die_val val, const char *str, | 37 | static inline int notify_die(enum die_val val, const char *str, |
39 | struct pt_regs *regs, long err, int trap, int sig) | 38 | struct pt_regs *regs, long err, int trap, int sig) |
40 | { | 39 | { |
@@ -45,7 +44,7 @@ static inline int notify_die(enum die_val val, const char *str, | |||
45 | .trapnr = trap, | 44 | .trapnr = trap, |
46 | .signr = sig | 45 | .signr = sig |
47 | }; | 46 | }; |
48 | return notifier_call_chain(&die_chain, val, &args); | 47 | return atomic_notifier_call_chain(&die_chain, val, &args); |
49 | } | 48 | } |
50 | 49 | ||
51 | extern int printk_address(unsigned long address); | 50 | extern int printk_address(unsigned long address); |
diff --git a/include/asm-x86_64/local.h b/include/asm-x86_64/local.h index 3e72c41727c5..bf148037d4e5 100644 --- a/include/asm-x86_64/local.h +++ b/include/asm-x86_64/local.h | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | typedef struct | 6 | typedef struct |
7 | { | 7 | { |
8 | volatile unsigned int counter; | 8 | volatile unsigned long counter; |
9 | } local_t; | 9 | } local_t; |
10 | 10 | ||
11 | #define LOCAL_INIT(i) { (i) } | 11 | #define LOCAL_INIT(i) { (i) } |
@@ -16,7 +16,7 @@ typedef struct | |||
16 | static __inline__ void local_inc(local_t *v) | 16 | static __inline__ void local_inc(local_t *v) |
17 | { | 17 | { |
18 | __asm__ __volatile__( | 18 | __asm__ __volatile__( |
19 | "incl %0" | 19 | "incq %0" |
20 | :"=m" (v->counter) | 20 | :"=m" (v->counter) |
21 | :"m" (v->counter)); | 21 | :"m" (v->counter)); |
22 | } | 22 | } |
@@ -24,7 +24,7 @@ static __inline__ void local_inc(local_t *v) | |||
24 | static __inline__ void local_dec(local_t *v) | 24 | static __inline__ void local_dec(local_t *v) |
25 | { | 25 | { |
26 | __asm__ __volatile__( | 26 | __asm__ __volatile__( |
27 | "decl %0" | 27 | "decq %0" |
28 | :"=m" (v->counter) | 28 | :"=m" (v->counter) |
29 | :"m" (v->counter)); | 29 | :"m" (v->counter)); |
30 | } | 30 | } |
@@ -32,7 +32,7 @@ static __inline__ void local_dec(local_t *v) | |||
32 | static __inline__ void local_add(unsigned int i, local_t *v) | 32 | static __inline__ void local_add(unsigned int i, local_t *v) |
33 | { | 33 | { |
34 | __asm__ __volatile__( | 34 | __asm__ __volatile__( |
35 | "addl %1,%0" | 35 | "addq %1,%0" |
36 | :"=m" (v->counter) | 36 | :"=m" (v->counter) |
37 | :"ir" (i), "m" (v->counter)); | 37 | :"ir" (i), "m" (v->counter)); |
38 | } | 38 | } |
@@ -40,7 +40,7 @@ static __inline__ void local_add(unsigned int i, local_t *v) | |||
40 | static __inline__ void local_sub(unsigned int i, local_t *v) | 40 | static __inline__ void local_sub(unsigned int i, local_t *v) |
41 | { | 41 | { |
42 | __asm__ __volatile__( | 42 | __asm__ __volatile__( |
43 | "subl %1,%0" | 43 | "subq %1,%0" |
44 | :"=m" (v->counter) | 44 | :"=m" (v->counter) |
45 | :"ir" (i), "m" (v->counter)); | 45 | :"ir" (i), "m" (v->counter)); |
46 | } | 46 | } |
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h index 972c9359f7d7..6b18cd8f293d 100644 --- a/include/asm-x86_64/mmzone.h +++ b/include/asm-x86_64/mmzone.h | |||
@@ -15,8 +15,13 @@ | |||
15 | #define NODEMAPSIZE 0xfff | 15 | #define NODEMAPSIZE 0xfff |
16 | 16 | ||
17 | /* Simple perfect hash to map physical addresses to node numbers */ | 17 | /* Simple perfect hash to map physical addresses to node numbers */ |
18 | extern int memnode_shift; | 18 | struct memnode { |
19 | extern u8 memnodemap[NODEMAPSIZE]; | 19 | int shift; |
20 | u8 map[NODEMAPSIZE]; | ||
21 | } ____cacheline_aligned; | ||
22 | extern struct memnode memnode; | ||
23 | #define memnode_shift memnode.shift | ||
24 | #define memnodemap memnode.map | ||
20 | 25 | ||
21 | extern struct pglist_data *node_data[]; | 26 | extern struct pglist_data *node_data[]; |
22 | 27 | ||
@@ -39,12 +44,8 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) | |||
39 | #define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT) | 44 | #define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT) |
40 | #define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr)) | 45 | #define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr)) |
41 | 46 | ||
42 | extern struct page *pfn_to_page(unsigned long pfn); | ||
43 | extern unsigned long page_to_pfn(struct page *page); | ||
44 | extern int pfn_valid(unsigned long pfn); | 47 | extern int pfn_valid(unsigned long pfn); |
45 | #endif | 48 | #endif |
46 | 49 | ||
47 | #define local_mapnr(kvaddr) \ | ||
48 | ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) ) | ||
49 | #endif | 50 | #endif |
50 | #endif | 51 | #endif |
diff --git a/include/asm-x86_64/numa.h b/include/asm-x86_64/numa.h index dffe276ca2df..f6cbb4cbb5a3 100644 --- a/include/asm-x86_64/numa.h +++ b/include/asm-x86_64/numa.h | |||
@@ -4,11 +4,11 @@ | |||
4 | #include <linux/nodemask.h> | 4 | #include <linux/nodemask.h> |
5 | #include <asm/numnodes.h> | 5 | #include <asm/numnodes.h> |
6 | 6 | ||
7 | struct node { | 7 | struct bootnode { |
8 | u64 start,end; | 8 | u64 start,end; |
9 | }; | 9 | }; |
10 | 10 | ||
11 | extern int compute_hash_shift(struct node *nodes, int numnodes); | 11 | extern int compute_hash_shift(struct bootnode *nodes, int numnodes); |
12 | extern int pxm_to_node(int nid); | 12 | extern int pxm_to_node(int nid); |
13 | 13 | ||
14 | #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) | 14 | #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) |
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h index 615e3e494929..408185bac351 100644 --- a/include/asm-x86_64/page.h +++ b/include/asm-x86_64/page.h | |||
@@ -123,8 +123,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
123 | #define __boot_va(x) __va(x) | 123 | #define __boot_va(x) __va(x) |
124 | #define __boot_pa(x) __pa(x) | 124 | #define __boot_pa(x) __pa(x) |
125 | #ifdef CONFIG_FLATMEM | 125 | #ifdef CONFIG_FLATMEM |
126 | #define pfn_to_page(pfn) (mem_map + (pfn)) | ||
127 | #define page_to_pfn(page) ((unsigned long)((page) - mem_map)) | ||
128 | #define pfn_valid(pfn) ((pfn) < end_pfn) | 126 | #define pfn_valid(pfn) ((pfn) < end_pfn) |
129 | #endif | 127 | #endif |
130 | 128 | ||
@@ -140,6 +138,7 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
140 | 138 | ||
141 | #endif /* __KERNEL__ */ | 139 | #endif /* __KERNEL__ */ |
142 | 140 | ||
141 | #include <asm-generic/memory_model.h> | ||
143 | #include <asm-generic/page.h> | 142 | #include <asm-generic/page.h> |
144 | 143 | ||
145 | #endif /* _X86_64_PAGE_H */ | 144 | #endif /* _X86_64_PAGE_H */ |
diff --git a/include/asm-x86_64/pda.h b/include/asm-x86_64/pda.h index c7ab38a601af..b47c3df9ed1d 100644 --- a/include/asm-x86_64/pda.h +++ b/include/asm-x86_64/pda.h | |||
@@ -22,8 +22,8 @@ struct x8664_pda { | |||
22 | int nodenumber; /* number of current node */ | 22 | int nodenumber; /* number of current node */ |
23 | unsigned int __softirq_pending; | 23 | unsigned int __softirq_pending; |
24 | unsigned int __nmi_count; /* number of NMI on this CPUs */ | 24 | unsigned int __nmi_count; /* number of NMI on this CPUs */ |
25 | struct mm_struct *active_mm; | ||
26 | int mmu_state; | 25 | int mmu_state; |
26 | struct mm_struct *active_mm; | ||
27 | unsigned apic_timer_irqs; | 27 | unsigned apic_timer_irqs; |
28 | } ____cacheline_aligned_in_smp; | 28 | } ____cacheline_aligned_in_smp; |
29 | 29 | ||
diff --git a/include/asm-x86_64/pgalloc.h b/include/asm-x86_64/pgalloc.h index 08cad2482bcb..43d4c333a8b1 100644 --- a/include/asm-x86_64/pgalloc.h +++ b/include/asm-x86_64/pgalloc.h | |||
@@ -45,12 +45,39 @@ static inline void pud_free (pud_t *pud) | |||
45 | free_page((unsigned long)pud); | 45 | free_page((unsigned long)pud); |
46 | } | 46 | } |
47 | 47 | ||
48 | static inline void pgd_list_add(pgd_t *pgd) | ||
49 | { | ||
50 | struct page *page = virt_to_page(pgd); | ||
51 | |||
52 | spin_lock(&pgd_lock); | ||
53 | page->index = (pgoff_t)pgd_list; | ||
54 | if (pgd_list) | ||
55 | pgd_list->private = (unsigned long)&page->index; | ||
56 | pgd_list = page; | ||
57 | page->private = (unsigned long)&pgd_list; | ||
58 | spin_unlock(&pgd_lock); | ||
59 | } | ||
60 | |||
61 | static inline void pgd_list_del(pgd_t *pgd) | ||
62 | { | ||
63 | struct page *next, **pprev, *page = virt_to_page(pgd); | ||
64 | |||
65 | spin_lock(&pgd_lock); | ||
66 | next = (struct page *)page->index; | ||
67 | pprev = (struct page **)page->private; | ||
68 | *pprev = next; | ||
69 | if (next) | ||
70 | next->private = (unsigned long)pprev; | ||
71 | spin_unlock(&pgd_lock); | ||
72 | } | ||
73 | |||
48 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) | 74 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) |
49 | { | 75 | { |
50 | unsigned boundary; | 76 | unsigned boundary; |
51 | pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); | 77 | pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); |
52 | if (!pgd) | 78 | if (!pgd) |
53 | return NULL; | 79 | return NULL; |
80 | pgd_list_add(pgd); | ||
54 | /* | 81 | /* |
55 | * Copy kernel pointers in from init. | 82 | * Copy kernel pointers in from init. |
56 | * Could keep a freelist or slab cache of those because the kernel | 83 | * Could keep a freelist or slab cache of those because the kernel |
@@ -67,6 +94,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
67 | static inline void pgd_free(pgd_t *pgd) | 94 | static inline void pgd_free(pgd_t *pgd) |
68 | { | 95 | { |
69 | BUG_ON((unsigned long)pgd & (PAGE_SIZE-1)); | 96 | BUG_ON((unsigned long)pgd & (PAGE_SIZE-1)); |
97 | pgd_list_del(pgd); | ||
70 | free_page((unsigned long)pgd); | 98 | free_page((unsigned long)pgd); |
71 | } | 99 | } |
72 | 100 | ||
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index def903287193..31e83c3bd022 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -420,6 +420,10 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
420 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) | 420 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) |
421 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | 421 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) |
422 | 422 | ||
423 | extern spinlock_t pgd_lock; | ||
424 | extern struct page *pgd_list; | ||
425 | void vmalloc_sync_all(void); | ||
426 | |||
423 | #endif /* !__ASSEMBLY__ */ | 427 | #endif /* !__ASSEMBLY__ */ |
424 | 428 | ||
425 | extern int kern_addr_valid(unsigned long addr); | 429 | extern int kern_addr_valid(unsigned long addr); |
diff --git a/include/asm-x86_64/poll.h b/include/asm-x86_64/poll.h index c43cbba31913..c0475a9d8bb8 100644 --- a/include/asm-x86_64/poll.h +++ b/include/asm-x86_64/poll.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define POLLWRBAND 0x0200 | 16 | #define POLLWRBAND 0x0200 |
17 | #define POLLMSG 0x0400 | 17 | #define POLLMSG 0x0400 |
18 | #define POLLREMOVE 0x1000 | 18 | #define POLLREMOVE 0x1000 |
19 | #define POLLRDHUP 0x2000 | ||
19 | 20 | ||
20 | struct pollfd { | 21 | struct pollfd { |
21 | int fd; | 22 | int fd; |
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h index 8c8d88c036ed..37a3ec433ee5 100644 --- a/include/asm-x86_64/processor.h +++ b/include/asm-x86_64/processor.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <asm/mmsegment.h> | 20 | #include <asm/mmsegment.h> |
21 | #include <asm/percpu.h> | 21 | #include <asm/percpu.h> |
22 | #include <linux/personality.h> | 22 | #include <linux/personality.h> |
23 | #include <linux/cpumask.h> | ||
23 | 24 | ||
24 | #define TF_MASK 0x00000100 | 25 | #define TF_MASK 0x00000100 |
25 | #define IF_MASK 0x00000200 | 26 | #define IF_MASK 0x00000200 |
@@ -65,6 +66,9 @@ struct cpuinfo_x86 { | |||
65 | __u32 x86_power; | 66 | __u32 x86_power; |
66 | __u32 extended_cpuid_level; /* Max extended CPUID function supported */ | 67 | __u32 extended_cpuid_level; /* Max extended CPUID function supported */ |
67 | unsigned long loops_per_jiffy; | 68 | unsigned long loops_per_jiffy; |
69 | #ifdef CONFIG_SMP | ||
70 | cpumask_t llc_shared_map; /* cpus sharing the last level cache */ | ||
71 | #endif | ||
68 | __u8 apicid; | 72 | __u8 apicid; |
69 | __u8 booted_cores; /* number of cores as seen by OS */ | 73 | __u8 booted_cores; /* number of cores as seen by OS */ |
70 | } ____cacheline_aligned; | 74 | } ____cacheline_aligned; |
@@ -354,9 +358,6 @@ struct extended_sigtable { | |||
354 | struct extended_signature sigs[0]; | 358 | struct extended_signature sigs[0]; |
355 | }; | 359 | }; |
356 | 360 | ||
357 | /* '6' because it used to be for P6 only (but now covers Pentium 4 as well) */ | ||
358 | #define MICROCODE_IOCFREE _IO('6',0) | ||
359 | |||
360 | 361 | ||
361 | #define ASM_NOP1 K8_NOP1 | 362 | #define ASM_NOP1 K8_NOP1 |
362 | #define ASM_NOP2 K8_NOP2 | 363 | #define ASM_NOP2 K8_NOP2 |
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index 3ba8fd45fcb3..8abf2a43c944 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h | |||
@@ -53,8 +53,6 @@ extern int sysctl_vsyscall; | |||
53 | extern int nohpet; | 53 | extern int nohpet; |
54 | extern unsigned long vxtime_hz; | 54 | extern unsigned long vxtime_hz; |
55 | 55 | ||
56 | extern void do_softirq_thunk(void); | ||
57 | |||
58 | extern int numa_setup(char *opt); | 56 | extern int numa_setup(char *opt); |
59 | 57 | ||
60 | extern int setup_early_printk(char *); | 58 | extern int setup_early_printk(char *); |
@@ -129,7 +127,6 @@ extern int fix_aperture; | |||
129 | #define iommu_aperture 0 | 127 | #define iommu_aperture 0 |
130 | #define iommu_aperture_allowed 0 | 128 | #define iommu_aperture_allowed 0 |
131 | #endif | 129 | #endif |
132 | extern int force_iommu; | ||
133 | 130 | ||
134 | extern int reboot_force; | 131 | extern int reboot_force; |
135 | extern int notsc_setup(char *); | 132 | extern int notsc_setup(char *); |
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h index 9ccbb2cfd5c0..a4fdaeb5c397 100644 --- a/include/asm-x86_64/smp.h +++ b/include/asm-x86_64/smp.h | |||
@@ -56,6 +56,7 @@ extern cpumask_t cpu_sibling_map[NR_CPUS]; | |||
56 | extern cpumask_t cpu_core_map[NR_CPUS]; | 56 | extern cpumask_t cpu_core_map[NR_CPUS]; |
57 | extern u8 phys_proc_id[NR_CPUS]; | 57 | extern u8 phys_proc_id[NR_CPUS]; |
58 | extern u8 cpu_core_id[NR_CPUS]; | 58 | extern u8 cpu_core_id[NR_CPUS]; |
59 | extern u8 cpu_llc_id[NR_CPUS]; | ||
59 | 60 | ||
60 | #define SMP_TRAMPOLINE_BASE 0x6000 | 61 | #define SMP_TRAMPOLINE_BASE 0x6000 |
61 | 62 | ||
diff --git a/include/asm-x86_64/string.h b/include/asm-x86_64/string.h index a3493ee282bb..ee6bf275349e 100644 --- a/include/asm-x86_64/string.h +++ b/include/asm-x86_64/string.h | |||
@@ -40,26 +40,15 @@ extern void *__memcpy(void *to, const void *from, size_t len); | |||
40 | 40 | ||
41 | 41 | ||
42 | #define __HAVE_ARCH_MEMSET | 42 | #define __HAVE_ARCH_MEMSET |
43 | #define memset __builtin_memset | 43 | void *memset(void *s, int c, size_t n); |
44 | 44 | ||
45 | #define __HAVE_ARCH_MEMMOVE | 45 | #define __HAVE_ARCH_MEMMOVE |
46 | void * memmove(void * dest,const void *src,size_t count); | 46 | void * memmove(void * dest,const void *src,size_t count); |
47 | 47 | ||
48 | /* Use C out of line version for memcmp */ | ||
49 | #define memcmp __builtin_memcmp | ||
50 | int memcmp(const void * cs,const void * ct,size_t count); | 48 | int memcmp(const void * cs,const void * ct,size_t count); |
51 | |||
52 | /* out of line string functions use always C versions */ | ||
53 | #define strlen __builtin_strlen | ||
54 | size_t strlen(const char * s); | 49 | size_t strlen(const char * s); |
55 | 50 | char *strcpy(char * dest,const char *src); | |
56 | #define strcpy __builtin_strcpy | 51 | char *strcat(char * dest, const char * src); |
57 | char * strcpy(char * dest,const char *src); | ||
58 | |||
59 | #define strcat __builtin_strcat | ||
60 | char * strcat(char * dest, const char * src); | ||
61 | |||
62 | #define strcmp __builtin_strcmp | ||
63 | int strcmp(const char * cs,const char * ct); | 52 | int strcmp(const char * cs,const char * ct); |
64 | 53 | ||
65 | #endif /* __KERNEL__ */ | 54 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-x86_64/suspend.h b/include/asm-x86_64/suspend.h index bb9f40597d09..bc7f81715e5e 100644 --- a/include/asm-x86_64/suspend.h +++ b/include/asm-x86_64/suspend.h | |||
@@ -39,9 +39,7 @@ extern unsigned long saved_context_r12, saved_context_r13, saved_context_r14, sa | |||
39 | extern unsigned long saved_context_eflags; | 39 | extern unsigned long saved_context_eflags; |
40 | 40 | ||
41 | #define loaddebug(thread,register) \ | 41 | #define loaddebug(thread,register) \ |
42 | __asm__("movq %0,%%db" #register \ | 42 | set_debugreg((thread)->debugreg##register, register) |
43 | : /* no output */ \ | ||
44 | :"r" ((thread)->debugreg##register)) | ||
45 | 43 | ||
46 | extern void fix_processor_context(void); | 44 | extern void fix_processor_context(void); |
47 | 45 | ||
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index b7f66034ae7a..397598980228 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h | |||
@@ -70,12 +70,6 @@ extern void load_gs_index(unsigned); | |||
70 | ".previous" \ | 70 | ".previous" \ |
71 | : :"r" (value), "r" (0)) | 71 | : :"r" (value), "r" (0)) |
72 | 72 | ||
73 | #define set_debug(value,register) \ | ||
74 | __asm__("movq %0,%%db" #register \ | ||
75 | : /* no output */ \ | ||
76 | :"r" ((unsigned long) value)) | ||
77 | |||
78 | |||
79 | #ifdef __KERNEL__ | 73 | #ifdef __KERNEL__ |
80 | struct alt_instr { | 74 | struct alt_instr { |
81 | __u8 *instr; /* original instruction */ | 75 | __u8 *instr; /* original instruction */ |
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h index c642f5d9882d..9db54e9d17bb 100644 --- a/include/asm-x86_64/topology.h +++ b/include/asm-x86_64/topology.h | |||
@@ -68,4 +68,6 @@ extern int __node_distance(int, int); | |||
68 | 68 | ||
69 | #include <asm-generic/topology.h> | 69 | #include <asm-generic/topology.h> |
70 | 70 | ||
71 | extern cpumask_t cpu_coregroup_map(int cpu); | ||
72 | |||
71 | #endif | 73 | #endif |
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index da0341c57949..fcc516353087 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h | |||
@@ -605,8 +605,12 @@ __SYSCALL(__NR_pselect6, sys_ni_syscall) /* for now */ | |||
605 | __SYSCALL(__NR_ppoll, sys_ni_syscall) /* for now */ | 605 | __SYSCALL(__NR_ppoll, sys_ni_syscall) /* for now */ |
606 | #define __NR_unshare 272 | 606 | #define __NR_unshare 272 |
607 | __SYSCALL(__NR_unshare, sys_unshare) | 607 | __SYSCALL(__NR_unshare, sys_unshare) |
608 | #define __NR_set_robust_list 273 | ||
609 | __SYSCALL(__NR_set_robust_list, sys_set_robust_list) | ||
610 | #define __NR_get_robust_list 274 | ||
611 | __SYSCALL(__NR_get_robust_list, sys_get_robust_list) | ||
608 | 612 | ||
609 | #define __NR_syscall_max __NR_unshare | 613 | #define __NR_syscall_max __NR_get_robust_list |
610 | 614 | ||
611 | #ifndef __NO_STUBS | 615 | #ifndef __NO_STUBS |
612 | 616 | ||