Excerpts from Matt Turner's message of Sun Nov 01 11:01:20 -0800 2009:
> This will allow us to include sys/io.h and use libc's in/out when
> available.

That's a fine goal, but given the ambiguity between Linux and BSD on
the outb argument ordering, I've got some suggestions

>  #    ifdef linux
> -/* for Linux on Alpha, we use the LIBC _inx/_outx routines */
> -/* note that the appropriate setup via "ioperm" needs to be done */
> -/*  *before* any inx/outx is done. */
> +#     include <sys/io.h>
> +#     define OUTB(port, val) outb((val), (port))
> +#     define OUTW(port, val) outw((val), (port))
> +#     define OUTL(port, val) outl((val), (port))

Please use inline functions instead of macros. Also, please make it
obvious that these macros belong to X.org and are not brought from
some other package. Further, it would be nice to have them
self-documenting as far as argument order somehow, perhaps

static inline void xorg_outb_port_val(uint16_t port, uint8_t val)

(suggestions welcome here, I just want to make people aware of any
ordering change here).

What isn't clear is how this affects the current API; ideally, we'd
make all existing drivers using whatever old names they've got
continue to compile, but with warnings so that developers will know
what to do to fix them.

-- 
[email protected]

Attachment: signature.asc
Description: PGP signature

_______________________________________________
xorg-devel mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to