x86_64: Use read and write crX in .c files
[sfrench/cifs-2.6.git] / arch / x86_64 / mm / fault.c
index 5e9ac70c135ed491c56b7af9500f4e02b677b346..327c9f2fa6269f3020f94f856cd8e0b8b36ab494 100644 (file)
@@ -159,7 +159,7 @@ void dump_pagetable(unsigned long address)
        pmd_t *pmd;
        pte_t *pte;
 
-       asm("movq %%cr3,%0" : "=r" (pgd));
+       pgd = (pgd_t *)read_cr3();
 
        pgd = __va((unsigned long)pgd & PHYSICAL_PAGE_MASK); 
        pgd += pgd_index(address);
@@ -316,7 +316,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
        prefetchw(&mm->mmap_sem);
 
        /* get the address */
-       __asm__("movq %%cr2,%0":"=r" (address));
+       address = read_cr2();
 
        info.si_code = SEGV_MAPERR;