Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Remove superfluous splclock()/splx() pair around tc...
details: https://anonhg.NetBSD.org/src/rev/acdd5a6c07e9
branches: trunk
changeset: 968063:acdd5a6c07e9
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Jan 01 17:28:17 2020 +0000
description:
Remove superfluous splclock()/splx() pair around tc_setclock().
diffstat:
sys/kern/kern_time.c | 9 ++-------
sys/kern/kern_todr.c | 7 ++-----
2 files changed, 4 insertions(+), 12 deletions(-)
diffs (86 lines):
diff -r 2c3ce75cb355 -r acdd5a6c07e9 sys/kern/kern_time.c
--- a/sys/kern/kern_time.c Wed Jan 01 16:50:41 2020 +0000
+++ b/sys/kern/kern_time.c Wed Jan 01 17:28:17 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_time.c,v 1.201 2019/10/05 12:57:40 kamil Exp $ */
+/* $NetBSD: kern_time.c,v 1.202 2020/01/01 17:28:17 thorpej Exp $ */
/*-
* Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.201 2019/10/05 12:57:40 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.202 2020/01/01 17:28:17 thorpej Exp $");
#include <sys/param.h>
#include <sys/resourcevar.h>
@@ -136,23 +136,19 @@
settime1(struct proc *p, const struct timespec *ts, bool check_kauth)
{
struct timespec delta, now;
- int s;
/* WHAT DO WE DO ABOUT PENDING REAL-TIME TIMEOUTS??? */
- s = splclock();
nanotime(&now);
timespecsub(ts, &now, &delta);
if (check_kauth && kauth_authorize_system(kauth_cred_get(),
KAUTH_SYSTEM_TIME, KAUTH_REQ_SYSTEM_TIME_SYSTEM, __UNCONST(ts),
&delta, KAUTH_ARG(check_kauth ? false : true)) != 0) {
- splx(s);
return (EPERM);
}
#ifdef notyet
if ((delta.tv_sec < 86400) && securelevel > 0) { /* XXX elad - notyet */
- splx(s);
return (EPERM);
}
#endif
@@ -162,7 +158,6 @@
timespecadd(&boottime, &delta, &boottime);
resettodr();
- splx(s);
return (0);
}
diff -r 2c3ce75cb355 -r acdd5a6c07e9 sys/kern/kern_todr.c
--- a/sys/kern/kern_todr.c Wed Jan 01 16:50:41 2020 +0000
+++ b/sys/kern/kern_todr.c Wed Jan 01 17:28:17 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_todr.c,v 1.40 2019/07/07 15:12:59 maxv Exp $ */
+/* $NetBSD: kern_todr.c,v 1.41 2020/01/01 17:28:17 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -41,7 +41,7 @@
#include "opt_todr.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_todr.c,v 1.40 2019/07/07 15:12:59 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_todr.c,v 1.41 2020/01/01 17:28:17 thorpej Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -81,7 +81,6 @@
bool waszero = (base == 0);
bool goodtime = false;
bool badrtc = false;
- int s;
struct timespec ts;
struct timeval tv;
@@ -169,9 +168,7 @@
ts.tv_sec = tv.tv_sec;
ts.tv_nsec = tv.tv_usec * 1000;
- s = splclock();
tc_setclock(&ts);
- splx(s);
if (waszero || goodtime)
return;
Home |
Main Index |
Thread Index |
Old Index