Source-Changes-HG archive

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

[src/pgoyette-compat]: src/sys/compat/common Implement vector initialization ...



details:   https://anonhg.NetBSD.org/src/rev/1d6d8ac4fc1c
branches:  pgoyette-compat
changeset: 830382:1d6d8ac4fc1c
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Thu Mar 08 00:23:47 2018 +0000

description:
Implement vector initialization for ifreqo2n and ifdatareq

diffstat:

 sys/compat/common/compat_mod.c       |   6 ++++--
 sys/compat/common/uipc_syscalls_50.c |  27 +++++++++++++++++++++++++--
 2 files changed, 29 insertions(+), 4 deletions(-)

diffs (73 lines):

diff -r b0bcdc287591 -r 1d6d8ac4fc1c sys/compat/common/compat_mod.c
--- a/sys/compat/common/compat_mod.c    Wed Mar 07 09:33:26 2018 +0000
+++ b/sys/compat/common/compat_mod.c    Thu Mar 08 00:23:47 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_mod.c,v 1.24.14.2 2018/03/06 23:17:42 pgoyette Exp $    */
+/*     $NetBSD: compat_mod.c,v 1.24.14.3 2018/03/08 00:23:47 pgoyette Exp $    */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24.14.2 2018/03/06 23:17:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24.14.3 2018/03/08 00:23:47 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -60,6 +60,8 @@
 #include <compat/common/compat_util.h>
 #include <compat/common/compat_mod.h>
 #include <compat/common/if_43.h>
+#include <compat/sys/sockio.h>
+
 
 #if defined(COMPAT_09) || defined(COMPAT_43) || defined(COMPAT_50)
 static struct sysctllog *compat_clog = NULL;
diff -r b0bcdc287591 -r 1d6d8ac4fc1c sys/compat/common/uipc_syscalls_50.c
--- a/sys/compat/common/uipc_syscalls_50.c      Wed Mar 07 09:33:26 2018 +0000
+++ b/sys/compat/common/uipc_syscalls_50.c      Thu Mar 08 00:23:47 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_syscalls_50.c,v 1.3 2011/01/19 10:21:16 tsutsui Exp $     */
+/*     $NetBSD: uipc_syscalls_50.c,v 1.3.56.1 2018/03/08 00:23:47 pgoyette Exp $       */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_50.c,v 1.3 2011/01/19 10:21:16 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_50.c,v 1.3.56.1 2018/03/08 00:23:47 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -95,4 +95,27 @@
                return EINVAL;
        }
 }
+
+/* Save and restore compat vector as needed */
+
+int (*orig_compat_ifconf)(u_long, void *);
+int (*orig_compat_ifdatareq)(struct lwp *, u_long, void *);
+
+void
+if_50_init(void)
+{
+
+       orig_compat_ifreqo2n = vec_compat_ifreqo2n;
+       orig_compat_ifdatareq = vec_compat_ifdatareq;
+       vec_compat_ifreqo2n = compat_ifreqo2n;
+       vec_compat_ifdatareq = compat_ifdatareq;
+}
+
+void
+if_50_fini(void)
+{
+
+       vec_compat_ifreqo2n = orig_compat_ifreqo2n;
+       vec_compat_ifdatareq = orig_compat_ifdatareq;
+}
 #endif



Home | Main Index | Thread Index | Old Index