diff options
Diffstat (limited to 'include/asm-x86/system_32.h')
-rw-r--r-- | include/asm-x86/system_32.h | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/include/asm-x86/system_32.h b/include/asm-x86/system_32.h index 8db478984ed1..c05568290add 100644 --- a/include/asm-x86/system_32.h +++ b/include/asm-x86/system_32.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/kernel.h> | ||
5 | #include <asm/segment.h> | 4 | #include <asm/segment.h> |
6 | #include <asm/cpufeature.h> | 5 | #include <asm/cpufeature.h> |
7 | #include <asm/cmpxchg.h> | 6 | #include <asm/cmpxchg.h> |
@@ -34,99 +33,6 @@ extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struc | |||
34 | "2" (prev), "d" (next)); \ | 33 | "2" (prev), "d" (next)); \ |
35 | } while (0) | 34 | } while (0) |
36 | 35 | ||
37 | static inline void native_clts(void) | ||
38 | { | ||
39 | asm volatile ("clts"); | ||
40 | } | ||
41 | |||
42 | static inline unsigned long native_read_cr0(void) | ||
43 | { | ||
44 | unsigned long val; | ||
45 | asm volatile("movl %%cr0,%0\n\t" :"=r" (val)); | ||
46 | return val; | ||
47 | } | ||
48 | |||
49 | static inline void native_write_cr0(unsigned long val) | ||
50 | { | ||
51 | asm volatile("movl %0,%%cr0": :"r" (val)); | ||
52 | } | ||
53 | |||
54 | static inline unsigned long native_read_cr2(void) | ||
55 | { | ||
56 | unsigned long val; | ||
57 | asm volatile("movl %%cr2,%0\n\t" :"=r" (val)); | ||
58 | return val; | ||
59 | } | ||
60 | |||
61 | static inline void native_write_cr2(unsigned long val) | ||
62 | { | ||
63 | asm volatile("movl %0,%%cr2": :"r" (val)); | ||
64 | } | ||
65 | |||
66 | static inline unsigned long native_read_cr3(void) | ||
67 | { | ||
68 | unsigned long val; | ||
69 | asm volatile("movl %%cr3,%0\n\t" :"=r" (val)); | ||
70 | return val; | ||
71 | } | ||
72 | |||
73 | static inline void native_write_cr3(unsigned long val) | ||
74 | { | ||
75 | asm volatile("movl %0,%%cr3": :"r" (val)); | ||
76 | } | ||
77 | |||
78 | static inline unsigned long native_read_cr4(void) | ||
79 | { | ||
80 | unsigned long val; | ||
81 | asm volatile("movl %%cr4,%0\n\t" :"=r" (val)); | ||
82 | return val; | ||
83 | } | ||
84 | |||
85 | static inline unsigned long native_read_cr4_safe(void) | ||
86 | { | ||
87 | unsigned long val; | ||
88 | /* This could fault if %cr4 does not exist */ | ||
89 | asm volatile("1: movl %%cr4, %0 \n" | ||
90 | "2: \n" | ||
91 | ".section __ex_table,\"a\" \n" | ||
92 | ".long 1b,2b \n" | ||
93 | ".previous \n" | ||
94 | : "=r" (val): "0" (0)); | ||
95 | return val; | ||
96 | } | ||
97 | |||
98 | static inline void native_write_cr4(unsigned long val) | ||
99 | { | ||
100 | asm volatile("movl %0,%%cr4": :"r" (val)); | ||
101 | } | ||
102 | |||
103 | static inline void native_wbinvd(void) | ||
104 | { | ||
105 | asm volatile("wbinvd": : :"memory"); | ||
106 | } | ||
107 | |||
108 | #ifdef CONFIG_PARAVIRT | ||
109 | #include <asm/paravirt.h> | ||
110 | #else | ||
111 | #define read_cr0() (native_read_cr0()) | ||
112 | #define write_cr0(x) (native_write_cr0(x)) | ||
113 | #define read_cr2() (native_read_cr2()) | ||
114 | #define write_cr2(x) (native_write_cr2(x)) | ||
115 | #define read_cr3() (native_read_cr3()) | ||
116 | #define write_cr3(x) (native_write_cr3(x)) | ||
117 | #define read_cr4() (native_read_cr4()) | ||
118 | #define read_cr4_safe() (native_read_cr4_safe()) | ||
119 | #define write_cr4(x) (native_write_cr4(x)) | ||
120 | #define wbinvd() (native_wbinvd()) | ||
121 | |||
122 | /* Clear the 'TS' bit */ | ||
123 | #define clts() (native_clts()) | ||
124 | |||
125 | #endif/* CONFIG_PARAVIRT */ | ||
126 | |||
127 | /* Set the 'TS' bit */ | ||
128 | #define stts() write_cr0(8 | read_cr0()) | ||
129 | |||
130 | #endif /* __KERNEL__ */ | 36 | #endif /* __KERNEL__ */ |
131 | 37 | ||
132 | 38 | ||