diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-05 17:55:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-05 17:55:20 -0400 |
commit | ea62ccd00fd0b6720b033adfc9984f31130ce195 (patch) | |
tree | 9837b797b2466fffcb0af96c388b06eae9c3df18 /include/asm-i386/alternative.h | |
parent | 886a0768affe9a32f18c45f8e1393bca9ece5392 (diff) | |
parent | 35060b6a9a4e1c89bc6fbea61090e302dbc61847 (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: (231 commits)
[PATCH] i386: Don't delete cpu_devs data to identify different x86 types in late_initcall
[PATCH] i386: type may be unused
[PATCH] i386: Some additional chipset register values validation.
[PATCH] i386: Add missing !X86_PAE dependincy to the 2G/2G split.
[PATCH] x86-64: Don't exclude asm-offsets.c in Documentation/dontdiff
[PATCH] i386: avoid redundant preempt_disable in __unlazy_fpu
[PATCH] i386: white space fixes in i387.h
[PATCH] i386: Drop noisy e820 debugging printks
[PATCH] x86-64: Fix allnoconfig error in genapic_flat.c
[PATCH] x86-64: Shut up warnings for vfat compat ioctls on other file systems
[PATCH] x86-64: Share identical video.S between i386 and x86-64
[PATCH] x86-64: Remove CONFIG_REORDER
[PATCH] x86-64: Print type and size correctly for unknown compat ioctls
[PATCH] i386: Remove copy_*_user BUG_ONs for (size < 0)
[PATCH] i386: Little cleanups in smpboot.c
[PATCH] x86-64: Don't enable NUMA for a single node in K8 NUMA scanning
[PATCH] x86: Use RDTSCP for synchronous get_cycles if possible
[PATCH] i386: Add X86_FEATURE_RDTSCP
[PATCH] i386: Implement X86_FEATURE_SYNC_RDTSC on i386
[PATCH] i386: Implement alternative_io for i386
...
Fix up trivial conflict in include/linux/highmem.h manually.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-i386/alternative.h')
-rw-r--r-- | include/asm-i386/alternative.h | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h index b8fa9557c532..0f70b379b029 100644 --- a/include/asm-i386/alternative.h +++ b/include/asm-i386/alternative.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _I386_ALTERNATIVE_H | 1 | #ifndef _I386_ALTERNATIVE_H |
2 | #define _I386_ALTERNATIVE_H | 2 | #define _I386_ALTERNATIVE_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <asm/types.h> | 4 | #include <asm/types.h> |
7 | #include <linux/stddef.h> | 5 | #include <linux/stddef.h> |
8 | #include <linux/types.h> | 6 | #include <linux/types.h> |
@@ -16,6 +14,7 @@ struct alt_instr { | |||
16 | u8 pad; | 14 | u8 pad; |
17 | }; | 15 | }; |
18 | 16 | ||
17 | extern void alternative_instructions(void); | ||
19 | extern void apply_alternatives(struct alt_instr *start, struct alt_instr *end); | 18 | extern void apply_alternatives(struct alt_instr *start, struct alt_instr *end); |
20 | 19 | ||
21 | struct module; | 20 | struct module; |
@@ -31,9 +30,7 @@ static inline void alternatives_smp_module_add(struct module *mod, char *name, | |||
31 | void *text, void *text_end) {} | 30 | void *text, void *text_end) {} |
32 | static inline void alternatives_smp_module_del(struct module *mod) {} | 31 | static inline void alternatives_smp_module_del(struct module *mod) {} |
33 | static inline void alternatives_smp_switch(int smp) {} | 32 | static inline void alternatives_smp_switch(int smp) {} |
34 | #endif | 33 | #endif /* CONFIG_SMP */ |
35 | |||
36 | #endif | ||
37 | 34 | ||
38 | /* | 35 | /* |
39 | * Alternative instructions for different CPU types or capabilities. | 36 | * Alternative instructions for different CPU types or capabilities. |
@@ -85,6 +82,21 @@ static inline void alternatives_smp_switch(int smp) {} | |||
85 | "663:\n\t" newinstr "\n664:\n" /* replacement */\ | 82 | "663:\n\t" newinstr "\n664:\n" /* replacement */\ |
86 | ".previous" :: "i" (feature), ##input) | 83 | ".previous" :: "i" (feature), ##input) |
87 | 84 | ||
85 | /* Like alternative_input, but with a single output argument */ | ||
86 | #define alternative_io(oldinstr, newinstr, feature, output, input...) \ | ||
87 | asm volatile ("661:\n\t" oldinstr "\n662:\n" \ | ||
88 | ".section .altinstructions,\"a\"\n" \ | ||
89 | " .align 4\n" \ | ||
90 | " .long 661b\n" /* label */ \ | ||
91 | " .long 663f\n" /* new instruction */ \ | ||
92 | " .byte %c[feat]\n" /* feature bit */ \ | ||
93 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
94 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
95 | ".previous\n" \ | ||
96 | ".section .altinstr_replacement,\"ax\"\n" \ | ||
97 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | ||
98 | ".previous" : output : [feat] "i" (feature), ##input) | ||
99 | |||
88 | /* | 100 | /* |
89 | * Alternative inline assembly for SMP. | 101 | * Alternative inline assembly for SMP. |
90 | * | 102 | * |
@@ -118,15 +130,17 @@ static inline void alternatives_smp_switch(int smp) {} | |||
118 | #define LOCK_PREFIX "" | 130 | #define LOCK_PREFIX "" |
119 | #endif | 131 | #endif |
120 | 132 | ||
121 | struct paravirt_patch; | 133 | struct paravirt_patch_site; |
122 | #ifdef CONFIG_PARAVIRT | 134 | #ifdef CONFIG_PARAVIRT |
123 | void apply_paravirt(struct paravirt_patch *start, struct paravirt_patch *end); | 135 | void apply_paravirt(struct paravirt_patch_site *start, |
136 | struct paravirt_patch_site *end); | ||
124 | #else | 137 | #else |
125 | static inline void | 138 | static inline void |
126 | apply_paravirt(struct paravirt_patch *start, struct paravirt_patch *end) | 139 | apply_paravirt(struct paravirt_patch_site *start, |
140 | struct paravirt_patch_site *end) | ||
127 | {} | 141 | {} |
128 | #define __start_parainstructions NULL | 142 | #define __parainstructions NULL |
129 | #define __stop_parainstructions NULL | 143 | #define __parainstructions_end NULL |
130 | #endif | 144 | #endif |
131 | 145 | ||
132 | #endif /* _I386_ALTERNATIVE_H */ | 146 | #endif /* _I386_ALTERNATIVE_H */ |