diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-10-26 23:23:52 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-10-26 23:23:52 +0000 |
| commit | 6183a1650dcce173f03806517a34bc4f2912657e (patch) | |
| tree | 1645c8a863ab6d71342d5282dfaf476c079a08ab /sys | |
| parent | 02ea0cf69f46e94da5a207dad3bf004d74a62e12 (diff) | |
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 (limited to 'sys')
| -rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 7 | ||||
| -rw-r--r-- | sys/arch/i386/i386/machdep.c | 7 | ||||
| -rw-r--r-- | sys/compat/netbsd32/netbsd32_compat_50.c | 9 | ||||
| -rw-r--r-- | sys/compat/netbsd32/netbsd32_time.c | 7 | ||||
| -rw-r--r-- | sys/kern/kern_ntptime.c | 6 | ||||
| -rw-r--r-- | sys/kern/kern_time.c | 6 | ||||
| -rw-r--r-- | sys/sys/timevar.h | 4 | ||||
| -rw-r--r-- | sys/sys/timex.h | 7 |
8 files changed, 26 insertions, 27 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index dfce2423e67..2a027d0c4e0 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.364 2022/10/26 23:22:07 riastradh Exp #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 @@ void dumpsys(void); 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 --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index ccf5384e54c..4324eb6ddf7 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.837 2022/08/20 23:48:50 riastradh Exp #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 @@ void initgdt(union descriptor *); static void i386_proc0_pcb_ldt_init(void); -extern int time_adjusted; - int *esym; int *eblob; extern int boothowto; diff --git a/sys/compat/netbsd32/netbsd32_compat_50.c b/sys/compat/netbsd32/netbsd32_compat_50.c index 0c4a26c3dfd..10f3f305bc0 100644 --- a/sys/compat/netbsd32/netbsd32_compat_50.c +++ b/sys/compat/netbsd32/netbsd32_compat_50.c @@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.52 2021/09/07 11:43:05 rias #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 @@ compat_50_netbsd32_adjtime(struct lwp *l, 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 --git a/sys/compat/netbsd32/netbsd32_time.c b/sys/compat/netbsd32/netbsd32_time.c index 507276159e4..a90fa6d0c30 100644 --- a/sys/compat/netbsd32/netbsd32_time.c +++ b/sys/compat/netbsd32/netbsd32_time.c @@ -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 @@ netbsd32___adjtime50(struct lwp *l, const struct netbsd32___adjtime50_args *uap, 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 --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index 5665bb20eb6..91585cbe0bd 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -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_freq; /* frequency offset (ns/s) */ 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 --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 8ad0df61f42..97c9b97ab71 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.217 2022/07/01 21:22:44 riastradh Ex #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 @@ sys___adjtime50(struct lwp *l, const struct sys___adjtime50_args *uap, 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 --git a/sys/sys/timevar.h b/sys/sys/timevar.h index e67b5304ced..5daed09cdfb 100644 --- a/sys/sys/timevar.h +++ b/sys/sys/timevar.h @@ -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 @@ void ptimers_free(struct proc *, int); 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 --git a/sys/sys/timex.h b/sys/sys/timex.h index 6a19c42ea2c..7357b2d5620 100644 --- a/sys/sys/timex.h +++ b/sys/sys/timex.h @@ -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 @@ struct timex { }; #ifdef _KERNEL + #include <sys/mutex.h> void ntp_update_second(int64_t *adjustment, time_t *newsec); @@ -246,6 +247,9 @@ void ntp_gettime(struct ntptimeval *); int ntp_timestatus(void); extern kmutex_t timecounter_lock; + +extern int64_t time_adjtime; + #else /* !_KERNEL */ __BEGIN_DECLS @@ -254,6 +258,7 @@ int ntp_gettime(struct ntptimeval *) __RENAME(__ntp_gettime50); #endif int ntp_adjtime(struct timex *); __END_DECLS + #endif /* _KERNEL */ #endif /* _SYS_TIMEX_H_ */ |
