From 1c5fa550e8f82e480cd487758be243b90403af3e Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Wed, 6 Aug 2003 11:05:42 +0000 Subject: [PATCH] Broke the warning that the cx driver (cronyx.c, cx,c and if_cx.c) uses pessimal (u_short) types for i/o ports. I don't understand the data structures in this driver well enough to unpessimize the types. --- sys/i386/isa/cxreg.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/i386/isa/cxreg.h b/sys/i386/isa/cxreg.h index c0206370551..4102f2f8776 100644 --- a/sys/i386/isa/cxreg.h +++ b/sys/i386/isa/cxreg.h @@ -428,3 +428,26 @@ #define CSRA_TXFLOFF 0x04 /* transmitter flow off */ #define CSRA_TXFLON 0x02 /* transmitter flow on */ #define CSRA_BITS "\20\2txflon\3txfloff\4txen\6rxflon\7rxfloff\10rxen" + +/* + * Hacks to avoid inb() and outb()'s checks that the port type is not + * pessimal. + */ + +static __inline u_char +xinb(u_int port) +{ + return (inb(port)); +} + +#undef inb +#define inb(port) xinb(port) + +static __inline void +xoutb(u_int port, u_char data) +{ + outb(port, data); +} + +#undef outb +#define outb(port, data) xoutb((port), (data))