diff options
author | Zachary Amsden <zach@vmware.com> | 2006-01-06 03:11:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:34 -0500 |
commit | ff6e8c0d5e47f0ceeebde86ec2f5919dbd5beb67 (patch) | |
tree | f7e50b5962b7b38ca025c0bf9ee48b618424cc6b /include/asm-i386/system.h | |
parent | eb05c3249a8e8a675e79d221f4a0874dc10ec903 (diff) |
[PATCH] x86: Cr4 is valid on some 486s
So some 486 processors do have CR4 register. Allow them to present it in
register dumps by using the old fault technique rather than testing processor
family.
Thanks to Maciej for noticing this.
Signed-off-by: Zachary Amsden <zach@vmware.com>
Cc: "Seth, Rohit" <rohit.seth@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-i386/system.h')
-rw-r--r-- | include/asm-i386/system.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 772f85da1206..88b4d5c6f37a 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h | |||
@@ -140,6 +140,19 @@ static inline unsigned long _get_base(char * addr) | |||
140 | :"=r" (__dummy)); \ | 140 | :"=r" (__dummy)); \ |
141 | __dummy; \ | 141 | __dummy; \ |
142 | }) | 142 | }) |
143 | |||
144 | #define read_cr4_safe() ({ \ | ||
145 | unsigned int __dummy; \ | ||
146 | /* This could fault if %cr4 does not exist */ \ | ||
147 | __asm__("1: movl %%cr4, %0 \n" \ | ||
148 | "2: \n" \ | ||
149 | ".section __ex_table,\"a\" \n" \ | ||
150 | ".long 1b,2b \n" \ | ||
151 | ".previous \n" \ | ||
152 | : "=r" (__dummy): "0" (0)); \ | ||
153 | __dummy; \ | ||
154 | }) | ||
155 | |||
143 | #define write_cr4(x) \ | 156 | #define write_cr4(x) \ |
144 | __asm__ __volatile__("movl %0,%%cr4": :"r" (x)); | 157 | __asm__ __volatile__("movl %0,%%cr4": :"r" (x)); |
145 | #define stts() write_cr0(8 | read_cr0()) | 158 | #define stts() write_cr0(8 | read_cr0()) |