Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/bouyer-quota2]: src Sync with HEAD
details: https://anonhg.NetBSD.org/src/rev/33318d28d24b
branches: bouyer-quota2
changeset: 761120:33318d28d24b
user: bouyer <bouyer%NetBSD.org@localhost>
date: Tue Feb 08 18:05:04 2011 +0000
description:
Sync with HEAD
diffstat:
sbin/dmctl/Makefile | 24 +
sbin/dmctl/README | 22 +
sbin/dmctl/dmctl.8 | 67 +
sbin/dmctl/dmctl.c | 580 ++++++
sys/arch/emips/Makefile | 32 +
sys/arch/emips/compile/Makefile | 3 +
sys/arch/emips/conf/GENERIC | 230 ++
sys/arch/emips/conf/INSTALL | 88 +
sys/arch/emips/conf/Makefile.emips.inc | 5 +
sys/arch/emips/conf/RAMDISK | 26 +
sys/arch/emips/conf/files.emips | 112 +
sys/arch/emips/conf/majors.emips | 50 +
sys/arch/emips/conf/std.emips | 20 +
sys/arch/emips/ebus/ac97_ebus.c | 50 +
sys/arch/emips/ebus/ace_ebus.c | 2361 +++++++++++++++++++++++++++
sys/arch/emips/ebus/clock_ebus.c | 323 +++
sys/arch/emips/ebus/dz_ebus.c | 793 +++++++++
sys/arch/emips/ebus/ebus.c | 120 +
sys/arch/emips/ebus/ebus_emips.c | 116 +
sys/arch/emips/ebus/ebusvar.h | 41 +
sys/arch/emips/ebus/evga_ebus.c | 50 +
sys/arch/emips/ebus/flash_ebus.c | 2347 ++++++++++++++++++++++++++
sys/arch/emips/ebus/gpio_ebus.c | 174 +
sys/arch/emips/ebus/icap_ebus.c | 422 ++++
sys/arch/emips/ebus/if_le_ebus.c | 972 +++++++++++
sys/arch/emips/ebus/lcd_ebus.c | 50 +
sys/arch/emips/ebus/ps2_ebus.c | 50 +
sys/arch/emips/ebus/stub_ebus.c | 130 +
sys/arch/emips/emips/autoconf.c | 238 ++
sys/arch/emips/emips/bus_dma.c | 738 ++++++++
sys/arch/emips/emips/bus_space.c | 124 +
sys/arch/emips/emips/clock.c | 110 +
sys/arch/emips/emips/cons.h | 44 +
sys/arch/emips/emips/cpu.c | 71 +
sys/arch/emips/emips/emipstype.h | 40 +
sys/arch/emips/emips/interrupt.c | 197 ++
sys/arch/emips/emips/locore_machdep.S | 216 ++
sys/arch/emips/emips/machdep.c | 802 +++++++++
sys/arch/emips/emips/machdep.h | 40 +
sys/arch/emips/emips/mainbus.c | 91 +
sys/arch/emips/emips/promcall.c | 241 ++
sys/arch/emips/emips/sysconf.c | 101 +
sys/arch/emips/emips/xilinx_ml40x.c | 122 +
sys/arch/emips/emips/xs_bee3.c | 120 +
sys/arch/emips/include/Makefile | 25 +
sys/arch/emips/include/ansi.h | 3 +
sys/arch/emips/include/asm.h | 3 +
sys/arch/emips/include/autoconf.h | 45 +
sys/arch/emips/include/bootinfo.h | 72 +
sys/arch/emips/include/bswap.h | 3 +
sys/arch/emips/include/bus.h | 665 +++++++
sys/arch/emips/include/cdefs.h | 3 +
sys/arch/emips/include/cpu.h | 3 +
sys/arch/emips/include/cpu_counter.h | 3 +
sys/arch/emips/include/db_machdep.h | 11 +
sys/arch/emips/include/disklabel.h | 57 +
sys/arch/emips/include/ecoff_machdep.h | 3 +
sys/arch/emips/include/elf_machdep.h | 3 +
sys/arch/emips/include/emipsreg.h | 929 ++++++++++
sys/arch/emips/include/endian.h | 3 +
sys/arch/emips/include/endian_machdep.h | 6 +
sys/arch/emips/include/float.h | 3 +
sys/arch/emips/include/ieee.h | 3 +
sys/arch/emips/include/ieeefp.h | 3 +
sys/arch/emips/include/int_const.h | 3 +
sys/arch/emips/include/int_fmtio.h | 3 +
sys/arch/emips/include/int_limits.h | 3 +
sys/arch/emips/include/int_mwgwtypes.h | 3 +
sys/arch/emips/include/int_types.h | 3 +
sys/arch/emips/include/intr.h | 129 +
sys/arch/emips/include/kcore.h | 3 +
sys/arch/emips/include/kdbparam.h | 3 +
sys/arch/emips/include/limits.h | 3 +
sys/arch/emips/include/loadfile_machdep.h | 61 +
sys/arch/emips/include/lock.h | 3 +
sys/arch/emips/include/locore.h | 3 +
sys/arch/emips/include/math.h | 3 +
sys/arch/emips/include/mcontext.h | 3 +
sys/arch/emips/include/mips_opcode.h | 3 +
sys/arch/emips/include/mutex.h | 3 +
sys/arch/emips/include/param.h | 151 +
sys/arch/emips/include/pcb.h | 3 +
sys/arch/emips/include/pmap.h | 3 +
sys/arch/emips/include/pmc.h | 3 +
sys/arch/emips/include/proc.h | 3 +
sys/arch/emips/include/profile.h | 3 +
sys/arch/emips/include/psl.h | 3 +
sys/arch/emips/include/pte.h | 3 +
sys/arch/emips/include/ptrace.h | 3 +
sys/arch/emips/include/reg.h | 3 +
sys/arch/emips/include/regdef.h | 3 +
sys/arch/emips/include/regnum.h | 3 +
sys/arch/emips/include/reloc.h | 3 +
sys/arch/emips/include/rwlock.h | 3 +
sys/arch/emips/include/setjmp.h | 3 +
sys/arch/emips/include/signal.h | 3 +
sys/arch/emips/include/stdarg.h | 3 +
sys/arch/emips/include/sysconf.h | 99 +
sys/arch/emips/include/trap.h | 3 +
sys/arch/emips/include/types.h | 14 +
sys/arch/emips/include/varargs.h | 3 +
sys/arch/emips/include/vmparam.h | 18 +
sys/arch/emips/include/wchar_limits.h | 3 +
sys/arch/emips/include/wired_map.h | 3 +
sys/arch/emips/stand/Makefile | 10 +
sys/arch/emips/stand/Makefile.booters | 130 +
sys/arch/emips/stand/Makefile.inc | 10 +
sys/arch/emips/stand/boot/Makefile | 25 +
sys/arch/emips/stand/boot/version | 7 +
sys/arch/emips/stand/bootxx_cd9660/Makefile | 10 +
sys/arch/emips/stand/bootxx_ffs/Makefile | 12 +
sys/arch/emips/stand/bootxx_lfs/Makefile | 11 +
sys/arch/emips/stand/common/ace.c | 742 ++++++++
sys/arch/emips/stand/common/ace.h | 37 +
sys/arch/emips/stand/common/boot.c | 330 +++
sys/arch/emips/stand/common/bootinfo.c | 79 +
sys/arch/emips/stand/common/bootinfo.h | 43 +
sys/arch/emips/stand/common/bootxx.c | 183 ++
sys/arch/emips/stand/common/checksize.sh | 74 +
sys/arch/emips/stand/common/clock.c | 61 +
sys/arch/emips/stand/common/common.h | 72 +
sys/arch/emips/stand/common/conf.c | 124 +
sys/arch/emips/stand/common/dev_net.c | 1 +
sys/arch/emips/stand/common/devopen.c | 143 +
sys/arch/emips/stand/common/enic.c | 318 +++
sys/arch/emips/stand/common/init_board.c | 78 +
sys/arch/emips/stand/common/printf.c | 83 +
sys/arch/emips/stand/common/prom_iface.c | 380 ++++
sys/arch/emips/stand/common/prom_iface.h | 94 +
sys/arch/emips/stand/common/putchar.c | 42 +
sys/arch/emips/stand/common/raw.c | 164 +
sys/arch/emips/stand/common/raw.h | 37 +
sys/arch/emips/stand/common/start.S | 534 ++++++
sys/arch/emips/stand/common/start.h | 60 +
134 files changed, 18867 insertions(+), 0 deletions(-)
diffs (truncated from 19403 to 300 lines):
diff -r bae3432b12ef -r 33318d28d24b sbin/dmctl/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sbin/dmctl/Makefile Tue Feb 08 18:05:04 2011 +0000
@@ -0,0 +1,24 @@
+PROG= dmctl
+MAN= dmctl.8
+WARN= 4
+SRC= dmctl.c
+
+BINDIR= /sbin
+
+#LIBDM_INCLUDE= ${NETBSDSRCDIR}/lib/libdm/
+#LIBDM_OBJDIR= ${NETBSDSRCDIR}/lib/libdm/
+#CFLAGS+= -fno-inline -Wall -O0 -g
+#CPPFLAGS+= -I. -I${LIBDM_INCLUDE}
+
+LDADD+= -ldm
+
+.ifdef RUMP_ACTION
+CPPFLAGS+= -D RUMP_ACTION
+LDADD+= -lrumpclient
+.endif
+
+LDADD+= -lprop
+
+#LDSTATIC= -static
+
+.include <bsd.prog.mk>
diff -r bae3432b12ef -r 33318d28d24b sbin/dmctl/README
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sbin/dmctl/README Tue Feb 08 18:05:04 2011 +0000
@@ -0,0 +1,22 @@
+= RUMP howto =
+
+Build rump dm library, build libdm with RUMP_ACTION, build dmct with RUMP_ACTION.
+
+cd lib/libdm/
+RUMP_ACTION=1 USETOOLS=no make
+
+cd ../../sbin/dmctl
+RUMP_ACTION=1 USETOOLS=no make
+RUMP_ACTION=1 USETOOLS=no make -f Makefile.server
+
+== Server Startup ==
+
+RUMP_SP_SERVER=unix:///tmp/dmc
+env RUMP_VERBOSE=1 ./dmctl_server
+
+Server uses /home/haad/test.img file as disk1 device.
+
+== Client Startup ==
+
+RUMP_SP_CLIENT=unix:///tmp/dmc
+./dmctl version
diff -r bae3432b12ef -r 33318d28d24b sbin/dmctl/dmctl.8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sbin/dmctl/dmctl.8 Tue Feb 08 18:05:04 2011 +0000
@@ -0,0 +1,67 @@
+.\" $NetBSD: dmctl.8,v 1.2.2.2 2011/02/08 18:09:39 bouyer Exp $
+.\"
+.\" Copyright (c) 2004,2009 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Adam Hamsik.
+.\"
+.\" 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.
+.Dd January 23, 2011
+.Dt DMCTL 8
+.Os
+.Sh NAME
+.Nm dmctl
+.Nd manipulate device-mapper driver command
+.Sh SYNOPSIS
+.Nm
+.Sh DESCRIPTION
+.Nm
+works with the device-mapper kernel driver.
+It can send and receive information and commands from the dm driver.
+.Bl -column -offset indent "suspend" "Switch active and passive tables for"
+.Ii Li version Ta Print driver and lib version.
+.It Li targets Ta List available kernel targets.
+.It Li create Ta Create device with [dm device name].
+.It Li ls Ta List existing dm devices.
+.It Li info Ta Get info about device with [dm device name].
+.It Li rename Ta Rename device with [dm device name] to [dm device new name].
+.It Li remove Ta Remove device with [dm device name].
+.It Li resume Ta Resume IO on dm device [dm device name].
+.It Li suspend Ta Suspend IO on dm device [dm device name].
+.It Li deps Ta Print physical dependiences for dm device [dm device name].
+.It Li reload Ta Switch active and passive tables for [dm device name].
+.It Li status Ta Print status for device with [dm device name].
+.It Li table Ta Print active table for device with [dm device name].
+.El
+.Sh SEE ALSO
+.Xr dm 3 ,
+.Xr dm 4
+.Sh HISTORY
+The
+.Nm
+was written and contributed to
+.Nx
+by
+.An Adam Hamsik
+and first appeared in
+.Nx 6.0 .
diff -r bae3432b12ef -r 33318d28d24b sbin/dmctl/dmctl.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sbin/dmctl/dmctl.c Tue Feb 08 18:05:04 2011 +0000
@@ -0,0 +1,580 @@
+/*
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Adam Hamsik.
+ *
+ * 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/types.h>
+#include <sys/param.h>
+
+#include <ctype.h>
+#include <err.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <prop/proplib.h>
+
+#include <dm.h>
+
+#ifdef RUMP_ACTION
+#include <rump/rump.h>
+#include <rump/rumpclient.h>
+#include <rump/rump_syscalls.h>
+#endif
+
+/* dmctl command is used to communicate with device-mapper driver in NetBSD
+ * it uses libdm library to create and send required data to kernel.
+ *
+ * Main purpose of dmctl is to add posibility to use device-mapper driver
+ * from outside of LVM scope.
+ */
+
+#define DMCTL_CMD_REQ_NODEVNAME 0 /* Command do not require device name */
+#define DMCTL_CMD_REQ_DEVNAME 1 /* Command require device name to work */
+#define DMCTL_CMD_REQ_NEWNAME 2 /* Command require device name and
+ newname to work */
+struct command {
+ const char *cmd_name;
+ const char *cmd_help;
+ const char *ioctl_cmd_name;
+ int min_args;
+ int (*cmd_func)(int, char *[], libdm_task_t);
+};
+
+int fd; /* file descriptor for device */
+const char *dvname; /* device name */
+const char *cmdname; /* command user issued */
+
+static char * parse_stdin(char *);
+
+static int dmctl_get_version(int, char *[], libdm_task_t);
+static int dmctl_get_targets(int, char *[], libdm_task_t);
+static int dmctl_get_device_info(int, char *[], libdm_task_t);
+static int dmctl_create_dev(int, char *[], libdm_task_t);
+static int dmctl_dev_rename(int, char *[], libdm_task_t);
+static int dmctl_dev_remove(int, char *[], libdm_task_t);
+static int dmctl_dev_resume(int, char *[], libdm_task_t);
+static int dmctl_dev_suspend(int, char *[], libdm_task_t);
+static int dmctl_dev_deps(int, char *[], libdm_task_t);
+static int dmctl_list_devices(int, char *[], libdm_task_t);
+static int dmctl_table_reload(int, char *[], libdm_task_t);
+static int dmctl_table_status(int, char *[], libdm_task_t);
+void usage(void);
+
+struct command commands[] = {
+ { "version",
+ "Print driver and lib version.",
+ NULL, DMCTL_CMD_REQ_NODEVNAME,
+ dmctl_get_version },
+ { "targets",
+ "List available kernel targets.",
+ NULL, DMCTL_CMD_REQ_NODEVNAME,
+ dmctl_get_targets },
+ { "create",
+ "Create device with [dm device name].",
+ NULL, DMCTL_CMD_REQ_DEVNAME,
+ dmctl_create_dev },
+ { "ls",
+ "List existing dm devices.",
+ "names", DMCTL_CMD_REQ_NODEVNAME,
+ dmctl_list_devices },
+ { "info",
+ "Get info about device with [dm device name].",
+ NULL, DMCTL_CMD_REQ_DEVNAME,
+ dmctl_get_device_info },
+ { "rename",
+ "Rename device with [dm device name] to [dm device new name].",
+ NULL, DMCTL_CMD_REQ_NEWNAME,
+ dmctl_dev_rename },
+ { "remove",
+ "Remove device with [dm device name].",
+ NULL, DMCTL_CMD_REQ_DEVNAME,
+ dmctl_dev_remove },
+ { "resume",
+ "Resume IO on dm device [dm device name].",
+ NULL, DMCTL_CMD_REQ_DEVNAME,
+ dmctl_dev_resume },
+ { "suspend",
+ "Suspend IO on dm device [dm device name].",
+ NULL, DMCTL_CMD_REQ_DEVNAME,
+ dmctl_dev_suspend },
+ { "deps",
+ "Print physical dependiences for dm device [dm device name].",
+ NULL, DMCTL_CMD_REQ_DEVNAME,
+ dmctl_dev_deps },
+ { "reload",
+ "Switch active and passive tables for device with [dm device name].",
+ NULL, DMCTL_CMD_REQ_DEVNAME,
+ dmctl_table_reload },
+ { "status",
+ "Print status for device with [dm device name].",
+ "table", DMCTL_CMD_REQ_DEVNAME,
+ dmctl_table_status },
+ { "table",
+ "Print active table for device with [dm device name].",
+ NULL, DMCTL_CMD_REQ_DEVNAME,
+ dmctl_table_status },
+ { NULL,
+ NULL,
+ NULL, 0,
+ NULL },
+};
+
+int
+main(int argc, char *argv[])
+{
+ int i;
+ int oargc;
+ libdm_task_t task;
+
+ oargc = 0;
+
+#ifdef RUMP_ACTION
+ if (rumpclient_init() == -1)
+ err(EXIT_FAILURE, "rump client init failed");
+#endif
+
+ /* Must have at least: device command */
+ if (argc < 2)
+ usage();
+
+ /* Skip program name, get and skip device name and command. */
+ cmdname = argv[1];
+ if (argc > 2) {
+ oargc = 1;
+ dvname = argv[2];
+ }
Home |
Main Index |
Thread Index |
Old Index