Re: svn commit: r305307 - head/tools/tools/crypto

2016-10-03 Thread Ngie Cooper

> On Oct 4, 2016, at 08:56, Gleb Smirnoff  wrote:
> 
>  George,
> 
> On Fri, Sep 02, 2016 at 02:43:00PM -0700, Ngie Cooper (yaneurabeya) wrote:
> N> > Author: gnn
> N> > Date: Fri Sep  2 21:35:32 2016
> N> > New Revision: 305307
> N> > URL: https://svnweb.freebsd.org/changeset/base/305307 
> 
> N> 
> N> …
> N> 
> N> > 
> +crypto="/tank/users/gnn/Repos/svn/FreeBSD.HEAD/tools/tools/crypto/cryptotest”
> N> 
> N> Why is your zpool hardcoded here :)?
> 
> Can you please address Ngie's comment?
> 
> Should be "./cryptotest" probably.

Hi Glebius,
George replied to me (I think directly) agreeing with my concern. The issue 
just hasn't been fixed yet.
I'll add this to a short list of items that need to be covered when I 
return from Japan on Friday, if it's not resolved before then.
Thanks!
-Ngie
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r305307 - head/tools/tools/crypto

2016-10-03 Thread Gleb Smirnoff
  George,

On Fri, Sep 02, 2016 at 02:43:00PM -0700, Ngie Cooper (yaneurabeya) wrote:
N> > Author: gnn
N> > Date: Fri Sep  2 21:35:32 2016
N> > New Revision: 305307
N> > URL: https://svnweb.freebsd.org/changeset/base/305307 

N> 
N> …
N> 
N> > 
+crypto="/tank/users/gnn/Repos/svn/FreeBSD.HEAD/tools/tools/crypto/cryptotest”
N> 
N> Why is your zpool hardcoded here :)?

Can you please address Ngie's comment?

Should be "./cryptotest" probably.

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

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

2016-10-03 Thread Jared McNeill
Author: jmcneill
Date: Mon Oct  3 21:42:05 2016
New Revision: 306658
URL: https://svnweb.freebsd.org/changeset/base/306658

Log:
  Clear GT_CTRL_ENABLE to stop the timer.
  
  Reviewed by:  andrew

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

Modified: head/sys/arm/arm/generic_timer.c
==
--- head/sys/arm/arm/generic_timer.cMon Oct  3 20:48:18 2016
(r306657)
+++ head/sys/arm/arm/generic_timer.cMon Oct  3 21:42:05 2016
(r306658)
@@ -259,7 +259,7 @@ arm_tmr_stop(struct eventtimer *et)
sc = (struct arm_tmr_softc *)et->et_priv;
 
ctrl = get_ctrl(sc->physical);
-   ctrl &= GT_CTRL_ENABLE;
+   ctrl &= ~GT_CTRL_ENABLE;
set_ctrl(ctrl, sc->physical);
 
return (0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r306598 - head/sbin/ccdconfig

2016-10-03 Thread Ngie Cooper

> On Oct 4, 2016, at 04:08, John Baldwin  wrote:
> 
>> On Monday, October 03, 2016 12:15:57 PM Konstantin Belousov wrote:
>>> On Sun, Oct 02, 2016 at 11:19:05PM +, Sevan Janiyan wrote:
>>> Author: sevan (doc committer)
>>> Date: Sun Oct  2 23:19:05 2016
>>> New Revision: 306598
>>> URL: https://svnweb.freebsd.org/changeset/base/306598
>>> 
>>> Log:
>>>  ccdconfig first appeared in NetBSD 1.1
>>>  From NetBSD man page, confirmed with repo tags in CVS [1]
>>>  (there was also no 1.0a release according to [2])
>>> 
>>>  [1] http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/ccdconfig/ccdconfig.c
>>>  [2] http://netbsd.org/releases/formal.html#history
>>> 
>>>  PR:212437
>>>  Approved by:bcr (mentor)
>>>  Obtained from:NetBSD
>>>  MFC after:4 days
>>>  Differential Revision:https://reviews.freebsd.org/D8105
>>> 
>>> Modified:
>>>  head/sbin/ccdconfig/ccdconfig.8
>> Is ccd(4) still operational ?  I suspect that it is not, and that
>> sbin/ccdconfig and ccd(4) page should be removed.
> 
> There is geom_ccd so I think there's a decent chance it still works.  Of
> course, no one should be using it except for some legacy config.  I'm not
> sure if 12 is sufficiently divorced in time from when ccdconfig was still
> something to use that we can remove it now.

I brought up its removal about 2 years ago: 
https://lists.freebsd.org/pipermail/freebsd-arch/2014-December/016454.html . If 
my memory serves me correctly, I think phk replied in another subthread (not 
tracked via pipermail above), requesting that *ccd(4) remain in the tree.

I'm CCing him, just in case.

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


svn commit: r306657 - in head/lib: . libcapsicum

2016-10-03 Thread Mariusz Zaborski
Author: oshogbo
Date: Mon Oct  3 20:48:18 2016
New Revision: 306657
URL: https://svnweb.freebsd.org/changeset/base/306657

Log:
  libcapsicum: introduce Capsicum helpers
  
  Capsicum helpers are a set of inline functions which goal is to reduce
  duplicated patterns used to Capsicumize applications.
  
  Reviewed by:  cem, AllanJude, bapt, ed, emaste
  Differential Revision:https://reviews.freebsd.org/D8013

Added:
  head/lib/libcapsicum/
  head/lib/libcapsicum/Makefile   (contents, props changed)
  head/lib/libcapsicum/capsicum_helpers.h   (contents, props changed)
Modified:
  head/lib/Makefile

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Mon Oct  3 20:05:33 2016(r306656)
+++ head/lib/Makefile   Mon Oct  3 20:48:18 2016(r306657)
@@ -38,6 +38,7 @@ SUBDIR=   ${SUBDIR_BOOTSTRAP} \
libbz2 \
libcalendar \
libcam \
+   libcapsicum \
${_libcasper} \
${_libcom_err} \
libcompat \

Added: head/lib/libcapsicum/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libcapsicum/Makefile   Mon Oct  3 20:48:18 2016
(r306657)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+PACKAGE=lib${LIB}
+
+INCS=  capsicum_helpers.h
+
+.include 

Added: head/lib/libcapsicum/capsicum_helpers.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libcapsicum/capsicum_helpers.h Mon Oct  3 20:48:18 2016
(r306657)
@@ -0,0 +1,120 @@
+/*-
+ * Copyright (c) 2016 Mariusz Zaborski 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _CAPSICUM_HELPERS_H_
+#define_CAPSICUM_HELPERS_H_
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#defineCAPH_IGNORE_EBADF   0x0001
+#defineCAPH_READ   0x0002
+#defineCAPH_WRITE  0x0004
+
+static __inline int
+caph_limit_stream(int fd, int flags)
+{
+   cap_rights_t rights;
+   unsigned long cmds[] = { TIOCGETA, TIOCGWINSZ };
+
+   cap_rights_init(, CAP_FCNTL, CAP_FSTAT, CAP_IOCTL);
+
+   if ((flags & CAPH_READ) != 0)
+   cap_rights_set(, CAP_READ);
+   if ((flags & CAPH_WRITE) != 0)
+   cap_rights_set(, CAP_WRITE);
+
+   if (cap_rights_limit(fd, ) < 0 && errno != ENOSYS) {
+   if (errno == EBADF && (flags & CAPH_IGNORE_EBADF) != 0)
+   return (0);
+   return (-1);
+   }
+
+   if (cap_ioctls_limit(fd, cmds, nitems(cmds)) < 0 && errno != ENOSYS)
+   return (-1);
+
+   if (cap_fcntls_limit(fd, CAP_FCNTL_GETFL) < 0 && errno != ENOSYS)
+   return (-1);
+
+   return (0);
+}
+
+static __inline int
+caph_limit_stdin(void)
+{
+
+   return (caph_limit_stream(STDIN_FILENO, CAPH_READ));
+}
+
+static __inline int
+caph_limit_stderr(void)
+{
+
+   return (caph_limit_stream(STDERR_FILENO, CAPH_WRITE));
+}
+
+static __inline int
+caph_limit_stdout(void)
+{
+
+   return (caph_limit_stream(STDOUT_FILENO, CAPH_WRITE));
+}
+
+static __inline int
+caph_limit_stdio(void)
+{
+
+   if (caph_limit_stdin() == -1 || caph_limit_stdout() == -1 ||
+   caph_limit_stdout() == -1) {
+   return (-1);
+   }
+
+   return (0);
+}
+
+static __inline void
+caph_cache_tzdata(void)
+{
+
+   tzset();
+}
+
+static __inline void
+caph_cache_catpages(void)
+{
+
+   

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

2016-10-03 Thread Andrew Turner
Author: andrew
Date: Mon Oct  3 20:05:33 2016
New Revision: 306656
URL: https://svnweb.freebsd.org/changeset/base/306656

Log:
  Use the cortex functions when booting on one of the Cortex-A ARMv8 CPUs.
  This list is incomplete, however we don't have the ID values for the
  missing Cortex-A32 or A35.
  
  Submitted by: loos (Cortex-A53)
  Sponsored by: ABT Systems Ltd

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

Modified: head/sys/arm/arm/cpufunc.c
==
--- head/sys/arm/arm/cpufunc.c  Mon Oct  3 19:52:06 2016(r306655)
+++ head/sys/arm/arm/cpufunc.c  Mon Oct  3 20:05:33 2016(r306656)
@@ -680,6 +680,9 @@ set_cpufuncs()
case CPU_ID_CORTEXA9:
case CPU_ID_CORTEXA12:
case CPU_ID_CORTEXA15:
+   case CPU_ID_CORTEXA53:
+   case CPU_ID_CORTEXA57:
+   case CPU_ID_CORTEXA72:
case CPU_ID_KRAIT300:
cpufuncs = cortexa_cpufuncs;
get_cachetype_cp15();
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r306654 - head/sys/arm/ti/cpsw

2016-10-03 Thread Luiz Otavio O Souza
Author: loos
Date: Mon Oct  3 19:48:56 2016
New Revision: 306654
URL: https://svnweb.freebsd.org/changeset/base/306654

Log:
  Enable the TX completion interrupt for the cpsw NIC to assure the free tx
  descriptors are reclaimed as soon as possible.
  
  Without this the free buffers are reclaimed only on watchdog runs or after
  trying to enqueue more packets.
  
  Sponsored by: Rubicon Communications, LLC (Netgte)

Modified:
  head/sys/arm/ti/cpsw/if_cpsw.c

Modified: head/sys/arm/ti/cpsw/if_cpsw.c
==
--- head/sys/arm/ti/cpsw/if_cpsw.c  Mon Oct  3 19:34:32 2016
(r306653)
+++ head/sys/arm/ti/cpsw/if_cpsw.c  Mon Oct  3 19:48:56 2016
(r306654)
@@ -117,6 +117,7 @@ static void cpsw_intr_rx(void *arg);
 static struct mbuf *cpsw_rx_dequeue(struct cpsw_softc *);
 static void cpsw_rx_enqueue(struct cpsw_softc *);
 static void cpswp_start(struct ifnet *);
+static void cpsw_intr_tx(void *);
 static void cpswp_tx_enqueue(struct cpswp_softc *);
 static int cpsw_tx_dequeue(struct cpsw_softc *);
 
@@ -209,6 +210,15 @@ static struct resource_spec irq_res_spec
{ -1, 0 }
 };
 
+static struct {
+   void (*cb)(void *);
+} cpsw_intr_cb[] = {
+   { cpsw_intr_rx_thresh },
+   { cpsw_intr_rx },
+   { cpsw_intr_tx },
+   { cpsw_intr_misc },
+};
+
 /* Number of entries here must match size of stats
  * array in struct cpswp_softc. */
 static struct cpsw_stat {
@@ -590,13 +600,15 @@ cpsw_init(struct cpsw_softc *sc)
/* Enable Interrupts for core 0 */
cpsw_write_4(sc, CPSW_WR_C_RX_THRESH_EN(0), 0xFF);
cpsw_write_4(sc, CPSW_WR_C_RX_EN(0), 0xFF);
+   cpsw_write_4(sc, CPSW_WR_C_TX_EN(0), 0xFF);
cpsw_write_4(sc, CPSW_WR_C_MISC_EN(0), 0x1F);
 
/* Enable host Error Interrupt */
cpsw_write_4(sc, CPSW_CPDMA_DMA_INTMASK_SET, 3);
 
-   /* Enable interrupts for RX Channel 0 */
+   /* Enable interrupts for RX and TX on Channel 0 */
cpsw_write_4(sc, CPSW_CPDMA_RX_INTMASK_SET, 1);
+   cpsw_write_4(sc, CPSW_CPDMA_TX_INTMASK_SET, 1);
 
/* Initialze MDIO - ENABLE, PREAMBLE=0, FAULTENB, CLKDIV=0xFF */
/* TODO Calculate MDCLK=CLK/(CLKDIV+1) */
@@ -645,22 +657,14 @@ cpsw_probe(device_t dev)
 static int
 cpsw_intr_attach(struct cpsw_softc *sc)
 {
+   int i;
 
-   /* Note: We don't use sc->irq_res[2] (TX interrupt) */
-   if (bus_setup_intr(sc->dev, sc->irq_res[0],
-   INTR_TYPE_NET | INTR_MPSAFE, NULL, cpsw_intr_rx_thresh,
-   sc, >ih_cookie[0]) != 0) {
-   return (-1);
-   }
-   if (bus_setup_intr(sc->dev, sc->irq_res[1],
-   INTR_TYPE_NET | INTR_MPSAFE, NULL, cpsw_intr_rx,
-   sc, >ih_cookie[1]) != 0) {
-   return (-1);
-   }
-   if (bus_setup_intr(sc->dev, sc->irq_res[3],
-   INTR_TYPE_NET | INTR_MPSAFE, NULL, cpsw_intr_misc,
-   sc, >ih_cookie[3]) != 0) {
-   return (-1);
+   for (i = 0; i < CPSW_INTR_COUNT; i++) {
+   if (bus_setup_intr(sc->dev, sc->irq_res[i],
+   INTR_TYPE_NET | INTR_MPSAFE, NULL,
+   cpsw_intr_cb[i].cb, sc, >ih_cookie[i]) != 0) {
+   return (-1);
+   }
}
 
return (0);
@@ -1696,6 +1700,18 @@ cpswp_start(struct ifnet *ifp)
 }
 
 static void
+cpsw_intr_tx(void *arg)
+{
+   struct cpsw_softc *sc;
+
+   sc = (struct cpsw_softc *)arg;
+   CPSW_TX_LOCK(sc);
+   cpsw_tx_dequeue(sc);
+   cpsw_write_4(sc, CPSW_CPDMA_CPDMA_EOI_VECTOR, 2);
+   CPSW_TX_UNLOCK(sc);
+}
+
+static void
 cpswp_tx_enqueue(struct cpswp_softc *sc)
 {
bus_dma_segment_t segs[CPSW_TXFRAGS];
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r306653 - head/sys/arm/conf

2016-10-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Oct  3 19:34:32 2016
New Revision: 306653
URL: https://svnweb.freebsd.org/changeset/base/306653

Log:
  Add Tegra TK1 DTBs to GENERIC kernel
  
  Approved by:  andrew

Modified:
  head/sys/arm/conf/GENERIC

Modified: head/sys/arm/conf/GENERIC
==
--- head/sys/arm/conf/GENERIC   Mon Oct  3 19:02:22 2016(r306652)
+++ head/sys/arm/conf/GENERIC   Mon Oct  3 19:34:32 2016(r306653)
@@ -169,4 +169,4 @@ options EFI
 
 # Flattened Device Tree
 optionsFDT # Configure using FDT/DTB data
-makeoptionsMODULES_EXTRA="dtb/allwinner dtb/rpi"
+makeoptionsMODULES_EXTRA="dtb/allwinner dtb/nvidia dtb/rpi"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r306652 - head/usr.sbin/arp

2016-10-03 Thread Bruce Simpson

On 03/10/16 20:22, Eric van Gyzen wrote:

The collision is unfortunate, but I agree that the context should be enough.


Agreed -- other technical writers have also used this version of the 
GARP acronym in doco.



However, that GARP -- 802.1ak -- is due to be replaced with MRP.


The "Mental-map Rewriting Protocol"?  ;-)


Multiple Registration Protocol (MRP) is intended to fill most of the 
roles GARP/GVRP did, for dynamic VLAN, end-station MAC and L2 multicast 
registration. (Think Ethernet multicast without IP.)


Actually, being reminded of this gave me an idea -- adding a subset of 
what's needed to support MRP to if_bridge would probably also help for 
supporting Ethernet rings; those protocols need to call into VLAN 
registration and port blocking too.


It would make for some good junior kernel hacker tasks...
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r306652 - head/usr.sbin/arp

2016-10-03 Thread Eric van Gyzen
On 10/03/2016 14:11, Bruce Simpson wrote:
> On 03/10/16 20:02, Eric van Gyzen wrote:
>> Author: vangyzen
>> Date: Mon Oct  3 19:02:22 2016
>> New Revision: 306652
>> URL: https://svnweb.freebsd.org/changeset/base/306652
>>
>> Log:
>>   Update arp(4) to document the net.link.ether.inet.garp_rexmit_count
>> sysctl.
> 
> Meh, acronym collision.
> 
> It's probably obvious in this context that GARP stands here for
> Gratuitous ARP, but my mental autocomplete reads it as Generic Attribute
> Registration Protocol (GARP).

The collision is unfortunate, but I agree that the context should be enough.

> However, that GARP -- 802.1ak -- is due to be replaced with MRP.

The "Mental-map Rewriting Protocol"?  ;-)

Cheers,

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


Re: svn commit: r306598 - head/sbin/ccdconfig

2016-10-03 Thread John Baldwin
On Monday, October 03, 2016 12:15:57 PM Konstantin Belousov wrote:
> On Sun, Oct 02, 2016 at 11:19:05PM +, Sevan Janiyan wrote:
> > Author: sevan (doc committer)
> > Date: Sun Oct  2 23:19:05 2016
> > New Revision: 306598
> > URL: https://svnweb.freebsd.org/changeset/base/306598
> > 
> > Log:
> >   ccdconfig first appeared in NetBSD 1.1
> >   From NetBSD man page, confirmed with repo tags in CVS [1]
> >   (there was also no 1.0a release according to [2])
> >   
> >   [1] http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/ccdconfig/ccdconfig.c
> >   [2] http://netbsd.org/releases/formal.html#history
> >   
> >   PR:   212437
> >   Approved by:  bcr (mentor)
> >   Obtained from:NetBSD
> >   MFC after:4 days
> >   Differential Revision:https://reviews.freebsd.org/D8105
> > 
> > Modified:
> >   head/sbin/ccdconfig/ccdconfig.8
> Is ccd(4) still operational ?  I suspect that it is not, and that
> sbin/ccdconfig and ccd(4) page should be removed.

There is geom_ccd so I think there's a decent chance it still works.  Of
course, no one should be using it except for some legacy config.  I'm not
sure if 12 is sufficiently divorced in time from when ccdconfig was still
something to use that we can remove it now.

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


Re: svn commit: r306652 - head/usr.sbin/arp

2016-10-03 Thread Bruce Simpson

On 03/10/16 20:02, Eric van Gyzen wrote:

Author: vangyzen
Date: Mon Oct  3 19:02:22 2016
New Revision: 306652
URL: https://svnweb.freebsd.org/changeset/base/306652

Log:
  Update arp(4) to document the net.link.ether.inet.garp_rexmit_count sysctl.


Meh, acronym collision.

It's probably obvious in this context that GARP stands here for 
Gratuitous ARP, but my mental autocomplete reads it as Generic Attribute 
Registration Protocol (GARP).


However, that GARP -- 802.1ak -- is due to be replaced with MRP.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r306652 - head/usr.sbin/arp

2016-10-03 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Oct  3 19:02:22 2016
New Revision: 306652
URL: https://svnweb.freebsd.org/changeset/base/306652

Log:
  Update arp(4) to document the net.link.ether.inet.garp_rexmit_count sysctl.
  
  Submitted by: David A. Bright 
  Requested by: markj
  Reviewed by:  markj, badger
  MFC after:4 weeks
  X-MFC with:   r306577
  Sponsored by: Dell EMC
  Differential Revision:https://reviews.freebsd.org/D8136

Modified:
  head/usr.sbin/arp/arp.4

Modified: head/usr.sbin/arp/arp.4
==
--- head/usr.sbin/arp/arp.4 Mon Oct  3 18:20:58 2016(r306651)
+++ head/usr.sbin/arp/arp.4 Mon Oct  3 19:02:22 2016(r306652)
@@ -28,7 +28,7 @@
 .\"@(#)arp4.4  6.5 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd November 5, 2013
+.Dd October 3, 2016
 .Dt ARP 4
 .Os
 .Sh NAME
@@ -126,6 +126,24 @@ the hardware address.
 Installing such entries is RFC 1812 violation, but some prorietary
 load balancing techniques require routers on network to do so.
 Turned off by default.
+.It Va garp_rexmit_count
+Should the kernel retransmit gratuitous ARP (GARP) packets when an IPv4 address
+is added to an interface.
+A GARP is always transmitted when an IPv4 address is added to an interface.
+A non-zero value of this sysctl will cause the GARP packet to be retransmitted
+the stated number of times.
+The interval between retransmissions is doubled each time, so the
+retransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds).
+The default value of zero means only the initial GARP is sent; no
+additional GARP packets are retransmitted.
+The maximum value is sixteen.
+.Pp
+Although a single GARP packet (the default behavior) is usually sufficient, in
+some circumstances, such as when a shared address is passed between cluster
+nodes, this single GARP may be dropped or lost.
+This can lead to neighbors on the network link working with a stale ARP cache
+and sending packets destined for that address to the node that previously owned
+the address, which may not respond.
 .It Va log_arp_movements
 Should the kernel log movements of IP addresses from one hardware
 address to an other.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r306651 - in head: include lib/libc/gen

2016-10-03 Thread Ed Schouten
2016-10-03 20:47 GMT+02:00 Konstantin Belousov :
> Sorry, I did not noticed this.  Yes, sym_compat is enough there.

Ah, no problem. Thanks for taking your time regardless!

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r306651 - in head: include lib/libc/gen

2016-10-03 Thread Konstantin Belousov
On Mon, Oct 03, 2016 at 08:36:52PM +0200, Ed Schouten wrote:
> 2016-10-03 20:34 GMT+02:00 Ed Schouten :
> > But I've added __sym_compat()s for those. That still causes them to be
> > available for linking, right? readelf -s gives:
> 
> Sorry if I was unclear. In this context, 'linking' should say
> 'run-time linking'.

Sorry, I did not noticed this.  Yes, sym_compat is enough there.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r306651 - in head: include lib/libc/gen

2016-10-03 Thread Ed Schouten
2016-10-03 20:34 GMT+02:00 Ed Schouten :
> But I've added __sym_compat()s for those. That still causes them to be
> available for linking, right? readelf -s gives:

Sorry if I was unclear. In this context, 'linking' should say
'run-time linking'.

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r306651 - in head: include lib/libc/gen

2016-10-03 Thread Ed Schouten
Hi Kostik,

2016-10-03 20:30 GMT+02:00 Konstantin Belousov :
> You just break ABI.  Symbols cannot be removed from the published version.

But I've added __sym_compat()s for those. That still causes them to be
available for linking, right? readelf -s gives:

72: 000780d040 FUNCGLOBAL DEFAULT   11 encrypt@FBSD_1.0
  1593: 0007802040 FUNCGLOBAL DEFAULT   11 des_setkey@FBSD_1.0
  2728: 0007805068 FUNCGLOBAL DEFAULT   11 des_cipher@FBSD_1.0
  3120: 000780a040 FUNCGLOBAL DEFAULT   11 setkey@FBSD_1.0

If this is incorrect, what should I have done instead?

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r306651 - in head: include lib/libc/gen

2016-10-03 Thread Konstantin Belousov
On Mon, Oct 03, 2016 at 06:20:58PM +, Ed Schouten wrote:
> Modified: head/lib/libc/gen/Symbol.map
> ==
> --- head/lib/libc/gen/Symbol.map  Mon Oct  3 18:00:10 2016
> (r306650)
> +++ head/lib/libc/gen/Symbol.map  Mon Oct  3 18:20:58 2016
> (r306651)
> @@ -73,10 +73,6 @@ FBSD_1.0 {
>   clock;
>   closedir;
>   confstr;
> - encrypt;
> - des_setkey;
> - des_cipher;
> - setkey;
>   ctermid;
>   ctermid_r;
>   daemon;
You just break ABI.  Symbols cannot be removed from the published version.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r306651 - in head: include lib/libc/gen

2016-10-03 Thread Ed Schouten
Author: ed
Date: Mon Oct  3 18:20:58 2016
New Revision: 306651
URL: https://svnweb.freebsd.org/changeset/base/306651

Log:
  Remove setkey(), encrypt(), des_setkey() and des_cipher().
  
  The setkey() and encrypt() functions are part of XSI, not the POSIX base
  definitions. There is no strict requirement for us to provide these,
  especially if we're only going to keep these around as undocumented
  stubs. The same holds for des_setkey() and des_cipher().
  
  Instead of providing functions that only generate warnings when linking,
  simply disallow linking against them. The impact of this is relatively
  low. It only causes two leaf ports to break. I'll see what I can do to
  help out to get those fixed.
  
  PR:   211626

Modified:
  head/include/stdlib.h
  head/include/unistd.h
  head/lib/libc/gen/Symbol.map
  head/lib/libc/gen/crypt.c

Modified: head/include/stdlib.h
==
--- head/include/stdlib.h   Mon Oct  3 18:00:10 2016(r306650)
+++ head/include/stdlib.h   Mon Oct  3 18:20:58 2016(r306651)
@@ -221,10 +221,6 @@ int putenv(char *);
 longrandom(void);
 unsigned short
*seed48(unsigned short[3]);
-#ifndef _SETKEY_DECLARED
-int setkey(const char *);
-#define_SETKEY_DECLARED
-#endif
 char   *setstate(/* const */ char *);
 voidsrand48(long);
 voidsrandom(unsigned int);

Modified: head/include/unistd.h
==
--- head/include/unistd.h   Mon Oct  3 18:00:10 2016(r306650)
+++ head/include/unistd.h   Mon Oct  3 18:20:58 2016(r306651)
@@ -449,8 +449,6 @@ int  symlink(const char * __restrict, co
 /* X/Open System Interfaces */
 #if __XSI_VISIBLE
 char   *crypt(const char *, const char *);
-/* char*ctermid(char *); *//* XXX ??? */
-int encrypt(char *, int);
 longgethostid(void);
 int lockf(int, int, off_t);
 int nice(int);
@@ -498,8 +496,6 @@ const char *
 crypt_get_format(void);
 char   *crypt_r(const char *, const char *, struct crypt_data *);
 int crypt_set_format(const char *);
-int des_cipher(const char *, char *, long, int);
-int des_setkey(const char *key);
 int dup3(int, int, int);
 int eaccess(const char *, int);
 voidendusershell(void);
@@ -567,10 +563,6 @@ int setdomainname(const char *, int);
 int setgroups(int, const gid_t *);
 voidsethostid(long);
 int sethostname(const char *, int);
-#ifndef _SETKEY_DECLARED
-int setkey(const char *);
-#define_SETKEY_DECLARED
-#endif
 int setlogin(const char *);
 int setloginclass(const char *);
 void   *setmode(const char *);

Modified: head/lib/libc/gen/Symbol.map
==
--- head/lib/libc/gen/Symbol.mapMon Oct  3 18:00:10 2016
(r306650)
+++ head/lib/libc/gen/Symbol.mapMon Oct  3 18:20:58 2016
(r306651)
@@ -73,10 +73,6 @@ FBSD_1.0 {
clock;
closedir;
confstr;
-   encrypt;
-   des_setkey;
-   des_cipher;
-   setkey;
ctermid;
ctermid_r;
daemon;

Modified: head/lib/libc/gen/crypt.c
==
--- head/lib/libc/gen/crypt.c   Mon Oct  3 18:00:10 2016(r306650)
+++ head/lib/libc/gen/crypt.c   Mon Oct  3 18:20:58 2016(r306651)
@@ -48,47 +48,41 @@ __FBSDID("$FreeBSD$");
  * encryption, make sure you've got libcrypt.a around.
  */
 
-__warn_references(des_setkey,
-   "WARNING!  des_setkey(3) not present in the system!");
-
 /* ARGSUSED */
 int
-des_setkey(const char *key __unused)
+__freebsd11_des_setkey(const char *key __unused)
 {
fprintf(stderr, "WARNING!  des_setkey(3) not present in the system!\n");
return (0);
 }
 
-__warn_references(des_cipher,
-   "WARNING!  des_cipher(3) not present in the system!");
-
 /* ARGSUSED */
 int
-des_cipher(const char *in, char *out, long salt __unused, int num_iter 
__unused)
+__freebsd11_des_cipher(const char *in, char *out, long salt __unused,
+int num_iter __unused)
 {
fprintf(stderr, "WARNING!  des_cipher(3) not present in the system!\n");
bcopy(in, out, 8);
return (0);
 }
 
-__warn_references(setkey,
-   "WARNING!  setkey(3) not present in the system!");
-
 /* ARGSUSED */
 int
-setkey(const char *key __unused)
+__freebsd11_setkey(const char *key __unused)
 {
fprintf(stderr, "WARNING!  setkey(3) not present in the system!\n");
return (0);
 }
 
-__warn_references(encrypt,
-   "WARNING!  encrypt(3) not present in the system!");
-
 /* ARGSUSED */
 int
-encrypt(char *block __unused, int flag __unused)
+__freebsd11_encrypt(char *block __unused, int flag __unused)
 {
fprintf(stderr, "WARNING!  encrypt(3) not present in the system!\n");
return (0);
 }
+

Re: svn commit: r306620 - head/usr.bin/mkimg

2016-10-03 Thread Marcel Moolenaar
On October 3, 2016 at 10:36:27 AM, Conrad Meyer (c...@freebsd.org) wrote:
On Sun, Oct 2, 2016 at 6:46 PM, Marcel Moolenaar  wrote: 
> Author: marcel 
> Date: Mon Oct 3 01:46:47 2016 
> New Revision: 306620 
> URL: https://svnweb.freebsd.org/changeset/base/306620 
> 
> Log: 
> Replace STAILQ with TAILQ. TAILQs are portable enough that they can 
> be used on both macOS and Linux. STAILQs are not. In particular, 
> STAILQ_LAST does not next on Linux. Since neither STAILQ_FOREACH_SAFE 
> nor TAILQ_FOREACH_SAFE exist on Linux, replace its use with a regular 
> TAILQ_FOREACH. The _SAFE variant was only used for having the next 
> pointer in a local variable. 

All of these routines are available in the "libbsd" sys/queue.h. You 
might find other helpful portability/compatibility routines there, 
requiring fewer changes to the FreeBSD mkimg. 
Oh, nice. I’ll take a look.




signature.asc
Description: Message signed with OpenPGP using AMPGpg


svn commit: r306650 - head/sys/arm/include

2016-10-03 Thread Andrew Turner
Author: andrew
Date: Mon Oct  3 18:00:10 2016
New Revision: 306650
URL: https://svnweb.freebsd.org/changeset/base/306650

Log:
  Add the Cortex-A{53,57,72} ID register values. These can all run 32-bit
  code so could run a 32-bit kernel.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/include/armreg.h

Modified: head/sys/arm/include/armreg.h
==
--- head/sys/arm/include/armreg.h   Mon Oct  3 17:49:26 2016
(r306649)
+++ head/sys/arm/include/armreg.h   Mon Oct  3 18:00:10 2016
(r306650)
@@ -152,6 +152,9 @@
 #define CPU_ID_CORTEXA15R1 (CPU_ID_CORTEXA15 | (1 << 
CPU_ID_VARIANT_SHIFT))
 #define CPU_ID_CORTEXA15R2 (CPU_ID_CORTEXA15 | (2 << 
CPU_ID_VARIANT_SHIFT))
 #define CPU_ID_CORTEXA15R3 (CPU_ID_CORTEXA15 | (3 << 
CPU_ID_VARIANT_SHIFT))
+#defineCPU_ID_CORTEXA53(CPU_ID_ARM_LTD | CPU_ID_CPUID_SCHEME | 
0xd030)
+#defineCPU_ID_CORTEXA57(CPU_ID_ARM_LTD | CPU_ID_CPUID_SCHEME | 
0xd070)
+#defineCPU_ID_CORTEXA72(CPU_ID_ARM_LTD | CPU_ID_CPUID_SCHEME | 
0xd080)
 
 #defineCPU_ID_KRAIT300 (CPU_ID_QUALCOM | CPU_ID_CPUID_SCHEME | 
0x06f0)
 /* Snapdragon S4 Pro/APQ8064 */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r306649 - in head: . gnu/usr.bin/binutils share/mk tools/build/mk tools/build/options usr.bin/elfcopy

2016-10-03 Thread Ed Maste
Author: emaste
Date: Mon Oct  3 17:49:26 2016
New Revision: 306649
URL: https://svnweb.freebsd.org/changeset/base/306649

Log:
  Retire WITHOUT_ELFCOPY_AS_OBJCOPY option
  
  In FreeBSD 11 ELF Tool Chain's elfcopy is installed as objcopy by
  default, with the option to switch back to GNU objcopy by setting
  WITHOUT_ELFCOPY_AS_OBJCOPY in make.conf.
  
  We plan to remove the outdated in-tree binutils in FreeBSD 12, so
  remove the temporary transition aid.
  
  Reviewed by:  brooks, imp
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D7337

Deleted:
  head/tools/build/options/WITHOUT_ELFCOPY_AS_OBJCOPY
  head/tools/build/options/WITH_ELFCOPY_AS_OBJCOPY
Modified:
  head/ObsoleteFiles.inc
  head/UPDATING
  head/gnu/usr.bin/binutils/Makefile
  head/share/mk/src.opts.mk
  head/tools/build/mk/OptionalObsoleteFiles.inc
  head/usr.bin/elfcopy/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Mon Oct  3 17:34:50 2016(r306648)
+++ head/ObsoleteFiles.inc  Mon Oct  3 17:49:26 2016(r306649)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20161003: MK_ELFCOPY_AS_OBJCOPY option retired
+OLD_FILES+=usr/bin/elfcopy
+OLD_FILES+=usr/share/man/man1/elfcopy.1.gz
 # 20160906: libkqueue tests moved to /usr/tests/sys/kqueue/libkqueue
 OLD_FILES+=usr/tests/sys/kqueue/kqtest
 OLD_FILES+=usr/tests/sys/kqueue/kqueue_test

Modified: head/UPDATING
==
--- head/UPDATING   Mon Oct  3 17:34:50 2016(r306648)
+++ head/UPDATING   Mon Oct  3 17:49:26 2016(r306649)
@@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20161003:
+   The WITHOUT_ELFCOPY_AS_OBJCOPY src.conf(5) knob has been retired.
+   ELF Tool Chain's elfcopy is always installed as /usr/bin/objcopy.
+
 20160924:
Relocatable object files with the extension of .So have been renamed
to use an extension of .pico instead.  The purpose of this change is

Modified: head/gnu/usr.bin/binutils/Makefile
==
--- head/gnu/usr.bin/binutils/Makefile  Mon Oct  3 17:34:50 2016
(r306648)
+++ head/gnu/usr.bin/binutils/Makefile  Mon Oct  3 17:49:26 2016
(r306649)
@@ -9,17 +9,12 @@ SUBDIR=   doc\
libbinutils \
as \
ld \
-   ${_objcopy} \
-   objdump \
+   objdump
 
-.if ${MK_ELFCOPY_AS_OBJCOPY} == "no"
-_objcopy=  objcopy
-.endif
 
 SUBDIR_DEPEND_libbinutils=libbfd   # for bfdver.h
 SUBDIR_DEPEND_as=libbfd libiberty libopcodes
 SUBDIR_DEPEND_ld=libbfd libiberty
-SUBDIR_DEPEND_objcopy=libbfd libiberty libbinutils
 SUBDIR_DEPEND_objdump=libbfd libiberty libbinutils libopcodes
 
 .if !make(install)

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Mon Oct  3 17:34:50 2016(r306648)
+++ head/share/mk/src.opts.mk   Mon Oct  3 17:49:26 2016(r306649)
@@ -82,7 +82,6 @@ __DEFAULT_YES_OPTIONS = \
 DYNAMICROOT \
 ED_CRYPTO \
 EE \
-ELFCOPY_AS_OBJCOPY \
 ELFTOOLCHAIN_BOOTSTRAP \
 EXAMPLES \
 FDT \

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Oct  3 17:34:50 
2016(r306648)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Oct  3 17:49:26 
2016(r306649)
@@ -220,9 +220,6 @@ OLD_DIRS+=usr/share/examples/bhyve
 OLD_FILES+=usr/bin/as
 OLD_FILES+=usr/bin/ld
 OLD_FILES+=usr/bin/ld.bfd
-.if ${MK_ELFCOPY_AS_OBJCOPY} == no
-OLD_FILES+=usr/bin/objcopy
-.endif
 OLD_FILES+=usr/bin/objdump
 OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.x
 OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xbn
@@ -421,9 +418,6 @@ OLD_FILES+=usr/libdata/ldscripts/elf_x86
 OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.xw
 OLD_FILES+=usr/share/man/man1/as.1.gz
 OLD_FILES+=usr/share/man/man1/ld.1.gz
-.if ${MK_ELFCOPY_AS_OBJCOPY} == no
-OLD_FILES+=usr/share/man/man1/objcopy.1.gz
-.endif
 OLD_FILES+=usr/share/man/man1/objdump.1.gz
 OLD_FILES+=usr/share/man/man7/as.7.gz
 OLD_FILES+=usr/share/man/man7/ld.7.gz
@@ -8024,6 +8018,7 @@ OLD_FILES+=usr/bin/c++filt
 OLD_FILES+=usr/bin/ld
 OLD_FILES+=usr/bin/ld.bfd
 OLD_FILES+=usr/bin/nm
+OLD_FILES+=usr/bin/objcopy
 OLD_FILES+=usr/bin/readelf
 OLD_FILES+=usr/bin/size
 OLD_FILES+=usr/bin/strings
@@ -8036,10 +8031,7 @@ OLD_FILES+=usr/share/man/man1/readelf.1.
 OLD_FILES+=usr/share/man/man1/size.1.gz
 OLD_FILES+=usr/share/man/man1/strings.1.gz
 OLD_FILES+=usr/share

Re: svn commit: r306620 - head/usr.bin/mkimg

2016-10-03 Thread Conrad Meyer
On Sun, Oct 2, 2016 at 6:46 PM, Marcel Moolenaar  wrote:
> Author: marcel
> Date: Mon Oct  3 01:46:47 2016
> New Revision: 306620
> URL: https://svnweb.freebsd.org/changeset/base/306620
>
> Log:
>   Replace STAILQ with TAILQ. TAILQs are portable enough that they can
>   be used on both macOS and Linux. STAILQs are not. In particular,
>   STAILQ_LAST does not next on Linux. Since neither STAILQ_FOREACH_SAFE
>   nor TAILQ_FOREACH_SAFE exist on Linux, replace its use with a regular
>   TAILQ_FOREACH. The _SAFE variant was only used for having the next
>   pointer in a local variable.

All of these routines are available in the "libbsd" sys/queue.h.  You
might find other helpful portability/compatibility routines there,
requiring fewer changes to the FreeBSD mkimg.

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


svn commit: r306648 - head/gnu/lib

2016-10-03 Thread Ed Maste
Author: emaste
Date: Mon Oct  3 17:34:50 2016
New Revision: 306648
URL: https://svnweb.freebsd.org/changeset/base/306648

Log:
  Don't build libdialog if WITHOUT_DIALOG is set
  
  X-MFC-With:   r306375

Modified:
  head/gnu/lib/Makefile

Modified: head/gnu/lib/Makefile
==
--- head/gnu/lib/Makefile   Mon Oct  3 17:20:34 2016(r306647)
+++ head/gnu/lib/Makefile   Mon Oct  3 17:34:50 2016(r306648)
@@ -2,7 +2,9 @@
 
 .include 
 
-SUBDIR= csu libgcc libdialog libregex
+SUBDIR= csu libgcc libregex
+
+SUBDIR.${MK_DIALOG}+=  libdialog
 
 .if ${MK_GCC} != "no"
 SUBDIR+= libgcov libgomp
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r306647 - in head/sys/dev: evdev usb/input

2016-10-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Oct  3 17:20:34 2016
New Revision: 306647
URL: https://svnweb.freebsd.org/changeset/base/306647

Log:
  const-ify struct evdev_methods
  
  Submitted by: Vladimir Kondratiev 
  Suggested by: hselasky

Modified:
  head/sys/dev/evdev/evdev.c
  head/sys/dev/evdev/evdev.h
  head/sys/dev/evdev/evdev_private.h
  head/sys/dev/usb/input/ukbd.c
  head/sys/dev/usb/input/ums.c

Modified: head/sys/dev/evdev/evdev.c
==
--- head/sys/dev/evdev/evdev.c  Mon Oct  3 16:47:46 2016(r306646)
+++ head/sys/dev/evdev/evdev.c  Mon Oct  3 17:20:34 2016(r306647)
@@ -302,7 +302,7 @@ evdev_set_serial(struct evdev_dev *evdev
 
 inline void
 evdev_set_methods(struct evdev_dev *evdev, void *softc,
-struct evdev_methods *methods)
+const struct evdev_methods *methods)
 {
 
evdev->ev_methods = methods;

Modified: head/sys/dev/evdev/evdev.h
==
--- head/sys/dev/evdev/evdev.h  Mon Oct  3 16:47:46 2016(r306646)
+++ head/sys/dev/evdev/evdev.h  Mon Oct  3 17:20:34 2016(r306647)
@@ -89,7 +89,8 @@ void evdev_set_name(struct evdev_dev *, 
 void evdev_set_id(struct evdev_dev *, uint16_t, uint16_t, uint16_t, uint16_t);
 void evdev_set_phys(struct evdev_dev *, const char *);
 void evdev_set_serial(struct evdev_dev *, const char *);
-void evdev_set_methods(struct evdev_dev *, void *, struct evdev_methods *);
+void evdev_set_methods(struct evdev_dev *, void *,
+const struct evdev_methods *);
 int evdev_register(struct evdev_dev *);
 int evdev_unregister(struct evdev_dev *);
 int evdev_push_event(struct evdev_dev *, uint16_t, uint16_t, int32_t);

Modified: head/sys/dev/evdev/evdev_private.h
==
--- head/sys/dev/evdev/evdev_private.h  Mon Oct  3 16:47:46 2016
(r306646)
+++ head/sys/dev/evdev/evdev_private.h  Mon Oct  3 17:20:34 2016
(r306647)
@@ -116,7 +116,7 @@ struct evdev_dev
uint64_tev_report_count;
 
/* Parent driver callbacks: */
-   struct evdev_methods *  ev_methods;
+   const struct evdev_methods * ev_methods;
void *  ev_softc;
 
LIST_ENTRY(evdev_dev) ev_link;

Modified: head/sys/dev/usb/input/ukbd.c
==
--- head/sys/dev/usb/input/ukbd.c   Mon Oct  3 16:47:46 2016
(r306646)
+++ head/sys/dev/usb/input/ukbd.c   Mon Oct  3 17:20:34 2016
(r306647)
@@ -364,7 +364,7 @@ static device_detach_t ukbd_detach;
 static device_resume_t ukbd_resume;
 
 #ifdef EVDEV_SUPPORT
-static struct evdev_methods ukbd_evdev_methods = {
+static const struct evdev_methods ukbd_evdev_methods = {
.ev_event = evdev_ev_kbd_event,
 };
 #endif

Modified: head/sys/dev/usb/input/ums.c
==
--- head/sys/dev/usb/input/ums.cMon Oct  3 16:47:46 2016
(r306646)
+++ head/sys/dev/usb/input/ums.cMon Oct  3 17:20:34 2016
(r306647)
@@ -191,7 +191,7 @@ static struct usb_fifo_methods ums_fifo_
 };
 
 #ifdef EVDEV_SUPPORT
-static struct evdev_methods ums_evdev_methods = {
+static const struct evdev_methods ums_evdev_methods = {
.ev_open = _ev_open,
.ev_close = _ev_close,
 };
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r306646 - in head/sys/arm/allwinner: a20 a31 a83t h3

2016-10-03 Thread Andrew Turner
Author: andrew
Date: Mon Oct  3 16:47:46 2016
New Revision: 306646
URL: https://svnweb.freebsd.org/changeset/base/306646

Log:
  Remove the old Allwinner std.* files, these are not part of the common
  Allwinner kernel configs.
  
  Sponsored by: ABT Systems Ltd

Deleted:
  head/sys/arm/allwinner/a20/std.a20
  head/sys/arm/allwinner/a31/std.a31
  head/sys/arm/allwinner/a83t/std.a83t
  head/sys/arm/allwinner/h3/std.h3
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r306622 - head/usr.bin/mkimg

2016-10-03 Thread Marcel Moolenaar



On October 2, 2016 at 11:52:33 PM, Warner Losh (i...@bsdimp.com) wrote:

Wouldn't it be better to say at the top 

#ifndef OFF_MAX 
#define OFF_MAX INT64_MAX 
#endif 
Not sure. The max is just for input checking. We do not even try to deal with 
an lseek(2) implementation that doesn’t take a 64-bit offset argument. Granted, 
the use of OFF_MAX before was based on FreeBSD’s lseek(2) implementation and 
was chosen to match it, knowing very well that it has a 64-bit offset argument. 
If lseek(2) doesn’t take a 64-bit offset then mkimg(1) fails for images larger 
than 2GB, but the problems with that run deeper than the max capacity that a 
user can specify on the mkimg command line. Not using OFF_MAX is a clear 
indication that the limit is not fully determined by lseek(2), but to a greater 
extend by the datatype used to hold the capacity.

Hence by preference for going with INT64_MAX. Easy to change if people feel I 
should keep using OFF_MAX.




signature.asc
Description: Message signed with OpenPGP using AMPGpg


svn commit: r306645 - in head/sys: arm/arm arm/include conf

2016-10-03 Thread Andrew Turner
Author: andrew
Date: Mon Oct  3 16:10:38 2016
New Revision: 306645
URL: https://svnweb.freebsd.org/changeset/base/306645

Log:
  Remove unused functions on armv6. Some of the cache handling code is still
  used in the elf trampoline so add a macro to handle this.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/arm/cpufunc_asm_arm11.S
  head/sys/arm/arm/cpufunc_asm_arm11x6.S
  head/sys/arm/arm/cpufunc_asm_armv6.S
  head/sys/arm/arm/cpufunc_asm_armv7.S
  head/sys/arm/include/cpufunc.h
  head/sys/conf/Makefile.arm

Modified: head/sys/arm/arm/cpufunc_asm_arm11.S
==
--- head/sys/arm/arm/cpufunc_asm_arm11.SMon Oct  3 15:17:22 2016
(r306644)
+++ head/sys/arm/arm/cpufunc_asm_arm11.SMon Oct  3 16:10:38 2016
(r306645)
@@ -38,62 +38,6 @@
 __FBSDID("$FreeBSD$");
 
 /*
- * TLB functions
- */
-ENTRY(arm11_tlb_flushID_SE)
-   mcr p15, 0, r0, c8, c6, 1   /* flush D tlb single entry */
-   mcr p15, 0, r0, c8, c5, 1   /* flush I tlb single entry */
-   mcr p15, 0, r0, c7, c10, 4  /* drain write buffer */
-   RET
-END(arm11_tlb_flushID_SE)
-
-/*
- * Context switch.
- *
- * These is the CPU-specific parts of the context switcher cpu_switch()
- * These functions actually perform the TTB reload.
- *
- * NOTE: Special calling convention
- * r1, r4-r13 must be preserved
- */
-ENTRY(arm11_context_switch)
-   /*
-* We can assume that the caches will only contain kernel addresses
-* at this point.  So no need to flush them again.
-*/
-   mcr p15, 0, r0, c7, c10, 4  /* drain the write buffer */
-   mcr p15, 0, r0, c2, c0, 0   /* set the new TTB */
-   mcr p15, 0, r0, c8, c7, 0   /* and flush the I+D tlbs */
-
-   /* Paranoia -- make sure the pipeline is empty. */
-   nop
-   nop
-   nop
-   RET
-END(arm11_context_switch)
-
-/*
- * TLB functions
- */
-ENTRY(arm11_tlb_flushID)
-   mcr p15, 0, r0, c8, c7, 0   /* flush I+D tlb */
-   mcr p15, 0, r0, c7, c10, 4  /* drain write buffer */
-   mov pc, lr
-END(arm11_tlb_flushID)
-
-ENTRY(arm11_tlb_flushD)
-   mcr p15, 0, r0, c8, c6, 0   /* flush D tlb */
-   mcr p15, 0, r0, c7, c10, 4  /* drain write buffer */
-   mov pc, lr
-END(arm11_tlb_flushD)
-
-ENTRY(arm11_tlb_flushD_SE)
-   mcr p15, 0, r0, c8, c6, 1   /* flush D tlb single entry */
-   mcr p15, 0, r0, c7, c10, 4  /* drain write buffer */
-   mov pc, lr
-END(arm11_tlb_flushD_SE)
-
-/*
  * Other functions
  */
 ENTRY(arm11_drain_writebuf)

Modified: head/sys/arm/arm/cpufunc_asm_arm11x6.S
==
--- head/sys/arm/arm/cpufunc_asm_arm11x6.S  Mon Oct  3 15:17:22 2016
(r306644)
+++ head/sys/arm/arm/cpufunc_asm_arm11x6.S  Mon Oct  3 16:10:38 2016
(r306645)
@@ -64,55 +64,6 @@ __FBSDID("$FreeBSD$");
 
.cpu arm1176jz-s
 
-#if 0
-#define Invalidate_I_cache(Rtmp1, Rtmp2) \
-   mcr p15, 0, Rtmp1, c7, c5, 0/* Invalidate Entire I cache */
-#else
-/*
- * Workaround for
- *
- *Erratum 411920 in ARM1136 (fixed in r1p4)
- *Erratum 415045 in ARM1176 (fixed in r0p5?)
- *
- * - value of arg 'reg' Should Be Zero
- */
-#define Invalidate_I_cache(Rtmp1, Rtmp2) \
-   mov Rtmp1, #0;  /* SBZ */   \
-   mrs Rtmp2, cpsr;\
-   cpsid   ifa;\
-   mcr p15, 0, Rtmp1, c7, c5, 0;   /* Nuke Whole Icache */ \
-   mcr p15, 0, Rtmp1, c7, c5, 0;   /* Nuke Whole Icache */ \
-   mcr p15, 0, Rtmp1, c7, c5, 0;   /* Nuke Whole Icache */ \
-   mcr p15, 0, Rtmp1, c7, c5, 0;   /* Nuke Whole Icache */ \
-   msr cpsr_cx, Rtmp2; \
-   nop;\
-   nop;\
-   nop;\
-   nop;\
-   nop;\
-   nop;\
-   nop;\
-   nop;\
-   nop;\
-   nop;\
-   nop;
-#endif
-
-#if 1
-#define Flush_D_cache(reg) \
-   mov reg, #0;/* SBZ */   
\
-   mcr p15, 0, reg, c7, c14, 0;/* Clean and Invalidate Entire Data 
Cache */\
-   mcr p15, 0, reg, c7, 

Re: svn commit: r306622 - head/usr.bin/mkimg

2016-10-03 Thread Adrian Chadd
suggest it for the next C standard? :)


-a


On 2 October 2016 at 23:43, Ed Schouten  wrote:
> 2016-10-03 6:00 GMT+02:00 Marcel Moolenaar :
>> Log:
>>   Replace OFF_MAX with INT64_MAX. The former is defined on Linux.
>
> Blargh. If only C had std::numeric_limits::{min,max}. :-(
>
> --
> Ed Schouten 
> Nuxi, 's-Hertogenbosch, the Netherlands
> KvK-nr.: 62051717
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-10-03 Thread Andrew Turner
Author: andrew
Date: Mon Oct  3 14:43:57 2016
New Revision: 306641
URL: https://svnweb.freebsd.org/changeset/base/306641

Log:
  Remove the parts of cpu_functions from armv6 that are unused on that
  architecture.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/arm/cpufunc.c
  head/sys/arm/include/cpufunc.h

Modified: head/sys/arm/arm/cpufunc.c
==
--- head/sys/arm/arm/cpufunc.c  Mon Oct  3 14:26:55 2016(r306640)
+++ head/sys/arm/arm/cpufunc.c  Mon Oct  3 14:43:57 2016(r306641)
@@ -242,28 +242,11 @@ struct cpu_functions sheeva_cpufuncs = {
 
 #ifdef CPU_MV_PJ4B
 struct cpu_functions pj4bv7_cpufuncs = {
-   /* CPU functions */
-   .cf_cpwait = armv7_drain_writebuf,
-
/* MMU functions */
.cf_control = cpufunc_control,
.cf_setttb = armv7_setttb,
 
-   /* TLB functions */
-   .cf_tlb_flushID = armv7_tlb_flushID,
-   .cf_tlb_flushID_SE = armv7_tlb_flushID_SE,
-   .cf_tlb_flushD = armv7_tlb_flushID,
-   .cf_tlb_flushD_SE = armv7_tlb_flushID_SE,
-
/* Cache operations */
-   .cf_icache_sync_range = armv7_icache_sync_range,
-   .cf_dcache_wbinv_all = armv7_dcache_wbinv_all,
-   .cf_dcache_wbinv_range = armv7_dcache_wbinv_range,
-   .cf_dcache_inv_range = armv7_dcache_inv_range,
-   .cf_dcache_wb_range = armv7_dcache_wb_range,
-   .cf_idcache_inv_all = armv7_idcache_inv_all,
-   .cf_idcache_wbinv_all = armv7_idcache_wbinv_all,
-   .cf_idcache_wbinv_range = armv7_idcache_wbinv_range,
.cf_l2cache_wbinv_all = (void *)cpufunc_nullop,
.cf_l2cache_wbinv_range = (void *)cpufunc_nullop,
.cf_l2cache_inv_range = (void *)cpufunc_nullop,
@@ -275,7 +258,6 @@ struct cpu_functions pj4bv7_cpufuncs = {
.cf_sleep = (void *)cpufunc_nullop,
 
/* Soft functions */
-   .cf_context_switch = armv7_context_switch,
.cf_setup = pj4bv7_setup
 };
 #endif /* CPU_MV_PJ4B */
@@ -436,28 +418,11 @@ struct cpu_functions fa526_cpufuncs = {
 
 #if defined(CPU_ARM1176)
 struct cpu_functions arm1176_cpufuncs = {
-   /* CPU functions */
-   .cf_cpwait = cpufunc_nullop,
- 
/* MMU functions */
.cf_control = cpufunc_control,
.cf_setttb = arm11x6_setttb,
 
-   /* TLB functions */
-   .cf_tlb_flushID = arm11_tlb_flushID,
-   .cf_tlb_flushID_SE = arm11_tlb_flushID_SE,
-   .cf_tlb_flushD = arm11_tlb_flushD,
-   .cf_tlb_flushD_SE = arm11_tlb_flushD_SE,
-
/* Cache operations */
-   .cf_icache_sync_range = arm11x6_icache_sync_range,
-   .cf_dcache_wbinv_all = arm11x6_dcache_wbinv_all,
-   .cf_dcache_wbinv_range = armv6_dcache_wbinv_range,
-   .cf_dcache_inv_range = armv6_dcache_inv_range,
-   .cf_dcache_wb_range = armv6_dcache_wb_range,
-   .cf_idcache_inv_all = armv6_idcache_inv_all,
-   .cf_idcache_wbinv_all = arm11x6_idcache_wbinv_all,
-   .cf_idcache_wbinv_range = arm11x6_idcache_wbinv_range,
.cf_l2cache_wbinv_all = (void *)cpufunc_nullop,
.cf_l2cache_wbinv_range = (void *)cpufunc_nullop,
.cf_l2cache_inv_range = (void *)cpufunc_nullop,
@@ -469,40 +434,17 @@ struct cpu_functions arm1176_cpufuncs = 
.cf_sleep = arm11x6_sleep, 
 
/* Soft functions */
-   .cf_context_switch = arm11_context_switch,
.cf_setup = arm11x6_setup
 };
 #endif /*CPU_ARM1176 */
 
 #if defined(CPU_CORTEXA) || defined(CPU_KRAIT)
 struct cpu_functions cortexa_cpufuncs = {
-   /* CPU functions */
-   .cf_cpwait = cpufunc_nullop,
-
/* MMU functions */
.cf_control = cpufunc_control,
.cf_setttb = armv7_setttb,
 
-   /*
-* TLB functions.  ARMv7 does all TLB ops based on a unified TLB model
-* whether the hardware implements separate I+D or not, so we use the
-* same 'ID' functions for all 3 variations.
-*/
-
-   .cf_tlb_flushID = armv7_tlb_flushID,
-   .cf_tlb_flushID_SE = armv7_tlb_flushID_SE,
-   .cf_tlb_flushD = armv7_tlb_flushID,
-   .cf_tlb_flushD_SE = armv7_tlb_flushID_SE,
-
/* Cache operations */
-   .cf_icache_sync_range = armv7_icache_sync_range,
-   .cf_dcache_wbinv_all = armv7_dcache_wbinv_all,
-   .cf_dcache_wbinv_range = armv7_dcache_wbinv_range,
-   .cf_dcache_inv_range = armv7_dcache_inv_range,
-   .cf_dcache_wb_range = armv7_dcache_wb_range,
-   .cf_idcache_inv_all = armv7_idcache_inv_all,
-   .cf_idcache_wbinv_all = armv7_idcache_wbinv_all,
-   .cf_idcache_wbinv_range = armv7_idcache_wbinv_range,
 
/*
 * Note: For CPUs using the PL310 the L2 ops are filled in when the
@@ -519,7 +461,6 @@ struct cpu_functions cortexa_cpufuncs = 
.cf_sleep = armv7_cpu_sleep,
 
/* Soft functions */
-   .cf_context_switch = armv7_context_switch,
.cf_setup = cortexa_setup
 };
 #endif /* CPU_CORTEXA */

Modified: head/sys/arm/include/cpufunc.h

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

2016-10-03 Thread Andrew Turner
Author: andrew
Date: Mon Oct  3 14:26:55 2016
New Revision: 306640
URL: https://svnweb.freebsd.org/changeset/base/306640

Log:
  Only define the CF_* macros on ARMv4/v5. They are unused on armv6.
  
  Sponsored by: ABT Systems Ltd

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

Modified: head/sys/arm/arm/genassym.c
==
--- head/sys/arm/arm/genassym.c Mon Oct  3 14:18:13 2016(r306639)
+++ head/sys/arm/arm/genassym.c Mon Oct  3 14:26:55 2016(r306640)
@@ -92,11 +92,13 @@ ASSYM(M_DATA, offsetof(struct mbuf, m_da
 ASSYM(M_NEXT, offsetof(struct mbuf, m_next));
 ASSYM(IP_SRC, offsetof(struct ip, ip_src));
 ASSYM(IP_DST, offsetof(struct ip, ip_dst));
+#if __ARM_ARCH < 6
 ASSYM(CF_CONTEXT_SWITCH, offsetof(struct cpu_functions, cf_context_switch));
 ASSYM(CF_DCACHE_WB_RANGE, offsetof(struct cpu_functions, cf_dcache_wb_range));
 ASSYM(CF_IDCACHE_WBINV_ALL, offsetof(struct cpu_functions, 
cf_idcache_wbinv_all));
 ASSYM(CF_L2CACHE_WBINV_ALL, offsetof(struct cpu_functions, 
cf_l2cache_wbinv_all));
 ASSYM(CF_TLB_FLUSHID_SE, offsetof(struct cpu_functions, cf_tlb_flushID_SE));
+#endif
 
 ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
 ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r306638 - head/lib/libstand

2016-10-03 Thread Toomas Soome
Author: tsoome
Date: Mon Oct  3 14:07:15 2016
New Revision: 306638
URL: https://svnweb.freebsd.org/changeset/base/306638

Log:
  Fix remaining bugs in libstancd/cd9660.c reported by Bruce Evans.
  
  Fixed text in comments.
  
  Reported by:  Bruce Evans 
  Reviewed by:  allanjude
  Approved by:  allanjude (mentor)
  Differential Revision:https://reviews.freebsd.org/D8119

Modified:
  head/lib/libstand/cd9660.c

Modified: head/lib/libstand/cd9660.c
==
--- head/lib/libstand/cd9660.c  Mon Oct  3 13:23:43 2016(r306637)
+++ head/lib/libstand/cd9660.c  Mon Oct  3 14:07:15 2016(r306638)
@@ -353,9 +353,9 @@ cd9660_open(const char *path, struct ope
 
dp = (struct iso_directory_record *)
((char *) dp + isonum_711(dp->length));
-   /* if the new block is zero length, its padding */
+   /* If the new block has zero length, it is padding. */
if (isonum_711(dp->length) == 0) {
-   /* skip to next block, if any */
+   /* Skip to next block, if any. */
off = boff * ISO_DEFAULT_BLOCK_SIZE;
continue;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r306637 - head/sys/vm

2016-10-03 Thread Andrew Gallatin
Author: gallatin
Date: Mon Oct  3 13:23:43 2016
New Revision: 306637
URL: https://svnweb.freebsd.org/changeset/base/306637

Log:
  Conditionally move initial vfs bio alloc above 4G
  
  On machines with just the wrong amount of physical memory (enough to
  have a lot of bufs, but not enough to use VM_FREELIST_DMA32) it is
  possible for 32-bit address limited devices to have little to no
  memory left when attaching, due to potentially large vfs bio configs
  consuming all memory below 4GB not protected by VM_FREELIST_ISADMA.
  This causes the 32-bit devices to allocate from VM_FREELIST_ISADMA,
  leaving that freelist emtpy when ISA devices need DMAable memory.
  
  Rather than decrease VM_DMA32_NPAGES_THRESHOLD, use the time honored
  technique of putting initially allocated kernel data structs
  at the end (or at least not the beginning) of memory.
  
  Since this allocation is done at boot and is wired, is not freed,
  so the system is low on 32-bit (and ISA) dma'ble memory forever.
  So it is a good candidate to move above 4GB.
  
  While here, remove an unneeded round_page() from kmem_malloc's size
  argument as suggested by alc.  The first thing kmem_malloc() does
  is a round_page(size), so there is no need to do it before the call.
  
  Reviewed by: alc
  Sponsored by: Netflix

Modified:
  head/sys/vm/vm_init.c

Modified: head/sys/vm/vm_init.c
==
--- head/sys/vm/vm_init.c   Mon Oct  3 13:12:44 2016(r306636)
+++ head/sys/vm/vm_init.c   Mon Oct  3 13:23:43 2016(r306637)
@@ -206,8 +206,18 @@ again:
 */
if (firstaddr == 0) {
size = (vm_size_t)v;
-   firstaddr = kmem_malloc(kernel_arena, round_page(size),
-   M_ZERO | M_WAITOK);
+#ifdef VM_FREELIST_DMA32
+   /*
+* Try to protect 32-bit DMAable memory from the largest
+* early alloc of wired mem.
+*/
+   firstaddr = kmem_alloc_attr(kernel_arena, size,
+   M_ZERO | M_NOWAIT, (vm_paddr_t)1 << 32,
+   ~(vm_paddr_t)0, VM_MEMATTR_DEFAULT);
+   if (firstaddr == 0)
+#endif
+   firstaddr = kmem_malloc(kernel_arena, size,
+   M_ZERO | M_WAITOK);
if (firstaddr == 0)
panic("startup: no room for tables");
goto again;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r306636 - head/lib/libc/gen

2016-10-03 Thread Ed Maste
Author: emaste
Date: Mon Oct  3 13:12:44 2016
New Revision: 306636
URL: https://svnweb.freebsd.org/changeset/base/306636

Log:
  libc arc4_stir: use only kern.arandom sysctl
  
  The sysctl cannot fail. If it does fail on some FreeBSD derivative or
  after some future change, just abort() so that the problem will be found
  and fixed.
  
  It's preferable to provide an arc4random() function that cannot fail and
  cannot return poor quality random data. While abort() is not normally
  suitable for a library, it makes sense here.
  
  Reviewed by:  ed, jonathan, markm
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8077

Modified:
  head/lib/libc/gen/arc4random.c

Modified: head/lib/libc/gen/arc4random.c
==
--- head/lib/libc/gen/arc4random.c  Mon Oct  3 12:58:08 2016
(r306635)
+++ head/lib/libc/gen/arc4random.c  Mon Oct  3 13:12:44 2016
(r306636)
@@ -137,35 +137,17 @@ arc4_sysctl(u_char *buf, size_t size)
 static void
 arc4_stir(void)
 {
-   int done, fd, i;
-   struct {
-   struct timeval  tv;
-   pid_t   pid;
-   u_char  rnd[KEYSIZE];
-   } rdat;
+   u_char rdat[KEYSIZE];
+   int i;
 
if (!rs_initialized) {
arc4_init();
rs_initialized = 1;
}
-   done = 0;
-   if (arc4_sysctl((u_char *), KEYSIZE) == KEYSIZE)
-   done = 1;
-   if (!done) {
-   fd = _open(RANDOMDEV, O_RDONLY | O_CLOEXEC, 0);
-   if (fd >= 0) {
-   if (_read(fd, , KEYSIZE) == KEYSIZE)
-   done = 1;
-   (void)_close(fd);
-   }
-   }
-   if (!done) {
-   (void)gettimeofday(, NULL);
-   rdat.pid = getpid();
-   /* We'll just take whatever was on the stack too... */
-   }
+   if (arc4_sysctl(rdat, KEYSIZE) != KEYSIZE)
+   abort(); /* Random sysctl cannot fail. */
 
-   arc4_addrandom((u_char *), KEYSIZE);
+   arc4_addrandom(rdat, KEYSIZE);
 
/*
 * Discard early keystream, as per recommendations in:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r306634 - head/share/man/man9

2016-10-03 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Oct  3 12:48:55 2016
New Revision: 306634
URL: https://svnweb.freebsd.org/changeset/base/306634

Log:
  Change from passive to active english. Correctly specify that the task
  is being drained and not the queue.
  
  Submitted by: wblock @
  MFC after:3 days

Modified:
  head/share/man/man9/taskqueue.9

Modified: head/share/man/man9/taskqueue.9
==
--- head/share/man/man9/taskqueue.9 Mon Oct  3 12:13:40 2016
(r306633)
+++ head/share/man/man9/taskqueue.9 Mon Oct  3 12:48:55 2016
(r306634)
@@ -223,8 +223,8 @@ Otherwise, the task is scheduled for enq
 after the absolute value of
 .Va ticks
 is passed.
-This function will return -1 if the queue is being drained.
-Otherwise the number of pending calls will be returned.
+This function returns -1 if the task is being drained.
+Otherwise, the number of pending calls is returned.
 .Pp
 The
 .Fn taskqueue_cancel
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-10-03 Thread Andrew Turner
Author: andrew
Date: Mon Oct  3 11:57:10 2016
New Revision: 306631
URL: https://svnweb.freebsd.org/changeset/base/306631

Log:
  Use C99 designated initializers to create the armv6 cpu_functions structs.
  This will help with a later cleanup of what functions we implement.
  
  Sponsored by: ABT Systems Ltd

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

Modified: head/sys/arm/arm/cpufunc.c
==
--- head/sys/arm/arm/cpufunc.c  Mon Oct  3 10:15:16 2016(r306630)
+++ head/sys/arm/arm/cpufunc.c  Mon Oct  3 11:57:10 2016(r306631)
@@ -243,49 +243,40 @@ struct cpu_functions sheeva_cpufuncs = {
 #ifdef CPU_MV_PJ4B
 struct cpu_functions pj4bv7_cpufuncs = {
/* CPU functions */
-
-   armv7_drain_writebuf,   /* cpwait   */
+   .cf_cpwait = armv7_drain_writebuf,
 
/* MMU functions */
-
-   cpufunc_control,/* control  */
-   armv7_setttb,   /* Setttb   */
+   .cf_control = cpufunc_control,
+   .cf_setttb = armv7_setttb,
 
/* TLB functions */
-
-   armv7_tlb_flushID,  /* tlb_flushID  */
-   armv7_tlb_flushID_SE,   /* tlb_flushID_SE   */
-   armv7_tlb_flushID,  /* tlb_flushD   */
-   armv7_tlb_flushID_SE,   /* tlb_flushD_SE*/
+   .cf_tlb_flushID = armv7_tlb_flushID,
+   .cf_tlb_flushID_SE = armv7_tlb_flushID_SE,
+   .cf_tlb_flushD = armv7_tlb_flushID,
+   .cf_tlb_flushD_SE = armv7_tlb_flushID_SE,
 
/* Cache operations */
-   armv7_icache_sync_range,/* icache_sync_range*/
-
-   armv7_dcache_wbinv_all, /* dcache_wbinv_all */
-   armv7_dcache_wbinv_range,   /* dcache_wbinv_range   */
-   armv7_dcache_inv_range, /* dcache_inv_range */
-   armv7_dcache_wb_range,  /* dcache_wb_range  */
-
-   armv7_idcache_inv_all,  /* idcache_inv_all  */
-   armv7_idcache_wbinv_all,/* idcache_wbinv_all*/
-   armv7_idcache_wbinv_range,  /* idcache_wbinv_all*/
-
-   (void *)cpufunc_nullop, /* l2cache_wbinv_all*/
-   (void *)cpufunc_nullop, /* l2cache_wbinv_range  */
-   (void *)cpufunc_nullop, /* l2cache_inv_range*/
-   (void *)cpufunc_nullop, /* l2cache_wb_range */
-   (void *)cpufunc_nullop, /* l2cache_drain_writebuf */
+   .cf_icache_sync_range = armv7_icache_sync_range,
+   .cf_dcache_wbinv_all = armv7_dcache_wbinv_all,
+   .cf_dcache_wbinv_range = armv7_dcache_wbinv_range,
+   .cf_dcache_inv_range = armv7_dcache_inv_range,
+   .cf_dcache_wb_range = armv7_dcache_wb_range,
+   .cf_idcache_inv_all = armv7_idcache_inv_all,
+   .cf_idcache_wbinv_all = armv7_idcache_wbinv_all,
+   .cf_idcache_wbinv_range = armv7_idcache_wbinv_range,
+   .cf_l2cache_wbinv_all = (void *)cpufunc_nullop,
+   .cf_l2cache_wbinv_range = (void *)cpufunc_nullop,
+   .cf_l2cache_inv_range = (void *)cpufunc_nullop,
+   .cf_l2cache_wb_range = (void *)cpufunc_nullop,
+   .cf_l2cache_drain_writebuf = (void *)cpufunc_nullop,
 
/* Other functions */
-
-   armv7_drain_writebuf,   /* drain_writebuf   */
-
-   (void *)cpufunc_nullop, /* sleep*/
+   .cf_drain_writebuf = armv7_drain_writebuf,
+   .cf_sleep = (void *)cpufunc_nullop,
 
/* Soft functions */
-   armv7_context_switch,   /* context_switch   */
-
-   pj4bv7_setup/* cpu setup*/
+   .cf_context_switch = armv7_context_switch,
+   .cf_setup = pj4bv7_setup
 };
 #endif /* CPU_MV_PJ4B */
 
@@ -446,64 +437,51 @@ struct cpu_functions fa526_cpufuncs = {
 #if defined(CPU_ARM1176)
 struct cpu_functions arm1176_cpufuncs = {
/* CPU functions */
-
-   cpufunc_nullop, /* cpwait   */
-
+   .cf_cpwait = cpufunc_nullop,
+ 
/* MMU functions */
-
-   cpufunc_control,/* control  */
-   arm11x6_setttb, /* Setttb   */
+   .cf_control = cpufunc_control,
+   .cf_setttb = arm11x6_setttb,
 
/* TLB functions */
-
-   arm11_tlb_flushID,  /* tlb_flushID  */
-   arm11_tlb_flushID_SE,   /* tlb_flushID_SE   */
-   arm11_tlb_flushD,   /* tlb_flushD   */
-   arm11_tlb_flushD_SE,/* tlb_flushD_SE*/
+   .cf_tlb_flushID = arm11_tlb_flushID,
+   .cf_tlb_flushID_SE = arm11_tlb_flushID_SE,
+   .cf_tlb_flushD = arm11_tlb_flushD,
+   .cf_tlb_flushD_SE = arm11_tlb_flushD_SE,
 
/* Cache operations */
-
-   arm11x6_icache_sync_range,  /* icache_sync_range*/
-
-   arm11x6_dcache_wbinv_all,   /* dcache_wbinv_all */
-   

Re: svn commit: r306598 - head/sbin/ccdconfig

2016-10-03 Thread Konstantin Belousov
On Sun, Oct 02, 2016 at 11:19:05PM +, Sevan Janiyan wrote:
> Author: sevan (doc committer)
> Date: Sun Oct  2 23:19:05 2016
> New Revision: 306598
> URL: https://svnweb.freebsd.org/changeset/base/306598
> 
> Log:
>   ccdconfig first appeared in NetBSD 1.1
>   From NetBSD man page, confirmed with repo tags in CVS [1]
>   (there was also no 1.0a release according to [2])
>   
>   [1] http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/ccdconfig/ccdconfig.c
>   [2] http://netbsd.org/releases/formal.html#history
>   
>   PR: 212437
>   Approved by:bcr (mentor)
>   Obtained from:  NetBSD
>   MFC after:  4 days
>   Differential Revision:  https://reviews.freebsd.org/D8105
> 
> Modified:
>   head/sbin/ccdconfig/ccdconfig.8
Is ccd(4) still operational ?  I suspect that it is not, and that
sbin/ccdconfig and ccd(4) page should be removed.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r306622 - head/usr.bin/mkimg

2016-10-03 Thread Warner Losh
Wouldn't it be better to say at the top

#ifndef OFF_MAX
#define OFF_MAX INT64_MAX
#endif

On Mon, Oct 3, 2016 at 12:43 AM, Ed Schouten  wrote:
> 2016-10-03 6:00 GMT+02:00 Marcel Moolenaar :
>> Log:
>>   Replace OFF_MAX with INT64_MAX. The former is defined on Linux.
>
> Blargh. If only C had std::numeric_limits::{min,max}. :-(
>
> --
> Ed Schouten 
> Nuxi, 's-Hertogenbosch, the Netherlands
> KvK-nr.: 62051717
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r306622 - head/usr.bin/mkimg

2016-10-03 Thread Ed Schouten
2016-10-03 6:00 GMT+02:00 Marcel Moolenaar :
> Log:
>   Replace OFF_MAX with INT64_MAX. The former is defined on Linux.

Blargh. If only C had std::numeric_limits::{min,max}. :-(

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"