summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/process.c
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2007-07-22 11:12:29 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-22 11:03:37 -0700
commitf51c94528a9bc73504928926ca4d791a2b7ddd7c (patch)
tree1562581d26098916a35a27ee58021f483c85b3da /arch/x86_64/kernel/process.c
parentabd4f7505bafdd6c5319fe3cb5caf9af6104e17a (diff)
downloadop-kernel-dev-f51c94528a9bc73504928926ca4d791a2b7ddd7c.zip
op-kernel-dev-f51c94528a9bc73504928926ca4d791a2b7ddd7c.tar.gz
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/kernel/process.c')
-rw-r--r--arch/x86_64/kernel/process.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index 92fade4..e7ac629 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -342,10 +342,10 @@ void __show_regs(struct pt_regs * regs)
rdmsrl(MSR_GS_BASE, gs);
rdmsrl(MSR_KERNEL_GS_BASE, shadowgs);
- asm("movq %%cr0, %0": "=r" (cr0));
- asm("movq %%cr2, %0": "=r" (cr2));
- asm("movq %%cr3, %0": "=r" (cr3));
- asm("movq %%cr4, %0": "=r" (cr4));
+ cr0 = read_cr0();
+ cr2 = read_cr2();
+ cr3 = read_cr3();
+ cr4 = read_cr4();
printk("FS: %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n",
fs,fsindex,gs,gsindex,shadowgs);
OpenPOWER on IntegriCloud