Module Name: src Committed By: bouyer Date: Tue May 26 10:37:25 UTC 2020
Modified Files: src/sys/arch/xen/conf: files.xen src/sys/arch/xen/xen: hypervisor.c privcmd.c src/sys/arch/xen/xenbus: xenbus_probe.c src/sys/miscfs/kernfs: files.kernfs Log Message: Add need-flags for kernfs. Compile Xen kernfs support only if kernfs is compiled in the kernel. Should fix MODULAR build. To generate a diff of this commit: cvs rdiff -u -r1.185 -r1.186 src/sys/arch/xen/conf/files.xen cvs rdiff -u -r1.85 -r1.86 src/sys/arch/xen/xen/hypervisor.c cvs rdiff -u -r1.58 -r1.59 src/sys/arch/xen/xen/privcmd.c cvs rdiff -u -r1.54 -r1.55 src/sys/arch/xen/xenbus/xenbus_probe.c cvs rdiff -u -r1.6 -r1.7 src/sys/miscfs/kernfs/files.kernfs 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/conf/files.xen diff -u src/sys/arch/xen/conf/files.xen:1.185 src/sys/arch/xen/conf/files.xen:1.186 --- src/sys/arch/xen/conf/files.xen:1.185 Tue May 5 17:02:01 2020 +++ src/sys/arch/xen/conf/files.xen Tue May 26 10:37:24 2020 @@ -1,4 +1,4 @@ -# $NetBSD: files.xen,v 1.185 2020/05/05 17:02:01 bouyer Exp $ +# $NetBSD: files.xen,v 1.186 2020/05/26 10:37:24 bouyer Exp $ defflag opt_xen.h XEN XENPVH XENPVHVM PAE DOM0OPS @@ -27,7 +27,7 @@ device xenbus {[id = -1]} attach xenbus at xendevbus file arch/xen/xenbus/xenbus_client.c xenbus needs-flag file arch/xen/xenbus/xenbus_comms.c xenbus needs-flag -file arch/xen/xenbus/xenbus_dev.c xenbus needs-flag +file arch/xen/xenbus/xenbus_dev.c xenbus & kernfs file arch/xen/xenbus/xenbus_probe.c xenbus needs-flag file arch/xen/xenbus/xenbus_xs.c xenbus needs-flag Index: src/sys/arch/xen/xen/hypervisor.c diff -u src/sys/arch/xen/xen/hypervisor.c:1.85 src/sys/arch/xen/xen/hypervisor.c:1.86 --- src/sys/arch/xen/xen/hypervisor.c:1.85 Thu May 21 21:12:31 2020 +++ src/sys/arch/xen/xen/hypervisor.c Tue May 26 10:37:25 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: hypervisor.c,v 1.85 2020/05/21 21:12:31 ad Exp $ */ +/* $NetBSD: hypervisor.c,v 1.86 2020/05/26 10:37:25 bouyer Exp $ */ /* * Copyright (c) 2005 Manuel Bouyer. @@ -53,7 +53,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.85 2020/05/21 21:12:31 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.86 2020/05/26 10:37:25 bouyer Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -65,6 +65,7 @@ __KERNEL_RCSID(0, "$NetBSD: hypervisor.c #include "isa.h" #include "pci.h" #include "acpica.h" +#include "kernfs.h" #include "opt_xen.h" #include "opt_mpbios.h" @@ -778,10 +779,12 @@ kernfs_parentdir_t *kernxen_pkt; void xenkernfs_init(void) { +#if NKERNFS > 0 kernfs_entry_t *dkt; KERNFS_ALLOCENTRY(dkt, KM_SLEEP); KERNFS_INITENTRY(dkt, DT_DIR, "xen", NULL, KFSsubdir, VDIR, DIR_MODE); kernfs_addentry(NULL, dkt); kernxen_pkt = KERNFS_ENTOPARENTDIR(dkt); +#endif } Index: src/sys/arch/xen/xen/privcmd.c diff -u src/sys/arch/xen/xen/privcmd.c:1.58 src/sys/arch/xen/xen/privcmd.c:1.59 --- src/sys/arch/xen/xen/privcmd.c:1.58 Tue May 26 10:11:56 2020 +++ src/sys/arch/xen/xen/privcmd.c Tue May 26 10:37:25 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: privcmd.c,v 1.58 2020/05/26 10:11:56 bouyer Exp $ */ +/* $NetBSD: privcmd.c,v 1.59 2020/05/26 10:37:25 bouyer Exp $ */ /*- * Copyright (c) 2004 Christian Limpach. @@ -27,7 +27,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.58 2020/05/26 10:11:56 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.59 2020/05/26 10:37:25 bouyer Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -782,7 +782,6 @@ privcmd_ioctl(void *v) case IOCTL_PRIVCMD_MMAPBATCH_V2: return privcmd_mmapbatch_v2(ap); - case IOCTL_PRIVCMD_MMAP_RESOURCE: return privcmd_mmap_resource(ap); Index: src/sys/arch/xen/xenbus/xenbus_probe.c diff -u src/sys/arch/xen/xenbus/xenbus_probe.c:1.54 src/sys/arch/xen/xenbus/xenbus_probe.c:1.55 --- src/sys/arch/xen/xenbus/xenbus_probe.c:1.54 Thu May 14 13:18:55 2020 +++ src/sys/arch/xen/xenbus/xenbus_probe.c Tue May 26 10:37:25 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: xenbus_probe.c,v 1.54 2020/05/14 13:18:55 jdolecek Exp $ */ +/* $NetBSD: xenbus_probe.c,v 1.55 2020/05/26 10:37:25 bouyer Exp $ */ /****************************************************************************** * Talks to Xen Store to figure out what devices we have. * @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.54 2020/05/14 13:18:55 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.55 2020/05/26 10:37:25 bouyer Exp $"); #if 0 #define DPRINTK(fmt, args...) \ @@ -56,6 +56,8 @@ __KERNEL_RCSID(0, "$NetBSD: xenbus_probe #include "xenbus_comms.h" +#include "kernfs.h" + static int xenbus_match(device_t, cfdata_t, void *); static void xenbus_attach(device_t, device_t, void *); static int xenbus_print(void *, const char *); @@ -719,8 +721,10 @@ xenbus_probe_init(void *unused) #endif /* DOM0OPS */ } +#if NKERNFS > 0 /* Publish xenbus and Xenstore info in /kern/xen */ xenbus_kernfs_init(); +#endif /* register event handler */ xb_init_comms(xenbus_dev); Index: src/sys/miscfs/kernfs/files.kernfs diff -u src/sys/miscfs/kernfs/files.kernfs:1.6 src/sys/miscfs/kernfs/files.kernfs:1.7 --- src/sys/miscfs/kernfs/files.kernfs:1.6 Sat Oct 11 06:42:20 2014 +++ src/sys/miscfs/kernfs/files.kernfs Tue May 26 10:37:25 2020 @@ -1,7 +1,7 @@ -# $NetBSD: files.kernfs,v 1.6 2014/10/11 06:42:20 uebayasi Exp $ +# $NetBSD: files.kernfs,v 1.7 2020/05/26 10:37:25 bouyer Exp $ deffs KERNFS define kernfs: vfs file miscfs/kernfs/kernfs_vfsops.c kernfs -file miscfs/kernfs/kernfs_vnops.c kernfs +file miscfs/kernfs/kernfs_vnops.c kernfs needs-flag