svn commit: r365697 - head/sys/powerpc/powerpc
Brandon Bergren
bdragon at FreeBSD.org
Sun Sep 13 21:22:40 UTC 2020
Author: bdragon
Date: Sun Sep 13 21:22:39 2020
New Revision: 365697
URL: https://svnweb.freebsd.org/changeset/base/365697
Log:
[PowerPC64LE] Bus space prep for LE
Swap the BE and LE bus_space tags when on LE, and adjust the nexus tag
to match.
This is prep for a a followup that makes the powerpc bus_space macros easier
to maintain in the future.
Sponsored by: Tag1 Consulting, Inc.
Modified:
head/sys/powerpc/powerpc/bus_machdep.c
head/sys/powerpc/powerpc/nexus.c
Modified: head/sys/powerpc/powerpc/bus_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 19:56:53 2020 (r365696)
+++ head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 21:22:39 2020 (r365697)
@@ -790,7 +790,11 @@ bs_le_sr_8(bus_space_handle_t bsh, bus_size_t ofs, uin
TODO;
}
+#if BYTE_ORDER == LITTLE_ENDIAN
+struct bus_space bs_le_tag = {
+#else
struct bus_space bs_be_tag = {
+#endif
/* mapping/unmapping */
bs_gen_map,
bs_gen_unmap,
@@ -884,7 +888,11 @@ struct bus_space bs_be_tag = {
bs_be_sr_8,
};
+#if BYTE_ORDER == LITTLE_ENDIAN
+struct bus_space bs_be_tag = {
+#else
struct bus_space bs_le_tag = {
+#endif
/* mapping/unmapping */
bs_gen_map,
bs_gen_unmap,
Modified: head/sys/powerpc/powerpc/nexus.c
==============================================================================
--- head/sys/powerpc/powerpc/nexus.c Sun Sep 13 19:56:53 2020 (r365696)
+++ head/sys/powerpc/powerpc/nexus.c Sun Sep 13 21:22:39 2020 (r365697)
@@ -35,6 +35,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <sys/endian.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@@ -173,7 +174,11 @@ static bus_space_tag_t
nexus_get_bus_tag(device_t bus __unused, device_t child __unused)
{
+#if BYTE_ORDER == LITTLE_ENDIAN
+ return(&bs_le_tag);
+#else
return(&bs_be_tag);
+#endif
}
static int
More information about the svn-src-all
mailing list