summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-04-07 19:31:36 +0000
committered <ed@FreeBSD.org>2009-04-07 19:31:36 +0000
commit0d9b7a69e5d1eda70f3c33e93b63edefea0b9ba5 (patch)
treeaca18a73f226a6a2ad08abb388126f0de4288883 /sys/amd64/include
parente716acd50bb631d8b1563cc620e4db9bcff31f25 (diff)
downloadFreeBSD-src-0d9b7a69e5d1eda70f3c33e93b63edefea0b9ba5.zip
FreeBSD-src-0d9b7a69e5d1eda70f3c33e93b63edefea0b9ba5.tar.gz
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>
Diffstat (limited to 'sys/amd64/include')
-rw-r--r--sys/amd64/include/cpufunc.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index cec9b4a..f6e4dda6 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -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 */
OpenPOWER on IntegriCloud