svn commit: r297443 - in head/sys: dev/nctgpio modules modules/nctgpio

2016-03-30 Thread Adrian Chadd
Author: adrian
Date: Thu Mar 31 04:57:38 2016
New Revision: 297443
URL: https://svnweb.freebsd.org/changeset/base/297443

Log:
  Add support for the Nuvoton NCT5104D.
  
  Make it compile only for i386/amd64 for now as it's been tested there.
  It's quite possible it'll show up elsewhere and we can enable it
  for other architectures later.
  
  Tested:
  
  * PC Engines APU1C4
  
  Submitted by: Daniel Wyatt 
  Reviewed by:  adrian, loos
  Differential Revision:https://reviews.freebsd.org/D5389

Added:
  head/sys/dev/nctgpio/
  head/sys/dev/nctgpio/nctgpio.c   (contents, props changed)
  head/sys/modules/nctgpio/
  head/sys/modules/nctgpio/Makefile   (contents, props changed)
Modified:
  head/sys/modules/Makefile

Added: head/sys/dev/nctgpio/nctgpio.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/nctgpio/nctgpio.c  Thu Mar 31 04:57:38 2016
(r297443)
@@ -0,0 +1,802 @@
+/*-
+ * Copyright (c) 2016 Daniel Wyatt 
+ * 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.
+ *
+ * $FreeBSD$
+ *
+ */
+
+/*
+ * Nuvoton GPIO driver.
+ *
+ */
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include "gpio_if.h"
+
+/*
+ * Global configuration registers (CR).
+ */
+#define NCT_CR_LDN 0x07/* Logical Device Number */
+#define NCT_CR_CHIP_ID 0x20/* Chip ID */
+#define NCT_CR_CHIP_ID_H   0x20/* Chip ID (high byte) */
+#define NCT_CR_CHIP_ID_L   0x21/* Chip ID (low byte) */
+#define NCT_CR_OPT_1   0x26/* Global Options (1) */
+
+/* Logical Device Numbers. */
+#define NCT_LDN_GPIO   0x07
+#define NCT_LDN_GPIO_CFG   0x08
+#define NCT_LDN_GPIO_MODE  0x0f
+
+/* Logical Device 7 */
+#define NCT_LD7_GPIO_ENABLE0x30
+#define NCT_LD7_GPIO0_IOR  0xe0
+#define NCT_LD7_GPIO0_DAT  0xe1
+#define NCT_LD7_GPIO0_INV  0xe2
+#define NCT_LD7_GPIO0_DST  0xe3
+#define NCT_LD7_GPIO1_IOR  0xe4
+#define NCT_LD7_GPIO1_DAT  0xe5
+#define NCT_LD7_GPIO1_INV  0xe6
+#define NCT_LD7_GPIO1_DST  0xe7
+
+/* Logical Device F */
+#define NCT_LDF_GPIO0_OUTCFG   0xe0
+#define NCT_LDF_GPIO1_OUTCFG   0xe1
+
+#define NCT_EXTFUNC_ENTER  0x87
+#define NCT_EXTFUNC_EXIT   0xaa
+
+#define NCT_MAX_PIN15
+#define NCT_IS_VALID_PIN(_p)   ((_p) >= 0 && (_p) <= NCT_MAX_PIN)
+
+#define NCT_PIN_BIT(_p) (1 << ((_p) % 8))
+
+#define NCT_GPIO_CAPS  (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \
+   GPIO_PIN_OPENDRAIN | GPIO_PIN_PUSHPULL | \
+   GPIO_PIN_INVIN | GPIO_PIN_INVOUT)
+
+struct nct_softc {
+   device_tdev;
+   device_tbusdev;
+   struct mtx  mtx;
+   struct resource *portres;
+   int rid;
+   struct gpio_pin pins[NCT_MAX_PIN];
+};
+
+#define GPIO_LOCK_INIT(_sc)mtx_init(&(_sc)->mtx,   \
+   device_get_nameunit(dev), NULL, MTX_DEF)
+#define GPIO_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->mtx)
+#define GPIO_LOCK(_sc) mtx_lock(&(_sc)->mtx)
+#define GPIO_UNLOCK(_sc)   mtx_unlock(&(_sc)->mtx)
+#define GPIO_ASSERT_LOCKED(_sc)mtx_assert(&(_sc)->mtx, MA_OWNED)
+#define GPIO_ASSERT_UNLOCKED(_sc)  mtx_assert(&(_sc)->mtx, 

svn commit: r297442 - head/targets/pseudo/hosttools

2016-03-30 Thread Bryan Drewery
Author: bdrewery
Date: Thu Mar 31 03:04:26 2016
New Revision: 297442
URL: https://svnweb.freebsd.org/changeset/base/297442

Log:
  hosttools: Trim unneeded directories.
  
  These should only be build tools that are in various Makefile.depend
  as host dependencies.  Anything toolchain related is handled by
  toolchain and bootstrap-tools currently.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/targets/pseudo/hosttools/Makefile.depend.host

Modified: head/targets/pseudo/hosttools/Makefile.depend.host
==
--- head/targets/pseudo/hosttools/Makefile.depend.host  Thu Mar 31 02:01:11 
2016(r297441)
+++ head/targets/pseudo/hosttools/Makefile.depend.host  Thu Mar 31 03:04:26 
2016(r297442)
@@ -9,21 +9,14 @@
 # These are all .host dependencies
 
 DIRDEPS = \
-   lib/clang/include \
-   lib/libc++ \
-   lib/libcxxrt \
-   share/doc/llvm/clang \
usr.bin/clang/clang-tblgen \
-   usr.bin/clang/clang \
usr.bin/clang/llvm-tblgen \
-   usr.bin/lex/lib \
usr.bin/localedef \
usr.bin/mkcsmapper_static \
usr.bin/mkesdb_static \
-   usr.bin/mkuzip \
-   usr.bin/yacc \
usr.bin/xinstall \
usr.bin/xlint/xlint \
+   usr.bin/yacc \
usr.sbin/config \
 
 .if ${MK_KERBEROS} != "no"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297441 - head/sbin/restore

2016-03-30 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Mar 31 02:01:11 2016
New Revision: 297441
URL: https://svnweb.freebsd.org/changeset/base/297441

Log:
  restore(8): fix use of uninitialized value.
  
  Prevent uninitialized use of scalar newvol when jumping to gethdr.
  
  CID:  1006491

Modified:
  head/sbin/restore/tape.c

Modified: head/sbin/restore/tape.c
==
--- head/sbin/restore/tape.cThu Mar 31 01:36:50 2016(r297440)
+++ head/sbin/restore/tape.cThu Mar 31 02:01:11 2016(r297441)
@@ -340,6 +340,7 @@ getvol(long nextvol)
}
if (volno == 1)
return;
+   newvol = 0;
goto gethdr;
}
 again:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297440 - stable/10/lib/libc/locale

2016-03-30 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Mar 31 01:36:50 2016
New Revision: 297440
URL: https://svnweb.freebsd.org/changeset/base/297440

Log:
  MFC   r296278:
  mbtowc(3): set errno to EILSEQ if an incomplete character is passed.
  
  According to POSIX, The mbtowc() function shall fail if:
  [EILSEQ] An invalid character sequence is detected.
  
  Reviewed by:  bapt
  Differential Revision:https://reviews.freebsd.org/D5496
  
  Obtained from:OpenBSD (Ingo Schwarze)

Modified:
  stable/10/lib/libc/locale/mbtowc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/locale/mbtowc.c
==
--- stable/10/lib/libc/locale/mbtowc.c  Thu Mar 31 00:53:23 2016
(r297439)
+++ stable/10/lib/libc/locale/mbtowc.c  Thu Mar 31 01:36:50 2016
(r297440)
@@ -32,6 +32,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include "mblocal.h"
@@ -49,9 +50,15 @@ mbtowc_l(wchar_t * __restrict pwc, const
return (0);
}
rval = XLOCALE_CTYPE(locale)->__mbrtowc(pwc, s, n, >mbtowc);
-   if (rval == (size_t)-1 || rval == (size_t)-2)
+   switch (rval) {
+   case (size_t)-2:
+   errno = EILSEQ;
+   /* FALLTHROUGH */
+   case (size_t)-1:
return (-1);
-   return ((int)rval);
+   default:
+   return ((int)rval);
+   }
 }
 int
 mbtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297439 - in head/sys: netinet netinet6

2016-03-30 Thread George V. Neville-Neil
Author: gnn
Date: Thu Mar 31 00:53:23 2016
New Revision: 297439
URL: https://svnweb.freebsd.org/changeset/base/297439

Log:
  Unbreak the RSS/PCBGROUp build.

Modified:
  head/sys/netinet/in_pcbgroup.c
  head/sys/netinet6/in6_pcbgroup.c

Modified: head/sys/netinet/in_pcbgroup.c
==
--- head/sys/netinet/in_pcbgroup.c  Thu Mar 31 00:26:40 2016
(r297438)
+++ head/sys/netinet/in_pcbgroup.c  Thu Mar 31 00:53:23 2016
(r297439)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 

Modified: head/sys/netinet6/in6_pcbgroup.c
==
--- head/sys/netinet6/in6_pcbgroup.cThu Mar 31 00:26:40 2016
(r297438)
+++ head/sys/netinet6/in6_pcbgroup.cThu Mar 31 00:53:23 2016
(r297439)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 #include 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297438 - head/share/mk

2016-03-30 Thread Bryan Drewery
Author: bdrewery
Date: Thu Mar 31 00:26:40 2016
New Revision: 297438
URL: https://svnweb.freebsd.org/changeset/base/297438

Log:
  DIRDEPS_BUILD: Don't reset OBJROOT in sub-makes.
  
  MAKEOBJDIRPREFIX is set to blank and exported from MAKELEVEL0 along
  with OBJROOT exported.  In sub-makes OBJROOT is recalculated with
  an empty MAKEOBJDIRPREFIX though.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/local.meta.sys.mk

Modified: head/share/mk/local.meta.sys.mk
==
--- head/share/mk/local.meta.sys.mk Wed Mar 30 23:56:43 2016
(r297437)
+++ head/share/mk/local.meta.sys.mk Thu Mar 31 00:26:40 2016
(r297438)
@@ -10,7 +10,7 @@ MK_INSTALL_AS_USER= yes
 _default_makeobjdir=$${.CURDIR:S,^$${SRCTOP},$${OBJTOP},}
 
 .if empty(OBJROOT) || ${.MAKE.LEVEL} == 0
-.if defined(MAKEOBJDIRPREFIX)
+.if defined(MAKEOBJDIRPREFIX) && !empty(MAKEOBJDIRPREFIX)
 # put things approximately where they want
 OBJROOT:=${MAKEOBJDIRPREFIX}${SRCTOP}/
 MAKEOBJDIRPREFIX=
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-03-30 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar 30 23:56:43 2016
New Revision: 297437
URL: https://svnweb.freebsd.org/changeset/base/297437

Log:
  Regenerate

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

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Wed Mar 30 23:53:12 2016
(r297436)
+++ head/share/man/man5/src.conf.5  Wed Mar 30 23:56:43 2016
(r297437)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z 
bdrewery
 .\" $FreeBSD$
-.Dd March 11, 2016
+.Dd March 30, 2016
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -248,7 +248,7 @@ Set to not build Capsicum support into s
 .\" from FreeBSD: head/tools/build/options/WITHOUT_CASPER 258838 2013-12-02 
08:21:28Z pjd
 Set to not build Casper program and related libraries.
 .It Va WITH_CCACHE_BUILD
-.\" from FreeBSD: head/tools/build/options/WITH_CCACHE_BUILD 290526 2015-11-08 
00:50:18Z bdrewery
+.\" from FreeBSD: head/tools/build/options/WITH_CCACHE_BUILD 297436 2016-03-30 
23:53:12Z bdrewery
 Set to use
 .Xr ccache 1
 for the build.
@@ -274,9 +274,6 @@ when using an external compiler.
 The
 .Sy CCACHE_CPP2
 option is used for Clang but not GCC.
-ccache works best when combined with the
-.Sy WITH_FAST_DEPEND
-option.
 .Pp
 Sharing a cache between multiple work directories requires using a layout
 similar to
@@ -517,8 +514,6 @@ When set, it also enforces the following
 .Pp
 .Bl -item -compact
 .It
-.Va WITH_FAST_DEPEND
-.It
 .Va WITH_INSTALL_AS_USER
 .El
 .Pp
@@ -618,12 +613,6 @@ An alternate bootstrap tool chain must b
 .\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 
09:06:24Z ru
 Set to avoid installing examples to
 .Pa /usr/share/examples/ .
-.It Va WITHOUT_FAST_DEPEND
-.\" from FreeBSD: head/tools/build/options/WITHOUT_FAST_DEPEND 296669 
2016-03-11 17:00:42Z bdrewery
-Set to use the historical
-.Xr mkdep 1
-for the "make depend" phase of the build.
-This option is deprecated and will be removed soon.
 .It Va WITHOUT_FDT
 .\" from FreeBSD: head/tools/build/options/WITHOUT_FDT 221539 2011-05-06 
19:10:27Z ru
 Set to not build Flattened Device Tree support as part of the base system.
@@ -1459,6 +1448,8 @@ When set, it also enforces the following
 .Va WITHOUT_GDB
 .It
 .Va WITHOUT_INCLUDES
+.It
+.Va WITHOUT_LLDB
 .El
 .It Va WITHOUT_UNBOUND
 .\" from FreeBSD: head/tools/build/options/WITHOUT_UNBOUND 255597 2013-09-15 
14:51:23Z des
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297436 - head/tools/build/options

2016-03-30 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar 30 23:53:12 2016
New Revision: 297436
URL: https://svnweb.freebsd.org/changeset/base/297436

Log:
  Remove FAST_DEPEND reference missed in r297434.

Modified:
  head/tools/build/options/WITH_CCACHE_BUILD

Modified: head/tools/build/options/WITH_CCACHE_BUILD
==
--- head/tools/build/options/WITH_CCACHE_BUILD  Wed Mar 30 23:50:29 2016
(r297435)
+++ head/tools/build/options/WITH_CCACHE_BUILD  Wed Mar 30 23:53:12 2016
(r297436)
@@ -24,9 +24,6 @@ when using an external compiler.
 The
 .Sy CCACHE_CPP2
 option is used for Clang but not GCC.
-ccache works best when combined with the
-.Sy WITH_FAST_DEPEND
-option.
 .Pp
 Sharing a cache between multiple work directories requires using a layout
 similar to
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297434 - in head: . gnu/lib/csu kerberos5 release/picobsd/build secure share/man/man5 share/man/man7 share/mk sys/conf sys/modules/pflog sys/modules/pfsync sys/modules/wtap tools tools...

2016-03-30 Thread Bryan Drewery
P} != "no"
mkdir -p ${OBJTREE}/gperf_for_gcc/usr/bin
-   ${_+_}@${ECHODIR} "===> ${_gperf} (obj,depend,all,install)"; \
+   ${_+_}@${ECHODIR} "===> ${_gperf} (obj,all,install)"; \
cd ${.CURDIR}/${_gperf}; \
${NXBMAKE} DIRPRFX=${_gperf}/ obj; \
-   if [ -z "${NO_DEPEND}" ]; then ${NXBMAKE} DIRPRFX=${_gperf}/ depend; 
fi; \
${NXBMAKE} DIRPRFX=${_gperf}/ all; \
${NXBMAKE} DIRPRFX=${_gperf}/ DESTDIR=${OBJTREE}/gperf_for_gcc install
 .endif
@@ -1687,10 +1649,9 @@ native-xtools: .PHONY
 usr.bin/xz \
 usr.bin/yacc \
 usr.sbin/chown
-   ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
+   ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
cd ${.CURDIR}/${_tool}; \
${NXBMAKE} DIRPRFX=${_tool}/ obj; \
-   if [ -z "${NO_DEPEND}" ]; then ${NXBMAKE} DIRPRFX=${_tool}/ 
depend; fi; \
${NXBMAKE} DIRPRFX=${_tool}/ all; \
${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${NXBDESTDIR} install
 .endfor
@@ -1926,10 +1887,9 @@ gnu/lib/libdialog__L: lib/msun__L lib/nc
 .for _lib in ${_prereq_libs}
 ${_lib}__PL: .PHONY .MAKE
 .if exists(${.CURDIR}/${_lib})
-   ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
+   ${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \
cd ${.CURDIR}/${_lib}; \
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \
-   if [ -z "${NO_DEPEND}" ]; then ${MAKE} MK_TESTS=no 
DIRPRFX=${_lib}/ depend; fi; \
${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
DIRPRFX=${_lib}/ all; \
${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
@@ -1940,10 +1900,9 @@ ${_lib}__PL: .PHONY .MAKE
 .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
 ${_lib}__L: .PHONY .MAKE
 .if exists(${.CURDIR}/${_lib})
-   ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
+   ${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \
cd ${.CURDIR}/${_lib}; \
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \
-   if [ -z "${NO_DEPEND}" ]; then ${MAKE} MK_TESTS=no 
DIRPRFX=${_lib}/ depend; fi; \
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all; \
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ install
 .endif
@@ -1953,10 +1912,9 @@ ${_lib}__L: .PHONY .MAKE
 # static PAM library, and dynamic PAM library before dynamic PAM
 # modules.
 lib/libpam__L: .PHONY .MAKE
-   ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
+   ${_+_}@${ECHODIR} "===> lib/libpam (obj,all,install)"; \
cd ${.CURDIR}/lib/libpam; \
${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj; \
-   if [ -z "${NO_DEPEND}" ]; then ${MAKE} MK_TESTS=no 
DIRPRFX=lib/libpam/ depend; fi; \
${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \
-D_NO_LIBPAM_SO_YET all; \
${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \
@@ -2251,10 +2209,9 @@ _xb-bootstrap-tools: .PHONY
 .for _tool in \
 ${_clang_tblgen} \
 ${_gperf}
-   ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
+   ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
cd ${.CURDIR}/${_tool}; \
${CDMAKE} DIRPRFX=${_tool}/ obj; \
-   if [ -z "${NO_DEPEND}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ depend; fi; \
${CDMAKE} DIRPRFX=${_tool}/ all; \
${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install
 .endfor
@@ -2271,10 +2228,9 @@ _xb-cross-tools: .PHONY
 ${_clang_libs} \
 ${_clang} \
 ${_cc}
-   ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \
+   ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,all)"; \
cd ${.CURDIR}/${_tool}; \
${CDMAKE} DIRPRFX=${_tool}/ obj; \
-   if [ -z "${NO_DEPEND}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ depend; fi; \
${CDMAKE} DIRPRFX=${_tool}/ all
 .endfor
 

Modified: head/Makefile.libcompat
==
--- head/Makefile.libcompat Wed Mar 30 22:26:14 2016(r297433)
+++ head/Makefile.libcompat Wed Mar 30 23:50:23 2016(r297434)
@@ -148,7 +148,7 @@ build${libcompat}: .PHONY
${_+_}cd ${.CURDIR}; \
    ${LIBCOMPATWMAKE} -f Makefile.inc1 -DNO_FSCHG libraries
 .if ${libcompat} == "32"
-.for _t in obj depend all
+.for _t in obj all
${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 
${LIBCOMPATWMAKE} \
-DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t}
${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIBCOMPATWMAKE} \

Modified: head/UPDATING
=

svn commit: r297435 - head

2016-03-30 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar 30 23:50:29 2016
New Revision: 297435
URL: https://svnweb.freebsd.org/changeset/base/297435

Log:
  Fix the external GCC build after r297271 by setting -L /usr/lib.
  
  GCC does add /usr/lib to the library search path but it comes after
  /usr/local/lib which can find ports libraries such as libedit.so.  The
  bad path comes in as 
/usr/local/lib/gcc/x86_64-portbld-freebsd11.0/5.3.0/../../../
  which corresponds to /lib.
  
  This partially reverts r297271.
  
  Pointyhat to: bdrewery
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Mar 30 23:50:23 2016(r297434)
+++ head/Makefile.inc1  Wed Mar 30 23:50:29 2016(r297435)
@@ -421,8 +421,8 @@ TARGET_ABI= gnueabi
 .endif
 .endif
 .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc
-# GCC requires -isystem when using a cross-compiler.
-XCFLAGS+=  -isystem ${WORLDTMP}/usr/include
+# GCC requires -isystem and -L when using a cross-compiler.
+XCFLAGS+=  -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib
 # Force using libc++ for external GCC.
 XCXXFLAGS+=-isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \
-nostdinc++ -L${WORLDTMP}/../lib/libc++
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297433 - head/targets

2016-03-30 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar 30 22:26:14 2016
New Revision: 297433
URL: https://svnweb.freebsd.org/changeset/base/297433

Log:
  show-valid-targets: Indent each target 2 spaces.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/targets/Makefile.xtras

Modified: head/targets/Makefile.xtras
==
--- head/targets/Makefile.xtras Wed Mar 30 22:12:07 2016(r297432)
+++ head/targets/Makefile.xtras Wed Mar 30 22:26:14 2016(r297433)
@@ -49,11 +49,11 @@ show-valid-targets:
 .for _machine in ${all_machine_list:O}
 .if !empty(BUILD_TARGETS_${_machine:tu})
@echo "Build targets for ${_machine} (leave out the 
${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):"
-   @echo "${BUILD_TARGETS_${_machine:tu}:O:ts\n}"
+   @echo -e "${BUILD_TARGETS_${_machine:tu}:O:ts\n}" | sed -e 's,^,  ,'
@echo
 .endif
 .endfor
-   @echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}"
+   @echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}" | sed -e 's,^,  
,'
 .endif
 
 help: show-help
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297432 - in stable: 10/include 9/include

2016-03-30 Thread Dimitry Andric
Author: dim
Date: Wed Mar 30 22:12:07 2016
New Revision: 297432
URL: https://svnweb.freebsd.org/changeset/base/297432

Log:
  MFC r297212:
  
  For C++, expose long long types and functions (lldiv_t, llabs, lldiv,
  etc) in stdlib.h.  These will be needed for newer versions of libc++,
  which uses them for defining overloaded versions of abs() and div().

Modified:
  stable/10/include/stdlib.h
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/9/include/stdlib.h
Directory Properties:
  stable/9/   (props changed)
  stable/9/include/   (props changed)

Modified: stable/10/include/stdlib.h
==
--- stable/10/include/stdlib.h  Wed Mar 30 21:31:34 2016(r297431)
+++ stable/10/include/stdlib.h  Wed Mar 30 22:12:07 2016(r297432)
@@ -124,7 +124,7 @@ size_t   wcstombs(char * __restrict, cons
  *
  * (The only other extension made by C99 in thie header is _Exit().)
  */
-#if __ISO_C_VISIBLE >= 1999
+#if __ISO_C_VISIBLE >= 1999 || defined(__cplusplus)
 #ifdef __LONG_LONG_SUPPORTED
 /* LONGLONG */
 typedef struct {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297432 - in stable: 10/include 9/include

2016-03-30 Thread Dimitry Andric
Author: dim
Date: Wed Mar 30 22:12:07 2016
New Revision: 297432
URL: https://svnweb.freebsd.org/changeset/base/297432

Log:
  MFC r297212:
  
  For C++, expose long long types and functions (lldiv_t, llabs, lldiv,
  etc) in stdlib.h.  These will be needed for newer versions of libc++,
  which uses them for defining overloaded versions of abs() and div().

Modified:
  stable/9/include/stdlib.h
Directory Properties:
  stable/9/   (props changed)
  stable/9/include/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/include/stdlib.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/9/include/stdlib.h
==
--- stable/9/include/stdlib.h   Wed Mar 30 21:31:34 2016(r297431)
+++ stable/9/include/stdlib.h   Wed Mar 30 22:12:07 2016(r297432)
@@ -124,7 +124,7 @@ size_t   wcstombs(char * __restrict, cons
  *
  * (The only other extension made by C99 in thie header is _Exit().)
  */
-#if __ISO_C_VISIBLE >= 1999
+#if __ISO_C_VISIBLE >= 1999 || defined(__cplusplus)
 #ifdef __LONG_LONG_SUPPORTED
 /* LONGLONG */
 typedef struct {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297431 - head/share/mk

2016-03-30 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar 30 21:31:34 2016
New Revision: 297431
URL: https://svnweb.freebsd.org/changeset/base/297431

Log:
  Remove redundant code imported into dirdeps.mk in r290956.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/local.dirdeps.mk

Modified: head/share/mk/local.dirdeps.mk
==
--- head/share/mk/local.dirdeps.mk  Wed Mar 30 18:55:58 2016
(r297430)
+++ head/share/mk/local.dirdeps.mk  Wed Mar 30 21:31:34 2016
(r297431)
@@ -9,15 +9,6 @@
 # DEP_MACHINE is set before we get here, this may not be.
 DEP_RELDIR ?= ${RELDIR}
 
-.if ${.TARGETS:Uall:M*/*} && empty(DIRDEPS)
-# This little trick let's us do
-#
-# mk -f dirdeps.mk some/dir.i386,bsd
-#
-DIRDEPS := ${.TARGETS:M*/*}
-${.TARGETS:Nall}: all
-.endif
-
 # making universe is special
 .if defined(UNIVERSE_GUARD)
 # these should be done by now
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297430 - head/targets

2016-03-30 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar 30 18:55:58 2016
New Revision: 297430
URL: https://svnweb.freebsd.org/changeset/base/297430

Log:
  show-valid-targets: Organize all targets by the all_machine_list.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/targets/Makefile.xtras

Modified: head/targets/Makefile.xtras
==
--- head/targets/Makefile.xtras Wed Mar 30 18:45:18 2016(r297429)
+++ head/targets/Makefile.xtras Wed Mar 30 18:55:58 2016(r297430)
@@ -33,23 +33,27 @@ OTHER_TARGETS = \
destroy-host \
destroy-stage \
 
-BUILD_TARGETS != cd ${_here} && \
+BUILD_TARGETS_${MACHINE:tu} != cd ${_here} && \
find . \( -name Makefile.depend -o -name ${.MAKE.DEPENDFILE:T} \) | \
sed 's,/Makefile.*,,;s,^./,,' | sort -u
 
-BUILD_TARGETS_HOST != cd ${_here} && \
-   find . \( -name Makefile.depend.host -o -name 
${.MAKE.DEPENDFILE:T}.host \) | \
+.for _machine in ${all_machine_list}
+_targets_${_machine} != cd ${_here} && \
+   find . \( -name Makefile.depend.${_machine} -o \
+   -name ${.MAKE.DEPENDFILE:T}.${_machine} \) | \
sed 's,/Makefile.*,,;s,^./,,' | sort -u
+BUILD_TARGETS_${_machine:tu} += ${_targets_${_machine}}
+.endfor
 
 show-valid-targets:
-.if !empty(BUILD_TARGETS_HOST)
-   @echo "Build targets for host (leave out the 
${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):"
-   @echo "${BUILD_TARGETS_HOST:O:ts\n}"
+.for _machine in ${all_machine_list:O}
+.if !empty(BUILD_TARGETS_${_machine:tu})
+   @echo "Build targets for ${_machine} (leave out the 
${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):"
+   @echo "${BUILD_TARGETS_${_machine:tu}:O:ts\n}"
@echo
 .endif
-   @echo "Build targets for ${MACHINE} (leave out the 
${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):"
-   @echo "${BUILD_TARGETS:O:ts\n}"
-   @echo; echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}"
+.endfor
+   @echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}"
 .endif
 
 help: show-help
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r297426 - in head/sys: arm/conf boot/fdt/dts/arm

2016-03-30 Thread Emmanuel Vadot

 Hi Luiz,

 Why setting the pins to SPI mode here ? This should be done in your own board 
dts file if you need it (unless there is some spi chip on the BBB that I don't 
know of). 
 This reduce the number of GPIOs available on the headers.

 Thanks,

On Wed, 30 Mar 2016 17:32:15 + (UTC)
Luiz Otavio O Souza  wrote:

> Author: loos
> Date: Wed Mar 30 17:32:14 2016
> New Revision: 297426
> URL: https://svnweb.freebsd.org/changeset/base/297426
> 
> Log:
>   Enable SPI1 on Beaglebone Black.
>   
>   SPI1 was chosen because SPI0 shares the gpio pins with I2C1.
>   
>   Sponsored by:   Rubicon Communications (Netgate)
> 
> Modified:
>   head/sys/arm/conf/BEAGLEBONE
>   head/sys/boot/fdt/dts/arm/beaglebone-black.dts
> 
> Modified: head/sys/arm/conf/BEAGLEBONE
> ==
> --- head/sys/arm/conf/BEAGLEBONE  Wed Mar 30 17:18:49 2016
> (r297425)
> +++ head/sys/arm/conf/BEAGLEBONE  Wed Mar 30 17:32:14 2016
> (r297426)
> @@ -87,6 +87,10 @@ device gpio
>  device   gpioled
>  device   gpiobacklight
>  
> +# SPI
> +device   ti_spi
> +device   spibus
> +
>  # ADC support
>  device   ti_adc
>  
> 
> Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts
> ==
> --- head/sys/boot/fdt/dts/arm/beaglebone-black.dtsWed Mar 30 17:18:49 
> 2016(r297425)
> +++ head/sys/boot/fdt/dts/arm/beaglebone-black.dtsWed Mar 30 17:32:14 
> 2016(r297426)
> @@ -37,6 +37,16 @@
>   AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE2)   
> /* spi0_cs0.i2c1_scl */
>   >;
>   };
> +
> + spi1_pins: pinmux_spi1_pins {
> + pinctrl-single,pins = <
> + AM33XX_IOPAD(0x964, PIN_INPUT_PULLUP | MUX_MODE2)   
> /* eCAP0_in_PWM0_out.spi1_cs1 */
> + AM33XX_IOPAD(0x990, PIN_INPUT_PULLDOWN | MUX_MODE3) 
> /* mcasp0_aclkx.spi1_sclk */
> + AM33XX_IOPAD(0x994, PIN_INPUT_PULLDOWN | MUX_MODE3) 
> /* mcasp0_fsx.spi1_d0 - miso */
> + AM33XX_IOPAD(0x998, PIN_INPUT_PULLUP | MUX_MODE3)   
> /* mcasp0_axr0.spi1_d1  - mosi */
> + AM33XX_IOPAD(0x99c, PIN_INPUT_PULLUP | MUX_MODE3)   
> /* mcasp0_ahclkr.spi1_cs0 */
> + >;
> + };
>  };
>  
>   {
> @@ -65,6 +75,13 @@
>   status = "okay";
>  };
>  
> + {
> + pinctrl-names = "default";
> + pinctrl-0 = <_pins>;
> +
> + status = "okay";
> +};
> +
>   {
>   hdmi = <>;
>  };
> ___
> svn-src-h...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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


svn commit: r297429 - stable/10/sys/netpfil/pf

2016-03-30 Thread Kristof Provost
Author: kp
Date: Wed Mar 30 18:45:18 2016
New Revision: 297429
URL: https://svnweb.freebsd.org/changeset/base/297429

Log:
  MFC 296932:
  pf: Improve forwarding detection
  
  When we guess the nature of the outbound packet (output vs. forwarding) we 
need
  to take bridges into account. When bridging the input interface does not match
  the output interface, but we're not forwarding. Similarly, it's possible for 
the
  interface to actually be the bridge interface itself (and not a member 
interface).

Modified:
  stable/10/sys/netpfil/pf/pf.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netpfil/pf/pf.c
==
--- stable/10/sys/netpfil/pf/pf.c   Wed Mar 30 18:40:09 2016
(r297428)
+++ stable/10/sys/netpfil/pf/pf.c   Wed Mar 30 18:45:18 2016
(r297429)
@@ -6145,11 +6145,13 @@ pf_test6(int dir, struct ifnet *ifp, str
 * We do need to be careful about bridges. If the
 * net.link.bridge.pfil_bridge sysctl is set we can be filtering on a
 * bridge, so if the input interface is a bridge member and the output
-* interface is its bridge we're not actually forwarding but bridging.
+* interface is its bridge or a member of the same bridge we're not
+* actually forwarding but bridging.
 */
-   if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif
-   && (m->m_pkthdr.rcvif->if_bridge == NULL
-   || m->m_pkthdr.rcvif->if_bridge != ifp->if_softc))
+   if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif &&
+   (m->m_pkthdr.rcvif->if_bridge == NULL ||
+   (m->m_pkthdr.rcvif->if_bridge != ifp->if_softc &&
+   m->m_pkthdr.rcvif->if_bridge != ifp->if_bridge)))
fwdir = PF_FWD;
 
if (!V_pf_status.running)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297428 - head/targets/pseudo/hosttools

2016-03-30 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar 30 18:40:09 2016
New Revision: 297428
URL: https://svnweb.freebsd.org/changeset/base/297428

Log:
  Move hosttools to Makefile.depend.host so it shows under host targets in 
show-valid-targets.
  
  Sponsored by: EMC / Isilon Storage Division

Added:
  head/targets/pseudo/hosttools/Makefile.depend.host
 - copied, changed from r297427, 
head/targets/pseudo/hosttools/Makefile.depend
Deleted:
  head/targets/pseudo/hosttools/Makefile.depend

Copied and modified: head/targets/pseudo/hosttools/Makefile.depend.host (from 
r297427, head/targets/pseudo/hosttools/Makefile.depend)
==
--- head/targets/pseudo/hosttools/Makefile.depend   Wed Mar 30 18:39:41 
2016(r297427, copy source)
+++ head/targets/pseudo/hosttools/Makefile.depend.host  Wed Mar 30 18:40:09 
2016(r297428)
@@ -6,29 +6,31 @@
 .include 
 .endif
 
+# These are all .host dependencies
+
 DIRDEPS = \
-   lib/clang/include.host \
-   lib/libc++.host \
-   lib/libcxxrt.host \
-   share/doc/llvm/clang.host \
-   usr.bin/clang/clang-tblgen.host \
-   usr.bin/clang/clang.host \
-   usr.bin/clang/llvm-tblgen.host \
-   usr.bin/lex/lib.host \
-   usr.bin/localedef.host \
-   usr.bin/mkcsmapper_static.host \
-   usr.bin/mkesdb_static.host \
-   usr.bin/mkuzip.host \
-   usr.bin/yacc.host \
-   usr.bin/xinstall.host \
-   usr.bin/xlint/xlint.host \
-   usr.sbin/config.host \
+   lib/clang/include \
+   lib/libc++ \
+   lib/libcxxrt \
+   share/doc/llvm/clang \
+   usr.bin/clang/clang-tblgen \
+   usr.bin/clang/clang \
+   usr.bin/clang/llvm-tblgen \
+   usr.bin/lex/lib \
+   usr.bin/localedef \
+   usr.bin/mkcsmapper_static \
+   usr.bin/mkesdb_static \
+   usr.bin/mkuzip \
+   usr.bin/yacc \
+   usr.bin/xinstall \
+   usr.bin/xlint/xlint \
+   usr.sbin/config \
 
 .if ${MK_KERBEROS} != "no"
 DIRDEPS+= \
-   kerberos5/tools/asn1_compile.host \
-   kerberos5/tools/make-roken.host \
-   usr.bin/compile_et.host \
+   kerberos5/tools/asn1_compile \
+   kerberos5/tools/make-roken \
+   usr.bin/compile_et \
 
 .endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297427 - head/targets

2016-03-30 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar 30 18:39:41 2016
New Revision: 297427
URL: https://svnweb.freebsd.org/changeset/base/297427

Log:
  show-valid-targets: Show host targets and also order all of the targets.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/targets/Makefile.xtras

Modified: head/targets/Makefile.xtras
==
--- head/targets/Makefile.xtras Wed Mar 30 17:32:14 2016(r297426)
+++ head/targets/Makefile.xtras Wed Mar 30 18:39:41 2016(r297427)
@@ -37,10 +37,19 @@ BUILD_TARGETS != cd ${_here} && \
find . \( -name Makefile.depend -o -name ${.MAKE.DEPENDFILE:T} \) | \
sed 's,/Makefile.*,,;s,^./,,' | sort -u
 
+BUILD_TARGETS_HOST != cd ${_here} && \
+   find . \( -name Makefile.depend.host -o -name 
${.MAKE.DEPENDFILE:T}.host \) | \
+   sed 's,/Makefile.*,,;s,^./,,' | sort -u
+
 show-valid-targets:
+.if !empty(BUILD_TARGETS_HOST)
+   @echo "Build targets for host (leave out the 
${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):"
+   @echo "${BUILD_TARGETS_HOST:O:ts\n}"
+   @echo
+.endif
@echo "Build targets for ${MACHINE} (leave out the 
${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):"
-   @echo "${BUILD_TARGETS:ts\n}"
-   @echo; echo "Other targets:"; echo "${OTHER_TARGETS:ts\n}"
+   @echo "${BUILD_TARGETS:O:ts\n}"
+   @echo; echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}"
 .endif
 
 help: show-help
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297426 - in head/sys: arm/conf boot/fdt/dts/arm

2016-03-30 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Mar 30 17:32:14 2016
New Revision: 297426
URL: https://svnweb.freebsd.org/changeset/base/297426

Log:
  Enable SPI1 on Beaglebone Black.
  
  SPI1 was chosen because SPI0 shares the gpio pins with I2C1.
  
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  head/sys/arm/conf/BEAGLEBONE
  head/sys/boot/fdt/dts/arm/beaglebone-black.dts

Modified: head/sys/arm/conf/BEAGLEBONE
==
--- head/sys/arm/conf/BEAGLEBONEWed Mar 30 17:18:49 2016
(r297425)
+++ head/sys/arm/conf/BEAGLEBONEWed Mar 30 17:32:14 2016
(r297426)
@@ -87,6 +87,10 @@ device   gpio
 device gpioled
 device gpiobacklight
 
+# SPI
+device ti_spi
+device spibus
+
 # ADC support
 device ti_adc
 

Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts
==
--- head/sys/boot/fdt/dts/arm/beaglebone-black.dts  Wed Mar 30 17:18:49 
2016(r297425)
+++ head/sys/boot/fdt/dts/arm/beaglebone-black.dts  Wed Mar 30 17:32:14 
2016(r297426)
@@ -37,6 +37,16 @@
AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE2)   
/* spi0_cs0.i2c1_scl */
>;
};
+
+   spi1_pins: pinmux_spi1_pins {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x964, PIN_INPUT_PULLUP | MUX_MODE2)   
/* eCAP0_in_PWM0_out.spi1_cs1 */
+   AM33XX_IOPAD(0x990, PIN_INPUT_PULLDOWN | MUX_MODE3) 
/* mcasp0_aclkx.spi1_sclk */
+   AM33XX_IOPAD(0x994, PIN_INPUT_PULLDOWN | MUX_MODE3) 
/* mcasp0_fsx.spi1_d0 - miso */
+   AM33XX_IOPAD(0x998, PIN_INPUT_PULLUP | MUX_MODE3)   
/* mcasp0_axr0.spi1_d1  - mosi */
+   AM33XX_IOPAD(0x99c, PIN_INPUT_PULLUP | MUX_MODE3)   
/* mcasp0_ahclkr.spi1_cs0 */
+   >;
+   };
 };
 
  {
@@ -65,6 +75,13 @@
status = "okay";
 };
 
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+
+   status = "okay";
+};
+
  {
hdmi = <>;
 };
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries

2016-03-30 Thread Nathan Whitehorn
I think it should be pci aim | fdt, just like the previous line when the 
files lived in sys/powerpc. To conf, that evaluates as pci && (aim || fdt).

-Nathan

On 03/30/16 08:55, Zbigniew Bodek wrote:


Thank you Nathan. Please check out new patch in the attachment.

Best regards
zbb

2016-03-30 16:33 GMT+02:00 Nathan Whitehorn >:


PowerPC (and SPARC) can have real OFW without FDT support. Adding
FDT to LINT is the wrong solution: rather, it should switch on fdt
| aim like the rest of the Open Firmware code.
-Nathan


On 03/30/16 01:54, Zbigniew Bodek wrote:

Hello Ed,

Please check out the attached patch. For powerpc we should
compile-in ofwpci.c regardless of FDT option.
However, it seems that LINT for powerpc does not have FDT. What
do you thing about adding it (as can be seen in the attached
patch)?. This would be done in a separate commit.

Best regards
zbb

2016-03-30 1:53 GMT+02:00 Ed Maste >:

On 29 March 2016 at 15:19, Zbigniew Bodek > wrote:
> Author: zbb
> Date: Tue Mar 29 15:19:56 2016
> New Revision: 297392
> URL: https://svnweb.freebsd.org/changeset/base/297392
>
> Log:
>   Reduce OFW PCI code duplication - involves ARM, PPC and
SPARC64

My 'make tinderbox' build is now failing (powerpc LINT) with:

linking kernel
cpcht.o: In function `cpcht_attach':
cpcht.c:(.text+0x17dc): undefined reference to `ofw_pci_attach'
cpcht.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver'
grackle.o: In function `grackle_attach':
grackle.c:(.text+0x2dc): undefined reference to `ofw_pci_attach'
grackle.o:(.data.rel+0x0): undefined reference to
`ofw_pci_driver'
uninorthpci.o: In function `uninorth_attach':
uninorthpci.c:(.text+0x68c): undefined reference to
`ofw_pci_attach'
uninorthpci.o:(.data.rel+0x0): undefined reference to
`ofw_pci_driver'
*** [kernel] Error code 1
___
svn-src-all@freebsd.org 
mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to
"svn-src-all-unsubscr...@freebsd.org
"







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


svn commit: r297425 - head/sys/boot/fdt/dts/arm

2016-03-30 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Mar 30 17:18:49 2016
New Revision: 297425
URL: https://svnweb.freebsd.org/changeset/base/297425

Log:
  Use the AM33XX_IOPAD() MACRO which is easier to read (uses the same offset
  of TRM).
  
  While here remove i2c2_pins, it is already defined in
  am335x-bone-common.dtsi.
  
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  head/sys/boot/fdt/dts/arm/beaglebone-black.dts

Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts
==
--- head/sys/boot/fdt/dts/arm/beaglebone-black.dts  Wed Mar 30 17:05:04 
2016(r297424)
+++ head/sys/boot/fdt/dts/arm/beaglebone-black.dts  Wed Mar 30 17:18:49 
2016(r297425)
@@ -33,15 +33,8 @@
 _pinmux {
i2c1_pins: pinmux_i2c1_pins {
pinctrl-single,pins = <
-   0x158 (PIN_INPUT_PULLUP | MUX_MODE2)/* 
spi0_d1.i2c1_sda */
-   0x15c (PIN_INPUT_PULLUP | MUX_MODE2)/* 
spi0_cs0.i2c1_scl */
-   >;
-   };
-
-   i2c2_pins: pinmux_i2c2_pins {
-   pinctrl-single,pins = <
-   0x178 (PIN_INPUT_PULLUP | MUX_MODE3)/* 
uart1_ctsn.i2c2_sda */
-   0x17c (PIN_INPUT_PULLUP | MUX_MODE3)/* 
uart1_rtsn.i2c2_scl */
+   AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE2)   
/* spi0_d1.i2c1_sda */
+   AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE2)   
/* spi0_cs0.i2c1_scl */
>;
};
 };
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297424 - head/sys/compat/linux

2016-03-30 Thread Jamie Gritton
Author: jamie
Date: Wed Mar 30 17:05:04 2016
New Revision: 297424
URL: https://svnweb.freebsd.org/changeset/base/297424

Log:
  Use osd_reserve / osd_jail_set_reserved, which is known to succeed.
  Also don't work around nonexistent osd_register failure.

Modified:
  head/sys/compat/linux/linux_mib.c

Modified: head/sys/compat/linux/linux_mib.c
==
--- head/sys/compat/linux/linux_mib.c   Wed Mar 30 17:00:33 2016
(r297423)
+++ head/sys/compat/linux/linux_mib.c   Wed Mar 30 17:05:04 2016
(r297424)
@@ -168,9 +168,6 @@ linux_find_prison(struct prison *spr, st
struct prison *pr;
struct linux_prison *lpr;
 
-   if (!linux_osd_jail_slot)
-   /* In case osd_register failed. */
-   spr = 
for (pr = spr;; pr = pr->pr_parent) {
mtx_lock(>pr_mtx);
lpr = (pr == )
@@ -189,15 +186,14 @@ linux_find_prison(struct prison *spr, st
  * Ensure a prison has its own Linux info.  If lprp is non-null, point it to
  * the Linux info and lock the prison.
  */
-static int
+static void
 linux_alloc_prison(struct prison *pr, struct linux_prison **lprp)
 {
struct prison *ppr;
struct linux_prison *lpr, *nlpr;
-   int error;
+   void *rsv;
 
/* If this prison already has Linux info, return that. */
-   error = 0;
lpr = linux_find_prison(pr, );
if (ppr == pr)
goto done;
@@ -207,29 +203,24 @@ linux_alloc_prison(struct prison *pr, st
 */
mtx_unlock(>pr_mtx);
nlpr = malloc(sizeof(struct linux_prison), M_PRISON, M_WAITOK);
+   rsv = osd_reserve(linux_osd_jail_slot);
lpr = linux_find_prison(pr, );
if (ppr == pr) {
free(nlpr, M_PRISON);
+   osd_free_reserved(rsv);
goto done;
}
/* Inherit the initial values from the ancestor. */
mtx_lock(>pr_mtx);
-   error = osd_jail_set(pr, linux_osd_jail_slot, nlpr);
-   if (error == 0) {
-   bcopy(lpr, nlpr, sizeof(*lpr));
-   lpr = nlpr;
-   } else {
-   free(nlpr, M_PRISON);
-   lpr = NULL;
-   }
+   (void)osd_jail_set_reserved(pr, linux_osd_jail_slot, rsv, nlpr);
+   bcopy(lpr, nlpr, sizeof(*lpr));
+   lpr = nlpr;
mtx_unlock(>pr_mtx);
  done:
if (lprp != NULL)
*lprp = lpr;
else
mtx_unlock(>pr_mtx);
-
-   return (error);
 }
 
 /*
@@ -249,7 +240,8 @@ linux_prison_create(void *obj, void *dat
 * Inherit a prison's initial values from its parent
 * (different from JAIL_SYS_INHERIT which also inherits changes).
 */
-   return (linux_alloc_prison(pr, NULL));
+   linux_alloc_prison(pr, NULL);
+   return (0);
 }
 
 static int
@@ -345,11 +337,7 @@ linux_prison_set(void *obj, void *data)
 * "linux=new" or "linux.*":
 * the prison gets its own Linux info.
 */
-   error = linux_alloc_prison(pr, );
-   if (error) {
-   mtx_unlock(>pr_mtx);
-   return (error);
-   }
+   linux_alloc_prison(pr, );
if (osrelease) {
error = linux_map_osrel(osrelease, >pr_osrel);
if (error) {
@@ -449,21 +437,18 @@ linux_osd_jail_register(void)
 
linux_osd_jail_slot =
osd_jail_register(linux_prison_destructor, methods);
-   if (linux_osd_jail_slot > 0) {
-   /* Copy the system linux info to any current prisons. */
-   sx_xlock(_lock);
-   TAILQ_FOREACH(pr, , pr_list)
-   (void)linux_alloc_prison(pr, NULL);
-   sx_xunlock(_lock);
-   }
+   /* Copy the system linux info to any current prisons. */
+   sx_slock(_lock);
+   TAILQ_FOREACH(pr, , pr_list)
+   linux_alloc_prison(pr, NULL);
+   sx_sunlock(_lock);
 }
 
 void
 linux_osd_jail_deregister(void)
 {
 
-   if (linux_osd_jail_slot)
-   osd_jail_deregister(linux_osd_jail_slot);
+   osd_jail_deregister(linux_osd_jail_slot);
 }
 
 void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297423 - head/sys/dev/flash

2016-03-30 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Mar 30 17:00:33 2016
New Revision: 297423
URL: https://svnweb.freebsd.org/changeset/base/297423

Log:
  Add basic FDT support for the mx25l SPI flash.
  
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  head/sys/dev/flash/mx25l.c

Modified: head/sys/dev/flash/mx25l.c
==
--- head/sys/dev/flash/mx25l.c  Wed Mar 30 16:57:28 2016(r297422)
+++ head/sys/dev/flash/mx25l.c  Wed Mar 30 17:00:33 2016(r297423)
@@ -26,6 +26,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_platform.h"
+
 #include 
 #include 
 #include 
@@ -40,6 +42,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef FDT
+#include 
+#include 
+#include 
+#endif
+
 #include 
 #include "spibus_if.h"
 
@@ -360,7 +368,15 @@ mx25l_read(device_t dev, off_t offset, c
 static int
 mx25l_probe(device_t dev)
 {
+
+#ifdef FDT
+   if (!ofw_bus_status_okay(dev))
+   return (ENXIO);
+   if (!ofw_bus_is_compatible(dev, "st,m25p"))
+   return (ENXIO);
+#endif
device_set_desc(dev, "M25Pxx Flash Family");
+
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297422 - in head: share/man/man9 sys/kern sys/sys

2016-03-30 Thread Jamie Gritton
Author: jamie
Date: Wed Mar 30 16:57:28 2016
New Revision: 297422
URL: https://svnweb.freebsd.org/changeset/base/297422

Log:
  Add osd_reserve() and osd_set_reserved(), which allow M_WAITOK allocation
  of an OSD array,

Modified:
  head/share/man/man9/osd.9
  head/sys/kern/kern_osd.c
  head/sys/sys/osd.h

Modified: head/share/man/man9/osd.9
==
--- head/share/man/man9/osd.9   Wed Mar 30 16:54:18 2016(r297421)
+++ head/share/man/man9/osd.9   Wed Mar 30 16:57:28 2016(r297422)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 5, 2011
+.Dd March 30, 2016
 .Dt OSD 9
 .Os
 .Sh NAME
@@ -33,6 +33,9 @@
 .Nm osd_register ,
 .Nm osd_deregister ,
 .Nm osd_set ,
+.Nm osd_reserve ,
+.Nm osd_set_reserved ,
+.Nm osd_free_reserved ,
 .Nm osd_get ,
 .Nm osd_del ,
 .Nm osd_call ,
@@ -63,6 +66,22 @@
 .Fa "void *value"
 .Fc
 .Ft void *
+.Fo osd_reserve
+.Fa "u_int slot"
+.Fc
+.Ft int
+.Fo osd_set_reserved
+.Fa "u_int type"
+.Fa "struct osd *osd"
+.Fa "u_int slot"
+.Fa "void *rsv"
+.Fa "void *value"
+.Fc
+.Ft void
+.Fo osd_free_reserved
+.Fa "void *rsv"
+.Fc
+.Ft void *
 .Fo osd_get
 .Fa "u_int type"
 .Fa "struct osd *osd"
@@ -198,6 +217,15 @@ argument points to a data object to asso
 .Fa osd .
 .Pp
 The
+.Fn osd_set_reserved
+function does the same as
+.Fn osd_set ,
+but with an extra argument
+.Fa rsv
+that is internal-use memory previously allocated via
+.Fn osd_reserve .
+.Pp
+The
 .Fn osd_get
 function returns the data pointer associated with a kernel data structure's
 .Vt struct osd
@@ -324,6 +352,24 @@ will proceed without any
 .Xr realloc 9
 calls.
 .Pp
+It is possible for
+.Fn osd_set
+to fail to allocate this array.  To ensure that such allocation succeeds,
+.Fn osd_reserve
+may be called (in a non-blocking context), and it will pre-allocate the
+memory via
+.Xr malloc 9
+with M_WAITOK.
+Then this pre-allocated memory is passed to
+.Fn osd_set_reserved ,
+which will use it if necessary or otherwise discard it.
+The memory may also be explicitly discarded by calling
+.Fn osd_free_reserved .
+As this method always allocates memory whether or not it is ultimately needed,
+it should be used only rarely, such as in the unlikely event that
+.Fn osd_set
+fails.
+.Pp
 The
 .Nm
 API is geared towards slot identifiers storing pointers to the same underlying
@@ -359,15 +405,27 @@ the kernel including most fast paths.
 returns the slot identifier for the newly registered data type.
 .Pp
 .Fn osd_set
-returns zero on success or ENOMEM if the specified type/slot identifier pair
+and
+.Fn osd_set_reserved
+return zero on success or ENOMEM if the specified type/slot identifier pair
 triggered an internal
 .Xr realloc 9
-which failed.
+which failed
+.Fn ( osd_set_reserved
+will always succeed when
+.Fa rsv
+is non-NULL).
 .Pp
 .Fn osd_get
 returns the data pointer for the specified type/slot identifier pair, or NULL 
if
 the slot has not been initialised yet.
 .Pp
+.Fn osd_reserve
+returns a pointer suitable for passing to
+.Fn osd_set_reserved
+or
+.Fn osd_free_reserved .
+.Pp
 .Fn osd_call
 returns zero if no method is run or the method for each slot runs successfully.
 If a method for a slot returns non-zero,

Modified: head/sys/kern/kern_osd.c
==
--- head/sys/kern/kern_osd.cWed Mar 30 16:54:18 2016(r297421)
+++ head/sys/kern/kern_osd.cWed Mar 30 16:57:28 2016(r297422)
@@ -54,7 +54,7 @@ struct osd_master {
struct sxosd_module_lock;
struct rmlockosd_object_lock;
struct mtx   osd_list_lock;
-   LIST_HEAD(, osd) osd_list;  /* (m) */
+   LIST_HEAD(, osd) osd_list;  /* (l) */
osd_destructor_t*osd_destructors;   /* (o) */
osd_method_t*osd_methods;   /* (m) */
u_intosd_ntslots;   /* (m) */
@@ -198,6 +198,24 @@ osd_deregister(u_int type, u_int slot)
 int
 osd_set(u_int type, struct osd *osd, u_int slot, void *value)
 {
+
+   return (osd_set_reserved(type, osd, slot, NULL, value));
+}
+
+void *
+osd_reserve(u_int slot)
+{
+
+   KASSERT(slot > 0, ("Invalid slot."));
+
+   OSD_DEBUG("Reserving slot array (slot=%u).", slot);
+   return (malloc(sizeof(void *) * slot, M_OSD, M_WAITOK | M_ZERO));
+}
+
+int
+osd_set_reserved(u_int type, struct osd *osd, u_int slot, void *rsv,
+void *value)
+{
struct rm_priotracker tracker;
 
KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type."));
@@ -206,36 +224,34 @@ osd_set(u_int type, struct osd *osd, u_i
 
rm_rlock([type].osd_object_lock, );
if (slot > osd->osd_nslots) {
+   void *newptr;
+
if (value == NULL) {
OSD_DEBUG(
"Not allocating null slot (type=%u, slot=%u).",
 

svn commit: r297421 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-03-30 Thread Alexander Motin
Author: mav
Date: Wed Mar 30 16:54:18 2016
New Revision: 297421
URL: https://svnweb.freebsd.org/changeset/base/297421

Log:
  Plug open count leak on zvol rename.
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Wed Mar 30 
16:48:57 2016(r297420)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Wed Mar 30 
16:54:18 2016(r297421)
@@ -2977,6 +2977,11 @@ zvol_rename_minor(zvol_state_t *zv, cons
ASSERT(dev != NULL);
zv->zv_dev = NULL;
destroy_dev(dev);
+   if (zv->zv_total_opens > 0) {
+   zv->zv_flags &= ~ZVOL_EXCL;
+   zv->zv_total_opens = 0;
+   zvol_last_close(zv);
+   }
 
make_dev_args_init();
args.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_WAITOK;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297420 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-03-30 Thread Alexander Motin
Author: mav
Date: Wed Mar 30 16:48:57 2016
New Revision: 297420
URL: https://svnweb.freebsd.org/changeset/base/297420

Log:
  Switch from using make_dev_p() to make_dev_s() to close races.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Wed Mar 30 
16:26:00 2016(r297419)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Wed Mar 30 
16:48:57 2016(r297420)
@@ -589,7 +589,6 @@ zvol_create_minor(const char *name)
minor_t minor = 0;
char chrbuf[30], blkbuf[30];
 #else
-   struct cdev *dev;
struct g_provider *pp;
struct g_geom *gp;
uint64_t volsize, mode;
@@ -688,18 +687,25 @@ zvol_create_minor(const char *name)
bioq_init(>zv_queue);
mtx_init(>zv_queue_mtx, "zvol", NULL, MTX_DEF);
} else if (zv->zv_volmode == ZFS_VOLMODE_DEV) {
-   error = make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK,
-   , _cdevsw, NULL, UID_ROOT, GID_OPERATOR,
-   0640, "%s/%s", ZVOL_DRIVER, name);
+   struct make_dev_args args;
+
+   make_dev_args_init();
+   args.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_WAITOK;
+   args.mda_devsw = _cdevsw;
+   args.mda_cr = NULL;
+   args.mda_uid = UID_ROOT;
+   args.mda_gid = GID_OPERATOR;
+   args.mda_mode = 0640;
+   args.mda_si_drv2 = zv;
+   error = make_dev_s(, >zv_dev,
+   "%s/%s", ZVOL_DRIVER, name);
if (error != 0) {
kmem_free(zv, sizeof(*zv));
dmu_objset_disown(os, FTAG);
mutex_exit(_state_lock);
return (error);
}
-   zv->zv_dev = dev;
-   dev->si_iosize_max = MAXPHYS;
-   dev->si_drv2 = zv;
+   zv->zv_dev->si_iosize_max = MAXPHYS;
}
LIST_INSERT_HEAD(_zvols, zv, zv_links);
 #endif /* illumos */
@@ -2965,18 +2971,24 @@ zvol_rename_minor(zvol_state_t *zv, cons
g_error_provider(pp, 0);
g_topology_unlock();
} else if (zv->zv_volmode == ZFS_VOLMODE_DEV) {
+   struct make_dev_args args;
+
dev = zv->zv_dev;
ASSERT(dev != NULL);
zv->zv_dev = NULL;
destroy_dev(dev);
 
-   if (make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK,
-   , _cdevsw, NULL, UID_ROOT, GID_OPERATOR,
-   0640, "%s/%s", ZVOL_DRIVER, newname) == 0) {
-   zv->zv_dev = dev;
-   dev->si_iosize_max = MAXPHYS;
-   dev->si_drv2 = zv;
-   }
+   make_dev_args_init();
+   args.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_WAITOK;
+   args.mda_devsw = _cdevsw;
+   args.mda_cr = NULL;
+   args.mda_uid = UID_ROOT;
+   args.mda_gid = GID_OPERATOR;
+   args.mda_mode = 0640;
+   args.mda_si_drv2 = zv;
+   if (make_dev_s(, >zv_dev,
+   "%s/%s", ZVOL_DRIVER, newname) == 0)
+   zv->zv_dev->si_iosize_max = MAXPHYS;
}
strlcpy(zv->zv_name, newname, sizeof(zv->zv_name));
 }
@@ -3023,16 +3035,10 @@ zvol_rename_minors(const char *oldname, 
 static int
 zvol_d_open(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
-   zvol_state_t *zv;
+   zvol_state_t *zv = dev->si_drv2;
int err = 0;
 
mutex_enter(_state_lock);
-   zv = dev->si_drv2;
-   if (zv == NULL) {
-   mutex_exit(_state_lock);
-   return(ENXIO);  /* zvol_create_minor() not done yet */
-   }
-
if (zv->zv_total_opens == 0)
err = zvol_first_open(zv);
if (err) {
@@ -3070,16 +3076,9 @@ out:
 static int
 zvol_d_close(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
-   zvol_state_t *zv;
-   int err = 0;
+   zvol_state_t *zv = dev->si_drv2;
 
mutex_enter(_state_lock);
-   zv = dev->si_drv2;
-   if (zv == NULL) {
-   mutex_exit(_state_lock);
-   return(ENXIO);
-   }
-
if (zv->zv_flags & ZVOL_EXCL) {
ASSERT(zv->zv_total_opens == 1);
zv->zv_flags &= ~ZVOL_EXCL;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297419 - head/sys/arm/ti

2016-03-30 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Mar 30 16:26:00 2016
New Revision: 297419
URL: https://svnweb.freebsd.org/changeset/base/297419

Log:
  Bump up the read and write timeouts.  The old value was too small for low
  speed transfers.
  
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  head/sys/arm/ti/ti_spi.c

Modified: head/sys/arm/ti/ti_spi.c
==
--- head/sys/arm/ti/ti_spi.cWed Mar 30 14:42:09 2016(r297418)
+++ head/sys/arm/ti/ti_spi.cWed Mar 30 16:26:00 2016(r297419)
@@ -333,7 +333,7 @@ ti_spi_fill_fifo(struct ti_spi_softc *sc
timeout = 1000;
while (--timeout > 0 && (TI_SPI_READ(sc,
MCSPI_STAT_CH(sc->sc_cs)) & MCSPI_STAT_TXS) == 0) {
-   DELAY(1);
+   DELAY(100);
}
if (timeout == 0)
return (-1);
@@ -366,7 +366,7 @@ ti_spi_drain_fifo(struct ti_spi_softc *s
timeout = 1000;
while (--timeout > 0 && (TI_SPI_READ(sc,
MCSPI_STAT_CH(sc->sc_cs)) & MCSPI_STAT_RXS) == 0) {
-   DELAY(1);
+   DELAY(100);
}
if (timeout == 0)
return (-1);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries

2016-03-30 Thread Zbigniew Bodek
Thank you Nathan. Please check out new patch in the attachment.

Best regards
zbb

2016-03-30 16:33 GMT+02:00 Nathan Whitehorn :

> PowerPC (and SPARC) can have real OFW without FDT support. Adding FDT to
> LINT is the wrong solution: rather, it should switch on fdt | aim like the
> rest of the Open Firmware code.
> -Nathan
>
>
> On 03/30/16 01:54, Zbigniew Bodek wrote:
>
> Hello Ed,
>
> Please check out the attached patch. For powerpc we should compile-in
> ofwpci.c regardless of FDT option.
> However, it seems that LINT for powerpc does not have FDT. What do you
> thing about adding it (as can be seen in the attached patch)?. This would
> be done in a separate commit.
>
> Best regards
> zbb
>
> 2016-03-30 1:53 GMT+02:00 Ed Maste :
>
>> On 29 March 2016 at 15:19, Zbigniew Bodek < 
>> z...@freebsd.org> wrote:
>> > Author: zbb
>> > Date: Tue Mar 29 15:19:56 2016
>> > New Revision: 297392
>> > URL: https://svnweb.freebsd.org/changeset/base/297392
>> >
>> > Log:
>> >   Reduce OFW PCI code duplication - involves ARM, PPC and SPARC64
>>
>> My 'make tinderbox' build is now failing (powerpc LINT) with:
>>
>> linking kernel
>> cpcht.o: In function `cpcht_attach':
>> cpcht.c:(.text+0x17dc): undefined reference to `ofw_pci_attach'
>> cpcht.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver'
>> grackle.o: In function `grackle_attach':
>> grackle.c:(.text+0x2dc): undefined reference to `ofw_pci_attach'
>> grackle.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver'
>> uninorthpci.o: In function `uninorth_attach':
>> uninorthpci.c:(.text+0x68c): undefined reference to `ofw_pci_attach'
>> uninorthpci.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver'
>> *** [kernel] Error code 1
>> ___
>> svn-src-all@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/svn-src-all
>> To unsubscribe, send any mail to " 
>> svn-src-all-unsubscr...@freebsd.org"
>>
>
>
>
diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc
index e39343b..56776dc 100644
--- a/sys/conf/files.powerpc
+++ b/sys/conf/files.powerpc
@@ -57,7 +57,7 @@ dev/ofw/ofw_console.c optionalaim
 dev/ofw/ofw_disk.c optionalofwd aim
 dev/ofw/ofw_iicbus.c   optionaliicbus aim
 dev/ofw/ofwbus.c   optionalaim | fdt
-dev/ofw/ofwpci.c   optionalfdt pci
+dev/ofw/ofwpci.c   optionalpci aim | pci fdt
 dev/ofw/ofw_standard.c optionalaim powerpc
 dev/ofw/ofw_subr.c optionalaim powerpc
 dev/powermac_nvram/powermac_nvram.c optional   powermac_nvram powermac
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r297418 - in head/lib/libc: arm mips powerpc powerpc64 sparc64

2016-03-30 Thread Ed Maste
Author: emaste
Date: Wed Mar 30 14:42:09 2016
New Revision: 297418
URL: https://svnweb.freebsd.org/changeset/base/297418

Log:
  libc: stop exporting cerror
  
  i386 stopped exporting .cerror in r240152, and likewise for amd64 in
  r240178. It is not used by other libraries on any platform, so apply
  the same change to the remaining architectures.
  
  Reviewed by:  jhibbits, jilles
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D5774

Modified:
  head/lib/libc/arm/Symbol.map
  head/lib/libc/mips/Symbol.map
  head/lib/libc/powerpc/Symbol.map
  head/lib/libc/powerpc64/Symbol.map
  head/lib/libc/sparc64/Symbol.map

Modified: head/lib/libc/arm/Symbol.map
==
--- head/lib/libc/arm/Symbol.mapWed Mar 30 13:26:35 2016
(r297417)
+++ head/lib/libc/arm/Symbol.mapWed Mar 30 14:42:09 2016
(r297418)
@@ -29,7 +29,6 @@ FBSD_1.0 {
ntohs;
vfork;
brk;
-   cerror; /* XXX - Should this be .cerror (see sys/cerror.S)? */
sbrk;
 };
 

Modified: head/lib/libc/mips/Symbol.map
==
--- head/lib/libc/mips/Symbol.map   Wed Mar 30 13:26:35 2016
(r297417)
+++ head/lib/libc/mips/Symbol.map   Wed Mar 30 14:42:09 2016
(r297418)
@@ -28,7 +28,6 @@ FBSD_1.0 {
ntohs;
vfork;
brk;
-   cerror; /* XXX - Should this be .cerror (see sys/cerror.S)? */
sbrk;
 };
 

Modified: head/lib/libc/powerpc/Symbol.map
==
--- head/lib/libc/powerpc/Symbol.mapWed Mar 30 13:26:35 2016
(r297417)
+++ head/lib/libc/powerpc/Symbol.mapWed Mar 30 14:42:09 2016
(r297418)
@@ -56,5 +56,4 @@ FBSDprivate_1.0 {
__signalcontext;
__syncicache;
_end;
-   .cerror;
 };

Modified: head/lib/libc/powerpc64/Symbol.map
==
--- head/lib/libc/powerpc64/Symbol.map  Wed Mar 30 13:26:35 2016
(r297417)
+++ head/lib/libc/powerpc64/Symbol.map  Wed Mar 30 14:42:09 2016
(r297418)
@@ -52,5 +52,4 @@ FBSDprivate_1.0 {
__signalcontext;
__syncicache;
_end;
-   _cerror;
 };

Modified: head/lib/libc/sparc64/Symbol.map
==
--- head/lib/libc/sparc64/Symbol.mapWed Mar 30 13:26:35 2016
(r297417)
+++ head/lib/libc/sparc64/Symbol.mapWed Mar 30 14:42:09 2016
(r297418)
@@ -82,7 +82,6 @@ FBSDprivate_1.0 {
__siglongjmp;
__sys_brk;
_brk;
-   .cerror;
__sys_exect;
_exect;
_end;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries

2016-03-30 Thread Nathan Whitehorn
PowerPC (and SPARC) can have real OFW without FDT support. Adding FDT to 
LINT is the wrong solution: rather, it should switch on fdt | aim like 
the rest of the Open Firmware code.

-Nathan

On 03/30/16 01:54, Zbigniew Bodek wrote:

Hello Ed,

Please check out the attached patch. For powerpc we should compile-in 
ofwpci.c regardless of FDT option.
However, it seems that LINT for powerpc does not have FDT. What do you 
thing about adding it (as can be seen in the attached patch)?. This 
would be done in a separate commit.


Best regards
zbb

2016-03-30 1:53 GMT+02:00 Ed Maste >:


On 29 March 2016 at 15:19, Zbigniew Bodek > wrote:
> Author: zbb
> Date: Tue Mar 29 15:19:56 2016
> New Revision: 297392
> URL: https://svnweb.freebsd.org/changeset/base/297392
>
> Log:
>   Reduce OFW PCI code duplication - involves ARM, PPC and SPARC64

My 'make tinderbox' build is now failing (powerpc LINT) with:

linking kernel
cpcht.o: In function `cpcht_attach':
cpcht.c:(.text+0x17dc): undefined reference to `ofw_pci_attach'
cpcht.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver'
grackle.o: In function `grackle_attach':
grackle.c:(.text+0x2dc): undefined reference to `ofw_pci_attach'
grackle.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver'
uninorthpci.o: In function `uninorth_attach':
uninorthpci.c:(.text+0x68c): undefined reference to `ofw_pci_attach'
uninorthpci.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver'
*** [kernel] Error code 1
___
svn-src-all@freebsd.org  mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to
"svn-src-all-unsubscr...@freebsd.org
"




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


svn commit: r297417 - head/lib/libc/stdio

2016-03-30 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Mar 30 13:26:35 2016
New Revision: 297417
URL: https://svnweb.freebsd.org/changeset/base/297417

Log:
  freopen(3): prevent uninitialized errno.
  
  Revert completley r297408 (and r297407): this ends up touching errno,
  which we are not allowed to do.
  
  Pointed out by:   ache, bde

Modified:
  head/lib/libc/stdio/freopen.c

Modified: head/lib/libc/stdio/freopen.c
==
--- head/lib/libc/stdio/freopen.c   Wed Mar 30 10:05:52 2016
(r297416)
+++ head/lib/libc/stdio/freopen.c   Wed Mar 30 13:26:35 2016
(r297417)
@@ -78,7 +78,6 @@ freopen(const char * __restrict file, co
 * re-open the same file with a different mode. We allow this only
 * if the modes are compatible.
 */
-   sverrno = 0;
if (file == NULL) {
/* See comment below regarding freopen() of closed files. */
if (fp->_flags == 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r297407 - head/lib/libc/stdio

2016-03-30 Thread Andrey Chernov
On 30.03.2016 4:32, Pedro F. Giffuni wrote:
> --- head/lib/libc/stdio/freopen.c Wed Mar 30 01:08:08 2016
> (r297406)
> +++ head/lib/libc/stdio/freopen.c Wed Mar 30 01:32:08 2016
> (r297407)
> @@ -66,7 +66,8 @@ freopen(const char * __restrict file, co
>   (void) fclose(fp);
>   errno = sverrno;
>   return (NULL);
> - }
> + } else
> + sverrno = 0;

This one is wrong too, see my detailed reply on the next commit.

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


Re: svn commit: r297408 - head/lib/libc/stdio

2016-03-30 Thread Andrey Chernov
On 30.03.2016 9:13, Pedro F. Giffuni wrote:
>*/
> + sverrno = 0;
>   if (file == NULL) {

It introduces the bug of touching errno. Previous code does it right
because 'goto finish;' can't happen with (f < 0) where errno is restored
later.

The whole errno code is complex here for reading at least.
It microoptimize errno handling by removing unnecessary assignment, but
it does not gain much in reality.

Better change for easy reading will be to set
sverrno = errno;
once right at the function enter and remove it in all other places.

In any case errno touching should be backed out.

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


svn commit: r297416 - in head: share/man/man4 sys/dev/usb sys/dev/usb/video

2016-03-30 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 30 10:05:52 2016
New Revision: 297416
URL: https://svnweb.freebsd.org/changeset/base/297416

Log:
  Add new USB ID to UDL driver.
  
  Submitted by: Matthias Petermann 
  PR:   201084

Modified:
  head/share/man/man4/udl.4
  head/sys/dev/usb/usbdevs
  head/sys/dev/usb/video/udl.c

Modified: head/share/man/man4/udl.4
==
--- head/share/man/man4/udl.4   Wed Mar 30 08:42:10 2016(r297415)
+++ head/share/man/man4/udl.4   Wed Mar 30 10:05:52 2016(r297416)
@@ -62,6 +62,7 @@ The following devices should work:
 .It Sunweit USB to DVI
 .It Unitek Y-2240 USB to DVI
 .It VideoHome NBdock1920
+.It i-tec USB 2.0 Docking Station (USBDVIDOCK)
 .El
 .Sh SEE ALSO
 .Xr usb 4

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsWed Mar 30 08:42:10 2016(r297415)
+++ head/sys/dev/usb/usbdevsWed Mar 30 10:05:52 2016(r297416)
@@ -1700,6 +1700,7 @@ product DISPLAYLINK UM7X0 0x401a  nanovis
 product DISPLAYLINK LT1421 0x03e0  Lenovo ThinkVision LT1421
 product DISPLAYLINK POLARIS2   0x0117  Polaris2 USB dock
 product DISPLAYLINK PLUGABLE   0x0377  Plugable docking station
+product DISPLAYLINK ITEC   0x02e9  i-tec USB 2.0 Docking Station
 
 /* DMI products */
 product DMI CFSM_RW0xa109  CF/SM Reader/Writer

Modified: head/sys/dev/usb/video/udl.c
==
--- head/sys/dev/usb/video/udl.cWed Mar 30 08:42:10 2016
(r297415)
+++ head/sys/dev/usb/video/udl.cWed Mar 30 10:05:52 2016
(r297416)
@@ -177,7 +177,8 @@ static const STRUCT_USB_HOST_ID udl_devs
{USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_PLUGABLE, 
DL160)},
{USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LUM70, DL125)},
{USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_POLARIS2, 
DLUNK)},
-   {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LT1421, DLUNK)}
+   {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LT1421, 
DLUNK)},
+   {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_ITEC, DL165)},
 };
 
 static void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries

2016-03-30 Thread Zbigniew Bodek
Hello Ed,

Please check out the attached patch. For powerpc we should compile-in
ofwpci.c regardless of FDT option.
However, it seems that LINT for powerpc does not have FDT. What do you
thing about adding it (as can be seen in the attached patch)?. This would
be done in a separate commit.

Best regards
zbb

2016-03-30 1:53 GMT+02:00 Ed Maste :

> On 29 March 2016 at 15:19, Zbigniew Bodek  wrote:
> > Author: zbb
> > Date: Tue Mar 29 15:19:56 2016
> > New Revision: 297392
> > URL: https://svnweb.freebsd.org/changeset/base/297392
> >
> > Log:
> >   Reduce OFW PCI code duplication - involves ARM, PPC and SPARC64
>
> My 'make tinderbox' build is now failing (powerpc LINT) with:
>
> linking kernel
> cpcht.o: In function `cpcht_attach':
> cpcht.c:(.text+0x17dc): undefined reference to `ofw_pci_attach'
> cpcht.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver'
> grackle.o: In function `grackle_attach':
> grackle.c:(.text+0x2dc): undefined reference to `ofw_pci_attach'
> grackle.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver'
> uninorthpci.o: In function `uninorth_attach':
> uninorthpci.c:(.text+0x68c): undefined reference to `ofw_pci_attach'
> uninorthpci.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver'
> *** [kernel] Error code 1
> ___
> svn-src-all@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
>
diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc
index e39343b..d2e8e3b 100644
--- a/sys/conf/files.powerpc
+++ b/sys/conf/files.powerpc
@@ -57,7 +57,7 @@ dev/ofw/ofw_console.c optionalaim
 dev/ofw/ofw_disk.c optionalofwd aim
 dev/ofw/ofw_iicbus.c   optionaliicbus aim
 dev/ofw/ofwbus.c   optionalaim | fdt
-dev/ofw/ofwpci.c   optionalfdt pci
+dev/ofw/ofwpci.c   optionalpci
 dev/ofw/ofw_standard.c optionalaim powerpc
 dev/ofw/ofw_subr.c optionalaim powerpc
 dev/powermac_nvram/powermac_nvram.c optional   powermac_nvram powermac
diff --git a/sys/powerpc/conf/NOTES b/sys/powerpc/conf/NOTES
index 75e774f..b00def4 100644
--- a/sys/powerpc/conf/NOTES
+++ b/sys/powerpc/conf/NOTES
@@ -46,6 +46,7 @@ options   POWERMAC#NewWorld Apple 
PowerMacs
 optionsPSIM#GDB PSIM ppc simulator
 optionsMAMBO   #IBM Mambo Full System Simulator
 
+optionsFDT
 optionsSC_OFWFB# OFW frame buffer
 
 # The cpufreq(4) driver provides support for CPU frequency control
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Re: svn commit: r297408 - head/lib/libc/stdio

2016-03-30 Thread Bruce Evans

On Wed, 30 Mar 2016, Pedro F. Giffuni wrote:


Log:
 freopen(3): prevent uninitialized errno.

 Revert r297407 and redo it cleanly.


This might need a few more commits to do it correctly.


Modified: head/lib/libc/stdio/freopen.c
==
--- head/lib/libc/stdio/freopen.c   Wed Mar 30 01:32:08 2016
(r297407)
+++ head/lib/libc/stdio/freopen.c   Wed Mar 30 06:13:58 2016
(r297408)
@@ -66,8 +66,7 @@ freopen(const char * __restrict file, co
(void) fclose(fp);
errno = sverrno;
return (NULL);
-   } else
-   sverrno = 0;
+   }


This uses the one value that is clearly wrong.  C Standard library
functions are not permitted to set errno to 0, but that is what happens
if this setting of sverrno is actually used.  Most C Standard library
functions are permitted to set errno to any nonzero value even if they
succeed.  For this particular function, errno has an unspecified value
in Standard C after the function returns, but POSIX extends this and
specifies some settings.  This extension is permitted because, unlike
for some other functions, Standard C doesn't specify anything for
errno.

It would not be wrong to set sverrno to errno here, of course without
the style bug, but any use of the value would be dubious.



FLOCKFILE(fp);

@@ -79,6 +78,7 @@ freopen(const char * __restrict file, co
 * re-open the same file with a different mode. We allow this only
 * if the modes are compatible.
 */
+   sverrno = 0;
if (file == NULL) {
/* See comment below regarding freopen() of closed files. */
if (fp->_flags == 0) {


Setting it to 0 here is equivalent to setting it above, except it doesn't
have the style bug.  Actually saving errno in it is not quite eqivalent
to saving errno above, since there are functions that might set errno in
between.

It should be set above, or better not at all.  You need to understand the
function better to place it exactly correctly.  The function only restores
from sverrno after the "finish" label in the f < 0 case.  I think it
intends to restore the errno that was set for one of the 2
'f = _open(...)' expressions, so if it actually uses the above setting
then that is a bug.  A complete fix would reorganise the function to
avoid "goto finish" so that it is clear to humans and coverities that
the above setting is never used.

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


svn commit: r297409 - head/sys/dev/bwn

2016-03-30 Thread Adrian Chadd
Author: adrian
Date: Wed Mar 30 06:48:09 2016
New Revision: 297409
URL: https://svnweb.freebsd.org/changeset/base/297409

Log:
  [bwn] fix time_before -> ieee80211_time_before()
  
  Noticed by: Jia-Shiun Li 

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Wed Mar 30 06:13:58 2016(r297408)
+++ head/sys/dev/bwn/if_bwn.c   Wed Mar 30 06:48:09 2016(r297409)
@@ -2612,7 +2612,7 @@ bwn_phy_g_task_15s(struct bwn_mac *mac)
BWN_GETTIME(now);
if (bwn_has_hwpctl(mac)) {
expire = now - BWN_LO_PWRVEC_EXPIRE;
-   if (time_before(lo->pwr_vec_read_time, expire)) {
+   if (ieee80211_time_before(lo->pwr_vec_read_time, expire)) {
bwn_lo_get_powervector(mac);
bwn_phy_g_dc_lookup_init(mac, 0);
}
@@ -2621,7 +2621,7 @@ bwn_phy_g_task_15s(struct bwn_mac *mac)
 
expire = now - BWN_LO_CALIB_EXPIRE;
TAILQ_FOREACH_SAFE(cal, >calib_list, list, tmp) {
-   if (!time_before(cal->calib_time, expire))
+   if (!ieee80211_time_before(cal->calib_time, expire))
continue;
if (BWN_BBATTCMP(>bbatt, >pg_bbatt) &&
BWN_RFATTCMP(>rfatt, >pg_rfatt)) {
@@ -6149,7 +6149,7 @@ bwn_lo_save(struct bwn_mac *mac, struct 
BWN_PHY_WRITE(mac, BWN_PHY_CCK(0x2f), 0);
 
nanouptime();
-   if (time_before(lo->txctl_measured_time,
+   if (ieee80211_time_before(lo->txctl_measured_time,
(ts.tv_nsec / 100 + ts.tv_sec * 1000) - BWN_LO_TXCTL_EXPIRE))
bwn_lo_measure_txctl_values(mac);
 
@@ -9365,7 +9365,7 @@ bwn_phy_txpower_check(struct bwn_mac *ma
 
BWN_GETTIME(now);
 
-   if (!(flags & BWN_TXPWR_IGNORE_TIME) && time_before(now, phy->nexttime))
+   if (!(flags & BWN_TXPWR_IGNORE_TIME) && ieee80211_time_before(now, 
phy->nexttime))
return;
phy->nexttime = now + 2 * 1000;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297408 - head/lib/libc/stdio

2016-03-30 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Mar 30 06:13:58 2016
New Revision: 297408
URL: https://svnweb.freebsd.org/changeset/base/297408

Log:
  freopen(3): prevent uninitialized errno.
  
  Revert r297407 and redo it cleanly.
  
  Pointed out by:   Jukka A. Ukkonen
  CID:  1018720
  MFC after:1 week

Modified:
  head/lib/libc/stdio/freopen.c

Modified: head/lib/libc/stdio/freopen.c
==
--- head/lib/libc/stdio/freopen.c   Wed Mar 30 01:32:08 2016
(r297407)
+++ head/lib/libc/stdio/freopen.c   Wed Mar 30 06:13:58 2016
(r297408)
@@ -66,8 +66,7 @@ freopen(const char * __restrict file, co
(void) fclose(fp);
errno = sverrno;
return (NULL);
-   } else
-   sverrno = 0;
+   }
 
FLOCKFILE(fp);
 
@@ -79,6 +78,7 @@ freopen(const char * __restrict file, co
 * re-open the same file with a different mode. We allow this only
 * if the modes are compatible.
 */
+   sverrno = 0;
if (file == NULL) {
/* See comment below regarding freopen() of closed files. */
if (fp->_flags == 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"