Module Name:    src
Committed By:   pooka
Date:           Wed Apr 22 17:38:33 UTC 2015

Modified Files:
        src/sys/rump/include/machine: cpu.h
        src/sys/rump/librump/rumpkern: intr.c rump_private.h
        src/sys/rump/librump/rumpkern/arch/generic: rump_generic_cpu.c
        src/sys/rump/librump/rumpkern/arch/x86: rump_x86_cpu.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/rump/include/machine/cpu.h
cvs rdiff -u -r1.51 -r1.52 src/sys/rump/librump/rumpkern/intr.c
cvs rdiff -u -r1.91 -r1.92 src/sys/rump/librump/rumpkern/rump_private.h
cvs rdiff -u -r1.1 -r1.2 \
    src/sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c
cvs rdiff -u -r1.2 -r1.3 \
    src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/include/machine/cpu.h
diff -u src/sys/rump/include/machine/cpu.h:1.21 src/sys/rump/include/machine/cpu.h:1.22
--- src/sys/rump/include/machine/cpu.h:1.21	Wed Apr 22 16:48:08 2015
+++ src/sys/rump/include/machine/cpu.h	Wed Apr 22 17:38:33 2015
@@ -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 @@ extern struct cpu_info *rumpcpu_info_lis
 					_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

Index: src/sys/rump/librump/rumpkern/intr.c
diff -u src/sys/rump/librump/rumpkern/intr.c:1.51 src/sys/rump/librump/rumpkern/intr.c:1.52
--- src/sys/rump/librump/rumpkern/intr.c:1.51	Wed Apr 22 16:49:42 2015
+++ src/sys/rump/librump/rumpkern/intr.c	Wed Apr 22 17:38:33 2015
@@ -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 @@ static void
 doclock(void *noarg)
 {
 	struct timespec thetick, curclock;
-	struct clockframe frame;
+	struct clockframe *clkframe;
 	int64_t sec;
 	long nsec;
 	int error;
@@ -111,13 +111,13 @@ doclock(void *noarg)
 	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;

Index: src/sys/rump/librump/rumpkern/rump_private.h
diff -u src/sys/rump/librump/rumpkern/rump_private.h:1.91 src/sys/rump/librump/rumpkern/rump_private.h:1.92
--- src/sys/rump/librump/rumpkern/rump_private.h:1.91	Sat Apr 18 15:49:18 2015
+++ src/sys/rump/librump/rumpkern/rump_private.h	Wed Apr 22 17:38:33 2015
@@ -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_user_unschedule(int, int *, vo
 
 void	rump_cpu_attach(struct cpu_info *);
 
+struct clockframe *rump_cpu_makeclockframe(void);
+
 void	rump_kernel_bigwrap(int *);
 void	rump_kernel_bigunwrap(int);
 

Index: src/sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c
diff -u src/sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c:1.1 src/sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c:1.2
--- src/sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c:1.1	Wed Feb 12 22:28:43 2014
+++ src/sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c	Wed Apr 22 17:38:33 2015
@@ -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 @@ rump_cpu_attach(struct cpu_info *ci)
 	kcpuset_set(kcpuset_attached, cpu_index(ci));
 	kcpuset_set(kcpuset_running, cpu_index(ci));
 }
+
+struct clockframe *
+rump_cpu_makeclockframe(void)
+{
+
+	return NULL;
+}

Index: src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c
diff -u src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c:1.2 src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c:1.3
--- src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c:1.2	Sat Mar 15 15:15:27 2014
+++ src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c	Wed Apr 22 17:38:33 2015
@@ -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 @@ wbinvd(void)
 	 * 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);
+}

Reply via email to