Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 May 2011 13:08:19 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Jung-uk Kim <jkim@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r221214 - head/sys/x86/x86
Message-ID:  <4DBE90A3.50102@FreeBSD.org>
In-Reply-To: <201104291820.p3TIKCv7009883@svn.freebsd.org>
References:  <201104291820.p3TIKCv7009883@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2011-04-29 20:20, Jung-uk Kim wrote:
...
> +static __inline void
> +vmware_hvcall(u_int cmd, u_int *p)
> +{
> +
> +	__asm __volatile("inl (%%dx)"
> +	: "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
> +	: "0" (VMW_HVMAGIC), "1" (UINT_MAX), "2" (cmd), "3" (VMW_HVPORT)
> +	: "memory");
> +}

This upsets clang's integrated assembler, and I think it's right in this
case:

sys/x86/x86/tsc.c:103:19: error: invalid operand for instruction
         __asm __volatile("inl (%%dx)"
                          ^
<inline asm>:1:6: note: instantiated into assembly here
         inl (%dx)
             ^

Can we please add an explicit %%eax as second argument here?  E.g.:

diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c
index 0b7510c..9638167 100644
--- a/sys/x86/x86/tsc.c
+++ b/sys/x86/x86/tsc.c
@@ -100,7 +100,7 @@ static __inline void
  vmware_hvcall(u_int cmd, u_int *p)
  {
  
-	__asm __volatile("inl (%%dx)"
+	__asm __volatile("inl (%%dx), %%eax"
  	: "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
  	: "0" (VMW_HVMAGIC), "1" (UINT_MAX), "2" (cmd), "3" (VMW_HVPORT)
  	: "memory");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DBE90A3.50102>