Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/pgoyette-compat]: src/sys Merge christos's recent changes on HEAD
details: https://anonhg.NetBSD.org/src/rev/4ff4376a4680
branches: pgoyette-compat
changeset: 321148:4ff4376a4680
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Thu Apr 12 22:33:41 2018 +0000
description:
Merge christos's recent changes on HEAD
diffstat:
sys/compat/common/Makefile.inc | 6 +-
sys/compat/common/uipc_syscalls_40.c | 18 +++--
sys/compat/common/uipc_syscalls_50.c | 13 +--
sys/compat/sys/sockio.h | 12 ++-
sys/kern/kern_stub.c | 20 +++++-
sys/net/if.c | 115 ++++++++++------------------------
sys/rump/librump/rumpnet/net_stub.c | 11 +--
7 files changed, 85 insertions(+), 110 deletions(-)
diffs (truncated from 422 to 300 lines):
diff -r 8e164ae0057c -r 4ff4376a4680 sys/compat/common/Makefile.inc
--- a/sys/compat/common/Makefile.inc Sat Apr 07 04:11:47 2018 +0000
+++ b/sys/compat/common/Makefile.inc Thu Apr 12 22:33:41 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.23.2.1 2018/03/13 08:53:06 pgoyette Exp $
+# $NetBSD: Makefile.inc,v 1.23.2.2 2018/04/12 22:33:41 pgoyette Exp $
#
# Configuration variables (default values are below):
#
@@ -17,7 +17,11 @@
# Default values:
COMPATDST?= ${.OBJDIR}/lib/compat
+.if !empty(OPT_MODULAR)
+COMPAT_AS?= library
+.else
COMPAT_AS?= obj
+.endif
COMPATDOTDIR?= ../../.
COMPATDIR= ${S:S@^.@${COMPATDOTDIR}@:Q}/compat/common
diff -r 8e164ae0057c -r 4ff4376a4680 sys/compat/common/uipc_syscalls_40.c
--- a/sys/compat/common/uipc_syscalls_40.c Sat Apr 07 04:11:47 2018 +0000
+++ b/sys/compat/common/uipc_syscalls_40.c Thu Apr 12 22:33:41 2018 +0000
@@ -1,9 +1,9 @@
-/* $NetBSD: uipc_syscalls_40.c,v 1.15.2.5 2018/03/08 09:56:05 pgoyette Exp $ */
+/* $NetBSD: uipc_syscalls_40.c,v 1.15.2.6 2018/04/12 22:33:41 pgoyette Exp $ */
/* written by Pavel Cahyna, 2006. Public domain. */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.15.2.5 2018/03/08 09:56:05 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.15.2.6 2018/04/12 22:33:41 pgoyette Exp $");
/*
* System call interface to the socket abstraction.
@@ -44,6 +44,14 @@
int bound;
struct psref psref;
+ switch (cmd) {
+ case OSIOCGIFCONF:
+ case OOSIOCGIFCONF:
+ break;
+ default:
+ return ENOSYS;
+ }
+
if (docopy) {
space = ifc->ifc_len;
ifrp = ifc->ifc_req;
@@ -153,14 +161,10 @@
return error;
}
-static int (*orig_compat_ifconf)(u_long, void *);
-static int (*orig_compat_ifconf)(u_long, void *);
-
void
if_40_init(void)
{
- orig_compat_ifconf = vec_compat_ifconf;
vec_compat_ifconf = compat_ifconf;
}
@@ -168,5 +172,5 @@
if_40_fini(void)
{
- vec_compat_ifconf = orig_compat_ifconf;
+ vec_compat_ifconf = (void *)enosys;
}
diff -r 8e164ae0057c -r 4ff4376a4680 sys/compat/common/uipc_syscalls_50.c
--- a/sys/compat/common/uipc_syscalls_50.c Sat Apr 07 04:11:47 2018 +0000
+++ b/sys/compat/common/uipc_syscalls_50.c Thu Apr 12 22:33:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_syscalls_50.c,v 1.3.56.3 2018/03/08 09:56:05 pgoyette Exp $ */
+/* $NetBSD: uipc_syscalls_50.c,v 1.3.56.4 2018/04/12 22:33:41 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.56.3 2018/03/08 09:56:05 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_50.c,v 1.3.56.4 2018/04/12 22:33:41 pgoyette Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -57,7 +57,7 @@
#include <compat/sys/if.h>
/*ARGSUSED*/
-int
+static int
compat_ifdatareq(struct lwp *l, u_long cmd, void *data)
{
struct oifdatareq *ifdr = data;
@@ -92,19 +92,16 @@
return 0;
default:
- return EINVAL;
+ return ENOSYS;
}
}
/* Save and restore compat vector as needed */
-int (*orig_compat_ifdatareq)(struct lwp *, u_long, void *);
-
void
if_50_init(void)
{
- orig_compat_ifdatareq = vec_compat_ifdatareq;
vec_compat_ifdatareq = compat_ifdatareq;
}
@@ -112,5 +109,5 @@
if_50_fini(void)
{
- vec_compat_ifdatareq = orig_compat_ifdatareq;
+ vec_compat_ifdatareq = (void *)enosys;
}
diff -r 8e164ae0057c -r 4ff4376a4680 sys/compat/sys/sockio.h
--- a/sys/compat/sys/sockio.h Sat Apr 07 04:11:47 2018 +0000
+++ b/sys/compat/sys/sockio.h Thu Apr 12 22:33:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sockio.h,v 1.10.58.1 2018/03/08 01:37:46 pgoyette Exp $ */
+/* $NetBSD: sockio.h,v 1.10.58.2 2018/04/12 22:33:41 pgoyette Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1993, 1994
@@ -56,8 +56,10 @@
#endif /* _KERNEL_OPT */
+#define OIFNAMSIZ 16
+
struct oifreq {
- char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ char ifr_name[OIFNAMSIZ]; /* if name, e.g. "en0" */
union {
struct sockaddr ifru_addr;
struct sockaddr ifru_dstaddr;
@@ -114,7 +116,7 @@
};
struct oifdatareq {
- char ifdr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ char ifdr_name[OIFNAMSIZ]; /* if name, e.g. "en0" */
struct oif_data ifdr_data;
};
@@ -178,7 +180,9 @@
(ni)->ifi_lastchange.tv_nsec = \
(oi)->ifi_lastchange.tv_usec * 1000; \
} while (/*CONSTCOND*/0)
+
#ifdef _KERNEL
+
void if_50_init(void);
void if_50_fini(void);
@@ -186,5 +190,7 @@
int compat_ifconf(u_long, void *);
int compat_ifdatareq(struct lwp *, u_long, void *);
__END_DECLS
+
#endif
+
#endif /* _COMPAT_SYS_SOCKIO_H_ */
diff -r 8e164ae0057c -r 4ff4376a4680 sys/kern/kern_stub.c
--- a/sys/kern/kern_stub.c Sat Apr 07 04:11:47 2018 +0000
+++ b/sys/kern/kern_stub.c Thu Apr 12 22:33:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_stub.c,v 1.44.2.1 2018/03/10 03:33:27 pgoyette Exp $ */
+/* $NetBSD: kern_stub.c,v 1.44.2.2 2018/04/12 22:33:41 pgoyette Exp $ */
/*-
* Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,11 +62,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_stub.c,v 1.44.2.1 2018/03/10 03:33:27 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_stub.c,v 1.44.2.2 2018/04/12 22:33:41 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_ktrace.h"
#include "opt_sysv.h"
+#include "opt_modular.h"
#endif
#include <sys/param.h>
@@ -87,6 +88,21 @@
bus_space_handle_t);
/*
+ * SYSV Semaphores, Shared Memory, Message Queues
+ */
+#ifndef MODULAR
+#ifndef SYSVMSG
+__strong_alias(msgctl1,enosys);
+#endif
+#ifndef SYSVSHM
+__strong_alias(shmctl1,enosys);
+#endif
+ #ifndef SYSVSEM
+ __strong_alias(semctl1,enosys);
+ #endif
+#endif
+
+/*
* ktrace stubs. ktruser() goes to enosys as we want to fail the syscall,
* but not kill the process: utrace() is a debugging feature.
*/
diff -r 8e164ae0057c -r 4ff4376a4680 sys/net/if.c
--- a/sys/net/if.c Sat Apr 07 04:11:47 2018 +0000
+++ b/sys/net/if.c Thu Apr 12 22:33:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.419.2.4 2018/03/08 00:25:30 pgoyette Exp $ */
+/* $NetBSD: if.c,v 1.419.2.5 2018/04/12 22:33:41 pgoyette Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.419.2.4 2018/03/08 00:25:30 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.419.2.5 2018/04/12 22:33:41 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -157,7 +157,6 @@
#include <compat/sys/sockio.h>
#include <compat/sys/socket.h>
-#include <compat/sys/if.h>
MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address");
MALLOC_DEFINE(M_IFMADDR, "ether_multi", "link-level multicast address");
@@ -243,58 +242,12 @@
static void if_sysctl_setup(struct sysctllog **);
-/*
- * Pointer to stub or real compat_cvtcmd() depending on presence of
- * the compat module
- */
-u_long stub_compat_cvtcmd(u_long);
-u_long (*vec_compat_cvtcmd)(u_long) = stub_compat_cvtcmd;
-
-/* Similarly, pointer to compat_ifioctl() if it is present */
-
+/* Compatability vector functions */
+u_long (*vec_compat_cvtcmd)(u_long) = NULL;
int (*vec_compat_ifioctl)(struct socket *, u_long, u_long, void *,
struct lwp *) = NULL;
-
-/*
- * And a few more
- */
-int stub_compat_ifdatareq(struct lwp *, u_long, void *);
-int (*vec_compat_ifdatareq)(struct lwp *, u_long, void *) =
- stub_compat_ifdatareq;
-
-void stub_compat_ifreqo2n(struct oifreq *, struct ifreq *);
-void (*vec_compat_ifreqo2n)(struct oifreq *, struct ifreq *) =
- stub_compat_ifreqo2n;
-
-int stub_compat_ifconf(u_long, void *);
-int (*vec_compat_ifconf)(u_long, void *) = stub_compat_ifconf;
-
-/* The stub version of compat_cvtcmd() */
-u_long stub_compat_cvtcmd(u_long cmd)
-{
-
- return cmd;
-}
-
-/* The stub version of compat_ifdatareq() */
-int stub_compat_ifdatareq(struct lwp *l, u_long cmd, void *data)
-{
-
- return EINVAL;
-}
-
-/* The stub version of compat_ifreqo2n() */
-void stub_compat_ifreqo2n(struct oifreq *old, struct ifreq *new)
-{
-
-}
-
-/* The stub version of compat_ifconf() */
Home |
Main Index |
Thread Index |
Old Index