Date: Tue, 7 Apr 2009 19:31:36 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r190817 - head/sys/amd64/include Message-ID: <200904071931.n37JVai9023274@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904071931.n37JVai9023274>