summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-07-18 10:19:11 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-11-13 13:03:51 +0100
commit59951a9a9cda7628c8e173fa2ecd926ce2971837 (patch)
tree3a8070667eea81492bf2e33514d01394fa4d8d65
parent53145c7232007e4c83819131a820e63e00dba7e6 (diff)
downloadrtems-libbsd-59951a9a9cda7628c8e173fa2ecd926ce2971837.tar.bz2
NVME(4): Big endian support
Update #3821.
-rw-r--r--freebsd/sys/dev/nvme/nvme_private.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/freebsd/sys/dev/nvme/nvme_private.h b/freebsd/sys/dev/nvme/nvme_private.h
index e473ec4b..f2f7d2b1 100644
--- a/freebsd/sys/dev/nvme/nvme_private.h
+++ b/freebsd/sys/dev/nvme/nvme_private.h
@@ -338,20 +338,20 @@ struct nvme_controller {
offsetof(struct nvme_registers, reg)
#define nvme_mmio_read_4(sc, reg) \
- bus_space_read_4((sc)->bus_tag, (sc)->bus_handle, \
- nvme_mmio_offsetof(reg))
+ le32toh(bus_space_read_4((sc)->bus_tag, (sc)->bus_handle, \
+ nvme_mmio_offsetof(reg)))
#define nvme_mmio_write_4(sc, reg, val) \
bus_space_write_4((sc)->bus_tag, (sc)->bus_handle, \
- nvme_mmio_offsetof(reg), val)
+ nvme_mmio_offsetof(reg), htole32(val))
#define nvme_mmio_write_8(sc, reg, val) \
do { \
bus_space_write_4((sc)->bus_tag, (sc)->bus_handle, \
- nvme_mmio_offsetof(reg), val & 0xFFFFFFFF); \
+ nvme_mmio_offsetof(reg), htole32(val & 0xFFFFFFFF)); \
bus_space_write_4((sc)->bus_tag, (sc)->bus_handle, \
nvme_mmio_offsetof(reg)+4, \
- (val & 0xFFFFFFFF00000000ULL) >> 32); \
+ htole32((val & 0xFFFFFFFF00000000ULL) >> 32)); \
} while (0);
#define nvme_printf(ctrlr, fmt, args...) \