cxgbe(4): Retire t4_bus_space_read_8 and t4_bus_space_write_8.
MFC after: 3 days Sponsored by: Chelsio Communications
This commit is contained in:
parent
1276a8363c
commit
1521ca71d3
@ -84,45 +84,6 @@ prefetch(void *x)
|
||||
#define SBUF_DRAIN 1
|
||||
#endif
|
||||
|
||||
#ifdef __amd64__
|
||||
/* XXX: need systemwide bus_space_read_8/bus_space_write_8 */
|
||||
static __inline uint64_t
|
||||
t4_bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle,
|
||||
bus_size_t offset)
|
||||
{
|
||||
KASSERT(tag == X86_BUS_SPACE_MEM,
|
||||
("%s: can only handle mem space", __func__));
|
||||
|
||||
return (*(volatile uint64_t *)(handle + offset));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
t4_bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, uint64_t value)
|
||||
{
|
||||
KASSERT(tag == X86_BUS_SPACE_MEM,
|
||||
("%s: can only handle mem space", __func__));
|
||||
|
||||
*(volatile uint64_t *)(bsh + offset) = value;
|
||||
}
|
||||
#else
|
||||
static __inline uint64_t
|
||||
t4_bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle,
|
||||
bus_size_t offset)
|
||||
{
|
||||
return (uint64_t)bus_space_read_4(tag, handle, offset) +
|
||||
((uint64_t)bus_space_read_4(tag, handle, offset + 4) << 32);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
t4_bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, uint64_t value)
|
||||
{
|
||||
bus_space_write_4(tag, bsh, offset, value);
|
||||
bus_space_write_4(tag, bsh, offset + 4, value >> 32);
|
||||
}
|
||||
#endif
|
||||
|
||||
struct adapter;
|
||||
typedef struct adapter adapter_t;
|
||||
|
||||
@ -977,14 +938,25 @@ static inline uint64_t
|
||||
t4_read_reg64(struct adapter *sc, uint32_t reg)
|
||||
{
|
||||
|
||||
return t4_bus_space_read_8(sc->bt, sc->bh, reg);
|
||||
#ifdef __LP64__
|
||||
return bus_space_read_8(sc->bt, sc->bh, reg);
|
||||
#else
|
||||
return (uint64_t)bus_space_read_4(sc->bt, sc->bh, reg) +
|
||||
((uint64_t)bus_space_read_4(sc->bt, sc->bh, reg + 4) << 32);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
t4_write_reg64(struct adapter *sc, uint32_t reg, uint64_t val)
|
||||
{
|
||||
|
||||
t4_bus_space_write_8(sc->bt, sc->bh, reg, val);
|
||||
#ifdef __LP64__
|
||||
bus_space_write_8(sc->bt, sc->bh, reg, val);
|
||||
#else
|
||||
bus_space_write_4(sc->bt, sc->bh, reg, val);
|
||||
bus_space_write_4(sc->bt, sc->bh, reg + 4, val>> 32);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
Loading…
Reference in New Issue
Block a user