Module Name:    src
Committed By:   jmcneill
Date:           Sat Sep 22 11:58:19 UTC 2018

Modified Files:
        src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
Use fdt_open_into instead of fdt_move to load the DTB since we may make
changes to the tree after loading it. When we are done making changes,
call fdt_pack.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/evbarm/fdt/fdt_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.37 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.38
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.37	Sun Sep 16 11:24:29 2018
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Sat Sep 22 11:58:19 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.37 2018/09/16 11:24:29 skrll Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.38 2018/09/22 11:58:19 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill <jmcne...@invisible.ca>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.37 2018/09/16 11:24:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.38 2018/09/22 11:58:19 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -372,7 +372,7 @@ initarm(void *arg)
 	/* Load FDT */
 	int error = fdt_check_header(fdt_addr_r);
 	if (error == 0) {
-		error = fdt_move(fdt_addr_r, fdt_data, sizeof(fdt_data));
+		error = fdt_open_into(fdt_addr_r, fdt_data, sizeof(fdt_data));
 		if (error != 0)
 			panic("fdt_move failed: %s", fdt_strerror(error));
 		fdtbus_set_data(fdt_data);
@@ -413,6 +413,11 @@ initarm(void *arg)
 	 */
 	fdt_update_stdout_path();
 
+	/*
+	 * Done making changes to the FDT.
+	 */
+	fdt_pack(fdt_data);
+
 	VPRINTF("consinit ");
 	consinit();
 	VPRINTF("ok\n");

Reply via email to