aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/system_64.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/system_64.h')
-rw-r--r--include/asm-x86/system_64.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/include/asm-x86/system_64.h b/include/asm-x86/system_64.h
index 5022aecc333d..4cb23848d460 100644
--- a/include/asm-x86/system_64.h
+++ b/include/asm-x86/system_64.h
@@ -7,9 +7,6 @@
7 7
8#ifdef __KERNEL__ 8#ifdef __KERNEL__
9 9
10#define __STR(x) #x
11#define STR(x) __STR(x)
12
13#define __SAVE(reg,offset) "movq %%" #reg ",(14-" #offset ")*8(%%rsp)\n\t" 10#define __SAVE(reg,offset) "movq %%" #reg ",(14-" #offset ")*8(%%rsp)\n\t"
14#define __RESTORE(reg,offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t" 11#define __RESTORE(reg,offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t"
15 12
@@ -85,7 +82,7 @@ static inline void write_cr0(unsigned long val)
85static inline unsigned long read_cr2(void) 82static inline unsigned long read_cr2(void)
86{ 83{
87 unsigned long cr2; 84 unsigned long cr2;
88 asm("movq %%cr2,%0" : "=r" (cr2)); 85 asm volatile("movq %%cr2,%0" : "=r" (cr2));
89 return cr2; 86 return cr2;
90} 87}
91 88
@@ -97,7 +94,7 @@ static inline void write_cr2(unsigned long val)
97static inline unsigned long read_cr3(void) 94static inline unsigned long read_cr3(void)
98{ 95{
99 unsigned long cr3; 96 unsigned long cr3;
100 asm("movq %%cr3,%0" : "=r" (cr3)); 97 asm volatile("movq %%cr3,%0" : "=r" (cr3));
101 return cr3; 98 return cr3;
102} 99}
103 100
@@ -109,7 +106,7 @@ static inline void write_cr3(unsigned long val)
109static inline unsigned long read_cr4(void) 106static inline unsigned long read_cr4(void)
110{ 107{
111 unsigned long cr4; 108 unsigned long cr4;
112 asm("movq %%cr4,%0" : "=r" (cr4)); 109 asm volatile("movq %%cr4,%0" : "=r" (cr4));
113 return cr4; 110 return cr4;
114} 111}
115 112
@@ -121,7 +118,7 @@ static inline void write_cr4(unsigned long val)
121static inline unsigned long read_cr8(void) 118static inline unsigned long read_cr8(void)
122{ 119{
123 unsigned long cr8; 120 unsigned long cr8;
124 asm("movq %%cr8,%0" : "=r" (cr8)); 121 asm volatile("movq %%cr8,%0" : "=r" (cr8));
125 return cr8; 122 return cr8;
126} 123}
127 124
@@ -137,6 +134,11 @@ static inline void write_cr8(unsigned long val)
137 134
138#endif /* __KERNEL__ */ 135#endif /* __KERNEL__ */
139 136
137static inline void clflush(volatile void *__p)
138{
139 asm volatile("clflush %0" : "+m" (*(char __force *)__p));
140}
141
140#define nop() __asm__ __volatile__ ("nop") 142#define nop() __asm__ __volatile__ ("nop")
141 143
142#ifdef CONFIG_SMP 144#ifdef CONFIG_SMP