svn commit: r257308 - head/sys/x86/include

2013-10-29 Thread Konstantin Belousov
Author: kib
Date: Tue Oct 29 07:25:54 2013
New Revision: 257308
URL: http://svnweb.freebsd.org/changeset/base/257308

Log:
  Remove redundand declaration, fixing the build with gcc.
  
  Reported and tested by:   Michael Butler 
  Sponsored by: The FreeBSD Foundation
  MFC after:1 month

Modified:
  head/sys/x86/include/busdma_impl.h

Modified: head/sys/x86/include/busdma_impl.h
==
--- head/sys/x86/include/busdma_impl.h  Tue Oct 29 06:37:27 2013
(r257307)
+++ head/sys/x86/include/busdma_impl.h  Tue Oct 29 07:25:54 2013
(r257308)
@@ -82,7 +82,6 @@ struct bus_dma_impl {
bus_dmasync_op_t op);
 };
 
-void busdma_lock_mutex(void *arg, bus_dma_lock_op_t op);
 void bus_dma_dflt_lock(void *arg, bus_dma_lock_op_t op);
 int bus_dma_run_filter(struct bus_dma_tag_common *dmat, bus_addr_t paddr);
 int common_bus_dma_tag_create(struct bus_dma_tag_common *parent,
___
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: r257302 - in head/contrib/binutils/bfd: . po

2013-10-29 Thread Dimitry Andric
On 29 Oct 2013, at 05:25, Eygene Ryabinkin  wrote:
> Author: rea (ports committer)
> Date: Tue Oct 29 04:25:49 2013
> New Revision: 257302
> URL: http://svnweb.freebsd.org/changeset/base/257302
> 
> Log:
>  binutils/bfd: fix printf-like format strings for "bfd *" arguments
> 
>  There is a special format argument '%B' that directly handles values
>  of type 'bfd *', they must be used instead of '%s'.  Manifestations
>  of this bug can be seen in ld(1) error messages, for example,
>http://lists.freebsd.org/pipermail/freebsd-current/2013-August/043580.html
>http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045404.html

Note this fixes the badly formatted error message, but *not* the other
problem that some people have observed, for example with pkg: 

http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045962.html

See point 4) in Matthias's mail.  Since r253839, ld was changed to
default to --no-as-needed, but there is still something subtly broken
with this behavior: sometimes, DT_NEEDED dependencies *are*
automatically pulled in, sometimes they are not...

If anyone has a clue what is wrong, please let us know. :-)

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r257315 - in head/contrib/byacc: . package package/debian test

2013-10-29 Thread Baptiste Daroussin
Author: bapt
Date: Tue Oct 29 08:21:22 2013
New Revision: 257315
URL: http://svnweb.freebsd.org/changeset/base/257315

Log:
  Merge byacc 20130925
  
  2 changes:
  - Increase default stack-size so that used to be our default stack-size prior 
byacc import
  - fix two loop-limits found by clang 3.3

Added:
  head/contrib/byacc/package/mingw-byacc.spec
 - copied unchanged from r257314, vendor/byacc/dist/package/mingw-byacc.spec
Modified:
  head/contrib/byacc/CHANGES
  head/contrib/byacc/VERSION
  head/contrib/byacc/aclocal.m4
  head/contrib/byacc/config.guess
  head/contrib/byacc/config.sub
  head/contrib/byacc/configure
  head/contrib/byacc/package/byacc.spec
  head/contrib/byacc/package/debian/changelog
  head/contrib/byacc/reader.c
  head/contrib/byacc/skeleton.c
  head/contrib/byacc/test/calc.tab.c
  head/contrib/byacc/test/calc1.tab.c
  head/contrib/byacc/test/calc2.tab.c
  head/contrib/byacc/test/calc3.tab.c
  head/contrib/byacc/test/code_calc.code.c
  head/contrib/byacc/test/code_error.code.c
  head/contrib/byacc/test/error.tab.c
  head/contrib/byacc/test/ftp.tab.c
  head/contrib/byacc/test/grammar.tab.c
  head/contrib/byacc/test/pure_calc.tab.c
  head/contrib/byacc/test/pure_error.tab.c
  head/contrib/byacc/test/quote_calc-s.tab.c
  head/contrib/byacc/test/quote_calc.tab.c
  head/contrib/byacc/test/quote_calc2-s.tab.c
  head/contrib/byacc/test/quote_calc2.tab.c
  head/contrib/byacc/test/quote_calc3-s.tab.c
  head/contrib/byacc/test/quote_calc3.tab.c
  head/contrib/byacc/test/quote_calc4-s.tab.c
  head/contrib/byacc/test/quote_calc4.tab.c
Directory Properties:
  head/contrib/byacc/   (props changed)

Modified: head/contrib/byacc/CHANGES
==
--- head/contrib/byacc/CHANGES  Tue Oct 29 08:10:34 2013(r257314)
+++ head/contrib/byacc/CHANGES  Tue Oct 29 08:21:22 2013(r257315)
@@ -1,3 +1,44 @@
+2013-09-25  Thomas E. Dickey  
+
+   * reader.c: fix two loop-limits found by clang 3.3 --analyze
+
+   * configure: regen
+
+   * aclocal.m4:
+   tweaks to CF_MIXEDCASE_FILENAMES and CF_XOPEN_SOURCE for msys from 
ncurses
+
+   * package/mingw-byacc.spec: RCS_BASE
+
+   * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, 
test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, 
test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, 
test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, 
test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, 
test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c:
+   regen
+
+   * skeleton.c:
+   Increase default stack-size to match FreeBSD version noted as from
+   "BSD 4.4 Lite Usr.bin Sources".  See
+
+   http://svnweb.freebsd.org/base/vendor/CSRG/dist/usr.bin/yacc/
+   http://svnweb.freebsd.org/base/head/usr.bin/yacc/
+   http://svnweb.freebsd.org/base/vendor/byacc/
+
+   The original 1.9 sources (on which I based development) used 500 for
+   stacksize; the BSD Lite sources (a year or two later) used 1.
+
+   This is a change to default values; the YYMAXDEPTH and YYSTACKSIZE
+   symbols have "always" been overridable by applications, but rarely
+   needed to do this.  RedHat began using the FreeBSD source in 2000,
+   and switched to this source in 2007 using the 20050813 snapshot.
+
+   RedHat #743343 misattributed the change in default stacksize to
+   a regression in byacc, but did not report the issue upstream.
+
+   * package/debian/changelog, VERSION, package/byacc.spec: bump
+
+2013-09-07  Thomas E. Dickey  
+
+   * config.sub: update to 2013-09-15
+
+   * config.guess: update to 2013-06-10
+
 2013-03-04  Thomas E. Dickey  
 
* package/debian/changelog, VERSION, package/byacc.spec: bump
@@ -30,7 +71,7 @@
 
 2013-02-10  Thomas E. Dickey  
 
-   * config.sub, config.guess: 2013-02-04
+   * config.sub, config.guess: update to 2013-02-04
 
 2012-10-03  Thomas E. Dickey  
 
@@ -348,11 +389,11 @@
 
 2011-04-01  Thomas E. Dickey  
 
-   * config.sub: 2011-04-01
+   * config.sub: update to 2011-04-01
 
 2011-02-02  Thomas E. Dickey  
 
-   * config.guess: 2011-01-01
+   * config.guess: update to 2011-01-01
 
 2010-12-29  Thomas E. Dickey  
 
@@ -530,11 +571,11 @@
 
 2010-09-28  Thomas E. Dickey  
 
-   * config.guess: 2010-09-24
+   * config.guess: update to 2010-09-24
 
 2010-09-10  Thomas E. Dickey  
 
-   * config.sub: 2010-09-11
+   * config.sub: update to 2010-09-11
 
 2010-06-10  Thomas E. Dickey  
 
@@ -770,9 +811,9 @@
 
 2009-12-31  Thomas E. Dickey  
 
-   * config.guess: 2009-12-30
+   * config.guess: update to 2009-12-30
 
-   * config.sub: 2009-12-31
+   * config.sub: update to 2009-12-31
 
 2009-10-27  Thomas E. Dickey  
 
@@ -798,7 +839,7 @@
 
 2009-08-25  Thomas E. Dickey  
 
-   * config.guess,

svn commit: r257316 - head/usr.bin/yacc

2013-10-29 Thread Baptiste Daroussin
Author: bapt
Date: Tue Oct 29 08:22:38 2013
New Revision: 257316
URL: http://svnweb.freebsd.org/changeset/base/257316

Log:
  Change warning level to 6

Modified:
  head/usr.bin/yacc/Makefile

Modified: head/usr.bin/yacc/Makefile
==
--- head/usr.bin/yacc/Makefile  Tue Oct 29 08:21:22 2013(r257315)
+++ head/usr.bin/yacc/Makefile  Tue Oct 29 08:22:38 2013(r257316)
@@ -15,5 +15,6 @@ CFLAGS+=  -DMIXEDCASE_FILENAMES=1 \

 LINKS= ${BINDIR}/yacc ${BINDIR}/byacc
 MLINKS=yacc.1 byacc.1
+WARNS= 6
 
 .include 
___
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: r257317 - head/usr.bin/yacc

2013-10-29 Thread Baptiste Daroussin
Author: bapt
Date: Tue Oct 29 08:55:09 2013
New Revision: 257317
URL: http://svnweb.freebsd.org/changeset/base/257317

Log:
  Setting WARNS=6 is useless, as it is already the default
  
  Reported by:  Sascha Wildner

Modified:
  head/usr.bin/yacc/Makefile

Modified: head/usr.bin/yacc/Makefile
==
--- head/usr.bin/yacc/Makefile  Tue Oct 29 08:22:38 2013(r257316)
+++ head/usr.bin/yacc/Makefile  Tue Oct 29 08:55:09 2013(r257317)
@@ -15,6 +15,5 @@ CFLAGS+=  -DMIXEDCASE_FILENAMES=1 \

 LINKS= ${BINDIR}/yacc ${BINDIR}/byacc
 MLINKS=yacc.1 byacc.1
-WARNS= 6
 
 .include 
___
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: r257133 - head/sys/dev/iwn

2013-10-29 Thread Stefan Farfeleder
On Mon, Oct 28, 2013 at 09:27:30PM -0700, Adrian Chadd wrote:
> I've filed a PR.
> 
> Please update to -HEAD and test.

Ok thanks, will do. Probably I won't be able before tomorrow though.

Stefan
___
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: r257324 - in head/sys: compat/svr4 dev/cs dev/cxgbe/tom dev/ep dev/etherswitch/ukswitch dev/ie dev/pdq dev/sbni dev/tsec dev/vx i386/i386 mips/cavium/octe powerpc/ps3 powerpc/pseries

2013-10-29 Thread Gleb Smirnoff
Author: glebius
Date: Tue Oct 29 11:17:49 2013
New Revision: 257324
URL: http://svnweb.freebsd.org/changeset/base/257324

Log:
  - Provide necessary includes.
  - Remove unnecessary includes.
  
  Sponsored by: Netflix
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/compat/svr4/svr4_sockio.c
  head/sys/dev/cs/if_cs_isa.c
  head/sys/dev/cs/if_cs_pccard.c
  head/sys/dev/cs/if_csvar.h
  head/sys/dev/cxgbe/tom/t4_connect.c
  head/sys/dev/ep/if_ep_mca.c
  head/sys/dev/etherswitch/ukswitch/ukswitch.c
  head/sys/dev/ie/if_ie_isa.c
  head/sys/dev/pdq/if_fea.c
  head/sys/dev/sbni/if_sbni_isa.c
  head/sys/dev/tsec/if_tsec_fdt.c
  head/sys/dev/vx/if_vx_eisa.c
  head/sys/i386/i386/bpf_jit_machdep.c
  head/sys/mips/cavium/octe/ethernet-common.c
  head/sys/mips/cavium/octe/ethernet-mdio.c
  head/sys/mips/cavium/octe/ethernet-mem.c
  head/sys/mips/cavium/octe/ethernet-rgmii.c
  head/sys/mips/cavium/octe/ethernet-rx.c
  head/sys/mips/cavium/octe/ethernet-sgmii.c
  head/sys/mips/cavium/octe/ethernet-spi.c
  head/sys/mips/cavium/octe/ethernet-tx.c
  head/sys/mips/cavium/octe/ethernet-xaui.c
  head/sys/mips/cavium/octe/ethernet.c
  head/sys/powerpc/ps3/if_glc.c
  head/sys/powerpc/pseries/phyp_llan.c

Modified: head/sys/compat/svr4/svr4_sockio.c
==
--- head/sys/compat/svr4/svr4_sockio.c  Tue Oct 29 09:57:00 2013
(r257323)
+++ head/sys/compat/svr4/svr4_sockio.c  Tue Oct 29 11:17:49 2013
(r257324)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 
 #include 

Modified: head/sys/dev/cs/if_cs_isa.c
==
--- head/sys/dev/cs/if_cs_isa.c Tue Oct 29 09:57:00 2013(r257323)
+++ head/sys/dev/cs/if_cs_isa.c Tue Oct 29 11:17:49 2013(r257324)
@@ -30,9 +30,11 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
+#include 
 #include 
+#include 
 #include 
-#include 
 
 #include 
 #include 
@@ -42,7 +44,7 @@ __FBSDID("$FreeBSD$");
 
 #include  
 #include 
-#include 
+#include 
 
 #include 
 

Modified: head/sys/dev/cs/if_cs_pccard.c
==
--- head/sys/dev/cs/if_cs_pccard.c  Tue Oct 29 09:57:00 2013
(r257323)
+++ head/sys/dev/cs/if_cs_pccard.c  Tue Oct 29 11:17:49 2013
(r257324)
@@ -29,7 +29,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 #include 
@@ -40,7 +42,7 @@ __FBSDID("$FreeBSD$");
  
 #include  
 #include  
-#include 
+#include 
 
 #include 
 #include 

Modified: head/sys/dev/cs/if_csvar.h
==
--- head/sys/dev/cs/if_csvar.h  Tue Oct 29 09:57:00 2013(r257323)
+++ head/sys/dev/cs/if_csvar.h  Tue Oct 29 11:17:49 2013(r257324)
@@ -28,9 +28,6 @@
 #ifndef _IF_CSVAR_H
 #define _IF_CSVAR_H
 
-#include 
-#include 
-
 /*
  * cs_softc: per line info and status
  */

Modified: head/sys/dev/cxgbe/tom/t4_connect.c
==
--- head/sys/dev/cxgbe/tom/t4_connect.c Tue Oct 29 09:57:00 2013
(r257323)
+++ head/sys/dev/cxgbe/tom/t4_connect.c Tue Oct 29 11:17:49 2013
(r257324)
@@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$");
 
 #ifdef TCP_OFFLOAD
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/ep/if_ep_mca.c
==
--- head/sys/dev/ep/if_ep_mca.c Tue Oct 29 09:57:00 2013(r257323)
+++ head/sys/dev/ep/if_ep_mca.c Tue Oct 29 11:17:49 2013(r257324)
@@ -28,9 +28,12 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 #include 
@@ -38,7 +41,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 #include 
 
 #include 

Modified: head/sys/dev/etherswitch/ukswitch/ukswitch.c
==
--- head/sys/dev/etherswitch/ukswitch/ukswitch.cTue Oct 29 09:57:00 
2013(r257323)
+++ head/sys/dev/etherswitch/ukswitch/ukswitch.cTue Oct 29 11:17:49 
2013(r257324)
@@ -32,16 +32,18 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
 #include 
-#include 
+#include 
 #include 
-#include 
 #include 
 #include 
 

Modified: head/sys/dev/ie/if_ie_isa.c
==
--- head/sys/dev/ie/if_ie_isa.c Tue Oct 29 09:57:00 2013(r257323)
+++ head/sys/dev/ie/if_ie_isa.c Tue Oct 29 11:17:49 2013(r257324)
@@ -41,7 +41,10 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
 #include 
 
 #include 
@@ -54,7 +57,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 #inc

svn commit: r257325 - head/sys/netinet

2013-10-29 Thread Gleb Smirnoff
Author: glebius
Date: Tue Oct 29 11:21:31 2013
New Revision: 257325
URL: http://svnweb.freebsd.org/changeset/base/257325

Log:
  Uninline inm_lookup_locked(). Now in_var.h doesn't dereference
  fields of struct ifnet.
  
  Sponsored by: Netflix
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/netinet/in_mcast.c
  head/sys/netinet/in_var.h

Modified: head/sys/netinet/in_mcast.c
==
--- head/sys/netinet/in_mcast.c Tue Oct 29 11:17:49 2013(r257324)
+++ head/sys/netinet/in_mcast.c Tue Oct 29 11:21:31 2013(r257325)
@@ -224,6 +224,49 @@ imf_init(struct in_mfilter *imf, const i
 }
 
 /*
+ * Function for looking up an in_multi record for an IPv4 multicast address
+ * on a given interface. ifp must be valid. If no record found, return NULL.
+ * The IN_MULTI_LOCK and IF_ADDR_LOCK on ifp must be held.
+ */
+struct in_multi *
+inm_lookup_locked(struct ifnet *ifp, const struct in_addr ina)
+{
+   struct ifmultiaddr *ifma;
+   struct in_multi *inm;
+
+   IN_MULTI_LOCK_ASSERT();
+   IF_ADDR_LOCK_ASSERT(ifp);
+
+   inm = NULL;
+   TAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) {
+   if (ifma->ifma_addr->sa_family == AF_INET) {
+   inm = (struct in_multi *)ifma->ifma_protospec;
+   if (inm->inm_addr.s_addr == ina.s_addr)
+   break;
+   inm = NULL;
+   }
+   }
+   return (inm);
+}
+
+/*
+ * Wrapper for inm_lookup_locked().
+ * The IF_ADDR_LOCK will be taken on ifp and released on return.
+ */
+struct in_multi *
+inm_lookup(struct ifnet *ifp, const struct in_addr ina)
+{
+   struct in_multi *inm;
+
+   IN_MULTI_LOCK_ASSERT();
+   IF_ADDR_RLOCK(ifp);
+   inm = inm_lookup_locked(ifp, ina);
+   IF_ADDR_RUNLOCK(ifp);
+
+   return (inm);
+}
+
+/*
  * Resize the ip_moptions vector to the next power-of-two minus 1.
  * May be called with locks held; do not sleep.
  */

Modified: head/sys/netinet/in_var.h
==
--- head/sys/netinet/in_var.h   Tue Oct 29 11:17:49 2013(r257324)
+++ head/sys/netinet/in_var.h   Tue Oct 29 11:21:31 2013(r257325)
@@ -363,49 +363,6 @@ extern struct mtx in_multi_mtx;
 #defineIN_MULTI_LOCK_ASSERT()  mtx_assert(&in_multi_mtx, MA_OWNED)
 #defineIN_MULTI_UNLOCK_ASSERT() mtx_assert(&in_multi_mtx, MA_NOTOWNED)
 
-/*
- * Function for looking up an in_multi record for an IPv4 multicast address
- * on a given interface. ifp must be valid. If no record found, return NULL.
- * The IN_MULTI_LOCK and IF_ADDR_LOCK on ifp must be held.
- */
-static __inline struct in_multi *
-inm_lookup_locked(struct ifnet *ifp, const struct in_addr ina)
-{
-   struct ifmultiaddr *ifma;
-   struct in_multi *inm;
-
-   IN_MULTI_LOCK_ASSERT();
-   IF_ADDR_LOCK_ASSERT(ifp);
-
-   inm = NULL;
-   TAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) {
-   if (ifma->ifma_addr->sa_family == AF_INET) {
-   inm = (struct in_multi *)ifma->ifma_protospec;
-   if (inm->inm_addr.s_addr == ina.s_addr)
-   break;
-   inm = NULL;
-   }
-   }
-   return (inm);
-}
-
-/*
- * Wrapper for inm_lookup_locked().
- * The IF_ADDR_LOCK will be taken on ifp and released on return.
- */
-static __inline struct in_multi *
-inm_lookup(struct ifnet *ifp, const struct in_addr ina)
-{
-   struct in_multi *inm;
-
-   IN_MULTI_LOCK_ASSERT();
-   IF_ADDR_RLOCK(ifp);
-   inm = inm_lookup_locked(ifp, ina);
-   IF_ADDR_RUNLOCK(ifp);
-
-   return (inm);
-}
-
 /* Acquire an in_multi record. */
 static __inline void
 inm_acquire_locked(struct in_multi *inm)
@@ -428,6 +385,8 @@ struct  route;
 struct ip_moptions;
 struct radix_node_head;
 
+struct in_multi *inm_lookup_locked(struct ifnet *, const struct in_addr);
+struct in_multi *inm_lookup(struct ifnet *, const struct in_addr);
 intimo_multi_filter(const struct ip_moptions *, const struct ifnet *,
const struct sockaddr *, const struct sockaddr *);
 void   inm_commit(struct in_multi *);
___
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: r257326 - head/sys/dev/cesa

2013-10-29 Thread Randall Stewart
Author: rrs
Date: Tue Oct 29 11:28:11 2013
New Revision: 257326
URL: http://svnweb.freebsd.org/changeset/base/257326

Log:
  Opps, my kirkwood fix for the dreamplug missed this.

Modified:
  head/sys/dev/cesa/cesa.c

Modified: head/sys/dev/cesa/cesa.c
==
--- head/sys/dev/cesa/cesa.cTue Oct 29 11:21:31 2013(r257325)
+++ head/sys/dev/cesa/cesa.cTue Oct 29 11:28:11 2013(r257326)
@@ -995,11 +995,17 @@ cesa_attach(device_t dev)
sc->sc_dev = dev;
 
/* Check if CESA peripheral device has power turned on */
+#if defined(SOC_MV_KIRKWOOD)
+   if (soc_power_ctrl_get(CPU_PM_CTRL_CRYPTO) == CPU_PM_CTRL_CRYPTO) {
+   device_printf(dev, "not powered on\n");
+   return (ENXIO);
+   }
+#else
if (soc_power_ctrl_get(CPU_PM_CTRL_CRYPTO) != CPU_PM_CTRL_CRYPTO) {
device_printf(dev, "not powered on\n");
return (ENXIO);
}
-
+#endif
soc_id(&d, &r);
 
switch (d) {
___
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: r257329 - head

2013-10-29 Thread Takahashi Yoshihiro
Author: nyan
Date: Tue Oct 29 12:34:11 2013
New Revision: 257329
URL: http://svnweb.freebsd.org/changeset/base/257329

Log:
  Fix build.  Both clang and gcc are required on pc98.
  
  X-MFC with:   r256915

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Oct 29 12:25:22 2013(r257328)
+++ head/Makefile.inc1  Tue Oct 29 12:34:11 2013(r257329)
@@ -1388,12 +1388,17 @@ _binutils=  gnu/usr.bin/binutils
 # If an full path to an external cross compiler is given, don't build
 # a cross compiler.
 .if ${XCC:M/*} == "" && ${MK_CROSS_COMPILER} != "no"
-.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && ${TARGET} != 
"pc98"
+.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang"
 _clang=usr.bin/clang
 _clang_libs=   lib/clang
 .else
 _cc=   gnu/usr.bin/cc
 .endif
+
+# The boot2 for pc98 requires gcc.
+.if ${TARGET} == "pc98"
+_cc=   gnu/usr.bin/cc
+.endif
 .endif
 
 cross-tools: .MAKE
___
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: r257332 - head/sys/conf

2013-10-29 Thread Zbigniew Bodek
Author: zbb
Date: Tue Oct 29 13:16:05 2013
New Revision: 257332
URL: http://svnweb.freebsd.org/changeset/base/257332

Log:
  Add missing ARMv6 CPU functions to ARM Makefile
  
  Will fix RPI-B kernel build failure since it adds missing
  armv6_idcache_wbinv_all which was previously taken from cpufunc_asm_pj4b.S.
  
  Reviewed by:  gber

Modified:
  head/sys/conf/Makefile.arm

Modified: head/sys/conf/Makefile.arm
==
--- head/sys/conf/Makefile.arm  Tue Oct 29 12:56:21 2013(r257331)
+++ head/sys/conf/Makefile.arm  Tue Oct 29 13:16:05 2013(r257332)
@@ -75,7 +75,8 @@ FILES_CPU_FUNC =  $S/$M/$M/cpufunc_asm_ar
$S/$M/$M/cpufunc_asm_xscale.S $S/$M/$M/cpufunc_asm.S \
$S/$M/$M/cpufunc_asm_xscale_c3.S $S/$M/$M/cpufunc_asm_armv5_ec.S \
$S/$M/$M/cpufunc_asm_fa526.S $S/$M/$M/cpufunc_asm_sheeva.S \
-   $S/$M/$M/cpufunc_asm_pj4b.S $S/$M/$M/cpufunc_asm_armv7.S
+   $S/$M/$M/cpufunc_asm_pj4b.S $S/$M/$M/cpufunc_asm_armv6.S \
+   $S/$M/$M/cpufunc_asm_armv7.S
 
 KERNEL_EXTRA=trampoline
 KERNEL_EXTRA_INSTALL=kernel.gz.tramp
___
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: r257298 - head/lib/libproc

2013-10-29 Thread Bruce Evans

On Tue, 29 Oct 2013, Mark Johnston wrote:


Log:
 Revert r257248 and fix the problem in a way that doesn't violate style(9).


Why did gcc complain about the original version?


Modified: head/lib/libproc/_libproc.h
==
--- head/lib/libproc/_libproc.h Tue Oct 29 02:25:18 2013(r257297)
+++ head/lib/libproc/_libproc.h Tue Oct 29 03:12:31 2013(r257298)
@@ -52,6 +52,6 @@ struct proc_handle {
#define DPRINTF(...)warn(__VA_ARGS__)
#define DPRINTFX(...)   warnx(__VA_ARGS__)
#else
-#defineDPRINTF(...)
-#defineDPRINTFX(...)
+#defineDPRINTF(...)do { } while (0)
+#defineDPRINTFX(...)   do { } while (0)
#endif

Modified: head/lib/libproc/proc_util.c
==
--- head/lib/libproc/proc_util.cTue Oct 29 02:25:18 2013
(r257297)
+++ head/lib/libproc/proc_util.cTue Oct 29 03:12:31 2013
(r257298)
@@ -145,9 +145,8 @@ proc_wstatus(struct proc_handle *phdl)
if (phdl == NULL)
return (-1);
if (waitpid(phdl->pid, &status, WUNTRACED) < 0) {
-   if (errno != EINTR) {
+   if (errno != EINTR)
DPRINTF("waitpid");
-   }
return (-1);
}
if (WIFSTOPPED(status))


Unlike some buggy macros, the null macro expanded to syntactically correct
code:

if (errno != EINTR)
;

so it doesn't need the do-while hack.  Empty statements are common in some
contexts, so compilers shouldn't warn about them.  In all versions, the
macro isn't completely function-like and the if statement is dead code,
so if compilers warn about too many things then the do-while hack wouldn't
work here or in most places that it is used.

Nearby style bugs:
- the error check is for "< 0" instead of for "== -1"
- the error message is not as loud as old ones.  All old ones begin with
  "ERROR: ".  The new style is better.  "ERROR" is not even redundant.
  It is wrong, since the errors are just warnings.

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: r257334 - in head/sys/dev/terasic: de4led mtl

2013-10-29 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Oct 29 13:43:09 2013
New Revision: 257334
URL: http://svnweb.freebsd.org/changeset/base/257334

Log:
  Hints-only devices should have BUS_PROBE_NOWILDCARD set. We probably need
  a better flag for this (in the driver metadata, for example).

Modified:
  head/sys/dev/terasic/de4led/terasic_de4led_nexus.c
  head/sys/dev/terasic/mtl/terasic_mtl_nexus.c

Modified: head/sys/dev/terasic/de4led/terasic_de4led_nexus.c
==
--- head/sys/dev/terasic/de4led/terasic_de4led_nexus.c  Tue Oct 29 13:38:44 
2013(r257333)
+++ head/sys/dev/terasic/de4led/terasic_de4led_nexus.c  Tue Oct 29 13:43:09 
2013(r257334)
@@ -58,7 +58,7 @@ terasic_de4led_nexus_probe(device_t dev)
 {
 
device_set_desc(dev, "Terasic DE4 8-element LED");
-   return (BUS_PROBE_DEFAULT);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/dev/terasic/mtl/terasic_mtl_nexus.c
==
--- head/sys/dev/terasic/mtl/terasic_mtl_nexus.cTue Oct 29 13:38:44 
2013(r257333)
+++ head/sys/dev/terasic/mtl/terasic_mtl_nexus.cTue Oct 29 13:43:09 
2013(r257334)
@@ -55,7 +55,7 @@ terasic_mtl_nexus_probe(device_t dev)
 {
 
device_set_desc(dev, "Terasic Multi-touch LCD (MTL)");
-   return (BUS_PROBE_DEFAULT);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 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: r257335 - head/share/misc

2013-10-29 Thread Sergey Kandaurov
Author: pluknet
Date: Tue Oct 29 13:44:19 2013
New Revision: 257335
URL: http://svnweb.freebsd.org/changeset/base/257335

Log:
  OS X 10.9 added.

Modified:
  head/share/misc/bsd-family-tree

Modified: head/share/misc/bsd-family-tree
==
--- head/share/misc/bsd-family-tree Tue Oct 29 13:43:09 2013
(r257334)
+++ head/share/misc/bsd-family-tree Tue Oct 29 13:44:19 2013
(r257335)
@@ -282,7 +282,8 @@ FreeBSD 5.2   |  |  
  | |  8.4 |  |NetBSD 6.1.1 |   |
  | |  |  |   | |   |
  |  FreeBSD   |  |NetBSD 6.1.2 |   |
- |9.2 |  | |   |
+ |9.2  Mac OS X  | |   |
+ |   10.0| |   |
  ||  | |   |
  ||  | |   |
  ||  | |   |
@@ -600,6 +601,7 @@ NetBSD 5.2.12013-09-29 [NBD]
 FreeBSD 9.22013-09-30 [FBD]
 NetBSD 6.0.3   2013-09-30 [NBD]
 NetBSD 6.1.2   2013-09-30 [NBD]
+Mac OS X 10.9  2013-10-22 [APL]
 
 Bibliography
 
___
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: r257336 - in head/sys/dev/altera: atse avgen jtag_uart sdcard

2013-10-29 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Oct 29 13:48:41 2013
New Revision: 257336
URL: http://svnweb.freebsd.org/changeset/base/257336

Log:
  These nexus attachments do not execute a real probe and so need
  BUS_PROBE_NOWILDCARD set.

Modified:
  head/sys/dev/altera/atse/if_atse_nexus.c
  head/sys/dev/altera/avgen/altera_avgen_nexus.c
  head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c
  head/sys/dev/altera/sdcard/altera_sdcard_nexus.c

Modified: head/sys/dev/altera/atse/if_atse_nexus.c
==
--- head/sys/dev/altera/atse/if_atse_nexus.cTue Oct 29 13:44:19 2013
(r257335)
+++ head/sys/dev/altera/atse/if_atse_nexus.cTue Oct 29 13:48:41 2013
(r257336)
@@ -130,7 +130,7 @@ atse_probe_nexus(device_t dev)
 
/* Success. */
device_set_desc(dev, "Altera Triple-Speed Ethernet MegaCore");
-   return (BUS_PROBE_DEFAULT);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/dev/altera/avgen/altera_avgen_nexus.c
==
--- head/sys/dev/altera/avgen/altera_avgen_nexus.c  Tue Oct 29 13:44:19 
2013(r257335)
+++ head/sys/dev/altera/avgen/altera_avgen_nexus.c  Tue Oct 29 13:48:41 
2013(r257336)
@@ -58,7 +58,7 @@ altera_avgen_nexus_probe(device_t dev)
 {
 
device_set_desc(dev, "Generic Altera Avalon device attachment");
-   return (BUS_PROBE_DEFAULT);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c
==
--- head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c  Tue Oct 29 
13:44:19 2013(r257335)
+++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c  Tue Oct 29 
13:48:41 2013(r257336)
@@ -62,7 +62,7 @@ altera_jtag_uart_nexus_probe(device_t de
 {
 
device_set_desc(dev, "Altera JTAG UART");
-   return (BUS_PROBE_DEFAULT);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/dev/altera/sdcard/altera_sdcard_nexus.c
==
--- head/sys/dev/altera/sdcard/altera_sdcard_nexus.cTue Oct 29 13:44:19 
2013(r257335)
+++ head/sys/dev/altera/sdcard/altera_sdcard_nexus.cTue Oct 29 13:48:41 
2013(r257336)
@@ -62,7 +62,7 @@ altera_sdcard_nexus_probe(device_t dev)
 {
 
device_set_desc(dev, "Altera Secure Data Card IP Core");
-   return (BUS_PROBE_DEFAULT);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 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: r257337 - in head/sys/arm/xscale: i80321 pxa

2013-10-29 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Oct 29 13:52:05 2013
New Revision: 257337
URL: http://svnweb.freebsd.org/changeset/base/257337

Log:
  Hints-only devices should return BUS_PROBE_NOWILDCARD from their probe
  methods.

Modified:
  head/sys/arm/xscale/i80321/iq80321.c
  head/sys/arm/xscale/pxa/pxa_obio.c

Modified: head/sys/arm/xscale/i80321/iq80321.c
==
--- head/sys/arm/xscale/i80321/iq80321.cTue Oct 29 13:48:41 2013
(r257336)
+++ head/sys/arm/xscale/i80321/iq80321.cTue Oct 29 13:52:05 2013
(r257337)
@@ -72,7 +72,7 @@ int
 iq80321_probe(device_t dev)
 {
device_set_desc(dev, "Intel 80321");
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 void

Modified: head/sys/arm/xscale/pxa/pxa_obio.c
==
--- head/sys/arm/xscale/pxa/pxa_obio.c  Tue Oct 29 13:48:41 2013
(r257336)
+++ head/sys/arm/xscale/pxa/pxa_obio.c  Tue Oct 29 13:52:05 2013
(r257337)
@@ -92,7 +92,7 @@ pxa_probe(device_t dev)
 {
 
device_set_desc(dev, "XScale PXA On-board IO");
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 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: r257338 - in head/sys/mips: adm5120 alchemy atheros cavium idt malta mips nlm rmi rt305x sibyte

2013-10-29 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Oct 29 14:07:31 2013
New Revision: 257338
URL: http://svnweb.freebsd.org/changeset/base/257338

Log:
  Devices that rely on hints or identify routines for discovery need to
  return BUS_PROBE_NOWILDCARD from their probe routines to avoid claiming
  wildcard devices on their parent bus. Do a sweep through the MIPS tree.
  
  MFC after: 2 weeks

Modified:
  head/sys/mips/adm5120/obio.c
  head/sys/mips/alchemy/obio.c
  head/sys/mips/atheros/apb.c
  head/sys/mips/atheros/ar71xx_ehci.c
  head/sys/mips/atheros/ar71xx_pci.c
  head/sys/mips/atheros/ar71xx_spi.c
  head/sys/mips/atheros/ar71xx_wdog.c
  head/sys/mips/atheros/ar724x_pci.c
  head/sys/mips/atheros/if_arge.c
  head/sys/mips/cavium/ciu.c
  head/sys/mips/cavium/octeon_ebt3000_cf.c
  head/sys/mips/cavium/octeon_pmc.c
  head/sys/mips/cavium/octeon_rnd.c
  head/sys/mips/cavium/octeon_rtc.c
  head/sys/mips/idt/obio.c
  head/sys/mips/malta/gt.c
  head/sys/mips/mips/tick.c
  head/sys/mips/nlm/tick.c
  head/sys/mips/nlm/xlp_pci.c
  head/sys/mips/rmi/iodi.c
  head/sys/mips/rmi/tick.c
  head/sys/mips/rt305x/obio.c
  head/sys/mips/sibyte/sb_zbbus.c

Modified: head/sys/mips/adm5120/obio.c
==
--- head/sys/mips/adm5120/obio.cTue Oct 29 13:52:05 2013
(r257337)
+++ head/sys/mips/adm5120/obio.cTue Oct 29 14:07:31 2013
(r257338)
@@ -157,7 +157,7 @@ static int
 obio_probe(device_t dev)
 {
 
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/mips/alchemy/obio.c
==
--- head/sys/mips/alchemy/obio.cTue Oct 29 13:52:05 2013
(r257337)
+++ head/sys/mips/alchemy/obio.cTue Oct 29 14:07:31 2013
(r257338)
@@ -158,7 +158,7 @@ static int
 obio_probe(device_t dev)
 {
 
-   return (0);
+   return (BUS_PROBE_NO_WILDCARD);
 }
 
 static int

Modified: head/sys/mips/atheros/apb.c
==
--- head/sys/mips/atheros/apb.c Tue Oct 29 13:52:05 2013(r257337)
+++ head/sys/mips/atheros/apb.c Tue Oct 29 14:07:31 2013(r257338)
@@ -103,7 +103,7 @@ static int
 apb_probe(device_t dev)
 {
 
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/mips/atheros/ar71xx_ehci.c
==
--- head/sys/mips/atheros/ar71xx_ehci.c Tue Oct 29 13:52:05 2013
(r257337)
+++ head/sys/mips/atheros/ar71xx_ehci.c Tue Oct 29 14:07:31 2013
(r257338)
@@ -75,7 +75,7 @@ ar71xx_ehci_probe(device_t self)
 
device_set_desc(self, EHCI_HC_DEVSTR);
 
-   return (BUS_PROBE_DEFAULT);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/mips/atheros/ar71xx_pci.c
==
--- head/sys/mips/atheros/ar71xx_pci.c  Tue Oct 29 13:52:05 2013
(r257337)
+++ head/sys/mips/atheros/ar71xx_pci.c  Tue Oct 29 14:07:31 2013
(r257338)
@@ -371,7 +371,7 @@ static int
 ar71xx_pci_probe(device_t dev)
 {
 
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/mips/atheros/ar71xx_spi.c
==
--- head/sys/mips/atheros/ar71xx_spi.c  Tue Oct 29 13:52:05 2013
(r257337)
+++ head/sys/mips/atheros/ar71xx_spi.c  Tue Oct 29 14:07:31 2013
(r257338)
@@ -92,7 +92,7 @@ static int
 ar71xx_spi_probe(device_t dev)
 {
device_set_desc(dev, "AR71XX SPI");
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/mips/atheros/ar71xx_wdog.c
==
--- head/sys/mips/atheros/ar71xx_wdog.c Tue Oct 29 13:52:05 2013
(r257337)
+++ head/sys/mips/atheros/ar71xx_wdog.c Tue Oct 29 14:07:31 2013
(r257338)
@@ -92,7 +92,7 @@ ar71xx_wdog_probe(device_t dev)
 {
 
device_set_desc(dev, "Atheros AR71XX watchdog timer");
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static void

Modified: head/sys/mips/atheros/ar724x_pci.c
==
--- head/sys/mips/atheros/ar724x_pci.c  Tue Oct 29 13:52:05 2013
(r257337)
+++ head/sys/mips/atheros/ar724x_pci.c  Tue Oct 29 14:07:31 2013
(r257338)
@@ -349,7 +349,7 @@ static int
 ar724x_pci_probe(device_t dev)
 {
 
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/mips/atheros/if_arge.c
==
--- head/sys/mips/atheros/if_arge.c Tue Oct 29 13:52:05 2013
(r257337)
+++ head/sys/mips/atheros/if_arge.c Tue Oct 29 14:07:31 2013
(r257338)
@@ -262,

svn commit: r257340 - head/share/misc

2013-10-29 Thread Sergey Kandaurov
Author: pluknet
Date: Tue Oct 29 14:15:09 2013
New Revision: 257340
URL: http://svnweb.freebsd.org/changeset/base/257340

Log:
  Fixed typo.
  
  Submitted by: Nikolai Lifanov
  Pointyhat:pluknet

Modified:
  head/share/misc/bsd-family-tree

Modified: head/share/misc/bsd-family-tree
==
--- head/share/misc/bsd-family-tree Tue Oct 29 14:07:42 2013
(r257339)
+++ head/share/misc/bsd-family-tree Tue Oct 29 14:15:09 2013
(r257340)
@@ -283,7 +283,7 @@ FreeBSD 5.2   |  |  
  | |  |  |   | |   |
  |  FreeBSD   |  |NetBSD 6.1.2 |   |
  |9.2  Mac OS X  | |   |
- |   10.0| |   |
+ |   10.9| |   |
  ||  | |   |
  ||  | |   |
  ||  | |   |
___
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: r257341 - in head/sys/dev: acpica cfe gxemul/disk gxemul/ether hyperv/vmbus rt xen/console xen/pcifront xen/timer

2013-10-29 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Oct 29 14:19:42 2013
New Revision: 257341
URL: http://svnweb.freebsd.org/changeset/base/257341

Log:
  More BUS_PROBE_NOWILDCARD sweeping. Some devices here (if_ath_ahb and siba)
  resist easy conversion since they implement a great deal of their attach
  logic inside probe(). Some of this could be fixed by moving it to attach(),
  but some requires something more subtle than BUS_PROBE_NOWILDCARD.

Modified:
  head/sys/dev/acpica/acpi.c
  head/sys/dev/cfe/cfe_resource.c
  head/sys/dev/gxemul/disk/gxemul_disk.c
  head/sys/dev/gxemul/ether/if_gx.c
  head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
  head/sys/dev/rt/if_rt.c
  head/sys/dev/xen/console/console.c
  head/sys/dev/xen/pcifront/pcifront.c
  head/sys/dev/xen/timer/timer.c

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Tue Oct 29 14:15:09 2013(r257340)
+++ head/sys/dev/acpica/acpi.c  Tue Oct 29 14:19:42 2013(r257341)
@@ -431,7 +431,7 @@ acpi_probe(device_t dev)
 
 device_set_desc(dev, acpi_desc);
 
-return_VALUE (0);
+return_VALUE (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/dev/cfe/cfe_resource.c
==
--- head/sys/dev/cfe/cfe_resource.c Tue Oct 29 14:15:09 2013
(r257340)
+++ head/sys/dev/cfe/cfe_resource.c Tue Oct 29 14:19:42 2013
(r257341)
@@ -61,7 +61,7 @@ static int
 cferes_probe(device_t dev)
 {
 
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/dev/gxemul/disk/gxemul_disk.c
==
--- head/sys/dev/gxemul/disk/gxemul_disk.c  Tue Oct 29 14:15:09 2013
(r257340)
+++ head/sys/dev/gxemul/disk/gxemul_disk.c  Tue Oct 29 14:19:42 2013
(r257341)
@@ -158,7 +158,7 @@ gxemul_disk_probe(device_t dev)
 {
device_set_desc(dev, "GXemul test disk");
 
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static void

Modified: head/sys/dev/gxemul/ether/if_gx.c
==
--- head/sys/dev/gxemul/ether/if_gx.c   Tue Oct 29 14:15:09 2013
(r257340)
+++ head/sys/dev/gxemul/ether/if_gx.c   Tue Oct 29 14:19:42 2013
(r257341)
@@ -125,7 +125,7 @@ gx_probe(device_t dev)
 
device_set_desc(dev, "GXemul test Ethernet");
 
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
==
--- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.cTue Oct 29 14:15:09 
2013(r257340)
+++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.cTue Oct 29 14:19:42 
2013(r257341)
@@ -313,7 +313,7 @@ vmbus_probe(device_t dev) {
 
device_set_desc(dev, "Vmbus Devices");
 
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 /**

Modified: head/sys/dev/rt/if_rt.c
==
--- head/sys/dev/rt/if_rt.c Tue Oct 29 14:15:09 2013(r257340)
+++ head/sys/dev/rt/if_rt.c Tue Oct 29 14:19:42 2013(r257341)
@@ -149,7 +149,7 @@ static int
 rt_probe(device_t dev)
 {
device_set_desc(dev, "Ralink RT305XF onChip Ethernet MAC");
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 /*

Modified: head/sys/dev/xen/console/console.c
==
--- head/sys/dev/xen/console/console.c  Tue Oct 29 14:15:09 2013
(r257340)
+++ head/sys/dev/xen/console/console.c  Tue Oct 29 14:19:42 2013
(r257341)
@@ -226,7 +226,7 @@ static int
 xc_probe(device_t dev)
 {
 
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int

Modified: head/sys/dev/xen/pcifront/pcifront.c
==
--- head/sys/dev/xen/pcifront/pcifront.cTue Oct 29 14:15:09 2013
(r257340)
+++ head/sys/dev/xen/pcifront/pcifront.cTue Oct 29 14:19:42 2013
(r257341)
@@ -441,7 +441,7 @@ xpcife_probe(device_t dev)
struct pcifront_device *pdev = (struct pcifront_device 
*)device_get_ivars(dev);
DPRINTF("xpcife probe (unit=%d)\n", pdev->unit);
 #endif
-   return 0;
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 /* Newbus xpcife device driver attach */

Modified: head/sys/dev/xen/timer/timer.c
==
--- head/sys/dev/xen/timer/timer.c  Tue Oct 29 14:15:09 2013
(r257340)
+++ head/sys/dev/xen/timer/timer.c  Tue Oct 29 14:19:42 2013
(r257341)
@@ -142,7 +142,7 @@ xentimer_probe(device_t dev)
   "VCPUOPs interface unavailable\n");
 #undef XTREQUIRE

svn commit: r257342 - in head/sys/arm: econa s3c2xx0 sa11x0

2013-10-29 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Oct 29 14:32:33 2013
New Revision: 257342
URL: http://svnweb.freebsd.org/changeset/base/257342

Log:
  A few last BUS_PROBE_NOWILDCARDs are in order.

Modified:
  head/sys/arm/econa/econa.c
  head/sys/arm/s3c2xx0/s3c24x0.c
  head/sys/arm/sa11x0/sa11x0.c

Modified: head/sys/arm/econa/econa.c
==
--- head/sys/arm/econa/econa.c  Tue Oct 29 14:19:42 2013(r257341)
+++ head/sys/arm/econa/econa.c  Tue Oct 29 14:32:33 2013(r257342)
@@ -172,7 +172,7 @@ econa_probe(device_t dev)
 {
 
device_set_desc(dev, "ECONA device bus");
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static void

Modified: head/sys/arm/s3c2xx0/s3c24x0.c
==
--- head/sys/arm/s3c2xx0/s3c24x0.c  Tue Oct 29 14:19:42 2013
(r257341)
+++ head/sys/arm/s3c2xx0/s3c24x0.c  Tue Oct 29 14:32:33 2013
(r257342)
@@ -429,7 +429,7 @@ s3c24x0_identify(driver_t *driver, devic
 int
 s3c24x0_probe(device_t dev)
 {
-   return 0;
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 int

Modified: head/sys/arm/sa11x0/sa11x0.c
==
--- head/sys/arm/sa11x0/sa11x0.cTue Oct 29 14:19:42 2013
(r257341)
+++ head/sys/arm/sa11x0/sa11x0.cTue Oct 29 14:32:33 2013
(r257342)
@@ -139,7 +139,7 @@ extern vm_offset_t saipic_base;
 int
 sa11x0_probe(device_t dev)
 {
-   return 0;
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 void
___
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: r257343 - head/sys/arm/at91

2013-10-29 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Oct 29 14:44:36 2013
New Revision: 257343
URL: http://svnweb.freebsd.org/changeset/base/257343

Log:
  A last BUS_PROBE_NOWILDCARD. Move setting the postfilter function into the
  attach function probe shouldn't actually set anything up but just bid
  on the device.

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

Modified: head/sys/arm/at91/at91.c
==
--- head/sys/arm/at91/at91.cTue Oct 29 14:32:33 2013(r257342)
+++ head/sys/arm/at91/at91.cTue Oct 29 14:44:36 2013(r257343)
@@ -231,8 +231,7 @@ at91_probe(device_t dev)
 {
 
device_set_desc(dev, "AT91 device bus");
-   arm_post_filter = at91_eoi;
-   return (0);
+   return (BUS_PROBE_NO_WILDCARD);
 }
 
 static void
@@ -261,6 +260,8 @@ at91_attach(device_t dev)
const struct pmap_devmap *pdevmap;
int i;
 
+   arm_post_filter = at91_eoi;
+
at91_softc = sc;
sc->sc_st = &at91_bs_tag;
sc->sc_sh = AT91_BASE;
___
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: r257344 - in head: etc etc/keys etc/mtree etc/pkg share share/keys share/keys/pkg/trusted share/man/man7

2013-10-29 Thread Bryan Drewery
Author: bdrewery (ports committer)
Date: Tue Oct 29 15:07:54 2013
New Revision: 257344
URL: http://svnweb.freebsd.org/changeset/base/257344

Log:
  Move /etc/keys to /usr/share/keys where users are less likely to modify them.
  
  Requested by: secteam (cperciva, des)
  Approved by:  bapt

Added:
  head/share/keys/
 - copied from r257343, head/etc/keys/
Deleted:
  head/etc/keys/
Modified:
  head/etc/Makefile
  head/etc/mtree/BSD.root.dist
  head/etc/mtree/BSD.usr.dist
  head/etc/pkg/FreeBSD.conf
  head/share/Makefile
  head/share/keys/pkg/trusted/Makefile
  head/share/man/man7/hier.7

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Tue Oct 29 14:44:36 2013(r257343)
+++ head/etc/Makefile   Tue Oct 29 15:07:54 2013(r257344)
@@ -224,7 +224,6 @@ distribution:
${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
${_+_}cd ${.CURDIR}/devd; ${MAKE} install
${_+_}cd ${.CURDIR}/gss; ${MAKE} install
-   ${_+_}cd ${.CURDIR}/keys; ${MAKE} install
${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
 .if ${MK_PKGBOOTSTRAP} != "no"
${_+_}cd ${.CURDIR}/pkg; ${MAKE} install

Modified: head/etc/mtree/BSD.root.dist
==
--- head/etc/mtree/BSD.root.distTue Oct 29 14:44:36 2013
(r257343)
+++ head/etc/mtree/BSD.root.distTue Oct 29 15:07:54 2013
(r257344)
@@ -34,14 +34,6 @@
 ..
 gss
 ..
-keys
-pkg
-revoked
-..
-trusted
-..
-..
-..
 mail
 ..
 mtree

Modified: head/etc/mtree/BSD.usr.dist
==
--- head/etc/mtree/BSD.usr.dist Tue Oct 29 14:44:36 2013(r257343)
+++ head/etc/mtree/BSD.usr.dist Tue Oct 29 15:07:54 2013(r257344)
@@ -478,6 +478,14 @@
 ..
 info
 ..
+keys
+pkg
+revoked
+..
+trusted
+..
+..
+..
 locale
 UTF-8
 ..

Modified: head/etc/pkg/FreeBSD.conf
==
--- head/etc/pkg/FreeBSD.conf   Tue Oct 29 14:44:36 2013(r257343)
+++ head/etc/pkg/FreeBSD.conf   Tue Oct 29 15:07:54 2013(r257344)
@@ -3,6 +3,6 @@ FreeBSD: {
   url: "pkg+http://pkg.freebsd.org/${ABI}/latest";,
   mirror_type: "srv",
   signature_type: "none",
-  fingerprints: "/etc/keys/pkg",
+  fingerprints: "/usr/share/keys/pkg",
   enabled: "yes"
 }

Modified: head/share/Makefile
==
--- head/share/Makefile Tue Oct 29 14:44:36 2013(r257343)
+++ head/share/Makefile Tue Oct 29 15:07:54 2013(r257344)
@@ -11,6 +11,7 @@ SUBDIR=   ${_colldef} \
dtrace \
${_examples} \
${_i18n} \
+   keys \
${_man} \
${_me} \
misc \

Modified: head/share/keys/pkg/trusted/Makefile
==
--- head/etc/keys/pkg/trusted/Makefile  Tue Oct 29 14:44:36 2013
(r257343)
+++ head/share/keys/pkg/trusted/MakefileTue Oct 29 15:07:54 2013
(r257344)
@@ -4,7 +4,7 @@ NO_OBJ=
 
 FILES= pkg.freebsd.org.2013102301
 
-FILESDIR=  /etc/keys/pkg/trusted
+FILESDIR=  /usr/share/keys/pkg/trusted
 FILESMODE= 644
 
 .include 

Modified: head/share/man/man7/hier.7
==
--- head/share/man/man7/hier.7  Tue Oct 29 14:44:36 2013(r257343)
+++ head/share/man/man7/hier.7  Tue Oct 29 15:07:54 2013(r257344)
@@ -32,7 +32,7 @@
 .\"@(#)hier.7  8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd October 23, 2013
+.Dd October 29, 2013
 .Dt HIER 7
 .Os
 .Sh NAME
@@ -94,15 +94,6 @@ bluetooth configuration files
 gnats configuration files;
 see
 .Xr send-pr 1
-.It Pa keys/
-known trusted and revoked keys.
-.Pp
-.Bl -tag -width ".Pa keys/pkg/" -compact
-.It Pa keys/pkg/
-fingerprints for
-.Xr pkg 8
-.El
-.Pp
 .It Pa localtime
 local timezone information;
 see
@@ -556,6 +547,16 @@ ASCII text files used by various games
 device description file for device name
 .It Pa info/
 GNU Info hypertext system
+.It Pa keys/
+known trusted and revoked keys.
+.Bl -tag -width ".Pa keys/pkg/" -compact
+.It Pa keys/pkg/
+fingerprints for
+.Xr pkg 7
+and
+.Xr pkg 8
+.El
+.Pp
 .It Pa locale/
 localization files;
 see
___
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: r257298 - head/lib/libproc

2013-10-29 Thread Mark Johnston
On Wed, Oct 30, 2013 at 12:21:28AM +1100, Bruce Evans wrote:
> On Tue, 29 Oct 2013, Mark Johnston wrote:
> 
> > Log:
> >  Revert r257248 and fix the problem in a way that doesn't violate style(9).
> 
> Why did gcc complain about the original version?

It looks like this is because of the use of -W, which is apparently an
alias for -Wextra; according to the gcc man page, this will trigger a
warning when "an empty body occurs in an if or else statement."

> 
> > Modified: head/lib/libproc/_libproc.h
> > ==
> > --- head/lib/libproc/_libproc.h Tue Oct 29 02:25:18 2013
> > (r257297)
> > +++ head/lib/libproc/_libproc.h Tue Oct 29 03:12:31 2013
> > (r257298)
> > @@ -52,6 +52,6 @@ struct proc_handle {
> > #define DPRINTF(...)warn(__VA_ARGS__)
> > #define DPRINTFX(...)   warnx(__VA_ARGS__)
> > #else
> > -#defineDPRINTF(...)
> > -#defineDPRINTFX(...)
> > +#defineDPRINTF(...)do { } while (0)
> > +#defineDPRINTFX(...)   do { } while (0)
> > #endif
> >
> > Modified: head/lib/libproc/proc_util.c
> > ==
> > --- head/lib/libproc/proc_util.cTue Oct 29 02:25:18 2013
> > (r257297)
> > +++ head/lib/libproc/proc_util.cTue Oct 29 03:12:31 2013
> > (r257298)
> > @@ -145,9 +145,8 @@ proc_wstatus(struct proc_handle *phdl)
> > if (phdl == NULL)
> > return (-1);
> > if (waitpid(phdl->pid, &status, WUNTRACED) < 0) {
> > -   if (errno != EINTR) {
> > +   if (errno != EINTR)
> > DPRINTF("waitpid");
> > -   }
> > return (-1);
> > }
> > if (WIFSTOPPED(status))
> 
> Unlike some buggy macros, the null macro expanded to syntactically correct
> code:
> 
>   if (errno != EINTR)
>   ;
> 
> so it doesn't need the do-while hack.  Empty statements are common in some
> contexts, so compilers shouldn't warn about them.  In all versions, the
> macro isn't completely function-like and the if statement is dead code,
> so if compilers warn about too many things then the do-while hack wouldn't
> work here or in most places that it is used.
> 
> Nearby style bugs:
> - the error check is for "< 0" instead of for "== -1"
> - the error message is not as loud as old ones.  All old ones begin with
>"ERROR: ".  The new style is better.  "ERROR" is not even redundant.
>It is wrong, since the errors are just warnings.
> 
> 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: r257345 - in head/sys: cam cam/scsi powerpc/pseries

2013-10-29 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Oct 29 15:36:58 2013
New Revision: 257345
URL: http://svnweb.freebsd.org/changeset/base/257345

Log:
  Implement extended LUN support. If PIM_EXTLUNS is set by a SIM, encode
  the upper 32-bits of the LUN, if possible, into the target_lun field as
  passed directly from the REPORT LUNs response. This allows extended LUN
  support to work for all LUNs with zeros in the lower 32-bits, which covers
  most addressing modes without breaking KBI. Behavior for drivers not
  setting PIM_EXTLUNS is unchanged. No user-facing interfaces are modified.
  
  Extended LUNs are stored with swizzled 16-bit word order so that, for
  devices implementing LUN addressing (like SCSI-2), the numerical
  representation of the LUN is identical with and without PIM_EXTLUNS. Thus
  setting PIM_EXTLUNS keeps most behavior, and user-facing LUN IDs, unchanged.
  This follows the strategy used in Solaris. A macro (CAM_EXTLUN_BYTE_SWIZZLE)
  is provided to transform a lun_id_t into a uint64_t ordered for the wire.
  
  This is the second part of work for full 64-bit extended LUN support and is
  designed to a bridge for stable/10 to the final 64-bit LUN code. The
  third and final part will involve widening lun_id_t to 64 bits and will
  not be MFCed. This third part will break the KBI but will keep the KPI
  unchanged so that all drivers that will care about this can be updated now
  and not require code changes between HEAD and stable/10.
  
  Reviewed by:  scottl
  MFC after:2 weeks

Modified:
  head/sys/cam/cam.h
  head/sys/cam/scsi/scsi_xpt.c
  head/sys/powerpc/pseries/phyp_vscsi.c

Modified: head/sys/cam/cam.h
==
--- head/sys/cam/cam.h  Tue Oct 29 15:07:54 2013(r257344)
+++ head/sys/cam/cam.h  Tue Oct 29 15:36:58 2013(r257345)
@@ -50,6 +50,12 @@ typedef union {
 #defineCAM_TARGET_WILDCARD ((target_id_t)~0)
 #defineCAM_LUN_WILDCARD ((lun_id_t)~0)
 
+#define CAM_EXTLUN_BYTE_SWIZZLE(lun) ( \
+   u_int64_t)lun) & 0xL) >> 48) | \
+   u_int64_t)lun) & 0xL) >> 16) | \
+   u_int64_t)lun) & 0xL) << 16) | \
+   u_int64_t)lun) & 0xL) << 48))
+
 /*
  * Maximum length for a CAM CDB.  
  */

Modified: head/sys/cam/scsi/scsi_xpt.c
==
--- head/sys/cam/scsi/scsi_xpt.cTue Oct 29 15:07:54 2013
(r257344)
+++ head/sys/cam/scsi/scsi_xpt.cTue Oct 29 15:36:58 2013
(r257345)
@@ -100,6 +100,12 @@ SYSCTL_PROC(_kern_cam, OID_AUTO, cam_src
(lval) <<= 8;   \
(lval) |=  (lp)->luns[(i)].lundata[1];  \
}
+#defineCAM_GET_LUN(lp, i, lval)
\
+   (lval) = scsi_4btoul((lp)->luns[(i)].lundata);  \
+   (lval) = ((lval) >> 16) | ((lval) << 16);
+#define CAM_LUN_ONLY_32BITS(lp, i) \
+   (scsi_4btoul(&((lp)->luns[(i)].lundata[4])) == 0)
+
 /*
  * If we're not quirked to search <= the first 8 luns
  * and we are either quirked to search above lun 8,
@@ -175,7 +181,8 @@ do {
\
 typedef enum {
PROBE_INQUIRY_CKSUM = 0x01,
PROBE_SERIAL_CKSUM  = 0x02,
-   PROBE_NO_ANNOUNCE   = 0x04
+   PROBE_NO_ANNOUNCE   = 0x04,
+   PROBE_EXTLUN= 0x08
 } probe_flags;
 
 typedef struct {
@@ -561,10 +568,9 @@ static void proberequestdefaultnegotiat
 static int   proberequestbackoff(struct cam_periph *periph,
 struct cam_ed *device);
 static void probedone(struct cam_periph *periph, union ccb *done_ccb);
-static int  probe_strange_rpl_data(struct scsi_report_luns_data *rp,
-   uint32_t maxlun);
 static void probe_purge_old(struct cam_path *path,
-struct scsi_report_luns_data *new);
+struct scsi_report_luns_data *new,
+probe_flags flags);
 static void probecleanup(struct cam_periph *periph);
 static void scsi_find_quirk(struct cam_ed *device);
 static void scsi_scan_bus(struct cam_periph *periph, union ccb *ccb);
@@ -700,6 +706,11 @@ probeschedule(struct cam_periph *periph)
else
softc->flags &= ~PROBE_NO_ANNOUNCE;
 
+   if (cpi.hba_misc & PIM_EXTLUNS)
+   softc->flags |= PROBE_EXTLUN;
+   else
+   softc->flags &= ~PROBE_EXTLUN;
+
xpt_schedule(periph, CAM_PRIORITY_XPT);
 }
 
@@ -1278,13 +1289,6 @@ out:
 */
free(lp, M_CAMXPT);
lp = NULL;
-   } else if (probe_strange_rpl_data(lp, maxlun)) {
- 

Re: svn commit: r257344 - in head: etc etc/keys etc/mtree etc/pkg share share/keys share/keys/pkg/trusted share/man/man7

2013-10-29 Thread Bryan Drewery
On 10/29/2013 10:07 AM, Bryan Drewery wrote:
> Author: bdrewery (ports committer)
> Date: Tue Oct 29 15:07:54 2013
> New Revision: 257344
> URL: http://svnweb.freebsd.org/changeset/base/257344
> 
> Log:
>   Move /etc/keys to /usr/share/keys where users are less likely to modify 
> them.
>   
>   Requested by:   secteam (cperciva, des)
>   Approved by:bapt

I plan to MFC after 2 days.

> 
> Added:
>   head/share/keys/
>  - copied from r257343, head/etc/keys/
> Deleted:
>   head/etc/keys/
> Modified:
>   head/etc/Makefile
>   head/etc/mtree/BSD.root.dist
>   head/etc/mtree/BSD.usr.dist
>   head/etc/pkg/FreeBSD.conf
>   head/share/Makefile
>   head/share/keys/pkg/trusted/Makefile
>   head/share/man/man7/hier.7
> 
> Modified: head/etc/Makefile
> ==
> --- head/etc/Makefile Tue Oct 29 14:44:36 2013(r257343)
> +++ head/etc/Makefile Tue Oct 29 15:07:54 2013(r257344)
> @@ -224,7 +224,6 @@ distribution:
>   ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
>   ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
>   ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
> - ${_+_}cd ${.CURDIR}/keys; ${MAKE} install
>   ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
>  .if ${MK_PKGBOOTSTRAP} != "no"
>   ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
> 
> Modified: head/etc/mtree/BSD.root.dist
> ==
> --- head/etc/mtree/BSD.root.dist  Tue Oct 29 14:44:36 2013
> (r257343)
> +++ head/etc/mtree/BSD.root.dist  Tue Oct 29 15:07:54 2013
> (r257344)
> @@ -34,14 +34,6 @@
>  ..
>  gss
>  ..
> -keys
> -pkg
> -revoked
> -..
> -trusted
> -..
> -..
> -..
>  mail
>  ..
>  mtree
> 
> Modified: head/etc/mtree/BSD.usr.dist
> ==
> --- head/etc/mtree/BSD.usr.dist   Tue Oct 29 14:44:36 2013
> (r257343)
> +++ head/etc/mtree/BSD.usr.dist   Tue Oct 29 15:07:54 2013
> (r257344)
> @@ -478,6 +478,14 @@
>  ..
>  info
>  ..
> +keys
> +pkg
> +revoked
> +..
> +trusted
> +..
> +..
> +..
>  locale
>  UTF-8
>  ..
> 
> Modified: head/etc/pkg/FreeBSD.conf
> ==
> --- head/etc/pkg/FreeBSD.conf Tue Oct 29 14:44:36 2013(r257343)
> +++ head/etc/pkg/FreeBSD.conf Tue Oct 29 15:07:54 2013(r257344)
> @@ -3,6 +3,6 @@ FreeBSD: {
>url: "pkg+http://pkg.freebsd.org/${ABI}/latest";,
>mirror_type: "srv",
>signature_type: "none",
> -  fingerprints: "/etc/keys/pkg",
> +  fingerprints: "/usr/share/keys/pkg",
>enabled: "yes"
>  }
> 
> Modified: head/share/Makefile
> ==
> --- head/share/Makefile   Tue Oct 29 14:44:36 2013(r257343)
> +++ head/share/Makefile   Tue Oct 29 15:07:54 2013(r257344)
> @@ -11,6 +11,7 @@ SUBDIR= ${_colldef} \
>   dtrace \
>   ${_examples} \
>   ${_i18n} \
> + keys \
>   ${_man} \
>   ${_me} \
>   misc \
> 
> Modified: head/share/keys/pkg/trusted/Makefile
> ==
> --- head/etc/keys/pkg/trusted/MakefileTue Oct 29 14:44:36 2013
> (r257343)
> +++ head/share/keys/pkg/trusted/Makefile  Tue Oct 29 15:07:54 2013
> (r257344)
> @@ -4,7 +4,7 @@ NO_OBJ=
>  
>  FILES=   pkg.freebsd.org.2013102301
>  
> -FILESDIR=/etc/keys/pkg/trusted
> +FILESDIR=/usr/share/keys/pkg/trusted
>  FILESMODE=   644
>  
>  .include 
> 
> Modified: head/share/man/man7/hier.7
> ==
> --- head/share/man/man7/hier.7Tue Oct 29 14:44:36 2013
> (r257343)
> +++ head/share/man/man7/hier.7Tue Oct 29 15:07:54 2013
> (r257344)
> @@ -32,7 +32,7 @@
>  .\"  @(#)hier.7  8.1 (Berkeley) 6/5/93
>  .\" $FreeBSD$
>  .\"
> -.Dd October 23, 2013
> +.Dd October 29, 2013
>  .Dt HIER 7
>  .Os
>  .Sh NAME
> @@ -94,15 +94,6 @@ bluetooth configuration files
>  gnats configuration files;
>  see
>  .Xr send-pr 1
> -.It Pa keys/
> -known trusted and revoked keys.
> -.Pp
> -.Bl -tag -width ".Pa keys/pkg/" -compact
> -.It Pa keys/pkg/
> -fingerprints for
> -.Xr pkg 8
> -.El
> -.Pp
>  .It Pa localtime
>  local timezone information;
>  see
> @@ -556,6 +547,16 @@ ASCII text files used by various games
>  device description file for device name
>  .It Pa info/
>  GNU Info hypertext system
> +.It Pa keys/
> +known trusted and revoked keys.
> +.Bl -tag -width ".Pa keys/pkg/

svn commit: r257346 - head/sys/dev/etherswitch/rtl8366

2013-10-29 Thread Luiz Otavio O Souza
Author: loos
Date: Tue Oct 29 15:45:11 2013
New Revision: 257346
URL: http://svnweb.freebsd.org/changeset/base/257346

Log:
  Fix the build of TP-WN1043ND kernel.  Provide necessary includes and remove
  unnecessary includes for rtl8366rb.
  
  Approved by:  adrian (mentor)

Modified:
  head/sys/dev/etherswitch/rtl8366/rtl8366rb.c

Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rb.c
==
--- head/sys/dev/etherswitch/rtl8366/rtl8366rb.cTue Oct 29 15:36:58 
2013(r257345)
+++ head/sys/dev/etherswitch/rtl8366/rtl8366rb.cTue Oct 29 15:45:11 
2013(r257346)
@@ -30,16 +30,18 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
 #include 
-#include 
+#include 
 #include 
-#include 
 #include 
 #include 
 
___
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: r257347 - head/usr.sbin/bhyve

2013-10-29 Thread Neel Natu
Author: neel
Date: Tue Oct 29 17:31:16 2013
New Revision: 257347
URL: http://svnweb.freebsd.org/changeset/base/257347

Log:
  Update copyright to include the author of the LPC bridge emulation code.

Modified:
  head/usr.sbin/bhyve/pci_lpc.c

Modified: head/usr.sbin/bhyve/pci_lpc.c
==
--- head/usr.sbin/bhyve/pci_lpc.c   Tue Oct 29 15:45:11 2013
(r257346)
+++ head/usr.sbin/bhyve/pci_lpc.c   Tue Oct 29 17:31:16 2013
(r257347)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2013 Neel Natu 
+ * Copyright (c) 2013 Tycho Nightingale 

  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
___
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: r257348 - head/sbin/newfs

2013-10-29 Thread Xin LI
Author: delphij
Date: Tue Oct 29 17:34:15 2013
New Revision: 257348
URL: http://svnweb.freebsd.org/changeset/base/257348

Log:
  Don't call arc4random_stir() explicitly.  To quote arc4random(3)
  manual page:
  
  There is no need to call arc4random_stir() before using
  arc4random() functions family, since they automatically
  initialize themselves.
  
  No objection: des
  MFC after:2 weeks

Modified:
  head/sbin/newfs/mkfs.c

Modified: head/sbin/newfs/mkfs.c
==
--- head/sbin/newfs/mkfs.c  Tue Oct 29 17:31:16 2013(r257347)
+++ head/sbin/newfs/mkfs.c  Tue Oct 29 17:34:15 2013(r257348)
@@ -134,12 +134,10 @@ mkfs(struct partition *pp, char *fsys)
 */
disk.d_bsize = sectorsize;
disk.d_ufs = Oflag;
-   if (Rflag) {
+   if (Rflag)
utime = 10;
-   } else {
+   else
time(&utime);
-   arc4random_stir();
-   }
sblock.fs_old_flags = FS_FLAGS_UPDATED;
sblock.fs_flags = 0;
if (Uflag)
___
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: r257349 - in head: contrib/tcpdump sbin/ifconfig usr.bin/netstat usr.sbin/tcpdump/tcpdump

2013-10-29 Thread Gleb Smirnoff
Author: glebius
Date: Tue Oct 29 17:38:13 2013
New Revision: 257349
URL: http://svnweb.freebsd.org/changeset/base/257349

Log:
  Make userland tools honor WITHOUT_PF build option.
  
  Tested by:d...@gmx.com

Modified:
  head/contrib/tcpdump/print-ip.c
  head/sbin/ifconfig/Makefile
  head/usr.bin/netstat/Makefile
  head/usr.bin/netstat/if.c
  head/usr.bin/netstat/main.c
  head/usr.sbin/tcpdump/tcpdump/Makefile

Modified: head/contrib/tcpdump/print-ip.c
==
--- head/contrib/tcpdump/print-ip.c Tue Oct 29 17:34:15 2013
(r257348)
+++ head/contrib/tcpdump/print-ip.c Tue Oct 29 17:38:13 2013
(r257349)
@@ -483,9 +483,11 @@ again:
pgm_print(ipds->cp, ipds->len, (const u_char *)ipds->ip);
break;
 
+#if defined(HAVE_NET_PFVAR_H)
case IPPROTO_PFSYNC:
pfsync_ip_print(ipds->cp, ipds->len);
break;
+#endif
 
default:
if (ndo->ndo_nflag==0 && (proto = getprotobynumber(ipds->nh)) 
!= NULL)

Modified: head/sbin/ifconfig/Makefile
==
--- head/sbin/ifconfig/Makefile Tue Oct 29 17:34:15 2013(r257348)
+++ head/sbin/ifconfig/Makefile Tue Oct 29 17:38:13 2013(r257349)
@@ -40,7 +40,9 @@ LDADD+=   -lbsdxml -lsbuf
 
 SRCS+= carp.c  # SIOC[GS]VH support
 SRCS+= ifgroup.c   # ...
+.if ${MK_PF} != "no"
 SRCS+= ifpfsync.c  # pfsync(4) support
+.endif
 
 SRCS+= ifbridge.c  # bridge support
 SRCS+= iflagg.c# lagg support

Modified: head/usr.bin/netstat/Makefile
==
--- head/usr.bin/netstat/Makefile   Tue Oct 29 17:34:15 2013
(r257348)
+++ head/usr.bin/netstat/Makefile   Tue Oct 29 17:38:13 2013
(r257349)
@@ -26,6 +26,10 @@ CFLAGS+=-DINET6
 CFLAGS+=-DSDP
 .endif
 
+.if ${MK_PF} != "no"
+CFLAGS+=-DPF
+.endif
+
 BINGRP=kmem
 BINMODE=2555
 DPADD= ${LIBKVM} ${LIBMEMSTAT} ${LIBUTIL}

Modified: head/usr.bin/netstat/if.c
==
--- head/usr.bin/netstat/if.c   Tue Oct 29 17:34:15 2013(r257348)
+++ head/usr.bin/netstat/if.c   Tue Oct 29 17:38:13 2013(r257349)
@@ -48,13 +48,15 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#ifdef PF
+#include 
+#include 
+#endif
 
 #include 
 #include 
@@ -80,6 +82,7 @@ static void sidewaysintpr(int);
 static char addr_buf[NI_MAXHOST];  /* for getnameinfo() */
 #endif
 
+#ifdef PF
 static const char* pfsyncacts[] = {
/* PFSYNC_ACT_CLR */"clear all request",
/* PFSYNC_ACT_INS */"state insert",
@@ -154,6 +157,7 @@ pfsync_stats(u_long off, const char *nam
p(pfsyncs_oerrors, "\t\t%ju send error%s\n");
 #undef p
 }
+#endif /* PF */
 
 /*
  * Display a formatted value, or a '-' in the same space.

Modified: head/usr.bin/netstat/main.c
==
--- head/usr.bin/netstat/main.c Tue Oct 29 17:34:15 2013(r257348)
+++ head/usr.bin/netstat/main.c Tue Oct 29 17:38:13 2013(r257349)
@@ -214,8 +214,10 @@ struct protox {
  pim_stats,NULL,   "pim",  1,  IPPROTO_PIM },
{ -1,   N_CARPSTAT, 1,  NULL,
  carp_stats,   NULL,   "carp", 1,  0 },
+#ifdef PF
{ -1,   N_PFSYNCSTAT,   1,  NULL,
  pfsync_stats, NULL,   "pfsync", 1,0 },
+#endif
{ -1,   N_ARPSTAT,  1,  NULL,
  arp_stats,NULL,   "arp", 1,   0 },
{ -1,   -1, 0,  NULL,

Modified: head/usr.sbin/tcpdump/tcpdump/Makefile
==
--- head/usr.sbin/tcpdump/tcpdump/Makefile  Tue Oct 29 17:34:15 2013
(r257348)
+++ head/usr.sbin/tcpdump/tcpdump/Makefile  Tue Oct 29 17:38:13 2013
(r257349)
@@ -89,7 +89,6 @@ SRCS= addrtoname.c \
print-olsr.c \
print-ospf.c \
print-otv.c \
-   print-pfsync.c \
print-pgm.c \
print-pim.c \
print-ppi.c \
@@ -171,7 +170,8 @@ CFLAGS+= -DHAVE_LIBCRYPTO -DHAVE_OPENSSL
 .endif
 
 .if ${MK_PF} != "no"
-SRCS+= print-pflog.c
+SRCS+= print-pflog.c \
+   print-pfsync.c
 CFLAGS+= -DHAVE_NET_PFVAR_H
 .endif
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257350 - head

2013-10-29 Thread Xin LI
Author: delphij
Date: Tue Oct 29 17:46:26 2013
New Revision: 257350
URL: http://svnweb.freebsd.org/changeset/base/257350

Log:
  In r257079, SRCDIR is pointed to ${.CURDIR} when not set.  However,
  Makefile.inc1 is being called in sub-make's where make(1) would,
  by default, implicitly chdir(2) to ${.OBJDIR} before executing any
  targets.  This would make some targets, like delete-old, when trying
  to derive various variables introduced by change r256921 using
  ``make -f Makefile.inc1'' that also rely on SRCDIR to fail.
  
  This changeset adds an explicit cd ${.CURDIR} before these unwrapped
  make calls, making them in line with the other ones that are already
  being wrapped with the explicit chdir's.
  
  Tested by:gjb
  MFC after:5 days

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Oct 29 17:38:13 2013(r257349)
+++ head/Makefile.inc1  Tue Oct 29 17:46:26 2013(r257350)
@@ -1686,6 +1686,7 @@ delete-old-files:
 # argument list will get too long. Using .for/.endfor make "loops" will make
 # the Makefile parser segfault.
@exec 3<&0; \
+   cd ${.CURDIR}; \
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
while read file; do \
@@ -1708,7 +1709,8 @@ delete-old-files:
 
 check-old-files:
@echo ">>> Checking for old files"
-   @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
+   @cd ${.CURDIR}; \
+   ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
while read file; do \
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; 
then \
@@ -1729,6 +1731,7 @@ delete-old-libs:
@echo ">>> Removing old libraries"
@echo "${OLD_LIBS_MESSAGE}" | fmt
@exec 3<&0; \
+   cd ${.CURDIR}; \
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
-V OLD_LIBS | xargs -n1 | \
while read file; do \
@@ -1748,7 +1751,8 @@ delete-old-libs:
 
 check-old-libs:
@echo ">>> Checking for old libraries"
-   @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
+   @cd ${.CURDIR}; \
+   ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
-V OLD_LIBS | xargs -n1 | \
while read file; do \
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; 
then \
@@ -1763,7 +1767,8 @@ check-old-libs:
 
 delete-old-dirs:
@echo ">>> Removing old directories"
-   @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
+   @cd ${.CURDIR}; \
+   ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
-V OLD_DIRS | xargs -n1 | sort -r | \
while read dir; do \
if [ -d "${DESTDIR}/$${dir}" ]; then \
@@ -1776,7 +1781,8 @@ delete-old-dirs:
 
 check-old-dirs:
@echo ">>> Checking for old directories"
-   @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
+   @cd ${.CURDIR}; \
+   ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
-V OLD_DIRS | xargs -n1 | \
while read dir; do \
if [ -d "${DESTDIR}/$${dir}" ]; then \
___
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: r257351 - head/sys/net

2013-10-29 Thread Andre Oppermann
Author: andre
Date: Tue Oct 29 17:48:08 2013
New Revision: 257351
URL: http://svnweb.freebsd.org/changeset/base/257351

Log:
  Move all interface queue related structures, macros and definitions
  from net/if_var to it own new net/ifq.h.
  
  For now net/ifq.h is unconditionally included through net/if_var.h.
  
  This is a mechanical change in preparation to make struct ifnet and
  the individual interface queue mechanisms opaque.
  
  Discussed with:   glebius
  Sponsored by: The FreeBSD Foundation

Added:
  head/sys/net/ifq.h
 - copied, changed from r257282, head/sys/net/if_var.h
Modified:
  head/sys/net/if_var.h

Modified: head/sys/net/if_var.h
==
--- head/sys/net/if_var.h   Tue Oct 29 17:46:26 2013(r257350)
+++ head/sys/net/if_var.h   Tue Oct 29 17:48:08 2013(r257351)
@@ -94,18 +94,6 @@ VNET_DECLARE(struct pfil_head, link_pfil
 #endif /* _KERNEL */
 
 /*
- * Structure defining a queue for a network interface.
- */
-struct ifqueue {
-   struct  mbuf *ifq_head;
-   struct  mbuf *ifq_tail;
-   int ifq_len;
-   int ifq_maxlen;
-   int ifq_drops;
-   struct  mtx ifq_mtx;
-};
-
-/*
  * Structure defining a network interface.
  *
  * (Would like to call this struct ``if'', but C isn't PL/1.)
@@ -208,6 +196,8 @@ struct ifnet {
void*if_pspare[8];  /* 1 netmap, 7 TDB */
 };
 
+#include/* XXXAO: temporary unconditional include */
+
 /*
  * XXX These aliases are terribly dangerous because they could apply
  * to anything.
@@ -262,96 +252,6 @@ void   if_addr_runlock(struct ifnet *ifp);
 void   if_maddr_rlock(struct ifnet *ifp);  /* if_multiaddrs */
 void   if_maddr_runlock(struct ifnet *ifp);/* if_multiaddrs */
 
-/*
- * Output queues (ifp->if_snd) and slow device input queues (*ifp->if_slowq)
- * are queues of messages stored on ifqueue structures
- * (defined above).  Entries are added to and deleted from these structures
- * by these macros.
- */
-#define IF_LOCK(ifq)   mtx_lock(&(ifq)->ifq_mtx)
-#define IF_UNLOCK(ifq) mtx_unlock(&(ifq)->ifq_mtx)
-#defineIF_LOCK_ASSERT(ifq) mtx_assert(&(ifq)->ifq_mtx, MA_OWNED)
-#define_IF_QFULL(ifq)  ((ifq)->ifq_len >= (ifq)->ifq_maxlen)
-#define_IF_DROP(ifq)   ((ifq)->ifq_drops++)
-#define_IF_QLEN(ifq)   ((ifq)->ifq_len)
-
-#define_IF_ENQUEUE(ifq, m) do {\
-   (m)->m_nextpkt = NULL;  \
-   if ((ifq)->ifq_tail == NULL)\
-   (ifq)->ifq_head = m;\
-   else\
-   (ifq)->ifq_tail->m_nextpkt = m; \
-   (ifq)->ifq_tail = m;\
-   (ifq)->ifq_len++;   \
-} while (0)
-
-#define IF_ENQUEUE(ifq, m) do {\
-   IF_LOCK(ifq);   \
-   _IF_ENQUEUE(ifq, m);\
-   IF_UNLOCK(ifq); \
-} while (0)
-
-#define_IF_PREPEND(ifq, m) do {\
-   (m)->m_nextpkt = (ifq)->ifq_head;   \
-   if ((ifq)->ifq_tail == NULL)\
-   (ifq)->ifq_tail = (m);  \
-   (ifq)->ifq_head = (m);  \
-   (ifq)->ifq_len++;   \
-} while (0)
-
-#define IF_PREPEND(ifq, m) do {\
-   IF_LOCK(ifq);   \
-   _IF_PREPEND(ifq, m);\
-   IF_UNLOCK(ifq); \
-} while (0)
-
-#define_IF_DEQUEUE(ifq, m) do {\
-   (m) = (ifq)->ifq_head;  \
-   if (m) {\
-   if (((ifq)->ifq_head = (m)->m_nextpkt) == NULL) \
-   (ifq)->ifq_tail = NULL; \
-   (m)->m_nextpkt = NULL;  \
-   (ifq)->ifq_len--;   \
-   }   \
-} while (0)
-
-#define IF_DEQUEUE(ifq, m) do {\
-   IF_LOCK(ifq);   \
-   _IF_DEQUEUE(ifq, m);\
-   IF_UNLOCK(ifq); \
-} while (0)
-
-#define_IF_DEQUEUE_ALL(ifq, m) do {\
-   (m) = (ifq)->ifq_head;  \
-   (ifq)->ifq_head = (ifq)->ifq_

Re: svn commit: r257298 - head/lib/libproc

2013-10-29 Thread Bruce Evans

On Tue, 29 Oct 2013, Mark Johnston wrote:


On Wed, Oct 30, 2013 at 12:21:28AM +1100, Bruce Evans wrote:

On Tue, 29 Oct 2013, Mark Johnston wrote:


Log:
 Revert r257248 and fix the problem in a way that doesn't violate style(9).


Why did gcc complain about the original version?


It looks like this is because of the use of -W, which is apparently an
alias for -Wextra; according to the gcc man page, this will trigger a
warning when "an empty body occurs in an if or else statement."


Thanks.  I have -W in some CFLAGS but never noticed this behaviour before.

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: r257359 - head/sys/netinet

2013-10-29 Thread Michael Tuexen
Author: tuexen
Date: Tue Oct 29 20:04:50 2013
New Revision: 257359
URL: http://svnweb.freebsd.org/changeset/base/257359

Log:
  Terminate a debug output with a \n.

Modified:
  head/sys/netinet/sctp_timer.c

Modified: head/sys/netinet/sctp_timer.c
==
--- head/sys/netinet/sctp_timer.c   Tue Oct 29 19:50:40 2013
(r257358)
+++ head/sys/netinet/sctp_timer.c   Tue Oct 29 20:04:50 2013
(r257359)
@@ -552,7 +552,7 @@ start_again:
TAILQ_FOREACH_SAFE(chk, &stcb->asoc.sent_queue, sctp_next, nchk) {
if (SCTP_TSN_GE(stcb->asoc.last_acked_seq, 
chk->rec.data.TSN_seq)) {
/* Strange case our list got out of order? */
-   SCTP_PRINTF("Our list is out of order? last_acked:%x 
chk:%x",
+   SCTP_PRINTF("Our list is out of order? last_acked:%x 
chk:%x\n",
(unsigned int)stcb->asoc.last_acked_seq, (unsigned 
int)chk->rec.data.TSN_seq);
recovery_cnt++;
 #ifdef INVARIANTS
___
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: r257362 - head/contrib/gcclibs/libssp

2013-10-29 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 29 20:36:04 2013
New Revision: 257362
URL: http://svnweb.freebsd.org/changeset/base/257362

Log:
  Quiesce warning by including appropriate header file

Modified:
  head/contrib/gcclibs/libssp/ssp.c

Modified: head/contrib/gcclibs/libssp/ssp.c
==
--- head/contrib/gcclibs/libssp/ssp.c   Tue Oct 29 20:35:35 2013
(r257361)
+++ head/contrib/gcclibs/libssp/ssp.c   Tue Oct 29 20:36:04 2013
(r257362)
@@ -56,6 +56,8 @@ Software Foundation, 51 Franklin Street,
 # include 
 #endif
 
+#include 
+
 void *__stack_chk_guard = 0;
 
 static void __attribute__ ((constructor))
___
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: r257363 - head/usr.bin/xinstall

2013-10-29 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 29 20:38:00 2013
New Revision: 257363
URL: http://svnweb.freebsd.org/changeset/base/257363

Log:
  Queisce sign errors by using unsigned char * and casting MAP_FAILED as 
unsigned
  char *
  
  Reviewed by:  brooks@

Modified:
  head/usr.bin/xinstall/xinstall.c

Modified: head/usr.bin/xinstall/xinstall.c
==
--- head/usr.bin/xinstall/xinstall.cTue Oct 29 20:36:04 2013
(r257362)
+++ head/usr.bin/xinstall/xinstall.cTue Oct 29 20:38:00 2013
(r257363)
@@ -1002,7 +1002,7 @@ compare(int from_fd, const char *from_na
int to_fd, const char *to_name __unused, size_t to_len,
char **dresp)
 {
-   char *p, *q;
+   unsigned char *p, *q;
int rv;
int done_compare;
DIGEST_CTX ctx;
@@ -1018,11 +1018,11 @@ compare(int from_fd, const char *from_na
if (trymmap(from_fd) && trymmap(to_fd)) {
p = mmap(NULL, from_len, PROT_READ, MAP_SHARED,
from_fd, (off_t)0);
-   if (p == (char *)MAP_FAILED)
+   if (p == (unsigned char *)MAP_FAILED)
goto out;
q = mmap(NULL, from_len, PROT_READ, MAP_SHARED,
to_fd, (off_t)0);
-   if (q == (char *)MAP_FAILED) {
+   if (q == (unsigned char *)MAP_FAILED) {
munmap(p, from_len);
goto out;
}
@@ -1036,7 +1036,7 @@ compare(int from_fd, const char *from_na
}
out:
if (!done_compare) {
-   char buf1[MAXBSIZE];
+   unsigned char buf1[MAXBSIZE];
char buf2[MAXBSIZE];
int n1, n2;
 
@@ -1146,7 +1146,8 @@ copy(int from_fd, const char *from_name,
 {
int nr, nw;
int serrno;
-   char *p, buf[MAXBSIZE];
+   unsigned char *p;
+   unsigned char buf[MAXBSIZE];
int done_copy;
DIGEST_CTX ctx;
 
@@ -1166,7 +1167,7 @@ copy(int from_fd, const char *from_name,
done_copy = 0;
if (size <= 8 * 1048576 && trymmap(from_fd) &&
(p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED,
-   from_fd, (off_t)0)) != (char *)MAP_FAILED) {
+   from_fd, (off_t)0)) != (unsigned char *)MAP_FAILED) {
nw = write(to_fd, p, size);
if (nw != size) {
serrno = errno;
___
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: r257365 - in head/sys/mips: mips nlm rmi

2013-10-29 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Oct 29 20:38:58 2013
New Revision: 257365
URL: http://svnweb.freebsd.org/changeset/base/257365

Log:
  Panics about how things can't be attached should probably happen in the
  attach method rather than probe.
  
  Submitted by: brooks

Modified:
  head/sys/mips/mips/tick.c
  head/sys/mips/nlm/tick.c
  head/sys/mips/rmi/tick.c

Modified: head/sys/mips/mips/tick.c
==
--- head/sys/mips/mips/tick.c   Tue Oct 29 20:38:19 2013(r257364)
+++ head/sys/mips/mips/tick.c   Tue Oct 29 20:38:58 2013(r257365)
@@ -309,9 +309,6 @@ static int
 clock_probe(device_t dev)
 {
 
-   if (device_get_unit(dev) != 0)
-   panic("can't attach more clocks");
-
device_set_desc(dev, "Generic MIPS32 ticker");
return (BUS_PROBE_NOWILDCARD);
 }
@@ -329,6 +326,9 @@ clock_attach(device_t dev)
struct clock_softc *sc;
int error;
 
+   if (device_get_unit(dev) != 0)
+   panic("can't attach more clocks");
+
softc = sc = device_get_softc(dev);
sc->intr_rid = 0;
sc->intr_res = bus_alloc_resource(dev,

Modified: head/sys/mips/nlm/tick.c
==
--- head/sys/mips/nlm/tick.cTue Oct 29 20:38:19 2013(r257364)
+++ head/sys/mips/nlm/tick.cTue Oct 29 20:38:58 2013(r257365)
@@ -314,9 +314,6 @@ static int
 clock_probe(device_t dev)
 {
 
-   if (device_get_unit(dev) != 0)
-   panic("can't attach more clocks");
-
device_set_desc(dev, "Generic MIPS32 ticker");
return (BUS_PROBE_NOWILDCARD);
 }
@@ -333,6 +330,9 @@ clock_attach(device_t dev)
 {
struct clock_softc *sc;
 
+   if (device_get_unit(dev) != 0)
+   panic("can't attach more clocks");
+
softc = sc = device_get_softc(dev);
cpu_establish_hardintr("compare", clock_intr, NULL,
sc, IRQ_TIMER, INTR_TYPE_CLK, &sc->intr_handler);

Modified: head/sys/mips/rmi/tick.c
==
--- head/sys/mips/rmi/tick.cTue Oct 29 20:38:19 2013(r257364)
+++ head/sys/mips/rmi/tick.cTue Oct 29 20:38:58 2013(r257365)
@@ -311,9 +311,6 @@ static int
 clock_probe(device_t dev)
 {
 
-   if (device_get_unit(dev) != 0)
-   panic("can't attach more clocks");
-
device_set_desc(dev, "Generic MIPS32 ticker");
return (BUS_PROBE_NOWILDCARD);
 }
@@ -330,6 +327,9 @@ clock_attach(device_t dev)
 {
struct clock_softc *sc;
 
+   if (device_get_unit(dev) != 0)
+   panic("can't attach more clocks");
+
softc = sc = device_get_softc(dev);
cpu_establish_hardintr("compare", clock_intr, NULL,
sc, IRQ_TIMER, INTR_TYPE_CLK, &sc->intr_handler);
___
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: r257364 - head/etc/defaults

2013-10-29 Thread Jeremie Le Hen
Author: jlh
Date: Tue Oct 29 20:38:19 2013
New Revision: 257364
URL: http://svnweb.freebsd.org/changeset/base/257364

Log:
  Fix indentation.
  
  MFC after: 4 days

Modified:
  head/etc/defaults/periodic.conf

Modified: head/etc/defaults/periodic.conf
==
--- head/etc/defaults/periodic.conf Tue Oct 29 20:38:00 2013
(r257363)
+++ head/etc/defaults/periodic.conf Tue Oct 29 20:38:19 2013
(r257364)
@@ -331,7 +331,7 @@ if [ -z "${source_periodic_confs_defined
$periodvar=daily
;;
*)
-eval $var=\"$value\"
+   eval $var=\"$value\"
;;
esac
}
___
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: r257361 - head/etc/defaults

2013-10-29 Thread Jeremie Le Hen
Author: jlh
Date: Tue Oct 29 20:35:35 2013
New Revision: 257361
URL: http://svnweb.freebsd.org/changeset/base/257361

Log:
  Fix compatibility function for old daily_status_security_${name}_enable
  variable
  
  PR:   conf/183137
  Reported by:Adam McDougall 
  MFC after:3 days

Modified:
  head/etc/defaults/periodic.conf

Modified: head/etc/defaults/periodic.conf
==
--- head/etc/defaults/periodic.conf Tue Oct 29 20:35:28 2013
(r257360)
+++ head/etc/defaults/periodic.conf Tue Oct 29 20:35:35 2013
(r257361)
@@ -319,7 +319,7 @@ if [ -z "${source_periodic_confs_defined
security_daily_compat_var() {
local var=$1 dailyvar value
 
-   dailyvar=daily_status_security${#status_security}
+   dailyvar=daily_status_security${var#security_status}
periodvar=${var%enable}period
eval value=\"\$$dailyvar\"
[ -z "$value" ] && return
@@ -331,7 +331,7 @@ if [ -z "${source_periodic_confs_defined
$periodvar=daily
;;
*)
-   $var="$value"
+eval $var=\"$value\"
;;
esac
}
___
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: r257360 - in head/contrib/binutils/gas: . config

2013-10-29 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 29 20:35:28 2013
New Revision: 257360
URL: http://svnweb.freebsd.org/changeset/base/257360

Log:
  Queisce warning about empty bodies in these loops by bumping the ;; to the
  next line.

Modified:
  head/contrib/binutils/gas/config/atof-ieee.c
  head/contrib/binutils/gas/symbols.c

Modified: head/contrib/binutils/gas/config/atof-ieee.c
==
--- head/contrib/binutils/gas/config/atof-ieee.cTue Oct 29 20:04:50 
2013(r257359)
+++ head/contrib/binutils/gas/config/atof-ieee.cTue Oct 29 20:35:28 
2013(r257360)
@@ -420,7 +420,8 @@ gen_to_words (LITTLENUM_TYPE *words, int
 - generic_floating_point_number.low);
 
   /* Seek (and forget) 1st significant bit.  */
-  for (exponent_skippage = 0; !next_bits (1); ++exponent_skippage);;
+  for (exponent_skippage = 0; !next_bits (1); ++exponent_skippage)
+   ;;
   exponent_1 = (generic_floating_point_number.exponent
+ generic_floating_point_number.leader
+ 1

Modified: head/contrib/binutils/gas/symbols.c
==
--- head/contrib/binutils/gas/symbols.c Tue Oct 29 20:04:50 2013
(r257359)
+++ head/contrib/binutils/gas/symbols.c Tue Oct 29 20:35:28 2013
(r257360)
@@ -1666,7 +1666,8 @@ dollar_label_name (register long n,   /* w
   *q = i % 10 + '0';
   i /= 10;
 }
-  while ((*p++ = *--q) != '\0');;
+  while ((*p++ = *--q) != '\0')
+   ;;
 
   /* The label, as a '\0' ended string, starts at symbol_name_build.  */
   return symbol_name_build;
@@ -1837,7 +1838,8 @@ fb_label_name (long n,/* We just saw "n
   *q = i % 10 + '0';
   i /= 10;
 }
-  while ((*p++ = *--q) != '\0');;
+  while ((*p++ = *--q) != '\0')
+   ;;
 
   /* The label, as a '\0' ended string, starts at symbol_name_build.  */
   return (symbol_name_build);
___
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: r257366 - head/contrib/libreadline

2013-10-29 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 29 20:53:09 2013
New Revision: 257366
URL: http://svnweb.freebsd.org/changeset/base/257366

Log:
  Quiesce warnings regarding assignement of loop conditionals by implementing
  the solution from the compiler to wrap the statement in parens.

Modified:
  head/contrib/libreadline/bind.c
  head/contrib/libreadline/complete.c
  head/contrib/libreadline/histexpand.c
  head/contrib/libreadline/history.c
  head/contrib/libreadline/input.c
  head/contrib/libreadline/tilde.c

Modified: head/contrib/libreadline/bind.c
==
--- head/contrib/libreadline/bind.c Tue Oct 29 20:38:58 2013
(r257365)
+++ head/contrib/libreadline/bind.c Tue Oct 29 20:53:09 2013
(r257366)
@@ -442,7 +442,7 @@ rl_translate_keyseq (seq, array, len)
 {
   register int i, c, l, temp;
 
-  for (i = l = 0; c = seq[i]; i++)
+  for (i = l = 0; (c = seq[i]); i++)
 {
   if (c == '\\')
{
@@ -1185,7 +1185,7 @@ rl_parse_and_bind (string)
 {
   int passc = 0;
 
-  for (i = 1; c = string[i]; i++)
+  for (i = 1; (c = string[i]); i++)
{
  if (passc)
{
@@ -1276,7 +1276,7 @@ rl_parse_and_bind (string)
   int delimiter, passc;
 
   delimiter = string[i++];
-  for (passc = 0; c = string[i]; i++)
+  for (passc = 0; (c = string[i]); i++)
{
  if (passc)
{
@@ -2048,7 +2048,7 @@ rl_function_dumper (print_readably)
 
   fprintf (rl_outstream, "\n");
 
-  for (i = 0; name = names[i]; i++)
+  for (i = 0; (name = names[i]); i++)
 {
   rl_command_func_t *function;
   char **invokers;

Modified: head/contrib/libreadline/complete.c
==
--- head/contrib/libreadline/complete.c Tue Oct 29 20:38:58 2013
(r257365)
+++ head/contrib/libreadline/complete.c Tue Oct 29 20:53:09 2013
(r257366)
@@ -884,7 +884,7 @@ _rl_find_completion_word (fp, dp)
   /* We didn't find an unclosed quoted substring upon which to do
  completion, so use the word break characters to find the
  substring on which to complete. */
-  while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))
+  while ((rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)))
{
  scan = rl_line_buffer[rl_point];
 
@@ -1803,7 +1803,7 @@ rl_completion_matches (text, entry_funct
   match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
   match_list[1] = (char *)NULL;
 
-  while (string = (*entry_function) (text, matches))
+  while ((string = (*entry_function) (text, matches)))
 {
   if (matches + 1 == match_list_size)
match_list = (char **)xrealloc
@@ -1854,7 +1854,7 @@ rl_username_completion_function (text, s
 }
 
 #if defined (HAVE_GETPWENT)
-  while (entry = getpwent ())
+  while ((entry = getpwent ()))
 {
   /* Null usernames should result in all users as possible completions. */
   if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))

Modified: head/contrib/libreadline/histexpand.c
==
--- head/contrib/libreadline/histexpand.c   Tue Oct 29 20:38:58 2013
(r257365)
+++ head/contrib/libreadline/histexpand.c   Tue Oct 29 20:53:09 2013
(r257366)
@@ -203,7 +203,7 @@ get_history_event (string, caller_index,
 }
 
   /* Only a closing `?' or a newline delimit a substring search string. */
-  for (local_index = i; c = string[i]; i++)
+  for (local_index = i; (c = string[i]); i++)
 {
 #if defined (HANDLE_MULTIBYTE)
   if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)

Modified: head/contrib/libreadline/history.c
==
--- head/contrib/libreadline/history.c  Tue Oct 29 20:38:58 2013
(r257365)
+++ head/contrib/libreadline/history.c  Tue Oct 29 20:53:09 2013
(r257366)
@@ -306,7 +306,7 @@ add_history (string)
}
 }
 
-  temp = alloc_history_entry (string, hist_inittime ());
+  temp = alloc_history_entry ((char *)string, hist_inittime ());
 
   the_history[history_length] = (HIST_ENTRY *)NULL;
   the_history[history_length - 1] = temp;

Modified: head/contrib/libreadline/input.c
==
--- head/contrib/libreadline/input.cTue Oct 29 20:38:58 2013
(r257365)
+++ head/contrib/libreadline/input.cTue Oct 29 20:53:09 2013
(r257366)
@@ -428,7 +428,7 @@ rl_read_key ()
   else
 {
   /* If input is coming from a macro, then use that. */
-  if (c = _rl_next_macro_key ())
+  if ((c = _rl_next_macro_key ()))
return (c);
 
   /* If the user has an event function, then call it periodically. */

Modified: head/contrib/libreadline/tilde.c
=

Re: svn commit: r257350 - head

2013-10-29 Thread Matthew Fleming
On Tue, Oct 29, 2013 at 10:46 AM, Xin LI  wrote:

> Author: delphij
> Date: Tue Oct 29 17:46:26 2013
> New Revision: 257350
> URL: http://svnweb.freebsd.org/changeset/base/257350
>
> Log:
>   In r257079, SRCDIR is pointed to ${.CURDIR} when not set.  However,
>   Makefile.inc1 is being called in sub-make's where make(1) would,
>   by default, implicitly chdir(2) to ${.OBJDIR} before executing any
>   targets.  This would make some targets, like delete-old, when trying
>   to derive various variables introduced by change r256921 using
>   ``make -f Makefile.inc1'' that also rely on SRCDIR to fail.
>
>   This changeset adds an explicit cd ${.CURDIR} before these unwrapped
>   make calls, making them in line with the other ones that are already
>   being wrapped with the explicit chdir's.
>
>   Tested by:gjb
>   MFC after:5 days
>
> Modified:
>   head/Makefile.inc1
>
> Modified: head/Makefile.inc1
>
> ==
> --- head/Makefile.inc1  Tue Oct 29 17:38:13 2013(r257349)
> +++ head/Makefile.inc1  Tue Oct 29 17:46:26 2013(r257350)
> @@ -1686,6 +1686,7 @@ delete-old-files:
>  # argument list will get too long. Using .for/.endfor make "loops" will
> make
>  # the Makefile parser segfault.
> @exec 3<&0; \
> +   cd ${.CURDIR}; \
> ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
> -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
>

Here and below, wouldn't passing -C {.CURDIR} to make be safer?  I admit I
don't know make that well, so I may be wrong here.

Thanks,
matthew
___
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: r257368 - head/sys/powerpc/pseries

2013-10-29 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Oct 29 21:08:20 2013
New Revision: 257368
URL: http://svnweb.freebsd.org/changeset/base/257368

Log:
  The ofw_bus() routines invoke the device's parent, not the device itself,
  so cease iterating when the parent is NULL, not when the device is.
  
  MFC after:5 days

Modified:
  head/sys/powerpc/pseries/plpar_iommu.c

Modified: head/sys/powerpc/pseries/plpar_iommu.c
==
--- head/sys/powerpc/pseries/plpar_iommu.c  Tue Oct 29 21:00:54 2013
(r257367)
+++ head/sys/powerpc/pseries/plpar_iommu.c  Tue Oct 29 21:08:20 2013
(r257368)
@@ -69,14 +69,14 @@ struct dma_window {
 };
 
 int
-phyp_iommu_set_dma_tag(device_t dev, device_t child, bus_dma_tag_t tag)
+phyp_iommu_set_dma_tag(device_t bus, device_t dev, bus_dma_tag_t tag)
 {
device_t p;
phandle_t node;
cell_t dma_acells, dma_scells, dmawindow[5];
struct iommu_map *i;
 
-   for (p = child; p != NULL; p = device_get_parent(p)) {
+   for (p = dev; device_get_parent(p) != NULL; p = device_get_parent(p)) {
if (ofw_bus_has_prop(p, "ibm,my-dma-window"))
break;
if (ofw_bus_has_prop(p, "ibm,dma-window"))
@@ -145,7 +145,7 @@ phyp_iommu_set_dma_tag(device_t dev, dev
papr_supports_stuff_tce = !(phyp_hcall(H_STUFF_TCE,
window->map->iobn, 0, 0, 0) == H_FUNCTION);
 
-   bus_dma_tag_set_iommu(tag, dev, window);
+   bus_dma_tag_set_iommu(tag, bus, window);
 
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: r257369 - head/sys/dev/hyperv/netvsc

2013-10-29 Thread Xin LI
Author: delphij
Date: Tue Oct 29 22:42:30 2013
New Revision: 257369
URL: http://svnweb.freebsd.org/changeset/base/257369

Log:
  Don't reference pointer before testing whether it is
  NULL.
  
  Submitted by: Clement Lecigne 
  Reviewed by:  grehan
  MFC after:3 days

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Tue Oct 29 21:08:20 
2013(r257368)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Tue Oct 29 22:42:30 
2013(r257369)
@@ -621,13 +621,15 @@ netvsc_recv(struct hv_device *device_ctx
 {
hn_softc_t *sc = (hn_softc_t *)device_get_softc(device_ctx->device);
struct mbuf *m_new;
-   struct ifnet *ifp = sc->hn_ifp;
+   struct ifnet *ifp;
int size;
int i;
 
if (sc == NULL) {
return (0); /* TODO: KYS how can this be! */
}
+
+   ifp = sc->hn_ifp;

ifp = sc->arpcom.ac_ifp;
 
___
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: r257370 - head/sys/arm/at91

2013-10-29 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Oct 29 23:55:17 2013
New Revision: 257370
URL: http://svnweb.freebsd.org/changeset/base/257370

Log:
  Fix typo. Sorry!

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

Modified: head/sys/arm/at91/at91.c
==
--- head/sys/arm/at91/at91.cTue Oct 29 22:42:30 2013(r257369)
+++ head/sys/arm/at91/at91.cTue Oct 29 23:55:17 2013(r257370)
@@ -231,7 +231,7 @@ at91_probe(device_t dev)
 {
 
device_set_desc(dev, "AT91 device bus");
-   return (BUS_PROBE_NO_WILDCARD);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static void
___
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: r257363 - head/usr.bin/xinstall

2013-10-29 Thread Bruce Evans

On Tue, 29 Oct 2013, Sean Bruno wrote:


Log:
 Queisce sign errors by using unsigned char * and casting MAP_FAILED as unsigned
 char *


This increases the type errors.


Modified: head/usr.bin/xinstall/xinstall.c
==
--- head/usr.bin/xinstall/xinstall.cTue Oct 29 20:36:04 2013
(r257362)
+++ head/usr.bin/xinstall/xinstall.cTue Oct 29 20:38:00 2013
(r257363)
@@ -1002,7 +1002,7 @@ compare(int from_fd, const char *from_na
int to_fd, const char *to_name __unused, size_t to_len,
char **dresp)
{
-   char *p, *q;
+   unsigned char *p, *q;
int rv;
int done_compare;
DIGEST_CTX ctx;


Using plain char is fragile and often broken for the things that it
is used for in C.  I happen to have been recently writing too much
about this in the comp.std.c newsgroup.  Using plain char is less
fragile in POSIX than in C, since POSIX-2001 requires signed char to
be int8_t so it cannot be 1's complement or signed magnitude, or have
padding bits.

No change should be made here.  Full changes to unsigned char would
require poisoning almost all char declarations by adding 'unsigned',
starting with strcpy().  Fixing strcpy()'s API was too hard for the C
standard in 1990 when C was less than half as old as now.  strcpy()
is only required to use unsigned char's internally.  This wasn't
explicit until C99.


@@ -1018,11 +1018,11 @@ compare(int from_fd, const char *from_na
if (trymmap(from_fd) && trymmap(to_fd)) {
p = mmap(NULL, from_len, PROT_READ, MAP_SHARED,
from_fd, (off_t)0);
-   if (p == (char *)MAP_FAILED)
+   if (p == (unsigned char *)MAP_FAILED)
goto out;
q = mmap(NULL, from_len, PROT_READ, MAP_SHARED,
to_fd, (off_t)0);
-   if (q == (char *)MAP_FAILED) {
+   if (q == (unsigned char *)MAP_FAILED) {
munmap(p, from_len);
goto out;
}


The casts of MAP_FAILED should be removed.  They have no effect except to
break some cases.  Here they mainly caused a type mismatch when the type
of the left hand operand was changed.  This depends on MAP_FAILED having
the correct type (void *).

The fallback definition of MAP_FAILED in xinstall.c should also be removed.
It is compatibility cruft that was last needed in FreeBSD in 1996.  FreeBSD's
MAP_FAILED had the wrong type (caddr_t) until 1997.


@@ -1036,7 +1036,7 @@ compare(int from_fd, const char *from_na
}
out:
if (!done_compare) {
-   char buf1[MAXBSIZE];
+   unsigned char buf1[MAXBSIZE];
char buf2[MAXBSIZE];
int n1, n2;



It's bizarre to use unsigned chars for one buffer and still use plain
chars for the other.

I now see what this change does.  digest_update() takes an unsigned
char * pointer.  This makes it hard to use with normal buffers containing
char, like strcpy() would be if its pointers were unsigned char *.

The correct fix is to break digest_update()'s API like strcpy()'s, or
to cast the pointer arg to unsigned char * whenever it is called
starting with a char * arg.  APIs are hard to change, so the latter
fix is normally used.  Here the API is local, so it is easy to change.
digest_update() calls SHA*_Update(), and no further changes are needed
for that since it takes a void * arg and converts internally to the
correct type, which can only be unsigned char *.

Some applications are too smart and use unsigned char buffers.  They
have essentially the same problem in the opposite direction with using
functions like strcpy().  I used to think that it was a bug to cast
pointer args in str*() calls, since it either has no effect or hides
type mismatch, and type mismatch may cause inconsistent comparisons.
(Note that even strcpy() needs to do comparisons for finding the null
terminator and must use unsigned char to get these right.  However,
the bug is just in the API -- both the caller and the callee should
be using unsigned char for everything.

The new type mismatch between buf1 and buf2 asks for identical files
to often compare unequal, since bytes that have their "sign" bit set
become negative in buf2 but stay positive in buf1.  (Files contain
bytes and bytes don't really have a sign bit, but accessing them via
buf2 corrupts them iff chars are signed.)  However, there is no problem
in practice, since buf1[n] and buf2[n] are never compared directly --
all comparisons are done by calling memcmp(), and it compares bytes.


@@ -1146,7 +1146,8 @@ copy(int from_fd, const char *from_name,
{
int nr, nw;
int serrno;
-   char *p, buf[MAXBSIZE];
+   unsigned char *p;
+   unsigne