svn commit: r221214 - head/sys/x86/x86

Dimitry Andric dim at FreeBSD.org
Mon May 2 11:08:20 UTC 2011


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");


More information about the svn-src-head mailing list