Fix fdtbus_get_cells(, 2) when running big endian.
This commit is contained in:
parent
dabb005d56
commit
70ed068d8b
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: fdt_subr.c,v 1.21 2018/03/06 17:40:04 bouyer Exp $ */
|
||||
/* $NetBSD: fdt_subr.c,v 1.22 2018/06/11 19:54:39 jakllsch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
|
||||
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.21 2018/03/06 17:40:04 bouyer Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.22 2018/06/11 19:54:39 jakllsch Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/bus.h>
|
||||
|
@ -156,7 +156,7 @@ fdtbus_get_cells(const uint8_t *buf, int cells)
|
|||
switch (cells) {
|
||||
case 0: return 0;
|
||||
case 1: return be32dec(buf);
|
||||
case 2: return be64dec(buf);
|
||||
case 2: return ((uint64_t)be32dec(buf)<<32)|be32dec(buf+4);
|
||||
default: panic("fdtbus_get_cells: bad cells val %d\n", cells);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue