Module Name: src
Committed By: pooka
Date: Sat Dec 19 15:03:34 UTC 2009
Modified Files:
src/sbin/cgdconfig: Makefile Makefile.cgdconfig
src/share/examples/rump/img2cgd: Makefile
Added Files:
src/sbin/cgdconfig: cgd_rumpops.c
Removed Files:
src/share/examples/rump/img2cgd: cgd_rumpops.c
Log Message:
Use RUMP_ACTION to avoid having to specify the same information
in the Makefiles of all the consumers.
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sbin/cgdconfig/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sbin/cgdconfig/Makefile.cgdconfig
cvs rdiff -u -r0 -r1.1 src/sbin/cgdconfig/cgd_rumpops.c
cvs rdiff -u -r1.1 -r1.2 src/share/examples/rump/img2cgd/Makefile
cvs rdiff -u -r1.1 -r0 src/share/examples/rump/img2cgd/cgd_rumpops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/cgdconfig/Makefile
diff -u src/sbin/cgdconfig/Makefile:1.12 src/sbin/cgdconfig/Makefile:1.13
--- src/sbin/cgdconfig/Makefile:1.12 Tue Sep 8 21:36:35 2009
+++ src/sbin/cgdconfig/Makefile Sat Dec 19 15:03:34 2009
@@ -1,10 +1,8 @@
-# $NetBSD: Makefile,v 1.12 2009/09/08 21:36:35 pooka Exp $
+# $NetBSD: Makefile,v 1.13 2009/12/19 15:03:34 pooka Exp $
PROG= cgdconfig
MAN= cgdconfig.8
-SRCS+= cgd_kernelops.c
-
.include "${.CURDIR}/Makefile.cgdconfig"
.include <bsd.prog.mk>
Index: src/sbin/cgdconfig/Makefile.cgdconfig
diff -u src/sbin/cgdconfig/Makefile.cgdconfig:1.1 src/sbin/cgdconfig/Makefile.cgdconfig:1.2
--- src/sbin/cgdconfig/Makefile.cgdconfig:1.1 Tue Sep 8 21:36:35 2009
+++ src/sbin/cgdconfig/Makefile.cgdconfig Sat Dec 19 15:03:34 2009
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.cgdconfig,v 1.1 2009/09/08 21:36:35 pooka Exp $
+# $NetBSD: Makefile.cgdconfig,v 1.2 2009/12/19 15:03:34 pooka Exp $
#
SRCS+= cgdconfig.c \
@@ -22,3 +22,11 @@
.PATH: ${CGDCONFIGDIR}
CPPFLAGS+= -I${CGDCONFIGDIR}
+
+.ifdef RUMP_ACTION
+LDADD+= -lrumpdev_cgd -lrumpdev_disk -lrumpdev -lrumpcrypto
+LDADD+= -lrumpvfs -lrump -lrumpuser -lpthread
+SRCS+= cgd_rumpops.c
+.else
+SRCS+= cgd_kernelops.c
+.endif
Index: src/share/examples/rump/img2cgd/Makefile
diff -u src/share/examples/rump/img2cgd/Makefile:1.1 src/share/examples/rump/img2cgd/Makefile:1.2
--- src/share/examples/rump/img2cgd/Makefile:1.1 Tue Sep 8 21:48:25 2009
+++ src/share/examples/rump/img2cgd/Makefile Sat Dec 19 15:03:34 2009
@@ -1,16 +1,14 @@
PROG= img2cgd
-SRCS= img2cgd.c cgd_rumpops.c
+SRCS= img2cgd.c
NOMAN=
.include <bsd.own.mk>
-.include "${NETBSDSRCDIR}/sbin/cgdconfig/Makefile.cgdconfig"
-
-LDADD+= -lrumpdev_cgd -lrumpdev_disk -lrumpdev -lrumpcrypto
-LDADD+= -lrumpvfs -lrump -lrumpuser -lpthread
-
+RUMP_ACTION= #defined
CPPFLAGS+= -DCGDCONFIG_AS_LIB
+.include "${NETBSDSRCDIR}/sbin/cgdconfig/Makefile.cgdconfig"
-DBG=-g -O0
+DBG= -g -O0
+WARNS= 3
.include <bsd.prog.mk>
Added files:
Index: src/sbin/cgdconfig/cgd_rumpops.c
diff -u /dev/null src/sbin/cgdconfig/cgd_rumpops.c:1.1
--- /dev/null Sat Dec 19 15:03:34 2009
+++ src/sbin/cgdconfig/cgd_rumpops.c Sat Dec 19 15:03:34 2009
@@ -0,0 +1,49 @@
+/* $NetBSD: cgd_rumpops.c,v 1.1 2009/12/19 15:03:34 pooka Exp $ */
+
+/*
+ * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__RCSID("$NetBSD: cgd_rumpops.c,v 1.1 2009/12/19 15:03:34 pooka Exp $");
+#endif /* !lint */
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <rump/rump_syscalls.h>
+
+#include "cgd_kernelops.h"
+
+const struct cgd_kernelops cgd_kops = {
+ .ko_open = rump_sys_open,
+ .ko_ioctl = rump_sys_ioctl,
+ .ko_pread = rump_sys_pread,
+ .ko_close = rump_sys_close,
+};