Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 Restore code to sysctl_free() the compat...



details:   https://anonhg.NetBSD.org/src/rev/64415721957a
branches:  trunk
changeset: 746066:64415721957a
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Mar 21 16:17:08 2020 +0000

description:
Restore code to sysctl_free() the compat32 shadow tree

diffstat:

 sys/compat/netbsd32/netbsd32_mod.c    |   6 +++-
 sys/compat/netbsd32/netbsd32_sysctl.c |  12 +++++++++-
 sys/compat/netbsd32/netbsd32_sysctl.h |  37 +++++++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+), 4 deletions(-)

diffs (115 lines):

diff -r 41620b98e9eb -r 64415721957a sys/compat/netbsd32/netbsd32_mod.c
--- a/sys/compat/netbsd32/netbsd32_mod.c        Sat Mar 21 14:25:49 2020 +0000
+++ b/sys/compat/netbsd32/netbsd32_mod.c        Sat Mar 21 16:17:08 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_mod.c,v 1.21 2020/03/15 14:15:12 pgoyette Exp $       */
+/*     $NetBSD: netbsd32_mod.c,v 1.22 2020/03/21 16:17:08 pgoyette Exp $       */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.21 2020/03/15 14:15:12 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.22 2020/03/21 16:17:08 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -76,6 +76,7 @@
 #include <sys/module_hook.h>
 #include <sys/compat_stub.h>
 
+#include <compat/netbsd32/netbsd32_sysctl.h>
 #include <compat/netbsd32/netbsd32_kern_proc.h>
 #include <compat/netbsd32/netbsd32_exec.h>
 
@@ -180,6 +181,7 @@
                MODULE_HOOK_UNSET(amd64_oosyscall_hook);
 #endif /* defined(__amd64__) */
                netbsd32_machdep_md_fini();
+               netbsd32_sysctl_fini();
                netbsd32_kern_proc_32_fini();
 
                error = exec_remove(netbsd32_execsw,
diff -r 41620b98e9eb -r 64415721957a sys/compat/netbsd32/netbsd32_sysctl.c
--- a/sys/compat/netbsd32/netbsd32_sysctl.c     Sat Mar 21 14:25:49 2020 +0000
+++ b/sys/compat/netbsd32/netbsd32_sysctl.c     Sat Mar 21 16:17:08 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_sysctl.c,v 1.43 2020/03/17 17:16:26 pgoyette Exp $    */
+/*     $NetBSD: netbsd32_sysctl.c,v 1.44 2020/03/21 16:17:08 pgoyette Exp $    */
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.43 2020/03/17 17:16:26 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.44 2020/03/21 16:17:08 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -57,6 +57,7 @@
 #include <compat/netbsd32/netbsd32_syscall.h>
 #include <compat/netbsd32/netbsd32_syscallargs.h>
 #include <compat/netbsd32/netbsd32_conv.h>
+#include <compat/netbsd32/netbsd32_sysctl.h>
 
 #if defined(DDB)
 #include <ddb/ddbvar.h>
@@ -180,6 +181,13 @@
                       CTL_HW, HW_MACHINE_ARCH, CTL_EOL);
 }
 
+void
+netbsd32_sysctl_fini(void)
+{
+
+       sysctl_free(&netbsd32_sysctl_root);
+}
+
 int
 netbsd32___sysctl(struct lwp *l, const struct netbsd32___sysctl_args *uap, register_t *retval)
 {
diff -r 41620b98e9eb -r 64415721957a sys/compat/netbsd32/netbsd32_sysctl.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/netbsd32/netbsd32_sysctl.h     Sat Mar 21 16:17:08 2020 +0000
@@ -0,0 +1,37 @@
+/*     $NetBSD: netbsd32_sysctl.h,v 1.3 2020/03/21 16:17:08 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software developed for The NetBSD Foundation
+ * by Andrew Doran.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _NETBSD32_SYSCTL_H
+#define _NETBSD32_SYSCTL_H
+
+void   netbsd32_sysctl_fini(void);
+
+#endif /* !_NETBSD32_SYSCTL_H */



Home | Main Index | Thread Index | Old Index