Subject: Correct use of bus_space functions
To: None <>
From: Martin J. Laubach <>
List: tech-kern
Date: 01/07/2003 23:56:02
  Looking at our and OpenBSD's version of the bktr driver, I
see that we do (wrapped for legibility):

#define INB(bktr,offset)

  while OpenBSD does:

#define INB(sc,o)	(({					\
	u_int8_t __v;						\
	__v = bus_space_read_1((sc)->memt, (sc)->memh, (o));	\
	bus_space_barrier((sc)->memt, (sc)->memh, (o), 1,	\
	(__v);							\

  Similar with INW, INL, OUTB, OUTW, OUTL.

  A part from that gcc-ismic thing of misusing a macro as a function, 
is the bus_space_barrier() correct or not?