Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 May 1995 15:05:44 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        dawes@physics.usyd.edu.au, hackers@FreeBSD.org
Cc:        alpha@xfree86.org
Subject:   Re: Problem with asm code in Mach32 server on FreeBSD 2.0 snaps
Message-ID:  <199505030505.PAA27586@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I've just been debugging a problem with the XFree86 Mach32 server on
>a machine running one of the 2.0 snaps (the Feb snap, but the same problem
>happens with a server compiled with the latest snap).  The problem is
>a SIGSEGV in outsw(), with the following stack trace:
>...

>I've isolated the problem to the following __asm__ function:

>  static __inline__ void outsw(void *buf, short count, unsigned short port)
>  {
>     __asm__ __volatile__ ("cld;rep;outsw" 
>                       ::"d" (port),"S" (buf),"c" (count):"cx","si");
>  }

The top 16 bits of %ecx aren't initialized.  This can be fixed by casting
(count) to (unsigned) but should be fixed by passing an (unsigned) in the
first place.  A few more cycles may be saved by making `port' unsigned too.

The different behaviour with an older version of gcc may be because gcc
now wastes even more time than before doing unnecessary sign extensions
of short args, so the top bits of %ecx are more likely to be nonzero
(0xffff).

Bruce



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