Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 Protect NPT stuff by "#ifdef NTP". Fix n...



details:   https://anonhg.NetBSD.org/src/rev/624ce422a9ae
branches:  trunk
changeset: 819052:624ce422a9ae
user:      rin <rin%NetBSD.org@localhost>
date:      Tue Nov 15 10:57:57 2016 +0000

description:
Protect NPT stuff by "#ifdef NTP". Fix non-NTP kernel.
Approved by martin.

diffstat:

 sys/compat/netbsd32/netbsd32_ioctl.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (86 lines):

diff -r 75edb5e60c00 -r 624ce422a9ae sys/compat/netbsd32/netbsd32_ioctl.c
--- a/sys/compat/netbsd32/netbsd32_ioctl.c      Tue Nov 15 10:05:22 2016 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.c      Tue Nov 15 10:57:57 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.c,v 1.85 2016/11/12 16:06:04 mlelstv Exp $      */
+/*     $NetBSD: netbsd32_ioctl.c,v 1.86 2016/11/15 10:57:57 rin Exp $  */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,11 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.85 2016/11/12 16:06:04 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.86 2016/11/15 10:57:57 rin Exp $");
+
+#if defined(_KERNEL_OPT)
+#include "opt_ntp.h"
+#endif
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -422,6 +426,7 @@
        p->tp = NETBSD32PTR64(s32p->tp);
 }
 
+#ifdef NTP
 static inline void
 netbsd32_to_clockctl_ntp_adjtime(
     const struct netbsd32_clockctl_ntp_adjtime *s32p,
@@ -432,6 +437,7 @@
        p->tp = NETBSD32PTR64(s32p->tp);
        p->retval = s32p->retval;
 }
+#endif
 
 static inline void
 netbsd32_to_ksyms_gsymbol(
@@ -842,6 +848,7 @@
        NETBSD32PTR32(s32p->tp, p->tp);
 }
 
+#ifdef NTP
 static inline void
 netbsd32_from_clockctl_ntp_adjtime(
     const struct clockctl_ntp_adjtime *p,
@@ -852,6 +859,7 @@
        NETBSD32PTR32(s32p->tp, p->tp);
        s32p->retval = p->retval;
 }
+#endif
 
 static inline void
 netbsd32_from_ksyms_gsymbol(
@@ -922,6 +930,7 @@
        NETBSD32PTR32(s32p->locators, p->locators);
 }
 
+#ifdef NTP
 static int
 netbsd32_do_clockctl_ntp_adjtime(struct clockctl_ntp_adjtime *args)
 {
@@ -944,6 +953,7 @@
 
        return error;
 }
+#endif
 
 /*
  * main ioctl syscall.
@@ -1314,6 +1324,7 @@
        case CLOCKCTL_CLOCK_SETTIME32:
                IOCTL_STRUCT_CONV_TO(CLOCKCTL_CLOCK_SETTIME,
                    clockctl_clock_settime);
+#ifdef NTP
        case CLOCKCTL_NTP_ADJTIME32:
                {
                        size = IOCPARM_LEN(CLOCKCTL_NTP_ADJTIME);
@@ -1335,6 +1346,7 @@
 
                        break;
                }
+#endif
 
        case KIOCGSYMBOL32:
                IOCTL_STRUCT_CONV_TO(KIOCGSYMBOL, ksyms_gsymbol);



Home | Main Index | Thread Index | Old Index