Module Name: src
Committed By: pooka
Date: Wed Apr 2 19:37:17 UTC 2014
Modified Files:
src/sys/rump/kern: Makefile.rumpkerncomp
src/sys/rump/kern/lib: Makefile
src/sys/rump/kern/lib/libtime: Makefile time_component.c
src/sys/rump/librump/rumpkern: Makefile.rumpkern rump.c
Log Message:
Put nanosleep() and folks in librump instead of maintaining them in
the separate rumpkern_time component. Keeping time-related routines
elsewhere lead to some illogical behavior if you didn't think of linking
in rumpkern_time (hands up everyone who checks the return value of
nanosleep()).
Add warnings if rumpkern_time is linked or used. I'll remove it in a
month or two instead of now since it was part of a buildrump.sh snapshot
and it's nicer if trying to use it gives a warning instead of an error
in the next snapshot.
"everything should be as modular as possible, but no more modular than that"
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/kern/Makefile.rumpkerncomp
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/kern/lib/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/kern/lib/libtime/Makefile \
src/sys/rump/kern/lib/libtime/time_component.c
cvs rdiff -u -r1.141 -r1.142 src/sys/rump/librump/rumpkern/Makefile.rumpkern
cvs rdiff -u -r1.291 -r1.292 src/sys/rump/librump/rumpkern/rump.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/kern/Makefile.rumpkerncomp
diff -u src/sys/rump/kern/Makefile.rumpkerncomp:1.9 src/sys/rump/kern/Makefile.rumpkerncomp:1.10
--- src/sys/rump/kern/Makefile.rumpkerncomp:1.9 Fri Mar 14 01:02:34 2014
+++ src/sys/rump/kern/Makefile.rumpkerncomp Wed Apr 2 19:37:17 2014
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile.rumpkerncomp,v 1.9 2014/03/14 01:02:34 pooka Exp $
+# $NetBSD: Makefile.rumpkerncomp,v 1.10 2014/04/02 19:37:17 pooka Exp $
#
.include <bsd.own.mk>
-RUMPKERNCOMPS= crypto time tty z
+RUMPKERNCOMPS= crypto tty z
.if ${MKSLJIT} != "no"
RUMPKERNCOMPS+= sljit
Index: src/sys/rump/kern/lib/Makefile
diff -u src/sys/rump/kern/lib/Makefile:1.4 src/sys/rump/kern/lib/Makefile:1.5
--- src/sys/rump/kern/lib/Makefile:1.4 Sun Dec 5 16:27:42 2010
+++ src/sys/rump/kern/lib/Makefile Wed Apr 2 19:37:17 2014
@@ -1,8 +1,11 @@
-# $NetBSD: Makefile,v 1.4 2010/12/05 16:27:42 pooka Exp $
+# $NetBSD: Makefile,v 1.5 2014/04/02 19:37:17 pooka Exp $
#
.include "${.CURDIR}/../Makefile.rumpkerncomp"
SUBDIR+= ${RUMPKERNLIBS}
+# obsolete and going away soon
+SUBDIR+= libtime
+
.include <bsd.subdir.mk>
Index: src/sys/rump/kern/lib/libtime/Makefile
diff -u src/sys/rump/kern/lib/libtime/Makefile:1.1 src/sys/rump/kern/lib/libtime/Makefile:1.2
--- src/sys/rump/kern/lib/libtime/Makefile:1.1 Fri Mar 14 01:02:34 2014
+++ src/sys/rump/kern/lib/libtime/Makefile Wed Apr 2 19:37:17 2014
@@ -1,11 +1,10 @@
-# $NetBSD: Makefile,v 1.1 2014/03/14 01:02:34 pooka Exp $
+# $NetBSD: Makefile,v 1.2 2014/04/02 19:37:17 pooka Exp $
#
.PATH: ${.CURDIR}/../../../../kern
LIB= rumpkern_time
-SRCS+= kern_time.c
SRCS+= time_component.c
CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern
Index: src/sys/rump/kern/lib/libtime/time_component.c
diff -u src/sys/rump/kern/lib/libtime/time_component.c:1.1 src/sys/rump/kern/lib/libtime/time_component.c:1.2
--- src/sys/rump/kern/lib/libtime/time_component.c:1.1 Fri Mar 14 01:02:34 2014
+++ src/sys/rump/kern/lib/libtime/time_component.c Wed Apr 2 19:37:17 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: time_component.c,v 1.1 2014/03/14 01:02:34 pooka Exp $ */
+/* $NetBSD: time_component.c,v 1.2 2014/04/02 19:37:17 pooka Exp $ */
/*
* Copyright (c) 2014 Antti Kantee. All Rights Reserved.
@@ -26,16 +26,17 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: time_component.c,v 1.1 2014/03/14 01:02:34 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: time_component.c,v 1.2 2014/04/02 19:37:17 pooka Exp $");
#include <sys/param.h>
#include <sys/timevar.h>
#include "rump_private.h"
+void rumpkern_time_is_obsolete(void);
+
RUMP_COMPONENT(RUMP_COMPONENT_KERN)
{
- time_init();
- time_init2();
+ rumpkern_time_is_obsolete();
}
Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern
diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.141 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.142
--- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.141 Sat Mar 15 15:22:42 2014
+++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Wed Apr 2 19:37:17 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.rumpkern,v 1.141 2014/03/15 15:22:42 pooka Exp $
+# $NetBSD: Makefile.rumpkern,v 1.142 2014/04/02 19:37:17 pooka Exp $
#
.include "${RUMPTOP}/Makefile.rump"
@@ -92,6 +92,7 @@ SRCS+= init_sysctl_base.c \
kern_syscall.c \
kern_sysctl.c \
kern_tc.c \
+ kern_time.c \
kern_timeout.c \
kern_uidinfo.c \
kern_xxx.c \
Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.291 src/sys/rump/librump/rumpkern/rump.c:1.292
--- src/sys/rump/librump/rumpkern/rump.c:1.291 Thu Mar 20 20:42:08 2014
+++ src/sys/rump/librump/rumpkern/rump.c Wed Apr 2 19:37:17 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: rump.c,v 1.291 2014/03/20 20:42:08 christos Exp $ */
+/* $NetBSD: rump.c,v 1.292 2014/04/02 19:37:17 pooka Exp $ */
/*
* Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.291 2014/03/20 20:42:08 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.292 2014/04/02 19:37:17 pooka Exp $");
#include <sys/systm.h>
#define ELFSIZE ARCH_ELFSIZE
@@ -392,6 +392,8 @@ rump_init(void)
pipe_init();
resource_init();
procinit_sysctl();
+ time_init();
+ time_init2();
/* start page baroness */
if (rump_threads) {
@@ -1050,3 +1052,16 @@ rump_syscall(int num, void *data, size_t
return rv;
}
+
+/*
+ * Temporary notification that rumpkern_time is obsolete. This is to
+ * be removed along with obsoleting rumpkern_time in a few months.
+ */
+#define RUMPKERN_TIME_WARN "rumpkern_time is obsolete, functionality in librump"
+__warn_references(rumpkern_time_is_obsolete,RUMPKERN_TIME_WARN)
+void rumpkern_time_is_obsolete(void);
+void
+rumpkern_time_is_obsolete(void)
+{
+ printf("WARNING: %s\n", RUMPKERN_TIME_WARN);
+}