Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpkern Include kern_clock.c in rump kernels.
details: https://anonhg.NetBSD.org/src/rev/53649d45ac58
branches: trunk
changeset: 337648:53649d45ac58
user: pooka <pooka%NetBSD.org@localhost>
date: Wed Apr 22 16:49:42 2015 +0000
description:
Include kern_clock.c in rump kernels.
diffstat:
sys/rump/librump/rumpkern/Makefile.rumpkern | 3 +-
sys/rump/librump/rumpkern/emul.c | 5 +-
sys/rump/librump/rumpkern/intr.c | 58 ++++++++++++++---------------
3 files changed, 32 insertions(+), 34 deletions(-)
diffs (152 lines):
diff -r 6638ccbf2df6 -r 53649d45ac58 sys/rump/librump/rumpkern/Makefile.rumpkern
--- a/sys/rump/librump/rumpkern/Makefile.rumpkern Wed Apr 22 16:48:08 2015 +0000
+++ b/sys/rump/librump/rumpkern/Makefile.rumpkern Wed Apr 22 16:49:42 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.rumpkern,v 1.155 2015/04/14 13:32:34 riastradh Exp $
+# $NetBSD: Makefile.rumpkern,v 1.156 2015/04/22 16:49:42 pooka Exp $
#
.include "${RUMPTOP}/Makefile.rump"
@@ -71,6 +71,7 @@
SRCS+= init_sysctl_base.c \
kern_auth.c \
kern_cfglock.c \
+ kern_clock.c \
kern_descrip.c \
kern_event.c \
kern_hook.c \
diff -r 6638ccbf2df6 -r 53649d45ac58 sys/rump/librump/rumpkern/emul.c
--- a/sys/rump/librump/rumpkern/emul.c Wed Apr 22 16:48:08 2015 +0000
+++ b/sys/rump/librump/rumpkern/emul.c Wed Apr 22 16:49:42 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emul.c,v 1.170 2015/04/18 15:49:18 pooka Exp $ */
+/* $NetBSD: emul.c,v 1.171 2015/04/22 16:49:42 pooka Exp $ */
/*
* Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.170 2015/04/18 15:49:18 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.171 2015/04/22 16:49:42 pooka Exp $");
#include <sys/param.h>
#include <sys/null.h>
@@ -85,7 +85,6 @@
dev_t rootdev = NODEV;
const int schedppq = 1;
-int hardclock_ticks;
bool mp_online = false;
struct timeval boottime;
int cold = 1;
diff -r 6638ccbf2df6 -r 53649d45ac58 sys/rump/librump/rumpkern/intr.c
--- a/sys/rump/librump/rumpkern/intr.c Wed Apr 22 16:48:08 2015 +0000
+++ b/sys/rump/librump/rumpkern/intr.c Wed Apr 22 16:49:42 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.c,v 1.50 2015/04/21 16:18:50 pooka Exp $ */
+/* $NetBSD: intr.c,v 1.51 2015/04/22 16:49:42 pooka Exp $ */
/*
* Copyright (c) 2008-2010, 2015 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.50 2015/04/21 16:18:50 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.51 2015/04/22 16:49:42 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -82,22 +82,12 @@
static int ncpu_final;
-static u_int
-rumptc_get(struct timecounter *tc)
-{
-
- KASSERT(rump_threads);
- return (u_int)hardclock_ticks;
-}
-
-static struct timecounter rumptc = {
- .tc_get_timecount = rumptc_get,
- .tc_poll_pps = NULL,
- .tc_counter_mask = ~0,
- .tc_frequency = 0,
- .tc_name = "rumpclk",
- .tc_quality = 0,
-};
+void noclock(void); void noclock(void) {return;}
+__strong_alias(sched_schedclock,noclock);
+__strong_alias(cpu_initclocks,noclock);
+__strong_alias(addupc_intr,noclock);
+__strong_alias(sched_tick,noclock);
+__strong_alias(setstatclockrate,noclock);
/*
* clock "interrupt"
@@ -106,10 +96,11 @@
doclock(void *noarg)
{
struct timespec thetick, curclock;
+ struct clockframe frame;
int64_t sec;
long nsec;
int error;
- int cpuindx = curcpu()->ci_index;
+ struct cpu_info *ci = curcpu();
error = rumpuser_clock_gettime(RUMPUSER_CLOCK_ABSMONO, &sec, &nsec);
if (error)
@@ -120,21 +111,24 @@
thetick.tv_sec = 0;
thetick.tv_nsec = 1000000000/hz;
+ /* not used, so doesn't matter what we pass in */
+ memset(&frame, 0, sizeof(frame));
+
for (;;) {
- callout_hardclock();
+ int lbolt_ticks = 0;
+
+ hardclock(&frame);
+ if (CPU_IS_PRIMARY(ci)) {
+ if (++lbolt_ticks >= hz) {
+ lbolt_ticks = 0;
+ cv_broadcast(&lbolt);
+ }
+ }
error = rumpuser_clock_sleep(RUMPUSER_CLOCK_ABSMONO,
curclock.tv_sec, curclock.tv_nsec);
KASSERT(!error);
timespecadd(&curclock, &thetick, &curclock);
-
- if (cpuindx != 0)
- continue;
-
- if ((++hardclock_ticks % hz) == 0) {
- cv_broadcast(&lbolt);
- }
- tc_ticktock();
}
}
@@ -304,8 +298,12 @@
if (ci->ci_index == 0) {
int sithr_swap;
- rumptc.tc_frequency = hz;
- tc_init(&rumptc);
+ /* pretend that we have our own for these */
+ stathz = 1;
+ schedhz = 1;
+ profhz = 1;
+
+ initclocks();
/* create deferred softint threads */
mutex_enter(&sithr_emtx);
Home |
Main Index |
Thread Index |
Old Index