Source-Changes-HG archive

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

[src/trunk]: src/sys/sys sys: Put externs for time_adjtime and time_adjusted ...



details:   https://anonhg.NetBSD.org/src/rev/0596e0a8220e
branches:  trunk
changeset: 372063:0596e0a8220e
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Oct 26 23:23:52 2022 +0000

description:
sys: Put externs for time_adjtime and time_adjusted in .h files.

time_adjtime: sys/timex.h (defined in ntp code)
time_adjusted: sys/timevar.h (defined in non-ntp code)

(Not really sure this is a valuable distinction to maintain; there's
non-ntp code that uses time_adjtime too.)

diffstat:

 sys/arch/amd64/amd64/machdep.c           |  7 +++----
 sys/arch/i386/i386/machdep.c             |  7 +++----
 sys/compat/netbsd32/netbsd32_compat_50.c |  9 ++++-----
 sys/compat/netbsd32/netbsd32_time.c      |  7 ++-----
 sys/kern/kern_ntptime.c                  |  6 ++----
 sys/kern/kern_time.c                     |  6 +++---
 sys/sys/timevar.h                        |  4 +++-
 sys/sys/timex.h                          |  7 ++++++-
 8 files changed, 26 insertions(+), 27 deletions(-)

diffs (249 lines):

diff -r 79563fd5b14d -r 0596e0a8220e sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c    Wed Oct 26 23:23:28 2022 +0000
+++ b/sys/arch/amd64/amd64/machdep.c    Wed Oct 26 23:23:52 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.364 2022/10/26 23:22:07 riastradh Exp $  */
+/*     $NetBSD: machdep.c,v 1.365 2022/10/26 23:23:52 riastradh Exp $  */
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.364 2022/10/26 23:22:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.365 2022/10/26 23:23:52 riastradh Exp $");
 
 #include "opt_modular.h"
 #include "opt_user_ldt.h"
@@ -154,6 +154,7 @@
 #include <sys/csan.h>
 #include <sys/msan.h>
 #include <sys/module.h>
+#include <sys/timevar.h>
 
 #ifdef KGDB
 #include <sys/kgdb.h>
@@ -303,8 +304,6 @@
 
 static void x86_64_proc0_pcb_ldt_init(void);
 
-extern int time_adjusted;      /* XXX no common header */
-
 void dump_misc_init(void);
 void dump_seg_prep(void);
 int dump_seg_iter(int (*)(paddr_t, paddr_t));
diff -r 79563fd5b14d -r 0596e0a8220e sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c      Wed Oct 26 23:23:28 2022 +0000
+++ b/sys/arch/i386/i386/machdep.c      Wed Oct 26 23:23:52 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.837 2022/08/20 23:48:50 riastradh Exp $  */
+/*     $NetBSD: machdep.c,v 1.838 2022/10/26 23:23:52 riastradh Exp $  */
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.837 2022/08/20 23:48:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.838 2022/10/26 23:23:52 riastradh Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_freebsd.h"
@@ -106,6 +106,7 @@
 #include <sys/ras.h>
 #include <sys/ksyms.h>
 #include <sys/device.h>
+#include <sys/timevar.h>
 
 #ifdef KGDB
 #include <sys/kgdb.h>
@@ -250,8 +251,6 @@
 
 static void i386_proc0_pcb_ldt_init(void);
 
-extern int time_adjusted;
-
 int *esym;
 int *eblob;
 extern int boothowto;
diff -r 79563fd5b14d -r 0596e0a8220e sys/compat/netbsd32/netbsd32_compat_50.c
--- a/sys/compat/netbsd32/netbsd32_compat_50.c  Wed Oct 26 23:23:28 2022 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_50.c  Wed Oct 26 23:23:52 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_compat_50.c,v 1.52 2021/09/07 11:43:05 riastradh Exp $        */
+/*     $NetBSD: netbsd32_compat_50.c,v 1.53 2022/10/26 23:23:52 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.52 2021/09/07 11:43:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.53 2022/10/26 23:23:52 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -47,6 +47,8 @@
 #include <sys/socketvar.h>
 #include <sys/stat.h>
 #include <sys/time.h>
+#include <sys/timevar.h>
+#include <sys/timex.h>
 #include <sys/ktrace.h>
 #include <sys/eventvar.h>
 #include <sys/resourcevar.h>
@@ -247,9 +249,6 @@
        struct netbsd32_timeval50 atv;
        int error;
 
-       extern int time_adjusted;     /* in kern_ntptime.c */
-       extern int64_t time_adjtime;  /* in kern_ntptime.c */
-
        if ((error = kauth_authorize_system(l->l_cred,
            KAUTH_SYSTEM_TIME, KAUTH_REQ_SYSTEM_TIME_ADJTIME, NULL, NULL,
            NULL)) != 0)
diff -r 79563fd5b14d -r 0596e0a8220e sys/compat/netbsd32/netbsd32_time.c
--- a/sys/compat/netbsd32/netbsd32_time.c       Wed Oct 26 23:23:28 2022 +0000
+++ b/sys/compat/netbsd32/netbsd32_time.c       Wed Oct 26 23:23:52 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_time.c,v 1.57 2021/09/20 01:00:55 thorpej Exp $       */
+/*     $NetBSD: netbsd32_time.c,v 1.58 2022/10/26 23:23:52 riastradh 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.57 2021/09/20 01:00:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.58 2022/10/26 23:23:52 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -261,9 +261,6 @@
        struct netbsd32_timeval atv;
        int error;
 
-       extern int time_adjusted;     /* in kern_ntptime.c */
-       extern int64_t time_adjtime;  /* in kern_ntptime.c */
-
        if ((error = kauth_authorize_system(l->l_cred,
            KAUTH_SYSTEM_TIME, KAUTH_REQ_SYSTEM_TIME_ADJTIME, NULL, NULL,
            NULL)) != 0)
diff -r 79563fd5b14d -r 0596e0a8220e sys/kern/kern_ntptime.c
--- a/sys/kern/kern_ntptime.c   Wed Oct 26 23:23:28 2022 +0000
+++ b/sys/kern/kern_ntptime.c   Wed Oct 26 23:23:52 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_ntptime.c,v 1.63 2022/03/13 12:57:33 riastradh Exp $      */
+/*     $NetBSD: kern_ntptime.c,v 1.64 2022/10/26 23:23:52 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("$FreeBSD: src/sys/kern/kern_ntptime.c,v 1.59 2005/05/28 14:34:41 rwatson Exp $"); */
-__KERNEL_RCSID(0, "$NetBSD: kern_ntptime.c,v 1.63 2022/03/13 12:57:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ntptime.c,v 1.64 2022/10/26 23:23:52 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ntp.h"
@@ -190,8 +190,6 @@
 static l_fp time_adj;                  /* tick adjust (ns/s) */
 int64_t time_adjtime;          /* correction from adjtime(2) (usec) */
 
-extern int time_adjusted;      /* ntp might have changed the system time */
-
 #ifdef NTP
 #ifdef PPS_SYNC
 /*
diff -r 79563fd5b14d -r 0596e0a8220e sys/kern/kern_time.c
--- a/sys/kern/kern_time.c      Wed Oct 26 23:23:28 2022 +0000
+++ b/sys/kern/kern_time.c      Wed Oct 26 23:23:52 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_time.c,v 1.217 2022/07/01 21:22:44 riastradh Exp $        */
+/*     $NetBSD: kern_time.c,v 1.218 2022/10/26 23:23:52 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009, 2020
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.217 2022/07/01 21:22:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.218 2022/10/26 23:23:52 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/resourcevar.h>
@@ -73,6 +73,7 @@
 #include <sys/signalvar.h>
 #include <sys/syslog.h>
 #include <sys/timetc.h>
+#include <sys/timevar.h>
 #include <sys/timex.h>
 #include <sys/kauth.h>
 #include <sys/mount.h>
@@ -603,7 +604,6 @@
 void
 adjtime1(const struct timeval *delta, struct timeval *olddelta, struct proc *p)
 {
-       extern int64_t time_adjtime;  /* in kern_ntptime.c */
 
        if (olddelta) {
                memset(olddelta, 0, sizeof(*olddelta));
diff -r 79563fd5b14d -r 0596e0a8220e sys/sys/timevar.h
--- a/sys/sys/timevar.h Wed Oct 26 23:23:28 2022 +0000
+++ b/sys/sys/timevar.h Wed Oct 26 23:23:52 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: timevar.h,v 1.48 2021/07/20 08:37:20 skrll Exp $       */
+/*     $NetBSD: timevar.h,v 1.49 2022/10/26 23:23:52 riastradh Exp $   */
 
 /*
  *  Copyright (c) 2005, 2008, 2020 The NetBSD Foundation, Inc.
@@ -237,6 +237,8 @@
 extern volatile time_t time_second;    /* current second in the epoch */
 extern volatile time_t time_uptime;    /* system uptime in seconds */
 
+extern int time_adjusted;
+
 #define        DEFAULT_TIMEOUT_EPSILON                                               \
        (&(const struct bintime) {                                            \
                .sec = 0,                                                     \
diff -r 79563fd5b14d -r 0596e0a8220e sys/sys/timex.h
--- a/sys/sys/timex.h   Wed Oct 26 23:23:28 2022 +0000
+++ b/sys/sys/timex.h   Wed Oct 26 23:23:52 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: timex.h,v 1.19 2021/12/10 20:36:04 andvar Exp $        */
+/*     $NetBSD: timex.h,v 1.20 2022/10/26 23:23:52 riastradh Exp $     */
 
 /*-
  ***********************************************************************
@@ -238,6 +238,7 @@
 };
 
 #ifdef _KERNEL
+
 #include <sys/mutex.h>
 
 void   ntp_update_second(int64_t *adjustment, time_t *newsec);
@@ -246,6 +247,9 @@
 int ntp_timestatus(void);
 
 extern kmutex_t timecounter_lock;
+
+extern int64_t time_adjtime;
+
 #else /* !_KERNEL */
 
 __BEGIN_DECLS
@@ -254,6 +258,7 @@
 #endif
 int ntp_adjtime(struct timex *);
 __END_DECLS
+
 #endif /* _KERNEL */
 
 #endif /* _SYS_TIMEX_H_ */



Home | Main Index | Thread Index | Old Index