Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump Apparently not all ports define struct clockframe i...
details: https://anonhg.NetBSD.org/src/rev/0ee059546ac8
branches: trunk
changeset: 337652:0ee059546ac8
user: pooka <pooka%NetBSD.org@localhost>
date: Wed Apr 22 17:38:33 2015 +0000
description:
Apparently not all ports define struct clockframe in cpu.h, so we cannot
provide our definition that way. Instead, generate the struct clockframe
passed to hardclock() in MD code.
diffstat:
sys/rump/include/machine/cpu.h | 6 +-----
sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c | 11 +++++++++--
sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c | 12 ++++++++++--
sys/rump/librump/rumpkern/intr.c | 12 ++++++------
sys/rump/librump/rumpkern/rump_private.h | 4 +++-
5 files changed, 29 insertions(+), 16 deletions(-)
diffs (143 lines):
diff -r 62a432840805 -r 0ee059546ac8 sys/rump/include/machine/cpu.h
--- a/sys/rump/include/machine/cpu.h Wed Apr 22 17:07:24 2015 +0000
+++ b/sys/rump/include/machine/cpu.h Wed Apr 22 17:38:33 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.21 2015/04/22 16:48:08 pooka Exp $ */
+/* $NetBSD: cpu.h,v 1.22 2015/04/22 17:38:33 pooka Exp $ */
/*
* Copyright (c) 2008-2011 Antti Kantee. All Rights Reserved.
@@ -86,10 +86,6 @@
_ci_ != NULL; _ci_ = _ci_->ci_next
#define CPU_IS_PRIMARY(_ci_) (_ci_->ci_index == 0)
-
-struct clockframe {
- int who_framed_clock;
-};
#define CLKF_USERMODE(framep) 0
#define CLKF_PC(framep) 0
#define CLKF_INTR(framep) 0
diff -r 62a432840805 -r 0ee059546ac8 sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c
--- a/sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c Wed Apr 22 17:07:24 2015 +0000
+++ b/sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c Wed Apr 22 17:38:33 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_generic_cpu.c,v 1.1 2014/02/12 22:28:43 pooka Exp $ */
+/* $NetBSD: rump_generic_cpu.c,v 1.2 2015/04/22 17:38:33 pooka Exp $ */
/*
* Copyright (c) 2009 Antti Kantee. All Rights Reserved.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump_generic_cpu.c,v 1.1 2014/02/12 22:28:43 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_generic_cpu.c,v 1.2 2015/04/22 17:38:33 pooka Exp $");
#include <sys/param.h>
@@ -51,3 +51,10 @@
kcpuset_set(kcpuset_attached, cpu_index(ci));
kcpuset_set(kcpuset_running, cpu_index(ci));
}
+
+struct clockframe *
+rump_cpu_makeclockframe(void)
+{
+
+ return NULL;
+}
diff -r 62a432840805 -r 0ee059546ac8 sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c
--- a/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c Wed Apr 22 17:07:24 2015 +0000
+++ b/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c Wed Apr 22 17:38:33 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_x86_cpu.c,v 1.2 2014/03/15 15:15:27 pooka Exp $ */
+/* $NetBSD: rump_x86_cpu.c,v 1.3 2015/04/22 17:38:33 pooka Exp $ */
/*
* Copyright (c) 2008 Antti Kantee. All Rights Reserved.
@@ -29,9 +29,10 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump_x86_cpu.c,v 1.2 2014/03/15 15:15:27 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_x86_cpu.c,v 1.3 2015/04/22 17:38:33 pooka Exp $");
#include <sys/param.h>
+#include <sys/kmem.h>
#include <machine/cpu.h>
@@ -80,3 +81,10 @@
* Honestly, I don't know why it's required even in the kernel.
*/
}
+
+struct clockframe *
+rump_cpu_makeclockframe(void)
+{
+
+ return kmem_zalloc(sizeof(struct clockframe), KM_SLEEP);
+}
diff -r 62a432840805 -r 0ee059546ac8 sys/rump/librump/rumpkern/intr.c
--- a/sys/rump/librump/rumpkern/intr.c Wed Apr 22 17:07:24 2015 +0000
+++ b/sys/rump/librump/rumpkern/intr.c Wed Apr 22 17:38:33 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.c,v 1.51 2015/04/22 16:49:42 pooka Exp $ */
+/* $NetBSD: intr.c,v 1.52 2015/04/22 17:38:33 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.51 2015/04/22 16:49:42 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.52 2015/04/22 17:38:33 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -96,7 +96,7 @@
doclock(void *noarg)
{
struct timespec thetick, curclock;
- struct clockframe frame;
+ struct clockframe *clkframe;
int64_t sec;
long nsec;
int error;
@@ -111,13 +111,13 @@
thetick.tv_sec = 0;
thetick.tv_nsec = 1000000000/hz;
- /* not used, so doesn't matter what we pass in */
- memset(&frame, 0, sizeof(frame));
+ /* generate dummy clockframe for hardclock to consume */
+ clkframe = rump_cpu_makeclockframe();
for (;;) {
int lbolt_ticks = 0;
- hardclock(&frame);
+ hardclock(clkframe);
if (CPU_IS_PRIMARY(ci)) {
if (++lbolt_ticks >= hz) {
lbolt_ticks = 0;
diff -r 62a432840805 -r 0ee059546ac8 sys/rump/librump/rumpkern/rump_private.h
--- a/sys/rump/librump/rumpkern/rump_private.h Wed Apr 22 17:07:24 2015 +0000
+++ b/sys/rump/librump/rumpkern/rump_private.h Wed Apr 22 17:38:33 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_private.h,v 1.91 2015/04/18 15:49:18 pooka Exp $ */
+/* $NetBSD: rump_private.h,v 1.92 2015/04/22 17:38:33 pooka Exp $ */
/*
* Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
@@ -173,6 +173,8 @@
void rump_cpu_attach(struct cpu_info *);
+struct clockframe *rump_cpu_makeclockframe(void);
+
void rump_kernel_bigwrap(int *);
void rump_kernel_bigunwrap(int);
Home |
Main Index |
Thread Index |
Old Index