[rtems-libbsd commit] NVME(4): Fix for big endian platforms
Sebastian Huber
sebh at rtems.org
Tue Feb 18 14:00:08 UTC 2020
Module: rtems-libbsd
Branch: master
Commit: 792d56bd33346adadf8b95dea2d2ed09f9e347e7
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=792d56bd33346adadf8b95dea2d2ed09f9e347e7
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Feb 18 14:36:27 2020 +0100
NVME(4): Fix for big endian platforms
Update #3821.
---
freebsd/sys/dev/nvme/nvme_qpair.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/freebsd/sys/dev/nvme/nvme_qpair.c b/freebsd/sys/dev/nvme/nvme_qpair.c
index a866a95..db6a387 100644
--- a/freebsd/sys/dev/nvme/nvme_qpair.c
+++ b/freebsd/sys/dev/nvme/nvme_qpair.c
@@ -631,8 +631,13 @@ nvme_qpair_process_completions(struct nvme_qpair *qpair)
qpair->phase = !qpair->phase; /* 3 */
}
+#ifndef __rtems__
bus_space_write_4(qpair->ctrlr->bus_tag, qpair->ctrlr->bus_handle,
qpair->cq_hdbl_off, qpair->cq_head);
+#else /* __rtems__ */
+ bus_space_write_4(qpair->ctrlr->bus_tag, qpair->ctrlr->bus_handle,
+ qpair->cq_hdbl_off, htole32(qpair->cq_head));
+#endif /* __rtems__ */
}
return (done != 0);
}
@@ -987,8 +992,13 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr)
wmb();
#endif /* __rtems__ */
+#ifndef __rtems__
bus_space_write_4(qpair->ctrlr->bus_tag, qpair->ctrlr->bus_handle,
qpair->sq_tdbl_off, qpair->sq_tail);
+#else /* __rtems__ */
+ bus_space_write_4(qpair->ctrlr->bus_tag, qpair->ctrlr->bus_handle,
+ qpair->sq_tdbl_off, htole32(qpair->sq_tail));
+#endif /* __rtems__ */
qpair->num_cmds++;
}
More information about the vc
mailing list