svn commit: r295877 - head/sys/dev/hyperv/netvsc

2016-02-21 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Feb 22 06:28:18 2016
New Revision: 295877
URL: https://svnweb.freebsd.org/changeset/base/295877

Log:
  hyperv/hn: Add TX method for txeof processing.
  
  Preamble to implement ifnet.if_transmit method.
  
  Reviewed by:  adrian
  Approved by:  adrian (mentor)
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D5346

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

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 22 06:22:47 2016
(r295876)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 22 06:28:18 2016
(r295877)
@@ -1026,9 +1026,10 @@ struct hn_tx_ring {
 #endif
int hn_txdesc_cnt;
int hn_txdesc_avail;
-   int hn_txeof;
+   int hn_has_txeof;
 
int hn_sched_tx;
+   void(*hn_txeof)(struct hn_tx_ring *);
struct taskqueue *hn_tx_taskq;
struct task hn_tx_task;
struct task hn_txeof_task;

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Mon Feb 22 06:22:47 
2016(r295876)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Mon Feb 22 06:28:18 
2016(r295877)
@@ -664,7 +664,7 @@ hn_tx_done(void *xpkt)
packet->compl.send.send_completion_tid;
 
txr = txd->txr;
-   txr->hn_txeof = 1;
+   txr->hn_has_txeof = 1;
hn_txdesc_put(txr, txd);
 }
 
@@ -684,11 +684,11 @@ netvsc_channel_rollup(struct hv_device *
}
 #endif
 
-   if (!txr->hn_txeof)
+   if (!txr->hn_has_txeof)
return;
 
-   txr->hn_txeof = 0;
-   hn_start_txeof(txr);
+   txr->hn_has_txeof = 0;
+   txr->hn_txeof(txr);
 }
 
 /*
@@ -976,12 +976,12 @@ again:
 * commands to run?  Ask netvsc_channel_rollup()
 * to kick start later.
 */
-   txr->hn_txeof = 1;
+   txr->hn_has_txeof = 1;
if (!send_failed) {
txr->hn_send_failed++;
send_failed = 1;
/*
-* Try sending again after set hn_txeof;
+* Try sending again after set hn_has_txeof;
 * in case that we missed the last
 * netvsc_channel_rollup().
 */
@@ -2111,6 +2111,8 @@ hn_create_tx_ring(struct hn_softc *sc, i
 */
txr->hn_sched_tx = 1;
 
+   txr->hn_txeof = hn_start_txeof; /* TODO: if_transmit */
+
parent_dtag = bus_get_dma_tag(sc->hn_dev);
 
/* DMA tag for RNDIS messages. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r295854 - head/bin/dd

2016-02-21 Thread Bruce Evans

On Sun, 21 Feb 2016, Edward Tomasz Napierala wrote:


Log:
 Make the "invalid numeric value" error message actually displayable
 (was a dead code before).

 Submitted by:  bde@ (earlier version)
 Reviewed by:   bde@


Thanks.


Modified:
 head/bin/dd/args.c

Modified: head/bin/dd/args.c
==
--- head/bin/dd/args.c  Sun Feb 21 13:54:22 2016(r295853)
+++ head/bin/dd/args.c  Sun Feb 21 14:36:50 2016(r295854)
@@ -422,11 +422,10 @@ get_num(const char *val)

errno = 0;
num = strtoumax(val, , 0);
-   if (errno != 0) /* Overflow or underflow. */
-   err(1, "%s", oper);
-
if (expr == val)/* No valid digits. */
-   errx(1, "%s: illegal numeric value", oper);
+   errx(1, "%s: invalid numeric value", oper);
+   if (errno != 0)
+   err(1, "%s", oper);

mult = postfix_to_mult(*expr);

...


This is to avoid the POSIX bug that the strto*() family "helpfully" sets
errno for cases not specified by C90, C99 or C11.  POSIX requires setting
errno to EINVAL if the base is unsupported or no conversion could be
performed.  The FreeBSD man page says that the conversion error is
unportable.  The base error is equally unportable, but the man page doesn't
mention it.  This breaks code like the above which depends on the Standard
C bhaviour of only setting errno to ERANGE.  The code happens to do a
generic check on errno first, and that prevents the more specific handling
for a conversion error from being reached.

Standard C in general allows errno to be clobbered on success, but for
functions that are documented to set errno like the strto*() family, it
intends to require only the documented settings.  The above code is an
example showing that settings to non-Standard C values are little different
from gratuitous clobbering.

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


svn commit: r295876 - head/sys/dev/hyperv/netvsc

2016-02-21 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Feb 22 06:22:47 2016
New Revision: 295876
URL: https://svnweb.freebsd.org/changeset/base/295876

Log:
  hyperv/hn: Staticize and rename packet TX done function
  
  It is only used in hv_netvsc_drv_freebsd.c; and rename it to hn_tx_done()
  mainly to reserve "xmit" for ifnet.if_transmit implement.
  
  While I'm here, remove unapplied comment.
  
  Reviewed by:  adrian
  Approved by:  adrian (mentor)
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D5345

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

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 22 06:17:26 2016
(r295875)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 22 06:22:47 2016
(r295876)
@@ -1086,7 +1086,6 @@ typedef struct hn_softc {
 extern int hv_promisc_mode;
 
 void netvsc_linkstatus_callback(struct hv_device *device_obj, uint32_t status);
-void netvsc_xmit_completion(void *context);
 void hv_nv_on_receive_completion(struct hv_device *device,
 uint64_t tid, uint32_t status);
 netvsc_dev *hv_nv_on_device_add(struct hv_device *device,

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Mon Feb 22 06:17:26 
2016(r295875)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Mon Feb 22 06:22:47 
2016(r295876)
@@ -653,17 +653,10 @@ hn_txdesc_hold(struct hn_txdesc *txd)
atomic_add_int(>refs, 1);
 }
 
-/*
- * Send completion processing
- *
- * Note:  It looks like offset 0 of buf is reserved to hold the softc
- * pointer.  The sc pointer is not currently needed in this function, and
- * it is not presently populated by the TX function.
- */
-void
-netvsc_xmit_completion(void *context)
+static void
+hn_tx_done(void *xpkt)
 {
-   netvsc_packet *packet = context;
+   netvsc_packet *packet = xpkt;
struct hn_txdesc *txd;
struct hn_tx_ring *txr;
 
@@ -905,7 +898,7 @@ done:
txd->m = m_head;
 
/* Set the completion routine */
-   packet->compl.send.on_send_completion = netvsc_xmit_completion;
+   packet->compl.send.on_send_completion = hn_tx_done;
packet->compl.send.send_completion_context = packet;
packet->compl.send.send_completion_tid = (uint64_t)(uintptr_t)txd;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295875 - head/sys/dev/hyperv/netvsc

2016-02-21 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Feb 22 06:17:26 2016
New Revision: 295875
URL: https://svnweb.freebsd.org/changeset/base/295875

Log:
  hyperv/hn: Rename TX related function and struct fields a bit
  
  Preamble to implement the ifnet.if_transmit method.
  
  Reviewed by:  adrian
  Approved by:  adrian (mentor)
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D5344

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

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 22 01:15:02 2016
(r295874)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 22 06:17:26 2016
(r295875)
@@ -1030,7 +1030,7 @@ struct hn_tx_ring {
 
int hn_sched_tx;
struct taskqueue *hn_tx_taskq;
-   struct task hn_start_task;
+   struct task hn_tx_task;
struct task hn_txeof_task;
 
struct mtx  hn_tx_lock;

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Mon Feb 22 01:15:02 
2016(r295874)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Mon Feb 22 06:17:26 
2016(r295875)
@@ -298,8 +298,8 @@ static int hn_create_tx_ring(struct hn_s
 static void hn_destroy_tx_ring(struct hn_tx_ring *);
 static int hn_create_tx_data(struct hn_softc *);
 static void hn_destroy_tx_data(struct hn_softc *);
-static void hn_start_taskfunc(void *xsc, int pending);
-static void hn_txeof_taskfunc(void *xsc, int pending);
+static void hn_start_taskfunc(void *, int);
+static void hn_start_txeof_taskfunc(void *, int);
 static void hn_stop_tx_tasks(struct hn_softc *);
 static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **);
 static void hn_create_rx_data(struct hn_softc *sc);
@@ -1555,7 +1555,7 @@ hn_start(struct ifnet *ifp)
return;
}
 do_sched:
-   taskqueue_enqueue(txr->hn_tx_taskq, >hn_start_task);
+   taskqueue_enqueue(txr->hn_tx_taskq, >hn_tx_task);
 }
 
 static void
@@ -1577,7 +1577,7 @@ hn_start_txeof(struct hn_tx_ring *txr)
mtx_unlock(>hn_tx_lock);
if (sched) {
taskqueue_enqueue(txr->hn_tx_taskq,
-   >hn_start_task);
+   >hn_tx_task);
}
} else {
 do_sched:
@@ -2103,8 +2103,8 @@ hn_create_tx_ring(struct hn_softc *sc, i
 #endif
 
txr->hn_tx_taskq = sc->hn_tx_taskq;
-   TASK_INIT(>hn_start_task, 0, hn_start_taskfunc, txr);
-   TASK_INIT(>hn_txeof_task, 0, hn_txeof_taskfunc, txr);
+   TASK_INIT(>hn_tx_task, 0, hn_start_taskfunc, txr);
+   TASK_INIT(>hn_txeof_task, 0, hn_start_txeof_taskfunc, txr);
 
txr->hn_direct_tx_size = hn_direct_tx_size;
if (hv_vmbus_protocal_version >= HV_VMBUS_VERSION_WIN8_1)
@@ -2399,7 +2399,7 @@ hn_start_taskfunc(void *xtxr, int pendin
 }
 
 static void
-hn_txeof_taskfunc(void *xtxr, int pending __unused)
+hn_start_txeof_taskfunc(void *xtxr, int pending __unused)
 {
struct hn_tx_ring *txr = xtxr;
 
@@ -2417,7 +2417,7 @@ hn_stop_tx_tasks(struct hn_softc *sc)
for (i = 0; i < sc->hn_tx_ring_cnt; ++i) {
struct hn_tx_ring *txr = >hn_tx_ring[i];
 
-   taskqueue_drain(txr->hn_tx_taskq, >hn_start_task);
+   taskqueue_drain(txr->hn_tx_taskq, >hn_tx_task);
taskqueue_drain(txr->hn_tx_taskq, >hn_txeof_task);
}
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r295864 - head/sys/kern

2016-02-21 Thread Bruce Evans

On Sun, 21 Feb 2016, Ian Lepore wrote:


Log:
 Allow a dynamic env to override a compiled-in static env by passing in the
 override indication in the env data.

 Submitted by:  bde


Thanks.

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


svn commit: r295874 - head/sys/dev/usb/wlan

2016-02-21 Thread Andriy Voskoboinyk
Author: avos
Date: Mon Feb 22 01:15:02 2016
New Revision: 295874
URL: https://svnweb.freebsd.org/changeset/base/295874

Log:
  urtwn: shutdown the device properly
  
  - R92C path: NetBSD (mostly)
  - R88E path: TP-Link driver
  
  Tested with RTL8188EU and RTL8188CUS.
  
  Reviewed by:  kevlo
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D5198

Modified:
  head/sys/dev/usb/wlan/if_urtwn.c
  head/sys/dev/usb/wlan/if_urtwnreg.h
  head/sys/dev/usb/wlan/if_urtwnvar.h

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==
--- head/sys/dev/usb/wlan/if_urtwn.cMon Feb 22 00:58:04 2016
(r295873)
+++ head/sys/dev/usb/wlan/if_urtwn.cMon Feb 22 01:15:02 2016
(r295874)
@@ -308,6 +308,8 @@ static void urtwn_start(struct urtwn_so
 static voidurtwn_parent(struct ieee80211com *);
 static int urtwn_r92c_power_on(struct urtwn_softc *);
 static int urtwn_r88e_power_on(struct urtwn_softc *);
+static voidurtwn_r92c_power_off(struct urtwn_softc *);
+static voidurtwn_r88e_power_off(struct urtwn_softc *);
 static int urtwn_llt_init(struct urtwn_softc *);
 #ifndef URTWN_WITHOUT_UCODE
 static voidurtwn_fw_reset(struct urtwn_softc *);
@@ -1782,6 +1784,7 @@ urtwn_read_rom(struct urtwn_softc *sc)
 
sc->sc_rf_write = urtwn_r92c_rf_write;
sc->sc_power_on = urtwn_r92c_power_on;
+   sc->sc_power_off = urtwn_r92c_power_off;
 
return (0);
 }
@@ -1809,6 +1812,7 @@ urtwn_r88e_read_rom(struct urtwn_softc *
 
sc->sc_rf_write = urtwn_r88e_rf_write;
sc->sc_power_on = urtwn_r88e_power_on;
+   sc->sc_power_off = urtwn_r88e_power_off;
 
return (0);
 }
@@ -3235,7 +3239,7 @@ urtwn_r88e_power_on(struct urtwn_softc *
 
/* Enable LDO normal mode. */
error = urtwn_write_1(sc, R92C_LPLDO_CTRL,
-   urtwn_read_1(sc, R92C_LPLDO_CTRL) & ~0x10);
+   urtwn_read_1(sc, R92C_LPLDO_CTRL) & ~R92C_LPLDO_CTRL_SLEEP);
if (error != USB_ERR_NORMAL_COMPLETION)
return (EIO);
 
@@ -3254,6 +3258,269 @@ urtwn_r88e_power_on(struct urtwn_softc *
return (0);
 }
 
+static __inline void
+urtwn_power_off(struct urtwn_softc *sc)
+{
+
+   return sc->sc_power_off(sc);
+}
+
+static void
+urtwn_r92c_power_off(struct urtwn_softc *sc)
+{
+   uint32_t reg;
+
+   /* Block all Tx queues. */
+   urtwn_write_1(sc, R92C_TXPAUSE, R92C_TX_QUEUE_ALL);
+
+   /* Disable RF */
+   urtwn_rf_write(sc, 0, 0, 0);
+
+   urtwn_write_1(sc, R92C_APSD_CTRL, R92C_APSD_CTRL_OFF);
+
+   /* Reset BB state machine */
+   urtwn_write_1(sc, R92C_SYS_FUNC_EN,
+   R92C_SYS_FUNC_EN_USBD | R92C_SYS_FUNC_EN_USBA |
+   R92C_SYS_FUNC_EN_BB_GLB_RST);
+   urtwn_write_1(sc, R92C_SYS_FUNC_EN,
+   R92C_SYS_FUNC_EN_USBD | R92C_SYS_FUNC_EN_USBA);
+
+   /*
+* Reset digital sequence
+*/
+#ifndef URTWN_WITHOUT_UCODE
+   if (urtwn_read_1(sc, R92C_MCUFWDL) & R92C_MCUFWDL_RDY) {
+   /* Reset MCU ready status */
+   urtwn_write_1(sc, R92C_MCUFWDL, 0);
+
+   /* If firmware in ram code, do reset */
+   urtwn_fw_reset(sc);
+   }
+#endif
+
+   /* Reset MAC and Enable 8051 */
+   urtwn_write_1(sc, R92C_SYS_FUNC_EN + 1,
+   (R92C_SYS_FUNC_EN_CPUEN |
+R92C_SYS_FUNC_EN_ELDR |
+R92C_SYS_FUNC_EN_HWPDN) >> 8);
+
+   /* Reset MCU ready status */
+   urtwn_write_1(sc, R92C_MCUFWDL, 0);
+
+   /* Disable MAC clock */
+   urtwn_write_2(sc, R92C_SYS_CLKR,
+   R92C_SYS_CLKR_ANAD16V_EN |
+   R92C_SYS_CLKR_ANA8M |
+   R92C_SYS_CLKR_LOADER_EN | 
+   R92C_SYS_CLKR_80M_SSC_DIS |
+   R92C_SYS_CLKR_SYS_EN |
+   R92C_SYS_CLKR_RING_EN |
+   0x4000);
+
+   /* Disable AFE PLL */
+   urtwn_write_1(sc, R92C_AFE_PLL_CTRL, 0x80);
+
+   /* Gated AFE DIG_CLOCK */
+   urtwn_write_2(sc, R92C_AFE_XTAL_CTRL, 0x880F);
+
+   /* Isolated digital to PON */
+   urtwn_write_1(sc, R92C_SYS_ISO_CTRL,
+   R92C_SYS_ISO_CTRL_MD2PP |
+   R92C_SYS_ISO_CTRL_PA2PCIE |
+   R92C_SYS_ISO_CTRL_PD2CORE |
+   R92C_SYS_ISO_CTRL_IP2MAC |
+   R92C_SYS_ISO_CTRL_DIOP |
+   R92C_SYS_ISO_CTRL_DIOE);
+
+   /*
+* Pull GPIO PIN to balance level and LED control
+*/
+   /* 1. Disable GPIO[7:0] */
+   urtwn_write_2(sc, R92C_GPIO_IOSEL, 0x);
+
+   reg = urtwn_read_4(sc, R92C_GPIO_PIN_CTRL) & ~0xff00;
+   reg |= ((reg << 8) & 0xff00) | 0x00ff;
+   urtwn_write_4(sc, R92C_GPIO_PIN_CTRL, reg);
+
+   /* Disable GPIO[10:8] */
+   urtwn_write_1(sc, R92C_MAC_PINMUX_CFG, 0x00);
+
+   reg = urtwn_read_2(sc, R92C_GPIO_IO_SEL) & ~0x00f0;
+   reg |= (((reg & 0x000f) << 4) | 0x0780);
+   

svn commit: r295873 - in head/sys/dev: msk sk

2016-02-21 Thread Pyun YongHyeon
Author: yongari
Date: Mon Feb 22 00:58:04 2016
New Revision: 295873
URL: https://svnweb.freebsd.org/changeset/base/295873

Log:
  ifnet lock was changed to use sx(9) long time ago.
  Don't hold a driver lock for if_free(9).

Modified:
  head/sys/dev/msk/if_msk.c
  head/sys/dev/sk/if_sk.c

Modified: head/sys/dev/msk/if_msk.c
==
--- head/sys/dev/msk/if_msk.c   Mon Feb 22 00:49:35 2016(r295872)
+++ head/sys/dev/msk/if_msk.c   Mon Feb 22 00:58:04 2016(r295873)
@@ -2059,11 +2059,11 @@ msk_detach(device_t dev)
msk_txrx_dma_free(sc_if);
bus_generic_detach(dev);
 
-   if (ifp)
-   if_free(ifp);
sc = sc_if->msk_softc;
sc->msk_if[sc_if->msk_port] = NULL;
MSK_IF_UNLOCK(sc_if);
+   if (ifp)
+   if_free(ifp);
 
return (0);
 }

Modified: head/sys/dev/sk/if_sk.c
==
--- head/sys/dev/sk/if_sk.c Mon Feb 22 00:49:35 2016(r295872)
+++ head/sys/dev/sk/if_sk.c Mon Feb 22 00:58:04 2016(r295873)
@@ -1833,8 +1833,6 @@ sk_detach(dev)
ether_ifdetach(ifp);
SK_IF_LOCK(sc_if);
}
-   if (ifp)
-   if_free(ifp);
/*
 * We're generally called from skc_detach() which is using
 * device_delete_child() to get to here. It's already trashed
@@ -1848,6 +1846,8 @@ sk_detach(dev)
sk_dma_jumbo_free(sc_if);
sk_dma_free(sc_if);
SK_IF_UNLOCK(sc_if);
+   if (ifp)
+   if_free(ifp);
 
return(0);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295872 - in stable/10/sys/boot/efi: include loader/arch/amd64

2016-02-21 Thread Marius Strobl
Author: marius
Date: Mon Feb 22 00:49:35 2016
New Revision: 295872
URL: https://svnweb.freebsd.org/changeset/base/295872

Log:
  MFC: r287299 [1]
  
  Add a gop command to help diagnose VT efifb problems. The gop
  command has the following sub-commands:
list- list all possible modes (paged)
get - return the current mode
set   - set the current mode to 
  
  MFC: r287317, r287422, r287475, r287489, r287538 [2]
  
  Add support for the UGA draw protocol. This includes adding a
  command called 'uga' to show whether UGA is implemented by the
  firmware and what the settings are. It also includes filling
  the efi_fb structure from the UGA information when GOP isn't
  implemented by the firmware.
  
  PR:   207313 [1], 202730 [2]
  Approved by:  re (gjb)

Added:
  stable/10/sys/boot/efi/include/efipciio.h
 - copied, changed from r287317, head/sys/boot/efi/include/efipciio.h
  stable/10/sys/boot/efi/include/efiuga.h
 - copied, changed from r287317, head/sys/boot/efi/include/efiuga.h
Modified:
  stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c
Directory Properties:
  stable/10/   (props changed)

Copied and modified: stable/10/sys/boot/efi/include/efipciio.h (from r287317, 
head/sys/boot/efi/include/efipciio.h)
==
--- head/sys/boot/efi/include/efipciio.hSun Aug 30 23:58:53 2015
(r287317, copy source)
+++ stable/10/sys/boot/efi/include/efipciio.h   Mon Feb 22 00:49:35 2016
(r295872)
@@ -21,9 +21,7 @@
 /// Global ID for the PCI I/O Protocol
 ///
 #define EFI_PCI_IO_PROTOCOL_GUID \
-  { \
-0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a 
} \
-  }
+{ 0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 
0x9a} }
 
 typedef struct _EFI_PCI_IO_PROTOCOL  EFI_PCI_IO_PROTOCOL;
 

Copied and modified: stable/10/sys/boot/efi/include/efiuga.h (from r287317, 
head/sys/boot/efi/include/efiuga.h)
==
--- head/sys/boot/efi/include/efiuga.h  Sun Aug 30 23:58:53 2015
(r287317, copy source)
+++ stable/10/sys/boot/efi/include/efiuga.h Mon Feb 22 00:49:35 2016
(r295872)
@@ -22,9 +22,7 @@
 #define __UGA_DRAW_H__
 
 #define EFI_UGA_DRAW_PROTOCOL_GUID \
-  { \
-0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 
0x39 } \
-  }
+{ 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 
0x39} }
 
 typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
 

Modified: stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c
==
--- stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c  Mon Feb 22 
00:48:53 2016(r295871)
+++ stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c  Mon Feb 22 
00:49:35 2016(r295872)
@@ -29,38 +29,45 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
+#include 
 #include 
 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include "framebuffer.h"
 
 static EFI_GUID gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
+static EFI_GUID pciio_guid = EFI_PCI_IO_PROTOCOL_GUID;
+static EFI_GUID uga_guid = EFI_UGA_DRAW_PROTOCOL_GUID;
 
-int
-efi_find_framebuffer(struct efi_fb *efifb)
+static u_int
+efifb_color_depth(struct efi_fb *efifb)
 {
-   EFI_GRAPHICS_OUTPUT *gop;
-   EFI_STATUS  status;
-   EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE   *mode;
-   EFI_GRAPHICS_OUTPUT_MODE_INFORMATION*info;
+   uint32_t mask;
+   u_int depth;
 
-   status = BS->LocateProtocol(_guid, NULL, (VOID **));
-   if (EFI_ERROR(status))
-   return (1);
-
-   mode = gop->Mode;
-   info = gop->Mode->Info;
+   mask = efifb->fb_mask_red | efifb->fb_mask_green |
+   efifb->fb_mask_blue | efifb->fb_mask_reserved;
+   if (mask == 0)
+   return (0);
+   for (depth = 1; mask != 1; depth++)
+   mask >>= 1;
+   return (depth);
+}
 
-   efifb->fb_addr = mode->FrameBufferBase;
-   efifb->fb_size = mode->FrameBufferSize;
-   efifb->fb_height = info->VerticalResolution;
-   efifb->fb_width = info->HorizontalResolution;
-   efifb->fb_stride = info->PixelsPerScanLine;
+static int
+efifb_mask_from_pixfmt(struct efi_fb *efifb, EFI_GRAPHICS_PIXEL_FORMAT pixfmt,
+EFI_PIXEL_BITMASK *pixinfo)
+{
+   int result;
 
-   switch (info->PixelFormat) {
+   result = 0;
+   switch (pixfmt) {
case PixelRedGreenBlueReserved8BitPerColor:
efifb->fb_mask_red = 0x00ff;
efifb->fb_mask_green = 0xff00;
@@ -74,14 +81,486 @@ efi_find_framebuffer(struct efi_fb *efif
efifb->fb_mask_reserved = 0xff00;
break;
case PixelBitMask:
-   efifb->fb_mask_red = 

svn commit: r295871 - in head/sys: conf dev/usb/wlan modules/usb modules/usb/urtwn

2016-02-21 Thread Andriy Voskoboinyk
Author: avos
Date: Mon Feb 22 00:48:53 2016
New Revision: 295871
URL: https://svnweb.freebsd.org/changeset/base/295871

Log:
  urtwn: add an option to compile the driver without firmware specific code
  
  - Add URTWN_WITHOUT_UCODE option (will disable any firmware specific code
  when set).
  - Do not exclude the driver from build when MK_SOURCELESS_UCODE is set
  (URTWN_WITHOUT_UCODE will be enforced unconditionally).
  - Do not abort initialization when firmware cannot be loaded;
  behave like the URTWN_WITHOUT_UCODE option was set.
  - Drop some unused variables from urtwn_softc structure.
  
  Tested with RTL8188EU and RTL8188CUS in HOSTAP and STA modes.
  
  Reviewed by:  kevlo
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D4849

Modified:
  head/sys/conf/options
  head/sys/dev/usb/wlan/if_urtwn.c
  head/sys/dev/usb/wlan/if_urtwnvar.h
  head/sys/modules/usb/Makefile
  head/sys/modules/usb/urtwn/Makefile

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Sun Feb 21 22:34:09 2016(r295870)
+++ head/sys/conf/options   Mon Feb 22 00:48:53 2016(r295871)
@@ -673,6 +673,9 @@ UPLCOM_INTR_INTERVALopt_uplcom.h
 UVSCOM_DEFAULT_OPKTSIZEopt_uvscom.h
 UVSCOM_INTR_INTERVAL   opt_uvscom.h
 
+# options for the Realtek RTL8188*U/RTL8192CU driver (urtwn)
+URTWN_WITHOUT_UCODEopt_urtwn.h
+
 # Embedded system options
 INIT_PATH
 

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==
--- head/sys/dev/usb/wlan/if_urtwn.cSun Feb 21 22:34:09 2016
(r295870)
+++ head/sys/dev/usb/wlan/if_urtwn.cMon Feb 22 00:48:53 2016
(r295871)
@@ -26,6 +26,7 @@ __FBSDID("$FreeBSD$");
  */
 
 #include "opt_wlan.h"
+#include "opt_urtwn.h"
 
 #include 
 #include 
@@ -308,11 +309,13 @@ static void   urtwn_parent(struct ieee802
 static int urtwn_r92c_power_on(struct urtwn_softc *);
 static int urtwn_r88e_power_on(struct urtwn_softc *);
 static int urtwn_llt_init(struct urtwn_softc *);
+#ifndef URTWN_WITHOUT_UCODE
 static voidurtwn_fw_reset(struct urtwn_softc *);
 static voidurtwn_r88e_fw_reset(struct urtwn_softc *);
 static int urtwn_fw_loadpage(struct urtwn_softc *, int,
const uint8_t *, int);
 static int urtwn_load_firmware(struct urtwn_softc *);
+#endif
 static int urtwn_dma_init(struct urtwn_softc *);
 static int urtwn_mac_init(struct urtwn_softc *);
 static voidurtwn_bb_init(struct urtwn_softc *);
@@ -1376,6 +1379,13 @@ urtwn_fw_cmd(struct urtwn_softc *sc, uin
usb_error_t error;
int ntries;
 
+   if (!(sc->sc_flags & URTWN_FW_LOADED)) {
+   URTWN_DPRINTF(sc, URTWN_DEBUG_FIRMWARE, "%s: firmware "
+   "was not loaded; command (id %d) will be discarded\n",
+   __func__, id);
+   return (0);
+   }
+
/* Wait for current FW box to be empty. */
for (ntries = 0; ntries < 100; ntries++) {
if (!(urtwn_read_1(sc, R92C_HMETFR) & (1 << sc->fwcur)))
@@ -3275,6 +3285,7 @@ urtwn_llt_init(struct urtwn_softc *sc)
return (error);
 }
 
+#ifndef URTWN_WITHOUT_UCODE
 static void
 urtwn_fw_reset(struct urtwn_softc *sc)
 {
@@ -3457,6 +3468,7 @@ fail:
firmware_put(fw, FIRMWARE_UNLOAD);
return (error);
 }
+#endif
 
 static int
 urtwn_dma_init(struct urtwn_softc *sc)
@@ -4786,10 +4798,12 @@ urtwn_init(struct urtwn_softc *sc)
urtwn_write_1(sc, R92C_BCN_MAX_ERR, 0xff);
}
 
+#ifndef URTWN_WITHOUT_UCODE
/* Load 8051 microcode. */
error = urtwn_load_firmware(sc);
-   if (error != 0)
-   goto fail;
+   if (error == 0)
+   sc->sc_flags |= URTWN_FW_LOADED;
+#endif
 
/* Initialize MAC/BB/RF blocks. */
error = urtwn_mac_init(sc);
@@ -4892,7 +4906,8 @@ urtwn_stop(struct urtwn_softc *sc)
return;
}
 
-   sc->sc_flags &= ~(URTWN_RUNNING | URTWN_TEMP_MEASURED);
+   sc->sc_flags &= ~(URTWN_RUNNING | URTWN_FW_LOADED |
+   URTWN_TEMP_MEASURED);
sc->thcal_lctemp = 0;
callout_stop(>sc_watchdog_ch);
urtwn_abort_xfers(sc);
@@ -4991,6 +5006,8 @@ static devclass_t urtwn_devclass;
 DRIVER_MODULE(urtwn, uhub, urtwn_driver, urtwn_devclass, NULL, NULL);
 MODULE_DEPEND(urtwn, usb, 1, 1, 1);
 MODULE_DEPEND(urtwn, wlan, 1, 1, 1);
+#ifndef URTWN_WITHOUT_UCODE
 MODULE_DEPEND(urtwn, firmware, 1, 1, 1);
+#endif
 MODULE_VERSION(urtwn, 1);
 USB_PNP_HOST_INFO(urtwn_devs);

Modified: head/sys/dev/usb/wlan/if_urtwnvar.h
==
--- head/sys/dev/usb/wlan/if_urtwnvar.h Sun Feb 21 22:34:09 2016
(r295870)
+++ 

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-21 Thread Alan Somers
On Sun, Feb 21, 2016 at 3:00 PM, Andrew Turner  wrote:
> On Thu, 18 Feb 2016 20:08:01 + (UTC)
> Alan Somers  wrote:
>
>> Author: asomers
>> Date: Thu Feb 18 20:08:01 2016
>> New Revision: 295768
>> URL: https://svnweb.freebsd.org/changeset/base/295768
>>
>> Log:
>>   Fix compiler warnings in iostat
>>
>>   Raise WARNS from 1 to 6 (the default)
>
> This breaks building with gcc:
>

I'll fix it in the morning.  Thanks for reporting it.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295870 - stable/10/sys/kern

2016-02-21 Thread Marius Strobl
Author: marius
Date: Sun Feb 21 22:34:09 2016
New Revision: 295870
URL: https://svnweb.freebsd.org/changeset/base/295870

Log:
  MFC: r264565
  
  Do not set M_BESTFIT if a strategy has already been provided.  This
  fixes problems when using M_FIRSTFIT.
  
  MFC: r280805
  
  Add four new DDB commands to display vmem(9) statistics.
  
  In particular, such DDB commands were added:
  show vmem 
  show all vmem
  show vmemdump 
  show all vmemdump
  
  As possible usage, that allows to see KVA usage and fragmentation.
  
  Approved by:  re (gjb)

Modified:
  stable/10/sys/kern/subr_vmem.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/subr_vmem.c
==
--- stable/10/sys/kern/subr_vmem.c  Sun Feb 21 21:20:23 2016
(r295869)
+++ stable/10/sys/kern/subr_vmem.c  Sun Feb 21 22:34:09 2016
(r295870)
@@ -502,7 +502,8 @@ qc_import(void *arg, void **store, int c
int i;
 
qc = arg;
-   flags |= M_BESTFIT;
+   if ((flags & VMEM_FITMASK) == 0)
+   flags |= M_BESTFIT;
for (i = 0; i < cnt; i++) {
if (vmem_xalloc(qc->qc_vmem, qc->qc_size, 0, 0, 0,
VMEM_ADDR_MIN, VMEM_ADDR_MAX, flags, ) != 0)
@@ -1407,6 +1408,8 @@ vmem_dump(const vmem_t *vm , int (*pr)(c
 #endif /* defined(DDB) || defined(DIAGNOSTIC) */
 
 #if defined(DDB)
+#include 
+
 static bt_t *
 vmem_whatis_lookup(vmem_t *vm, vmem_addr_t addr)
 {
@@ -1460,6 +1463,78 @@ vmem_print(vmem_addr_t addr, const char 
 
vmem_dump(vm, pr);
 }
+
+DB_SHOW_COMMAND(vmemdump, vmemdump)
+{
+
+   if (!have_addr) {
+   db_printf("usage: show vmemdump \n");
+   return;
+   }
+
+   vmem_dump((const vmem_t *)addr, db_printf);
+}
+
+DB_SHOW_ALL_COMMAND(vmemdump, vmemdumpall)
+{
+   const vmem_t *vm;
+
+   LIST_FOREACH(vm, _list, vm_alllist)
+   vmem_dump(vm, db_printf);
+}
+
+DB_SHOW_COMMAND(vmem, vmem_summ)
+{
+   const vmem_t *vm = (const void *)addr;
+   const bt_t *bt;
+   size_t ft[VMEM_MAXORDER], ut[VMEM_MAXORDER];
+   size_t fs[VMEM_MAXORDER], us[VMEM_MAXORDER];
+   int ord;
+
+   if (!have_addr) {
+   db_printf("usage: show vmem \n");
+   return;
+   }
+
+   db_printf("vmem %p '%s'\n", vm, vm->vm_name);
+   db_printf("\tquantum:\t%zu\n", vm->vm_quantum_mask + 1);
+   db_printf("\tsize:\t%zu\n", vm->vm_size);
+   db_printf("\tinuse:\t%zu\n", vm->vm_inuse);
+   db_printf("\tfree:\t%zu\n", vm->vm_size - vm->vm_inuse);
+   db_printf("\tbusy tags:\t%d\n", vm->vm_nbusytag);
+   db_printf("\tfree tags:\t%d\n", vm->vm_nfreetags);
+
+   memset(, 0, sizeof(ft));
+   memset(, 0, sizeof(ut));
+   memset(, 0, sizeof(fs));
+   memset(, 0, sizeof(us));
+   TAILQ_FOREACH(bt, >vm_seglist, bt_seglist) {
+   ord = SIZE2ORDER(bt->bt_size >> vm->vm_quantum_shift);
+   if (bt->bt_type == BT_TYPE_BUSY) {
+   ut[ord]++;
+   us[ord] += bt->bt_size;
+   } else if (bt->bt_type == BT_TYPE_FREE) {
+   ft[ord]++;
+   fs[ord] += bt->bt_size;
+   }
+   }
+   db_printf("\t\t\tinuse\tsize\t\tfree\tsize\n");
+   for (ord = 0; ord < VMEM_MAXORDER; ord++) {
+   if (ut[ord] == 0 && ft[ord] == 0)
+   continue;
+   db_printf("\t%-15zu %zu\t%-15zu %zu\t%-16zu\n",
+   ORDER2SIZE(ord) << vm->vm_quantum_shift,
+   ut[ord], us[ord], ft[ord], fs[ord]);
+   }
+}
+
+DB_SHOW_ALL_COMMAND(vmem, vmem_summall)
+{
+   const vmem_t *vm;
+
+   LIST_FOREACH(vm, _list, vm_alllist)
+   vmem_summ((db_expr_t)vm, TRUE, count, modif);
+}
 #endif /* defined(DDB) */
 
 #define vmem_printf printf
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-21 Thread Andrew Turner
On Thu, 18 Feb 2016 20:08:01 + (UTC)
Alan Somers  wrote:

> Author: asomers
> Date: Thu Feb 18 20:08:01 2016
> New Revision: 295768
> URL: https://svnweb.freebsd.org/changeset/base/295768
> 
> Log:
>   Fix compiler warnings in iostat
>   
>   Raise WARNS from 1 to 6 (the default)

This breaks building with gcc:

===> usr.sbin/ifmcstat (all)
===> usr.sbin/iostat (all)
cc1: warnings being treated as errors
/scratch/tmp/andrew/head-git/usr.sbin/iostat/iostat.c: In function 'devstats':
/scratch/tmp/andrew/head-git/usr.sbin/iostat/iostat.c:800: warning: declaration 
of 'devname' shadows a global declaration
/scratch/tmp/andrew/obj/powerpc.powerpc/scratch/tmp/andrew/head-git/tmp/usr/include/stdlib.h:282:
 warning: shadowed declaration is here
/scratch/tmp/andrew/head-git/usr.sbin/iostat/iostat.c: In function 'cpustats':
/scratch/tmp/andrew/head-git/usr.sbin/iostat/iostat.c:982: warning: declaration 
of 'time' shadows a global declaration
/scratch/tmp/andrew/obj/powerpc.powerpc/scratch/tmp/andrew/head-git/tmp/usr/include/time.h:154:
 warning: shadowed declaration is here
*** Error code 1

Stop.
make[4]: stopped in /scratch/tmp/andrew/head-git/usr.sbin/iostat
*** Error code 1

Stop.
make[3]: stopped in /scratch/tmp/andrew/head-git/usr.sbin
*** Error code 1

Stop.
make[2]: stopped in /scratch/tmp/andrew/head-git
*** Error code 1

Stop.
make[1]: stopped in /scratch/tmp/andrew/head-git
*** Error code 1

Stop.
make: stopped in /scratch/tmp/andrew/head-git

-Wshadow is added to the warning flags with WARNS >= 4.

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


svn commit: r295869 - in head/sys/boot/efi: include libefi

2016-02-21 Thread Andrew Turner
Author: andrew
Date: Sun Feb 21 21:20:23 2016
New Revision: 295869
URL: https://svnweb.freebsd.org/changeset/base/295869

Log:
  Make efi_time and EFI_GetTimeOfDay static, neither are used by other parts
  of the efi code.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/boot/efi/include/efilib.h
  head/sys/boot/efi/libefi/time.c

Modified: head/sys/boot/efi/include/efilib.h
==
--- head/sys/boot/efi/include/efilib.h  Sun Feb 21 20:58:24 2016
(r295868)
+++ head/sys/boot/efi/include/efilib.h  Sun Feb 21 21:20:23 2016
(r295869)
@@ -46,7 +46,6 @@ int efi_handle_lookup(EFI_HANDLE, struct
 int efi_handle_update_dev(EFI_HANDLE, struct devsw *, int, uint64_t);
 
 int efi_status_to_errno(EFI_STATUS);
-time_t efi_time(EFI_TIME *);
 
 EFI_STATUS main(int argc, CHAR16 *argv[]);
 void exit(EFI_STATUS status);

Modified: head/sys/boot/efi/libefi/time.c
==
--- head/sys/boot/efi/libefi/time.c Sun Feb 21 20:58:24 2016
(r295868)
+++ head/sys/boot/efi/libefi/time.c Sun Feb 21 21:20:23 2016
(r295869)
@@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
 #define SECSPERHOUR ( 60*60 )
 #define SECSPERDAY (24 * SECSPERHOUR)
 
-time_t
+static time_t
 efi_time(EFI_TIME *ETime)
 {
 /*
@@ -164,7 +164,7 @@ efi_time(EFI_TIME *ETime)
 return UTime;
 }
 
-int
+static int
 EFI_GetTimeOfDay(
OUT struct timeval *tp,
OUT struct timezone *tzp
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295868 - head/bin/sh

2016-02-21 Thread Jilles Tjoelker
Author: jilles
Date: Sun Feb 21 20:58:24 2016
New Revision: 295868
URL: https://svnweb.freebsd.org/changeset/base/295868

Log:
  sh: Don't hash alias name when there are no aliases.

Modified:
  head/bin/sh/alias.c

Modified: head/bin/sh/alias.c
==
--- head/bin/sh/alias.c Sun Feb 21 18:58:05 2016(r295867)
+++ head/bin/sh/alias.c Sun Feb 21 20:58:24 2016(r295868)
@@ -144,9 +144,11 @@ rmaliases(void)
 struct alias *
 lookupalias(const char *name, int check)
 {
-   struct alias *ap = *hashalias(name);
+   struct alias *ap;
 
-   for (; ap; ap = ap->next) {
+   if (aliases == 0)
+   return (NULL);
+   for (ap = *hashalias(name); ap; ap = ap->next) {
if (equal(name, ap->name)) {
if (check && (ap->flag & ALIASINUSE))
return (NULL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295867 - head/usr.sbin/config

2016-02-21 Thread Ian Lepore
Author: ian
Date: Sun Feb 21 18:58:05 2016
New Revision: 295867
URL: https://svnweb.freebsd.org/changeset/base/295867

Log:
  Document the ability to override compiled-in env and hints using variables
  in the bootloader-provided env.

Modified:
  head/usr.sbin/config/config.5

Modified: head/usr.sbin/config/config.5
==
--- head/usr.sbin/config/config.5   Sun Feb 21 18:54:17 2016
(r295866)
+++ head/usr.sbin/config/config.5   Sun Feb 21 18:58:05 2016
(r295867)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 3, 2005
+.Dd February 21, 2016
 .Dt CONFIG 5
 .Os
 .Sh NAME
@@ -118,7 +118,8 @@ The kernel normally uses an environment 
 by
 .Xr loader 8 .
 This directive makes the kernel ignore the boot environment and use
-the compiled-in environment instead.
+the compiled-in environment instead, unless the boot environment contains
+.Va static_env.disabled=1 .
 .Pp
 This directive is useful for setting kernel tunables in
 embedded environments that do not start from
@@ -141,7 +142,9 @@ time (see
 .Xr device.hints 5 ) .
 This directive configures the kernel to use the static device configuration
 listed in
-.Ar filename .
+.Ar filename ,
+unless the boot environment contains
+.Va static_hints.disabled=1 .
 The file
 .Ar filename
 must conform to the syntax specified by
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295866 - head/bin/sh

2016-02-21 Thread Jilles Tjoelker
Author: jilles
Date: Sun Feb 21 18:54:17 2016
New Revision: 295866
URL: https://svnweb.freebsd.org/changeset/base/295866

Log:
  sh: Optimize setprompt(0).
  
  Avoid doing work to print an empty prompt (such as when reading scripts).

Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==
--- head/bin/sh/parser.cSun Feb 21 18:51:48 2016(r295865)
+++ head/bin/sh/parser.cSun Feb 21 18:54:17 2016(r295866)
@@ -1930,6 +1930,8 @@ static void
 setprompt(int which)
 {
whichprompt = which;
+   if (which == 0)
+   return;
 
 #ifndef NO_HISTORY
if (!el)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295865 - head/sys/dev/rtwn

2016-02-21 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Feb 21 18:51:48 2016
New Revision: 295865
URL: https://svnweb.freebsd.org/changeset/base/295865

Log:
  rtwn: import r290048.
  
  - Fix scanning from AUTH state.
  
  Tested by: Simone Mario Lombardo 
  
  PR:   203105
  Reviewed by:  kevlo
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D4820

Modified:
  head/sys/dev/rtwn/if_rtwn.c

Modified: head/sys/dev/rtwn/if_rtwn.c
==
--- head/sys/dev/rtwn/if_rtwn.c Sun Feb 21 18:35:01 2016(r295864)
+++ head/sys/dev/rtwn/if_rtwn.c Sun Feb 21 18:51:48 2016(r295865)
@@ -168,6 +168,8 @@ static void rtwn_get_txpower(struct rtwn
uint16_t[]);
 static voidrtwn_set_txpower(struct rtwn_softc *,
struct ieee80211_channel *, struct ieee80211_channel *);
+static voidrtwn_set_rx_bssid_all(struct rtwn_softc *, int);
+static voidrtwn_set_gain(struct rtwn_softc *, uint8_t);
 static voidrtwn_scan_start(struct ieee80211com *);
 static voidrtwn_scan_end(struct ieee80211com *);
 static voidrtwn_set_channel(struct ieee80211com *);
@@ -1237,22 +1239,6 @@ rtwn_newstate(struct ieee80211vap *vap, 
rtwn_set_led(sc, RTWN_LED_LINK, 0);
break;
case IEEE80211_S_SCAN:
-   if (vap->iv_state != IEEE80211_S_SCAN) {
-   /* Allow Rx from any BSSID. */
-   rtwn_write_4(sc, R92C_RCR,
-   rtwn_read_4(sc, R92C_RCR) &
-   ~(R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN));
-
-   /* Set gain for scanning. */
-   reg = rtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(0));
-   reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20);
-   rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg);
-
-   reg = rtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1));
-   reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20);
-   rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg);
-   }
-
/* Make link LED blink during scan. */
rtwn_set_led(sc, RTWN_LED_LINK, !sc->ledlink);
 
@@ -1261,14 +1247,6 @@ rtwn_newstate(struct ieee80211vap *vap, 
rtwn_read_1(sc, R92C_TXPAUSE) | 0x0f);
break;
case IEEE80211_S_AUTH:
-   /* Set initial gain under link. */
-   reg = rtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(0));
-   reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32);
-   rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg);
-
-   reg = rtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1));
-   reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32);
-   rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg);
rtwn_set_chan(sc, ic->ic_curchan, NULL);
break;
case IEEE80211_S_RUN:
@@ -2684,17 +2662,56 @@ rtwn_set_txpower(struct rtwn_softc *sc, 
 }
 
 static void
+rtwn_set_rx_bssid_all(struct rtwn_softc *sc, int enable)
+{
+   uint32_t reg;
+
+   reg = rtwn_read_4(sc, R92C_RCR);
+   if (enable)
+   reg &= ~R92C_RCR_CBSSID_BCN;
+   else
+   reg |= R92C_RCR_CBSSID_BCN;
+   rtwn_write_4(sc, R92C_RCR, reg);
+}
+
+static void
+rtwn_set_gain(struct rtwn_softc *sc, uint8_t gain)
+{
+   uint32_t reg;
+
+   reg = rtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(0));
+   reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, gain);
+   rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg);
+
+   reg = rtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1));
+   reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, gain);
+   rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg);
+}
+
+static void
 rtwn_scan_start(struct ieee80211com *ic)
 {
+   struct rtwn_softc *sc = ic->ic_softc;
 
-   /* XXX do nothing?  */
+   RTWN_LOCK(sc);
+   /* Receive beacons / probe responses from any BSSID. */
+   rtwn_set_rx_bssid_all(sc, 1);
+   /* Set gain for scanning. */
+   rtwn_set_gain(sc, 0x20);
+   RTWN_UNLOCK(sc);
 }
 
 static void
 rtwn_scan_end(struct ieee80211com *ic)
 {
+   struct rtwn_softc *sc = ic->ic_softc;
 
-   /* XXX do nothing?  */
+   RTWN_LOCK(sc);
+   /* Restore limitations. */
+   rtwn_set_rx_bssid_all(sc, 0);
+   /* Set gain under link. */
+   rtwn_set_gain(sc, 0x32);
+   RTWN_UNLOCK(sc);
 }
 
 static void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295864 - head/sys/kern

2016-02-21 Thread Ian Lepore
Author: ian
Date: Sun Feb 21 18:35:01 2016
New Revision: 295864
URL: https://svnweb.freebsd.org/changeset/base/295864

Log:
  Allow a dynamic env to override a compiled-in static env by passing in the
  override indication in the env data.
  
  Submitted by: bde

Modified:
  head/sys/kern/kern_environment.c

Modified: head/sys/kern/kern_environment.c
==
--- head/sys/kern/kern_environment.cSun Feb 21 18:17:09 2016
(r295863)
+++ head/sys/kern/kern_environment.cSun Feb 21 18:35:01 2016
(r295864)
@@ -217,6 +217,9 @@ done:
  * environment obtained from a boot loader, or to provide an empty buffer into
  * which MD code can store an initial environment using kern_setenv() calls.
  *
+ * When a copy of an initial environment is passed in, we start by scanning 
that
+ * env for overrides to the compiled-in envmode and hintmode variables.
+ *
  * If the global envmode is 1, the environment is initialized from the global
  * static_env[], regardless of the arguments passed.  This implements the env
  * keyword described in config(5).  In this case env_pos is set to env_len,
@@ -238,6 +241,14 @@ done:
 void
 init_static_kenv(char *buf, size_t len)
 {
+   char *cp;
+   
+   for (cp = buf; cp != NULL && cp[0] != '\0'; cp += strlen(cp) + 1) {
+   if (strcmp(cp, "static_env.disabled=1") == 0)
+   envmode = 0;
+   if (strcmp(cp, "static_hints.disabled=1") == 0)
+   hintmode = 0;
+   }
 
if (envmode == 1) {
kern_envp = static_env;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295863 - head/sys/i386/i386

2016-02-21 Thread Ian Lepore
Author: ian
Date: Sun Feb 21 18:17:09 2016
New Revision: 295863
URL: https://svnweb.freebsd.org/changeset/base/295863

Log:
  Minor style cleanups.
  
  Submitted by: bde

Modified:
  head/sys/i386/i386/machdep.c

Modified: head/sys/i386/i386/machdep.c
==
--- head/sys/i386/i386/machdep.cSun Feb 21 16:48:37 2016
(r295862)
+++ head/sys/i386/i386/machdep.cSun Feb 21 18:17:09 2016
(r295863)
@@ -2463,8 +2463,8 @@ init386(first)
metadata_missing = 1;
}
 
-   if (bootinfo.bi_envp)
-   init_static_kenv((caddr_t)bootinfo.bi_envp + KERNBASE, 0);
+   if (bootinfo.bi_envp != 0)
+   init_static_kenv((char *)bootinfo.bi_envp + KERNBASE, 0);
else
init_static_kenv(NULL, 0);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295862 - head/bin/sh

2016-02-21 Thread Jilles Tjoelker
Author: jilles
Date: Sun Feb 21 16:48:37 2016
New Revision: 295862
URL: https://svnweb.freebsd.org/changeset/base/295862

Log:
  sh: Remove unnecessary flushouts while reading script.
  
  Output is flushed when a builtin is done or immediately after writing it
  (error messages, set -v output, prompts).

Modified:
  head/bin/sh/input.c

Modified: head/bin/sh/input.c
==
--- head/bin/sh/input.c Sun Feb 21 16:45:22 2016(r295861)
+++ head/bin/sh/input.c Sun Feb 21 16:48:37 2016(r295862)
@@ -212,8 +212,6 @@ preadbuffer(void)
}
if (parsenleft == EOF_NLEFT || parsefile->buf == NULL)
return PEOF;
-   flushout();
-   flushout();
 
 again:
if (parselleft <= 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r295856 - head/sys/compat/linprocfs

2016-02-21 Thread Mateusz Guzik
On Sun, Feb 21, 2016 at 02:56:05PM +, Dag-Erling Smørgrav wrote:

First of all I received this patch over a month ago and then I forgot a
about it, for which I have to apologize.

Now back to business.

> Author: des
> Date: Sun Feb 21 14:56:05 2016
> New Revision: 295856
> URL: https://svnweb.freebsd.org/changeset/base/295856
> 
> Log:
>   Implement /proc/$$/limits.
>   
>   PR: 207386
>   Submitted by:   Szymon Śliwa 
>   MFC after:  3 weeks
> 
> Modified:
>   head/sys/compat/linprocfs/linprocfs.c
> 
> Modified: head/sys/compat/linprocfs/linprocfs.c
> ==
> --- head/sys/compat/linprocfs/linprocfs.c Sun Feb 21 14:50:37 2016
> (r295855)
> +++ head/sys/compat/linprocfs/linprocfs.c Sun Feb 21 14:56:05 2016
> (r295856)
> @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -1366,6 +1367,67 @@ linprocfs_dofdescfs(PFS_FILL_ARGS)
>   return (0);
>  }
>  
> +/*
> + * Filler function for proc/pid/limits
> + */
> +
> +#define RLIM_NONE -1
> +
> +static const struct limit_info {
> + const char  *desc;
> + const char  *unit;
> + unsigned long long  rlim_id;
> +} limits_info[] = {
> + { "Max cpu time",   "seconds",  RLIMIT_CPU },
> + { "Max file size",  "bytes",RLIMIT_FSIZE },
> + { "Max data size",  "bytes",RLIMIT_DATA },
> + { "Max stack size", "bytes",RLIMIT_STACK },
> + { "Max core file size", "bytes",RLIMIT_CORE },
> + { "Max resident set",   "bytes",RLIMIT_RSS },
> + { "Max processes",  "processes",RLIMIT_NPROC },
> + { "Max open files", "files",RLIMIT_NOFILE },
> + { "Max locked memory",  "bytes",RLIMIT_MEMLOCK },
> + { "Max address space",  "bytes",RLIMIT_AS },
> + { "Max file locks", "locks",RLIM_INFINITY },
> + { "Max pending signals","signals",  RLIM_INFINITY },
> + { "Max msgqueue size",  "bytes",RLIM_NONE },
> + { "Max nice priority",  "", RLIM_NONE },
> + { "Max realtime priority",  "", RLIM_NONE },
> + { "Max realtime timeout",   "us",   RLIM_INFINITY },
> + { 0, 0, 0 }
> +};
> +
> +static int
> +linprocfs_doproclimits(PFS_FILL_ARGS)
> +{
> + const struct limit_info *li;
> + struct rlimit li_rlimits;
> + struct plimit *cur_proc_lim;
> +

'cur' is a bad part for a name here. For instance 'curthread' refers to
the thread executing the code. Now 'cur' strongly implies this is a
pointer to limits from the current thread. This also is not the standard
name used for pointers to plimit.

> + cur_proc_lim = lim_alloc();

I presume this function is called with the process unlocked. If it was
locked, bound sleep property of the mtx would conflict with unbodung
sleep possibly induced by lim_alloc.

But there is no reason to allocate anything.

> + lim_copy(cur_proc_lim, p->p_limit);

If the process is unlocked, this has to be wrong. The target process may
be in the process of changing its limits leading to this code reading a
pointer to a buffer which is freed before lim_copy accesses it.

The limit structure is maintained with a reference counter. Thus the
correct thing to do is to lock the process, grab the reference, unlock
the process, do what you need to do with the structure and finally unref
it.

Interestingly the correct thing to do is implemented here:
http://fxr.watson.org/fxr/source/fs/procfs/procfs_rlimit.c#L112

I have not verified correctness of the rest of the patch.

> + sbuf_printf(sb, "%-26s%-21s%-21s%-10s\n", "Limit", "Soft Limit",
> + "Hard Limit", "Units");
> + for (li = limits_info; li->desc != NULL; ++li) {
> + if (li->rlim_id != RLIM_INFINITY && li->rlim_id != RLIM_NONE)
> + li_rlimits = cur_proc_lim->pl_rlimit[li->rlim_id];
> + else {
> + li_rlimits.rlim_cur = 0;
> + li_rlimits.rlim_max = 0;
> + }
> + if (li->rlim_id == RLIM_INFINITY ||
> + li_rlimits.rlim_cur == RLIM_INFINITY)
> + sbuf_printf(sb, "%-26s%-21s%-21s%-10s\n",
> + li->desc, "unlimited", "unlimited", li->unit);
> + else
> + sbuf_printf(sb, "%-26s%-21ld%-21ld%-10s\n",
> + li->desc, (long)li_rlimits.rlim_cur,
> + (long)li_rlimits.rlim_max, li->unit);
> + }
> + lim_free(cur_proc_lim);
> + return (0);
> +}
> +
>  
>  /*
>   * Filler function for proc/sys/kernel/random/uuid
> @@ -1504,6 +1566,8 @@ linprocfs_init(PFS_INIT_ARGS)
>   NULL, 

svn commit: r295861 - head/sys/dev/pms/freebsd/driver/ini/src

2016-02-21 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Feb 21 16:45:22 2016
New Revision: 295861
URL: https://svnweb.freebsd.org/changeset/base/295861

Log:
  ostiInitiatorIOCompleted(): wrong sizeof() argument.
  
  Detected by:  PVS Static Analysis
  CID:  1331601, 1331523

Modified:
  head/sys/dev/pms/freebsd/driver/ini/src/osapi.c

Modified: head/sys/dev/pms/freebsd/driver/ini/src/osapi.c
==
--- head/sys/dev/pms/freebsd/driver/ini/src/osapi.c Sun Feb 21 16:27:55 
2016(r295860)
+++ head/sys/dev/pms/freebsd/driver/ini/src/osapi.c Sun Feb 21 16:45:22 
2016(r295861)
@@ -313,7 +313,7 @@ ostiInitiatorIOCompleted(tiRoot_t  *
   }
   sense_len = MIN( pSenseData->senseLen,
pccb->senseLen - csio->sense_resid );
-  bzero(>sense_data, sizeof(>sense_data));
+  bzero(>sense_data, sizeof(csio->sense_data));
   AGTIAPI_PRINTK("ostiInitiatorIOCompleted: check condition copying\n");
   memcpy( (void *)pccb->pSenseData,
   pSenseData->senseData,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295857 - head/contrib/binutils/bfd

2016-02-21 Thread Ian Lepore
Author: ian
Date: Sun Feb 21 14:59:24 2016
New Revision: 295857
URL: https://svnweb.freebsd.org/changeset/base/295857

Log:
  Unconditionally set e_ident[OSABI]=ELFOSABI_FREEBSD in arm binary headers.
  
  When the armv6 support was imported from a project branch, this complex
  conditional logic and related #define'd values came along, but it's really
  not clear what the intent of it all was.  The effect, however, was that
  OSABI was always set to zero, which is "UNIX System V ABI".  Having the wrong
  value there causes pkg(8) to avoid looking inside arm elf binaries to
  determine shared-lib required/provides info for packaging.

Modified:
  head/contrib/binutils/bfd/elf32-arm.c

Modified: head/contrib/binutils/bfd/elf32-arm.c
==
--- head/contrib/binutils/bfd/elf32-arm.c   Sun Feb 21 14:56:05 2016
(r295856)
+++ head/contrib/binutils/bfd/elf32-arm.c   Sun Feb 21 14:59:24 2016
(r295857)
@@ -59,13 +59,6 @@
 #define elf_info_to_howto   0
 #define elf_info_to_howto_rel   elf32_arm_info_to_howto
 
-#define ARM_ELF_ABI_VERSION0
-#ifdef __FreeBSD__
-#define ARM_ELF_OS_ABI_VERSION ELFOSABI_FREEBSD
-#else
-#define ARM_ELF_OS_ABI_VERSION ELFOSABI_ARM
-#endif
-
 static struct elf_backend_data elf32_arm_vxworks_bed;
 
 /* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g.
@@ -9377,11 +9370,8 @@ elf32_arm_post_process_headers (bfd * ab
 
   i_ehdrp = elf_elfheader (abfd);
 
-  if (EF_ARM_EABI_VERSION (i_ehdrp->e_flags) == EF_ARM_EABI_UNKNOWN)
-i_ehdrp->e_ident[EI_OSABI] = ARM_ELF_OS_ABI_VERSION;
-  else
-i_ehdrp->e_ident[EI_OSABI] = 0;
-  i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION;
+  i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
+  i_ehdrp->e_ident[EI_ABIVERSION] = 0;
 
   if (link_info)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295856 - head/sys/compat/linprocfs

2016-02-21 Thread Dag-Erling Smørgrav
Author: des
Date: Sun Feb 21 14:56:05 2016
New Revision: 295856
URL: https://svnweb.freebsd.org/changeset/base/295856

Log:
  Implement /proc/$$/limits.
  
  PR:   207386
  Submitted by: Szymon Śliwa 
  MFC after:3 weeks

Modified:
  head/sys/compat/linprocfs/linprocfs.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==
--- head/sys/compat/linprocfs/linprocfs.c   Sun Feb 21 14:50:37 2016
(r295855)
+++ head/sys/compat/linprocfs/linprocfs.c   Sun Feb 21 14:56:05 2016
(r295856)
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1366,6 +1367,67 @@ linprocfs_dofdescfs(PFS_FILL_ARGS)
return (0);
 }
 
+/*
+ * Filler function for proc/pid/limits
+ */
+
+#define RLIM_NONE -1
+
+static const struct limit_info {
+   const char  *desc;
+   const char  *unit;
+   unsigned long long  rlim_id;
+} limits_info[] = {
+   { "Max cpu time",   "seconds",  RLIMIT_CPU },
+   { "Max file size",  "bytes",RLIMIT_FSIZE },
+   { "Max data size",  "bytes",RLIMIT_DATA },
+   { "Max stack size", "bytes",RLIMIT_STACK },
+   { "Max core file size", "bytes",RLIMIT_CORE },
+   { "Max resident set",   "bytes",RLIMIT_RSS },
+   { "Max processes",  "processes",RLIMIT_NPROC },
+   { "Max open files", "files",RLIMIT_NOFILE },
+   { "Max locked memory",  "bytes",RLIMIT_MEMLOCK },
+   { "Max address space",  "bytes",RLIMIT_AS },
+   { "Max file locks", "locks",RLIM_INFINITY },
+   { "Max pending signals","signals",  RLIM_INFINITY },
+   { "Max msgqueue size",  "bytes",RLIM_NONE },
+   { "Max nice priority",  "", RLIM_NONE },
+   { "Max realtime priority",  "", RLIM_NONE },
+   { "Max realtime timeout",   "us",   RLIM_INFINITY },
+   { 0, 0, 0 }
+};
+
+static int
+linprocfs_doproclimits(PFS_FILL_ARGS)
+{
+   const struct limit_info *li;
+   struct rlimit li_rlimits;
+   struct plimit *cur_proc_lim;
+
+   cur_proc_lim = lim_alloc();
+   lim_copy(cur_proc_lim, p->p_limit);
+   sbuf_printf(sb, "%-26s%-21s%-21s%-10s\n", "Limit", "Soft Limit",
+   "Hard Limit", "Units");
+   for (li = limits_info; li->desc != NULL; ++li) {
+   if (li->rlim_id != RLIM_INFINITY && li->rlim_id != RLIM_NONE)
+   li_rlimits = cur_proc_lim->pl_rlimit[li->rlim_id];
+   else {
+   li_rlimits.rlim_cur = 0;
+   li_rlimits.rlim_max = 0;
+   }
+   if (li->rlim_id == RLIM_INFINITY ||
+   li_rlimits.rlim_cur == RLIM_INFINITY)
+   sbuf_printf(sb, "%-26s%-21s%-21s%-10s\n",
+   li->desc, "unlimited", "unlimited", li->unit);
+   else
+   sbuf_printf(sb, "%-26s%-21ld%-21ld%-10s\n",
+   li->desc, (long)li_rlimits.rlim_cur,
+   (long)li_rlimits.rlim_max, li->unit);
+   }
+   lim_free(cur_proc_lim);
+   return (0);
+}
+
 
 /*
  * Filler function for proc/sys/kernel/random/uuid
@@ -1504,6 +1566,8 @@ linprocfs_init(PFS_INIT_ARGS)
NULL, NULL, NULL, 0);
pfs_create_file(dir, "auxv", _doauxv,
NULL, _candebug, NULL, PFS_RD|PFS_RAWRD);
+   pfs_create_file(dir, "limits", _doproclimits,
+   NULL, NULL, NULL, PFS_RD);
 
/* /proc/scsi/... */
dir = pfs_create_dir(root, "scsi", NULL, NULL, NULL, 0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r295854 - head/bin/dd

2016-02-21 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Feb 21 14:36:50 2016
New Revision: 295854
URL: https://svnweb.freebsd.org/changeset/base/295854

Log:
  Make the "invalid numeric value" error message actually displayable
  (was a dead code before).
  
  Submitted by: bde@ (earlier version)
  Reviewed by:  bde@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/bin/dd/args.c

Modified: head/bin/dd/args.c
==
--- head/bin/dd/args.c  Sun Feb 21 13:54:22 2016(r295853)
+++ head/bin/dd/args.c  Sun Feb 21 14:36:50 2016(r295854)
@@ -422,11 +422,10 @@ get_num(const char *val)
 
errno = 0;
num = strtoumax(val, , 0);
-   if (errno != 0) /* Overflow or underflow. */
-   err(1, "%s", oper);
-   
if (expr == val)/* No valid digits. */
-   errx(1, "%s: illegal numeric value", oper);
+   errx(1, "%s: invalid numeric value", oper);
+   if (errno != 0)
+   err(1, "%s", oper);
 
mult = postfix_to_mult(*expr);
 
@@ -472,11 +471,10 @@ get_off_t(const char *val)
 
errno = 0;
num = strtoimax(val, , 0);
-   if (errno != 0) /* Overflow or underflow. */
-   err(1, "%s", oper);
-   
if (expr == val)/* No valid digits. */
-   errx(1, "%s: illegal numeric value", oper);
+   errx(1, "%s: invalid numeric value", oper);
+   if (errno != 0)
+   err(1, "%s", oper);
 
mult = postfix_to_mult(*expr);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295853 - vendor/libc++/libc++-release_38-r261369

2016-02-21 Thread Dimitry Andric
Author: dim
Date: Sun Feb 21 13:54:22 2016
New Revision: 295853
URL: https://svnweb.freebsd.org/changeset/base/295853

Log:
  Tag libc++ release_38 branch r261369.

Added:
  vendor/libc++/libc++-release_38-r261369/
 - copied from r295852, vendor/libc++/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295852 - in vendor/libc++/dist: include test/std/re/re.regex/re.regex.construct test/std/re/re.results/re.results.form

2016-02-21 Thread Dimitry Andric
Author: dim
Date: Sun Feb 21 13:53:59 2016
New Revision: 295852
URL: https://svnweb.freebsd.org/changeset/base/295852

Log:
  Vendor import of libc++ release_38 branch r261369:
  https://llvm.org/svn/llvm-project/libcxx/branches/release_38@261369

Modified:
  vendor/libc++/dist/include/regex
  vendor/libc++/dist/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp
  vendor/libc++/dist/test/std/re/re.results/re.results.form/form1.pass.cpp

Modified: vendor/libc++/dist/include/regex
==
--- vendor/libc++/dist/include/regexSun Feb 21 13:53:36 2016
(r295851)
+++ vendor/libc++/dist/include/regexSun Feb 21 13:53:59 2016
(r295852)
@@ -976,7 +976,12 @@ public:
 typedef locale  locale_type;
 typedef ctype_base::maskchar_class_type;
 
+#if defined(__mips__) && defined(__GLIBC__)
+static const char_class_type __regex_word = 
static_cast(_ISbit(15));
+#else
 static const char_class_type __regex_word = 0x80;
+#endif
+
 private:
 locale __loc_;
 const ctype* __ct_;
@@ -4265,6 +4270,9 @@ basic_regex<_CharT, _Traits>::__parse_at
 if (__first != __last && *__first == '\\')
 {
 _ForwardIterator __t1 = _VSTD::next(__first);
+if (__t1 == __last)
+__throw_regex_error();
+
 _ForwardIterator __t2 = __parse_decimal_escape(__t1, __last);
 if (__t2 != __t1)
 __first = __t2;
@@ -5384,8 +5392,8 @@ match_results<_BidirectionalIterator, _A
 if ('0' <= *__fmt_first && *__fmt_first <= '9')
 {
 size_t __i = *__fmt_first - '0';
-__out = _VSTD::copy(__matches_[__i].first,
-   __matches_[__i].second, __out);
+__out = _VSTD::copy((*this)[__i].first,
+(*this)[__i].second, __out);
 }
 else
 {
@@ -5436,8 +5444,8 @@ match_results<_BidirectionalIterator, _A
 ++__fmt_first;
 __i = 10 * __i + *__fmt_first - '0';
 }
-__out = _VSTD::copy(__matches_[__i].first,
-   __matches_[__i].second, __out);
+__out = _VSTD::copy((*this)[__i].first,
+(*this)[__i].second, __out);
 }
 else
 {

Modified: 
vendor/libc++/dist/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp
==
--- 
vendor/libc++/dist/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp  
Sun Feb 21 13:53:36 2016(r295851)
+++ 
vendor/libc++/dist/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp  
Sun Feb 21 13:53:59 2016(r295852)
@@ -33,6 +33,7 @@ int main() 
 {
 assert(error_escape_thrown("[\\a]"));
 assert(error_escape_thrown("\\a"));
+assert(error_escape_thrown("\\"));
 
 assert(error_escape_thrown("[\\e]"));
 assert(error_escape_thrown("\\e"));

Modified: 
vendor/libc++/dist/test/std/re/re.results/re.results.form/form1.pass.cpp
==
--- vendor/libc++/dist/test/std/re/re.results/re.results.form/form1.pass.cpp
Sun Feb 21 13:53:36 2016(r295851)
+++ vendor/libc++/dist/test/std/re/re.results/re.results.form/form1.pass.cpp
Sun Feb 21 13:53:59 2016(r295852)
@@ -38,6 +38,31 @@ int main()
 {
 std::match_results m;
 const char s[] = "abcdefghijk";
+assert(std::regex_search(s, m, std::regex("cd((e)fg)hi",
+  
std::regex_constants::nosubs)));
+
+char out[100] = {0};
+const char fmt[] = "prefix: $`, match: $&, suffix: $', m[1]: $1, m[2]: 
$2";
+char* r = m.format(output_iterator(out),
+fmt, fmt + std::char_traits::length(fmt)).base();
+assert(r == out + 54);
+assert(std::string(out) == "prefix: ab, match: cdefghi, suffix: jk, 
m[1]: , m[2]: ");
+}
+{
+std::match_results m;
+const char s[] = "abcdefghijk";
+assert(std::regex_search(s, m, std::regex("cdefghi")));
+
+char out[100] = {0};
+const char fmt[] = "prefix: $`, match: $&, suffix: $', m[1]: $1, m[2]: 
$2";
+char* r = m.format(output_iterator(out),
+fmt, fmt + std::char_traits::length(fmt)).base();
+assert(r == out + 54);
+assert(std::string(out) == "prefix: ab, match: cdefghi, suffix: jk, 
m[1]: , m[2]: ");
+}
+{
+std::match_results m;
+const char s[] = "abcdefghijk";
 assert(std::regex_search(s, m, std::regex("cd((e)fg)hi")));
 
 char out[100] = 

svn commit: r295851 - vendor/compiler-rt/compiler-rt-release_38-r261369

2016-02-21 Thread Dimitry Andric
Author: dim
Date: Sun Feb 21 13:53:36 2016
New Revision: 295851
URL: https://svnweb.freebsd.org/changeset/base/295851

Log:
  Tag compiler-rt release_38 branch r261369.

Added:
  vendor/compiler-rt/compiler-rt-release_38-r261369/
 - copied from r295850, vendor/compiler-rt/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295849 - vendor/clang/clang-release_38-r261369

2016-02-21 Thread Dimitry Andric
Author: dim
Date: Sun Feb 21 13:52:51 2016
New Revision: 295849
URL: https://svnweb.freebsd.org/changeset/base/295849

Log:
  Tag clang release_38 branch r261369.

Added:
  vendor/clang/clang-release_38-r261369/
 - copied from r295848, vendor/clang/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295850 - in vendor/compiler-rt/dist: lib/msan lib/sanitizer_common lib/tsan/go test/asan/TestCases test/tsan

2016-02-21 Thread Dimitry Andric
Author: dim
Date: Sun Feb 21 13:53:12 2016
New Revision: 295850
URL: https://svnweb.freebsd.org/changeset/base/295850

Log:
  Vendor import of compiler-rt release_38 branch r261369:
  https://llvm.org/svn/llvm-project/compiler-rt/branches/release_38@261369

Modified:
  vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc
  vendor/compiler-rt/dist/lib/tsan/go/buildgo.sh
  vendor/compiler-rt/dist/test/asan/TestCases/throw_catch.cc
  vendor/compiler-rt/dist/test/tsan/CMakeLists.txt
  vendor/compiler-rt/dist/test/tsan/ignore_lib0.cc
  vendor/compiler-rt/dist/test/tsan/printf-1.c

Modified: vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc
==
--- vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc   Sun Feb 21 
13:52:51 2016(r295849)
+++ vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc   Sun Feb 21 
13:53:12 2016(r295850)
@@ -1408,12 +1408,12 @@ int OnExit() {
   __msan_unpoison(ptr, size)
 #define COMMON_INTERCEPTOR_ENTER(ctx, func, ...)  \
   if (msan_init_is_running) return REAL(func)(__VA_ARGS__);   \
+  ENSURE_MSAN_INITED();   \
   MSanInterceptorContext msan_ctx = {IsInInterceptorScope()}; \
   ctx = (void *)_ctx;\
   (void)ctx;  \
   InterceptorScope interceptor_scope; \
-  __msan_unpoison(__errno_location(), sizeof(int)); /* NOLINT */  \
-  ENSURE_MSAN_INITED();
+  __msan_unpoison(__errno_location(), sizeof(int)); /* NOLINT */
 #define COMMON_INTERCEPTOR_DIR_ACQUIRE(ctx, path) \
   do {\
   } while (false)

Modified: 
vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc
==
--- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc 
Sun Feb 21 13:52:51 2016(r295849)
+++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc 
Sun Feb 21 13:53:12 2016(r295850)
@@ -222,6 +222,11 @@ uptr ThreadDescriptorSize() {
 char *end;
 int minor = internal_simple_strtoll(buf + 8, , 10);
 if (end != buf + 8 && (*end == '\0' || *end == '.')) {
+  int patch = 0;
+  if (*end == '.')
+// strtoll will return 0 if no valid conversion could be performed
+patch = internal_simple_strtoll(end + 1, nullptr, 10);
+
   /* sizeof(struct pthread) values from various glibc versions.  */
   if (SANITIZER_X32)
 val = 1728;  // Assume only one particular version for x32.
@@ -235,9 +240,9 @@ uptr ThreadDescriptorSize() {
 val = FIRST_32_SECOND_64(1136, 1712);
   else if (minor == 10)
 val = FIRST_32_SECOND_64(1168, 1776);
-  else if (minor <= 12)
+  else if (minor == 11 || (minor == 12 && patch == 1))
 val = FIRST_32_SECOND_64(1168, 2288);
-  else if (minor == 13)
+  else if (minor <= 13)
 val = FIRST_32_SECOND_64(1168, 2304);
   else
 val = FIRST_32_SECOND_64(1216, 2304);

Modified: vendor/compiler-rt/dist/lib/tsan/go/buildgo.sh
==
--- vendor/compiler-rt/dist/lib/tsan/go/buildgo.sh  Sun Feb 21 13:52:51 
2016(r295849)
+++ vendor/compiler-rt/dist/lib/tsan/go/buildgo.sh  Sun Feb 21 13:53:12 
2016(r295850)
@@ -50,19 +50,20 @@ if [ "`uname -a | grep Linux`" != "" ]; 
../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
"
 elif [ "`uname -a | grep FreeBSD`" != "" ]; then
-SUFFIX="freebsd_amd64"
-OSCFLAGS="-fno-strict-aliasing -fPIC -Werror"
-OSLDFLAGS="-lpthread -fPIC -fpie"
-SRCS="
-$SRCS
-../rtl/tsan_platform_linux.cc
-../../sanitizer_common/sanitizer_posix.cc
-../../sanitizer_common/sanitizer_posix_libcdep.cc
-../../sanitizer_common/sanitizer_procmaps_common.cc
-../../sanitizer_common/sanitizer_procmaps_freebsd.cc
-../../sanitizer_common/sanitizer_linux.cc
-../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
-"
+   SUFFIX="freebsd_amd64"
+   OSCFLAGS="-fno-strict-aliasing -fPIC -Werror"
+   OSLDFLAGS="-lpthread -fPIC -fpie"
+   SRCS="
+   $SRCS
+   ../rtl/tsan_platform_linux.cc
+   ../../sanitizer_common/sanitizer_posix.cc
+   ../../sanitizer_common/sanitizer_posix_libcdep.cc
+   ../../sanitizer_common/sanitizer_procmaps_common.cc
+   ../../sanitizer_common/sanitizer_procmaps_freebsd.cc
+   ../../sanitizer_common/sanitizer_linux.cc
+   

svn commit: r295847 - vendor/llvm/llvm-release_38-r261369

2016-02-21 Thread Dimitry Andric
Author: dim
Date: Sun Feb 21 13:52:12 2016
New Revision: 295847
URL: https://svnweb.freebsd.org/changeset/base/295847

Log:
  Tag llvm release_38 branch r261369.

Added:
  vendor/llvm/llvm-release_38-r261369/
 - copied from r295846, vendor/llvm/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295848 - in vendor/clang/dist: docs lib/Basic lib/CodeGen lib/Driver lib/Format lib/Sema test/CodeGen test/CodeGenCXX test/Driver test/OpenMP unittests/Format

2016-02-21 Thread Dimitry Andric
Author: dim
Date: Sun Feb 21 13:52:32 2016
New Revision: 295848
URL: https://svnweb.freebsd.org/changeset/base/295848

Log:
  Vendor import of clang release_38 branch r261369:
  https://llvm.org/svn/llvm-project/cfe/branches/release_38@261369

Added:
  vendor/clang/dist/test/CodeGen/arm-vfp-asm-constraint.c   (contents, props 
changed)
  vendor/clang/dist/test/CodeGenCXX/windows-on-arm-stack-probe-size.cpp   
(contents, props changed)
Modified:
  vendor/clang/dist/docs/ReleaseNotes.rst
  vendor/clang/dist/lib/Basic/Targets.cpp
  vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp
  vendor/clang/dist/lib/CodeGen/TargetInfo.cpp
  vendor/clang/dist/lib/Driver/ToolChains.cpp
  vendor/clang/dist/lib/Driver/ToolChains.h
  vendor/clang/dist/lib/Format/ContinuationIndenter.cpp
  vendor/clang/dist/lib/Sema/SemaOpenMP.cpp
  vendor/clang/dist/test/Driver/freebsd.cpp
  vendor/clang/dist/test/OpenMP/for_ast_print.cpp
  vendor/clang/dist/test/OpenMP/for_lastprivate_codegen.cpp
  vendor/clang/dist/test/OpenMP/parallel_messages.cpp
  vendor/clang/dist/unittests/Format/FormatTest.cpp

Modified: vendor/clang/dist/docs/ReleaseNotes.rst
==
--- vendor/clang/dist/docs/ReleaseNotes.rst Sun Feb 21 13:52:12 2016
(r295847)
+++ vendor/clang/dist/docs/ReleaseNotes.rst Sun Feb 21 13:52:32 2016
(r295848)
@@ -39,12 +39,16 @@ Major New Features
 - Feature1...
 
 Improvements to Clang's diagnostics
-^^^
+---
 
 Clang's diagnostics are constantly being improved to catch more issues,
 explain them more clearly, and provide more accurate source information
 about them. The improvements since the 3.7 release include:
 
+- ``-Wmicrosoft`` has been split into many targeted flags, so that projects can
+  choose to enable only a subset of these warnings. ``-Wno-microsoft`` still
+  disables all these warnings, and ``-Wmicrosoft`` still enables them all.
+
 -  ...
 
 New Compiler Flags
@@ -140,7 +144,51 @@ Objective-C Language Changes in Clang
 OpenCL C Language Changes in Clang
 --
 
-...
+Several OpenCL 2.0 features have been added, including:
+
+- Command-line option ``-std=CL2.0``.
+
+- Generic address space (``__generic``) along with new conversion rules
+  between different address spaces and default address space deduction.
+
+- Support for program scope variables with ``__global`` address space.
+
+- Pipe specifier was added (although no pipe functions are supported yet).
+
+- Atomic types: ``atomic_int``, ``atomic_uint``, ``atomic_long``,
+  ``atomic_ulong``, ``atomic_float``, ``atomic_double``, ``atomic_flag``,
+  ``atomic_intptr_t``, ``atomic_uintptr_t``, ``atomic_size_t``,
+  ``atomic_ptrdiff_t`` and their usage with C11 style builtin functions.
+
+- Image types: ``image2d_depth_t``, ``image2d_array_depth_t``,
+  ``image2d_msaa_t``, ``image2d_array_msaa_t``, ``image2d_msaa_depth_t``,
+  ``image2d_array_msaa_depth_t``.
+
+- Other types (for pipes and device side enqueue): ``clk_event_t``,
+  ``queue_t``, ``ndrange_t``, ``reserve_id_t``.
+
+Several additional features/bugfixes have been added to the previous standards:
+
+- A set of floating point arithmetic relaxation flags: ``-cl-no-signed-zeros``,
+  ``-cl-unsafe-math-optimizations``, ``-cl-finite-math-only``,
+  ``-cl-fast-relaxed-math``.
+
+- Added ``^^`` to the list of reserved operations.
+
+- Improved vector support and diagnostics.
+
+- Improved diagnostics for function pointers.
+
+CUDA Support in Clang
+-
+Clang has experimental support for end-to-end CUDA compilation now:
+
+- The driver now detects CUDA installation, creates host and device compilation
+  pipelines, links device-side code with appropriate CUDA bitcode and produces
+  single object file with host and GPU code.
+
+- Implemented target attribute-based function overloading which allows clang to
+  compile CUDA sources without splitting them into separate host/device TUs.
 
 Internal API Changes
 
@@ -220,7 +268,7 @@ Several new checks were added:
   ``-enable-checker optin.performance.Padding``.
 - The checks to detect misuse of ``_Nonnull`` type qualifiers as well as checks
   to detect misuse of Objective-C generics were added.
-- The analyzer now has opt in checks to detect localization errors in Coca
+- The analyzer now has opt in checks to detect localization errors in Cocoa
   applications. The checks warn about uses of non-localized ``NSStrings``
   passed to UI methods expecting localized strings and on ``NSLocalizedString``
   macros that are missing the comment argument. These can be enabled by passing

Modified: vendor/clang/dist/lib/Basic/Targets.cpp
==
--- vendor/clang/dist/lib/Basic/Targets.cpp Sun Feb 21 13:52:12 2016
(r295847)
+++ vendor/clang/dist/lib/Basic/Targets.cpp Sun Feb 

svn commit: r295846 - in vendor/llvm/dist: docs include/llvm/CodeGen include/llvm/IR lib/CodeGen lib/CodeGen/SelectionDAG lib/ExecutionEngine/IntelJITEvents lib/Support lib/Target/Sparc lib/Target/...

2016-02-21 Thread Dimitry Andric
Author: dim
Date: Sun Feb 21 13:51:43 2016
New Revision: 295846
URL: https://svnweb.freebsd.org/changeset/base/295846

Log:
  Vendor import of llvm release_38 branch r261369:
  https://llvm.org/svn/llvm-project/llvm/branches/release_38@261369

Added:
  vendor/llvm/dist/test/CodeGen/AArch64/fcopysign.ll
  vendor/llvm/dist/test/CodeGen/WinEH/wineh-noret-cleanup.ll
  vendor/llvm/dist/test/CodeGen/X86/pr26625.ll
  vendor/llvm/dist/test/CodeGen/X86/regalloc-spill-at-ehpad.ll
  vendor/llvm/dist/test/Transforms/PruneEH/pr26263.ll
Deleted:
  vendor/llvm/dist/test/Transforms/LoopVectorize/X86/reg-usage.ll
Modified:
  vendor/llvm/dist/docs/CMake.rst
  vendor/llvm/dist/docs/ReleaseNotes.rst
  vendor/llvm/dist/include/llvm/CodeGen/LiveInterval.h
  vendor/llvm/dist/include/llvm/IR/IRBuilder.h
  vendor/llvm/dist/include/llvm/IR/Instructions.h
  vendor/llvm/dist/lib/CodeGen/CalcSpillWeights.cpp
  vendor/llvm/dist/lib/CodeGen/LiveInterval.cpp
  vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  vendor/llvm/dist/lib/CodeGen/WinEHPrepare.cpp
  vendor/llvm/dist/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
  vendor/llvm/dist/lib/ExecutionEngine/IntelJITEvents/LLVMBuild.txt
  vendor/llvm/dist/lib/Support/Triple.cpp
  vendor/llvm/dist/lib/Target/Sparc/SparcInstrAliases.td
  vendor/llvm/dist/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
  vendor/llvm/dist/lib/Target/X86/X86FrameLowering.cpp
  vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td
  vendor/llvm/dist/lib/Transforms/IPO/PruneEH.cpp
  vendor/llvm/dist/lib/Transforms/Scalar/LoopStrengthReduce.cpp
  vendor/llvm/dist/lib/Transforms/Vectorize/LoopVectorize.cpp
  vendor/llvm/dist/test/CodeGen/X86/shrink-wrap-chkstk.ll
  vendor/llvm/dist/test/MC/Sparc/sparc-ctrl-instructions.s
  vendor/llvm/dist/test/MC/Sparc/sparc64-ctrl-instructions.s
  vendor/llvm/dist/test/MC/X86/x86_nop.s
  vendor/llvm/dist/test/Transforms/InstCombine/fprintf-1.ll
  vendor/llvm/dist/test/Transforms/LoopStrengthReduce/funclet.ll
  vendor/llvm/dist/test/Transforms/LoopVectorize/PowerPC/stride-vectorization.ll
  vendor/llvm/dist/test/Transforms/LoopVectorize/X86/vector_max_bandwidth.ll
  vendor/llvm/dist/test/Transforms/LoopVectorize/interleaved-accesses.ll

Modified: vendor/llvm/dist/docs/CMake.rst
==
--- vendor/llvm/dist/docs/CMake.rst Sun Feb 21 13:49:26 2016
(r295845)
+++ vendor/llvm/dist/docs/CMake.rst Sun Feb 21 13:51:43 2016
(r295846)
@@ -197,12 +197,6 @@ CMake manual, or execute ``cmake --help-
 **CMAKE_CXX_FLAGS**:STRING
   Extra flags to use when compiling C++ source files.
 
-**BUILD_SHARED_LIBS**:BOOL
-  Flag indicating if shared libraries will be built. Its default value is
-  OFF. This option is only recommended for use by LLVM developers.
-  On Windows, shared libraries may be used when building with MinGW, including
-  mingw-w64, but not when building with the Microsoft toolchain.
-
 .. _LLVM-specific variables:
 
 LLVM-specific variables
@@ -445,6 +439,30 @@ LLVM-specific variables
   $CMAKE_INSTALL_PREFIX/Toolchains containing an xctoolchain directory which 
can
   be used to override the default system tools. 
 
+**LLVM_BUILD_LLVM_DYLIB**:BOOL
+  If enabled, the target for building the libLLVM shared library is added.
+  This library contains all of LLVM's components in a single shared library.
+  Defaults to OFF. This cannot be used in conjunction with BUILD_SHARED_LIBS.
+  Tools will only be linked to the libLLVM shared library if 
LLVM_LINK_LLVM_DYLIB
+  is also ON.
+  The components in the library can be customised by setting 
LLVM_DYLIB_COMPONENTS
+  to a list of the desired components.
+
+**LLVM_LINK_LLVM_DYLIB**:BOOL
+  If enabled, tools will be linked with the libLLVM shared library. Defaults
+  to OFF. Setting LLVM_LINK_LLVM_DYLIB to ON also sets LLVM_BUILD_LLVM_DYLIB
+  to ON.
+
+**BUILD_SHARED_LIBS**:BOOL
+  Flag indicating if each LLVM component (e.g. Support) is built as a shared
+  library (ON) or as a static library (OFF). Its default value is OFF. On
+  Windows, shared libraries may be used when building with MinGW, including
+  mingw-w64, but not when building with the Microsoft toolchain.
+ 
+  .. note:: BUILD_SHARED_LIBS is only recommended for use by LLVM developers.
+If you want to build LLVM as a shared library, you should use the
+``LLVM_BUILD_LLVM_DYLIB`` option.
+
 Executing the test suite
 
 

Modified: vendor/llvm/dist/docs/ReleaseNotes.rst
==
--- vendor/llvm/dist/docs/ReleaseNotes.rst  Sun Feb 21 13:49:26 2016
(r295845)
+++ vendor/llvm/dist/docs/ReleaseNotes.rst  Sun Feb 21 13:51:43 2016
(r295846)
@@ -89,6 +89,30 @@ Non-comprehensive list of changes in thi
   the node ``N`` is guaranteed not to be the last in the list, it is safe to
   call ``&*++N->getIterator()`` directly.
 
+* The `Kaleidoscope 

svn commit: r295844 - in head/cddl/contrib/opensolaris/cmd: zfs zpool

2016-02-21 Thread Dimitry Andric
Author: dim
Date: Sun Feb 21 13:03:58 2016
New Revision: 295844
URL: https://svnweb.freebsd.org/changeset/base/295844

Log:
  Fix "invalid type '(null)'" usage messages in zfs(8) and zpool(8).
  
  Currently, zfs(8) and zpool(8) print "invalid type '(null)'" or similar
  messages, if you pass in invalid types, sources or column names for "zfs
  get", "zfs list" and "zpool get".  This is because the commands use
  getsubopt(3), and in case of failure, they print 'value', which is NULL
  when sub options don't match.
  
  They should print 'suboptarg' instead, which is the documented way to
  get at the non-matching sub option value.
  
  Reviewed by:  smh
  MFC after:3 days
  Differential Revision: https://reviews.freebsd.org/D5365

Modified:
  head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cSat Feb 20 22:58:33 
2016(r295843)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cSun Feb 21 13:03:58 
2016(r295844)
@@ -1713,7 +1713,7 @@ zfs_do_get(int argc, char **argv)
default:
(void) fprintf(stderr,
gettext("invalid column name "
-   "'%s'\n"), value);
+   "'%s'\n"), suboptarg);
usage(B_FALSE);
}
}
@@ -1750,7 +1750,7 @@ zfs_do_get(int argc, char **argv)
default:
(void) fprintf(stderr,
gettext("invalid source "
-   "'%s'\n"), value);
+   "'%s'\n"), suboptarg);
usage(B_FALSE);
}
}
@@ -1786,7 +1786,7 @@ zfs_do_get(int argc, char **argv)
default:
(void) fprintf(stderr,
gettext("invalid type '%s'\n"),
-   value);
+   suboptarg);
usage(B_FALSE);
}
}
@@ -3156,7 +3156,7 @@ zfs_do_list(int argc, char **argv)
default:
(void) fprintf(stderr,
gettext("invalid type '%s'\n"),
-   value);
+   suboptarg);
usage(B_FALSE);
}
}

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cSat Feb 20 
22:58:33 2016(r295843)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cSun Feb 21 
13:03:58 2016(r295844)
@@ -5431,7 +5431,7 @@ zpool_do_get(int argc, char **argv)
default:
(void) fprintf(stderr,
gettext("invalid column name "
-   "'%s'\n"), value);
+   "'%s'\n"), suboptarg);
usage(B_FALSE);
}
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"