Subject: asm constraints in machine/pio.h and gcc-2.7.2
To: None <port-i386@NetBSD.ORG>
From: Craig M. Chase <chase@pine.ece.utexas.edu>
List: port-i386
Date: 12/06/1995 17:03:51
Greetings,
I tried compiling NetBSD-current (12/5/95) with gcc-2.7.2 and
encountered a little trouble with machine/pio.h
The offending lines are:
__inbc(int port)
{
u_char data;
__asm __volatile("inb %1,%0" : "=a" (data) : "i" (port));
return data;
}
and
static __inline void
__outbc(int port, u_char data)
{
__asm __volatile("outb %0,%1" : : "a" (data), "i" (port));
}
The compiler didn't like the "i" constraint much.
Even after consulting the gcc info pages, I'm afraid I must admit I
don't really know all of what is going on.
Anyway, I hacked out the i (actually, I made __outbc the same as __outb)
and compiled and everything linked fine (haven't run the kernel yet).
Anybody know what is going on? Is this a gcc flaw, or is there a fix
that should be applied to pio.h?
Thanks,
Craig
--
Craig Chase --- Assistant Professor
Electrical and Computer Engineering
The University of Texas at Austin
Austin, TX 78721 --- (512) 471-7457
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2
mQCNAzCNf0YAAAEEANXpNKQilG9pAMd1OqXNteVYNaKoI7cXvBpl2nYpGNe/CZrS
U/Vebi1PfKy6eWqbgsUOo1yPzfBmh5GGA0TUcyalIN8Aur4w0LdWAFP5ihMQEQYh
g33Nfjq0xBFyxHDP76X+pq5idGYj9ZZKGDTeFwzKIAmKPvggohGN4hjScfM9AAUR
tCVDcmFpZyBNLiBDaGFzZSA8Y2hhc2VAZWNlLnV0ZXhhcy5lZHU+
=rjIy
-----END PGP PUBLIC KEY BLOCK-----