diff options
Diffstat (limited to 'include/asm-x86_64/system.h')
-rw-r--r-- | include/asm-x86_64/system.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index bd376bc8c4ab..213b7fe5d998 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h | |||
@@ -89,6 +89,11 @@ static inline unsigned long read_cr3(void) | |||
89 | return cr3; | 89 | return cr3; |
90 | } | 90 | } |
91 | 91 | ||
92 | static inline void write_cr3(unsigned long val) | ||
93 | { | ||
94 | asm volatile("movq %0,%%cr3" :: "r" (val) : "memory"); | ||
95 | } | ||
96 | |||
92 | static inline unsigned long read_cr4(void) | 97 | static inline unsigned long read_cr4(void) |
93 | { | 98 | { |
94 | unsigned long cr4; | 99 | unsigned long cr4; |
@@ -98,7 +103,7 @@ static inline unsigned long read_cr4(void) | |||
98 | 103 | ||
99 | static inline void write_cr4(unsigned long val) | 104 | static inline void write_cr4(unsigned long val) |
100 | { | 105 | { |
101 | asm volatile("movq %0,%%cr4" :: "r" (val)); | 106 | asm volatile("movq %0,%%cr4" :: "r" (val) : "memory"); |
102 | } | 107 | } |
103 | 108 | ||
104 | #define stts() write_cr0(8 | read_cr0()) | 109 | #define stts() write_cr0(8 | read_cr0()) |