Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ofw OF properties are stored in big endian, but the ...
details: https://anonhg.NetBSD.org/src/rev/9f4f68b32cae
branches: trunk
changeset: 342219:9f4f68b32cae
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Dec 13 11:00:01 2015 +0000
description:
OF properties are stored in big endian, but the host might not be. Swap
the value of the "reg" property where appropriate.
diffstat:
sys/dev/ofw/ofw_subr.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r 9273f70912c0 -r 9f4f68b32cae sys/dev/ofw/ofw_subr.c
--- a/sys/dev/ofw/ofw_subr.c Sun Dec 13 04:55:12 2015 +0000
+++ b/sys/dev/ofw/ofw_subr.c Sun Dec 13 11:00:01 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_subr.c,v 1.24 2015/12/12 22:22:51 jmcneill Exp $ */
+/* $NetBSD: ofw_subr.c,v 1.25 2015/12/13 11:00:01 jmcneill Exp $ */
/*
* Copyright 1998
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.24 2015/12/12 22:22:51 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.25 2015/12/13 11:00:01 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -396,7 +396,7 @@
if (OF_getprop(node, "reg", ®64, sizeof(reg64))
< sizeof(reg64))
continue;
- addr = reg64;
+ addr = be64toh(reg64);
/*
* The i2c bus number (0 or 1) is encoded in bit 33
* of the register, but we encode it in bit 8 of
@@ -408,7 +408,7 @@
if (OF_getprop(node, "reg", ®32, sizeof(reg32))
< sizeof(reg32))
continue;
- addr = reg32;
+ addr = be32toh(reg32);
} else {
continue;
}
Home |
Main Index |
Thread Index |
Old Index