Convert NEXUS_ACCESSOR to use the __BUS_ACCESSOR
macro instead of reimplementing it. Approved by: peter
This commit is contained in:
parent
a11af9c915
commit
de794a36b9
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user