Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

VAX bus_space functions and unused variables



Hi,

compiling a VAX kernel with "slhci at tc" fails due to the way bus_space functions are implemented: The bus space tag is not used, but generic drivers (such as slhci) can and do pass it as variable when calling bus_space functions. This results in "unused variable" warnings/errors by the compiler.

My suggested patch (against 7.0, sorry) for bus.h is attached, as well as a small fix for uba_mainbus.c which became evident then.
Is a PR preferred for this?

Regards,
Felix
Index: vax/include/bus.h
===================================================================
RCS file: /cvsroot/src/sys/arch/vax/include/bus.h,v
retrieving revision 1.31
diff -u -r1.31 bus.h
--- vax/include/bus.h	28 Apr 2008 20:23:39 -0000	1.31
+++ vax/include/bus.h	22 Apr 2016 16:07:11 -0000
@@ -201,15 +201,15 @@
  */
 
 #define	bus_space_read_1(t, h, o)					\
-	    (*(volatile uint8_t *)((h) + (o)))
+	 (__USE(t), (*(volatile uint8_t *)((h) + (o))))
 
 #define	bus_space_read_2(t, h, o)					\
 	 (__BUS_SPACE_ADDRESS_SANITY((h) + (o), uint16_t, "bus addr"),	\
-	    (*(volatile uint16_t *)((h) + (o))))
+	    __USE(t), (*(volatile uint16_t *)((h) + (o))))
 
 #define	bus_space_read_4(t, h, o)					\
 	 (__BUS_SPACE_ADDRESS_SANITY((h) + (o), uint32_t, "bus addr"),	\
-	    (*(volatile uint32_t *)((h) + (o))))
+	    __USE(t), (*(volatile uint32_t *)((h) + (o))))
 
 #if 0	/* Cause a link error for bus_space_read_8 */
 #define	bus_space_read_8(t, h, o)	!!! bus_space_read_8 unimplemented !!!
@@ -364,18 +364,21 @@
 
 #define	bus_space_write_1(t, h, o, v)					\
 do {									\
+	__USE(t);							\
 	((void)(*(volatile uint8_t *)((h) + (o)) = (v)));		\
 } while (0)
 
 #define	bus_space_write_2(t, h, o, v)					\
 do {									\
 	__BUS_SPACE_ADDRESS_SANITY((h) + (o), uint16_t, "bus addr");	\
+	__USE(t);							\
 	((void)(*(volatile uint16_t *)((h) + (o)) = (v)));		\
 } while (0)
 
 #define	bus_space_write_4(t, h, o, v)					\
 do {									\
 	__BUS_SPACE_ADDRESS_SANITY((h) + (o), uint32_t, "bus addr");	\
+	__USE(t);							\
 	((void)(*(volatile uint32_t *)((h) + (o)) = (v)));		\
 } while (0)
 
Index: vax/uba/uba_mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/vax/uba/uba_mainbus.c,v
retrieving revision 1.10
diff -u -r1.10 uba_mainbus.c
--- vax/uba/uba_mainbus.c	14 Dec 2010 23:38:30 -0000	1.10
+++ vax/uba/uba_mainbus.c	22 Apr 2016 16:07:11 -0000
@@ -152,7 +152,7 @@
 {
 #define	QIPCR	0x1f40
 #define	Q_LMEAE	0x20
-	bus_space_write_2(sc->uh_tag, sc->uh_ioh, QIPCR, Q_LMEAE);
+	bus_space_write_2(sc->uh_iot, sc->uh_ioh, QIPCR, Q_LMEAE);
 }
 
 void


Home | Main Index | Thread Index | Old Index