svn commit: r295451 - in head: lib/libmemstat sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sparc64/sparc64 sys/vm

2016-02-09 Thread Gleb Smirnoff
Author: glebius
Date: Tue Feb  9 20:22:35 2016
New Revision: 295451
URL: https://svnweb.freebsd.org/changeset/base/295451

Log:
  Include sys/_task.h into uma_int.h, so that taskqueue.h isn't a
  requirement for uma_int.h.
  
  Suggested by: jhb

Modified:
  head/lib/libmemstat/memstat_uma.c
  head/sys/amd64/amd64/uma_machdep.c
  head/sys/arm/arm/vm_machdep.c
  head/sys/arm64/arm64/uma_machdep.c
  head/sys/arm64/arm64/vm_machdep.c
  head/sys/kern/kern_malloc.c
  head/sys/mips/mips/uma_machdep.c
  head/sys/mips/mips/vm_machdep.c
  head/sys/powerpc/powerpc/uma_machdep.c
  head/sys/riscv/riscv/uma_machdep.c
  head/sys/riscv/riscv/vm_machdep.c
  head/sys/sparc64/sparc64/vm_machdep.c
  head/sys/vm/memguard.c
  head/sys/vm/uma_dbg.c
  head/sys/vm/uma_int.h
  head/sys/vm/vm_page.c

Modified: head/lib/libmemstat/memstat_uma.c
==
--- head/lib/libmemstat/memstat_uma.c   Tue Feb  9 20:19:31 2016
(r295450)
+++ head/lib/libmemstat/memstat_uma.c   Tue Feb  9 20:22:35 2016
(r295451)
@@ -29,7 +29,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 

Modified: head/sys/amd64/amd64/uma_machdep.c
==
--- head/sys/amd64/amd64/uma_machdep.c  Tue Feb  9 20:19:31 2016
(r295450)
+++ head/sys/amd64/amd64/uma_machdep.c  Tue Feb  9 20:22:35 2016
(r295451)
@@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/arm/arm/vm_machdep.c
==
--- head/sys/arm/arm/vm_machdep.c   Tue Feb  9 20:19:31 2016
(r295450)
+++ head/sys/arm/arm/vm_machdep.c   Tue Feb  9 20:22:35 2016
(r295451)
@@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 

Modified: head/sys/arm64/arm64/uma_machdep.c
==
--- head/sys/arm64/arm64/uma_machdep.c  Tue Feb  9 20:19:31 2016
(r295450)
+++ head/sys/arm64/arm64/uma_machdep.c  Tue Feb  9 20:22:35 2016
(r295451)
@@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/arm64/arm64/vm_machdep.c
==
--- head/sys/arm64/arm64/vm_machdep.c   Tue Feb  9 20:19:31 2016
(r295450)
+++ head/sys/arm64/arm64/vm_machdep.c   Tue Feb  9 20:22:35 2016
(r295451)
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 

Modified: head/sys/kern/kern_malloc.c
==
--- head/sys/kern/kern_malloc.c Tue Feb  9 20:19:31 2016(r295450)
+++ head/sys/kern/kern_malloc.c Tue Feb  9 20:22:35 2016(r295451)
@@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 

Modified: head/sys/mips/mips/uma_machdep.c
==
--- head/sys/mips/mips/uma_machdep.cTue Feb  9 20:19:31 2016
(r295450)
+++ head/sys/mips/mips/uma_machdep.cTue Feb  9 20:22:35 2016
(r295451)
@@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/mips/mips/vm_machdep.c
==
--- head/sys/mips/mips/vm_machdep.c Tue Feb  9 20:19:31 2016
(r295450)
+++ head/sys/mips/mips/vm_machdep.c Tue Feb  9 20:22:35 2016
(r295451)
@@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 

Modified: head/sys/powerpc/powerpc/uma_machdep.c
==
--- head/sys/powerpc/powerpc/uma_machdep.c  Tue Feb  9 20:19:31 2016
(r295450)
+++ head/sys/powerpc/powerpc/uma_machdep.c  Tue Feb  9 20:22:35 2016
(r295451)
@@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/riscv/riscv/uma_machdep.c
==
--- head/sys/riscv/riscv/uma_machdep.c  Tue Feb  9 20:19:31 2016
(r295450)
+++ head/sys/riscv/riscv/uma_machdep.c  Tue Feb  9 20:22:35 2016
(r295451)
@@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/riscv/riscv/vm_machdep.c
==
--- head/sys/riscv/riscv/vm_machdep.c   Tue Feb  9 20:19:31 2016
(r295450)

svn commit: r295445 - head/usr.bin/top

2016-02-09 Thread Konstantin Belousov
Author: kib
Date: Tue Feb  9 18:35:37 2016
New Revision: 295445
URL: https://svnweb.freebsd.org/changeset/base/295445

Log:
  Rename variable to reflect the condition.
  
  Suggested by: jhb
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/top/machine.c

Modified: head/usr.bin/top/machine.c
==
--- head/usr.bin/top/machine.c  Tue Feb  9 18:19:24 2016(r295444)
+++ head/usr.bin/top/machine.c  Tue Feb  9 18:35:37 2016(r295445)
@@ -1155,12 +1155,12 @@ getsysctl(const char *name, void *ptr, s
 static const char *
 format_nice(const struct kinfo_proc *pp)
 {
-   const char *fifo, *kthread;
+   const char *fifo, *kproc;
int rtpri;
static char nicebuf[4 + 1];
 
fifo = PRI_NEED_RR(pp->ki_pri.pri_class) ? "" : "F";
-   kthread = (pp->ki_flag & P_KPROC) ? "k" : "";
+   kproc = (pp->ki_flag & P_KPROC) ? "k" : "";
switch (PRI_BASE(pp->ki_pri.pri_class)) {
case PRI_ITHD:
return ("-");
@@ -1188,7 +1188,7 @@ format_nice(const struct kinfo_proc *pp)
rtpri = ((pp->ki_flag & P_KPROC) ? pp->ki_pri.pri_native :
pp->ki_pri.pri_user) - PRI_MIN_REALTIME;
snprintf(nicebuf, sizeof(nicebuf), "%sr%d%s",
-   kthread, rtpri, fifo);
+   kproc, rtpri, fifo);
break;
case PRI_TIMESHARE:
if (pp->ki_flag & P_KPROC)
@@ -1200,7 +1200,7 @@ format_nice(const struct kinfo_proc *pp)
rtpri = ((pp->ki_flag & P_KPROC) ? pp->ki_pri.pri_native :
pp->ki_pri.pri_user) - PRI_MIN_IDLE;
snprintf(nicebuf, sizeof(nicebuf), "%si%d%s",
-   kthread, rtpri, fifo);
+   kproc, rtpri, fifo);
break;
default:
return ("?");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295427 - head/bin/dd

2016-02-09 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Feb  9 09:37:04 2016
New Revision: 295427
URL: https://svnweb.freebsd.org/changeset/base/295427

Log:
  Use a proper type for return value of postfix_to_mult(); the way it's
  being used wouldn't work if the value returned didn't fit in intmax_t.
  
  Submitted by: bde@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/bin/dd/args.c

Modified: head/bin/dd/args.c
==
--- head/bin/dd/args.c  Tue Feb  9 09:32:10 2016(r295426)
+++ head/bin/dd/args.c  Tue Feb  9 09:37:04 2016(r295427)
@@ -360,10 +360,10 @@ c_conv(const void *a, const void *b)
((const struct conv *)b)->name));
 }
 
-static uintmax_t
+static intmax_t
 postfix_to_mult(const char expr)
 {
-   uintmax_t mult;
+   intmax_t mult;
 
mult = 0;
switch (expr) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295431 - head/tools/tools/nanobsd/embedded

2016-02-09 Thread Andrew Turner
Author: andrew
Date: Tue Feb  9 10:06:06 2016
New Revision: 295431
URL: https://svnweb.freebsd.org/changeset/base/295431

Log:
  Correct the year, it's 2016.

Modified:
  head/tools/tools/nanobsd/embedded/qemu-armv7.cfg

Modified: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg
==
--- head/tools/tools/nanobsd/embedded/qemu-armv7.cfgTue Feb  9 09:57:50 
2016(r295430)
+++ head/tools/tools/nanobsd/embedded/qemu-armv7.cfgTue Feb  9 10:06:06 
2016(r295431)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 #-
-# Copyright (c) 2015 Andrew Turner. All Rights Reserved.
+# Copyright (c) 2016 Andrew Turner. All Rights Reserved.
 # Copyright (c) 2015 Warner Losh. All Rights Reserved.
 # Copyright (c) 2010-2011 iXsystems, Inc., All rights reserved.
 #
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295432 - head/sys/arm64/arm64

2016-02-09 Thread Andrew Turner
Author: andrew
Date: Tue Feb  9 10:18:22 2016
New Revision: 295432
URL: https://svnweb.freebsd.org/changeset/base/295432

Log:
  Use designated initialisers for the db disassembler interface to help with
  finding the struct when searching for one of its members.

Modified:
  head/sys/arm64/arm64/db_disasm.c

Modified: head/sys/arm64/arm64/db_disasm.c
==
--- head/sys/arm64/arm64/db_disasm.cTue Feb  9 10:06:06 2016
(r295431)
+++ head/sys/arm64/arm64/db_disasm.cTue Feb  9 10:18:22 2016
(r295432)
@@ -41,9 +41,9 @@ static void db_disasm_printaddr(vm_offse
 
 /* Glue code to interface db_disasm to the generic ARM disassembler */
 static const struct disasm_interface db_disasm_interface = {
-   db_disasm_read_word,
-   db_disasm_printaddr,
-   db_printf
+   .di_readword = db_disasm_read_word,
+   .di_printaddr = db_disasm_printaddr,
+   .di_printf = db_printf,
 };
 
 static u_int
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295426 - head/bin/dd

2016-02-09 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Feb  9 09:32:10 2016
New Revision: 295426
URL: https://svnweb.freebsd.org/changeset/base/295426

Log:
  Use proper functions for parsing the numeric values.
  
  Submitted by: bde@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/bin/dd/args.c

Modified: head/bin/dd/args.c
==
--- head/bin/dd/args.c  Tue Feb  9 06:26:27 2016(r295425)
+++ head/bin/dd/args.c  Tue Feb  9 09:32:10 2016(r295426)
@@ -419,7 +419,7 @@ get_num(const char *val)
char *expr;
 
errno = 0;
-   num = strtouq(val, , 0);
+   num = strtoumax(val, , 0);
if (errno != 0) /* Overflow or underflow. */
err(1, "%s", oper);

@@ -469,7 +469,7 @@ get_off_t(const char *val)
char *expr;
 
errno = 0;
-   num = strtoq(val, , 0);
+   num = strtoimax(val, , 0);
if (errno != 0) /* Overflow or underflow. */
err(1, "%s", oper);

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295428 - head/bin/dd

2016-02-09 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Feb  9 09:38:05 2016
New Revision: 295428
URL: https://svnweb.freebsd.org/changeset/base/295428

Log:
  Improve comment to reflect recent changes.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/bin/dd/args.c

Modified: head/bin/dd/args.c
==
--- head/bin/dd/args.c  Tue Feb  9 09:37:04 2016(r295427)
+++ head/bin/dd/args.c  Tue Feb  9 09:38:05 2016(r295428)
@@ -407,8 +407,10 @@ postfix_to_mult(const char expr)
  * 3) A positive decimal number followed by a 'k' or 'K' (mult by 1 << 10).
  * 4) A positive decimal number followed by a 'm' or 'M' (mult by 1 << 20).
  * 5) A positive decimal number followed by a 'g' or 'G' (mult by 1 << 30).
- * 5) A positive decimal number followed by a 'w' or 'W' (mult by sizeof 
int).
- * 6) Two or more positive decimal numbers (with/without [BbKkMmGgWw])
+ * 6) A positive decimal number followed by a 't' or 'T' (mult by 1 << 40).
+ * 7) A positive decimal number followed by a 'p' or 'P' (mult by 1 << 50).
+ * 8) A positive decimal number followed by a 'w' or 'W' (mult by sizeof 
int).
+ * 9) Two or more positive decimal numbers (with/without [BbKkMmGgWw])
  *separated by 'x' or 'X' (also '*' for backwards compatibility),
  *specifying the product of the indicated values.
  */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295430 - head/tools/tools/nanobsd/embedded

2016-02-09 Thread Andrew Turner
Author: andrew
Date: Tue Feb  9 09:57:50 2016
New Revision: 295430
URL: https://svnweb.freebsd.org/changeset/base/295430

Log:
  Add an ARMv7 config file to build nanobsd images for the qemu virt
  platform.
  
  Sponsored by: ABT Systems Ltd

Added:
  head/tools/tools/nanobsd/embedded/qemu-armv7.cfg   (contents, props changed)

Added: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/nanobsd/embedded/qemu-armv7.cfgTue Feb  9 09:57:50 
2016(r295430)
@@ -0,0 +1,48 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Andrew Turner. All Rights Reserved.
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, 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 AUTHOR 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 iXsystems, Inc. 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.
+#
+
+NANO_ARCH=armv6
+NANO_DRIVE=vtbd0
+NANO_KERNEL=VIRT
+NANO_NAME=qemu-armv7
+NANO_LAYOUT=std-uefi-bios
+NANO_CPUTYPE=cortexa
+
+. common   # Pull in common definitions
+
+qemu_env
+
+#
+# Run with
+#  qemu-system-arm -M virt -serial stdio -bios QEMU_EFI.fd \
+#  -drive if=none,file=_.disk.image.qemu-armv7.qcow2,id=hd0 \
+#  -device virtio-blk-device,drive=hd0
+# QEMU_EFI.fd is from
+#  
http://releases.linaro.org/components/kernel/uefi-linaro/15.12/release/qemu/
+#
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295440 - head/sys/dev/sound/pcm

2016-02-09 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb  9 17:09:14 2016
New Revision: 295440
URL: https://svnweb.freebsd.org/changeset/base/295440

Log:
  To support userspace audio daemons like Virtual OSS, /dev/sndstat is
  made writeable by the root user. Userspace audio daemons can add or
  update an entry in /dev/sndstat by doing a single system write call to
  any /dev/sndstat file descriptor handle. When the audio daemon closes the
  file handle or is killed the entry disappears.
  
  While at it, cleanup the sound status code a bit:
  - keep the device list sorted to avoid sorting the list every time a
/dev/sndstat read request is made.
  - factor out locking into a pair of locking macros.
  - use the sound status lock to protect all per file handle states,
when generating the output for /dev/sndstat and when removing or
adding sound status devices. This way sndstat_acquire() and
sndstat_release() become superfluous and can be removed.
  
  Reviewed by:  mav @
  Differential Revision:https://reviews.freebsd.org/D5191

Modified:
  head/sys/dev/sound/pcm/sndstat.c
  head/sys/dev/sound/pcm/sound.c
  head/sys/dev/sound/pcm/sound.h

Modified: head/sys/dev/sound/pcm/sndstat.c
==
--- head/sys/dev/sound/pcm/sndstat.cTue Feb  9 16:58:50 2016
(r295439)
+++ head/sys/dev/sound/pcm/sndstat.cTue Feb  9 17:09:14 2016
(r295440)
@@ -37,77 +37,51 @@
 SND_DECLARE_FILE("$FreeBSD$");
 
 #defineSS_TYPE_MODULE  0
-#defineSS_TYPE_FIRST   1
 #defineSS_TYPE_PCM 1
 #defineSS_TYPE_MIDI2
 #defineSS_TYPE_SEQUENCER   3
-#defineSS_TYPE_LAST3
 
 static d_open_t sndstat_open;
-static d_close_t sndstat_close;
+static void sndstat_close(void *);
 static d_read_t sndstat_read;
+static d_write_t sndstat_write;
 
 static struct cdevsw sndstat_cdevsw = {
.d_version =D_VERSION,
.d_open =   sndstat_open,
-   .d_close =  sndstat_close,
.d_read =   sndstat_read,
+   .d_write =  sndstat_write,
.d_name =   "sndstat",
.d_flags =  D_TRACKCLOSE,
 };
 
 struct sndstat_entry {
-   SLIST_ENTRY(sndstat_entry) link;
+   TAILQ_ENTRY(sndstat_entry) link;
device_t dev;
char *str;
sndstat_handler handler;
int type, unit;
 };
 
-static struct sx sndstat_lock;
-static struct sbuf sndstat_sbuf;
-static struct cdev *sndstat_dev = NULL;
-static int sndstat_bufptr = -1;
-static int sndstat_maxunit = -1;
-static int sndstat_files = 0;
-
-#define SNDSTAT_PID(x) ((pid_t)((intptr_t)((x)->si_drv1)))
-#define SNDSTAT_PID_SET(x, y)  (x)->si_drv1 = (void *)((intptr_t)(y))
-#define SNDSTAT_FLUSH()do {
\
-   if (sndstat_bufptr != -1) { \
-   sbuf_delete(_sbuf); \
-   sndstat_bufptr = -1;\
-   }   \
-} while (0)
+struct sndstat_file {
+   TAILQ_ENTRY(sndstat_file) entry;
+   struct sbuf sbuf;
+   int out_offset;
+   int in_offset;
+};
 
-static SLIST_HEAD(, sndstat_entry) sndstat_devlist = 
SLIST_HEAD_INITIALIZER(sndstat_devlist);
+static struct sx sndstat_lock;
+static struct cdev *sndstat_dev;
 
-int snd_verbose = 0;
+#defineSNDSTAT_LOCK() sx_xlock(_lock)
+#defineSNDSTAT_UNLOCK() sx_xunlock(_lock)
 
-#ifdef SND_DEBUG
-static int
-sysctl_hw_snd_sndstat_pid(SYSCTL_HANDLER_ARGS)
-{
-   int err, val;
+static TAILQ_HEAD(, sndstat_entry) sndstat_devlist = 
TAILQ_HEAD_INITIALIZER(sndstat_devlist);
+static TAILQ_HEAD(, sndstat_file) sndstat_filelist = 
TAILQ_HEAD_INITIALIZER(sndstat_filelist);
 
-   if (sndstat_dev == NULL)
-   return (EINVAL);
-
-   sx_xlock(_lock);
-   val = (int)SNDSTAT_PID(sndstat_dev);
-   err = sysctl_handle_int(oidp, , 0, req);
-   if (err == 0 && req->newptr != NULL && val == 0) {
-   SNDSTAT_FLUSH();
-   SNDSTAT_PID_SET(sndstat_dev, 0);
-   }
-   sx_unlock(_lock);
-   return (err);
-}
-SYSCTL_PROC(_hw_snd, OID_AUTO, sndstat_pid, CTLTYPE_INT | CTLFLAG_RWTUN,
-0, sizeof(int), sysctl_hw_snd_sndstat_pid, "I", "sndstat busy pid");
-#endif
+int snd_verbose = 0;
 
-static int sndstat_prepare(struct sbuf *s);
+static int sndstat_prepare(struct sndstat_file *);
 
 static int
 sysctl_hw_sndverbose(SYSCTL_HANDLER_ARGS)
@@ -122,7 +96,7 @@ sysctl_hw_sndverbose(SYSCTL_HANDLER_ARGS
else
snd_verbose = verbose;
}
-   return error;
+   return (error);
 }
 SYSCTL_PROC(_hw_snd, OID_AUTO, verbose, CTLTYPE_INT | CTLFLAG_RWTUN,
 0, sizeof(int), sysctl_hw_sndverbose, "I", "verbosity level");
@@ -130,128 +104,135 @@ 

svn commit: r295436 - in head/sys/gnu/dts: arm include/dt-bindings/clk include/dt-bindings/clock include/dt-bindings/dma include/dt-bindings/gpio include/dt-bindings/i2c include/dt-bindings/iio inc...

2016-02-09 Thread Andrew Turner
Author: andrew
Date: Tue Feb  9 16:42:32 2016
New Revision: 295436
URL: https://svnweb.freebsd.org/changeset/base/295436

Log:
  Update our copy of the Linux dts files to be in sync with Linux 4.5-rc1. We
  now uave a full copy of the arm device tree sources to help when adding
  support for newer boards.
  
  Sponsored by: ABT Systems Ltd

Added:
  head/sys/gnu/dts/arm/alphascale-asm9260-devkit.dts
 - copied unchanged from r295019, 
vendor/device-tree/dist/src/arm/alphascale-asm9260-devkit.dts
  head/sys/gnu/dts/arm/alphascale-asm9260.dtsi
 - copied unchanged from r295019, 
vendor/device-tree/dist/src/arm/alphascale-asm9260.dtsi
  head/sys/gnu/dts/arm/alpine-db.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/alpine-db.dts
  head/sys/gnu/dts/arm/alpine.dtsi
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/alpine.dtsi
  head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am335x-baltos-ir5221.dts
  head/sys/gnu/dts/arm/am335x-bonegreen.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am335x-bonegreen.dts
  head/sys/gnu/dts/arm/am335x-chiliboard.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am335x-chiliboard.dts
  head/sys/gnu/dts/arm/am335x-chilisom.dtsi
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am335x-chilisom.dtsi
  head/sys/gnu/dts/arm/am335x-cm-t335.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am335x-cm-t335.dts
  head/sys/gnu/dts/arm/am335x-phycore-som.dtsi
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am335x-phycore-som.dtsi
  head/sys/gnu/dts/arm/am335x-sbc-t335.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am335x-sbc-t335.dts
  head/sys/gnu/dts/arm/am335x-shc.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am335x-shc.dts
  head/sys/gnu/dts/arm/am335x-sl50.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am335x-sl50.dts
  head/sys/gnu/dts/arm/am335x-wega-rdk.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am335x-wega-rdk.dts
  head/sys/gnu/dts/arm/am335x-wega.dtsi
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am335x-wega.dtsi
  head/sys/gnu/dts/arm/am437x-cm-t43.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am437x-cm-t43.dts
  head/sys/gnu/dts/arm/am437x-sbc-t43.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am437x-sbc-t43.dts
  head/sys/gnu/dts/arm/am57xx-cl-som-am57x.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am57xx-cl-som-am57x.dts
  head/sys/gnu/dts/arm/am57xx-sbc-am57x.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/am57xx-sbc-am57x.dts
  head/sys/gnu/dts/arm/arm-realview-pb11mp.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/arm-realview-pb11mp.dts
  head/sys/gnu/dts/arm/armada-370-dlink-dns327l.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/armada-370-dlink-dns327l.dts
  head/sys/gnu/dts/arm/armada-370-seagate-nas-2bay.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/armada-370-seagate-nas-2bay.dts
  head/sys/gnu/dts/arm/armada-370-seagate-nas-4bay.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/armada-370-seagate-nas-4bay.dts
  head/sys/gnu/dts/arm/armada-370-seagate-nas-xbay.dtsi
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/armada-370-seagate-nas-xbay.dtsi
  head/sys/gnu/dts/arm/armada-370-seagate-personal-cloud-2bay.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/armada-370-seagate-personal-cloud-2bay.dts
  head/sys/gnu/dts/arm/armada-370-seagate-personal-cloud.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/armada-370-seagate-personal-cloud.dts
  head/sys/gnu/dts/arm/armada-370-seagate-personal-cloud.dtsi
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/armada-370-seagate-personal-cloud.dtsi
  head/sys/gnu/dts/arm/armada-385-linksys-caiman.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/armada-385-linksys-caiman.dts
  head/sys/gnu/dts/arm/armada-385-linksys-cobra.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/armada-385-linksys-cobra.dts
  head/sys/gnu/dts/arm/armada-385-linksys.dtsi
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/armada-385-linksys.dtsi
  head/sys/gnu/dts/arm/armada-388-clearfog.dts
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/armada-388-clearfog.dts
  head/sys/gnu/dts/arm/armada-38x-solidrun-microsom.dtsi
 - copied unchanged from r295015, 
vendor/device-tree/dist/src/arm/armada-38x-solidrun-microsom.dtsi
  head/sys/gnu/dts/arm/armada-390.dtsi
 - copied 

svn commit: r295435 - in head: bin/pkill bin/ps sys/compat/ndis sys/dev/hwpmc sys/kern sys/sys usr.bin/top usr.sbin/bsnmpd/modules/snmp_hostres

2016-02-09 Thread Konstantin Belousov
Author: kib
Date: Tue Feb  9 16:30:16 2016
New Revision: 295435
URL: https://svnweb.freebsd.org/changeset/base/295435

Log:
  Rename P_KTHREAD struct proc p_flag to P_KPROC.
  
  I left as is an apparent bug in ntoskrnl_var.h:AT_PASSIVE_LEVEL()
  definition.
  
  Suggested by: jhb
  Sponsored by: The FreeBSD Foundation

Modified:
  head/bin/pkill/pkill.c
  head/bin/ps/ps.1
  head/sys/compat/ndis/ntoskrnl_var.h
  head/sys/dev/hwpmc/hwpmc_mod.c
  head/sys/kern/init_main.c
  head/sys/kern/kern_fork.c
  head/sys/kern/kern_kthread.c
  head/sys/kern/kern_proc.c
  head/sys/kern/kern_racct.c
  head/sys/sys/proc.h
  head/usr.bin/top/machine.c
  head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.h

Modified: head/bin/pkill/pkill.c
==
--- head/bin/pkill/pkill.c  Tue Feb  9 14:35:23 2016(r295434)
+++ head/bin/pkill/pkill.c  Tue Feb  9 16:30:16 2016(r295435)
@@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
 
 /* Ignore system-processes (if '-S' flag is not specified) and myself. */
 #definePSKIP(kp)   ((kp)->ki_pid == mypid ||   
\
-(!kthreads && ((kp)->ki_flag & P_KTHREAD) != 0))
+(!kthreads && ((kp)->ki_flag & P_KPROC) != 0))
 
 enum listtype {
LT_GENERIC,

Modified: head/bin/ps/ps.1
==
--- head/bin/ps/ps.1Tue Feb  9 14:35:23 2016(r295434)
+++ head/bin/ps/ps.1Tue Feb  9 16:30:16 2016(r295435)
@@ -318,7 +318,7 @@ the include file
 .Bl -column P_SINGLE_BOUNDARY 0x4000
 .It Dv "P_ADVLOCK" Ta No "0x1" Ta "Process may hold a POSIX advisory lock"
 .It Dv "P_CONTROLT" Ta No "0x2" Ta "Has a controlling terminal"
-.It Dv "P_KTHREAD" Ta No "0x4" Ta "Kernel thread"
+.It Dv "P_KPROC" Ta No "0x4" Ta "Kernel process"
 .It Dv "P_FOLLOWFORK" Ta No "0x8" Ta "Attach debugger to new children"
 .It Dv "P_PPWAIT" Ta No "0x00010" Ta "Parent is waiting for child to exec/exit"
 .It Dv "P_PROFIL" Ta No "0x00020" Ta "Has started profiling"

Modified: head/sys/compat/ndis/ntoskrnl_var.h
==
--- head/sys/compat/ndis/ntoskrnl_var.h Tue Feb  9 14:35:23 2016
(r295434)
+++ head/sys/compat/ndis/ntoskrnl_var.h Tue Feb  9 16:30:16 2016
(r295435)
@@ -337,7 +337,7 @@ typedef struct nt_dispatch_header nt_dis
 #defineSYNC_LEVEL_MP   (IPI_LEVEL - 1)
 
 #defineAT_PASSIVE_LEVEL(td)\
-   ((td)->td_proc->p_flag & P_KTHREAD == FALSE)
+   ((td)->td_proc->p_flag & P_KPROC == FALSE)
 
 #defineAT_DISPATCH_LEVEL(td)   \
((td)->td_base_pri == PI_REALTIME)

Modified: head/sys/dev/hwpmc/hwpmc_mod.c
==
--- head/sys/dev/hwpmc/hwpmc_mod.c  Tue Feb  9 14:35:23 2016
(r295434)
+++ head/sys/dev/hwpmc/hwpmc_mod.c  Tue Feb  9 16:30:16 2016
(r295435)
@@ -1009,7 +1009,7 @@ pmc_attach_one_process(struct proc *p, s
 
/* issue an attach event to a configured log file */
if (pm->pm_owner->po_flags & PMC_PO_OWNS_LOGFILE) {
-   if (p->p_flag & P_KTHREAD) {
+   if (p->p_flag & P_KPROC) {
fullpath = kernelname;
freepath = NULL;
} else {

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Tue Feb  9 14:35:23 2016(r295434)
+++ head/sys/kern/init_main.c   Tue Feb  9 16:30:16 2016(r295435)
@@ -479,7 +479,7 @@ proc0_init(void *dummy __unused)
session0.s_leader = p;
 
p->p_sysent = _sysvec;
-   p->p_flag = P_SYSTEM | P_INMEM | P_KTHREAD;
+   p->p_flag = P_SYSTEM | P_INMEM | P_KPROC;
p->p_flag2 = 0;
p->p_state = PRS_NORMAL;
knlist_init_mtx(>p_klist, >p_mtx);

Modified: head/sys/kern/kern_fork.c
==
--- head/sys/kern/kern_fork.c   Tue Feb  9 14:35:23 2016(r295434)
+++ head/sys/kern/kern_fork.c   Tue Feb  9 16:30:16 2016(r295435)
@@ -1037,7 +1037,7 @@ fork_exit(void (*callout)(void *, struct
 * Check if a kernel thread misbehaved and returned from its main
 * function.
 */
-   if (p->p_flag & P_KTHREAD) {
+   if (p->p_flag & P_KPROC) {
printf("Kernel thread \"%s\" (pid %d) exited prematurely.\n",
td->td_name, p->p_pid);
kthread_exit();

Modified: head/sys/kern/kern_kthread.c
==
--- head/sys/kern/kern_kthread.cTue Feb  9 14:35:23 2016
(r295434)
+++ head/sys/kern/kern_kthread.cTue Feb  9 16:30:16 2016

svn commit: r295452 - head/etc/periodic/security

2016-02-09 Thread Kurt Lidl
Author: lidl
Date: Tue Feb  9 21:00:38 2016
New Revision: 295452
URL: https://svnweb.freebsd.org/changeset/base/295452

Log:
  Zero pf rule counters so daily reports make sense
  
  Zero pf rule counters so that each daily report lists an absolute
  number of rejected packets, not the total since the last time the
  machine rebooted (or the counters were manually cleared).
  
  PR:   206467
  Submitted by: Rick Adams
  Approved by:  rpaulo (mentor)
  Differential Revision:https://reviews.freebsd.org/D5172

Modified:
  head/etc/periodic/security/520.pfdenied

Modified: head/etc/periodic/security/520.pfdenied
==
--- head/etc/periodic/security/520.pfdenied Tue Feb  9 20:22:35 2016
(r295451)
+++ head/etc/periodic/security/520.pfdenied Tue Feb  9 21:00:38 2016
(r295452)
@@ -44,7 +44,7 @@ rc=0
 if check_yesno_period security_status_pfdenied_enable
 then
TMP=`mktemp -t security`
-   if pfctl -sr -v 2>/dev/null | nawk '{if (/^block/) {buf=$0; getline; 
gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' > ${TMP}; then
+   if pfctl -sr -v -z 2>/dev/null | nawk '{if (/^block/) {buf=$0; getline; 
gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' > ${TMP}; then
  check_diff new_only pf ${TMP} "${host} pf denied packets:"
fi
rc=$?
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295441 - head/share/examples/jails

2016-02-09 Thread Devin Teske
Author: dteske
Date: Tue Feb  9 18:08:40 2016
New Revision: 295441
URL: https://svnweb.freebsd.org/changeset/base/295441

Log:
  Fix bpf unhiding example /etc/devfs.rules

Modified:
  head/share/examples/jails/jib
  head/share/examples/jails/jng

Modified: head/share/examples/jails/jib
==
--- head/share/examples/jails/jib   Tue Feb  9 17:09:14 2016
(r295440)
+++ head/share/examples/jails/jib   Tue Feb  9 18:08:40 2016
(r295441)
@@ -122,7 +122,7 @@
 #  add include $devfsrules_hide_all
 #  add include $devfsrules_unhide_basic
 #  add include $devfsrules_unhide_login
-#  add include $devfsrules_unhide_bpf
+#  add path 'bpf*' unhide
 #
 # And set ether devfs.ruleset="11" (jail.conf(5)) or
 # jail_{name}_devfs_ruleset="11" (rc.conf(5)).

Modified: head/share/examples/jails/jng
==
--- head/share/examples/jails/jng   Tue Feb  9 17:09:14 2016
(r295440)
+++ head/share/examples/jails/jng   Tue Feb  9 18:08:40 2016
(r295441)
@@ -122,7 +122,7 @@
 #  add include $devfsrules_hide_all
 #  add include $devfsrules_unhide_basic
 #  add include $devfsrules_unhide_login
-#  add include $devfsrules_unhide_bpf
+#  add path 'bpf*' unhide
 #
 # And set ether devfs.ruleset="11" (jail.conf(5)) or
 # jail_{name}_devfs_ruleset="11" (rc.conf(5)).
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295442 - head/share/examples/jails

2016-02-09 Thread Devin Teske
Author: dteske
Date: Tue Feb  9 18:10:36 2016
New Revision: 295442
URL: https://svnweb.freebsd.org/changeset/base/295442

Log:
  Change MAC algo to support mixing w/jng interfaces

Modified:
  head/share/examples/jails/jib

Modified: head/share/examples/jails/jib
==
--- head/share/examples/jails/jib   Tue Feb  9 18:08:40 2016
(r295441)
+++ head/share/examples/jails/jib   Tue Feb  9 18:10:36 2016
(r295442)
@@ -198,7 +198,8 @@ jib_addm()
 
mustberoot_to_continue
 
-   local iface iface_devid eiface_devid_a eiface_devid_b
+   local iface iface_devid eiface_devid
+   local eiface_devid_a eiface_devid_b
local new num quad i=0
for iface in $*; do
 
@@ -248,32 +249,28 @@ jib_addm()
# unique value preventing conflict.
#
iface_devid=$( ifconfig $iface ether | awk '/ether/,$0=$2' )
-   eiface_devid_a=${iface_devid#??:??:??}
-   eiface_devid_b=${iface_devid#??:??:??}
+   eiface_devid=${iface_devid#??:??:??}
num=$( set -- `echo -n $name | sum` && echo $1 )
quad=$(( $num & 15 ))
case "$quad" in
10) quad=a ;; 11) quad=b ;; 12) quad=c ;;
13) quad=d ;; 14) quad=e ;; 15) quad=f ;;
esac
-   eiface_devid_a=$quad$eiface_devid_a
-   eiface_devid_b=$quad$eiface_devid_b
+   eiface_devid=$quad$eiface_devid
num=$(( $num >> 4 ))
quad=$(( $num & 15 ))
case "$quad" in
10) quad=a ;; 11) quad=b ;; 12) quad=c ;;
13) quad=d ;; 14) quad=e ;; 15) quad=f ;;
esac
-   eiface_devid_a=$quad$eiface_devid_a
-   eiface_devid_b=$quad$eiface_devid_b
+   eiface_devid=$quad$eiface_devid
num=$(( $num >> 4 ))
quad=$(( $num & 15 ))
case "$quad" in
10) quad=a ;; 11) quad=b ;; 12) quad=c ;;
13) quad=d ;; 14) quad=e ;; 15) quad=f ;;
esac
-   eiface_devid_a=$quad:$eiface_devid_a
-   eiface_devid_b=$quad:$eiface_devid_b
+   eiface_devid=$quad:$eiface_devid
num=$(( $num >> 4 ))
quad=$(( $num & 15 ))
case "$quad" in
@@ -281,13 +278,13 @@ jib_addm()
13) quad=d ;; 14) quad=e ;; 15) quad=f ;;
esac
case "$iface_devid" in
-   ?2:*|?6:*)
-   eiface_devid_a=a:$quad$eiface_devid_a
-   eiface_devid_b=e:$quad$eiface_devid_b
+   ?[Ee]:*)
+   eiface_devid_a=2:$quad$eiface_devid
+   eiface_devid_b=6:$quad$eiface_devid
;;
*)
-   eiface_devid_a=2:$quad$eiface_devid_a
-   eiface_devid_b=6:$quad$eiface_devid_b
+   eiface_devid_a=2:$quad$eiface_devid
+   eiface_devid_b=e:$quad$eiface_devid
esac
eval num=\$_${iface}_num
if [ "$num" ]; then
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295443 - head/share/examples/jails

2016-02-09 Thread Devin Teske
Author: dteske
Date: Tue Feb  9 18:11:18 2016
New Revision: 295443
URL: https://svnweb.freebsd.org/changeset/base/295443

Log:
  Bring generated interfaces up always

Modified:
  head/share/examples/jails/jib
  head/share/examples/jails/jng

Modified: head/share/examples/jails/jib
==
--- head/share/examples/jails/jib   Tue Feb  9 18:10:36 2016
(r295442)
+++ head/share/examples/jails/jib   Tue Feb  9 18:11:18 2016
(r295443)
@@ -214,6 +214,7 @@ jib_addm()
new=$( ifconfig bridge create ) || return
ifconfig $new addm $iface || return
ifconfig $new name "$iface$bridge" || return
+   ifconfig "$iface$bridge" up || return
fi
 
# 4. Create a new interface to the bridge
@@ -223,6 +224,8 @@ jib_addm()
# 5. Rename the new interface
ifconfig $new name "e${i}a_$name" || return
ifconfig ${new%a}b name "e${i}b_$name" || return
+   ifconfig "e${i}a_$name" up || return
+   ifconfig "e${i}b_$name" up || return
 
#
# 6. Set the MAC address of the new interface using a sensible

Modified: head/share/examples/jails/jng
==
--- head/share/examples/jails/jng   Tue Feb  9 18:10:36 2016
(r295442)
+++ head/share/examples/jails/jng   Tue Feb  9 18:11:18 2016
(r295443)
@@ -255,6 +255,7 @@ jng_bridge()
echo $2 ) || return
ngctl name "$iface$bridge:link$num" $eiface || return
ifconfig $new name $eiface || return
+   ifconfig $eiface up || return
 
#
# 6. Set the MAC address of the new interface using a sensible
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295444 - head/sys/arm/allwinner

2016-02-09 Thread Andrew Turner
Author: andrew
Date: Tue Feb  9 18:19:24 2016
New Revision: 295444
URL: https://svnweb.freebsd.org/changeset/base/295444

Log:
  Remove unneeded whitespace, and fix a license for a new file. Extracted
  from a larger patch.
  
  Submitted by: Emmanuel Vadot 
  X-Differential Revision:  https://reviews.freebsd.org/D4792

Modified:
  head/sys/arm/allwinner/allwinner_machdep.h

Modified: head/sys/arm/allwinner/allwinner_machdep.h
==
--- head/sys/arm/allwinner/allwinner_machdep.h  Tue Feb  9 18:11:18 2016
(r295443)
+++ head/sys/arm/allwinner/allwinner_machdep.h  Tue Feb  9 18:19:24 2016
(r295444)
@@ -2,8 +2,6 @@
  * Copyright (c) 2015 Emmanuel Vadot 
  * All rights reserved.
  *
- * This code is derived from software written for Brini by Mark Brinicombe
- *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -31,17 +29,17 @@
 
 #ifndef AW_MACHDEP_H
 #defineAW_MACHDEP_H
- 
+
 #defineALLWINNERSOC_A100x1000
 #defineALLWINNERSOC_A130x1300
 #defineALLWINNERSOC_A10S   0x1001
 #defineALLWINNERSOC_A200x2000
- 
+
 #defineALLWINNERSOC_SUN4I  0x4000
 #defineALLWINNERSOC_SUN5I  0x5000
 #defineALLWINNERSOC_SUN7I  0x7000
- 
+
 u_int allwinner_soc_type(void);
 u_int allwinner_soc_family(void);
- 
+
 #endif /* AW_MACHDEP_H */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295455 - head

2016-02-09 Thread Baptiste Daroussin
Author: bapt
Date: Wed Feb 10 00:26:01 2016
New Revision: 295455
URL: https://svnweb.freebsd.org/changeset/base/295455

Log:
  Fix make universe when running with non POSIX/C locales using a locale 
sensitive
  pattern
  
  Reported by:  many
  Submitted by: jilles

Modified:
  head/Makefile

Modified: head/Makefile
==
--- head/Makefile   Wed Feb 10 00:08:51 2016(r295454)
+++ head/Makefile   Wed Feb 10 00:26:01 2016(r295455)
@@ -466,7 +466,8 @@ _THINNER=cat
 _THINNER=xargs grep -L "^.NO_UNIVERSE" || true
 .endif
 KERNCONFS!=cd ${KERNSRCDIR}/${TARGET}/conf && \
-   find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \
+   find [[:upper:][:digit:]]*[[:upper:][:digit:]] \
+   -type f -maxdepth 0 \
! -name DEFAULTS ! -name NOTES | \
${_THINNER}
 universe_kernconfs:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295457 - head/share/examples/jails

2016-02-09 Thread Devin Teske
Author: dteske
Date: Wed Feb 10 04:04:31 2016
New Revision: 295457
URL: https://svnweb.freebsd.org/changeset/base/295457

Log:
  Add vnet jail configuration examples

Added:
  head/share/examples/jails/jail.xxx.conf   (contents, props changed)
  head/share/examples/jails/rc.conf.jails   (contents, props changed)
  head/share/examples/jails/rcjail.xxx.conf   (contents, props changed)
Modified:
  head/share/examples/jails/README

Modified: head/share/examples/jails/README
==
--- head/share/examples/jails/READMEWed Feb 10 04:00:01 2016
(r295456)
+++ head/share/examples/jails/READMEWed Feb 10 04:04:31 2016
(r295457)
@@ -1,5 +1,49 @@
 # $FreeBSD$
 
-See under share/examples/netgraph for some examples of
+Sample 1: jail.conf(5)
+
+   $ cp jib jng /usr/sbin/
+   $ cat jail.xxx.conf >> /etc/jail.conf
+   $ vi /etc/jail.conf
+   # NB: Customize root directory and bridge interface
+   $ sysrc jail_enable=YES
+   # NB: Assumes jail_list="" (meaning ``all jails in jail.conf'')
+   # NB: Assumes rc_conf_files="" (``below rc.conf(5) samples not used'')
+   $ service jail start
+
+Sample 2: rc.conf(5)
+
+   $ cp jib jng /usr/sbin/
+   $ cp rc.conf.jails /etc/
+   $ vi /etc/rc.conf.jails
+   # NB: Customize root directory and bridge interface
+   $ sysrc rc_conf_files+=/etc/rc.conf.jails
+   # NB: Assumes /etc/jail.conf does not exist and jail_list=""
+   $ service jail start
+
+Sample 3: Per-jail jail.conf(5)
+
+   $ cp jib jng /usr/sbin/
+   $ cp jail.xxx.conf /etc/
+   $ vi /etc/jail.xxx.conf
+   # NB: Customize root directory and bridge interface
+   $ sysrc jail_enable=YES
+   $ sysrc jail_list+=xxx
+   # NB: Assumes rc_conf_files=""
+   $ service jail start
+
+Sample 4: Per-jail rc.conf(5)
+
+   $ cp jib jng /usr/sbin/
+   $ cp rcjail.xxx.conf /etc/
+   $ vi /etc/rcjail.xxx.conf
+   # NB: Customize root directory and bridge interface
+   $ sysrc jail_enable=YES
+   $ sysrc jail_list+=xxx
+   $ sysrc rc_conf_files+=/etc/rcjail.xxx.conf
+   # NB: Assumes neither /etc/jail.conf nor /etc/jail.xxx.conf exist
+   $ service jail start
+
+For additional recipes, see share/examples/netgraph for
 making and hooking together jails using netgraph as the
 virtual networking fabric.

Added: head/share/examples/jails/jail.xxx.conf
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/examples/jails/jail.xxx.conf Wed Feb 10 04:04:31 2016
(r295457)
@@ -0,0 +1,35 @@
+# $FreeBSD$
+
+xxx {
+   host.hostname = "xxx.yyy";  # hostname
+   path = "/vm/xxx";   # root directory
+
+   exec.clean;
+   exec.system_user = "root";
+   exec.jail_user = "root";
+
+   #
+   # NB: Below 4-lines required
+   #
+   vnet;
+   # netgraph
+   vnet.interface = "ng0_xxx"; # vnet interface(s)
+   exec.prestart += "jng bridge xxx em0";  # bridge interface(s)
+   exec.poststop += "jng shutdown xxx";# destroy interface(s)
+   # if_bridge
+   #vnet.interface = "e0b_xxx";# vnet interface(s)
+   #exec.prestart += "jib addm xxx em0";   # bridge interface(s)
+   #exec.poststop += "jib destroy xxx";# destroy interface(s)
+
+   # Standard recipe
+   exec.start += "/bin/sh /etc/rc";
+   exec.stop = "/bin/sh /etc/rc.shutdown";
+   exec.consolelog = "/var/log/jail_xxx_console.log";
+   mount.devfs;# mount devfs
+
+   # Optional (default off)
+   #devfs_ruleset = "11";  # rule to unhide bpf for DHCP
+   #allow.mount;   # mount /etc/fstab.xxx
+   #allow.set_hostname = 1;# Allow hostname to change
+   #allow.sysvipc = 1; # Allow SysV Interprocess Comm.
+}

Added: head/share/examples/jails/rc.conf.jails
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/examples/jails/rc.conf.jails Wed Feb 10 04:04:31 2016
(r295457)
@@ -0,0 +1,76 @@
+# $FreeBSD$
+
+###
+# JAIL CONFIGURATIONS #
+###
+
+jail_enable="YES"
+jail_list="xxx"
+
+#
+# Global presets for all jails
+#
+jail_devfs_enable="YES"# mount devfs
+# Optional (default off)
+#jail_sysvipc_allow="YES"  # Allow SysV Interprocess Comm.
+#jail_set_hostname_allow="YES" # Allow hostname to change
+
+#
+# To allow dhclient(8) to work inside a jail, make sure the following appears
+# in /etc/devfs.rules (which should be created if it doesn't 

svn commit: r295460 - head/share/examples/jails

2016-02-09 Thread Devin Teske
Author: dteske
Date: Wed Feb 10 04:56:38 2016
New Revision: 295460
URL: https://svnweb.freebsd.org/changeset/base/295460

Log:
  Add `stats' command to get ng_bridge(4) stats

Modified:
  head/share/examples/jails/jng

Modified: head/share/examples/jails/jng
==
--- head/share/examples/jails/jng   Wed Feb 10 04:43:08 2016
(r295459)
+++ head/share/examples/jails/jng   Wed Feb 10 04:56:38 2016
(r295460)
@@ -154,6 +154,7 @@ usage()
show\
show1   \
shutdown\
+   stats   \
; do
eval usage=\"\$jng_${action}_usage\"
[ "$usage" ] || continue
@@ -414,6 +415,39 @@ jng_shutdown()
jng_show "$name" | xargs -rn1 -I eiface ngctl shutdown eiface:
 }
 
+jng_stats_usage="stats NAME"
+jng_stats_descr="Show ng_bridge link statistics for NAME interfaces"
+jng_stats()
+{
+   local OPTIND=1 OPTARG flag
+   while getopts "" flag; do
+   case "$flag" in
+   *) action_usage stats # NOTREACHED
+   esac
+   done
+   shift $(( $OPTIND -1 ))
+   local name="$1"
+   [ "${name:-x}" = "${name#*[!0-9a-zA-Z_]}" -a $# -eq 1 ] ||
+   action_usage stats # NOTREACHED
+   mustberoot_to_continue
+   for eiface in $( jng_show "$name" ); do
+   echo "$eiface:"
+   ngctl show $eiface: | awk '
+   $3 == "bridge" && $5 ~ /^link/ {
+   bridge = $2
+   link = substr($5, 5)
+   system(sprintf("ngctl msg %s: getstats %u",
+   bridge, link))
+   }' | fmt 2 | awk '
+   /=/ && fl = index($0, "=") {
+   printf "%20s = %s\n",
+   substr($0, 0, fl-1),
+   substr($0, 0, fl+1)
+   }
+   ' # END-QUOTE
+   done
+}
+
  MAIN
 
 #
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295459 - in head/sys: arm/include sys

2016-02-09 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 10 04:43:08 2016
New Revision: 295459
URL: https://svnweb.freebsd.org/changeset/base/295459

Log:
  Break out the shared bits of the arm intrng definitions into sys/intr.h;
  leave the machine dependent bits in sys/arm/.
  
  This is in preparation for MIPS INTRNG work.
  
  Submitted by: Stanislav Galabov 

Added:
  head/sys/sys/intr.h   (contents, props changed)
Modified:
  head/sys/arm/include/intr.h

Modified: head/sys/arm/include/intr.h
==
--- head/sys/arm/include/intr.h Wed Feb 10 04:20:39 2016(r295458)
+++ head/sys/arm/include/intr.h Wed Feb 10 04:43:08 2016(r295459)
@@ -49,93 +49,7 @@
 #defineNIRQ1024/* XXX - It should be an option. */
 #endif
 
-#ifdef notyet
-#defineINTR_SOLO   INTR_MD1
-typedef int intr_irq_filter_t(void *arg, struct trapframe *tf);
-#else
-typedef int intr_irq_filter_t(void *arg);
-#endif
-
-#define INTR_ISRC_NAMELEN  (MAXCOMLEN + 1)
-
-typedef void intr_ipi_filter_t(void *arg);
-
-enum intr_isrc_type {
-   INTR_ISRCT_NAMESPACE,
-   INTR_ISRCT_FDT
-};
-
-#define INTR_ISRCF_REGISTERED  0x01/* registered in a controller */
-#define INTR_ISRCF_PERCPU  0x02/* per CPU interrupt */
-#define INTR_ISRCF_BOUND   0x04/* bound to a CPU */
-
-/* Interrupt source definition. */
-struct intr_irqsrc {
-   device_tisrc_dev;   /* where isrc is mapped */
-   intptr_tisrc_xref;  /* device reference key */
-   uintptr_t   isrc_data;  /* device data for isrc */
-   u_int   isrc_irq;   /* unique identificator */
-   enum intr_isrc_type isrc_type;  /* how is isrc decribed */
-   u_int   isrc_flags;
-   charisrc_name[INTR_ISRC_NAMELEN];
-   uint16_tisrc_nspc_type;
-   uint16_tisrc_nspc_num;
-   enum intr_trigger   isrc_trig;
-   enum intr_polarity  isrc_pol;
-   cpuset_tisrc_cpu;   /* on which CPUs is enabled */
-   u_int   isrc_index;
-   u_long *isrc_count;
-   u_int   isrc_handlers;
-   struct intr_event * isrc_event;
-   intr_irq_filter_t * isrc_filter;
-   intr_ipi_filter_t * isrc_ipifilter;
-   void *  isrc_arg;
-#ifdef FDT
-   u_int   isrc_ncells;
-   pcell_t isrc_cells[];   /* leave it last */
-#endif
-};
-
-void intr_irq_set_name(struct intr_irqsrc *isrc, const char *fmt, ...)
-__printflike(2, 3);
-
-void intr_irq_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf);
-
-#define INTR_IRQ_NSPC_NONE 0
-#define INTR_IRQ_NSPC_PLAIN1
-#define INTR_IRQ_NSPC_IRQ  2
-#define INTR_IRQ_NSPC_IPI  3
-
-u_int intr_namespace_map_irq(device_t dev, uint16_t type, uint16_t num);
-#ifdef FDT
-u_int intr_fdt_map_irq(phandle_t, pcell_t *, u_int);
-#endif
-
-int intr_pic_register(device_t dev, intptr_t xref);
-int intr_pic_unregister(device_t dev, intptr_t xref);
-int intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter,
-void *arg, u_int ipicount);
-
-int intr_irq_add_handler(device_t dev, driver_filter_t, driver_intr_t, void *,
-u_int, int, void **);
-int intr_irq_remove_handler(device_t dev, u_int, void *);
-int intr_irq_config(u_int, enum intr_trigger, enum intr_polarity);
-int intr_irq_describe(u_int, void *, const char *);
-
-u_int intr_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask);
-
-#ifdef SMP
-int intr_irq_bind(u_int, int);
-
-void intr_ipi_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf);
-
-#define AISHF_NOALLOC  0x0001
-
-int intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t 
*filter,
-void *arg, u_int flags);
-
-void intr_pic_init_secondary(void);
-#endif
+#include 
 
 #else /* ARM_INTRNG */
 

Added: head/sys/sys/intr.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/sys/intr.h Wed Feb 10 04:43:08 2016(r295459)
@@ -0,0 +1,130 @@
+/* $NetBSD: intr.h,v 1.7 2003/06/16 20:01:00 thorpej Exp $ */
+
+/*-
+ * Copyright (c) 1997 Mark Brinicombe.
+ * 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.
+ * 3. All advertising materials mentioning 

Re: svn commit: r295455 - head

2016-02-09 Thread NGie Cooper

> On Feb 9, 2016, at 16:26, Baptiste Daroussin  wrote:
> 
> Author: bapt
> Date: Wed Feb 10 00:26:01 2016
> New Revision: 295455
> URL: https://svnweb.freebsd.org/changeset/base/295455
> 
> Log:
>  Fix make universe when running with non POSIX/C locales using a locale 
> sensitive
>  pattern
> 
>  Reported by:many
>  Submitted by:jilles

Please. Please MFC this.

> Modified:
>  head/Makefile
> 
> Modified: head/Makefile
> ==
> --- head/MakefileWed Feb 10 00:08:51 2016(r295454)
> +++ head/MakefileWed Feb 10 00:26:01 2016(r295455)
> @@ -466,7 +466,8 @@ _THINNER=cat
> _THINNER=xargs grep -L "^.NO_UNIVERSE" || true
> .endif
> KERNCONFS!=cd ${KERNSRCDIR}/${TARGET}/conf && \
> -find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \
> +find [[:upper:][:digit:]]*[[:upper:][:digit:]] \
> +-type f -maxdepth 0 \
>! -name DEFAULTS ! -name NOTES | \
>${_THINNER}
> universe_kernconfs:
> 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r295455 - head

2016-02-09 Thread Baptiste Daroussin
On Tue, Feb 09, 2016 at 11:01:05PM -0800, NGie Cooper wrote:
> 
> > On Feb 9, 2016, at 16:26, Baptiste Daroussin  wrote:
> > 
> > Author: bapt
> > Date: Wed Feb 10 00:26:01 2016
> > New Revision: 295455
> > URL: https://svnweb.freebsd.org/changeset/base/295455
> > 
> > Log:
> >  Fix make universe when running with non POSIX/C locales using a locale 
> > sensitive
> >  pattern
> > 
> >  Reported by:many
> >  Submitted by:jilles
> 
> Please. Please MFC this.

Sure I will I forgot to note it but I will

Best regards,
Bapt


signature.asc
Description: PGP signature


Re: svn commit: r294327 - in head/sys: dev/cxgb dev/cxgbe dev/e1000 dev/hyperv/netvsc dev/ixgbe dev/mxge netinet sys

2016-02-09 Thread Hans Petter Selasky

On 01/19/16 17:09, Ryan Stone wrote:

On Tue, Jan 19, 2016 at 10:33 AM, Hans Petter Selasky 
wrote:



+   qsort(lc->lro_mbuf_data, lc->lro_mbuf_count, sizeof(struct mbuf *),
+   _lro_mbuf_compare_header);



In the worst case, qsort() can take O(n**2) time and consume O(n) stack
space.  Is there a DOS concern here?



Hi,

Our FreeBSD qsort() routine has been specifically modified to not 
exhibit the so-called QuickSort worst case behaviour of O(N**2) sorting 
time. This is not documented in our source code, but here:


http://cs.fit.edu/~pkc/classes/writing/samples/bentley93engineering.pdf

So I think DOS w.r.t O(N**2) is not a valid consern.

Thank you for your input Ryan.

BTW:

Drew Gallatin has tested our qsort() v.s. my mergesort() and found that:

"It looks like mergesort is nearly 2x as expensive. (4.7% vs 2.5%)"

See:

https://reviews.freebsd.org/D5200

And:

https://reviews.freebsd.org/D4994

--HPS
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"