Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/pgoyette-compat]: src/sys Move the NTP compat_30 and compat_50 routines ...
details: https://anonhg.NetBSD.org/src/rev/ee6838a1476a
branches: pgoyette-compat
changeset: 830669:ee6838a1476a
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Tue Sep 11 23:58:46 2018 +0000
description:
Move the NTP compat_30 and compat_50 routines into the version-specific
modules.
diffstat:
sys/compat/netbsd32/netbsd32_compat_30.c | 38 ++++++++++++++++++-
sys/compat/netbsd32/netbsd32_compat_50.c | 38 ++++++++++++++++++-
sys/compat/netbsd32/netbsd32_time.c | 63 +------------------------------
sys/compat/netbsd32/syscalls.master | 8 ++-
sys/modules/compat_netbsd32/Makefile | 4 +-
sys/modules/compat_netbsd32_30/Makefile | 3 +-
sys/modules/compat_netbsd32_50/Makefile | 3 +-
7 files changed, 85 insertions(+), 72 deletions(-)
diffs (truncated from 302 to 300 lines):
diff -r 8587185d2bf1 -r ee6838a1476a sys/compat/netbsd32/netbsd32_compat_30.c
--- a/sys/compat/netbsd32/netbsd32_compat_30.c Tue Sep 11 23:26:21 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_30.c Tue Sep 11 23:58:46 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_compat_30.c,v 1.31.16.7 2018/09/11 21:18:32 pgoyette Exp $ */
+/* $NetBSD: netbsd32_compat_30.c,v 1.31.16.8 2018/09/11 23:58:46 pgoyette Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,11 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_30.c,v 1.31.16.7 2018/09/11 21:18:32 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_30.c,v 1.31.16.8 2018/09/11 23:58:46 pgoyette Exp $");
+
+#if defined(_KERNEL_OPT)
+#include <opt_ntp.h>
+#endif
#include <sys/param.h>
#include <sys/systm.h>
@@ -297,6 +301,34 @@
return (compat_30_sys_fhopen(l, &ua, retval));
}
+#ifdef NTP
+int
+compat_30_netbsd32_ntp_gettime(struct lwp *l, const struct compat_30_netbsd32_ntp_gettime_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(netbsd32_ntptimevalp_t) ntvp;
+ } */
+ struct netbsd32_ntptimeval30 ntv32;
+ struct ntptimeval ntv;
+ int error = 0;
+
+ if (SCARG_P32(uap, ntvp)) {
+ ntp_gettime(&ntv);
+
+ ntv32.time.tv_sec = ntv.time.tv_sec;
+ ntv32.time.tv_usec = ntv.time.tv_nsec / 1000;
+ ntv32.maxerror = (netbsd32_long)ntv.maxerror;
+ ntv32.esterror = (netbsd32_long)ntv.esterror;
+ error = copyout(&ntv32, SCARG_P32(uap, ntvp), sizeof(ntv32));
+ }
+ if (!error) {
+ *retval = ntp_timestatus();
+ }
+
+ return (error);
+}
+#endif
+
static struct syscall_package compat_netbsd32_30_syscalls[] = {
{ NETBSD32_SYS_compat_30_netbsd32_getdents, 0,
(sy_call_t *)compat_30_netbsd32_getdents },
@@ -318,6 +350,8 @@
(sy_call_t *)compat_30_netbsd32___fhstat30 },
{ NETBSD32_SYS_compat_30_netbsd32_fhopen, 0,
(sy_call_t *)compat_30_netbsd32_fhopen },
+ { NETBSD32_SYS_compat_30_netbsd32_ntp_gettime, 0,
+ (sy_call_t *)compat_30_netbsd32_ntp_gettime },
{ 0, 0, NULL }
};
diff -r 8587185d2bf1 -r ee6838a1476a sys/compat/netbsd32/netbsd32_compat_50.c
--- a/sys/compat/netbsd32/netbsd32_compat_50.c Tue Sep 11 23:26:21 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_50.c Tue Sep 11 23:58:46 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_compat_50.c,v 1.32.16.7 2018/09/11 23:26:21 pgoyette Exp $ */
+/* $NetBSD: netbsd32_compat_50.c,v 1.32.16.8 2018/09/11 23:58:46 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,12 +36,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.32.16.7 2018/09/11 23:26:21 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.32.16.8 2018/09/11 23:58:46 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
+#include <opt_ntp.h>
#endif
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/module.h>
@@ -929,6 +931,36 @@
return (compat_50_sys_quotactl(l, &ua, retval));
}
+int
+compat_50_netbsd32_ntp_gettime(struct lwp *l,
+ const struct compat_50_netbsd32_ntp_gettime_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(netbsd32_ntptimeval50p_t) ntvp;
+ } */
+ struct netbsd32_ntptimeval50 ntv32;
+ struct ntptimeval ntv;
+ int error = 0;
+
+ if (SCARG_P32(uap, ntvp)) {
+ ntp_gettime(&ntv);
+
+ ntv32.time.tv_sec = (int32_t)ntv.time.tv_sec;
+ ntv32.time.tv_nsec = ntv.time.tv_nsec;
+ ntv32.maxerror = (netbsd32_long)ntv.maxerror;
+ ntv32.esterror = (netbsd32_long)ntv.esterror;
+ ntv32.tai = (netbsd32_long)ntv.tai;
+ ntv32.time_state = ntv.time_state;
+ error = copyout(&ntv32, SCARG_P32(uap, ntvp), sizeof(ntv32));
+ }
+ if (!error) {
+ *retval = ntp_timestatus();
+ }
+
+ return (error);
+}
+
+
static struct syscall_package compat_netbsd32_50_syscalls[] = {
{ NETBSD32_SYS_compat_50_netbsd32_mknod, 0,
(sy_call_t *)compat_50_netbsd32_mknod },
@@ -986,6 +1018,8 @@
(sy_call_t *)compat_50_netbsd32_getitimer },
{ NETBSD32_SYS_compat_50_netbsd32_quotactl, 0,
(sy_call_t *)compat_50_netbsd32_quotactl },
+ { NETBSD32_SYS_compat_50_netbsd32_ntp_gettime, 0,
+ (sy_call_t *)compat_50_netbsd32_ntp_gettime },
{ 0, 0, NULL }
};
diff -r 8587185d2bf1 -r ee6838a1476a sys/compat/netbsd32/netbsd32_time.c
--- a/sys/compat/netbsd32/netbsd32_time.c Tue Sep 11 23:26:21 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_time.c Tue Sep 11 23:58:46 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_time.c,v 1.49 2017/02/26 10:26:19 njoly Exp $ */
+/* $NetBSD: netbsd32_time.c,v 1.49.12.1 2018/09/11 23:58:46 pgoyette Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.49 2017/02/26 10:26:19 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.49.12.1 2018/09/11 23:58:46 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ntp.h"
@@ -81,65 +81,6 @@
return (error);
}
-#ifdef COMPAT_50
-int
-compat_50_netbsd32_ntp_gettime(struct lwp *l,
- const struct compat_50_netbsd32_ntp_gettime_args *uap, register_t *retval)
-{
- /* {
- syscallarg(netbsd32_ntptimeval50p_t) ntvp;
- } */
- struct netbsd32_ntptimeval50 ntv32;
- struct ntptimeval ntv;
- int error = 0;
-
- if (SCARG_P32(uap, ntvp)) {
- ntp_gettime(&ntv);
-
- ntv32.time.tv_sec = (int32_t)ntv.time.tv_sec;
- ntv32.time.tv_nsec = ntv.time.tv_nsec;
- ntv32.maxerror = (netbsd32_long)ntv.maxerror;
- ntv32.esterror = (netbsd32_long)ntv.esterror;
- ntv32.tai = (netbsd32_long)ntv.tai;
- ntv32.time_state = ntv.time_state;
- error = copyout(&ntv32, SCARG_P32(uap, ntvp), sizeof(ntv32));
- }
- if (!error) {
- *retval = ntp_timestatus();
- }
-
- return (error);
-}
-#endif
-
-#ifdef COMPAT_30
-int
-compat_30_netbsd32_ntp_gettime(struct lwp *l, const struct compat_30_netbsd32_ntp_gettime_args *uap, register_t *retval)
-{
- /* {
- syscallarg(netbsd32_ntptimevalp_t) ntvp;
- } */
- struct netbsd32_ntptimeval30 ntv32;
- struct ntptimeval ntv;
- int error = 0;
-
- if (SCARG_P32(uap, ntvp)) {
- ntp_gettime(&ntv);
-
- ntv32.time.tv_sec = ntv.time.tv_sec;
- ntv32.time.tv_usec = ntv.time.tv_nsec / 1000;
- ntv32.maxerror = (netbsd32_long)ntv.maxerror;
- ntv32.esterror = (netbsd32_long)ntv.esterror;
- error = copyout(&ntv32, SCARG_P32(uap, ntvp), sizeof(ntv32));
- }
- if (!error) {
- *retval = ntp_timestatus();
- }
-
- return (error);
-}
-#endif
-
int
netbsd32_ntp_adjtime(struct lwp *l, const struct netbsd32_ntp_adjtime_args *uap, register_t *retval)
{
diff -r 8587185d2bf1 -r ee6838a1476a sys/compat/netbsd32/syscalls.master
--- a/sys/compat/netbsd32/syscalls.master Tue Sep 11 23:26:21 2018 +0000
+++ b/sys/compat/netbsd32/syscalls.master Tue Sep 11 23:58:46 2018 +0000
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.120.2.10 2018/09/11 08:35:27 pgoyette Exp $
+ $NetBSD: syscalls.master,v 1.120.2.11 2018/09/11 23:58:46 pgoyette Exp $
; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -408,7 +408,8 @@
netbsd32_voidp buf, netbsd32_size_t nbyte, \
int PAD, netbsd32_off_t offset); }
#if defined(NTP) || !defined(_KERNEL_OPT)
-175 COMPAT_30 { int|netbsd32||ntp_gettime( \
+175 COMPAT_30 MODULAR compat_netbsd32_30 \
+ { int|netbsd32||ntp_gettime( \
netbsd32_ntptimeval50p_t ntvp); }
176 STD { int|netbsd32||ntp_adjtime(netbsd32_timexp_t tp); }
#else
@@ -888,7 +889,8 @@
netbsd32_fhandlep_t fhp, \
netbsd32_stat50p_t sb); }
#if defined(NTP) || !defined(_KERNEL_OPT)
-393 COMPAT_50 { int|netbsd32||ntp_gettime( \
+393 COMPAT_50 MODULAR compat_netbsd32_50 \
+ { int|netbsd32||ntp_gettime( \
netbsd32_ntptimeval50p_t ntvp); }
#else
393 EXCL __ntp_gettime30
diff -r 8587185d2bf1 -r ee6838a1476a sys/modules/compat_netbsd32/Makefile
--- a/sys/modules/compat_netbsd32/Makefile Tue Sep 11 23:26:21 2018 +0000
+++ b/sys/modules/compat_netbsd32/Makefile Tue Sep 11 23:58:46 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20.12.7 2018/09/11 23:26:21 pgoyette Exp $
+# $NetBSD: Makefile,v 1.20.12.8 2018/09/11 23:58:46 pgoyette Exp $
.include "../Makefile.inc"
.include "../Makefile.assym"
@@ -21,7 +21,7 @@
CPPFLAGS+= -DCOMPAT_NETBSD32
CPPFLAGS+= -DEXEC_ELF32 -DEXEC_ELF64
CPPFLAGS+= -DCOREDUMP -DNTP -DVMSWAP
-CPPFLAGS+= -DNTP -DKTRACE -DMODULAR
+CPPFLAGS+= -DKTRACE -DMODULAR
.PATH: ${S}/compat/netbsd32
SRCS+= netbsd32_compat_10.c # belongs to compat_netbsd32_sysvipc_10
diff -r 8587185d2bf1 -r ee6838a1476a sys/modules/compat_netbsd32_30/Makefile
--- a/sys/modules/compat_netbsd32_30/Makefile Tue Sep 11 23:26:21 2018 +0000
+++ b/sys/modules/compat_netbsd32_30/Makefile Tue Sep 11 23:58:46 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1.2.2 2018/09/11 04:20:51 pgoyette Exp $
+# $NetBSD: Makefile,v 1.1.2.3 2018/09/11 23:58:46 pgoyette Exp $
.include "../Makefile.inc"
@@ -6,6 +6,7 @@
KMOD= compat_netbsd32_30
+CPPFLAGS+= -DNTP
CPPFLAGS+= -DCOMPAT_NETBSD32
CPPFLAGS+= -DCOMPAT_30
CPPFLAGS+= -DCOMPAT_40 -DCOMPAT_50 -DCOMPAT_60 -DCOMPAT_70 -DCOMPAT_80
diff -r 8587185d2bf1 -r ee6838a1476a sys/modules/compat_netbsd32_50/Makefile
--- a/sys/modules/compat_netbsd32_50/Makefile Tue Sep 11 23:26:21 2018 +0000
+++ b/sys/modules/compat_netbsd32_50/Makefile Tue Sep 11 23:58:46 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1.2.3 2018/09/11 23:26:21 pgoyette Exp $
+# $NetBSD: Makefile,v 1.1.2.4 2018/09/11 23:58:47 pgoyette Exp $
.include "../Makefile.inc"
@@ -6,6 +6,7 @@
KMOD= compat_netbsd32_50
+CPPFLAGS+= -DNTP
CPPFLAGS+= -DCOMPAT_NETBSD32
Home |
Main Index |
Thread Index |
Old Index