Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/arch/powerpc/oea Pull up following revision(s) (reque...



details:   https://anonhg.NetBSD.org/src/rev/5feb666e6cbc
branches:  netbsd-9
changeset: 465965:5feb666e6cbc
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Dec 08 12:48:14 2019 +0000

description:
Pull up following revision(s) (requested by joerg in ticket #494):

        sys/arch/powerpc/oea/ofw_autoconf.c: revision 1.24

Add a hack for qemu/macppc. OF_finddevice calls will crash depending on
the boot loader and kernel being used. This patch allows using
-prom-env qemu_boot_hack=y to disable the lookup.

diffstat:

 sys/arch/powerpc/oea/ofw_autoconf.c |  19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r 9ce53b6f50bc -r 5feb666e6cbc sys/arch/powerpc/oea/ofw_autoconf.c
--- a/sys/arch/powerpc/oea/ofw_autoconf.c       Thu Dec 05 10:29:13 2019 +0000
+++ b/sys/arch/powerpc/oea/ofw_autoconf.c       Sun Dec 08 12:48:14 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_autoconf.c,v 1.23 2018/11/21 17:54:42 scole Exp $ */
+/* $NetBSD: ofw_autoconf.c,v 1.23.4.1 2019/12/08 12:48:14 martin Exp $ */
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
  * Copyright (C) 1995, 1996 TooLs GmbH.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_autoconf.c,v 1.23 2018/11/21 17:54:42 scole Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_autoconf.c,v 1.23.4.1 2019/12/08 12:48:14 martin Exp $");
 
 #ifdef ofppc
 #include "gtpci.h"
@@ -137,10 +137,17 @@
         *   /pci/mac-io/ata-3@2000/disk@0:0/netbsd.new         (OF-3.x)
         */
        strcpy(cbootpath, bootpath);
-       while ((node = OF_finddevice(cbootpath)) == -1) {
-               if ((p = strrchr(cbootpath, '/')) == NULL)
-                       break;
-               *p = '\0';
+
+       if ((node = OF_finddevice("/options")) == -1 ||
+           OF_getprop(node, "qemu_boot_hack", type, sizeof(type) - 1) == -1 ||
+           type[0] != 'y') {
+               while ((node = OF_finddevice(cbootpath)) == -1) {
+                       if ((p = strrchr(cbootpath, '/')) == NULL)
+                               break;
+                       *p = '\0';
+               }
+       } else {
+               node = -1;
        }
 
        printf("bootpath: %s\n", bootpath);



Home | Main Index | Thread Index | Old Index