]> err.no Git - linux-2.6/blobdiff - include/asm-x86_64/system.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6] / include / asm-x86_64 / system.h
index e4f246d62c46bf57c6218df7738ca17dc6356671..02175aa1d16a8aea903a51e6b5e1c71fda57d075 100644 (file)
@@ -75,19 +75,31 @@ static inline unsigned long read_cr0(void)
        unsigned long cr0;
        asm volatile("movq %%cr0,%0" : "=r" (cr0));
        return cr0;
-} 
+}
 
 static inline void write_cr0(unsigned long val) 
 { 
        asm volatile("movq %0,%%cr0" :: "r" (val));
-} 
+}
+
+static inline unsigned long read_cr2(void)
+{
+       unsigned long cr2;
+       asm("movq %%cr2,%0" : "=r" (cr2));
+       return cr2;
+}
+
+static inline void write_cr2(unsigned long val)
+{
+       asm volatile("movq %0,%%cr2" :: "r" (val));
+}
 
 static inline unsigned long read_cr3(void)
 { 
        unsigned long cr3;
        asm("movq %%cr3,%0" : "=r" (cr3));
        return cr3;
-} 
+}
 
 static inline void write_cr3(unsigned long val)
 {
@@ -99,17 +111,29 @@ static inline unsigned long read_cr4(void)
        unsigned long cr4;
        asm("movq %%cr4,%0" : "=r" (cr4));
        return cr4;
-} 
+}
 
 static inline void write_cr4(unsigned long val)
 { 
        asm volatile("movq %0,%%cr4" :: "r" (val) : "memory");
-} 
+}
+
+static inline unsigned long read_cr8(void)
+{
+       unsigned long cr8;
+       asm("movq %%cr8,%0" : "=r" (cr8));
+       return cr8;
+}
+
+static inline void write_cr8(unsigned long val)
+{
+       asm volatile("movq %0,%%cr8" :: "r" (val) : "memory");
+}
 
 #define stts() write_cr0(8 | read_cr0())
 
 #define wbinvd() \
-       __asm__ __volatile__ ("wbinvd": : :"memory");
+       __asm__ __volatile__ ("wbinvd": : :"memory")
 
 #endif /* __KERNEL__ */