[rtems-libbsd commit] PCI(4): Add big endian support
Sebastian Huber
sebh at rtems.org
Mon Sep 23 09:01:39 UTC 2019
Module: rtems-libbsd
Branch: 5-freebsd-12
Commit: cdbae21e4d55c01ce9a3db98443ab315e011e760
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=cdbae21e4d55c01ce9a3db98443ab315e011e760
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Aug 6 07:38:40 2019 +0200
PCI(4): Add big endian support
---
freebsd/sys/dev/pci/pci.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/freebsd/sys/dev/pci/pci.c b/freebsd/sys/dev/pci/pci.c
index 56c3f58..745471e 100644
--- a/freebsd/sys/dev/pci/pci.c
+++ b/freebsd/sys/dev/pci/pci.c
@@ -80,6 +80,14 @@ __FBSDID("$FreeBSD$");
#include <rtems/bsd/local/pcib_if.h>
#include <rtems/bsd/local/pci_if.h>
+#ifdef __rtems__
+#undef bus_read_4
+#define bus_read_4(r, o) \
+ le32toh(bus_space_read_4((r)->r_bustag, (r)->r_bushandle, o))
+#undef bus_write_4
+#define bus_write_4(r, o, v) \
+ bus_space_write_4((r)->r_bustag, (r)->r_bushandle, o, htole32(v))
+#endif /* __rtems__ */
#define PCIR_IS_BIOS(cfg, reg) \
(((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) || \
((cfg)->hdrtype == PCIM_HDRTYPE_BRIDGE && reg == PCIR_BIOS_1))
More information about the vc
mailing list