summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_time.c
diff options
context:
space:
mode:
authorart <art@openbsd.org>2004-06-09 20:18:28 +0000
committerart <art@openbsd.org>2004-06-09 20:18:28 +0000
commitc46fd98e83c3f85ee585e9e7b62f29adddc53812 (patch)
tree57e2c0dbf04e6280b6b0b0ad72e1f804cc234df6 /sys/kern/kern_time.c
parentrename POOLPAGE macros to pmap_map_direct (diff)
downloadwireguard-openbsd-c46fd98e83c3f85ee585e9e7b62f29adddc53812.tar.xz
wireguard-openbsd-c46fd98e83c3f85ee585e9e7b62f29adddc53812.zip
Merge in a piece of the SMP branch into HEAD.
Introduce the cpu_info structure, p_cpu field in struct proc and global scheduling context and various changed code to deal with this. At the moment no architecture uses this stuff yet, but it will allow us slow and controlled migration to the new APIs. All new code is ifdef:ed out. ok deraadt@ niklas@
Diffstat (limited to 'sys/kern/kern_time.c')
-rw-r--r--sys/kern/kern_time.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index ab9f7f8de73..f40928b2824 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_time.c,v 1.39 2004/02/15 02:34:14 tedu Exp $ */
+/* $OpenBSD: kern_time.c,v 1.40 2004/06/09 20:18:28 art Exp $ */
/* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */
/*
@@ -99,7 +99,18 @@ settime(struct timeval *tv)
timersub(tv, &time, &delta);
time = *tv;
timeradd(&boottime, &delta, &boottime);
+#ifdef __HAVE_CURCPU
+ /*
+ * XXXSMP
+ * This is wrong. We should traverse a list of all
+ * CPUs and add the delta to the runtime of those
+ * CPUs which have a process on them.
+ */
+ timeradd(&curcpu()->ci_schedstate.spc_runtime, &delta,
+ &curcpu()->ci_schedstate.spc_runtime);
+#else
timeradd(&runtime, &delta, &runtime);
+#endif
splx(s);
resettodr();