Module Name: src Committed By: mlelstv Date: Sun Oct 7 11:25:55 UTC 2018
Modified Files: src/sys/arch/xen/include: xen.h src/sys/arch/xen/x86: autoconf.c Log Message: Support bootspec. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/arch/xen/include/xen.h cvs rdiff -u -r1.19 -r1.20 src/sys/arch/xen/x86/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/xen/include/xen.h diff -u src/sys/arch/xen/include/xen.h:1.39 src/sys/arch/xen/include/xen.h:1.40 --- src/sys/arch/xen/include/xen.h:1.39 Thu Jul 26 15:38:26 2018 +++ src/sys/arch/xen/include/xen.h Sun Oct 7 11:25:55 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: xen.h,v 1.39 2018/07/26 15:38:26 maxv Exp $ */ +/* $NetBSD: xen.h,v 1.40 2018/10/07 11:25:55 mlelstv Exp $ */ /* * @@ -44,7 +44,7 @@ struct xen_netinfo { }; union xen_cmdline_parseinfo { - char xcp_bootdev[16]; /* sizeof(dv_xname) */ + char xcp_bootdev[144]; struct xen_netinfo xcp_netinfo; char xcp_console[16]; char xcp_pcidevs[64]; Index: src/sys/arch/xen/x86/autoconf.c diff -u src/sys/arch/xen/x86/autoconf.c:1.19 src/sys/arch/xen/x86/autoconf.c:1.20 --- src/sys/arch/xen/x86/autoconf.c:1.19 Sat Jul 29 06:29:32 2017 +++ src/sys/arch/xen/x86/autoconf.c Sun Oct 7 11:25:55 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.19 2017/07/29 06:29:32 maxv Exp $ */ +/* $NetBSD: autoconf.c,v 1.20 2018/10/07 11:25:55 mlelstv Exp $ */ /* NetBSD: autoconf.c,v 1.75 2003/12/30 12:33:22 pk Exp */ /*- @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.19 2017/07/29 06:29:32 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.20 2018/10/07 11:25:55 mlelstv Exp $"); #include "opt_xen.h" #include "opt_multiprocessor.h" @@ -150,7 +150,8 @@ cpu_rootconf(void) cpu_bootconf(); printf("boot device: %s\n", - booted_device ? device_xname(booted_device) : "<unknown>"); + booted_device ? device_xname(booted_device) : + bootspec ? bootspec : "<unknown>"); rootconf(); } @@ -164,6 +165,7 @@ cpu_bootconf(void) device_t dv; deviter_t di; union xen_cmdline_parseinfo xcp; + static char bootspecbuf[sizeof(xcp.xcp_bootdev)]; if (booted_device) return; @@ -200,6 +202,18 @@ cpu_bootconf(void) break; } deviter_release(&di); + + if (booted_device) + return; + + /* + * not a boot device name, pass through to MI code + */ + if (xcp.xcp_bootdev[0] != '\0') { + strlcpy(bootspecbuf, xcp.xcp_bootdev, sizeof(bootspecbuf)); + bootspec = bootspecbuf; + return; + } } #include "pci.h"