[PATCH] Simplify in*() and out*() functions of AMD64 and i386

Kostik Belousov kostikbel at gmail.com
Wed Apr 8 14:31:33 PDT 2009


On Wed, Apr 08, 2009 at 09:58:02PM +0200, Christoph Mallon wrote:
> Hi amd64@ and i386@,
> 
> attached is a patch which simplifies the in*() and out*() functions for 
> I/O port access of AMD64 and i386. It removes an unnecessary distinction 
> of cases for inb() and outb(), which was used to generate better code 
> for ports < 256. This is unnecessary, because GCC supports an asm input 
> constraint to handle this ("N"). The stale comment, which states there 
> is no constraint for this, is removed, too. Also the {in,out}{w,l}() get 
> treated with this constraint. They had no special case before, so now 

> better code is generated for them. Further, the unnecessary "cld" is 
> removed from {in,out}s{b,w,l}(), because it is guaranteed by the ABI 
> that the direction flag is cleared. All in all the code for in/out gets 
> a bit simpler.
The DF flag is guaranteed to be cleared for usermode only. Currently,
kernel does not clear the flag on entry.

We did fixed signal handlers to always have DF cleared, but the kernel
was explicitely left out because used version of gcc does the right
thing with DF when needed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-i386/attachments/20090408/9cdfb231/attachment.pgp


More information about the freebsd-i386 mailing list