svn commit: r190817 - head/sys/amd64/include
Ed Schouten
ed at FreeBSD.org
Tue Apr 7 12:32:03 PDT 2009
Author: ed
Date: Tue Apr 7 19:31:36 2009
New Revision: 190817
URL: http://svn.freebsd.org/changeset/base/190817
Log:
Don't explicitly force ecx to be used for MSR_FSBASE/MSR_GSBASE.
Because the "c" input constaint is used, the compiler will already place
the MSR_FSBASE/MSR_GSBASE constants in ecx. Using __asm("ecx") makes
LLVM crash. Even though this is also an LLVM bug, we'd better remove the
unnecessary GCCism as well.
Submitted by: Christoph Mallon <christoph.mallon at gmx.de>
Modified:
head/sys/amd64/include/cpufunc.h
Modified: head/sys/amd64/include/cpufunc.h
==============================================================================
--- head/sys/amd64/include/cpufunc.h Tue Apr 7 19:18:02 2009 (r190816)
+++ head/sys/amd64/include/cpufunc.h Tue Apr 7 19:31:36 2009 (r190817)
@@ -535,12 +535,9 @@ cpu_mwait(int extensions, int hints)
static __inline void
load_fs(u_int sel)
{
- register u_int32_t fsbase __asm("ecx");
-
/* Preserve the fsbase value across the selector load */
- fsbase = MSR_FSBASE;
- __asm __volatile("rdmsr; mov %0,%%fs; wrmsr"
- : : "rm" (sel), "c" (fsbase) : "eax", "edx");
+ __asm __volatile("rdmsr; mov %0,%%fs; wrmsr"
+ : : "rm" (sel), "c" (MSR_FSBASE) : "eax", "edx");
}
#ifndef MSR_GSBASE
@@ -549,16 +546,13 @@ load_fs(u_int sel)
static __inline void
load_gs(u_int sel)
{
- register u_int32_t gsbase __asm("ecx");
-
/*
* Preserve the gsbase value across the selector load.
* Note that we have to disable interrupts because the gsbase
* being trashed happens to be the kernel gsbase at the time.
*/
- gsbase = MSR_GSBASE;
- __asm __volatile("pushfq; cli; rdmsr; mov %0,%%gs; wrmsr; popfq"
- : : "rm" (sel), "c" (gsbase) : "eax", "edx");
+ __asm __volatile("pushfq; cli; rdmsr; mov %0,%%gs; wrmsr; popfq"
+ : : "rm" (sel), "c" (MSR_GSBASE) : "eax", "edx");
}
#else
/* Usable by userland */
More information about the svn-src-all
mailing list