Re: svn commit: r246033 - head/usr.bin/systat

2013-01-29 Thread Andrey Zonov
On 1/28/13 6:51 PM, Bruce Evans wrote:
> On Mon, 28 Jan 2013, Andrey Zonov wrote:
> 
>> Log:
>>  - Show page faults requiring I/O on vmstat display.
> 
> No space is available there for showing it.
> 

Yep, you're right.

>> Modified: head/usr.bin/systat/vmstat.c
>> ==
>>
>> --- head/usr.bin/systat/vmstat.cMon Jan 28 12:54:53 2013(r246032)
>> +++ head/usr.bin/systat/vmstat.cMon Jan 28 12:57:42 2013(r246033)
>> @@ -324,24 +325,25 @@ labelkre(void)
>> mvprintw(INTSROW, INTSCOL + 1, "Interrupts");
>> mvprintw(INTSROW + 1, INTSCOL + 6, "total");
>>
>> -mvprintw(VMSTATROW, VMSTATCOL + 9, "cow");
>> -mvprintw(VMSTATROW + 1, VMSTATCOL + 9, "zfod");
>> -mvprintw(VMSTATROW + 2, VMSTATCOL + 9, "ozfod");
>> -mvprintw(VMSTATROW + 3, VMSTATCOL + 9 - 1, "%%ozfod");
>> -mvprintw(VMSTATROW + 4, VMSTATCOL + 9, "daefr");
>> -mvprintw(VMSTATROW + 5, VMSTATCOL + 9, "prcfr");
>> -mvprintw(VMSTATROW + 6, VMSTATCOL + 9, "totfr");
>> -mvprintw(VMSTATROW + 7, VMSTATCOL + 9, "react");
>> -mvprintw(VMSTATROW + 8, VMSTATCOL + 9, "pdwak");
>> -mvprintw(VMSTATROW + 9, VMSTATCOL + 9, "pdpgs");
>> -mvprintw(VMSTATROW + 10, VMSTATCOL + 9, "intrn");
>> -mvprintw(VMSTATROW + 11, VMSTATCOL + 9, "wire");
>> -mvprintw(VMSTATROW + 12, VMSTATCOL + 9, "act");
>> -mvprintw(VMSTATROW + 13, VMSTATCOL + 9, "inact");
>> -mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "cache");
>> -mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "free");
>> -if (LINES - 1 > VMSTATROW + 16)
>> -mvprintw(VMSTATROW + 16, VMSTATCOL + 9, "buf");
> 
> This is the last possible line on a 25-line display.  On a 24-line
> display, it is omitted so that it doesn't mangle or get mangled by the
> prompt/status line.  But previous lines are not specially handled, and
> neither are other parts of the display.  Also, the interrupt display
> may reach the last line of the window, and then it interacts with the
> prompt/status line even on a 25-line display.
> 
> On a 23-line display, mangling occurs as follows:
> - the special case for the "buf" line has no visible effect, since
>   this line is outside of the window
> - the free "line" and the prompt/status line are both on the last line
>   in the window, together with the %busy display and possibly the
>   interrupts display.  These mangle each other,
> 
> On a 22-line display, the mangling moves up by 1 line and becomes worse.
> Now there seems to be a windowing bug.  Some field (the "free" one) is
> mispositioned, so the display becomes magled (instead of just truncated)
> even when the prompt/status line is not used.
> 
>> +mvprintw(VMSTATROW, VMSTATCOL + 9, "ioflt");
> 
> Putting it first unsorts the fields a bit and makes the diff large.
> 
> It is not documented in the man page.
> 

Fixed in attached systat1.patch.txt.

>> +mvprintw(VMSTATROW + 1, VMSTATCOL + 9, "cow");
>> +mvprintw(VMSTATROW + 2, VMSTATCOL + 9, "zfod");
>> +mvprintw(VMSTATROW + 3, VMSTATCOL + 9, "ozfod");
>> +mvprintw(VMSTATROW + 4, VMSTATCOL + 9 - 1, "%%ozfod");
>> +mvprintw(VMSTATROW + 5, VMSTATCOL + 9, "daefr");
>> +mvprintw(VMSTATROW + 6, VMSTATCOL + 9, "prcfr");
>> +mvprintw(VMSTATROW + 7, VMSTATCOL + 9, "totfr");
>> +mvprintw(VMSTATROW + 8, VMSTATCOL + 9, "react");
>> +mvprintw(VMSTATROW + 9, VMSTATCOL + 9, "pdwak");
>> +mvprintw(VMSTATROW + 10, VMSTATCOL + 9, "pdpgs");
>> +mvprintw(VMSTATROW + 11, VMSTATCOL + 9, "intrn");
>> +mvprintw(VMSTATROW + 12, VMSTATCOL + 9, "wire");
>> +mvprintw(VMSTATROW + 13, VMSTATCOL + 9, "act");
>> +mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "inact");
>> +mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "cache");
>> +mvprintw(VMSTATROW + 16, VMSTATCOL + 9, "free");
>> +if (LINES - 1 > VMSTATROW + 17)
>> +mvprintw(VMSTATROW + 17, VMSTATCOL + 9, "buf");
> 
> Adding a field at the top pushes the "buf" field to the last line of
> the window in the most common case of a 25-line display, and makes its
> special case useless except for 26-line displays, so mangling from the
> "buf" line now occurs in the most common case.
> 
> It moves the problems for 22-24 line displays to 23-25 line displays,
> respectively.  Now it is the "free" field that needs the special handling
> to avoid mangling in the nextmost common case of 24-line displays.  Even
> more seriously, the "free" field is much more interesting than the "buf"
> field, so we don't want to lose it or have it mangled in a common case.
> The "buf" field really belongs in another group of fields (before "dtbuf")
> but is spaced where it is since there is no free space near "dtbuf" but
> just 1 line of free space (in the most common case) in the vmmeter fields
> column ("buf" also isn't a vmmeter field so it doesn't belong there).  But
> now there are 0 lines of free space there.
> 
> Since systat output barely works with screen depths other than 24 an

svn commit: r246074 - in head: . gnu/usr.bin/patch share/mk tools/build/options usr.bin usr.bin/patch

2013-01-29 Thread Gabor Kovesdan
Author: gabor
Date: Tue Jan 29 17:03:18 2013
New Revision: 246074
URL: http://svnweb.freebsd.org/changeset/base/246074

Log:
  - Add a BSD-licensed patch, ported by Pedro F. Giffuni (pfg) from
DragonflyBSD and install it as bsdpatch.  WITH_BSD_PATCH makes it
default and installs GNU patch as gnupatch.
  
  Submitted by: pfg
  Obtained from:The DragonflyBSD Project

Added:
  head/tools/build/options/WITH_BSD_PATCH   (contents, props changed)
  head/usr.bin/patch/
  head/usr.bin/patch/Makefile   (contents, props changed)
  head/usr.bin/patch/backupfile.c   (contents, props changed)
  head/usr.bin/patch/backupfile.h   (contents, props changed)
  head/usr.bin/patch/common.h   (contents, props changed)
  head/usr.bin/patch/inp.c   (contents, props changed)
  head/usr.bin/patch/inp.h   (contents, props changed)
  head/usr.bin/patch/mkpath.c   (contents, props changed)
  head/usr.bin/patch/patch.1   (contents, props changed)
  head/usr.bin/patch/patch.c   (contents, props changed)
  head/usr.bin/patch/pathnames.h   (contents, props changed)
  head/usr.bin/patch/pch.c   (contents, props changed)
  head/usr.bin/patch/pch.h   (contents, props changed)
  head/usr.bin/patch/util.c   (contents, props changed)
  head/usr.bin/patch/util.h   (contents, props changed)
Modified:
  head/UPDATING
  head/gnu/usr.bin/patch/Makefile
  head/share/mk/bsd.own.mk
  head/usr.bin/Makefile

Modified: head/UPDATING
==
--- head/UPDATING   Tue Jan 29 16:00:43 2013(r246073)
+++ head/UPDATING   Tue Jan 29 17:03:18 2013(r246074)
@@ -26,6 +26,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20130129:
+   A BSD-licensed patch(1) variant has been added and is installed
+   as bsdpatch, being the GNU version the default patch.
+   To inverse the logic and use the BSD-licensed one as default,
+   while having the GNU version installed as gnupatch, rebuild
+   ans install world with the WITH_BSD_PATCH knob set.
+
 20130118:
The install(1) option -M has changed meaning and now takes an
argument that is a file or path to append logs to.  In the

Modified: head/gnu/usr.bin/patch/Makefile
==
--- head/gnu/usr.bin/patch/Makefile Tue Jan 29 16:00:43 2013
(r246073)
+++ head/gnu/usr.bin/patch/Makefile Tue Jan 29 17:03:18 2013
(r246074)
@@ -1,6 +1,17 @@
 # $FreeBSD$
 
-PROG=  patch
+.include 
+
+.if ${MK_BSD_PATCH} == "yes"
+PROG=  gnupatch
+CLEANFILES+= gnupatch.1
+
+gnupatch.1: patch.1
+   cp ${.ALLSRC} ${.TARGET}
+.else
+PROG=  patch
+.endif
+
 SRCS=   backupfile.c inp.c patch.c pch.c util.c version.c
 CFLAGS+=-DHAVE_CONFIG_H
 

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkTue Jan 29 16:00:43 2013(r246073)
+++ head/share/mk/bsd.own.mkTue Jan 29 17:03:18 2013(r246074)
@@ -354,6 +354,7 @@ __DEFAULT_YES_OPTIONS = \
 
 __DEFAULT_NO_OPTIONS = \
 ARM_EABI \
+BSD_PATCH \
 BIND_IDN \
 BIND_LARGE_FILE \
 BIND_LIBS \

Added: head/tools/build/options/WITH_BSD_PATCH
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITH_BSD_PATCH Tue Jan 29 17:03:18 2013
(r246074)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Install BSD-licensed patch as 'patch' instead of GNU patch.

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Tue Jan 29 16:00:43 2013(r246073)
+++ head/usr.bin/Makefile   Tue Jan 29 17:03:18 2013(r246074)
@@ -123,6 +123,7 @@ SUBDIR= alias \
pagesize \
passwd \
paste \
+   patch \
pathchk \
perror \
pr \

Added: head/usr.bin/patch/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/patch/Makefile Tue Jan 29 17:03:18 2013(r246074)
@@ -0,0 +1,19 @@
+# $FreeBSD$
+#  $OpenBSD: Makefile,v 1.4 2005/05/16 15:22:46 espie Exp $
+#  $DragonFly: src/usr.bin/patch/Makefile,v 1.8 2008/08/10 23:50:12 joerg 
Exp $
+
+.include 
+
+.if ${MK_BSD_PATCH} == "yes"
+PROG=  patch
+.else
+PROG=  bsdpatch
+CLEANFILES+= bsdpatch.1
+
+bsdpatch.1: patch.1
+   cp ${.ALLSRC} ${.TARGET}
+.endif
+
+SRCS=  backupfile.c inp.c mkpath.c patch.c pch.c util.c
+
+.include 

Added: head/usr.bin/patch/backupfile.c
==
--- /dev/nul

svn commit: r246075 - head/share/man/man5

2013-01-29 Thread Gabor Kovesdan
Author: gabor
Date: Tue Jan 29 17:05:21 2013
New Revision: 246075
URL: http://svnweb.freebsd.org/changeset/base/246075

Log:
  - Regen

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Tue Jan 29 17:03:18 2013
(r246074)
+++ head/share/man/man5/src.conf.5  Tue Jan 29 17:05:21 2013
(r246075)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 236279 2012-05-30 02:37:20Z 
gjb
 .\" $FreeBSD$
-.Dd January 17, 2013
+.Dd January 29, 2013
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -100,6 +100,9 @@ Set to not build
 .Xr apm 8 ,
 .Xr apmd 8
 and related programs.
+.It Va WITH_ARM_EABI
+.\" from FreeBSD: head/tools/build/options/WITH_ARM_EABI 245539 2013-01-17 
05:56:28Z andrew
+Set the ARM ABI to EABI.
 .It Va WITHOUT_ASSERT_DEBUG
 .\" from FreeBSD: head/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 
2006-09-11 13:55:27Z ru
 Set to compile programs and libraries without the
@@ -242,6 +245,9 @@ Set to not build the BSD licensed versio
 .It Va WITH_BSD_GREP
 .\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 73 2011-05-25 
01:04:12Z obrien
 Install BSD-licensed grep as '[ef]grep' instead of GNU grep.
+.It Va WITH_BSD_PATCH
+.\" from FreeBSD: head/tools/build/options/WITH_BSD_PATCH 246074 2013-01-29 
17:03:18Z gabor
+Install BSD-licensed patch as 'patch' instead of GNU patch.
 .It Va WITHOUT_BSNMP
 .\" from FreeBSD: head/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 
16:15:42Z sam
 Set to not build or install
@@ -476,9 +482,6 @@ Set to not build GPIB bus support.
 Set to not build
 .Xr gpioctl 8
 as part of the base system.
-.It Va WITH_GPL_DTC
-Set to build the GPL'd version of the device tree compiler from elinux.org,
-instead of the BSD licensed one.
 .It Va WITHOUT_GROFF
 .\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 
08:13:49Z uqs
 Set to not build
@@ -888,6 +891,11 @@ Set to build some programs without PAM s
 .Xr ftpd 8
 and
 .Xr ppp 8 .
+.It Va WITHOUT_PC_SYSINSTALL
+.\" from FreeBSD: head/tools/build/options/WITHOUT_PC_SYSINSTALL 245606 
2013-01-18 15:57:09Z eadler
+Set to not build
+.Xr pc-sysinstall 8
+and related programs.
 .It Va WITHOUT_PF
 .\" from FreeBSD: head/tools/build/options/WITHOUT_PF 156932 2006-03-21 
07:50:50Z ru
 Set to not build PF firewall package.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r246083 - head/bin/cat

2013-01-29 Thread Brooks Davis
Author: brooks
Date: Tue Jan 29 18:19:40 2013
New Revision: 246083
URL: http://svnweb.freebsd.org/changeset/base/246083

Log:
  Add -l option to cat(1). This option causes cat(1) to use fcntl(2) to
  set an exclusive advisory lock on stdout.  This will be used to guarantee
  orderly writing to METALOG.
  
  Sponsored by: DARPA, AFRL
  Obtained from:NetBSD (mason)

Modified:
  head/bin/cat/cat.1
  head/bin/cat/cat.c

Modified: head/bin/cat/cat.1
==
--- head/bin/cat/cat.1  Tue Jan 29 17:54:26 2013(r246082)
+++ head/bin/cat/cat.1  Tue Jan 29 18:19:40 2013(r246083)
@@ -32,7 +32,7 @@
 .\" @(#)cat.1  8.3 (Berkeley) 5/2/95
 .\" $FreeBSD$
 .\"
-.Dd March 21, 2004
+.Dd Jaunary 29, 2013
 .Dt CAT 1
 .Os
 .Sh NAME
@@ -40,7 +40,7 @@
 .Nd concatenate and print files
 .Sh SYNOPSIS
 .Nm
-.Op Fl benstuv
+.Op Fl belnstuv
 .Op Ar
 .Sh DESCRIPTION
 The
@@ -79,6 +79,16 @@ Display non-printing characters (see the
 option), and display a dollar sign
 .Pq Ql \&$
 at the end of each line.
+.It Fl l
+Set an exclusive advisory lock on the standard output file descriptor.
+This lock is set using
+.Xr fcntl 2
+with the
+.Dv F_SETLKW
+command.
+If the output file is already locked,
+.Nm
+will block until the lock is acquired.
 .It Fl n
 Number the output lines, starting at 1.
 .It Fl s
@@ -160,6 +170,7 @@ operand.
 .Xr tail 1 ,
 .Xr vis 1 ,
 .Xr zcat 1 ,
+.Xr fcntl 2 ,
 .Xr setbuf 3
 .Rs
 .%A Rob Pike
@@ -175,7 +186,7 @@ utility is compliant with the
 specification.
 .Pp
 The flags
-.Op Fl benstv
+.Op Fl belnstv
 are extensions to the specification.
 .Sh HISTORY
 A

Modified: head/bin/cat/cat.c
==
--- head/bin/cat/cat.c  Tue Jan 29 17:54:26 2013(r246082)
+++ head/bin/cat/cat.c  Tue Jan 29 18:19:40 2013(r246083)
@@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-static int bflag, eflag, nflag, sflag, tflag, vflag;
+static int bflag, eflag, lflag, nflag, sflag, tflag, vflag;
 static int rval;
 static const char *filename;
 
@@ -96,10 +96,11 @@ int
 main(int argc, char *argv[])
 {
int ch;
+   struct flock stdout_lock;
 
setlocale(LC_CTYPE, "");
 
-   while ((ch = getopt(argc, argv, "benstuv")) != -1)
+   while ((ch = getopt(argc, argv, "belnstuv")) != -1)
switch (ch) {
case 'b':
bflag = nflag = 1;  /* -b implies -n */
@@ -107,6 +108,9 @@ main(int argc, char *argv[])
case 'e':
eflag = vflag = 1;  /* -e implies -v */
break;
+   case 'l':
+   lflag = 1;
+   break;
case 'n':
nflag = 1;
break;
@@ -127,6 +131,15 @@ main(int argc, char *argv[])
}
argv += optind;
 
+   if (lflag) {
+   stdout_lock.l_len = 0;
+   stdout_lock.l_start = 0;
+   stdout_lock.l_type = F_WRLCK;
+   stdout_lock.l_whence = SEEK_SET;
+   if (fcntl(STDOUT_FILENO, F_SETLKW, &stdout_lock) == -1)
+   err(EXIT_FAILURE, "stdout");
+   }
+
if (bflag || eflag || nflag || sflag || tflag || vflag)
scanfiles(argv, 1);
else
@@ -140,7 +153,7 @@ main(int argc, char *argv[])
 static void
 usage(void)
 {
-   fprintf(stderr, "usage: cat [-benstuv] [file ...]\n");
+   fprintf(stderr, "usage: cat [-belnstuv] [file ...]\n");
exit(1);
/* NOTREACHED */
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r246084 - head/sys/sys

2013-01-29 Thread Brooks Davis
Author: brooks
Date: Tue Jan 29 18:22:38 2013
New Revision: 246084
URL: http://svnweb.freebsd.org/changeset/base/246084

Log:
  Bump __FreeBSD_version for cat -l (soon to be a bootstrap tool).

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hTue Jan 29 18:19:40 2013(r246083)
+++ head/sys/sys/param.hTue Jan 29 18:22:38 2013(r246084)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 126  /* Master, propagated to newvers */
+#define __FreeBSD_version 127  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r246085 - in head/sys: amd64/linux32 compat/linprocfs compat/linux i386/linux

2013-01-29 Thread John Baldwin
Author: jhb
Date: Tue Jan 29 18:41:30 2013
New Revision: 246085
URL: http://svnweb.freebsd.org/changeset/base/246085

Log:
  Reduce duplication between i386/linux/linux.h and amd64/linux32/linux.h
  by moving bits that are MI out into headers in compat/linux.
  
  Reviewed by:  Chagin Dmitry  dmitry | gmail
  MFC after:2 weeks

Modified:
  head/sys/amd64/linux32/linux.h
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/compat/linprocfs/linprocfs.c
  head/sys/compat/linux/linux_emul.c
  head/sys/compat/linux/linux_file.c
  head/sys/compat/linux/linux_file.h
  head/sys/compat/linux/linux_fork.c
  head/sys/compat/linux/linux_ioctl.h
  head/sys/compat/linux/linux_ipc.h
  head/sys/compat/linux/linux_mib.c
  head/sys/compat/linux/linux_misc.h
  head/sys/compat/linux/linux_signal.h
  head/sys/compat/linux/linux_socket.h
  head/sys/compat/linux/linux_sysctl.c
  head/sys/compat/linux/linux_time.c
  head/sys/i386/linux/linux.h
  head/sys/i386/linux/linux_ptrace.c
  head/sys/i386/linux/linux_sysvec.c

Modified: head/sys/amd64/linux32/linux.h
==
--- head/sys/amd64/linux32/linux.h  Tue Jan 29 18:22:38 2013
(r246084)
+++ head/sys/amd64/linux32/linux.h  Tue Jan 29 18:41:30 2013
(r246085)
@@ -107,11 +107,6 @@ typedef struct {
 /*
  * Miscellaneous
  */
-#defineLINUX_NAME_MAX  255
-#defineLINUX_MAX_UTSNAME   65
-
-#defineLINUX_CTL_MAXNAME   10
-
 #defineLINUX_AT_COUNT  16  /* Count of used aux entry 
types.
 * Keep this synchronized with
 * elf_linux_fixup() code.
@@ -127,11 +122,6 @@ struct l___sysctl_args
l_ulong __spare[4];
 } __packed;
 
-/* Scheduling policies */
-#defineLINUX_SCHED_OTHER   0
-#defineLINUX_SCHED_FIFO1
-#defineLINUX_SCHED_RR  2
-
 /* Resource limits */
 #defineLINUX_RLIMIT_CPU0
 #defineLINUX_RLIMIT_FSIZE  1
@@ -265,15 +255,6 @@ struct l_statfs64 { 
 l_int   f_spare[6];
 } __packed;
 
-struct l_new_utsname {
-   charsysname[LINUX_MAX_UTSNAME];
-   charnodename[LINUX_MAX_UTSNAME];
-   charrelease[LINUX_MAX_UTSNAME];
-   charversion[LINUX_MAX_UTSNAME];
-   charmachine[LINUX_MAX_UTSNAME];
-   chardomainname[LINUX_MAX_UTSNAME];
-} __packed;
-
 /*
  * Signalling
  */
@@ -535,27 +516,9 @@ struct l_rt_sigframe {
l_handler_t sf_handler;
 } __packed;
 
-extern int bsd_to_linux_signal[];
-extern int linux_to_bsd_signal[];
 extern struct sysentvec elf_linux_sysvec;
 
 /*
- * Pluggable ioctl handlers
- */
-struct linux_ioctl_args;
-struct thread;
-
-typedef int linux_ioctl_function_t(struct thread *, struct linux_ioctl_args *);
-
-struct linux_ioctl_handler {
-   linux_ioctl_function_t *func;
-   int low, high;
-};
-
-intlinux_ioctl_register_handler(struct linux_ioctl_handler *h);
-intlinux_ioctl_unregister_handler(struct linux_ioctl_handler *h);
-
-/*
  * open/fcntl flags
  */
 #defineLINUX_O_RDONLY  
@@ -597,65 +560,6 @@ intlinux_ioctl_unregister_handler(struc
 #defineLINUX_F_WRLCK   1
 #defineLINUX_F_UNLCK   2
 
-/*
- * posix_fadvise advice
- */
-#defineLINUX_POSIX_FADV_NORMAL 0
-#defineLINUX_POSIX_FADV_RANDOM 1
-#defineLINUX_POSIX_FADV_SEQUENTIAL 2
-#defineLINUX_POSIX_FADV_WILLNEED   3
-#defineLINUX_POSIX_FADV_DONTNEED   4
-#defineLINUX_POSIX_FADV_NOREUSE5
-
-/*
- * mount flags
- */
-#defineLINUX_MS_RDONLY 0x0001
-#defineLINUX_MS_NOSUID 0x0002
-#defineLINUX_MS_NODEV  0x0004
-#defineLINUX_MS_NOEXEC 0x0008
-#defineLINUX_MS_REMOUNT0x0020
-
-/*
- * SystemV IPC defines
- */
-#defineLINUX_SEMOP 1
-#defineLINUX_SEMGET2
-#defineLINUX_SEMCTL3
-#defineLINUX_MSGSND11
-#defineLINUX_MSGRCV12
-#defineLINUX_MSGGET13
-#defineLINUX_MSGCTL14
-#defineLINUX_SHMAT 21
-#defineLINUX_SHMDT 22
-#defineLINUX_SHMGET23
-#defineLINUX_SHMCTL24
-
-#defineLINUX_IPC_RMID  0
-#defineLINUX_IPC_SET   1
-#defineLINUX_IPC_STAT  2
-#defineLINUX_IPC_INFO  3
-
-#defineLINUX_SHM_LOCK  11
-#defineLINUX_SHM_UNLOCK12
-#defineLINUX_SHM_STAT  13
-#defineLINUX_SHM_INFO  14
-
-#defineLINUX_SHM_RDONLY0x1000
-#defineLINUX_SHM_RND   0x2000
-#defineLINUX_SHM_REMAP 0x4000
-
-/* semctl commands */
-#defineLINUX_GET

svn commit: r246087 - head/sys/vm

2013-01-29 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 29 19:06:16 2013
New Revision: 246087
URL: http://svnweb.freebsd.org/changeset/base/246087

Log:
  Fix typo in debug printf.

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Tue Jan 29 19:02:43 2013(r246086)
+++ head/sys/vm/uma_core.c  Tue Jan 29 19:06:16 2013(r246087)
@@ -1702,7 +1702,7 @@ uma_startup(void *bootmem, int boot_page
 
 #ifdef UMA_DEBUG
printf("Calculated uma_max_ipers (for OFFPAGE) is %d\n", uma_max_ipers);
-   printf("Calculated uma_max_ipers_slab (for OFFPAGE) is %d\n",
+   printf("Calculated uma_max_ipers_ref (for OFFPAGE) is %d\n",
uma_max_ipers_ref);
 #endif
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r246090 - head/bin/cat

2013-01-29 Thread Joel Dahl
Author: joel (doc committer)
Date: Tue Jan 29 20:01:47 2013
New Revision: 246090
URL: http://svnweb.freebsd.org/changeset/base/246090

Log:
  Fix date.

Modified:
  head/bin/cat/cat.1

Modified: head/bin/cat/cat.1
==
--- head/bin/cat/cat.1  Tue Jan 29 19:59:56 2013(r246089)
+++ head/bin/cat/cat.1  Tue Jan 29 20:01:47 2013(r246090)
@@ -32,7 +32,7 @@
 .\" @(#)cat.1  8.3 (Berkeley) 5/2/95
 .\" $FreeBSD$
 .\"
-.Dd Jaunary 29, 2013
+.Dd January 29, 2013
 .Dt CAT 1
 .Os
 .Sh NAME
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r246091 - head/usr.bin/patch

2013-01-29 Thread Xin LI
Author: delphij
Date: Tue Jan 29 20:05:16 2013
New Revision: 246091
URL: http://svnweb.freebsd.org/changeset/base/246091

Log:
   - Refresh code with latest OpenBSD revisions.
   - Remove $DragonFly$ tags as they are using git nowadays and VCS tags will
 not help merging.
   - Other changes to Copyright headers to make them consistent with other
 source code, we intend to fork from this point.
  
  Reviewed by:  pfg

Modified:
  head/usr.bin/patch/Makefile
  head/usr.bin/patch/backupfile.c
  head/usr.bin/patch/backupfile.h
  head/usr.bin/patch/common.h
  head/usr.bin/patch/inp.c
  head/usr.bin/patch/inp.h
  head/usr.bin/patch/mkpath.c
  head/usr.bin/patch/patch.1
  head/usr.bin/patch/patch.c
  head/usr.bin/patch/pathnames.h
  head/usr.bin/patch/pch.c
  head/usr.bin/patch/pch.h
  head/usr.bin/patch/util.c
  head/usr.bin/patch/util.h

Modified: head/usr.bin/patch/Makefile
==
--- head/usr.bin/patch/Makefile Tue Jan 29 20:01:47 2013(r246090)
+++ head/usr.bin/patch/Makefile Tue Jan 29 20:05:16 2013(r246091)
@@ -1,6 +1,5 @@
-# $FreeBSD$
 #  $OpenBSD: Makefile,v 1.4 2005/05/16 15:22:46 espie Exp $
-#  $DragonFly: src/usr.bin/patch/Makefile,v 1.8 2008/08/10 23:50:12 joerg 
Exp $
+# $FreeBSD$
 
 .include 
 

Modified: head/usr.bin/patch/backupfile.c
==
--- head/usr.bin/patch/backupfile.c Tue Jan 29 20:01:47 2013
(r246090)
+++ head/usr.bin/patch/backupfile.c Tue Jan 29 20:05:16 2013
(r246091)
@@ -1,6 +1,4 @@
-/* $FreeBSD$ */
 /*-
- *
  * Copyright (C) 1990 Free Software Foundation, Inc.
  * 
  * This program is free software; you can redistribute it and/or modify it
@@ -14,8 +12,8 @@
  *
  * David MacKenzie . Some algorithms adapted from GNU Emacs.
  *
- * $OpenBSD: backupfile.c,v 1.19 2006/03/11 19:41:30 otto Exp $
- * $DragonFly: src/usr.bin/patch/backupfile.c,v 1.5 2008/08/11 00:05:06 joerg 
Exp $
+ * $OpenBSD: backupfile.c,v 1.20 2009/10/27 23:59:41 deraadt Exp $
+ * $FreeBSD$
  */
 
 #include 

Modified: head/usr.bin/patch/backupfile.h
==
--- head/usr.bin/patch/backupfile.h Tue Jan 29 20:01:47 2013
(r246090)
+++ head/usr.bin/patch/backupfile.h Tue Jan 29 20:05:16 2013
(r246091)
@@ -1,6 +1,4 @@
-/* $FreeBSD$ */
 /*-
- * backupfile.h -- declarations for making Emacs style backup file names
  * Copyright (C) 1990 Free Software Foundation, Inc.
  * 
  * This program is free software; you can redistribute it and/or modify it
@@ -9,9 +7,11 @@
  * This program is distributed in the hope that it will be useful, but WITHOUT
  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  * FITNESS FOR A PARTICULAR PURPOSE.
- * 
+ *
+ * backupfile.h -- declarations for making Emacs style backup file names
+ *
  * $OpenBSD: backupfile.h,v 1.6 2003/07/28 18:35:36 otto Exp $
- * $DragonFly: src/usr.bin/patch/backupfile.h,v 1.3 2007/09/29 23:11:10 
swildner Exp $
+ * $FreeBSD$
  */
 
 /* When to make backup files. */

Modified: head/usr.bin/patch/common.h
==
--- head/usr.bin/patch/common.h Tue Jan 29 20:01:47 2013(r246090)
+++ head/usr.bin/patch/common.h Tue Jan 29 20:05:16 2013(r246091)
@@ -1,6 +1,4 @@
-/* $FreeBSD$ */
 /*-
- * 
  * Copyright 1986, Larry Wall
  * 
  * Redistribution and use in source and binary forms, with or without
@@ -26,7 +24,7 @@
  * behaviour
  *
  * $OpenBSD: common.h,v 1.26 2006/03/11 19:41:30 otto Exp $
- * $DragonFly: src/usr.bin/patch/common.h,v 1.5 2008/08/10 23:50:12 joerg Exp $
+ * $FreeBSD$
  */
 
 #include 

Modified: head/usr.bin/patch/inp.c
==
--- head/usr.bin/patch/inp.cTue Jan 29 20:01:47 2013(r246090)
+++ head/usr.bin/patch/inp.cTue Jan 29 20:05:16 2013(r246091)
@@ -1,6 +1,4 @@
-/* $FreeBSD$ */
 /*-
- * 
  * Copyright 1986, Larry Wall
  * 
  * Redistribution and use in source and binary forms, with or without
@@ -25,7 +23,8 @@
  * -C option added in 1998, original code by Marc Espie, based on FreeBSD
  * behaviour
  *
- * $OpenBSD: inp.c,v 1.34 2006/03/11 19:41:30 otto Exp $
+ * $OpenBSD: inp.c,v 1.36 2012/04/10 14:46:34 ajacoutot Exp $
+ * $FreeBSD$
  */
 
 #include 

Modified: head/usr.bin/patch/inp.h
==
--- head/usr.bin/patch/inp.hTue Jan 29 20:01:47 2013(r246090)
+++ head/usr.bin/patch/inp.hTue Jan 29 20:05:16 2013(r246091)
@@ -1,12 +1,4 @@
-/*
- * $FreeBSD$
- * $OpenBSD: inp.h,v 1.8 2003/08/15 08:00:51 otto Exp $
- * $DragonFly: src/usr.bin/patch/inp.h,v 1.1 2004/09/24 18:44:28 joerg Exp $
- */
-
-/*
- * patch - a program to apply diffs to original files
- * 
+/*-
  * Copyright 1986

svn commit: r246092 - head

2013-01-29 Thread Brooks Davis
Author: brooks
Date: Tue Jan 29 20:28:11 2013
New Revision: 246092
URL: http://svnweb.freebsd.org/changeset/base/246092

Log:
  Fix installworld when the host does not need to bootstrap nmtree.
  
  Reported by:  lev, jmg

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Jan 29 20:05:16 2013(r246091)
+++ head/Makefile.inc1  Tue Jan 29 20:28:11 2013(r246092)
@@ -673,7 +673,7 @@ _zoneinfo=  zic tzsetup
 
 ITOOLS=[ awk cap_mkdb cat chflags chmod chown \
date echo egrep find grep id install ${_install-info} \
-   ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
+   ln lockf make mkdir mtree mv nmtree pwd_mkdb rm sed sh sysctl \
test true uname wc ${_zoneinfo}
 
 #
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r246085 - in head/sys: amd64/linux32 compat/linprocfs compat/linux i386/linux

2013-01-29 Thread John Baldwin
On Tuesday, January 29, 2013 1:41:30 pm John Baldwin wrote:
> Author: jhb
> Date: Tue Jan 29 18:41:30 2013
> New Revision: 246085
> URL: http://svnweb.freebsd.org/changeset/base/246085
> 
> Log:
>   Reduce duplication between i386/linux/linux.h and amd64/linux32/linux.h
>   by moving bits that are MI out into headers in compat/linux.
>   
>   Reviewed by:Chagin Dmitry  dmitry | gmail
>   MFC after:  2 weeks

Should be 'Reviewed by: dchagin', sorry. :(

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


svn commit: r246093 - head/sys/dev/cxgbe

2013-01-29 Thread Navdeep Parhar
Author: np
Date: Tue Jan 29 20:59:22 2013
New Revision: 246093
URL: http://svnweb.freebsd.org/changeset/base/246093

Log:
  Provide a statistic to track the number of drops in each of the port's
  txq's buf_ring.  The aggregate for all the queues of a port is already
  provided in ifnet->if_snd.ifq_drops.
  
  MFC after:3 days.

Modified:
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cTue Jan 29 20:28:11 2013
(r246092)
+++ head/sys/dev/cxgbe/t4_main.cTue Jan 29 20:59:22 2013
(r246093)
@@ -5533,6 +5533,7 @@ t4_ioctl(struct cdev *dev, unsigned long
txq->txpkt_wrs = 0;
txq->txpkts_wrs = 0;
txq->txpkts_pkts = 0;
+   txq->br->br_drops = 0;
txq->no_dmamap = 0;
txq->no_desc = 0;
}

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Tue Jan 29 20:28:11 2013(r246092)
+++ head/sys/dev/cxgbe/t4_sge.c Tue Jan 29 20:59:22 2013(r246093)
@@ -2362,6 +2362,8 @@ alloc_txq(struct port_info *pi, struct s
SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "txpkts_pkts", 
CTLFLAG_RD,
&txq->txpkts_pkts, "# of frames tx'd using txpkts work requests");
 
+   SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "br_drops", CTLFLAG_RD,
+   &txq->br->br_drops, "# of drops in the buf_ring for this queue");
SYSCTL_ADD_UINT(&pi->ctx, children, OID_AUTO, "no_dmamap", CTLFLAG_RD,
&txq->no_dmamap, 0, "# of times txq ran out of DMA maps");
SYSCTL_ADD_UINT(&pi->ctx, children, OID_AUTO, "no_desc", CTLFLAG_RD,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r246094 - head/lib/libstand

2013-01-29 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 29 21:37:56 2013
New Revision: 246094
URL: http://svnweb.freebsd.org/changeset/base/246094

Log:
  Remove unused file.

Deleted:
  head/lib/libstand/if_ether.h
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r246095 - head/sys/net

2013-01-29 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 29 21:44:22 2013
New Revision: 246095
URL: http://svnweb.freebsd.org/changeset/base/246095

Log:
  route_output() always supplies info with RTAX_GATEWAY member that
  points to a sockaddr of AF_LINK family. Assert this instead of
  checking.

Modified:
  head/sys/net/if_llatbl.c

Modified: head/sys/net/if_llatbl.c
==
--- head/sys/net/if_llatbl.cTue Jan 29 21:37:56 2013(r246094)
+++ head/sys/net/if_llatbl.cTue Jan 29 21:44:22 2013(r246095)
@@ -273,10 +273,9 @@ lla_rt_output(struct rt_msghdr *rtm, str
u_int laflags = 0, flags = 0;
int error = 0;
 
-   if (dl == NULL || dl->sdl_family != AF_LINK) {
-   log(LOG_INFO, "%s: invalid dl\n", __func__);
-   return EINVAL;
-   }
+   KASSERT(dl != NULL && dl->sdl_family == AF_LINK,
+   ("%s: invalid dl\n", __func__));
+
ifp = ifnet_byindex(dl->sdl_index);
if (ifp == NULL) {
log(LOG_INFO, "%s: invalid ifp (sdl_index %d)\n",
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r246096 - head

2013-01-29 Thread Brooks Davis
Author: brooks
Date: Tue Jan 29 21:48:10 2013
New Revision: 246096
URL: http://svnweb.freebsd.org/changeset/base/246096

Log:
  Fix installworld when nmtree is not on the host by only adding it to
  ITOOLS when we will be using the host copy.
  
  Fix installkernel when -DNO_ROOT is set.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Jan 29 21:44:22 2013(r246095)
+++ head/Makefile.inc1  Tue Jan 29 21:48:10 2013(r246096)
@@ -673,8 +673,8 @@ _zoneinfo=  zic tzsetup
 
 ITOOLS=[ awk cap_mkdb cat chflags chmod chown \
date echo egrep find grep id install ${_install-info} \
-   ln lockf make mkdir mtree mv nmtree pwd_mkdb rm sed sh sysctl \
-   test true uname wc ${_zoneinfo}
+   ln lockf make mkdir mtree ${_nmtree_itools} mv pwd_mkdb \
+   rm sed sh sysctl test true uname wc ${_zoneinfo}
 
 #
 # distributeworld
@@ -964,7 +964,7 @@ reinstallkernel reinstallkernel.debug: i
@echo "--"
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
${CROSSENV} PATH=${TMPPATH} \
-   ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
+   ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} 
${.TARGET:S/kernel//}
 
 distributekernel distributekernel.debug:
 .if empty(INSTALLKERNEL)
@@ -1132,6 +1132,8 @@ _yacc=usr.bin/yacc
 .if ${BOOTSTRAPPING} < 126
 _nmtree=   lib/libnetbsd \
usr.sbin/nmtree
+.else
+_nmtree_itools=nmtree
 .endif
 
 .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r246097 - in head: . etc

2013-01-29 Thread Brooks Davis
Author: brooks
Date: Tue Jan 29 22:17:58 2013
New Revision: 246097
URL: http://svnweb.freebsd.org/changeset/base/246097

Log:
  Log the addition of login.conf.db, passwd, pwd.db, and spwd.db via cat -l.
  
  Make cat a bootstrap tool to facilitate this.

Modified:
  head/Makefile.inc1
  head/etc/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Jan 29 21:48:10 2013(r246096)
+++ head/Makefile.inc1  Tue Jan 29 22:17:58 2013(r246097)
@@ -185,7 +185,7 @@ OBJTREE=${MAKEOBJDIRPREFIX}/${TARGET}.$
 .endif
 WORLDTMP=  ${OBJTREE}${.CURDIR}/tmp
 # /usr/games added for fortune which depend on strfile
-BPATH= 
${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games
+BPATH= 
${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games:${WORLDTMP}/legacy/bin
 XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
 STRICTTMPPATH= ${BPATH}:${XPATH}
 TMPPATH=   ${STRICTTMPPATH}:${PATH}
@@ -412,7 +412,7 @@ _worldtmp:
rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
 .endif
 .for _dir in \
-lib usr legacy/usr
+lib usr legacy/bin legacy/usr
mkdir -p ${WORLDTMP}/${_dir}
 .endfor
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
@@ -1136,6 +1136,10 @@ _nmtree= lib/libnetbsd \
 _nmtree_itools=nmtree
 .endif
 
+.if ${BOOTSTRAPPING} < 127
+_cat=  bin/cat
+.endif
+
 .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041
 _awk=  usr.bin/awk
 .endif
@@ -1191,6 +1195,7 @@ bootstrap-tools:
 ${_ar} \
 ${_dtc} \
 ${_awk} \
+${_cat} \
 usr.bin/lorder \
 usr.bin/makewhatis \
 ${_mklocale} \

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Tue Jan 29 21:48:10 2013(r246096)
+++ head/etc/Makefile   Tue Jan 29 22:17:58 2013(r246097)
@@ -180,6 +180,10 @@ CAP_MKDB_ENDIAN?=
 PWD_MKDB_ENDIAN?=
 .endif
 
+.if defined(NO_ROOT)
+METALOG.add?=  cat -l >> ${METALOG}
+.endif
+
 distribution:
 .if !defined(DESTDIR)
@echo "set DESTDIR before running \"make ${.TARGET}\""
@@ -201,6 +205,14 @@ distribution:
 .endif
pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
${DESTDIR}/etc/master.passwd
+.if defined(NO_ROOT)
+   ( \
+   echo "./etc/login.conf.db type=file mode=0644 uname=root 
gname=wheel"; \
+   echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; 
\
+   echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; 
\
+   echo "./etc/spwd.db type=file mode=0600 uname=root 
gname=wheel"; \
+   ) | ${METALOG.add}
+.endif
 .if ${MK_ATF} != "no"
${_+_}cd ${.CURDIR}/atf; ${MAKE} install
 .endif
@@ -336,9 +348,9 @@ distrib-dirs:
test "$$d" == "/" && d=""; \
d=${DISTBASE}$$d; \
shift; \
-   ${ECHO} "${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# >>" \
-   "${METALOG}" ; \
-   ${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# >> ${METALOG} ; \
+   ${ECHO} "${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# |" \
+   "${METALOG.add}" ; \
+   ${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# | ${METALOG.add} ; \
done; true
 .endif
${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r246106 - head/libexec/tftpd

2013-01-29 Thread Sean Bruno
Author: sbruno
Date: Wed Jan 30 01:36:04 2013
New Revision: 246106
URL: http://svnweb.freebsd.org/changeset/base/246106

Log:
  Remove extra %s from debug statement that ends up crashing tftpd if
  debug is set very high (like -d15 in my case).
  
  Obtained from:Yahoo! Inc
  MFC after:  2 weeks

Modified:
  head/libexec/tftpd/tftp-io.c

Modified: head/libexec/tftpd/tftp-io.c
==
--- head/libexec/tftpd/tftp-io.cWed Jan 30 01:30:06 2013
(r246105)
+++ head/libexec/tftpd/tftp-io.cWed Jan 30 01:36:04 2013
(r246106)
@@ -142,7 +142,7 @@ send_error(int peer, int error)
char buf[MAXPKTSIZE];
 
if (debug&DEBUG_PACKETS)
-   tftp_log(LOG_DEBUG, "Sending ERROR %d: %s", error);
+   tftp_log(LOG_DEBUG, "Sending ERROR %d", error);
 
DROPPACKET("send_error");
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r246108 - in head/sys/amd64: include vmm

2013-01-29 Thread Neel Natu
Author: neel
Date: Wed Jan 30 04:09:09 2013
New Revision: 246108
URL: http://svnweb.freebsd.org/changeset/base/246108

Log:
  Add emulation support for instruction "88/r: mov r/m8, r8".
  
  This instruction moves a byte from a register to a memory location.
  
  Tested by: tycho nightingale at pluribusnetworks com

Modified:
  head/sys/amd64/include/vmm_instruction_emul.h
  head/sys/amd64/vmm/vmm_instruction_emul.c

Modified: head/sys/amd64/include/vmm_instruction_emul.h
==
--- head/sys/amd64/include/vmm_instruction_emul.h   Wed Jan 30 01:43:00 
2013(r246107)
+++ head/sys/amd64/include/vmm_instruction_emul.h   Wed Jan 30 04:09:09 
2013(r246108)
@@ -49,7 +49,8 @@ struct vie {
uint8_t rex_w:1,/* REX prefix */
rex_r:1,
rex_x:1,
-   rex_b:1;
+   rex_b:1,
+   rex_present:1;
 
uint8_t mod:2,  /* ModRM byte */
reg:4,

Modified: head/sys/amd64/vmm/vmm_instruction_emul.c
==
--- head/sys/amd64/vmm/vmm_instruction_emul.c   Wed Jan 30 01:43:00 2013
(r246107)
+++ head/sys/amd64/vmm/vmm_instruction_emul.c   Wed Jan 30 04:09:09 2013
(r246108)
@@ -65,6 +65,10 @@ enum {
 #defineVIE_OP_F_IMM8   (1 << 1)/* 8-bit immediate 
operand */
 
 static const struct vie_op one_byte_opcodes[256] = {
+   [0x88] = {
+   .op_byte = 0x88,
+   .op_type = VIE_OP_TYPE_MOV,
+   },
[0x89] = {
.op_byte = 0x89,
.op_type = VIE_OP_TYPE_MOV,
@@ -161,6 +165,46 @@ vie_read_register(void *vm, int vcpuid, 
 }
 
 static int
+vie_read_bytereg(void *vm, int vcpuid, struct vie *vie, uint8_t *rval)
+{
+   uint64_t val;
+   int error, rshift;
+   enum vm_reg_name reg;
+
+   rshift = 0;
+   reg = gpr_map[vie->reg];
+
+   /*
+* 64-bit mode imposes limitations on accessing legacy byte registers.
+*
+* The legacy high-byte registers cannot be addressed if the REX
+* prefix is present. In this case the values 4, 5, 6 and 7 of the
+* 'ModRM:reg' field address %spl, %bpl, %sil and %dil respectively.
+*
+* If the REX prefix is not present then the values 4, 5, 6 and 7
+* of the 'ModRM:reg' field address the legacy high-byte registers,
+* %ah, %ch, %dh and %bh respectively.
+*/
+   if (!vie->rex_present) {
+   if (vie->reg & 0x4) {
+   /*
+* Obtain the value of %ah by reading %rax and shifting
+* right by 8 bits (same for %bh, %ch and %dh).
+*/
+   rshift = 8;
+   reg = gpr_map[vie->reg & 0x3];
+   }
+   }
+
+   if (!vie_valid_register(reg))
+   return (EINVAL);
+
+   error = vm_get_register(vm, vcpuid, reg, &val);
+   *rval = val >> rshift;
+   return (error);
+}
+
+static int
 vie_update_register(void *vm, int vcpuid, enum vm_reg_name reg,
uint64_t val, int size)
 {
@@ -209,12 +253,24 @@ emulate_mov(void *vm, int vcpuid, uint64
 {
int error, size;
enum vm_reg_name reg;
+   uint8_t byte;
uint64_t val;
 
size = 4;
error = EINVAL;
 
switch (vie->op.op_byte) {
+   case 0x88:
+   /*
+* MOV byte from reg (ModRM:reg) to mem (ModRM:r/m)
+* 88/r:mov r/m8, r8
+* REX + 88/r:  mov r/m8, r8 (%ah, %ch, %dh, %bh not available)
+*/
+   size = 1;
+   error = vie_read_bytereg(vm, vcpuid, vie, &byte);
+   if (error == 0)
+   error = memwrite(vm, vcpuid, gpa, byte, size, arg);
+   break;
case 0x89:
/*
 * MOV from reg (ModRM:reg) to mem (ModRM:r/m)
@@ -497,6 +553,8 @@ decode_rex(struct vie *vie)
return (-1);
 
if (x >= 0x40 && x <= 0x4F) {
+   vie->rex_present = 1;
+
vie->rex_w = x & 0x8 ? 1 : 0;
vie->rex_r = x & 0x4 ? 1 : 0;
vie->rex_x = x & 0x2 ? 1 : 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r246109 - head/usr.sbin/bhyve

2013-01-29 Thread Neel Natu
Author: neel
Date: Wed Jan 30 04:30:36 2013
New Revision: 246109
URL: http://svnweb.freebsd.org/changeset/base/246109

Log:
  Add support for MSI-X interrupts in the virtio network device and make that
  the default.
  
  The current behavior of advertising a single MSI vector can be requested by
  setting the environment variable "BHYVE_USE_MSI" to "true". The use of MSI
  is not compliant with the virtio specification and will be eventually phased
  out.
  
  Submitted by: Gopakumar T
  Obtained from:NetApp

Modified:
  head/usr.sbin/bhyve/pci_emul.c
  head/usr.sbin/bhyve/pci_emul.h
  head/usr.sbin/bhyve/pci_virtio_net.c
  head/usr.sbin/bhyve/virtio.h

Modified: head/usr.sbin/bhyve/pci_emul.c
==
--- head/usr.sbin/bhyve/pci_emul.c  Wed Jan 30 04:09:09 2013
(r246108)
+++ head/usr.sbin/bhyve/pci_emul.c  Wed Jan 30 04:30:36 2013
(r246109)
@@ -167,6 +167,94 @@ pci_parse_slot(char *opt, int legacy)
 }
 
 static int
+pci_valid_pba_offset(struct pci_devinst *pi, uint64_t offset)
+{
+
+   if (offset < pi->pi_msix.pba_offset)
+   return (0);
+
+   if (offset >= pi->pi_msix.pba_offset + pi->pi_msix.pba_size) {
+   return (0);
+   }
+
+   return (1);
+}
+
+int
+pci_emul_msix_twrite(struct pci_devinst *pi, uint64_t offset, int size,
+uint64_t value)
+{
+   int msix_entry_offset;
+   int tab_index;
+   char *dest;
+
+   /* support only 4 or 8 byte writes */
+   if (size != 4 && size != 8)
+   return (-1);
+
+   /*
+* Return if table index is beyond what device supports
+*/
+   tab_index = offset / MSIX_TABLE_ENTRY_SIZE;
+   if (tab_index >= pi->pi_msix.table_count)
+   return (-1);
+
+   msix_entry_offset = offset % MSIX_TABLE_ENTRY_SIZE;
+
+   /* support only aligned writes */
+   if ((msix_entry_offset % size) != 0)
+   return (-1);
+
+   dest = (char *)(pi->pi_msix.table + tab_index);
+   dest += msix_entry_offset;
+
+   if (size == 4)
+   *((uint32_t *)dest) = value;
+   else
+   *((uint64_t *)dest) = value;
+
+   return (0);
+}
+
+uint64_t
+pci_emul_msix_tread(struct pci_devinst *pi, uint64_t offset, int size)
+{
+   char *dest;
+   int msix_entry_offset;
+   int tab_index;
+   uint64_t retval = ~0;
+
+   /* support only 4 or 8 byte reads */
+   if (size != 4 && size != 8)
+   return (retval);
+
+   msix_entry_offset = offset % MSIX_TABLE_ENTRY_SIZE;
+
+   /* support only aligned reads */
+   if ((msix_entry_offset % size) != 0) {
+   return (retval);
+   }
+
+   tab_index = offset / MSIX_TABLE_ENTRY_SIZE;
+
+   if (tab_index < pi->pi_msix.table_count) {
+   /* valid MSI-X Table access */
+   dest = (char *)(pi->pi_msix.table + tab_index);
+   dest += msix_entry_offset;
+
+   if (size == 4)
+   retval = *((uint32_t *)dest);
+   else
+   retval = *((uint64_t *)dest);
+   } else if (pci_valid_pba_offset(pi, offset)) {
+   /* return 0 for PBA access */
+   retval = 0;
+   }
+
+   return (retval);
+}
+
+static int
 pci_emul_io_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
uint32_t *eax, void *arg)
 {
@@ -178,8 +266,7 @@ pci_emul_io_handler(struct vmctx *ctx, i
for (i = 0; i <= PCI_BARMAX; i++) {
if (pdi->pi_bar[i].type == PCIBAR_IO &&
port >= pdi->pi_bar[i].addr &&
-   port + bytes <=
-   pdi->pi_bar[i].addr + pdi->pi_bar[i].size) {
+   port + bytes <= pdi->pi_bar[i].addr + pdi->pi_bar[i].size) {
offset = port - pdi->pi_bar[i].addr;
if (in)
*eax = (*pe->pe_barread)(ctx, vcpu, pdi, i,
@@ -484,13 +571,95 @@ pci_emul_add_msicap(struct pci_devinst *
return (pci_emul_add_capability(pi, (u_char *)&msicap, sizeof(msicap)));
 }
 
+static void
+pci_populate_msixcap(struct msixcap *msixcap, int msgnum, int barnum,
+uint32_t msix_tab_size, int nextptr)
+{
+   CTASSERT(sizeof(struct msixcap) == 12);
+
+   assert(msix_tab_size % 4096 == 0);
+
+   bzero(msixcap, sizeof(struct msixcap));
+   msixcap->capid = PCIY_MSIX;
+   msixcap->nextptr = nextptr;
+
+   /*
+* Message Control Register, all fields set to
+* zero except for the Table Size.
+* Note: Table size N is encoded as N-1
+*/
+   msixcap->msgctrl = msgnum - 1;
+
+   /*
+* MSI-X BAR setup:
+* - MSI-X table start at offset 0
+* - PBA table starts at a 4K aligned offset after the MSI-X table
+*/
+   msixcap->table_info = barnum & PCIM

svn commit: r246113 - head/sys/dev/usb/controller

2013-01-29 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Jan 30 07:48:43 2013
New Revision: 246113
URL: http://svnweb.freebsd.org/changeset/base/246113

Log:
  Add missing NULL pointer check.
  
  Reported by:  Lars Engels
  MFC after:1 week

Modified:
  head/sys/dev/usb/controller/xhci.c

Modified: head/sys/dev/usb/controller/xhci.c
==
--- head/sys/dev/usb/controller/xhci.c  Wed Jan 30 06:37:18 2013
(r246112)
+++ head/sys/dev/usb/controller/xhci.c  Wed Jan 30 07:48:43 2013
(r246113)
@@ -886,6 +886,12 @@ xhci_check_transfer(struct xhci_softc *s
 * a short packet also makes the transfer done
 */
if (td->remainder > 0) {
+   if (td->alt_next == NULL) {
+   DPRINTF("short TD has no "
+   "alternate next\n");
+   xhci_generic_done(xfer);
+   break;
+   }
DPRINTF("TD has short pkt\n");
if (xfer->flags_int.short_frames_ok ||
xfer->flags_int.isochronous_xfr ||
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"