aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/mm/fault.c
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2007-07-22 05:12:29 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-22 14:03:37 -0400
commitf51c94528a9bc73504928926ca4d791a2b7ddd7c (patch)
tree1562581d26098916a35a27ee58021f483c85b3da /arch/x86_64/mm/fault.c
parentabd4f7505bafdd6c5319fe3cb5caf9af6104e17a (diff)
x86_64: Use read and write crX in .c files
This patch uses the read and write functions provided at system.h for control registers instead of writting raw assembly over and over again in .c files. Functions to manipulate cr2 and cr8 were provided, as they were lacking. Also, removed some extra space after closing brackets Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86_64/mm/fault.c')
-rw-r--r--arch/x86_64/mm/fault.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index 5e9ac70c135e..327c9f2fa626 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -159,7 +159,7 @@ void dump_pagetable(unsigned long address)
159 pmd_t *pmd; 159 pmd_t *pmd;
160 pte_t *pte; 160 pte_t *pte;
161 161
162 asm("movq %%cr3,%0" : "=r" (pgd)); 162 pgd = (pgd_t *)read_cr3();
163 163
164 pgd = __va((unsigned long)pgd & PHYSICAL_PAGE_MASK); 164 pgd = __va((unsigned long)pgd & PHYSICAL_PAGE_MASK);
165 pgd += pgd_index(address); 165 pgd += pgd_index(address);
@@ -316,7 +316,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
316 prefetchw(&mm->mmap_sem); 316 prefetchw(&mm->mmap_sem);
317 317
318 /* get the address */ 318 /* get the address */
319 __asm__("movq %%cr2,%0":"=r" (address)); 319 address = read_cr2();
320 320
321 info.si_code = SEGV_MAPERR; 321 info.si_code = SEGV_MAPERR;
322 322