Module Name: src
Committed By: martin
Date: Mon Jun 17 16:41:50 UTC 2024
Modified Files:
src/sys/arch/hp300/hp300 [netbsd-10]: autoconf.c
Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #693):
sys/arch/hp300/hp300/autoconf.c: revision 1.113
Fix a 20 years old botch by me in setbootdev() on switching to MI SCSI.
setbootdev() updates bootdev data shared between BOOTROM and
it notifies BOOTROM to choose a current root device as a boot device
on the next boot, but I didn't understand the intention and then
it has been broken on SCSI disks. Sigh.
(I wonder if no one has noticed this old feature for 20 years..)
To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.110.6.1 src/sys/arch/hp300/hp300/autoconf.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/hp300/hp300/autoconf.c
diff -u src/sys/arch/hp300/hp300/autoconf.c:1.110 src/sys/arch/hp300/hp300/autoconf.c:1.110.6.1
--- src/sys/arch/hp300/hp300/autoconf.c:1.110 Sat Aug 7 16:18:53 2021
+++ src/sys/arch/hp300/hp300/autoconf.c Mon Jun 17 16:41:50 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.110 2021/08/07 16:18:53 thorpej Exp $ */
+/* $NetBSD: autoconf.c,v 1.110.6.1 2024/06/17 16:41:50 martin Exp $ */
/*-
* Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.110 2021/08/07 16:18:53 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.110.6.1 2024/06/17 16:41:50 martin Exp $");
#include "dvbox.h"
#include "gbox.h"
@@ -652,10 +652,9 @@ setbootdev(void)
*/
switch (type) {
case 2: /* rd */
- case 4: /* sd */
/*
* "rd" -> "hpibbus" -> "fhpib"
- * "sd" -> "scsibus" -> "spc"
+ * "rd" -> "hpibbus" -> "nhpib"
*/
for (cdd = LIST_FIRST(&dev_data_list_hpib), ctlr = 0;
cdd != NULL; cdd = LIST_NEXT(cdd, dd_clist), ctlr++) {
@@ -671,6 +670,24 @@ setbootdev(void)
}
}
break;
+ case 4: /* sd */
+ /*
+ * "sd" -> "scsibus" -> "spc"
+ */
+ for (cdd = LIST_FIRST(&dev_data_list_scsi), ctlr = 0;
+ cdd != NULL; cdd = LIST_NEXT(cdd, dd_clist), ctlr++) {
+ if (cdd->dd_dev ==
+ device_parent(device_parent(root_device))) {
+ /*
+ * Found it!
+ */
+ bootdev = MAKEBOOTDEV(type,
+ ctlr, dd->dd_slave, dd->dd_punit,
+ DISKPART(rootdev));
+ break;
+ }
+ }
+ break;
}
out: