Convert NEXUS_ACCESSOR to use the __BUS_ACCESSOR

macro instead of reimplementing it.

Approved by:	peter
This commit is contained in:
Maxime Henrion 2002-08-22 19:47:10 +00:00
parent a11af9c915
commit de794a36b9

View File

@ -33,20 +33,8 @@ enum nexus_device_ivars {
NEXUS_IVAR_PCIBUS
};
#define NEXUS_ACCESSOR(A, B, T) \
\
static __inline T nexus_get_ ## A(device_t dev) \
{ \
uintptr_t v; \
BUS_READ_IVAR(device_get_parent(dev), dev, NEXUS_IVAR_ ## B, &v); \
return (T) v; \
} \
\
static __inline void nexus_set_ ## A(device_t dev, T t) \
{ \
uintptr_t v = (uintptr_t) t; \
BUS_WRITE_IVAR(device_get_parent(dev), dev, NEXUS_IVAR_ ## B, v); \
}
#define NEXUS_ACCESSOR(var, ivar, type) \
__BUS_ACCESSOR(nexus, var, NEXUS, ivar, type)
NEXUS_ACCESSOR(pcibus, PCIBUS, u_int32_t)