svn commit: r235262 - head/sys/dev/re

2012-05-11 Thread Kevin Lo
Author: kevlo
Date: Fri May 11 07:12:18 2012
New Revision: 235262
URL: http://svn.freebsd.org/changeset/base/235262

Log:
  Make sure we don't dereference a null pointer

Modified:
  head/sys/dev/re/if_re.c

Modified: head/sys/dev/re/if_re.c
==
--- head/sys/dev/re/if_re.c Fri May 11 04:18:39 2012(r235261)
+++ head/sys/dev/re/if_re.c Fri May 11 07:12:18 2012(r235262)
@@ -1753,8 +1753,12 @@ re_detach(device_t dev)
bus_teardown_intr(dev, sc-rl_irq[0], sc-rl_intrhand[0]);
sc-rl_intrhand[0] = NULL;
}
-   if (ifp != NULL)
+   if (ifp != NULL) {
+#ifdef DEV_NETMAP
+   netmap_detach(ifp);
+#endif /* DEV_NETMAP */
if_free(ifp);
+   }
if ((sc-rl_flags  (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0)
rid = 0;
else
@@ -1843,9 +1847,6 @@ re_detach(device_t dev)
bus_dma_tag_destroy(sc-rl_ldata.rl_stag);
}
 
-#ifdef DEV_NETMAP
-   netmap_detach(ifp);
-#endif /* DEV_NETMAP */
if (sc-rl_parent_tag)
bus_dma_tag_destroy(sc-rl_parent_tag);
 
___
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: r235264 - in head/sys/boot/pc98: btx/btx btx/btxldr btx/lib cdboot loader

2012-05-11 Thread Andriy Gapon
Author: avg
Date: Fri May 11 09:46:17 2012
New Revision: 235264
URL: http://svn.freebsd.org/changeset/base/235264

Log:
  MFi386: improve argument passing via btxldr
  
  use related definitions in i386 bootargs.h
  
  Reviewed by:  nyan, jhb
  MFC after:1 month

Added:
  head/sys/boot/pc98/btx/lib/btxcsu.S
 - copied, changed from r235217, head/sys/boot/pc98/btx/lib/btxcsu.s
  head/sys/boot/pc98/cdboot/cdboot.S
 - copied, changed from r235152, head/sys/boot/pc98/cdboot/cdboot.s
Deleted:
  head/sys/boot/pc98/btx/lib/btxcsu.s
  head/sys/boot/pc98/cdboot/cdboot.s
Modified:
  head/sys/boot/pc98/btx/btx/Makefile
  head/sys/boot/pc98/btx/btx/btx.S
  head/sys/boot/pc98/btx/btxldr/Makefile
  head/sys/boot/pc98/btx/btxldr/btxldr.S
  head/sys/boot/pc98/btx/lib/Makefile
  head/sys/boot/pc98/cdboot/Makefile
  head/sys/boot/pc98/loader/main.c

Modified: head/sys/boot/pc98/btx/btx/Makefile
==
--- head/sys/boot/pc98/btx/btx/Makefile Fri May 11 09:34:39 2012
(r235263)
+++ head/sys/boot/pc98/btx/btx/Makefile Fri May 11 09:46:17 2012
(r235264)
@@ -12,6 +12,7 @@ BOOT_BTX_FLAGS=0x0
 .endif
 
 CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS}
+CFLAGS+=-I${.CURDIR}/../../../i386/common
 
 .if defined(BTX_SERIAL)
 BOOT_COMCONSOLE_PORT?= 0x238

Modified: head/sys/boot/pc98/btx/btx/btx.S
==
--- head/sys/boot/pc98/btx/btx/btx.SFri May 11 09:34:39 2012
(r235263)
+++ head/sys/boot/pc98/btx/btx/btx.SFri May 11 09:46:17 2012
(r235264)
@@ -15,6 +15,8 @@
  * $FreeBSD$
  */
 
+#include bootargs.h
+
 /*
  * Memory layout.
  */
@@ -205,7 +207,7 @@ init.8: xorl %ecx,%ecx  # Zero
andl $0x7,%eax
incl %eax
shll $0x11,%eax # To bytes
-   subl $0x1000,%eax   # Less arg space
+   subl $ARGSPACE,%eax # Less arg space
subl %edx,%eax  # Less base
movb $SEL_UDATA,%cl # User data selector
pushl %ecx  # Set SS

Modified: head/sys/boot/pc98/btx/btxldr/Makefile
==
--- head/sys/boot/pc98/btx/btxldr/Makefile  Fri May 11 09:34:39 2012
(r235263)
+++ head/sys/boot/pc98/btx/btxldr/Makefile  Fri May 11 09:46:17 2012
(r235264)
@@ -6,6 +6,7 @@ NO_MAN=
 SRCS=  btxldr.S
 
 CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRESS}
+CFLAGS+=-I${.CURDIR}/../../../i386/common
 
 .if defined(BTXLDR_VERBOSE)
 CFLAGS+=-DBTXLDR_VERBOSE

Modified: head/sys/boot/pc98/btx/btxldr/btxldr.S
==
--- head/sys/boot/pc98/btx/btxldr/btxldr.S  Fri May 11 09:34:39 2012
(r235263)
+++ head/sys/boot/pc98/btx/btxldr/btxldr.S  Fri May 11 09:46:17 2012
(r235264)
@@ -20,6 +20,8 @@
  * real thing should probably be more flexible, and in C.
  */
 
+#include bootargs.h
+
 /*
  * Memory locations.
  */
@@ -105,7 +107,7 @@ gdcwait.2:  inb $0x60,%al
call hexout #  stack
call putstr #  pointer
movl $m_args,%esi   # Format string
-   leal 0x4(%esp,1),%ebx   # First argument
+   leal 0x4(%esp),%ebx # First argument
movl $0x6,%ecx  # Count
 start.1:   movl (%ebx),%eax# Get argument and
addl $0x4,%ebx  #  bump pointer
@@ -113,24 +115,28 @@ start.1:  movl (%ebx),%eax# Get argumen
loop start.1# Till done
call putstr # End message
 #endif
-   movl $0x48,%ecx # Allocate space
-   subl %ecx,%ebp  #  for bootinfo
-   movl 0x18(%esp,1),%esi  # Source: bootinfo
+   movl BA_BOOTINFO+4(%esp),%esi   # Source: bootinfo
cmpl $0x0, %esi # If the bootinfo pointer
je start_null_bi#  is null, don't copy it
+   movl BI_SIZE(%esi),%ecx # Allocate space
+   subl %ecx,%ebp  #  for bootinfo
movl %ebp,%edi  # Destination
rep # Copy
movsb   #  it
-   movl %ebp,0x18(%esp,1)  # Update pointer
+   movl %ebp,BA_BOOTINFO+4(%esp)   # Update pointer
+   movl %edi,%ebp  # Restore base pointer
 #ifdef BTXLDR_VERBOSE
movl $m_rel_bi,%esi # Display
movl %ebp,%eax  #  bootinfo
call hexout   

svn commit: r235265 - head/share/man/man7

2012-05-11 Thread Ulrich Spoerlein
Author: uqs
Date: Fri May 11 10:13:34 2012
New Revision: 235265
URL: http://svn.freebsd.org/changeset/base/235265

Log:
  Stop lying about default UFS blocksizes.
  
  This catches up with the year-old change to default blocksizes. Also
  reduce the variants of spelling gigabyte from 3 down to 2 (GB and GiB).
  
  Suggested by: arundel (about a year ago now ...)

Modified:
  head/share/man/man7/tuning.7

Modified: head/share/man/man7/tuning.7
==
--- head/share/man/man7/tuning.7Fri May 11 09:46:17 2012
(r235264)
+++ head/share/man/man7/tuning.7Fri May 11 10:13:34 2012
(r235265)
@@ -23,7 +23,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd October 16, 2010
+.Dd May 11, 2012
 .Dt TUNING 7
 .Os
 .Sh NAME
@@ -148,15 +148,15 @@ If you do not use ports all that much an
 system source
 .Pq Pa /usr/src
 on the machine, you can get away with
-a 1 gigabyte
+a 1 GB
 .Pa /usr
 partition.
 However, if you install a lot of ports
 (especially window managers and Linux-emulated binaries), we recommend
-at least a 2 gigabyte
+at least a 2 GB
 .Pa /usr
 and if you also intend to keep system source
-on the machine, we recommend a 3 gigabyte
+on the machine, we recommend a 3 GB
 .Pa /usr .
 Do not underestimate the
 amount of space you will need in this partition, it can creep up and
@@ -218,22 +218,22 @@ and
 .Em cylinders/group .
 .Pp
 .Fx
-performs best when using 8K or 16K file system block sizes.
-The default file system block size is 16K,
+performs best when using 16K or 32K file system block sizes.
+The default file system block size is 32K,
 which provides best performance for most applications,
 with the exception of those that perform random access on large files
 (such as database server software).
 Such applications tend to perform better with a smaller block size,
 although modern disk characteristics are such that the performance
 gain from using a smaller block size may not be worth consideration.
-Using a block size larger than 16K
+Using a block size larger than 32K
 can cause fragmentation of the buffer cache and
 lead to lower performance.
 .Pp
 The defaults may be unsuitable
 for a file system that requires a very large number of i-nodes
 or is intended to hold a large number of very small files.
-Such a file system should be created with an 8K or 4K block size.
+Such a file system should be created with an 4K, 8K, or 16K block size.
 This also requires you to specify a smaller
 fragment size.
 We recommend always using a fragment size that is 1/8
@@ -256,13 +256,13 @@ Do not use this option
 unless you are actually storing large files on the partition, because if you
 overcompensate you can wind up with a file system that has lots of free
 space remaining but cannot accommodate any more files.
-Using 32768, 65536, or 262144 bytes/i-node is recommended.
+Using 65536, 131072, or 262144 bytes/i-node is recommended.
 You can go higher but
 it will have only incremental effects on
 .Xr fsck 8
 recovery times.
 For example,
-.Dq Li newfs -i 32768 ... .
+.Dq Li newfs -i 65536 ... .
 .Pp
 .Xr tunefs 8
 may be used to further tune a file system.
@@ -525,8 +525,8 @@ sysctl governs VFS read-ahead and is exp
 to pre-read if the heuristics algorithm decides that the reads are
 issued sequentially.
 It is used by the UFS, ext2fs and msdosfs file systems.
-With the default UFS block size of 16 KiB, a setting of 32 will allow
-speculatively reading up to 512 KiB.
+With the default UFS block size of 32 KiB, a setting of 64 will allow
+speculatively reading up to 2 MiB.
 This setting may be increased to get around disk I/O latencies, especially
 where these latencies are large such as in virtual machine emulated
 environments.
___
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: r235266 - head/lib/libc/stdlib

2012-05-11 Thread Konstantin Belousov
Author: kib
Date: Fri May 11 11:29:08 2012
New Revision: 235266
URL: http://svn.freebsd.org/changeset/base/235266

Log:
  According to SUSv4, realpath(3) must fail if
  [ENOENT]  A component of file_name does not name an existing file or
  file_name points to an empty string.
  [ENOTDIR] A component of the path prefix is not a directory, or the
  file_name argument contains at least one non- slash character
  and ends with one or more trailing slash characters and the last
  pathname component names an existing file that is neither a
  directory nor a symbolic link to a directory.
  Add checks for the listed conditions, and set errno accordingly.
  
  Update the realpath(3) manpage to mention SUS behaviour. Remove the
  requirement to include sys/param.h before stdlib.h.
  
  PR:   128933
  MFC after:  3 weeks

Modified:
  head/lib/libc/stdlib/realpath.3
  head/lib/libc/stdlib/realpath.c

Modified: head/lib/libc/stdlib/realpath.3
==
--- head/lib/libc/stdlib/realpath.3 Fri May 11 10:13:34 2012
(r235265)
+++ head/lib/libc/stdlib/realpath.3 Fri May 11 11:29:08 2012
(r235266)
@@ -31,7 +31,7 @@
 .\ @(#)realpath.3 8.2 (Berkeley) 2/16/94
 .\ $FreeBSD$
 .\
-.Dd April 19, 2010
+.Dd May 11, 2012
 .Dt REALPATH 3
 .Os
 .Sh NAME
@@ -40,7 +40,6 @@
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
-.In sys/param.h
 .In stdlib.h
 .Ft char *
 .Fn realpath const char *pathname char *resolved_path
@@ -72,11 +71,12 @@ The
 function will resolve both absolute and relative paths
 and return the absolute pathname corresponding to
 .Fa pathname .
-All but the last component of
+All components of
 .Fa pathname
 must exist when
 .Fn realpath
-is called.
+is called, and all but the last component must name either directories or
+symlinks pointing to the directories.
 .Sh RETURN VALUES
 The
 .Fn realpath

Modified: head/lib/libc/stdlib/realpath.c
==
--- head/lib/libc/stdlib/realpath.c Fri May 11 10:13:34 2012
(r235265)
+++ head/lib/libc/stdlib/realpath.c Fri May 11 11:29:08 2012
(r235266)
@@ -132,8 +132,29 @@ realpath(const char * __restrict path, c
resolved[resolved_len++] = '/';
resolved[resolved_len] = '\0';
}
-   if (next_token[0] == '\0')
+   if (next_token[0] == '\0') {
+   /*
+* Handle consequential slashes.  The path
+* before slash shall point to a directory.
+*
+* Only the trailing slashes are not covered
+* by other checks in the loop, but we verify
+* the prefix for any (rare) // or /\0
+* occurence to not implement lookahead.
+*/
+   if (lstat(resolved, sb) != 0) {
+   if (m)
+   free(resolved);
+   return (NULL);
+   }
+   if (!S_ISDIR(sb.st_mode)) {
+   if (m)
+   free(resolved);
+   errno = ENOTDIR;
+   return (NULL);
+   }
continue;
+   }
else if (strcmp(next_token, .) == 0)
continue;
else if (strcmp(next_token, ..) == 0) {
@@ -151,9 +172,7 @@ realpath(const char * __restrict path, c
}
 
/*
-* Append the next path component and lstat() it. If
-* lstat() fails we still can return successfully if
-* there are no more path components left.
+* Append the next path component and lstat() it.
 */
resolved_len = strlcat(resolved, next_token, PATH_MAX);
if (resolved_len = PATH_MAX) {
@@ -163,10 +182,8 @@ realpath(const char * __restrict path, c
return (NULL);
}
if (lstat(resolved, sb) != 0) {
-   if (errno == ENOENT  p == NULL) {
-   errno = serrno;
-   return (resolved);
-   }
+   if (errno != ENOENT || p != NULL)
+   errno = ENOTDIR;
if (m)
free(resolved);
return (NULL);
___
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: r235267 - in head/usr.bin/sort: . nls

2012-05-11 Thread Gabor Kovesdan
Author: gabor
Date: Fri May 11 12:37:16 2012
New Revision: 235267
URL: http://svn.freebsd.org/changeset/base/235267

Log:
  Add a BSD-licensed sort rewrite that was started by me and later completed
  with the major functionality and optimizations by Oleg Moskalenko.
  It is compatible with the latest version of POSIX and the current GNU sort
  version that we have in base.  Beside this, it implements all the
  functionality introduced in later versions of GNU sort.  For now, it will
  be installed as bsdsort, keeping GNU sort as the default sort
  implementation.

Added:
  head/usr.bin/sort/
  head/usr.bin/sort/Makefile   (contents, props changed)
  head/usr.bin/sort/bwstring.c   (contents, props changed)
  head/usr.bin/sort/bwstring.h   (contents, props changed)
  head/usr.bin/sort/coll.c   (contents, props changed)
  head/usr.bin/sort/coll.h   (contents, props changed)
  head/usr.bin/sort/file.c   (contents, props changed)
  head/usr.bin/sort/file.h   (contents, props changed)
  head/usr.bin/sort/mem.c   (contents, props changed)
  head/usr.bin/sort/mem.h   (contents, props changed)
  head/usr.bin/sort/nls/
  head/usr.bin/sort/nls/C.msg   (contents, props changed)
  head/usr.bin/sort/nls/hu_HU.ISO8859-2.msg   (contents, props changed)
  head/usr.bin/sort/radixsort.c   (contents, props changed)
  head/usr.bin/sort/radixsort.h   (contents, props changed)
  head/usr.bin/sort/sort.1.in   (contents, props changed)
  head/usr.bin/sort/sort.c   (contents, props changed)
  head/usr.bin/sort/sort.h   (contents, props changed)
  head/usr.bin/sort/vsort.c   (contents, props changed)
  head/usr.bin/sort/vsort.h   (contents, props changed)

Added: head/usr.bin/sort/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/sort/Makefile  Fri May 11 12:37:16 2012(r235267)
@@ -0,0 +1,45 @@
+# $FreeBSD$
+
+.include bsd.own.mk
+
+.if ${MK_BSD_SORT} == yes
+PROG=  sort
+.else
+PROG=  bsdsort
+CLEANFILES+= bsdsort.1
+
+bsdsort.1: sort.1
+   cp ${.ALLSRC} ${.TARGET}
+.endif
+
+SRCS=  bwstring.c coll.c file.c mem.c radixsort.c sort.c vsort.c
+
+WARNS= 6
+
+sort.1: sort.1.in
+   /usr/bin/sed ${MAN_SUB} ${.ALLSRC} ${.TARGET}
+
+CLEANFILES+= sort.1
+
+.if !defined(WITHOUT_THREADS)
+CFLAGS+= -DSORT_THREADS
+LDFLAGS+= -lpthread -lmd
+MAN_SUB+= -e 's|%%THREADS%%||g'
+.else
+LDFLAGS+= -lmd
+MAN_SUB+= -e 's|%%THREADS%%|\.\\|g'
+.endif
+
+.if !defined(WITHOUT_NLS)
+NLS+=  hu_HU.ISO8859-2
+NLSSRCFILES= ${NLS:S@$@.msg@}
+MAN_SUB+= -e 's|%%NLS%%||g'
+.for lang in ${NLS}
+NLSSRCDIR_${lang}= ${.CURDIR}/nls
+.endfor
+.else
+CFLAGS+= -DWITHOUT_NLS
+MAN_SUB+= -e 's|%%THREADS%%|\.\\|g'
+.endif
+
+.include bsd.prog.mk

Added: head/usr.bin/sort/bwstring.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/sort/bwstring.cFri May 11 12:37:16 2012
(r235267)
@@ -0,0 +1,1138 @@
+/*-
+ * Copyright (C) 2009 Gabor Kovesdan ga...@freebsd.org
+ * Copyright (C) 2012 Oleg Moskalenko oleg.moskale...@citrix.com
+ * 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 THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include ctype.h
+#include errno.h
+#include err.h
+#include langinfo.h
+#include math.h
+#include stdlib.h
+#include string.h
+#include wchar.h
+#include wctype.h
+
+#include bwstring.h
+#include sort.h
+
+bool byte_sort = false;
+
+static wchar_t **wmonths = NULL;
+static unsigned char **cmonths = NULL;
+
+/* initialise months */
+
+void
+initialise_months(void)
+{
+   const nl_item item[12] = { ABMON_1, ABMON_2, ABMON_3, 

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

2012-05-11 Thread Gabor Kovesdan
Author: gabor
Date: Fri May 11 12:47:21 2012
New Revision: 235268
URL: http://svn.freebsd.org/changeset/base/235268

Log:
  - Hook up BSD sort to the build.  By default, it will be installed as
bsdsort and GNU sort will be the default sort.  When WITH_BSD_SORT
is set, BSD sort will be the default sort and GNU sort will be installed
as gnusort.

Added:
  head/tools/build/options/WITH_BSD_SORT   (contents, props changed)
Modified:
  head/gnu/usr.bin/sort/Makefile
  head/share/mk/bsd.own.mk
  head/usr.bin/Makefile

Modified: head/gnu/usr.bin/sort/Makefile
==
--- head/gnu/usr.bin/sort/Makefile  Fri May 11 12:37:16 2012
(r235267)
+++ head/gnu/usr.bin/sort/Makefile  Fri May 11 12:47:21 2012
(r235268)
@@ -3,7 +3,18 @@
 SORTDIR= ${.CURDIR}/../../../contrib/gnu-sort
 .PATH: ${SORTDIR}/lib ${SORTDIR}/src ${SORTDIR}/man
 
+.include bsd.own.mk
+
+.if ${MK_BSD_SORT} != yes
 PROG=  sort
+.else
+PROG=  gnusort
+
+CLEANFILES+= gnusort.1
+gnusort.1: sort.1
+   cp ${.ALLSRC} ${.TARGET}
+.endif
+
 SRCS=   sort.c \
__fpending.c \
argmatch.c \

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkFri May 11 12:37:16 2012(r235267)
+++ head/share/mk/bsd.own.mkFri May 11 12:47:21 2012(r235268)
@@ -413,6 +413,7 @@ __DEFAULT_YES_OPTIONS = \
 
 __DEFAULT_NO_OPTIONS = \
 BSD_GREP \
+BSD_SORT \
 BIND_IDN \
 BIND_LARGE_FILE \
 BIND_LIBS \

Added: head/tools/build/options/WITH_BSD_SORT
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITH_BSD_SORT  Fri May 11 12:47:21 2012
(r235268)
@@ -0,0 +1,2 @@
+.\ $FreeBSD$
+Install BSD-licensed sort as 'sort' instead of GNU sort.

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Fri May 11 12:37:16 2012(r235267)
+++ head/usr.bin/Makefile   Fri May 11 12:47:21 2012(r235268)
@@ -141,6 +141,7 @@ SUBDIR= alias \
shar \
showmount \
sockstat \
+   sort \
split \
stat \
stdbuf \
___
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: r235267 - in head/usr.bin/sort: . nls

2012-05-11 Thread Konstantin Belousov
On Fri, May 11, 2012 at 12:37:16PM +, Gabor Kovesdan wrote:
 Author: gabor
 Date: Fri May 11 12:37:16 2012
 New Revision: 235267
 URL: http://svn.freebsd.org/changeset/base/235267

 +bool byte_sort = false;
 +
 +static wchar_t **wmonths = NULL;
 +static unsigned char **cmonths = NULL;

Such initializations are useless. You only increase the size of the binary
on the disk as the consequence.


pgp8tPZnUT7G9.pgp
Description: PGP signature


Re: svn commit: r235267 - in head/usr.bin/sort: . nls

2012-05-11 Thread David Chisnall
On 11 May 2012, at 08:48, Konstantin Belousov wrote:

 On Fri, May 11, 2012 at 12:37:16PM +, Gabor Kovesdan wrote:
 Author: gabor
 Date: Fri May 11 12:37:16 2012
 New Revision: 235267
 URL: http://svn.freebsd.org/changeset/base/235267
 
 +bool byte_sort = false;
 +
 +static wchar_t **wmonths = NULL;
 +static unsigned char **cmonths = NULL;
 
 Such initializations are useless. You only increase the size of the binary
 on the disk as the consequence.

Really?  The C specification requires all globals and statics that are not 
explicitly initialised to be set to their zero value, so this initialisation 
has no effect on the resulting binary[1].  These are placed in the BSS section, 
irrespective of whether the initialisation is implicit or explicit and the 
loader is responsible for allocating space for them - all that is stored in the 
binary is the size.

For local variables, initialisation like this has no effect even at low 
optimisation levels - dead stores will be removed.  It does, however, make it 
more difficult for the compiler to distinguish between initialised and 
initialised sensibly in some cases.

David

[1] In a standards-compliant compiler.  Apparently a few shipping compilers for 
embedded systems fail to respect this, but everything FreeBSD is compiled with 
does.___
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: r235267 - in head/usr.bin/sort: . nls

2012-05-11 Thread Colin Percival
On 05/11/12 05:48, Konstantin Belousov wrote:
 On Fri, May 11, 2012 at 12:37:16PM +, Gabor Kovesdan wrote:
 +bool byte_sort = false; + +static wchar_t **wmonths = NULL; +static
 unsigned char **cmonths = NULL;
 
 Such initializations are useless. You only increase the size of the binary 
 on the disk as the consequence.

I just tested this hypothesis, and found no change in binary size using
either clang or gcc46.  Presumably they're smart enough to ignore explicit
(and unnecessary) initializations of statics to zero.

-- 
Colin Percival
Security Officer, FreeBSD | freebsd.org | The power to serve
Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid
___
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: r235269 - head/share/man/man5

2012-05-11 Thread Gabor Kovesdan
Author: gabor
Date: Fri May 11 13:03:52 2012
New Revision: 235269
URL: http://svn.freebsd.org/changeset/base/235269

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  Fri May 11 12:47:21 2012
(r235268)
+++ head/share/man/man5/src.conf.5  Fri May 11 13:03:52 2012
(r235269)
@@ -1,7 +1,7 @@
 .\ DO NOT EDIT-- this file is automatically generated.
 .\ from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z 
ru
 .\ $FreeBSD$
-.Dd April 29, 2012
+.Dd May 11, 2012
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -227,6 +227,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_SORT
+.\ from FreeBSD: head/tools/build/options/WITH_BSD_SORT 235268 2012-05-11 
12:47:21Z gabor
+Install BSD-licensed sort as 'sort' instead of GNU sort.
 .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
@@ -270,7 +273,7 @@ When set, it also enforces the following
 Set to not build the Clang C/C++ compiler.
 .Pp
 It is a default setting on
-arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, 
mips/mips64, mips/mipsn32, powerpc/powerpc and sparc64/sparc64.
+arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, 
mips/mips64, mips/mipsn32 and sparc64/sparc64.
 When set, it also enforces the following options:
 .Pp
 .Bl -item -compact
@@ -284,7 +287,7 @@ When set, it also enforces the following
 Set to build the Clang C/C++ compiler.
 .Pp
 It is a default setting on
-amd64/amd64, i386/i386, pc98/i386 and powerpc/powerpc64.
+amd64/amd64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64.
 .It Va WITH_CLANG_EXTRAS
 .\ from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 
23:56:22Z dim
 Set to build additional clang and llvm tools, such as bugpoint.
___
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: r235267 - in head/usr.bin/sort: . nls

2012-05-11 Thread Gabor Kovesdan

On 2012.05.11. 15:02, Colin Percival wrote:

On 05/11/12 05:48, Konstantin Belousov wrote:

On Fri, May 11, 2012 at 12:37:16PM +, Gabor Kovesdan wrote:

+bool byte_sort = false; + +static wchar_t **wmonths = NULL; +static
unsigned char **cmonths = NULL;


Such initializations are useless. You only increase the size of the binary
on the disk as the consequence.

I just tested this hypothesis, and found no change in binary size using
either clang or gcc46.  Presumably they're smart enough to ignore explicit
(and unnecessary) initializations of statics to zero.
Thanks Colin and thanks Konstantin for raising this doubt. I will clean 
these up later for better style, anyway.


Gabor

___
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: r235267 - in head/usr.bin/sort: . nls

2012-05-11 Thread Konstantin Belousov
On Fri, May 11, 2012 at 08:57:29AM -0400, David Chisnall wrote:
 On 11 May 2012, at 08:48, Konstantin Belousov wrote:
 
  On Fri, May 11, 2012 at 12:37:16PM +, Gabor Kovesdan wrote:
  Author: gabor
  Date: Fri May 11 12:37:16 2012
  New Revision: 235267
  URL: http://svn.freebsd.org/changeset/base/235267
  
  +bool byte_sort = false;
  +
  +static wchar_t **wmonths = NULL;
  +static unsigned char **cmonths = NULL;
  
  Such initializations are useless. You only increase the size of the binary
  on the disk as the consequence.
 
 Really? The C specification requires all globals and statics that
 are not explicitly initialised to be set to their zero value, so this
 initialisation has no effect on the resulting binary[1]. These are
 placed in the BSS section, irrespective of whether the initialisation is
 implicit or explicit and the loader is responsible for allocating space
 for them - all that is stored in the binary is the size.

The initialized variables are placed in .data and not .bss.
Apparently, some compilers do an optimiziation and put zero-initialized
objects into .bss, as Colin noted, but this is not guaranteed behaviour.
If placed in .data, they do consume disk space.

Redundand initialization is not encouraged by style as well.
 
 For local variables, initialisation like this has no effect even
 at low optimisation levels - dead stores will be removed. It does,
 however, make it more difficult for the compiler to distinguish between
 initialised and initialised sensibly in some cases.
local variables are irrelevant there.

 
 David
 
 [1] In a standards-compliant compiler. Apparently a few shipping
 compilers for embedded systems fail to respect this, but everything
 FreeBSD is compiled with does.


pgpu5zwYzr0XY.pgp
Description: PGP signature


svn commit: r235270 - head/sys/geom/raid

2012-05-11 Thread Alexander Motin
Author: mav
Date: Fri May 11 13:20:17 2012
New Revision: 235270
URL: http://svn.freebsd.org/changeset/base/235270

Log:
  - Prevent error status leak if write to some of the RAID1/1E volume disks
  failed while write to some other succeeded. Instead mark disk as failed.
  - Make RAID1E less aggressive in failing disks to avoid volume breakage.
  
  MFC after:2 weeks

Modified:
  head/sys/geom/raid/tr_raid1.c
  head/sys/geom/raid/tr_raid1e.c

Modified: head/sys/geom/raid/tr_raid1.c
==
--- head/sys/geom/raid/tr_raid1.c   Fri May 11 13:03:52 2012
(r235269)
+++ head/sys/geom/raid/tr_raid1.c   Fri May 11 13:20:17 2012
(r235270)
@@ -894,7 +894,16 @@ rebuild_round_done:
g_raid_unlock_range(sd-sd_volume, bp-bio_offset,
bp-bio_length);
}
-   error = bp-bio_error;
+   if (pbp-bio_cmd != BIO_READ) {
+   if (pbp-bio_inbed == 1 || pbp-bio_error != 0)
+   pbp-bio_error = bp-bio_error;
+   if (bp-bio_error != 0) {
+   G_RAID_LOGREQ(0, bp, Write failed: failing subdisk.);
+   g_raid_tr_raid1_fail_disk(sd-sd_softc, sd, 
sd-sd_disk);
+   }
+   error = pbp-bio_error;
+   } else
+   error = bp-bio_error;
g_destroy_bio(bp);
if (pbp-bio_children == pbp-bio_inbed) {
pbp-bio_completed = pbp-bio_length;

Modified: head/sys/geom/raid/tr_raid1e.c
==
--- head/sys/geom/raid/tr_raid1e.c  Fri May 11 13:03:52 2012
(r235269)
+++ head/sys/geom/raid/tr_raid1e.c  Fri May 11 13:20:17 2012
(r235270)
@@ -338,6 +338,9 @@ static void
 g_raid_tr_raid1e_fail_disk(struct g_raid_softc *sc, struct g_raid_subdisk *sd,
 struct g_raid_disk *disk)
 {
+   struct g_raid_volume *vol;
+
+   vol = sd-sd_volume;
/*
 * We don't fail the last disk in the pack, since it still has decent
 * data on it and that's better than failing the disk if it is the root
@@ -347,8 +350,12 @@ g_raid_tr_raid1e_fail_disk(struct g_raid
 * the volume that has / on it.  I can't think of a case where we'd
 * want the volume to go away on this kind of event.
 */
-   if (g_raid_nsubdisks(sd-sd_volume, G_RAID_SUBDISK_S_ACTIVE) == 1 
-   g_raid_get_subdisk(sd-sd_volume, G_RAID_SUBDISK_S_ACTIVE) == sd)
+   if ((g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_ACTIVE) +
+g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_RESYNC) +
+g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_STALE) +
+g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_UNINITIALIZED) 
+vol-v_disks_count) 
+   (sd-sd_state = G_RAID_SUBDISK_S_UNINITIALIZED))
return;
g_raid_fail_disk(sc, sd, disk);
 }
@@ -1113,7 +1120,16 @@ rebuild_round_done:
G_RAID_LOGREQ(2, bp, REMAP done %d., bp-bio_error);
g_raid_unlock_range(sd-sd_volume, virtual, bp-bio_length);
}
-   error = bp-bio_error;
+   if (pbp-bio_cmd != BIO_READ) {
+   if (pbp-bio_inbed == 1 || pbp-bio_error != 0)
+   pbp-bio_error = bp-bio_error;
+   if (bp-bio_error != 0) {
+   G_RAID_LOGREQ(0, bp, Write failed: failing subdisk.);
+   g_raid_tr_raid1e_fail_disk(sd-sd_softc, sd, 
sd-sd_disk);
+   }
+   error = pbp-bio_error;
+   } else
+   error = bp-bio_error;
g_destroy_bio(bp);
if (pbp-bio_children == pbp-bio_inbed) {
pbp-bio_completed = pbp-bio_length;
___
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: r235267 - in head/usr.bin/sort: . nls

2012-05-11 Thread Dimitry Andric
On 2012-05-11 15:02, Colin Percival wrote: On 05/11/12 05:48, Konstantin 
Belousov wrote:
 On Fri, May 11, 2012 at 12:37:16PM +, Gabor Kovesdan wrote:
 +bool byte_sort = false; + +static wchar_t **wmonths = NULL; +static
 unsigned char **cmonths = NULL;

 Such initializations are useless. You only increase the size of the binary 
 on the disk as the consequence.
 
 I just tested this hypothesis, and found no change in binary size using
 either clang or gcc46.  Presumably they're smart enough to ignore explicit
 (and unnecessary) initializations of statics to zero.

This is default behaviour, which can be toggled with gcc's (and clang's)
command line option -fno-zero-initialized-in-bss:

http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fno_002dzero_002dinitialized_002din_002dbss-744
___
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: r235271 - in head/sys: arm/at91 boot/arm/at91/libat91

2012-05-11 Thread Warner Losh
Author: imp
Date: Fri May 11 14:40:25 2012
New Revision: 235271
URL: http://svn.freebsd.org/changeset/base/235271

Log:
  Hack to unbreak boot2 for at91rm9200 boot loader.  When the at91sam
  code came in, it moved things around which wound up breaking the
  build.  We have to do this bit of a hack to avoid duplication of a lot
  of #defines.

Modified:
  head/sys/arm/at91/at91_pioreg.h
  head/sys/boot/arm/at91/libat91/at91rm9200.h

Modified: head/sys/arm/at91/at91_pioreg.h
==
--- head/sys/arm/at91/at91_pioreg.h Fri May 11 13:20:17 2012
(r235270)
+++ head/sys/arm/at91/at91_pioreg.h Fri May 11 14:40:25 2012
(r235271)
@@ -28,6 +28,7 @@
 #ifndef ARM_AT91_AT91_PIOREG_H
 #define ARM_AT91_AT91_PIOREG_H
 
+#ifndef ATMEL_ENV
 /* Registers */
 #define PIO_PER0x00/* PIO Enable Register */
 #define PIO_PDR0x04/* PIO Disable Register */
@@ -65,6 +66,7 @@
 #define PIO_OWDR   0xa4/* PIO Output Write Disable Register */
 #define PIO_OWSR   0xa8/* PIO Output Write Status Register */
/*  0xac   reserved */
+#endif
 
 #define AT91C_PIO_PA0((unsigned int) 1   0) // Pin Controlled by PA0
 #define AT91C_PIO_PA1((unsigned int) 1   1) // Pin Controlled by PA1

Modified: head/sys/boot/arm/at91/libat91/at91rm9200.h
==
--- head/sys/boot/arm/at91/libat91/at91rm9200.h Fri May 11 13:20:17 2012
(r235270)
+++ head/sys/boot/arm/at91/libat91/at91rm9200.h Fri May 11 14:40:25 2012
(r235271)
@@ -41,6 +41,8 @@
 #ifndef AT91RM9200_H
 #defineAT91RM9200_H
 
+#define ATMEL_ENV
+
 typedef volatile unsigned int AT91_REG;// Hardware register definition
 
 // 
*
___
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: r235272 - head/sys/boot/arm/at91/boot2

2012-05-11 Thread Warner Losh
Author: imp
Date: Fri May 11 14:45:29 2012
New Revision: 235272
URL: http://svn.freebsd.org/changeset/base/235272

Log:
  Add support for passing in the board ID.
  
  # This doesn't implement the full Linux boot ABI for arm yet.
  # since there's no ATAGs list passed in for r2, and r0 has
  # boot options rather than 0 as specified in the standard.
  # Commited code to the tree won't touch any of this anyway, but
  # future code may be able to use this.

Modified:
  head/sys/boot/arm/at91/boot2/boot2.c

Modified: head/sys/boot/arm/at91/boot2/boot2.c
==
--- head/sys/boot/arm/at91/boot2/boot2.cFri May 11 14:40:25 2012
(r235271)
+++ head/sys/boot/arm/at91/boot2/boot2.cFri May 11 14:45:29 2012
(r235272)
@@ -86,11 +86,12 @@ static const unsigned char flags[NOPT] =
RBX_VERBOSE
 };
 
+unsigned board_id; /* board type to pass to kernel, if set by board_* code */
 unsigned dsk_start;
 static char cmd[512];
 static char kname[1024];
 static uint32_t opts;
-static int dsk_meta;
+static uint8_t dsk_meta;
 
 static void load(void);
 static int parse(void);
@@ -241,7 +242,7 @@ load(void)
 #ifdef FIXUP_BOOT_DRV
fixup_boot_drv(staddr, klen, bootslice, bootpart);
 #endif
-   ((void(*)(int))addr)(opts  RBX_MASK);
+   ((void(*)(int, int, int, int))addr)(opts  RBX_MASK, board_id, 0, 0);
 }
 
 static int
___
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: r235273 - head/sys/arm/xscale/ixp425

2012-05-11 Thread Warner Losh
Author: imp
Date: Fri May 11 14:51:59 2012
New Revision: 235273
URL: http://svn.freebsd.org/changeset/base/235273

Log:
  Remove obsolte big endian flag.  It is no longer needed.

Modified:
  head/sys/arm/xscale/ixp425/std.ixp425
  head/sys/arm/xscale/ixp425/std.ixp435

Modified: head/sys/arm/xscale/ixp425/std.ixp425
==
--- head/sys/arm/xscale/ixp425/std.ixp425   Fri May 11 14:45:29 2012
(r235272)
+++ head/sys/arm/xscale/ixp425/std.ixp425   Fri May 11 14:51:59 2012
(r235273)
@@ -3,4 +3,3 @@
 files  ../xscale/ixp425/files.ixp425
 include../xscale/std.xscale
 cpuCPU_XSCALE_IXP425
-makeoption ARM_BIG_ENDIAN

Modified: head/sys/arm/xscale/ixp425/std.ixp435
==
--- head/sys/arm/xscale/ixp425/std.ixp435   Fri May 11 14:45:29 2012
(r235272)
+++ head/sys/arm/xscale/ixp425/std.ixp435   Fri May 11 14:51:59 2012
(r235273)
@@ -5,4 +5,3 @@ files   ../xscale/ixp425/files.ixp425
 include../xscale/std.xscale
 cpuCPU_XSCALE_IXP435
 cpuCPU_XSCALE_IXP425
-makeoption ARM_BIG_ENDIAN
___
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: r235266 - head/lib/libc/stdlib

2012-05-11 Thread Andrey Chernov
Thanks, but in this two places old errno value should be saved across
free() because free() may damage it:

On Fri, May 11, 2012 at 11:29:08AM +, Konstantin Belousov wrote:
...
 + if (lstat(resolved, sb) != 0) {
 + if (m)
 + free(resolved);
 +
return (NULL);
...
 + errno = ENOTDIR;
   if (m)
   free(resolved);
   return (NULL);


-- 
http://ache.vniz.net/
___
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: r235276 - head/usr.sbin/pkg_install/lib

2012-05-11 Thread Beat Gaetzi
Author: beat (ports committer)
Date: Fri May 11 16:09:12 2012
New Revision: 235276
URL: http://svn.freebsd.org/changeset/base/235276

Log:
  - Print package name in case an empty pkgdep line is found.
  
  PR:   bin/164378
  Submitted by: Yuri yuri AT tsoft.com and many others
  Approved by:  flz
  MFC after:2 weeks

Modified:
  head/usr.sbin/pkg_install/lib/plist.c

Modified: head/usr.sbin/pkg_install/lib/plist.c
==
--- head/usr.sbin/pkg_install/lib/plist.c   Fri May 11 16:08:51 2012
(r235275)
+++ head/usr.sbin/pkg_install/lib/plist.c   Fri May 11 16:09:12 2012
(r235276)
@@ -286,7 +286,8 @@ read_plist(Package *pkg, FILE *fp)
if (*cp == '\0') {
cp = NULL;
if (cmd == PLIST_PKGDEP) {
-   warnx(corrupted record (pkgdep line without argument), 
ignoring);
+   warnx(corrupted record for package %s (pkgdep line without 
+   argument), ignoring, pkg-name);
cmd = FAIL;
}
goto bottom;
___
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: r235266 - head/lib/libc/stdlib

2012-05-11 Thread Konstantin Belousov
On Fri, May 11, 2012 at 06:54:32PM +0400, Andrey Chernov wrote:
 Thanks, but in this two places old errno value should be saved across
 free() because free() may damage it:
I do not agree. free() cannot change errno.

 
 On Fri, May 11, 2012 at 11:29:08AM +, Konstantin Belousov wrote:
 ...
  +   if (lstat(resolved, sb) != 0) {
  +   if (m)
  +   free(resolved);
  +
   return (NULL);
 ...
  +   errno = ENOTDIR;
  if (m)
  free(resolved);
  return (NULL);
 


pgpLzo9PAV9Sl.pgp
Description: PGP signature


svn commit: r235277 - head/sys/arm/arm

2012-05-11 Thread Warner Losh
Author: imp
Date: Fri May 11 17:40:13 2012
New Revision: 235277
URL: http://svn.freebsd.org/changeset/base/235277

Log:
  This comment has become unmoored from the code to which it applies.
  Move it back.

Modified:
  head/sys/arm/arm/locore.S

Modified: head/sys/arm/arm/locore.S
==
--- head/sys/arm/arm/locore.S   Fri May 11 16:09:12 2012(r235276)
+++ head/sys/arm/arm/locore.S   Fri May 11 17:40:13 2012(r235277)
@@ -42,12 +42,6 @@ __FBSDID($FreeBSD$);
 /* What size should this really be ? It is only used by initarm() */
 #define INIT_ARM_STACK_SIZE2048
 
-/*
- * This is for kvm_mkdb, and should be the address of the beginning
- * of the kernel text segment (not necessarily the same as kernbase).
- */
-
-
 #defineCPWAIT_BRANCH   
 \
sub pc, pc, #4
 
@@ -56,6 +50,10 @@ __FBSDID($FreeBSD$);
mov tmp, tmp/* wait for it to complete */   ;\
CPWAIT_BRANCH   /* branch to next insn */
 
+/*
+ * This is for kvm_mkdb, and should be the address of the beginning
+ * of the kernel text segment (not necessarily the same as kernbase).
+ */
.text
.align  0
 .globl kernbase
___
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: r235265 - head/share/man/man7

2012-05-11 Thread Bruce Evans

On Fri, 11 May 2012, Ulrich Spoerlein wrote:


Log:
 Stop lying about default UFS blocksizes.

 This catches up with the year-old change to default blocksizes. Also
 reduce the variants of spelling gigabyte from 3 down to 2 (GB and GiB).


Why not reduce it to 1 (no GakaBytes, aka GiB)?


Modified: head/share/man/man7/tuning.7
==
--- head/share/man/man7/tuning.7Fri May 11 09:46:17 2012
(r235264)
+++ head/share/man/man7/tuning.7Fri May 11 10:13:34 2012
(r235265)
@@ -148,15 +148,15 @@ If you do not use ports all that much an
system source
.Pq Pa /usr/src
on the machine, you can get away with
-a 1 gigabyte
+a 1 GB


Since we are not disk manufacturers, GB here means 2**30.  I like not
spelling it GakaByte of course.

Similarly in most places.


@@ -218,22 +218,22 @@ and
.Em cylinders/group .
.Pp
.Fx
-performs best when using 8K or 16K file system block sizes.
-The default file system block size is 16K,
+performs best when using 16K or 32K file system block sizes.
+The default file system block size is 32K,


K here means 2**10.  I like not spelling it KakaByte of course.


@@ -256,13 +256,13 @@ Do not use this option
unless you are actually storing large files on the partition, because if you
overcompensate you can wind up with a file system that has lots of free
space remaining but cannot accommodate any more files.
-Using 32768, 65536, or 262144 bytes/i-node is recommended.
+Using 65536, 131072, or 262144 bytes/i-node is recommended.


Most places give block sizes in K.  This is verbose.


You can go higher but
it will have only incremental effects on
.Xr fsck 8
recovery times.
For example,
-.Dq Li newfs -i 32768 ... .
+.Dq Li newfs -i 65536 ... .


newfs now uses expand_number() for most numeric args.  expand_number()
is horrible, starting with its name (it doesn't expand numbers, but
parses string representations of numbers), but it supports sizes in K
and its bugs don't include supporting sizes in GakaBytes, so the
verboseness in the above is now unnecessary.


.Pp
.Xr tunefs 8
may be used to further tune a file system.
@@ -525,8 +525,8 @@ sysctl governs VFS read-ahead and is exp
to pre-read if the heuristics algorithm decides that the reads are
issued sequentially.
It is used by the UFS, ext2fs and msdosfs file systems.
-With the default UFS block size of 16 KiB, a setting of 32 will allow
-speculatively reading up to 512 KiB.
+With the default UFS block size of 32 KiB, a setting of 64 will allow
+speculatively reading up to 2 MiB.


This used and uses KakaBytes, but the above uses K (it also omits B).

This uses MakaBytes for the first time in this file.  Elsewhere, most
places use M.  The first of these are in the first paragraph, and near
them, GB is spelled as G, so the reduction is from = 4 to =3, not from
3 to 2.  Actually, I can't find any GakaB, so the reduction does seem to
be to 2 (G and GB).  For M, the spellings are at least M for fs and
swap sizes, M and MB for memory sizes, MB for page sizes, and now MakaByte
for a block size.


This setting may be increased to get around disk I/O latencies, especially
where these latencies are large such as in virtual machine emulated
environments.


Bruce
___
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: r235278 - head/sys/arm/arm

2012-05-11 Thread Warner Losh
Author: imp
Date: Fri May 11 17:49:00 2012
New Revision: 235278
URL: http://svn.freebsd.org/changeset/base/235278

Log:
  Remove unused cruft.  We call through memcpy more directly when we
  need to move the kernel, so we no longer need this.

Modified:
  head/sys/arm/arm/locore.S

Modified: head/sys/arm/arm/locore.S
==
--- head/sys/arm/arm/locore.S   Fri May 11 17:40:13 2012(r235277)
+++ head/sys/arm/arm/locore.S   Fri May 11 17:49:00 2012(r235278)
@@ -229,11 +229,6 @@ mmu_init_table:
.word   _end
.word   svcstk + INIT_ARM_STACK_SIZE
 
-#if defined(FLASHADDR)  defined(LOADERRAMADDR)
-.L_arm_memcpy:
-.word   _C_LABEL(_arm_memcpy)
-#endif
-
 .Lvirt_done:
.word   virt_done
 .Lmainreturned:
___
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: r235280 - head/sys/netinet

2012-05-11 Thread Michael Tuexen
Author: tuexen
Date: Fri May 11 17:50:51 2012
New Revision: 235280
URL: http://svn.freebsd.org/changeset/base/235280

Log:
  Remove a constant which is only used on non-FreeBSD platform.
  (The actual code for the socket option handling has been #ifdefed
  out forever...)
  
  MFC after: 3 days.

Modified:
  head/sys/netinet/sctp.h

Modified: head/sys/netinet/sctp.h
==
--- head/sys/netinet/sctp.h Fri May 11 17:50:18 2012(r235279)
+++ head/sys/netinet/sctp.h Fri May 11 17:50:51 2012(r235280)
@@ -265,8 +265,6 @@ struct sctp_paramhdr {
 #define SCTP_PEELOFF0x800a
 /* the real worker for sctp_getaddrlen() */
 #define SCTP_GET_ADDR_LEN   0x800b
-/* temporary workaround for Apple listen() issue, no args used */
-#define SCTP_LISTEN_FIX0x800c
 /* Debug things that need to be purged */
 #define SCTP_SET_INITIAL_DBG_SEQ   0x9f00
 
___
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: r235266 - head/lib/libc/stdlib

2012-05-11 Thread Garrett Cooper
On Fri, May 11, 2012 at 10:04 AM, Konstantin Belousov
kostik...@gmail.com wrote:
 On Fri, May 11, 2012 at 06:54:32PM +0400, Andrey Chernov wrote:
 Thanks, but in this two places old errno value should be saved across
 free() because free() may damage it:
 I do not agree. free() cannot change errno.

It might depending on the OS (logically it shouldn't, but I
digress), but there was some recent discussion on the POSIX list about
errno not being mangled via free:
http://austingroupbugs.net/view.php?id=385 .
Cheers,
-Garrett
___
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: r235266 - head/lib/libc/stdlib

2012-05-11 Thread Andrey Chernov
On Fri, May 11, 2012 at 08:04:12PM +0300, Konstantin Belousov wrote:
 On Fri, May 11, 2012 at 06:54:32PM +0400, Andrey Chernov wrote:
  Thanks, but in this two places old errno value should be saved across
  free() because free() may damage it:
 I do not agree. free() cannot change errno.

Perhaps I forget something, so please refer to standard stating that.

IEEE Std 1003.1-2008 says that No errors are defined. in the ERRORS 
section, but states that beforehand:

if the argument does not match a pointer earlier returned by a function 
in POSIX.1-2008 that allocates memory as if by malloc(), or if the space has 
been deallocated by a call to free() or realloc(), the behavior is 
undefined.

Any use of a pointer that refers to freed space results in undefined 
behavior.

...

The DESCRIPTION is updated to clarify that if the pointer returned is not 
by a function that allocates memory as if by malloc(), then the behavior 
is undefined.

So that undefined behavior case still can modify errno.

(Some internal syscalls (like munmap etc) could produce errno. In any 
case it is very implemetation defined.)

-- 
http://ache.vniz.net/


pgpSABA7ajT4j.pgp
Description: PGP signature


svn commit: r235281 - head/sys/boot/i386/cdboot

2012-05-11 Thread Dimitry Andric
Author: dim
Date: Fri May 11 18:07:23 2012
New Revision: 235281
URL: http://svn.freebsd.org/changeset/base/235281

Log:
  Fix sys/boot/i386/cdboot/cdboot.S compilation with clang after r235219.
  This file uses .code16 directives, which are not yet supported by
  clang's integrated assembler.
  
  MFC after:1 month

Modified:
  head/sys/boot/i386/cdboot/Makefile

Modified: head/sys/boot/i386/cdboot/Makefile
==
--- head/sys/boot/i386/cdboot/Makefile  Fri May 11 17:50:51 2012
(r235280)
+++ head/sys/boot/i386/cdboot/Makefile  Fri May 11 18:07:23 2012
(r235281)
@@ -13,3 +13,7 @@ ORG=  0x7c00
 LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
 
 .include bsd.prog.mk
+
+# XXX: clang integrated-as doesn't grok .codeNN directives yet
+CFLAGS.cdboot.S=   ${CLANG_NO_IAS}
+CFLAGS+=   ${CFLAGS.${.IMPSRC:T}}
___
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: r235282 - head/sys/netinet

2012-05-11 Thread Michael Tuexen
Author: tuexen
Date: Fri May 11 18:07:36 2012
New Revision: 235282
URL: http://svn.freebsd.org/changeset/base/235282

Log:
  Only provide the supported features in the SCTP_ASSOC_CHANGE notif
  if the state is SCTP_COMM_UP or SCTP_RESTART.
  While there, do some cleanups.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==
--- head/sys/netinet/sctputil.c Fri May 11 18:07:23 2012(r235281)
+++ head/sys/netinet/sctputil.c Fri May 11 18:07:36 2012(r235282)
@@ -2592,8 +2592,8 @@ sctp_pad_lastmbuf(struct mbuf *m, int pa
 }
 
 static void
-sctp_notify_assoc_change(uint32_t event, struct sctp_tcb *stcb,
-uint32_t error, int so_locked
+sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb,
+uint16_t error, int so_locked
 #if !defined(__APPLE__)  !defined(SCTP_SO_LOCK_TESTING)
 SCTP_UNUSED
 #endif
@@ -2602,6 +2602,7 @@ sctp_notify_assoc_change(uint32_t event,
struct mbuf *m_notify;
struct sctp_assoc_change *sac;
struct sctp_queued_to_read *control;
+   size_t len;
unsigned int i;
 
 #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
@@ -2615,7 +2616,7 @@ sctp_notify_assoc_change(uint32_t event,
 */
if (((stcb-sctp_ep-sctp_flags  SCTP_PCB_FLAGS_TCPTYPE) ||
(stcb-sctp_ep-sctp_flags  SCTP_PCB_FLAGS_IN_TCPPOOL)) 
-   ((event == SCTP_COMM_LOST) || (event == SCTP_CANT_STR_ASSOC))) {
+   ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) {
if (SCTP_GET_STATE(stcb-asoc) == SCTP_STATE_COOKIE_WAIT) {
SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, 
SCTP_FROM_SCTPUTIL, ECONNREFUSED);
stcb-sctp_socket-so_error = ECONNREFUSED;
@@ -2651,7 +2652,11 @@ sctp_notify_assoc_change(uint32_t event,
/* event not enabled */
return;
}
-   m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_assoc_change), 0, 
M_DONTWAIT, 1, MT_DATA);
+   len = sizeof(struct sctp_assoc_change);
+   if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) {
+   len += SCTP_ASSOC_SUPPORTS_MAX;
+   }
+   m_notify = sctp_get_mbuf_for_msg(len, 0, M_DONTWAIT, 1, MT_DATA);
if (m_notify == NULL)
/* no space left */
return;
@@ -2661,27 +2666,29 @@ sctp_notify_assoc_change(uint32_t event,
sac-sac_type = SCTP_ASSOC_CHANGE;
sac-sac_flags = 0;
sac-sac_length = sizeof(struct sctp_assoc_change);
-   sac-sac_state = event;
+   sac-sac_state = state;
sac-sac_error = error;
/* XXX verify these stream counts */
sac-sac_outbound_streams = stcb-asoc.streamoutcnt;
sac-sac_inbound_streams = stcb-asoc.streamincnt;
sac-sac_assoc_id = sctp_get_associd(stcb);
-   i = 0;
-   if (stcb-asoc.peer_supports_prsctp) {
-   sac-sac_info[i++] = SCTP_ASSOC_SUPPORTS_PR;
-   }
-   if (stcb-asoc.peer_supports_auth) {
-   sac-sac_info[i++] = SCTP_ASSOC_SUPPORTS_AUTH;
-   }
-   if (stcb-asoc.peer_supports_asconf) {
-   sac-sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF;
-   }
-   sac-sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF;
-   if (stcb-asoc.peer_supports_strreset) {
-   sac-sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG;
+   if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) {
+   i = 0;
+   if (stcb-asoc.peer_supports_prsctp) {
+   sac-sac_info[i++] = SCTP_ASSOC_SUPPORTS_PR;
+   }
+   if (stcb-asoc.peer_supports_auth) {
+   sac-sac_info[i++] = SCTP_ASSOC_SUPPORTS_AUTH;
+   }
+   if (stcb-asoc.peer_supports_asconf) {
+   sac-sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF;
+   }
+   sac-sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF;
+   if (stcb-asoc.peer_supports_strreset) {
+   sac-sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG;
+   }
+   sac-sac_length += i;
}
-   sac-sac_length += i;
SCTP_BUF_LEN(m_notify) = sac-sac_length;
SCTP_BUF_NEXT(m_notify) = NULL;
control = sctp_build_readq_entry(stcb, stcb-asoc.primary_destination,
@@ -2700,7 +2707,7 @@ sctp_notify_assoc_change(uint32_t event,
control,
stcb-sctp_socket-so_rcv, 1, SCTP_READ_LOCK_NOT_HELD,
so_locked);
-   if (event == SCTP_COMM_LOST) {
+   if (state == SCTP_COMM_LOST) {
/* Wake up any sleeper */
 #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
so = SCTP_INP_SO(stcb-sctp_ep);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send 

svn commit: r235283 - head/sys/netinet

2012-05-11 Thread Michael Tuexen
Author: tuexen
Date: Fri May 11 19:15:33 2012
New Revision: 235283
URL: http://svn.freebsd.org/changeset/base/235283

Log:
  Fix a bug in the handling of association reset request.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_input.c

Modified: head/sys/netinet/sctp_input.c
==
--- head/sys/netinet/sctp_input.c   Fri May 11 18:07:36 2012
(r235282)
+++ head/sys/netinet/sctp_input.c   Fri May 11 19:15:33 2012
(r235283)
@@ -3773,46 +3773,40 @@ sctp_handle_str_reset_request_tsn(struct
 
seq = ntohl(req-request_seq);
if (asoc-str_reset_seq_in == seq) {
+   asoc-last_reset_action[1] = stcb-asoc.last_reset_action[0];
if (!(asoc-local_strreset_support  
SCTP_ENABLE_CHANGE_ASSOC_REQ)) {
-   stcb-asoc.last_reset_action[1] = 
stcb-asoc.last_reset_action[0];
-   stcb-asoc.last_reset_action[0] = 
SCTP_STREAM_RESET_RESULT_PERFORMED;
-
asoc-last_reset_action[0] = 
SCTP_STREAM_RESET_RESULT_DENIED;
-   } else
+   } else {
fwdtsn.ch.chunk_length = htons(sizeof(struct 
sctp_forward_tsn_chunk));
-   fwdtsn.ch.chunk_type = SCTP_FORWARD_CUM_TSN;
-   fwdtsn.ch.chunk_flags = 0;
-   fwdtsn.new_cumulative_tsn = 
htonl(stcb-asoc.highest_tsn_inside_map + 1);
-   sctp_handle_forward_tsn(stcb, fwdtsn, abort_flag, NULL, 0);
-   if (abort_flag) {
-   return (1);
-   }
-   asoc-highest_tsn_inside_map += SCTP_STREAM_RESET_TSN_DELTA;
-   if (SCTP_BASE_SYSCTL(sctp_logging_level)  
SCTP_MAP_LOGGING_ENABLE) {
-   sctp_log_map(0, 10, asoc-highest_tsn_inside_map, 
SCTP_MAP_SLIDE_RESULT);
-   }
-   asoc-tsn_last_delivered = asoc-cumulative_tsn = 
asoc-highest_tsn_inside_map;
-   asoc-mapping_array_base_tsn = asoc-highest_tsn_inside_map + 1;
-   memset(asoc-mapping_array, 0, asoc-mapping_array_size);
-   asoc-highest_tsn_inside_nr_map = asoc-highest_tsn_inside_map;
-   memset(asoc-nr_mapping_array, 0, asoc-mapping_array_size);
-   atomic_add_int(asoc-sending_seq, 1);
-   /* save off historical data for retrans */
-   asoc-last_sending_seq[1] = asoc-last_sending_seq[0];
-   asoc-last_sending_seq[0] = asoc-sending_seq;
-   asoc-last_base_tsnsent[1] = asoc-last_base_tsnsent[0];
-   asoc-last_base_tsnsent[0] = asoc-mapping_array_base_tsn;
-
-   sctp_add_stream_reset_result_tsn(chk,
-   ntohl(req-request_seq),
-   SCTP_STREAM_RESET_RESULT_PERFORMED,
-   asoc-sending_seq,
-   asoc-mapping_array_base_tsn);
-   sctp_reset_out_streams(stcb, 0, (uint16_t *) NULL);
-   sctp_reset_in_stream(stcb, 0, (uint16_t *) NULL);
-   asoc-last_reset_action[1] = asoc-last_reset_action[0];
-   asoc-last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED;
-   sctp_notify_stream_reset_tsn(stcb, asoc-sending_seq, 
(asoc-mapping_array_base_tsn + 1), 0);
+   fwdtsn.ch.chunk_type = SCTP_FORWARD_CUM_TSN;
+   fwdtsn.ch.chunk_flags = 0;
+   fwdtsn.new_cumulative_tsn = 
htonl(stcb-asoc.highest_tsn_inside_map + 1);
+   sctp_handle_forward_tsn(stcb, fwdtsn, abort_flag, 
NULL, 0);
+   if (abort_flag) {
+   return (1);
+   }
+   asoc-highest_tsn_inside_map += 
SCTP_STREAM_RESET_TSN_DELTA;
+   if (SCTP_BASE_SYSCTL(sctp_logging_level)  
SCTP_MAP_LOGGING_ENABLE) {
+   sctp_log_map(0, 10, 
asoc-highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT);
+   }
+   asoc-tsn_last_delivered = asoc-cumulative_tsn = 
asoc-highest_tsn_inside_map;
+   asoc-mapping_array_base_tsn = 
asoc-highest_tsn_inside_map + 1;
+   memset(asoc-mapping_array, 0, 
asoc-mapping_array_size);
+   asoc-highest_tsn_inside_nr_map = 
asoc-highest_tsn_inside_map;
+   memset(asoc-nr_mapping_array, 0, 
asoc-mapping_array_size);
+   atomic_add_int(asoc-sending_seq, 1);
+   /* save off historical data for retrans */
+   asoc-last_sending_seq[1] = asoc-last_sending_seq[0];
+   asoc-last_sending_seq[0] = asoc-sending_seq;
+   asoc-last_base_tsnsent[1] = asoc-last_base_tsnsent[0];
+   asoc-last_base_tsnsent[0] = 
asoc-mapping_array_base_tsn;
+   sctp_reset_out_streams(stcb, 0, (uint16_t *) NULL);
+  

Re: svn commit: r235277 - head/sys/arm/arm

2012-05-11 Thread Bruce Evans

On Fri, 11 May 2012, Warner Losh wrote:


Log:
 This comment has become unmoored from the code to which it applies.
 Move it back.


This commit message is unmoored from its this too (except when both are
collected in the commit mail).


Modified: head/sys/arm/arm/locore.S
==
--- head/sys/arm/arm/locore.S   Fri May 11 16:09:12 2012(r235276)
+++ head/sys/arm/arm/locore.S   Fri May 11 17:40:13 2012(r235277)
@@ -42,12 +42,6 @@ __FBSDID($FreeBSD$);
/* What size should this really be ? It is only used by initarm() */
#define INIT_ARM_STACK_SIZE 2048

-/*
- * This is for kvm_mkdb, and should be the address of the beginning
- * of the kernel text segment (not necessarily the same as kernbase).
- */
-
-


Like the commit message, this this doesn't clearly refer to anything.

The 2 blank lines are either intentional unmooring with 1 style bugs,
or 2 style bugs.   (When a this refers to multiple this's, and those
this's are separated by blank lines, attaching the this to the this's
by juxtaposition (with no blank lines) doesn't work, and one fairly
obscure way of indicating this is to attach the comment to nothing
(by separating it with a blank line.)


#define CPWAIT_BRANCH\
sub pc, pc, #4

@@ -56,6 +50,10 @@ __FBSDID($FreeBSD$);
mov tmp, tmp/* wait for it to complete */   ;\
CPWAIT_BRANCH   /* branch to next insn */

+/*
+ * This is for kvm_mkdb, and should be the address of the beginning
+ * of the kernel text segment (not necessarily the same as kernbase).
+ */
.text
.align  0
.globl kernbase



This this now has its this near to it, but would still be clearer if this
were described explicitly.  That this seems to be simply kernbase, or
possibly kernbase and physaddr.  But this or that comment makes no sense
when attached to kernbase, because it says that this or that this is
NOT necessarily the same as kernbase.

These this's have intentionally fairly bad grammar so that it is unclear
what those this's are ;-).

Bruce
___
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: r235281 - head/sys/boot/i386/cdboot

2012-05-11 Thread Andriy Gapon
on 11/05/2012 21:07 Dimitry Andric said the following:
 Author: dim
 Date: Fri May 11 18:07:23 2012
 New Revision: 235281
 URL: http://svn.freebsd.org/changeset/base/235281
 
 Log:
   Fix sys/boot/i386/cdboot/cdboot.S compilation with clang after r235219.
   This file uses .code16 directives, which are not yet supported by
   clang's integrated assembler.
   
   MFC after:  1 month

Thank you!
Please ping me when the MFC time comes, so that I won't forget to bundle this
commit into the MFC of the original/offending commit.

 Modified:
   head/sys/boot/i386/cdboot/Makefile
 
 Modified: head/sys/boot/i386/cdboot/Makefile
 ==
 --- head/sys/boot/i386/cdboot/MakefileFri May 11 17:50:51 2012
 (r235280)
 +++ head/sys/boot/i386/cdboot/MakefileFri May 11 18:07:23 2012
 (r235281)
 @@ -13,3 +13,7 @@ ORG=0x7c00
  LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
  
  .include bsd.prog.mk
 +
 +# XXX: clang integrated-as doesn't grok .codeNN directives yet
 +CFLAGS.cdboot.S= ${CLANG_NO_IAS}
 +CFLAGS+= ${CFLAGS.${.IMPSRC:T}}


-- 
Andriy Gapon
___
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: r235285 - head/sbin/ifconfig

2012-05-11 Thread Hiroki Sato
Author: hrs
Date: Fri May 11 20:01:45 2012
New Revision: 235285
URL: http://svn.freebsd.org/changeset/base/235285

Log:
  Skip nd6 line with no warning message when the system does not support
  INET6.
  
  Spotted by:   flo

Modified:
  head/sbin/ifconfig/af_nd6.c

Modified: head/sbin/ifconfig/af_nd6.c
==
--- head/sbin/ifconfig/af_nd6.c Fri May 11 19:26:54 2012(r235284)
+++ head/sbin/ifconfig/af_nd6.c Fri May 11 20:01:45 2012(r235285)
@@ -148,12 +148,14 @@ nd6_status(int s)
memset(nd, 0, sizeof(nd));
strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname));
if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0))  0) {
-   warn(socket(AF_INET6, SOCK_DGRAM));
+   if (errno != EPROTONOSUPPORT)
+   warn(socket(AF_INET6, SOCK_DGRAM));
return;
}
error = ioctl(s6, SIOCGIFINFO_IN6, nd);
if (error) {
-   warn(ioctl(SIOCGIFINFO_IN6));
+   if (errno != EPFNOSUPPORT)
+   warn(ioctl(SIOCGIFINFO_IN6));
close(s6);
return;
}
___
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: r235286 - in head: contrib/bsnmp/snmp_usm contrib/bsnmp/snmp_vacm lib/libbluetooth lib/libc/locale lib/libc/net lib/libc/posix1e lib/libc/rpc lib/libc/stdlib lib/libc/string lib/libelf ...

2012-05-11 Thread Glen Barber
Author: gjb (doc committer)
Date: Fri May 11 20:06:46 2012
New Revision: 235286
URL: http://svn.freebsd.org/changeset/base/235286

Log:
  General mdoc(7) and typo fixes.
  
  PR:   167734
  Submitted by: Nobuyuki Koganemaru (kogane!jp.freebsd.org)
  MFC after:3 days

Modified:
  head/contrib/bsnmp/snmp_usm/snmp_usm.3
  head/contrib/bsnmp/snmp_vacm/snmp_vacm.3
  head/lib/libbluetooth/bluetooth.3
  head/lib/libc/locale/duplocale.3
  head/lib/libc/locale/freelocale.3
  head/lib/libc/locale/newlocale.3
  head/lib/libc/locale/querylocale.3
  head/lib/libc/locale/uselocale.3
  head/lib/libc/locale/xlocale.3
  head/lib/libc/net/sctp_connectx.3
  head/lib/libc/net/sctp_recvmsg.3
  head/lib/libc/net/sourcefilter.3
  head/lib/libc/posix1e/acl_delete_entry.3
  head/lib/libc/rpc/publickey.3
  head/lib/libc/stdlib/getenv.3
  head/lib/libc/stdlib/strfmon.3
  head/lib/libc/string/strlcpy.3
  head/lib/libelf/elf_getdata.3
  head/lib/libelf/elf_strptr.3
  head/lib/libelf/gelf_getphdr.3
  head/lib/libelf/gelf_newehdr.3
  head/lib/libgpib/gpib.3
  head/lib/libkvm/kvm_getpcpu.3
  head/lib/libprocstat/libprocstat.3
  head/lib/libradius/libradius.3
  head/lib/libtacplus/libtacplus.3
  head/lib/libusb/libusb.3
  head/lib/libusb/libusb20.3
  head/lib/msun/man/cexp.3
  head/lib/msun/man/complex.3
  head/share/man/man3/ATOMIC_VAR_INIT.3
  head/share/man/man3/pthread.3
  head/share/man/man3/pthread_condattr.3
  head/sys/netinet/libalias/libalias.3
  head/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.3
  head/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3

Modified: head/contrib/bsnmp/snmp_usm/snmp_usm.3
==
--- head/contrib/bsnmp/snmp_usm/snmp_usm.3  Fri May 11 20:01:45 2012
(r235285)
+++ head/contrib/bsnmp/snmp_usm/snmp_usm.3  Fri May 11 20:06:46 2012
(r235286)
@@ -57,7 +57,7 @@ An advisory lock used to coordinate seve
 altering the SNMP USM users.
 .It Va usmUserTable
 The table contains all SNMP USM users configured in
-.Nm bsnmpd.
+.Nm bsnmpd .
 The table contains the following objects
 .Bl -tag -width .It Va usmUserEngineID
 .It Va usmUserEngineID
@@ -102,7 +102,7 @@ module
 These columns may be used to change the user's privacy key.
 .It Va usmUserPublic
 An arbitrary octet string that may be modified to confirm a SET operation on 
any
-of the columns was successfull.
+of the columns was successful.
 .It Va usmUserStorageType
 This column always has either of two values. Entries created via
 .Nm bsnmpd's

Modified: head/contrib/bsnmp/snmp_vacm/snmp_vacm.3
==
--- head/contrib/bsnmp/snmp_vacm/snmp_vacm.3Fri May 11 20:01:45 2012
(r235285)
+++ head/contrib/bsnmp/snmp_vacm/snmp_vacm.3Fri May 11 20:06:46 2012
(r235286)
@@ -76,7 +76,7 @@ objects under the subtree in the relevan
 .It Va vacmViewTreeFamilyTable
 The table contains a list of SNMP views, i.e. entries specifying the OID of a
 MIB subtree and whether access to the objects under this subtree is to be
-allowed or forbiden.
+allowed or forbidden.
 .El
 .Sh FILES
 .Bl -tag -width X

Modified: head/lib/libbluetooth/bluetooth.3
==
--- head/lib/libbluetooth/bluetooth.3   Fri May 11 20:01:45 2012
(r235285)
+++ head/lib/libbluetooth/bluetooth.3   Fri May 11 20:06:46 2012
(r235286)
@@ -494,7 +494,8 @@ previously obtained with
 .Xr bt_devopen 3 .
 Filtering can be done on packet types, i.e.
 .Dv ACL ,
-.Dv SCO or
+.Dv SCO
+or
 .Dv HCI ,
 command and event packets, and, in addition, on
 .Dv HCI

Modified: head/lib/libc/locale/duplocale.3
==
--- head/lib/libc/locale/duplocale.3Fri May 11 20:01:45 2012
(r235285)
+++ head/lib/libc/locale/duplocale.3Fri May 11 20:06:46 2012
(r235286)
@@ -44,10 +44,10 @@ Duplicates an existing
 .Fa locale_t
 returning a new
 .Fa locale_t
-that refers to the same locale values but has independent internal state.
+that refers to the same locale values but has an independent internal state.
 Various functions, such as
 .Xr mblen 3
-require presistent state.
+require a persistent state.
 These functions formerly used static variables and calls to them from multiple
 threads had undefined behavior.
 They now use fields in the

Modified: head/lib/libc/locale/freelocale.3
==
--- head/lib/libc/locale/freelocale.3   Fri May 11 20:01:45 2012
(r235285)
+++ head/lib/libc/locale/freelocale.3   Fri May 11 20:06:46 2012
(r235286)
@@ -34,7 +34,7 @@
 .Nd Frees a locale created with
 .Xr duplocale 3
 or
-.Xr newlocale 3 .
+.Xr newlocale 3
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS

Modified: head/lib/libc/locale/newlocale.3

Re: svn commit: r235267 - in head/usr.bin/sort: . nls

2012-05-11 Thread Warner Losh

On May 11, 2012, at 9:02 AM, Colin Percival wrote:

 On 05/11/12 05:48, Konstantin Belousov wrote:
 On Fri, May 11, 2012 at 12:37:16PM +, Gabor Kovesdan wrote:
 +bool byte_sort = false; + +static wchar_t **wmonths = NULL; +static
 unsigned char **cmonths = NULL;
 
 Such initializations are useless. You only increase the size of the binary 
 on the disk as the consequence.
 
 I just tested this hypothesis, and found no change in binary size using
 either clang or gcc46.  Presumably they're smart enough to ignore explicit
 (and unnecessary) initializations of statics to zero.

How did you test this?  size(1) or ls(1)?  If ls, then you may be running into 
the page rounding of the .text and .data sections...

Warner

___
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: r235267 - in head/usr.bin/sort: . nls

2012-05-11 Thread Colin Percival
On 05/11/12 13:08, Warner Losh wrote:
 On May 11, 2012, at 9:02 AM, Colin Percival wrote:
 On 05/11/12 05:48, Konstantin Belousov wrote:
 On Fri, May 11, 2012 at 12:37:16PM +, Gabor Kovesdan wrote:
 +bool byte_sort = false; + +static wchar_t **wmonths = NULL; +static
 unsigned char **cmonths = NULL;

 Such initializations are useless. You only increase the size of the binary 
 on the disk as the consequence.

 I just tested this hypothesis, and found no change in binary size using
 either clang or gcc46.  Presumably they're smart enough to ignore explicit
 (and unnecessary) initializations of statics to zero.
 
 How did you test this?  size(1) or ls(1)?  If ls, then you may be running 
 into the page rounding of the .text and .data sections...

size(1), ls(1)-before-strip(1), and ls(1)-after-strip(1).

-- 
Colin Percival
Security Officer, FreeBSD | freebsd.org | The power to serve
Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid
___
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: r235288 - in head/sys/dev/etherswitch: . arswitch rtl8366

2012-05-11 Thread Adrian Chadd
Author: adrian
Date: Fri May 11 20:53:20 2012
New Revision: 235288
URL: http://svn.freebsd.org/changeset/base/235288

Log:
  Commit the first pass of the etherswitch support.
  
  This is designed to support the very basic ethernet switch chip behaviour,
  specifically:
  
  * accessing switch register space;
  * accessing per-PHY registers (for switches that actually expose PHYs);
  * basic vlan group support, which applies for the rtl8366 driver but not
for the atheros switches.
  
  This also includes initial support for:
  
  * rtl8366rb support - which is a 10/100/1000 switch which supports
vlan groups;
  * Initial Atheros AR8316 switch support - which is a 10/100/1000 switch
which supports an alternate vlan configuration (so the vlan group
methods are stubbed.)
  
  The general idea here is that the switch driver may speak to a variety of
  backend busses (mdio, i2c, spi, whatever) and expose:
  
  * If applicable, one or more MDIO busses which ethernet interfaces can
then attach PHYs to via miiproxy/mdioproxy;
  
  * exposes miibusses, one for each port at the moment, so ..
  
  * .. a PHY can be exposed on each miibus, for each switch port, with all
of the existing MII/ifnet framework.
  
  However:
  
  * The ifnet is manually created for now, and it isn't linked into the
interface list, nor can you (currently) send/receive frames on this ifnet.
At some point in the future there may be _some_ support for this, for
switches with a multi-port, isolated mode.
  
  * I'm still in the process of sorting out correct(er) locking.
  
  TODO:
  
  * ray's switch code in zrouter (zrouter.org) includes a much more developed
newbus API that covers the various switch methods, as well as a
capability API so drivers, the switch layer and the userland utility
can properly control the subset of supported features.
  
The plan is to sort that out later, once the rest of ray's switch drivers
are brought over and extended to export MII busses and PHYs.
  
  Submitted by: Stefan Bethke s...@lassitu.de
  Reviewed by:  ray

Added:
  head/sys/dev/etherswitch/arswitch/
  head/sys/dev/etherswitch/arswitch/arswitch.c   (contents, props changed)
  head/sys/dev/etherswitch/arswitch/arswitch_8216.c   (contents, props changed)
  head/sys/dev/etherswitch/arswitch/arswitch_8216.h   (contents, props changed)
  head/sys/dev/etherswitch/arswitch/arswitch_8226.c   (contents, props changed)
  head/sys/dev/etherswitch/arswitch/arswitch_8226.h   (contents, props changed)
  head/sys/dev/etherswitch/arswitch/arswitch_8316.c   (contents, props changed)
  head/sys/dev/etherswitch/arswitch/arswitch_8316.h   (contents, props changed)
  head/sys/dev/etherswitch/arswitch/arswitch_phy.c   (contents, props changed)
  head/sys/dev/etherswitch/arswitch/arswitch_phy.h   (contents, props changed)
  head/sys/dev/etherswitch/arswitch/arswitch_reg.c   (contents, props changed)
  head/sys/dev/etherswitch/arswitch/arswitch_reg.h   (contents, props changed)
  head/sys/dev/etherswitch/arswitch/arswitchreg.h   (contents, props changed)
  head/sys/dev/etherswitch/arswitch/arswitchvar.h   (contents, props changed)
  head/sys/dev/etherswitch/etherswitch.c   (contents, props changed)
  head/sys/dev/etherswitch/etherswitch.h   (contents, props changed)
  head/sys/dev/etherswitch/etherswitch_if.m   (contents, props changed)
  head/sys/dev/etherswitch/rtl8366/
  head/sys/dev/etherswitch/rtl8366/rtl8366rb.c   (contents, props changed)
  head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h   (contents, props changed)

Added: head/sys/dev/etherswitch/arswitch/arswitch.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/etherswitch/arswitch/arswitch.cFri May 11 20:53:20 
2012(r235288)
@@ -0,0 +1,557 @@
+/*-
+ * Copyright (c) 2011-2012 Stefan Bethke.
+ * Copyright (c) 2012 Adrian Chadd.
+ * 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 THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR 

svn commit: r235289 - in head/sbin: . etherswitchcfg

2012-05-11 Thread Adrian Chadd
Author: adrian
Date: Fri May 11 20:56:04 2012
New Revision: 235289
URL: http://svn.freebsd.org/changeset/base/235289

Log:
  Add etherswitchcfg.
  
  Submitted by: Stefan Bethke s...@lassitu.de

Added:
  head/sbin/etherswitchcfg/
  head/sbin/etherswitchcfg/Makefile   (contents, props changed)
  head/sbin/etherswitchcfg/etherswitchcfg.8   (contents, props changed)
  head/sbin/etherswitchcfg/etherswitchcfg.c   (contents, props changed)
  head/sbin/etherswitchcfg/ifmedia.c   (contents, props changed)
Modified:
  head/sbin/Makefile

Modified: head/sbin/Makefile
==
--- head/sbin/Makefile  Fri May 11 20:53:20 2012(r235288)
+++ head/sbin/Makefile  Fri May 11 20:56:04 2012(r235289)
@@ -20,6 +20,7 @@ SUBDIR=adjkerntz \
dump \
dumpfs \
dumpon \
+   etherswitchcfg \
ffsinfo \
fsck \
fsck_ffs \

Added: head/sbin/etherswitchcfg/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sbin/etherswitchcfg/Makefile   Fri May 11 20:56:04 2012
(r235289)
@@ -0,0 +1,9 @@
+#  @(#)Makefile5.4 (Berkeley) 6/5/91
+# $FreeBSD$
+
+PROG=  etherswitchcfg
+MAN=   etherswitchcfg.8
+SRCS=  etherswitchcfg.c ifmedia.c
+CFLAGS+= -I${.CURDIR}/../../sys
+
+.include bsd.prog.mk

Added: head/sbin/etherswitchcfg/etherswitchcfg.8
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sbin/etherswitchcfg/etherswitchcfg.8   Fri May 11 20:56:04 2012
(r235289)
@@ -0,0 +1,114 @@
+.\ $FreeBSD$
+.Dd December 15, 2011
+.Dt ETHERSWITCHCFG 8
+.Os
+.Sh NAME
+.Nm etherswitchcfg
+.Nd configure a built-in Ethernet switch
+.Sh SYNOPSIS
+.Nm
+.Op Fl f control file
+.Ar info
+.Nm
+.Op Fl f control file
+.Ar phy
+.Ar phy.register[=value]
+.Nm
+.Op Fl f control file
+.Ar port%d
+.Ar command parameter
+.Nm
+.Op Fl f control file
+.Ar reg
+.Ar register[=value]
+.Nm
+.Op Fl f control file
+.Ar vlangroup%d
+.Ar command parameter
+.Sh DESCRIPTION
+The
+.Nm
+utility is used to configure an Ethernet switch built into the system.
+.Nm
+accepts a number of options:
+.Bl -tag -width .Fl f -compact
+.It Fl f control file
+Specifies the
+.Xr etherswitch 4
+control file that represents the switch to be configured.
+It defaults to
+.Li /dev/etherswitch0 .
+.It Fl m
+When reporting port information, also list available media options for
+that port.
+.It Fl v
+Produce more verbose output.
+Without this flag, lines that represent inactive or empty configuration
+options are omitted.
+.El
+.Ss phy
+The phy command provides access to the registers of the PHYs attached
+to or integrated into the switch controller.
+PHY registers are specified as phy.register,
+where
+.Ar phy
+is usually the port number, and
+.Ar register
+is the register number.
+Both can be provided as decimal, octal or hexadecimal numbers in any of the 
formats
+understood by
+.Xr strtol 4 .
+To set the register value, use the form instance.register=value.
+.Ss port
+The port command selects one of the ports of the switch.
+It supports the following commands:
+.Bl -tag -width .Ar vlangroup number -compact
+.It Ar vlangroup number
+Sets the VLAN group number that is used to process incoming frames that are 
not tagged.
+.It Ar media mediaspec
+Specifies the physical media configuration to be configured for a port.
+.It Ar mediaopt mediaoption
+Specifies a list of media options for a port. See
+.Xr ifconfig 8
+for details on
+.Ar media and 
+.Ar mediaopt .
+.El
+.Ss reg
+The reg command provides access to the registers of the switch controller.
+.Ss vlangroup
+The vlangroup command selects one of the VLAN groups for configuration.
+It supports the following commands:
+.Bl -tag -width .Ar vlangroup -compact
+.It Ar vlan VID
+Sets the VLAN ID (802.1q VID) for this VLAN group.
+Frames transmitted on tagged member ports of this group will be tagged
+with this VID.
+Incoming frames carrying this tag will be forwarded according to the
+configuration of this VLAN group.
+.It Ar members port,...
+Configures which ports are to be a member of this VLAN group.
+The port numbers are given as a comma-separated list.
+Each port can optionally be followed by
+.Dq t
+to indicate that frames on this port are tagged.
+.El
+.Sh FILES
+.Bl -tag -width /dev/etherswitch? -compact
+.It Pa /dev/etherswitch?
+Control file for the ethernet switch driver.
+.El
+.Sh EXAMPLES
+Configure VLAN group 1 with a VID of 2 and makes ports 0 and 5 members,
+while excluding all other ports.
+Port 5 will send and receive tagged frames, while port 0 will be untagged.
+Incoming untagged frames on port 0 are assigned to vlangroup1.
+.Dl # etherswitchcfg vlangroup1 vlan 2 members 0,5t port0 vlangroup 1
+.Sh SEE ALSO
+.Xr etherswitch 4
+.Sh HISTORY
+.Nm
+first appeared in
+.Fx 10.0 .
+.Sh 

svn commit: r235290 - head/sys/mips/conf

2012-05-11 Thread Adrian Chadd
Author: adrian
Date: Fri May 11 21:13:43 2012
New Revision: 235290
URL: http://svn.freebsd.org/changeset/base/235290

Log:
  Add switch support to AP96.

Modified:
  head/sys/mips/conf/AP96
  head/sys/mips/conf/AP96.hints

Modified: head/sys/mips/conf/AP96
==
--- head/sys/mips/conf/AP96 Fri May 11 20:56:04 2012(r235289)
+++ head/sys/mips/conf/AP96 Fri May 11 21:13:43 2012(r235290)
@@ -44,3 +44,6 @@ devicefirmware# Used by the 
above
 # Options required for miiproxy and mdiobus
 optionsARGE_MDIO   # Export an MDIO bus separate from arge
 device miiproxy# MDIO bus - MII PHY rendezvous
+
+device etherswitch
+device arswitch

Modified: head/sys/mips/conf/AP96.hints
==
--- head/sys/mips/conf/AP96.hints   Fri May 11 20:56:04 2012
(r235289)
+++ head/sys/mips/conf/AP96.hints   Fri May 11 21:13:43 2012
(r235290)
@@ -5,21 +5,17 @@ hint.argemdio.0.at=nexus0
 hint.argemdio.0.maddr=0x1900
 hint.argemdio.0.msize=0x1000
 hint.argemdio.0.order=0
+# This creates an automatic mdioproxy0!
 
-# Create two mdioproxy instances - by default only one is created
-# per mdiobus above.
-hint.mdioproxy.0.at=mdio0
-hint.mdioproxy.1.at=mdio0
+
+# The switch automatically probes off of mdio0, and will
+# create an mdioproxy1.
 
 # TODO: RGMII
-# XXX this port currently doesn't work with the current configuration.
-hint.arge.0.phymask=0x0f
+hint.arge.0.phymask=0x0# Nothing attached here (XXX?)
 hint.arge.0.media=1000
 hint.arge.0.fduplex=1
 hint.arge.0.miimode=3  # RGMII
-# For now, rendezouvs this on the arge0 mdiobus.
-# Later, this will rendezvous via the AR8316 switch.
-hint.arge.0.mdio=mdioproxy0
 
 # TODO: RGMII
 hint.arge.1.phymask=0x10
@@ -27,7 +23,7 @@ hint.arge.1.phymask=0x10
 # For now, rendezouvs this on the arge0 mdiobus.
 # Later, this will rendezvous via the AR8316 switch.
 hint.arge.1.miimode=3  # RGMII
-hint.arge.1.mdio=mdioproxy1
+hint.arge.1.mdio=mdioproxy1# off the switch mdiobus
 
 # ath0 - slot 17
 hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1fff1000
___
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: r235291 - head/lib/libjail

2012-05-11 Thread Jamie Gritton
Author: jamie
Date: Fri May 11 21:22:52 2012
New Revision: 235291
URL: http://svn.freebsd.org/changeset/base/235291

Log:
  The linker isn't consistent in the ordering of dynamic sysctls, so don't
  assume that the unnamed final component of security.jail.param.foo. is
  one less than the foo component.  It might be one greater instead.

Modified:
  head/lib/libjail/jail.c

Modified: head/lib/libjail/jail.c
==
--- head/lib/libjail/jail.c Fri May 11 21:13:43 2012(r235290)
+++ head/lib/libjail/jail.c Fri May 11 21:22:52 2012(r235291)
@@ -855,7 +855,7 @@ jailparam_type(struct jailparam *jp)
 {
char *p, *nname;
size_t miblen, desclen;
-   int isarray;
+   int i, isarray;
struct {
int i;
char s[MAXPATHLEN];
@@ -977,21 +977,33 @@ jailparam_type(struct jailparam *jp)
}
break;
case CTLTYPE_NODE:
-   /* A node might be described by an empty-named child. */
+   /*
+* A node might be described by an empty-named child,
+* which would be immediately before or after the node itself.
+*/
mib[1] = 1;
-   mib[(miblen / sizeof(int)) + 2] =
-   mib[(miblen / sizeof(int)) + 1] - 1;
miblen += sizeof(int);
-   desclen = sizeof(desc.s);
-   if (sysctl(mib, (miblen / sizeof(int)) + 2, desc.s, desclen,
-   NULL, 0)  0) {
-   snprintf(jail_errmsg, JAIL_ERRMSGLEN,
-   sysctl(0.1): %s, strerror(errno));
-   return (-1);
+   for (i = -1; i = 1; i += 2) {
+   mib[(miblen / sizeof(int)) + 1] =
+   mib[(miblen / sizeof(int))] + i;
+   desclen = sizeof(desc.s);
+   if (sysctl(mib, (miblen / sizeof(int)) + 2, desc.s,
+   desclen, NULL, 0)  0) {
+   if (errno == ENOENT)
+   continue;
+   snprintf(jail_errmsg, JAIL_ERRMSGLEN,
+   sysctl(0.1): %s, strerror(errno));
+   return (-1);
+   }
+   if (desclen ==
+   sizeof(SJPARAM) + strlen(jp-jp_name) + 2 
+   memcmp(SJPARAM ., desc.s, sizeof(SJPARAM)) == 0 
+   memcmp(jp-jp_name, desc.s + sizeof(SJPARAM),
+   desclen - sizeof(SJPARAM) - 2) == 0 
+   desc.s[desclen - 2] == '.')
+   goto mib_desc;
}
-   if (desc.s[desclen - 2] != '.')
-   goto unknown_parameter;
-   goto mib_desc;
+   goto unknown_parameter;
default:
snprintf(jail_errmsg, JAIL_ERRMSGLEN,
unknown type for %s, jp-jp_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: r235292 - head/share/man/man4

2012-05-11 Thread Warner Losh
Author: imp
Date: Fri May 11 21:25:59 2012
New Revision: 235292
URL: http://svn.freebsd.org/changeset/base/235292

Log:
  Add pointers for how to setup debugging over firewire.

Modified:
  head/share/man/man4/firewire.4

Modified: head/share/man/man4/firewire.4
==
--- head/share/man/man4/firewire.4  Fri May 11 21:22:52 2012
(r235291)
+++ head/share/man/man4/firewire.4  Fri May 11 21:25:59 2012
(r235292)
@@ -82,12 +82,20 @@ manager, are dynamically assigned, after
 On the
 .Nm
 bus, every device is identified by an EUI 64 address.
+.Pp
+Debugging over the firewire interace is possible with the 
+.Xr dcons 4 
+driver.
+Please see
+.Pa http://wiki.freebsd.org/DebugWithDcons 
+for details on how to setup debugging with firewire.
 .Sh FILES
 .Bl -tag -compact
 .It Pa /dev/fw0.0
 .It Pa /dev/fwmem0.0
 .El
 .Sh SEE ALSO
+.Xr dcons 4 ,
 .Xr fwe 4 ,
 .Xr fwip 4 ,
 .Xr fwohci 4 ,
___
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: r235293 - head/usr.sbin/rtprio

2012-05-11 Thread Xin LI
Author: delphij
Date: Fri May 11 21:52:05 2012
New Revision: 235293
URL: http://svn.freebsd.org/changeset/base/235293

Log:
  Fix the case where the utility is being used to run a command directly,
  this is a regression introduced with r228917.
  
  PR:   bin/154042
  Submitted by: Bugs Beastie bugsbeastie gmail.com
  MFC after:1 week

Modified:
  head/usr.sbin/rtprio/rtprio.c

Modified: head/usr.sbin/rtprio/rtprio.c
==
--- head/usr.sbin/rtprio/rtprio.c   Fri May 11 21:25:59 2012
(r235292)
+++ head/usr.sbin/rtprio/rtprio.c   Fri May 11 21:52:05 2012
(r235293)
@@ -109,9 +109,12 @@ main(int argc, char *argv[])
if (argv[2][0] == '-') {
proc = parseint(argv[2], pid);
proc = abs(proc);
-   if (rtprio(RTP_SET, proc, rtp) != 0)
-   err(1, RTP_SET);
-   } else {
+   }
+
+   if (rtprio(RTP_SET, proc, rtp) != 0)
+   err(1, RTP_SET);
+
+   if (proc == 0) {
execvp(argv[2], argv[2]);
err(1, execvp: %s, argv[2]);
}
___
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: r235294 - head/usr.sbin/jail

2012-05-11 Thread Joel Dahl
Author: joel (doc committer)
Date: Fri May 11 22:05:30 2012
New Revision: 235294
URL: http://svn.freebsd.org/changeset/base/235294

Log:
  Fix .Pp macro.

Modified:
  head/usr.sbin/jail/jail.8

Modified: head/usr.sbin/jail/jail.8
==
--- head/usr.sbin/jail/jail.8   Fri May 11 21:52:05 2012(r235293)
+++ head/usr.sbin/jail/jail.8   Fri May 11 22:05:30 2012(r235294)
@@ -204,7 +204,7 @@ and
 options can also remove running jails that aren't in the
 .Xr jail.conf 5
 file, specified by name or jid.
-.P
+.Pp
 An argument of
 .Dq *
 is a wildcard that will operate on all jails, regardless of whether
___
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: r235297 - head/bin/kenv

2012-05-11 Thread Matthew D Fleming
Author: mdf
Date: Fri May 11 23:05:14 2012
New Revision: 235297
URL: http://svn.freebsd.org/changeset/base/235297

Log:
  Add a -v and -N option to kenv(1), so it can be more easily used in
  scripts the way sysctl(8) is.  The -N option, like in sysctl(8),
  displays only the kenv names, not their values.  The -v option prints an
  individual kenv variable name with its value as name=value.  This is
  the inverse of sysctl(8)'s -n flag, since the default behaviour of
  kenv(1) is already like sysctl(8) -n.
  
  Submitted by: Garrett Cooper  yanegomi AT gmail DOT com 
  MFC after:1 week

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

Modified: head/bin/kenv/kenv.1
==
--- head/bin/kenv/kenv.1Fri May 11 22:41:58 2012(r235296)
+++ head/bin/kenv/kenv.1Fri May 11 23:05:14 2012(r235297)
@@ -32,9 +32,9 @@
 .Nd dump or modify the kernel environment
 .Sh SYNOPSIS
 .Nm
-.Op Fl hq
+.Op Fl hNq
 .Nm
-.Op Fl q
+.Op Fl qv
 .Ar variable Ns Op = Ns Ar value
 .Nm
 .Op Fl q
@@ -54,6 +54,11 @@ name is specified,
 .Nm
 will only report that value.
 If the
+.Fl N
+option is specified,
+.Nm
+will only display variable names and not their values.
+If the
 .Fl u
 option is specified,
 .Nm
@@ -68,6 +73,13 @@ If the
 option is set, warnings normally printed as a result of being unable to
 perform the requested operation will be suppressed.
 .Pp
+If the
+.Fl v
+option is set, the variable name will be printed out for the
+environment variable in addition to the value when
+.Nm
+is executed with a variable name.
+.Pp
 Variables can be added to the kernel environment using the
 .Pa /boot/loader.conf
 file, or also statically compiled into the kernel using the statement

Modified: head/bin/kenv/kenv.c
==
--- head/bin/kenv/kenv.cFri May 11 22:41:58 2012(r235296)
+++ head/bin/kenv/kenv.cFri May 11 23:05:14 2012(r235297)
@@ -42,15 +42,17 @@ static int  ksetenv(char *, char *);
 static int kunsetenv(char *);
 
 static int hflag = 0;
+static int Nflag = 0;
 static int qflag = 0;
 static int uflag = 0;
+static int vflag = 0;
 
 static void
 usage(void)
 {
(void)fprintf(stderr, %s\n%s\n%s\n,
-   usage: kenv [-hq],
-  kenv [-q] variable[=value],
+   usage: kenv [-hNq],
+  kenv [-qv] variable[=value],
   kenv [-q] -u variable);
exit(1);
 }
@@ -64,17 +66,23 @@ main(int argc, char **argv)
error = 0;
val = NULL;
env = NULL;
-   while ((ch = getopt(argc, argv, hqu)) != -1) {
+   while ((ch = getopt(argc, argv, hNquv)) != -1) {
switch (ch) {
case 'h':
hflag++;
break;
+   case 'N':
+   Nflag++;
+   break;
case 'q':
qflag++;
break;
case 'u':
uflag++;
break;
+   case 'v':
+   vflag++;
+   break;
default:
usage();
}
@@ -91,9 +99,9 @@ main(int argc, char **argv)
argv++;
argc--;
}
-   if (hflag  (env != NULL))
+   if ((hflag || Nflag)  env != NULL)
usage();
-   if ((argc  0) || (uflag  (env == NULL)))
+   if (argc  0 || ((uflag || vflag)  env == NULL))
usage();
if (env == NULL) {
error = kdumpenv();
@@ -152,7 +160,10 @@ kdumpenv(void)
if (cp == NULL)
continue;
*cp++ = '\0';
-   printf(%s=\%s\\n, buf, cp);
+   if (Nflag)
+   printf(%s\n, buf);
+   else
+   printf(%s=\%s\\n, buf, cp);
buf = cp;
}
return (0);
@@ -167,7 +178,10 @@ kgetenv(char *env)
ret = kenv(KENV_GET, env, buf, sizeof(buf));
if (ret == -1)
return (ret);
-   printf(%s\n, buf);
+   if (vflag)
+   printf(%s=\%s\\n, env, buf);
+   else
+   printf(%s\n, buf);
return (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: r235300 - head/sys/kern

2012-05-11 Thread Xin LI
Author: delphij
Date: Fri May 11 23:41:52 2012
New Revision: 235300
URL: http://svn.freebsd.org/changeset/base/235300

Log:
  Release proc lock after setting signal queue.
  
  PR:   kern/167727
  Submitted by: Jinjun Gao gjinjun gmail com
  MFC after:2 weeks

Modified:
  head/sys/kern/kern_kthread.c

Modified: head/sys/kern/kern_kthread.c
==
--- head/sys/kern/kern_kthread.cFri May 11 23:36:26 2012
(r235299)
+++ head/sys/kern/kern_kthread.cFri May 11 23:41:52 2012
(r235300)
@@ -182,6 +182,7 @@ kproc_suspend(struct proc *p, int timo)
return (EINVAL);
}
SIGADDSET(p-p_siglist, SIGSTOP);
+   PROC_UNLOCK(p);
wakeup(p);
return msleep(p-p_siglist, p-p_mtx, PPAUSE | PDROP, suspkp, timo);
 }
___
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: r235301 - head/sys/kern

2012-05-11 Thread Xin LI
Author: delphij
Date: Fri May 11 23:43:32 2012
New Revision: 235301
URL: http://svn.freebsd.org/changeset/base/235301

Log:
  Revert previous revision, misunderstood the code :(

Modified:
  head/sys/kern/kern_kthread.c

Modified: head/sys/kern/kern_kthread.c
==
--- head/sys/kern/kern_kthread.cFri May 11 23:41:52 2012
(r235300)
+++ head/sys/kern/kern_kthread.cFri May 11 23:43:32 2012
(r235301)
@@ -182,7 +182,6 @@ kproc_suspend(struct proc *p, int timo)
return (EINVAL);
}
SIGADDSET(p-p_siglist, SIGSTOP);
-   PROC_UNLOCK(p);
wakeup(p);
return msleep(p-p_siglist, p-p_mtx, PPAUSE | PDROP, suspkp, timo);
 }
___
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: r235301 - head/sys/kern

2012-05-11 Thread Xin LI
On Fri, May 11, 2012 at 4:43 PM, Xin LI delp...@freebsd.org wrote:
 Author: delphij
 Date: Fri May 11 23:43:32 2012
 New Revision: 235301
 URL: http://svn.freebsd.org/changeset/base/235301

 Log:
  Revert previous revision, misunderstood the code :(

 Modified:
  head/sys/kern/kern_kthread.c

 Modified: head/sys/kern/kern_kthread.c
 ==
 --- head/sys/kern/kern_kthread.c        Fri May 11 23:41:52 2012        
 (r235300)
 +++ head/sys/kern/kern_kthread.c        Fri May 11 23:43:32 2012        
 (r235301)
 @@ -182,7 +182,6 @@ kproc_suspend(struct proc *p, int timo)
                return (EINVAL);
        }
        SIGADDSET(p-p_siglist, SIGSTOP);
 -       PROC_UNLOCK(p);
        wakeup(p);
        return msleep(p-p_siglist, p-p_mtx, PPAUSE | PDROP, suspkp, 
 timo);

For the record, p-p_mtx is the mutex used by PROC_[UN]LOCK(), which
has to be held while calling msleep().

Cheers,
-- 
Xin LI delp...@delphij.net https://www.delphij.net/
FreeBSD - The Power to Serve! Live free or die
___
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: r235302 - head/share/man/man4

2012-05-11 Thread Glen Barber
Author: gjb (doc committer)
Date: Sat May 12 00:30:54 2012
New Revision: 235302
URL: http://svn.freebsd.org/changeset/base/235302

Log:
  Bump .Dd

Modified:
  head/share/man/man4/firewire.4

Modified: head/share/man/man4/firewire.4
==
--- head/share/man/man4/firewire.4  Fri May 11 23:43:32 2012
(r235301)
+++ head/share/man/man4/firewire.4  Sat May 12 00:30:54 2012
(r235302)
@@ -31,7 +31,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd April 1, 2006
+.Dd May 11, 2012
 .Dt FIREWIRE 4
 .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


Re: svn commit: r235265 - head/share/man/man7

2012-05-11 Thread Eitan Adler
On 11 May 2012 06:13, Ulrich Spoerlein u...@freebsd.org wrote:
 Author: uqs
 Date: Fri May 11 10:13:34 2012
 New Revision: 235265
 URL: http://svn.freebsd.org/changeset/base/235265

 Log:
  Stop lying about default UFS blocksizes.

  This catches up with the year-old change to default blocksizes. Also
  reduce the variants of spelling gigabyte from 3 down to 2 (GB and GiB).

  Suggested by: arundel (about a year ago now ...)

 Modified:
  head/share/man/man7/tuning.7

 Modified: head/share/man/man7/tuning.7

There is active work going on with this page at
http://wiki.freebsd.org/SystemTuning
When the page is ready I will fix up the man page. Any changes made to
the man page between then and now will almost certainly get lost.

-- 
Eitan Adler
___
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: r235265 - head/share/man/man7

2012-05-11 Thread Eitan Adler
On 11 May 2012 13:47, Bruce Evans b...@optusnet.com.au wrote:

 Why not reduce it to 1 (no GakaBytes, aka GiB)?

Can you please make your suggested changes on
http://wiki.freebsd.org/SystemTuning ?

-- 
Eitan Adler
Source  Ports committer
X11, Bugbusting teams
___
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: r235316 - head/bin/kenv

2012-05-11 Thread Matthew D Fleming
Author: mdf
Date: Sat May 12 02:49:40 2012
New Revision: 235316
URL: http://svn.freebsd.org/changeset/base/235316

Log:
  I forgot to bump the manpage date.
  
  Reminded by:  Garrett Cooper
  MFC after:3 days
  X-MFC-with:   r235297

Modified:
  head/bin/kenv/kenv.1

Modified: head/bin/kenv/kenv.1
==
--- head/bin/kenv/kenv.1Sat May 12 00:55:49 2012(r235315)
+++ head/bin/kenv/kenv.1Sat May 12 02:49:40 2012(r235316)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd January 13, 2009
+.Dd May 11, 2012
 .Dt KENV 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: r235317 - in head: share/man/man4 usr.sbin/nfsd

2012-05-11 Thread Glen Barber
Author: gjb (doc committer)
Date: Sat May 12 03:25:46 2012
New Revision: 235317
URL: http://svn.freebsd.org/changeset/base/235317

Log:
  General mdoc(7) and typo fixes.
  
  PR:   167776
  Submitted by: Nobuyuki Koganemaru (kogane!jp.freebsd.org)
  MFC after:3 days

Modified:
  head/share/man/man4/acpi_hp.4
  head/share/man/man4/acpi_wmi.4
  head/share/man/man4/ahci.4
  head/share/man/man4/ath.4
  head/share/man/man4/atp.4
  head/share/man/man4/bpf.4
  head/share/man/man4/bridge.4
  head/share/man/man4/capsicum.4
  head/share/man/man4/ch.4
  head/share/man/man4/cpuctl.4
  head/share/man/man4/cxgbe.4
  head/share/man/man4/dcons.4
  head/share/man/man4/ddb.4
  head/share/man/man4/epair.4
  head/share/man/man4/fdt.4
  head/share/man/man4/fdtbus.4
  head/share/man/man4/gdb.4
  head/share/man/man4/ip.4
  head/share/man/man4/ipmi.4
  head/share/man/man4/ipw.4
  head/share/man/man4/isci.4
  head/share/man/man4/isp.4
  head/share/man/man4/iwn.4
  head/share/man/man4/mac_none.4
  head/share/man/man4/mac_stub.4
  head/share/man/man4/mps.4
  head/share/man/man4/net80211.4
  head/share/man/man4/netmap.4
  head/share/man/man4/ng_etf.4
  head/share/man/man4/ng_nat.4
  head/share/man/man4/ng_netflow.4
  head/share/man/man4/ng_socket.4
  head/share/man/man4/pcm.4
  head/share/man/man4/pcn.4
  head/share/man/man4/psm.4
  head/share/man/man4/rl.4
  head/share/man/man4/run.4
  head/share/man/man4/ses.4
  head/share/man/man4/siftr.4
  head/share/man/man4/simplebus.4
  head/share/man/man4/sis.4
  head/share/man/man4/sk.4
  head/share/man/man4/snd_hda.4
  head/share/man/man4/snd_hdspe.4
  head/share/man/man4/splash.4
  head/share/man/man4/ste.4
  head/share/man/man4/termios.4
  head/share/man/man4/ti.4
  head/share/man/man4/tl.4
  head/share/man/man4/tws.4
  head/share/man/man4/uhso.4
  head/share/man/man4/ulpt.4
  head/share/man/man4/umcs.4
  head/share/man/man4/uslcom.4
  head/share/man/man4/vr.4
  head/share/man/man4/watchdog.4
  head/share/man/man4/wb.4
  head/share/man/man4/wpi.4
  head/share/man/man4/xl.4
  head/share/man/man4/xnb.4
  head/usr.sbin/nfsd/nfsv4.4

Modified: head/share/man/man4/acpi_hp.4
==
--- head/share/man/man4/acpi_hp.4   Sat May 12 02:49:40 2012
(r235316)
+++ head/share/man/man4/acpi_hp.4   Sat May 12 03:25:46 2012
(r235317)
@@ -261,7 +261,7 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Michael Gmelin Aq free...@grem.de
+.An Michael Gmelin Aq free...@grem.de .
 .Pp
 It has been inspired by hp-wmi driver, which implements a subset of these
 features (hotkeys) on Linux.
@@ -275,7 +275,7 @@ http://www.microsoft.com/whdc/system/pnp
 .El
 .Pp
 This manual page was written by
-.An Michael Gmelin Aq free...@grem.de
+.An Michael Gmelin Aq free...@grem.de .
 .Sh BUGS
 This driver is experimental and has only been tested on i386 on an
 HP Compaq 8510p which featured all supported wireless devices (WWAN/BT/WLAN).

Modified: head/share/man/man4/acpi_wmi.4
==
--- head/share/man/man4/acpi_wmi.4  Sat May 12 02:49:40 2012
(r235316)
+++ head/share/man/man4/acpi_wmi.4  Sat May 12 03:25:46 2012
(r235317)
@@ -85,12 +85,12 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Michael Gmelin Aq free...@grem.de
+.An Michael Gmelin Aq free...@grem.de .
 .Pp
-Work has been inspired by the Linux acpi-wmi driver written by Carlos Corbacho
+Work has been inspired by the Linux acpi-wmi driver written by Carlos Corbacho.
 .Pp
 See http://www.microsoft.com/whdc/system/pnppwr/wmi/wmi-acpi.mspx for
 the specification of ACPI-WMI.
 .Pp
 This manual page was written by
-.An Michael Gmelin Aq free...@grem.de
+.An Michael Gmelin Aq free...@grem.de .

Modified: head/share/man/man4/ahci.4
==
--- head/share/man/man4/ahci.4  Sat May 12 02:49:40 2012(r235316)
+++ head/share/man/man4/ahci.4  Sat May 12 03:25:46 2012(r235317)
@@ -51,7 +51,7 @@ The following tunables are settable from
 .Xr loader 8 :
 .Bl -ohang
 .It Va hint.ahci. Ns Ar X Ns Va .msi
-controls Message Signaled Interrupts (MSI) usage by the specified controller
+controls Message Signaled Interrupts (MSI) usage by the specified controller.
 .Bl -tag -compact
 .It 0
 MSI disabled;

Modified: head/share/man/man4/ath.4
==
--- head/share/man/man4/ath.4   Sat May 12 02:49:40 2012(r235316)
+++ head/share/man/man4/ath.4   Sat May 12 03:25:46 2012(r235317)
@@ -186,7 +186,7 @@ ifconfig wlan0 meshid my_mesh mode 11a i
 .Ed
 .Pp
 Create two virtual 802.11a host-based access points, one with
-with WEP enabled and one with no security, and bridge them to
+WEP enabled and one with no security, and bridge them to
 the fxp0 (wired) device:
 .Bd -literal -offset 

svn commit: r235318 - head/sys/dev/mfi

2012-05-11 Thread Sean Bruno
Author: sbruno
Date: Sat May 12 03:30:50 2012
New Revision: 235318
URL: http://svn.freebsd.org/changeset/base/235318

Log:
  Fix inappropriate data type for two bus_dmamap_t variables that were causing
  PAE to insta-panic on startup.  Remove one unused variable that was
  commented out.
  
  Reviewed by:  ambrisko@
  Obtained from:jhb@ peter@ bz@ and countless others during BSDCAN
  MFC after:3 days

Modified:
  head/sys/dev/mfi/mfi_cam.c
  head/sys/dev/mfi/mfivar.h

Modified: head/sys/dev/mfi/mfi_cam.c
==
--- head/sys/dev/mfi/mfi_cam.c  Sat May 12 03:25:46 2012(r235317)
+++ head/sys/dev/mfi/mfi_cam.c  Sat May 12 03:30:50 2012(r235318)
@@ -293,8 +293,8 @@ mfip_start(void *data)
pt-header.data_len = csio-dxfer_len;
pt-header.sense_len = MFI_SENSE_LEN;
pt-header.cdb_len = csio-cdb_len;
-   pt-sense_addr_lo = cm-cm_sense_busaddr;
-   pt-sense_addr_hi = 0;
+   pt-sense_addr_lo = (uint32_t)cm-cm_sense_busaddr;
+   pt-sense_addr_hi = (uint32_t)((uint64_t)cm-cm_sense_busaddr  32);
if (ccbh-flags  CAM_CDB_POINTER)
bcopy(csio-cdb_io.cdb_ptr, pt-cdb[0], csio-cdb_len);
else

Modified: head/sys/dev/mfi/mfivar.h
==
--- head/sys/dev/mfi/mfivar.h   Sat May 12 03:25:46 2012(r235317)
+++ head/sys/dev/mfi/mfivar.h   Sat May 12 03:30:50 2012(r235318)
@@ -176,7 +176,7 @@ struct mfi_softc {
// Start: LSIP200113393
bus_dma_tag_t   verbuf_h_dmat;
bus_dmamap_tverbuf_h_dmamap;
-   uint32_tverbuf_h_busaddr;
+   bus_dmamap_tverbuf_h_busaddr;
uint32_t*verbuf;
void*kbuff_arr[MAX_IOCTL_SGE];
bus_dma_tag_t   mfi_kbuff_arr_dmat[2];
@@ -232,7 +232,7 @@ struct mfi_softc {
 
bus_dma_tag_t   mfi_sense_dmat;
bus_dmamap_tmfi_sense_dmamap;
-   uint32_tmfi_sense_busaddr;
+   bus_dmamap_tmfi_sense_busaddr;
struct mfi_sense*mfi_sense;
 
struct resource *mfi_irq;
@@ -319,7 +319,6 @@ struct mfi_softc {
uint8_t *   request_message_pool;
uint8_t *   request_message_pool_align;
uint8_t *   request_desc_pool;
-   //uint32_t  request_desc_busaddr;
bus_addr_t  request_msg_busaddr;
bus_addr_t  reply_frame_busaddr;
bus_addr_t  sg_frame_busaddr;
___
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: r235319 - in head/share/man: man4 man7 man9

2012-05-11 Thread Glen Barber
Author: gjb (doc committer)
Date: Sat May 12 03:46:43 2012
New Revision: 235319
URL: http://svn.freebsd.org/changeset/base/235319

Log:
  Remove duplicate words in mdoc(7) pages.
  
  PR:   167810
  Submitted by: Bryan Drewery {bryan!shatow%net} (hackers lounge)
  Found with:   textproc/igor
  MFC after:3 days

Modified:
  head/share/man/man4/mk48txx.4
  head/share/man/man4/mwl.4
  head/share/man/man4/ng_patch.4
  head/share/man/man4/ste.4
  head/share/man/man4/vge.4
  head/share/man/man7/tuning.7
  head/share/man/man9/VOP_GETACL.9
  head/share/man/man9/VOP_GETEXTATTR.9
  head/share/man/man9/VOP_SETACL.9
  head/share/man/man9/VOP_SETEXTATTR.9
  head/share/man/man9/locking.9
  head/share/man/man9/store.9

Modified: head/share/man/man4/mk48txx.4
==
--- head/share/man/man4/mk48txx.4   Sat May 12 03:30:50 2012
(r235318)
+++ head/share/man/man4/mk48txx.4   Sat May 12 03:46:43 2012
(r235319)
@@ -123,7 +123,7 @@ function.
 The offset into the control registers of the
 .Tn Mostek
 chip,
-which is set by the the
+which is set by the
 .Fn mk48txx_attach
 function.
 .It Fa sc_year0

Modified: head/share/man/man4/mwl.4
==
--- head/share/man/man4/mwl.4   Sat May 12 03:30:50 2012(r235318)
+++ head/share/man/man4/mwl.4   Sat May 12 03:46:43 2012(r235319)
@@ -144,7 +144,7 @@ ifconfig wlan0 create wlandev mwl0 wlanm
 ifconfig wlan0 meshid my_mesh mode 11a inet 192.168.0.10/24
 .Ed
 .Pp
-Create two virtual 802.11a host-based access points, one with
+Create two virtual 802.11a host-based access points, one
 with WEP enabled and one with no security, and bridge them to
 the fxp0 (wired) device:
 .Bd -literal -offset indent

Modified: head/share/man/man4/ng_patch.4
==
--- head/share/man/man4/ng_patch.4  Sat May 12 03:30:50 2012
(r235318)
+++ head/share/man/man4/ng_patch.4  Sat May 12 03:46:43 2012
(r235319)
@@ -140,7 +140,7 @@ node allows to modify TTL and TOS/DSCP f
 Suppose you have two adjacent simplex links to remote network
 (e.g.\ satellite), so that the packets expiring in between
 will generate unwanted ICMP-replies which have to go forth, not back.
-Thus you need to raise TTL of every packet entering link link by 2
+Thus you need to raise TTL of every packet entering link by 2
 to ensure the TTL will not reach zero there.
 So you setup
 .Xr ipfw 8

Modified: head/share/man/man4/ste.4
==
--- head/share/man/man4/ste.4   Sat May 12 03:30:50 2012(r235318)
+++ head/share/man/man4/ste.4   Sat May 12 03:46:43 2012(r235319)
@@ -136,7 +136,7 @@ Maximum number of time to delay RX inter
 The valid range is 0 to 209712 in units of 1us, the default is
 150 (150us).
 The value 0 effectively disables the RX interrupt moderation.
-The resolution of of timer is about 3.2us so finer tuning than
+The resolution of timer is about 3.2us so finer tuning than
 3.2us wouldn't be available.
 The interface does not need to be brought down and up again before
 a change takes effect.

Modified: head/share/man/man4/vge.4
==
--- head/share/man/man4/vge.4   Sat May 12 03:30:50 2012(r235318)
+++ head/share/man/man4/vge.4   Sat May 12 03:46:43 2012(r235319)
@@ -177,7 +177,7 @@ tunables:
 Maximum number of time to delay interrupts.
 The valid range is 0 to 5100 in units of 1us, the default is
 150 (150us).
-The resolution of of timer is about 20us so finer tuning than
+The resolution of timer is about 20us so finer tuning than
 20us wouldn't be available.
 The interface should be brought down and up again before a change
 takes effect.

Modified: head/share/man/man7/tuning.7
==
--- head/share/man/man7/tuning.7Sat May 12 03:30:50 2012
(r235318)
+++ head/share/man/man7/tuning.7Sat May 12 03:46:43 2012
(r235319)
@@ -447,7 +447,7 @@ the content of mapped buffer to the read
 Increasing this value to a higher setting, such as `25165824' might
 improve performance on systems where space for mapping pipe buffers
 is quickly exhausted.
-This exhaustion is not fatal; however, and it will only cause pipes to
+This exhaustion is not fatal; however, and it will only cause pipes
 to fall back to using double-copy.
 .Pp
 The

Modified: head/share/man/man9/VOP_GETACL.9
==
--- head/share/man/man9/VOP_GETACL.9Sat May 12 03:30:50 2012
(r235318)
+++ head/share/man/man9/VOP_GETACL.9Sat May 12 03:46:43 2012
(r235319)
@@ -79,7 +79,7 @@ Otherwise, an appropriate error code is 
 .It Bq Er 

svn commit: r235320 - head/sys/mips/conf

2012-05-11 Thread Adrian Chadd
Author: adrian
Date: Sat May 12 04:52:59 2012
New Revision: 235320
URL: http://svn.freebsd.org/changeset/base/235320

Log:
  Add in the AP93 configuration file.
  
  The AP93 has:
  
  * AR7240 - mips24k processor with integrated 10/100 switch and
various other peripherals;
  * AR9283 - 2x2 2.4GHz 802.11n (with calibration data in flash);
  * 64MB RAM;
  * 16MB SPI flash.
  
  The switch code detects as an AR8216 at the present moment, which isn't
  _entirely_ strictly true.  However, the MII/MDIO routing in AP93.hints
  works - the arge0 MAC connects to PHY4 in the switch, but via the
  switch internal MDIO bus.  The switch connects to arge0's MDIO bus,
  but only to export the switch registers.
  
  Thanks to stb and ray for the switch work, and ray for helping determine
  what the correct switch hints should be for this thing.

Added:
  head/sys/mips/conf/AP93   (contents, props changed)
  head/sys/mips/conf/AP93.hints   (contents, props changed)

Added: head/sys/mips/conf/AP93
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/AP93 Sat May 12 04:52:59 2012(r235320)
@@ -0,0 +1,138 @@
+#
+# AP93 -- Kernel configuration file for FreeBSD/mips for Atheros AP93 reference
+# board (AR7240)
+#
+# $FreeBSD$
+#
+
+ident  AP93
+
+# XXX The default load address in the Uboot environment is 0x8001
+makeoptionsKERNLOADADDR=0x8005
+optionsHZ=1000
+
+# The AP93 has 64mb of RAM; hard-code that
+optionsAR71XX_REALMEM=64*1024*1024
+
+# It's UBOOT, not Redboot - without this, things will hang at startup
+optionsAR71XX_ENV_UBOOT
+
+makeoptionsMODULES_OVERRIDE=ath ath_pci ath_ahb bridgestp if_bridge 
if_gif if_gre random wlan wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt wlan_tkip 
wlan_wep wlan_xauth usb ar71xx
+
+hints  AP93.hints
+include../atheros/std.ar71xx
+
+makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
+makeoptionsMODULES_OVERRIDE=
+
+optionsDDB
+optionsKDB
+
+optionsSCHED_4BSD  #4BSD scheduler
+optionsINET#InterNETworking
+# Can't do IPv6 - it just doesn't fit.
+# options  INET6
+# options  NFSCL   #Network Filesystem Client
+optionsPSEUDOFS#Pseudo-filesystem framework
+options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time 
extensions
+optionsALQ
+
+# Debugging for use in -current
+optionsDEADLKRES
+optionsINVARIANTS
+optionsINVARIANT_SUPPORT
+optionsWITNESS
+optionsWITNESS_SKIPSPIN
+options FFS #Berkeley Fast Filesystem
+
+# Support uncompress lzma rootfs
+device geom_uncompress
+optionsGEOM_UNCOMPRESS
+optionsROOTDEVNAME=\ufs:/dev/map/rootfs.uncompress\
+
+# PCI bus
+device pci
+device ar724x_pci
+# Enable the AR71xx EEPROM PCI(e) workaround
+optionsAR71XX_ATH_EEPROM
+
+# NVRAM U-Boot Environment - Kernel environment
+device nvram2env
+
+# Wireless NIC cards
+optionsIEEE80211_DEBUG
+optionsIEEE80211_SUPPORT_MESH
+optionsIEEE80211_SUPPORT_TDMA
+optionsIEEE80211_ALQ
+
+device wlan# 802.11 support
+device wlan_wep# 802.11 WEP support
+device wlan_ccmp   # 802.11 CCMP support
+device wlan_tkip   # 802.11 TKIP support
+device wlan_xauth  # 802.11 hostap support
+
+device ath # Atheros pci/cardbus NIC's
+device ath_pci # PCI/PCIe bus glue
+optionsATH_DEBUG
+optionsATH_ENABLE_11N
+optionsATH_DIAGAPI
+device firmware
+optionsATH_EEPROM_FIRMWARE
+
+device ath_hal
+optionsAH_SUPPORT_AR5416
+optionsAH_DEBUG
+optionsAH_DEBUG_ALQ
+
+device ath_rate_sample
+
+device mii
+device arge
+device miiproxy
+optionsARGE_DEBUG
+optionsARGE_MDIO
+device etherswitch
+device arswitch
+
+# USB devices - (todo: does AR7240 have OHCI, or just EHCI?)
+
+#deviceusb
+optionsUSB_EHCI_BIG_ENDIAN_DESC# handle big-endian 
byte order
+optionsUSB_DEBUG
+optionsUSB_HOST_ALIGN=32
+#deviceehci
+
+# Mass storage
+#devicescbus
+#deviceumass
+#deviceda
+
+# Read MSDOS formatted disks
+optionsGEOM_PART_BSD
+optionsGEOM_PART_MBR
+#options   MSDOSFS
+
+# GPIO 

svn commit: r235321 - head/sys/dev/mfi

2012-05-11 Thread Sean Bruno
Author: sbruno
Date: Sat May 12 05:05:22 2012
New Revision: 235321
URL: http://svn.freebsd.org/changeset/base/235321

Log:
  Pointy hat to sleep deprived committer.
  
  Use a *real* variable type instead of one I made up.
  
  Background Music:  Queen -- Bicycle Race
  
  Reviewed by:BSDCAN 2012 Hacker Lounge Audience

Modified:
  head/sys/dev/mfi/mfivar.h

Modified: head/sys/dev/mfi/mfivar.h
==
--- head/sys/dev/mfi/mfivar.h   Sat May 12 04:52:59 2012(r235320)
+++ head/sys/dev/mfi/mfivar.h   Sat May 12 05:05:22 2012(r235321)
@@ -176,7 +176,7 @@ struct mfi_softc {
// Start: LSIP200113393
bus_dma_tag_t   verbuf_h_dmat;
bus_dmamap_tverbuf_h_dmamap;
-   bus_dmamap_tverbuf_h_busaddr;
+   bus_addr_t  verbuf_h_busaddr;
uint32_t*verbuf;
void*kbuff_arr[MAX_IOCTL_SGE];
bus_dma_tag_t   mfi_kbuff_arr_dmat[2];
@@ -232,7 +232,7 @@ struct mfi_softc {
 
bus_dma_tag_t   mfi_sense_dmat;
bus_dmamap_tmfi_sense_dmamap;
-   bus_dmamap_tmfi_sense_busaddr;
+   bus_addr_t  mfi_sense_busaddr;
struct mfi_sense*mfi_sense;
 
struct resource *mfi_irq;
___
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: r235322 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2012-05-11 Thread Jason Evans
Author: jasone
Date: Sat May 12 05:26:49 2012
New Revision: 235322
URL: http://svn.freebsd.org/changeset/base/235322

Log:
  Import jemalloc 3.0.0.  This fixes memory zeroing bugs that manifested as
  jemalloc assertion failures for debug builds, or as calloc() sometimes
  returning non-zeroed memory for production builds.

Modified:
  head/contrib/jemalloc/ChangeLog
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/arena.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/jemalloc.c

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Sat May 12 05:05:22 2012
(r235321)
+++ head/contrib/jemalloc/ChangeLog Sat May 12 05:26:49 2012
(r235322)
@@ -6,7 +6,7 @@ found in the git revision history:
 http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git
 git://canonware.com/jemalloc.git
 
-* 3.0.0 (XXX not yet released)
+* 3.0.0 (May 11, 2012)
 
   Although this version adds some major new features, the primary focus is on
   internal code cleanup that facilitates maintainability and portability, most
@@ -23,6 +23,7 @@ found in the git revision history:
 + FreeBSD
 + Mac OS X Lion
 + MinGW
++ Windows (no support yet for replacing the system malloc)
   - Add support for additional architectures:
 + MIPS
 + SH4
@@ -31,12 +32,13 @@ found in the git revision history:
   - Add nallocm(), which rounds a request size up to the nearest size class
 without actually allocating.
   - Implement aligned_alloc() (blame C11).
-  - Add the --disable-munmap option, and make it the default on Linux.
-  - Add the --with-mangling option.
-  - Add the --disable-experimental option.
   - Add the thread.tcache.enabled mallctl.
   - Add the opt.prof_final mallctl.
   - Update pprof (from gperftools 2.0).
+  - Add the --with-mangling option.
+  - Add the --disable-experimental option.
+  - Add the --disable-munmap option, and make it the default on Linux.
+  - Add the --enable-mremap option, which disables use of mremap(2) by default.
 
   Incompatible changes:
   - Enable stats by default.
@@ -71,6 +73,7 @@ found in the git revision history:
 write-after-free memory corruption.
   - Fix a potential deadlock that could occur during interval- and
 growth-triggered heap profile dumps.
+  - Fix large calloc() zeroing bugs due to dropping chunk map unzeroed flags.
   - Fix chunk_alloc_dss() to stop claiming memory is zeroed.  This bug could
 cause memory corruption and crashes with --enable-dss specified.
   - Fix fork-related bugs that could cause deadlock in children between fork

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Sat May 12 05:05:22 2012
(r235321)
+++ head/contrib/jemalloc/FREEBSD-diffs Sat May 12 05:26:49 2012
(r235322)
@@ -1,5 +1,5 @@
 diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in
-index 93c16dc..b5c5595 100644
+index 877c500..7d659a7 100644
 --- a/doc/jemalloc.xml.in
 +++ b/doc/jemalloc.xml.in
 @@ -51,12 +51,23 @@
@@ -192,7 +192,7 @@ index 000..9efab93
 +#define   pthread_mutex_lock  _pthread_mutex_lock
 +#define   pthread_mutex_unlock_pthread_mutex_unlock
 diff --git a/src/jemalloc.c b/src/jemalloc.c
-index d42e91d..cdf6222 100644
+index bc54cd7..fa9fcf0 100644
 --- a/src/jemalloc.c
 +++ b/src/jemalloc.c
 @@ -8,6 +8,10 @@ malloc_tsd_data(, arenas, arena_t *, NULL)

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Sat May 12 05:05:22 2012
(r235321)
+++ head/contrib/jemalloc/VERSION   Sat May 12 05:26:49 2012
(r235322)
@@ -1 +1 @@
-1.0.0-335-g37b6f95dcd866f51c91488531a2efc3ed4c2b754
+3.0.0-0-gfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Sat May 12 05:05:22 2012
(r235321)
+++ head/contrib/jemalloc/doc/jemalloc.3Sat May 12 05:26:49 2012
(r235322)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 05/09/2012
+.\  Date: 05/11/2012
 .\Manual: User Manual
-.\Source: jemalloc 1.0.0-335-g37b6f95dcd866f51c91488531a2efc3ed4c2b754
+.\Source: jemalloc 3.0.0-0-gfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046
 .\  Language: English
 .\
-.TH JEMALLOC 3 05/09/2012 jemalloc 1.0.0-335-g37b6f95dcd User Manual
+.TH JEMALLOC 3 05/11/2012 jemalloc 3.0.0-0-gfc9b1dbf69f5 User Manual
 .\ 

svn commit: r235323 - in head/sys: conf dev/etherswitch/arswitch

2012-05-11 Thread Adrian Chadd
Author: adrian
Date: Sat May 12 05:26:49 2012
New Revision: 235323
URL: http://svn.freebsd.org/changeset/base/235323

Log:
  Further arswitch work:
  
  * Add in the AR724x support.  It probes the same as an AR8216/AR8316, so
just add in a hint to force the probe success rather than auto-detecting
it.
  
  * Add in the missing entries from conf/files, lacking in the previous
commit.
  
  The register values and CPU port / mirror port initialisation value was
  obtained from Linux OpenWRT ag71xx_ar7240.c.
  
  The DELAY(1000) to let things settle is my local workaround.  For some
  reason, PHY4 doesn't seem to probe very reliably without it.  It's quite
  possible that we're missing some MDIO bus initialisation code in if_arge
  for the AR724x case.  As I dislike DELAY() workarounds in general, it's
  definitely worth trying to figure out why this is the case.
  
  Tested on:AP93 (AR7240) reference design
  
  Obtained from:Linux OpenWRT

Added:
  head/sys/dev/etherswitch/arswitch/arswitch_7240.c   (contents, props changed)
  head/sys/dev/etherswitch/arswitch/arswitch_7240.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/etherswitch/arswitch/arswitch.c
  head/sys/dev/etherswitch/arswitch/arswitchvar.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat May 12 05:26:49 2012(r235322)
+++ head/sys/conf/files Sat May 12 05:26:49 2012(r235323)
@@ -3688,3 +3688,16 @@ dev/xen/xenpci/evtchn.c optional
 dev/etherswitch/mdio_if.m  optional miiproxy
 dev/etherswitch/mdio.c optional miiproxy
 dev/etherswitch/miiproxy.c optional miiproxy
+
+dev/etherswitch/etherswitch.c  optional etherswitch
+dev/etherswitch/etherswitch_if.m   optional etherswitch
+
+dev/etherswitch/rtl8366/rtl8366rb.coptional rtl8366rb
+
+dev/etherswitch/arswitch/arswitch.coptional arswitch
+dev/etherswitch/arswitch/arswitch_reg.coptional arswitch
+dev/etherswitch/arswitch/arswitch_phy.coptional arswitch
+dev/etherswitch/arswitch/arswitch_8216.c   optional arswitch
+dev/etherswitch/arswitch/arswitch_8226.c   optional arswitch
+dev/etherswitch/arswitch/arswitch_8316.c   optional arswitch
+dev/etherswitch/arswitch/arswitch_7240.c   optional arswitch

Modified: head/sys/dev/etherswitch/arswitch/arswitch.c
==
--- head/sys/dev/etherswitch/arswitch/arswitch.cSat May 12 05:26:49 
2012(r235322)
+++ head/sys/dev/etherswitch/arswitch/arswitch.cSat May 12 05:26:49 
2012(r235323)
@@ -59,6 +59,7 @@
 #include dev/etherswitch/arswitch/arswitch_reg.h
 #include dev/etherswitch/arswitch/arswitch_phy.h
 
+#include dev/etherswitch/arswitch/arswitch_7240.h
 #include dev/etherswitch/arswitch/arswitch_8216.h
 #include dev/etherswitch/arswitch/arswitch_8226.h
 #include dev/etherswitch/arswitch/arswitch_8316.h
@@ -96,6 +97,15 @@ arswitch_probe(device_t dev)
sc = device_get_softc(dev);
bzero(sc, sizeof(*sc));
sc-page = -1;
+
+   /* AR7240 probe */
+   if (ar7240_probe(dev) == 0) {
+   chipname = AR7240;
+   sc-sc_switchtype = AR8X16_SWITCH_AR7240;
+   goto done;
+   }
+
+   /* AR8xxx probe */
id = arswitch_readreg(dev, AR8X16_REG_MASK_CTRL);
switch ((id  AR8X16_MASK_CTRL_VER_MASK) 
AR8X16_MASK_CTRL_VER_SHIFT) {
@@ -114,6 +124,8 @@ arswitch_probe(device_t dev)
default:
chipname = NULL;
}
+
+done:
DPRINTF(dev, chipname=%s, rev=%02x\n, chipname,
id  AR8X16_MASK_CTRL_REV_MASK);
if (chipname != NULL) {
@@ -176,7 +188,9 @@ arswitch_attach(device_t dev)
/*
 * Attach switch related functions
 */
-   if (AR8X16_IS_SWITCH(sc, AR8216))
+   if (AR8X16_IS_SWITCH(sc, AR7240))
+   ar7240_attach(sc);
+   else if (AR8X16_IS_SWITCH(sc, AR8216))
ar8216_attach(sc);
else if (AR8X16_IS_SWITCH(sc, AR8226))
ar8226_attach(sc);

Added: head/sys/dev/etherswitch/arswitch/arswitch_7240.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/etherswitch/arswitch/arswitch_7240.c   Sat May 12 05:26:49 
2012(r235323)
@@ -0,0 +1,143 @@
+/*-
+ * Copyright (c) 2011-2012 Stefan Bethke.
+ * Copyright (c) 2012 Adrian Chadd.
+ * 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 

svn commit: r235324 - head/sys/mips/conf

2012-05-11 Thread Adrian Chadd
Author: adrian
Date: Sat May 12 05:27:14 2012
New Revision: 235324
URL: http://svn.freebsd.org/changeset/base/235324

Log:
  Now that there's a hint for it, add a I'm an AR7240 switch! hint.

Modified:
  head/sys/mips/conf/AP93.hints

Modified: head/sys/mips/conf/AP93.hints
==
--- head/sys/mips/conf/AP93.hints   Sat May 12 05:26:49 2012
(r235323)
+++ head/sys/mips/conf/AP93.hints   Sat May 12 05:27:14 2012
(r235324)
@@ -41,11 +41,10 @@ hint.arge.1.phymask=0x0
 hint.arge.1.media=1000 # Force to 1000BaseTX/full
 hint.arge.1.fduplex=1
 
-# AR7240 switch config
 #
-# XXX TODO - have the AR7240 switch auto-detect correctly?
-# XXX It detects as an AR8216, which isn't strictly true!
+# AR7240 switch config
 #
+hint.arswitch.0.is_7240=1  # We need to be explicitly told this
 hint.arswitch.0.numphys=4  # 4 active switch PHYs (PHY 0 - 3)
 hint.arswitch.0.phy4cpu=1  # Yes, PHY 4 == dedicated PHY
 hint.arswitch.0.is_rgmii=0 # No, not RGMII
___
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