svn commit: r286918 - in head/sys: conf dev/cyapa dev/ichiic dev/isl

2015-08-19 Thread Michael Gmelin
Author: grembo (ports committer)
Date: Wed Aug 19 09:49:29 2015
New Revision: 286918
URL: https://svnweb.freebsd.org/changeset/base/286918

Log:
  Allow building a kernel with baked in ig4, isl and cyapa drivers.
  
  Also addresses jhb's remarks on D2811 and D3068.
  
  PR:   202059
  Differential Revision:https://reviews.freebsd.org/D3351
  Reviewed by:  jhb
  Approved by:  jhb

Modified:
  head/sys/conf/files
  head/sys/dev/cyapa/cyapa.c
  head/sys/dev/ichiic/ig4_iic.c
  head/sys/dev/isl/isl.c

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Aug 19 06:08:11 2015(r286917)
+++ head/sys/conf/files Wed Aug 19 09:49:29 2015(r286918)
@@ -1236,6 +1236,7 @@ t5fw.fw   optional cxgbe  
\
 dev/cy/cy.coptional cy
 dev/cy/cy_isa.coptional cy isa
 dev/cy/cy_pci.coptional cy pci
+dev/cyapa/cyapa.c  optional cyapa smbus
 dev/dc/if_dc.c optional dc pci
 dev/dc/dcphy.c optional dc pci
 dev/dc/pnphy.c optional dc pci
@@ -1461,8 +1462,8 @@ dev/hptiop/hptiop.c   optional hptiop scb
 dev/hwpmc/hwpmc_logging.c  optional hwpmc
 dev/hwpmc/hwpmc_mod.c  optional hwpmc
 dev/hwpmc/hwpmc_soft.c optional hwpmc
-dev/ichiic/ig4_iic.c   optional ichiic
-dev/ichiic/ig4_pci.c   optional ichiic pci
+dev/ichiic/ig4_iic.c   optional ig4 smbus
+dev/ichiic/ig4_pci.c   optional ig4 pci smbus
 dev/ichsmb/ichsmb.coptional ichsmb
 dev/ichsmb/ichsmb_pci.coptional ichsmb pci
 dev/ida/ida.c  optional ida
@@ -1557,6 +1558,7 @@ dev/iscsi_initiator/isc_soc.c optional i
 dev/iscsi_initiator/isc_sm.c   optional iscsi_initiator scbus
 dev/iscsi_initiator/isc_subr.c optional iscsi_initiator scbus
 dev/ismt/ismt.coptional ismt
+dev/isl/isl.c  optional isl smbus
 dev/isp/isp.c  optional isp
 dev/isp/isp_freebsd.c  optional isp
 dev/isp/isp_library.c  optional isp

Modified: head/sys/dev/cyapa/cyapa.c
==
--- head/sys/dev/cyapa/cyapa.c  Wed Aug 19 06:08:11 2015(r286917)
+++ head/sys/dev/cyapa/cyapa.c  Wed Aug 19 09:49:29 2015(r286918)
@@ -149,7 +149,6 @@ struct cyapa_fifo {
 struct cyapa_softc {
device_t dev;
int count;  /* >0 if device opened */
-   int unit;
int addr;
struct cdev *devnode;
struct selinfo selinfo;
@@ -450,7 +449,6 @@ static int
 cyapa_probe(device_t dev)
 {
struct cyapa_cap cap;
-   int unit;
int addr;
int error;
 
@@ -463,8 +461,6 @@ cyapa_probe(device_t dev)
if (addr != 0x67)
return (ENXIO);
 
-   unit = device_get_unit(dev);
-
error = init_device(dev, &cap, addr, 1);
if (error != 0)
return (ENXIO);
@@ -486,7 +482,7 @@ cyapa_attach(device_t dev)
sc->reporting_mode = 1;
 
unit = device_get_unit(dev);
-   addr = *((unsigned char*) device_get_ivars(dev));
+   addr = smbus_get_addr(dev);
 
if (init_device(dev, &cap, addr, 0))
return (ENXIO);
@@ -494,7 +490,6 @@ cyapa_attach(device_t dev)
mtx_init(&sc->mutex, "cyapa", NULL, MTX_DEF);
 
sc->dev = dev;
-   sc->unit = unit;
sc->addr = addr;
 
knlist_init_mtx(&sc->selinfo.si_note, &sc->mutex);

Modified: head/sys/dev/ichiic/ig4_iic.c
==
--- head/sys/dev/ichiic/ig4_iic.c   Wed Aug 19 06:08:11 2015
(r286917)
+++ head/sys/dev/ichiic/ig4_iic.c   Wed Aug 19 09:49:29 2015
(r286918)
@@ -74,8 +74,8 @@ static void ig4iic_intr(void *cookie);
 static void ig4iic_dump(ig4iic_softc_t *sc);
 
 static int ig4_dump;
-SYSCTL_INT(_debug, OID_AUTO, ig4_dump, CTLTYPE_INT | CTLFLAG_RW,
-  &ig4_dump, 0, "");
+SYSCTL_INT(_debug, OID_AUTO, ig4_dump, CTLFLAG_RW,
+  &ig4_dump, 0, "Dump controller registers");
 
 /*
  * Low-level inline support functions

Modified: head/sys/dev/isl/isl.c
==
--- head/sys/dev/isl/isl.c  Wed Aug 19 06:08:11 2015(r286917)
+++ head/sys/dev/isl/isl.c  Wed Aug 19 09:49:29 2015(r286918)
@@ -71,12 +71,9 @@ __FBSDID("$FreeBSD$");
 
 struct isl_softc {
device_tdev;
-   int unit;
int addr;
 
struct sx   isl_sx;
-   struct sysctl_ctx_list *sysctl_ctx;
-   struct sysctl_oid *sysctl_tree;
 };
 
 /* Returns < 0 on problem. */
@@ -85,8 +82,7 @@ static int isl_read_sensor(device_t dev,
 /*
  * Initialize the device
  */
-static

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

2015-08-19 Thread Andriy Gapon
On 14/08/2015 16:43, Alexander Motin wrote:
> Author: mav
> Date: Fri Aug 14 13:43:12 2015
> New Revision: 286776
> URL: https://svnweb.freebsd.org/changeset/base/286776
> 
> Log:
>   Remove some random accumulated diff from Illumos.
>   
>   Submitted by:   avg (partially)
> 
> Modified:
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
> 

[snip]

> @@ -6514,6 +6509,12 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr)
>   csize = zio_compress_data(ZIO_COMPRESS_LZ4, hdr->b_l1hdr.b_tmp_cdata,
>   cdata, l2hdr->b_asize);
>  
> + rounded = P2ROUNDUP(csize, (size_t)SPA_MINBLOCKSIZE);
> + if (rounded > csize) {
> + bzero((char *)cdata + csize, rounded - csize);
> + csize = rounded;
> + }
> +
>   if (csize == 0) {
>   /* zero block, indicate that there's nothing to write */
>   zio_data_buf_free(cdata, len);
> @@ -6522,19 +6523,11 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr)
>   hdr->b_l1hdr.b_tmp_cdata = NULL;
>   ARCSTAT_BUMP(arcstat_l2_compress_zeros);
>   return (B_TRUE);
> - }
> -
> - rounded = P2ROUNDUP(csize,
> - (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift);
> - if (rounded < len) {

Alexander,

it is my fault, but this commit introduced a regression for L2ARC
devices with ashift > 9: P2ROUNDUP(1 <<
l2hdr->b_dev->l2ad_vdev->vdev_ashift) became P2ROUNDUP(SPA_MINBLOCKSIZE)
while the line got moved.

-- 
Andriy Gapon
___
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: r286919 - in head/sys/arm64: arm64 include

2015-08-19 Thread Zbigniew Bodek
Author: zbb
Date: Wed Aug 19 10:36:36 2015
New Revision: 286919
URL: https://svnweb.freebsd.org/changeset/base/286919

Log:
  Add SMP support to GICv3 and ITS drivers
  
  Introduce supprot for SMP to GICv3 and ITS drivers.
  
  Obtained from: Semihalf
  Sponsored by:  The FreeBSD Foundation
  Differential Revision: https://reviews.freebsd.org/D3299

Modified:
  head/sys/arm64/arm64/gic_v3.c
  head/sys/arm64/arm64/gic_v3_its.c
  head/sys/arm64/arm64/gic_v3_reg.h
  head/sys/arm64/arm64/gic_v3_var.h
  head/sys/arm64/include/cpu.h

Modified: head/sys/arm64/arm64/gic_v3.c
==
--- head/sys/arm64/arm64/gic_v3.c   Wed Aug 19 09:49:29 2015
(r286918)
+++ head/sys/arm64/arm64/gic_v3.c   Wed Aug 19 10:36:36 2015
(r286919)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -61,6 +62,10 @@ static void gic_v3_dispatch(device_t, st
 static void gic_v3_eoi(device_t, u_int);
 static void gic_v3_mask_irq(device_t, u_int);
 static void gic_v3_unmask_irq(device_t, u_int);
+#ifdef SMP
+static void gic_v3_init_secondary(device_t);
+static void gic_v3_ipi_send(device_t, cpuset_t, u_int);
+#endif
 
 static device_method_t gic_v3_methods[] = {
/* Device interface */
@@ -71,7 +76,10 @@ static device_method_t gic_v3_methods[] 
DEVMETHOD(pic_eoi,  gic_v3_eoi),
DEVMETHOD(pic_mask, gic_v3_mask_irq),
DEVMETHOD(pic_unmask,   gic_v3_unmask_irq),
-
+#ifdef SMP
+   DEVMETHOD(pic_init_secondary,   gic_v3_init_secondary),
+   DEVMETHOD(pic_ipi_send, gic_v3_ipi_send),
+#endif
/* End */
DEVMETHOD_END
 };
@@ -95,6 +103,7 @@ enum gic_v3_xdist {
 
 /* Helper routines starting with gic_v3_ */
 static int gic_v3_dist_init(struct gic_v3_softc *);
+static int gic_v3_redist_alloc(struct gic_v3_softc *);
 static int gic_v3_redist_find(struct gic_v3_softc *);
 static int gic_v3_redist_init(struct gic_v3_softc *);
 static int gic_v3_cpu_init(struct gic_v3_softc *);
@@ -105,11 +114,21 @@ typedef int (*gic_v3_initseq_t) (struct 
 /* Primary CPU initialization sequence */
 static gic_v3_initseq_t gic_v3_primary_init[] = {
gic_v3_dist_init,
+   gic_v3_redist_alloc,
gic_v3_redist_init,
gic_v3_cpu_init,
NULL
 };
 
+#ifdef SMP
+/* Secondary CPU initialization sequence */
+static gic_v3_initseq_t gic_v3_secondary_init[] = {
+   gic_v3_redist_init,
+   gic_v3_cpu_init,
+   NULL
+};
+#endif
+
 /*
  * Device interface.
  */
@@ -213,7 +232,7 @@ gic_v3_detach(device_t dev)
for (rid = 0; rid < (sc->gic_redists.nregions + 1); rid++)
bus_release_resource(dev, SYS_RES_MEMORY, rid, 
sc->gic_res[rid]);
 
-   for (i = 0; i < MAXCPU; i++)
+   for (i = 0; i < mp_ncpus; i++)
free(sc->gic_redists.pcpu[i], M_GIC_V3);
 
free(sc->gic_res, M_GIC_V3);
@@ -258,13 +277,9 @@ gic_v3_dispatch(device_t dev, struct tra
}
 
if (active_irq <= GIC_LAST_SGI) {
-   /*
-* TODO: Implement proper SGI handling.
-*   Mask it if such is received for some reason.
-*/
-   device_printf(dev,
-   "Received unsupported interrupt type: SGI\n");
-   PIC_MASK(dev, active_irq);
+   gic_icc_write(EOIR1, (uint64_t)active_irq);
+   arm_dispatch_intr(active_irq, frame);
+   continue;
}
}
 }
@@ -283,7 +298,7 @@ gic_v3_mask_irq(device_t dev, u_int irq)
 
sc = device_get_softc(dev);
 
-   if (irq >= GIC_FIRST_PPI && irq <= GIC_LAST_PPI) { /* PPIs in 
corresponding Re-Distributor */
+   if (irq <= GIC_LAST_PPI) { /* SGIs and PPIs in corresponding 
Re-Distributor */
gic_r_write(sc, 4,
GICR_SGI_BASE_SIZE + GICD_ICENABLER(irq), GICD_I_MASK(irq));
gic_v3_wait_for_rwp(sc, REDIST);
@@ -303,7 +318,7 @@ gic_v3_unmask_irq(device_t dev, u_int ir
 
sc = device_get_softc(dev);
 
-   if (irq >= GIC_FIRST_PPI && irq <= GIC_LAST_PPI) { /* PPIs in 
corresponding Re-Distributor */
+   if (irq <= GIC_LAST_PPI) { /* SGIs and PPIs in corresponding 
Re-Distributor */
gic_r_write(sc, 4,
GICR_SGI_BASE_SIZE + GICD_ISENABLER(irq), GICD_I_MASK(irq));
gic_v3_wait_for_rwp(sc, REDIST);
@@ -316,6 +331,101 @@ gic_v3_unmask_irq(device_t dev, u_int ir
panic("%s: Unsupported IRQ number %u", __func__, irq);
 }
 
+#ifdef SMP
+static void
+gic_v3_init_secondary(device_t dev)
+{
+   struct gic_v3_softc *sc;
+   gic_v3_initseq_t *init_func;
+   int err;
+
+   sc = device_get_softc(dev);
+
+   /* Train init sequence for boot CPU */
+   for (init_func = gic_v3_s

svn commit: r286920 - head/sys/arm64/arm64

2015-08-19 Thread Zbigniew Bodek
Author: zbb
Date: Wed Aug 19 11:45:45 2015
New Revision: 286920
URL: https://svnweb.freebsd.org/changeset/base/286920

Log:
  Remove redundant mp_naps from ARM64 secondary CPU start-up code
  
  The global variable has been only used for CPU startup ordering
  which is not needed anyway.
  
  Obtained from: Semihalf
  Sponsored by:  The FreeBSD Foundation
  Differential Revision: https://reviews.freebsd.org/D3296

Modified:
  head/sys/arm64/arm64/mp_machdep.c

Modified: head/sys/arm64/arm64/mp_machdep.c
==
--- head/sys/arm64/arm64/mp_machdep.c   Wed Aug 19 10:36:36 2015
(r286919)
+++ head/sys/arm64/arm64/mp_machdep.c   Wed Aug 19 11:45:45 2015
(r286920)
@@ -94,8 +94,6 @@ void init_secondary(uint64_t);
 
 uint8_t secondary_stacks[MAXCPU - 1][PAGE_SIZE * KSTACK_PAGES] __aligned(16);
 
-/* # of Applications processors */
-volatile int mp_naps;
 /* Set to 1 once we're ready to let the APs out of the pen. */
 volatile int aps_ready = 0;
 
@@ -211,16 +209,6 @@ init_secondary(uint64_t cpu)
"mov x18, %0 \n"
"msr tpidr_el1, %0" :: "r"(pcpup));
 
-   /*
-* pcpu_init() updates queue, so it should not be executed in parallel
-* on several cores
-*/
-   while(mp_naps < (cpu - 1))
-   ;
-
-   /* Signal our startup to BSP */
-   atomic_add_rel_32(&mp_naps, 1);
-
/* Spin until the BSP releases the APs */
while (!aps_ready)
__asm __volatile("wfe");
___
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: r286921 - head/sys/kern

2015-08-19 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 19 11:53:32 2015
New Revision: 286921
URL: https://svnweb.freebsd.org/changeset/base/286921

Log:
  fget_unlocked() depends on the freed struct file f_count field being
  zero.  The file_zone if no-free, but r284861 added trashing of the
  freed memory.  Most visible manifestation of the issue were 'memory
  modified after free' panics for the file zone, triggered from
  falloc_noinstall().
  
  Add UMA_ZONE_ZINIT flag to turn off trashing.  Mjg noted that it makes
  sense to not trash freed memory for any non-free zone, which will be
  done later.
  
  Reported and tested by:   pho
  Discussed with:   mjg
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cWed Aug 19 11:45:45 2015
(r286920)
+++ head/sys/kern/kern_descrip.cWed Aug 19 11:53:32 2015
(r286921)
@@ -3833,7 +3833,7 @@ filelistinit(void *dummy)
 {
 
file_zone = uma_zcreate("Files", sizeof(struct file), NULL, NULL,
-   NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+   NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE | UMA_ZONE_ZINIT);
filedesc0_zone = uma_zcreate("filedesc0", sizeof(struct filedesc0),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
mtx_init(&sigio_lock, "sigio lock", NULL, MTX_DEF);
___
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: r286922 - head/sys/arm64/include

2015-08-19 Thread Zbigniew Bodek
Author: zbb
Date: Wed Aug 19 11:59:41 2015
New Revision: 286922
URL: https://svnweb.freebsd.org/changeset/base/286922

Log:
  Increase MAXCPU in ARM64
  
  Increase MAXCPU number to the maximum known value the existing
  hardware can support.
  
  Obtained from: Semihalf
  Sponsored by:  The FreeBSD Foundation
  Differential Revision: https://reviews.freebsd.org/D3405

Modified:
  head/sys/arm64/include/param.h

Modified: head/sys/arm64/include/param.h
==
--- head/sys/arm64/include/param.h  Wed Aug 19 11:53:32 2015
(r286921)
+++ head/sys/arm64/include/param.h  Wed Aug 19 11:59:41 2015
(r286922)
@@ -51,7 +51,7 @@
 
 #if defined(SMP) || defined(KLD_MODULE)
 #ifndef MAXCPU
-#defineMAXCPU  2
+#defineMAXCPU  96
 #endif
 #else
 #defineMAXCPU  1
___
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: r286923 - head/sys/powerpc/mpc85xx

2015-08-19 Thread Justin Hibbits
Author: jhibbits
Date: Wed Aug 19 13:23:07 2015
New Revision: 286923
URL: https://svnweb.freebsd.org/changeset/base/286923

Log:
  Remove debug printf.

Modified:
  head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c

Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c
==
--- head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Wed Aug 19 11:59:41 2015
(r286922)
+++ head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Wed Aug 19 13:23:07 2015
(r286923)
@@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$");
 static int
 fsl_pcib_rc_probe(device_t dev)
 {
-   printf("Probe called\n");
if (pci_get_vendor(dev) != 0x1957)
return (ENXIO);
if (pci_get_progif(dev) != 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"


svn commit: r286924 - head/sys/amd64/cloudabi64

2015-08-19 Thread Baptiste Daroussin
Author: bapt
Date: Wed Aug 19 15:18:32 2015
New Revision: 286924
URL: https://svnweb.freebsd.org/changeset/base/286924

Log:
  Add a kern.features.cloudabi64 entry when the module is loaded to helps the
  userland to be able to test is cloudabi64 is supported or not
  
  Reviewed by:  ed
  Differential Revision:https://reviews.freebsd.org/D3430

Modified:
  head/sys/amd64/cloudabi64/cloudabi64_sysvec.c

Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
==
--- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c   Wed Aug 19 13:23:07 
2015(r286923)
+++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c   Wed Aug 19 15:18:32 
2015(r286924)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -272,3 +273,4 @@ static moduledata_t cloudabi64_module = 
 
 DECLARE_MODULE_TIED(cloudabi64, cloudabi64_module, SI_SUB_EXEC, SI_ORDER_ANY);
 MODULE_DEPEND(cloudabi64, cloudabi, 1, 1, 1);
+FEATURE(cloudabi64, "CloudABI 64bit support");
___
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: r286926 - head/sys/dev/cxgbe

2015-08-19 Thread Navdeep Parhar
Author: np
Date: Wed Aug 19 15:40:03 2015
New Revision: 286926
URL: https://svnweb.freebsd.org/changeset/base/286926

Log:
  cxgbe(4):  Save the flags for the last adapter-wide synchronized
  operation that was initiated successfully.  (The caller and thread are
  already recorded).
  
  MFC after:1 week

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hWed Aug 19 15:30:55 2015
(r286925)
+++ head/sys/dev/cxgbe/adapter.hWed Aug 19 15:40:03 2015
(r286926)
@@ -808,6 +808,7 @@ struct adapter {
 #ifdef INVARIANTS
const char *last_op;
const void *last_op_thr;
+   int last_op_flags;
 #endif
 
int sc_do_rxcopy;

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cWed Aug 19 15:30:55 2015
(r286925)
+++ head/sys/dev/cxgbe/t4_main.cWed Aug 19 15:40:03 2015
(r286926)
@@ -1149,6 +1149,7 @@ cxgbe_detach(device_t dev)
 #ifdef INVARIANTS
sc->last_op = "t4detach";
sc->last_op_thr = curthread;
+   sc->last_op_flags = 0;
 #endif
ADAPTER_UNLOCK(sc);
 
@@ -3165,6 +3166,7 @@ begin_synchronized_op(struct adapter *sc
 #ifdef INVARIANTS
sc->last_op = wmesg;
sc->last_op_thr = curthread;
+   sc->last_op_flags = flags;
 #endif
 
 done:
___
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: r286932 - head/release/doc/en_US.ISO8859-1/errata stable/10/release/doc/en_US.ISO8859-1/errata stable/9/release/doc/en_US.ISO8859-1/errata

2015-08-19 Thread Glen Barber
Author: gjb
Date: Wed Aug 19 17:51:03 2015
New Revision: 286932
URL: https://svnweb.freebsd.org/changeset/base/286932

Log:
  Remove a broken link.
  While here, prefer https where possible.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/errata/article.xml

Changes in other areas also in this revision:
Modified:
  stable/10/release/doc/en_US.ISO8859-1/errata/article.xml
  stable/9/release/doc/en_US.ISO8859-1/errata/article.xml

Modified: head/release/doc/en_US.ISO8859-1/errata/article.xml
==
--- head/release/doc/en_US.ISO8859-1/errata/article.xml Wed Aug 19 17:47:47 
2015(r286931)
+++ head/release/doc/en_US.ISO8859-1/errata/article.xml Wed Aug 19 17:51:03 
2015(r286932)
@@ -62,7 +62,7 @@
   the Internet and should be consulted as the current
   errata for this release.  These other copies of the
   errata are located at
-  http://www.FreeBSD.org/releases/"; />,
+  https://www.FreeBSD.org/releases/"; />,
   plus any sites
   which keep up-to-date mirrors of this location.
 
@@ -71,8 +71,7 @@
   the snapshot).
 
 For a list of all &os; CERT security advisories, see
-  http://www.FreeBSD.org/security/"; />
-  or ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/"; />.
+  https://www.FreeBSD.org/security/"/>.
   
 
   
___
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: r286933 - head/usr.sbin/pkg

2015-08-19 Thread Xin LI
Author: delphij
Date: Wed Aug 19 18:24:39 2015
New Revision: 286933
URL: https://svnweb.freebsd.org/changeset/base/286933

Log:
  Issue warning and refuse to proceed further if the configured
  repository signature_type is unsupported by bootstrap pkg(7).
  
  Previously, when signature_type specified an unsupported method,
  the bootstrap pkg(7) would proceed like when signature_type is
  "none".  MITM attackers may be able to use this vulnerability and
  bypass validation and install their own versions of pkg(8).
  
  At this time, only fingerprint and none are supported by the
  bootstrap pkg(7).
  
  FreeBSD's official pkg(8) repository uses the fingerprint method
  and is therefore unaffected.
  
  Errata candidate.
  
  Discussed with:   bapt@
  Submitted by: Fabian Keil
  Obtained from:ElectroBSD

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

Modified: head/usr.sbin/pkg/pkg.c
==
--- head/usr.sbin/pkg/pkg.c Wed Aug 19 17:51:03 2015(r286932)
+++ head/usr.sbin/pkg/pkg.c Wed Aug 19 18:24:39 2015(r286933)
@@ -767,7 +767,13 @@ bootstrap_pkg(bool force)
goto fetchfail;
 
if (signature_type != NULL &&
-   strcasecmp(signature_type, "FINGERPRINTS") == 0) {
+   strcasecmp(signature_type, "NONE") != 0) {
+   if (strcasecmp(signature_type, "FINGERPRINTS") != 0) {
+   warnx("Signature type %s is not supported for "
+   "bootstrapping.", signature_type);
+   goto cleanup;
+   }
+
snprintf(tmpsig, MAXPATHLEN, "%s/pkg.txz.sig.XX",
getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP);
snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz.sig",
@@ -855,7 +861,13 @@ bootstrap_pkg_local(const char *pkgpath,
goto cleanup;
}
if (signature_type != NULL &&
-   strcasecmp(signature_type, "FINGERPRINTS") == 0) {
+   strcasecmp(signature_type, "NONE") != 0) {
+   if (strcasecmp(signature_type, "FINGERPRINTS") != 0) {
+   warnx("Signature type %s is not supported for "
+   "bootstrapping.", signature_type);
+   goto cleanup;
+   }
+
snprintf(path, sizeof(path), "%s.sig", pkgpath);
 
if ((fd_sig = open(path, O_RDONLY)) == -1) {
___
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: r286934 - head/include

2015-08-19 Thread Jason Evans
Author: jasone
Date: Wed Aug 19 18:32:12 2015
New Revision: 286934
URL: https://svnweb.freebsd.org/changeset/base/286934

Log:
  Use bool rather than _Bool for C++ compatibility.
  
  Submitted by: Nikolai Lifanov

Modified:
  head/include/malloc_np.h

Modified: head/include/malloc_np.h
==
--- head/include/malloc_np.hWed Aug 19 18:24:39 2015(r286933)
+++ head/include/malloc_np.hWed Aug 19 18:32:12 2015(r286934)
@@ -33,17 +33,17 @@
 #define_MALLOC_NP_H_
 #include 
 #include 
+#include 
 #include 
 
 __BEGIN_DECLS
-typedef void *(chunk_alloc_t)(void *, size_t, size_t, _Bool *, _Bool *,
-unsigned);
-typedef _Bool (chunk_dalloc_t)(void *, size_t, _Bool, unsigned);
-typedef _Bool (chunk_commit_t)(void *, size_t, size_t, size_t, unsigned);
-typedef _Bool (chunk_decommit_t)(void *, size_t, size_t, size_t, unsigned);
-typedef _Bool (chunk_purge_t)(void *, size_t, size_t, size_t, unsigned);
-typedef _Bool (chunk_split_t)(void *, size_t, size_t, size_t, _Bool, unsigned);
-typedef _Bool (chunk_merge_t)(void *, size_t, void *, size_t, _Bool, unsigned);
+typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, 
unsigned);
+typedef bool (chunk_dalloc_t)(void *, size_t, bool, unsigned);
+typedef bool (chunk_commit_t)(void *, size_t, size_t, size_t, unsigned);
+typedef bool (chunk_decommit_t)(void *, size_t, size_t, size_t, unsigned);
+typedef bool (chunk_purge_t)(void *, size_t, size_t, size_t, unsigned);
+typedef bool (chunk_split_t)(void *, size_t, size_t, size_t, bool, unsigned);
+typedef bool (chunk_merge_t)(void *, size_t, void *, size_t, bool, unsigned);
 typedef struct {
chunk_alloc_t   *alloc;
chunk_dalloc_t  *dalloc;
___
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: r286937 - head/usr.bin/truss

2015-08-19 Thread John Baldwin
Author: jhb
Date: Wed Aug 19 19:59:42 2015
New Revision: 286937
URL: https://svnweb.freebsd.org/changeset/base/286937

Log:
  Use nitems().

Modified:
  head/usr.bin/truss/amd64-fbsd.c
  head/usr.bin/truss/amd64-fbsd32.c
  head/usr.bin/truss/amd64-linux32.c
  head/usr.bin/truss/arm-fbsd.c
  head/usr.bin/truss/i386-fbsd.c
  head/usr.bin/truss/i386-linux.c
  head/usr.bin/truss/mips-fbsd.c
  head/usr.bin/truss/powerpc-fbsd.c
  head/usr.bin/truss/powerpc64-fbsd.c
  head/usr.bin/truss/sparc64-fbsd.c

Modified: head/usr.bin/truss/amd64-fbsd.c
==
--- head/usr.bin/truss/amd64-fbsd.c Wed Aug 19 18:33:25 2015
(r286936)
+++ head/usr.bin/truss/amd64-fbsd.c Wed Aug 19 19:59:42 2015
(r286937)
@@ -64,7 +64,7 @@ static const char rcsid[] =
 
 #include "syscalls.h"
 
-static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]);
+static int nsyscalls = nitems(syscallnames);
 
 /*
  * This is what this particular file uses to keep track of a system call.

Modified: head/usr.bin/truss/amd64-fbsd32.c
==
--- head/usr.bin/truss/amd64-fbsd32.c   Wed Aug 19 18:33:25 2015
(r286936)
+++ head/usr.bin/truss/amd64-fbsd32.c   Wed Aug 19 19:59:42 2015
(r286937)
@@ -64,8 +64,7 @@ static const char rcsid[] =
 
 #include "freebsd32_syscalls.h"
 
-static int nsyscalls = sizeof(freebsd32_syscallnames) /
-sizeof(freebsd32_syscallnames[0]);
+static int nsyscalls = nitems(freebsd32_syscallnames);
 
 /*
  * This is what this particular file uses to keep track of a system call.

Modified: head/usr.bin/truss/amd64-linux32.c
==
--- head/usr.bin/truss/amd64-linux32.c  Wed Aug 19 18:33:25 2015
(r286936)
+++ head/usr.bin/truss/amd64-linux32.c  Wed Aug 19 19:59:42 2015
(r286937)
@@ -61,8 +61,7 @@ static const char rcsid[] =
 
 #include "linux32_syscalls.h"
 
-static int nsyscalls =
-   sizeof(linux32_syscallnames) / sizeof(linux32_syscallnames[0]);
+static int nsyscalls = nitems(linux32_syscallnames);
 
 /*
  * This is what this particular file uses to keep track of a system call.
@@ -310,8 +309,7 @@ amd64_linux32_syscall_exit(struct trussi
 * but that complicates things considerably.
 */
if (errorp) {
-   for (i = 0;
-   (size_t)i < sizeof(bsd_to_linux_errno) / sizeof(int); i++) {
+   for (i = 0; (size_t)i < nitems(bsd_to_linux_errno); i++) {
if (retval == bsd_to_linux_errno[i])
break;
}

Modified: head/usr.bin/truss/arm-fbsd.c
==
--- head/usr.bin/truss/arm-fbsd.c   Wed Aug 19 18:33:25 2015
(r286936)
+++ head/usr.bin/truss/arm-fbsd.c   Wed Aug 19 19:59:42 2015
(r286937)
@@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$");
 #include "syscalls.h"
 
 
-static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]);
+static int nsyscalls = nitems(syscallnames);
 
 /*
  * This is what this particular file uses to keep track of a system call.

Modified: head/usr.bin/truss/i386-fbsd.c
==
--- head/usr.bin/truss/i386-fbsd.c  Wed Aug 19 18:33:25 2015
(r286936)
+++ head/usr.bin/truss/i386-fbsd.c  Wed Aug 19 19:59:42 2015
(r286937)
@@ -64,7 +64,7 @@ static const char rcsid[] =
 
 #include "syscalls.h"
 
-static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]);
+static int nsyscalls = nitems(syscallnames);
 
 /*
  * This is what this particular file uses to keep track of a system call.

Modified: head/usr.bin/truss/i386-linux.c
==
--- head/usr.bin/truss/i386-linux.c Wed Aug 19 18:33:25 2015
(r286936)
+++ head/usr.bin/truss/i386-linux.c Wed Aug 19 19:59:42 2015
(r286937)
@@ -61,8 +61,7 @@ static const char rcsid[] =
 
 #include "linux_syscalls.h"
 
-static int nsyscalls =
-   sizeof(linux_syscallnames) / sizeof(linux_syscallnames[0]);
+static int nsyscalls = nitems(linux_syscallnames);
 
 /*
  * This is what this particular file uses to keep track of a system call.
@@ -309,8 +308,7 @@ i386_linux_syscall_exit(struct trussinfo
 * but that complicates things considerably.
 */
if (errorp) {
-   for (i = 0;
-   (size_t)i < sizeof(bsd_to_linux_errno) / sizeof(int); i++) {
+   for (i = 0; (size_t)i < nitems(bsd_to_linux_errno); i++) {
if (retval == bsd_to_linux_errno[i])
break;
}

Modified: head/usr.bin/truss/mips-fbsd.c
==
--- 

svn commit: r286938 - head/usr.bin/truss

2015-08-19 Thread John Baldwin
Author: jhb
Date: Wed Aug 19 20:02:03 2015
New Revision: 286938
URL: https://svnweb.freebsd.org/changeset/base/286938

Log:
  Various style and whitespace fixes.

Modified:
  head/usr.bin/truss/amd64-fbsd.c
  head/usr.bin/truss/amd64-fbsd32.c
  head/usr.bin/truss/amd64-linux32.c
  head/usr.bin/truss/arm-fbsd.c
  head/usr.bin/truss/i386-fbsd.c
  head/usr.bin/truss/i386-linux.c
  head/usr.bin/truss/mips-fbsd.c
  head/usr.bin/truss/powerpc-fbsd.c
  head/usr.bin/truss/powerpc64-fbsd.c
  head/usr.bin/truss/sparc64-fbsd.c
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/amd64-fbsd.c
==
--- head/usr.bin/truss/amd64-fbsd.c Wed Aug 19 19:59:42 2015
(r286937)
+++ head/usr.bin/truss/amd64-fbsd.c Wed Aug 19 20:02:03 2015
(r286938)
@@ -305,6 +305,7 @@ amd64_syscall_exit(struct trussinfo *tru
 */
for (i = 0; i < sc->nargs; i++) {
char *temp;
+
if (sc->args[i].type & OUT) {
/*
 * If an error occurred, then don't bother

Modified: head/usr.bin/truss/amd64-fbsd32.c
==
--- head/usr.bin/truss/amd64-fbsd32.c   Wed Aug 19 19:59:42 2015
(r286937)
+++ head/usr.bin/truss/amd64-fbsd32.c   Wed Aug 19 20:02:03 2015
(r286938)
@@ -305,6 +305,7 @@ amd64_fbsd32_syscall_exit(struct trussin
 */
for (i = 0; i < sc->nargs; i++) {
char *temp;
+
if (sc->args[i].type & OUT) {
/*
 * If an error occurred, then don't bother

Modified: head/usr.bin/truss/amd64-linux32.c
==
--- head/usr.bin/truss/amd64-linux32.c  Wed Aug 19 19:59:42 2015
(r286937)
+++ head/usr.bin/truss/amd64-linux32.c  Wed Aug 19 20:02:03 2015
(r286938)
@@ -287,6 +287,7 @@ amd64_linux32_syscall_exit(struct trussi
 */
for (i = 0; i < sc->nargs; i++) {
char *temp;
+
if (sc->args[i].type & OUT) {
/*
 * If an error occurred, then don't bother

Modified: head/usr.bin/truss/arm-fbsd.c
==
--- head/usr.bin/truss/arm-fbsd.c   Wed Aug 19 19:59:42 2015
(r286937)
+++ head/usr.bin/truss/arm-fbsd.c   Wed Aug 19 20:02:03 2015
(r286938)
@@ -336,6 +336,7 @@ arm_syscall_exit(struct trussinfo *truss
 */
for (i = 0; i < sc->nargs; i++) {
char *temp;
+
if (sc->args[i].type & OUT) {
/*
 * If an error occurred, then don't bother

Modified: head/usr.bin/truss/i386-fbsd.c
==
--- head/usr.bin/truss/i386-fbsd.c  Wed Aug 19 19:59:42 2015
(r286937)
+++ head/usr.bin/truss/i386-fbsd.c  Wed Aug 19 20:02:03 2015
(r286938)
@@ -299,6 +299,7 @@ i386_syscall_exit(struct trussinfo *trus
 */
for (i = 0; i < sc->nargs; i++) {
char *temp;
+
if (sc->args[i].type & OUT) {
/*
 * If an error occurred, then don't bother

Modified: head/usr.bin/truss/i386-linux.c
==
--- head/usr.bin/truss/i386-linux.c Wed Aug 19 19:59:42 2015
(r286937)
+++ head/usr.bin/truss/i386-linux.c Wed Aug 19 20:02:03 2015
(r286938)
@@ -286,6 +286,7 @@ i386_linux_syscall_exit(struct trussinfo
 */
for (i = 0; i < sc->nargs; i++) {
char *temp;
+
if (sc->args[i].type & OUT) {
/*
 * If an error occurred, then don't bother

Modified: head/usr.bin/truss/mips-fbsd.c
==
--- head/usr.bin/truss/mips-fbsd.c  Wed Aug 19 19:59:42 2015
(r286937)
+++ head/usr.bin/truss/mips-fbsd.c  Wed Aug 19 20:02:03 2015
(r286938)
@@ -333,6 +333,7 @@ mips_syscall_exit(struct trussinfo *trus
 */
for (i = 0; i < sc->nargs; i++) {
char *temp;
+
if (sc->args[i].type & OUT) {
/*
 * If an error occurred, then don't bother

Modified: head/usr.bin/truss/powerpc-fbsd.c

svn commit: r286939 - head/usr.bin/truss

2015-08-19 Thread John Baldwin
Author: jhb
Date: Wed Aug 19 20:09:14 2015
New Revision: 286939
URL: https://svnweb.freebsd.org/changeset/base/286939

Log:
  Always use %j with an intmax_t cast to print time_t values.  time_t is
  longer than long on 32-bit platforms with a 64-bit time_t.
  
  Inspired by:  mail from bde

Modified:
  head/usr.bin/truss/main.c
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/main.c
==
--- head/usr.bin/truss/main.c   Wed Aug 19 20:02:03 2015(r286938)
+++ head/usr.bin/truss/main.c   Wed Aug 19 20:09:14 2015(r286939)
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -323,15 +324,15 @@ START_TRACE:
if (trussinfo->flags & ABSOLUTETIMESTAMPS) {
timespecsubt(&trussinfo->curthread->after,
&trussinfo->start_time, &timediff);
-   fprintf(trussinfo->outfile, "%ld.%09ld ",
-   (long)timediff.tv_sec,
+   fprintf(trussinfo->outfile, "%jd.%09ld ",
+   (intmax_t)timediff.tv_sec,
timediff.tv_nsec);
}
if (trussinfo->flags & RELATIVETIMESTAMPS) {
timespecsubt(&trussinfo->curthread->after,
&trussinfo->curthread->before, &timediff);
-   fprintf(trussinfo->outfile, "%ld.%09ld ",
-   (long)timediff.tv_sec,
+   fprintf(trussinfo->outfile, "%jd.%09ld ",
+   (intmax_t)timediff.tv_sec,
timediff.tv_nsec);
}
signame = strsig(trussinfo->pr_data);
@@ -348,15 +349,16 @@ START_TRACE:
if (trussinfo->flags & ABSOLUTETIMESTAMPS) {
timespecsubt(&trussinfo->curthread->after,
&trussinfo->start_time, &timediff);
-   fprintf(trussinfo->outfile, "%ld.%09ld ",
-   (long)timediff.tv_sec,
+   fprintf(trussinfo->outfile, "%jd.%09ld ",
+   (intmax_t)timediff.tv_sec,
timediff.tv_nsec);
}
if (trussinfo->flags & RELATIVETIMESTAMPS) {
timespecsubt(&trussinfo->curthread->after,
&trussinfo->curthread->before, &timediff);
-   fprintf(trussinfo->outfile, "%ld.%09ld ",
-   (long)timediff.tv_sec, timediff.tv_nsec);
+   fprintf(trussinfo->outfile, "%jd.%09ld ",
+   (intmax_t)timediff.tv_sec,
+   timediff.tv_nsec);
}
fprintf(trussinfo->outfile,
"process exit, rval = %u\n", trussinfo->pr_data);

Modified: head/usr.bin/truss/syscalls.c
==
--- head/usr.bin/truss/syscalls.c   Wed Aug 19 20:02:03 2015
(r286938)
+++ head/usr.bin/truss/syscalls.c   Wed Aug 19 20:09:14 2015
(r286939)
@@ -993,7 +993,7 @@ print_arg(struct syscall_args *sc, unsig
 
if (get_struct(pid, (void *)args[sc->offset], &ts,
sizeof(ts)) != -1)
-   fprintf(fp, "{ %ld.%09ld }", (long)ts.tv_sec,
+   fprintf(fp, "{ %jd.%09ld }", (intmax_t)ts.tv_sec,
ts.tv_nsec);
else
fprintf(fp, "0x%lx", args[sc->offset]);
@@ -1019,8 +1019,9 @@ print_arg(struct syscall_args *sc, unsig
fprintf(fp, "UTIME_OMIT");
break;
default:
-   fprintf(fp, "%ld.%09ld",
-   (long)ts[i].tv_sec, ts[i].tv_nsec);
+   fprintf(fp, "%jd.%09ld",
+   (intmax_t)ts[i].tv_sec,
+   ts[i].tv_nsec);
break;
}
}
@@ -1034,7 +1035,7 @@ print_arg(struct syscall_args *sc, unsig
 
if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv))
!= -1)
-   fprintf(fp, "{ %ld.%06ld }", (long)tv.tv_sec,
+   fprintf(fp, "{ %jd.%06ld }", (intmax_t)

svn commit: r286940 - head/usr.bin/truss

2015-08-19 Thread John Baldwin
Author: jhb
Date: Wed Aug 19 20:10:58 2015
New Revision: 286940
URL: https://svnweb.freebsd.org/changeset/base/286940

Log:
  ino_t is unsigned, so use uintmax_t instead of intmax_t when printing it.
  
  Submitted by: bde (sort of)

Modified:
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/syscalls.c
==
--- head/usr.bin/truss/syscalls.c   Wed Aug 19 20:09:14 2015
(r286939)
+++ head/usr.bin/truss/syscalls.c   Wed Aug 19 20:10:58 2015
(r286940)
@@ -1397,8 +1397,8 @@ print_arg(struct syscall_args *sc, unsig
 
strmode(st.st_mode, mode);
fprintf(fp,
-   "{ mode=%s,inode=%jd,size=%jd,blksize=%ld }", mode,
-   (intmax_t)st.st_ino, (intmax_t)st.st_size,
+   "{ mode=%s,inode=%ju,size=%jd,blksize=%ld }", mode,
+   (uintmax_t)st.st_ino, (intmax_t)st.st_size,
(long)st.st_blksize);
} else {
fprintf(fp, "0x%lx", args[sc->offset]);
___
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: r286941 - in head: lib/libc/gen tools/regression/lib/libc/gen

2015-08-19 Thread Jilles Tjoelker
Author: jilles
Date: Wed Aug 19 20:31:03 2015
New Revision: 286941
URL: https://svnweb.freebsd.org/changeset/base/286941

Log:
  wordexp(): Improve some error codes.
  
  Distinguish between WRDE_BADVAL and WRDE_SYNTAX based on when the error
  occurred (parsing or execution), not based on whether WRDE_UNDEF was passed.
  
  Also, return WRDE_NOSPACE for a few more unexpected results from sh.

Modified:
  head/lib/libc/gen/wordexp.3
  head/lib/libc/gen/wordexp.c
  head/tools/regression/lib/libc/gen/test-wordexp.c

Modified: head/lib/libc/gen/wordexp.3
==
--- head/lib/libc/gen/wordexp.3 Wed Aug 19 20:10:58 2015(r286940)
+++ head/lib/libc/gen/wordexp.3 Wed Aug 19 20:31:03 2015(r286941)
@@ -131,9 +131,10 @@ argument contains one of the following u
 .Ql { ,
 .Ql } .
 .It Dv WRDE_BADVAL
-An attempt was made to expand an undefined shell variable and
+An error after successful parsing,
+such as an attempt to expand an undefined shell variable with
 .Dv WRDE_UNDEF
-is set in
+set in
 .Fa flags .
 .It Dv WRDE_CMDSUB
 An attempt was made to use command substitution and
@@ -141,7 +142,9 @@ An attempt was made to use command subst
 is set in
 .Fa flags .
 .It Dv WRDE_NOSPACE
-Not enough memory to store the result.
+Not enough memory to store the result or
+an error during
+.Xr fork 2 .
 .It Dv WRDE_SYNTAX
 Shell syntax error in
 .Fa words .

Modified: head/lib/libc/gen/wordexp.c
==
--- head/lib/libc/gen/wordexp.c Wed Aug 19 20:10:58 2015(r286940)
+++ head/lib/libc/gen/wordexp.c Wed Aug 19 20:31:03 2015(r286941)
@@ -103,8 +103,7 @@ static int
 we_askshell(const char *words, wordexp_t *we, int flags)
 {
int pdes[2];/* Pipe to child */
-   char bbuf[9];   /* Buffer for byte count */
-   char wbuf[9];   /* Buffer for word count */
+   char buf[18];   /* Buffer for byte and word count */
long nwords, nbytes;/* Number of words, bytes from child */
long i; /* Handy integer */
size_t sofs;/* Offset into we->we_strings */
@@ -119,6 +118,7 @@ we_askshell(const char *words, wordexp_t
char **nwv; /* Temporary for realloc() */
sigset_t newsigblock, oldsigblock;
const char *ifs;
+   char save;
 
serrno = errno;
ifs = getenv("IFS");
@@ -146,8 +146,9 @@ we_askshell(const char *words, wordexp_t
_fcntl(pdes[1], F_SETFD, 0)) < 0)
_exit(1);
execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u",
-   "-c", "IFS=$1;eval \"$2\";eval \"set -- $3\";IFS=;a=\"$*\";"
-   "printf '%08x' \"$#\" \"${#a}\";printf '%s\\0' \"$@\"",
+   "-c", "IFS=$1;eval \"$2\";eval \"echo;set -- $3\";"
+   "IFS=;a=\"$*\";printf '%08x' \"$#\" \"${#a}\";"
+   "printf '%s\\0' \"$@\"",
"",
ifs != NULL ? ifs : " \t\n",
flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null", words,
@@ -157,20 +158,30 @@ we_askshell(const char *words, wordexp_t
 
/*
 * We are the parent; read the output of the shell wordexp function,
-* which is a 32-bit hexadecimal word count, a 32-bit hexadecimal
-* byte count (not including terminating null bytes), followed by
-* the expanded words separated by nulls.
+* which is a byte indicating that the words were parsed successfully,
+* a 32-bit hexadecimal word count, a 32-bit hexadecimal byte count
+* (not including terminating null bytes), followed by the expanded
+* words separated by nulls.
 */
_close(pdes[1]);
-   if (we_read_fully(pdes[0], wbuf, 8) != 8 ||
-   we_read_fully(pdes[0], bbuf, 8) != 8) {
-   error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX;
+   switch (we_read_fully(pdes[0], buf, 17)) {
+   case 1:
+   error = WRDE_BADVAL;
+   serrno = errno;
+   goto cleanup;
+   case 17:
+   break;
+   default:
+   error = WRDE_SYNTAX;
serrno = errno;
goto cleanup;
}
-   wbuf[8] = bbuf[8] = '\0';
-   nwords = strtol(wbuf, NULL, 16);
-   nbytes = strtol(bbuf, NULL, 16) + nwords;
+   save = buf[9];
+   buf[9] = '\0';
+   nwords = strtol(buf + 1, NULL, 16);
+   buf[9] = save;
+   buf[17] = '\0';
+   nbytes = strtol(buf + 9, NULL, 16) + nwords;
 
/*
 * Allocate or reallocate (when flags & WRDE_APPEND) the word vector
@@ -200,7 +211,7 @@ we_askshell(const char *words, wordexp_t
we->we_strings = nstrings;
 
if (we_read_fully(pdes[0], we->we_str

svn commit: r286942 - head/sys/arm/freescale/imx

2015-08-19 Thread Ian Lepore
Author: ian
Date: Wed Aug 19 20:31:35 2015
New Revision: 286942
URL: https://svnweb.freebsd.org/changeset/base/286942

Log:
  Add compatible strings for all the hardware this driver works with.
  
  Also, move the READ/WRITE bus space access macros from the header into the
  source file, and rename them to RD2/WR2 to make it clear they're 16-bit
  accessors.  (READ/WRITE just don't seem like good names to be in a public
  header file.)

Modified:
  head/sys/arm/freescale/imx/imx_wdog.c
  head/sys/arm/freescale/imx/imx_wdogreg.h

Modified: head/sys/arm/freescale/imx/imx_wdog.c
==
--- head/sys/arm/freescale/imx/imx_wdog.c   Wed Aug 19 20:31:03 2015
(r286941)
+++ head/sys/arm/freescale/imx/imx_wdog.c   Wed Aug 19 20:31:35 2015
(r286942)
@@ -65,6 +65,20 @@ static struct resource_spec imx_wdog_spe
{ -1, 0 }
 };
 
+static struct ofw_compat_data compat_data[] = {
+   {"fsl,imx6sx-wdt", 1},
+   {"fsl,imx6sl-wdt", 1},
+   {"fsl,imx6q-wdt",  1},
+   {"fsl,imx53-wdt",  1},
+   {"fsl,imx51-wdt",  1},
+   {"fsl,imx50-wdt",  1},
+   {"fsl,imx35-wdt",  1},
+   {"fsl,imx27-wdt",  1},
+   {"fsl,imx25-wdt",  1},
+   {"fsl,imx21-wdt",  1},
+   {NULL, 0}
+};
+
 static voidimx_watchdog(void *, u_int, int *);
 static int imx_wdog_probe(device_t);
 static int imx_wdog_attach(device_t);
@@ -83,6 +97,10 @@ static driver_t imx_wdog_driver = {
 static devclass_t imx_wdog_devclass;
 DRIVER_MODULE(imx_wdog, simplebus, imx_wdog_driver, imx_wdog_devclass, 0, 0);
 
+#defineRD2(_sc, _r)
\
+   bus_space_read_2((_sc)->sc_bst, (_sc)->sc_bsh, (_r))
+#defineWR2(_sc, _r, _v)
\
+   bus_space_write_2((_sc)->sc_bst, (_sc)->sc_bsh, (_r), (_v))
 
 static void
 imx_watchdog(void *arg, u_int cmd, int *error)
@@ -95,8 +113,8 @@ imx_watchdog(void *arg, u_int cmd, int *
mtx_lock(&sc->sc_mtx);
 
/* Refresh counter, since we feels good */
-   WRITE(sc, WDOG_SR_REG, WDOG_SR_STEP1);
-   WRITE(sc, WDOG_SR_REG, WDOG_SR_STEP2);
+   WR2(sc, WDOG_SR_REG, WDOG_SR_STEP1);
+   WR2(sc, WDOG_SR_REG, WDOG_SR_STEP2);
 
/* We don't require precession, so "-10" (/1024) is ok */
timeout = (1 << ((cmd & WD_INTERVAL) - 10)) / 100;
@@ -105,14 +123,14 @@ imx_watchdog(void *arg, u_int cmd, int *
device_printf(sc->sc_dev,
"WARNING: watchdog can't be disabled!!!");
sc->sc_timeout = timeout;
-   reg = READ(sc, WDOG_CR_REG);
+   reg = RD2(sc, WDOG_CR_REG);
reg &= ~WDOG_CR_WT_MASK;
reg |= (timeout << (WDOG_CR_WT_SHIFT + 1)) &
WDOG_CR_WT_MASK;
-   WRITE(sc, WDOG_CR_REG, reg);
+   WR2(sc, WDOG_CR_REG, reg);
/* Refresh counter */
-   WRITE(sc, WDOG_SR_REG, WDOG_SR_STEP1);
-   WRITE(sc, WDOG_SR_REG, WDOG_SR_STEP2);
+   WR2(sc, WDOG_SR_REG, WDOG_SR_STEP1);
+   WR2(sc, WDOG_SR_REG, WDOG_SR_STEP2);
*error = 0;
} else {
*error = EOPNOTSUPP;
@@ -132,11 +150,10 @@ imx_wdog_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
 
-   if (!ofw_bus_is_compatible(dev, "fsl,imx51-wdt") &&
-   !ofw_bus_is_compatible(dev, "fsl,imx53-wdt"))
+   if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
return (ENXIO);
 
-   device_set_desc(dev, "Freescale i.MX5xx Watchdog Timer");
+   device_set_desc(dev, "Freescale i.MX Watchdog");
return (0);
 }
 

Modified: head/sys/arm/freescale/imx/imx_wdogreg.h
==
--- head/sys/arm/freescale/imx/imx_wdogreg.hWed Aug 19 20:31:03 2015
(r286941)
+++ head/sys/arm/freescale/imx/imx_wdogreg.hWed Aug 19 20:31:35 2015
(r286942)
@@ -59,7 +59,3 @@
 #defineWDOG_MCR_REG0x08/* Miscellaneous Control Register */
 #defineWDOG_MCR_PDE(1 << 0)
 
-#defineREAD(_sc, _r)   
\
-   bus_space_read_2((_sc)->sc_bst, (_sc)->sc_bsh, (_r))
-#defineWRITE(_sc, _r, _v)  
\
-   bus_space_write_2((_sc)->sc_bst, (_sc)->sc_bsh, (_r), (_v))
___
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: r286943 - head/sys/arm/freescale/imx

2015-08-19 Thread Ian Lepore
Author: ian
Date: Wed Aug 19 20:50:31 2015
New Revision: 286943
URL: https://svnweb.freebsd.org/changeset/base/286943

Log:
  Make the imx watchdog actually work, by setting WDOG_CR_WDE (enable bit).
  Also, follow the rules from watchdog(9) about what values to return in
  various situations (especially, don't touch *error when asked to set a
  non-zero timeout that isn't achievable on the hardware).

Modified:
  head/sys/arm/freescale/imx/imx_wdog.c

Modified: head/sys/arm/freescale/imx/imx_wdog.c
==
--- head/sys/arm/freescale/imx/imx_wdog.c   Wed Aug 19 20:31:35 2015
(r286942)
+++ head/sys/arm/freescale/imx/imx_wdog.c   Wed Aug 19 20:50:31 2015
(r286943)
@@ -107,40 +107,32 @@ imx_watchdog(void *arg, u_int cmd, int *
 {
struct imx_wdog_softc *sc;
uint16_t reg;
-   int timeout;
+   u_int timeout;
 
sc = arg;
mtx_lock(&sc->sc_mtx);
-
-   /* Refresh counter, since we feels good */
-   WR2(sc, WDOG_SR_REG, WDOG_SR_STEP1);
-   WR2(sc, WDOG_SR_REG, WDOG_SR_STEP2);
-
-   /* We don't require precession, so "-10" (/1024) is ok */
-   timeout = (1 << ((cmd & WD_INTERVAL) - 10)) / 100;
-   if (timeout > 1 && timeout < 128) {
-   if (timeout != sc->sc_timeout) {
-   device_printf(sc->sc_dev,
-   "WARNING: watchdog can't be disabled!!!");
-   sc->sc_timeout = timeout;
-   reg = RD2(sc, WDOG_CR_REG);
-   reg &= ~WDOG_CR_WT_MASK;
-   reg |= (timeout << (WDOG_CR_WT_SHIFT + 1)) &
-   WDOG_CR_WT_MASK;
-   WR2(sc, WDOG_CR_REG, reg);
+   if (cmd == 0) {
+   if (bootverbose)
+   device_printf(sc->sc_dev, "Can not be disabled.\n");
+   *error = EOPNOTSUPP;
+   } else {
+   timeout = (u_int)((1ULL << (cmd & WD_INTERVAL)) / 10U);
+   if (timeout > 1 && timeout < 128) {
+   if (timeout != sc->sc_timeout) {
+   sc->sc_timeout = timeout;
+   reg = RD2(sc, WDOG_CR_REG);
+   reg &= ~WDOG_CR_WT_MASK;
+   reg |= (timeout << (WDOG_CR_WT_SHIFT + 1)) &
+   WDOG_CR_WT_MASK;
+   WR2(sc, WDOG_CR_REG, reg | WDOG_CR_WDE);
+   }
/* Refresh counter */
WR2(sc, WDOG_SR_REG, WDOG_SR_STEP1);
WR2(sc, WDOG_SR_REG, WDOG_SR_STEP2);
*error = 0;
-   } else {
-   *error = EOPNOTSUPP;
}
-   } else {
-   device_printf(sc->sc_dev, "Can not be disabled.\n");
-   *error = EOPNOTSUPP;
}
mtx_unlock(&sc->sc_mtx);
-
 }
 
 static int
___
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: r286944 - head/sys/arm/conf

2015-08-19 Thread Ian Lepore
Author: ian
Date: Wed Aug 19 21:04:50 2015
New Revision: 286944
URL: https://svnweb.freebsd.org/changeset/base/286944

Log:
  Enable the watchdog driver on imx6, now that it works.

Modified:
  head/sys/arm/conf/IMX6

Modified: head/sys/arm/conf/IMX6
==
--- head/sys/arm/conf/IMX6  Wed Aug 19 20:50:31 2015(r286943)
+++ head/sys/arm/conf/IMX6  Wed Aug 19 21:04:50 2015(r286944)
@@ -136,5 +136,5 @@ device  ffec# Freescale 
Fast Ethernet
 device fsliic  # Freescale i2c/iic
 device iic # iic protocol
 device iicbus  # iic bus
-#deviceimxwdt  # Watchdog. WARNING: can't be 
disabled!!!
+device imxwdt  # Watchdog. WARNING: can't be 
disabled!!!
 
___
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: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300

2015-08-19 Thread Ermal Luçi
Just an update there.

Here is the patch i had prepared
https://github.com/pfsense/FreeBSD-src/commit/6ee75bdd7bf7c20359dd6e38c243586cb062edea
Now its public at least.

On Thu, Aug 6, 2015 at 3:03 PM, Adrian Chadd  wrote:

> Ermal - yes please. :) Or, just do the MFC yourself. :)
>
>
> -a
>
>
> On 6 August 2015 at 00:21, Ermal Luçi  wrote:
> > I did the port for pfSense and the whole stack works from HEAD into
> > 10-STABLE.
> >
> > Just minor modifications were required.
> > If you want i can try to send the diff.
> >
> > On Wed, Aug 5, 2015 at 11:55 PM, Oliver Pinter
> >  wrote:
> >>
> >> Yup. :) If you need testers with the backport, then ping me. ;)
> >>
> >> On Wed, Aug 5, 2015 at 11:23 PM, Adrian Chadd 
> wrote:
> >> > The whole wifi stack / drivers need backporting. :)
> >> >
> >> >
> >> >
> >> > -a
> >> >
> >> >
> >> > On 5 August 2015 at 12:41, Shawn Webb 
> >> > wrote:
> >> >> On Wed, 2015-08-05 at 19:32 +, Adrian Chadd wrote:
> >> >>> Author: adrian
> >> >>> Date: Wed Aug  5 19:32:35 2015
> >> >>> New Revision: 286337
> >> >>> URL: https://svnweb.freebsd.org/changeset/base/286337
> >> >>>
> >> >>> Log:
> >> >>>   Add TXOP enforce support to the AR9300 HAL.
> >> >>>
> >> >>>   This is required for (more) correct TDMA support.  Without it, the
> >> >>>   code tries to calculate the required guard interval based on the
> >> >>>   current rate, and since this is an 11n NIC and people try using
> >> >>>   11n, it calls ath_hal_computetxtime() on an 11n rate which then
> >> >>>   panics.
> >> >>>
> >> >>>   This doesn't fix TDMA slave mode on AR9300 - it just makes it
> >> >>>   have one less bug.
> >> >>>
> >> >>>   Reported by:Berislav Purgar 
> >> >>>
> >> >>> Modified:
> >> >>>   head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c
> >> >>
> >> >> Hey Adrian,
> >> >>
> >> >> Can this be MFC'd?
> >> >>
> >> >> Thanks,
> >> >>
> >> >> --
> >> >> Shawn Webb
> >> >> HardenedBSD
> >> >>
> >> >> GPG Key ID:  0x6A84658F52456EEE
> >> >> GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245
> 6EEE
> >> > ___
> >> > svn-src-head@freebsd.org mailing list
> >> > http://lists.freebsd.org/mailman/listinfo/svn-src-head
> >> > To unsubscribe, send any mail to "
> svn-src-head-unsubscr...@freebsd.org"
> >>
> >
> >
> >
> > --
> > Ermal
>



-- 
Ermal
___
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: r286945 - head/sys/netinet

2015-08-19 Thread Alexander V. Chernikov
Author: melifaro
Date: Wed Aug 19 21:08:42 2015
New Revision: 286945
URL: https://svnweb.freebsd.org/changeset/base/286945

Log:
  Check value return from lle_create() for NULL.
  This bug sneaked unnoticed in r286722.
  
  Reported by:  adrian

Modified:
  head/sys/netinet/if_ether.c

Modified: head/sys/netinet/if_ether.c
==
--- head/sys/netinet/if_ether.c Wed Aug 19 21:04:50 2015(r286944)
+++ head/sys/netinet/if_ether.c Wed Aug 19 21:08:42 2015(r286945)
@@ -790,10 +790,13 @@ match:
 */
IF_AFDATA_WLOCK(ifp);
la = lla_create(LLTABLE(ifp), 0, (struct sockaddr *)&sin);
-   arp_update_lle(ah, ifp, la);
+   if (la != NULL)
+   arp_update_lle(ah, ifp, la);
IF_AFDATA_WUNLOCK(ifp);
-   arp_mark_lle_reachable(la);
-   LLE_WUNLOCK(la);
+   if (la != NULL) {
+   arp_mark_lle_reachable(la);
+   LLE_WUNLOCK(la);
+   }
}
 reply:
if (op != ARPOP_REQUEST)
___
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: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300

2015-08-19 Thread Oliver Pinter
Cool! Thanks Ermal!

On 8/19/15, Ermal Luçi  wrote:
> Just an update there.
>
> Here is the patch i had prepared
> https://github.com/pfsense/FreeBSD-src/commit/6ee75bdd7bf7c20359dd6e38c243586cb062edea
> Now its public at least.
>
> On Thu, Aug 6, 2015 at 3:03 PM, Adrian Chadd  wrote:
>
>> Ermal - yes please. :) Or, just do the MFC yourself. :)
>>
>>
>> -a
>>
>>
>> On 6 August 2015 at 00:21, Ermal Luçi  wrote:
>> > I did the port for pfSense and the whole stack works from HEAD into
>> > 10-STABLE.
>> >
>> > Just minor modifications were required.
>> > If you want i can try to send the diff.
>> >
>> > On Wed, Aug 5, 2015 at 11:55 PM, Oliver Pinter
>> >  wrote:
>> >>
>> >> Yup. :) If you need testers with the backport, then ping me. ;)
>> >>
>> >> On Wed, Aug 5, 2015 at 11:23 PM, Adrian Chadd 
>> wrote:
>> >> > The whole wifi stack / drivers need backporting. :)
>> >> >
>> >> >
>> >> >
>> >> > -a
>> >> >
>> >> >
>> >> > On 5 August 2015 at 12:41, Shawn Webb 
>> >> > wrote:
>> >> >> On Wed, 2015-08-05 at 19:32 +, Adrian Chadd wrote:
>> >> >>> Author: adrian
>> >> >>> Date: Wed Aug  5 19:32:35 2015
>> >> >>> New Revision: 286337
>> >> >>> URL: https://svnweb.freebsd.org/changeset/base/286337
>> >> >>>
>> >> >>> Log:
>> >> >>>   Add TXOP enforce support to the AR9300 HAL.
>> >> >>>
>> >> >>>   This is required for (more) correct TDMA support.  Without it,
>> >> >>> the
>> >> >>>   code tries to calculate the required guard interval based on the
>> >> >>>   current rate, and since this is an 11n NIC and people try using
>> >> >>>   11n, it calls ath_hal_computetxtime() on an 11n rate which then
>> >> >>>   panics.
>> >> >>>
>> >> >>>   This doesn't fix TDMA slave mode on AR9300 - it just makes it
>> >> >>>   have one less bug.
>> >> >>>
>> >> >>>   Reported by:Berislav Purgar 
>> >> >>>
>> >> >>> Modified:
>> >> >>>   head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c
>> >> >>
>> >> >> Hey Adrian,
>> >> >>
>> >> >> Can this be MFC'd?
>> >> >>
>> >> >> Thanks,
>> >> >>
>> >> >> --
>> >> >> Shawn Webb
>> >> >> HardenedBSD
>> >> >>
>> >> >> GPG Key ID:  0x6A84658F52456EEE
>> >> >> GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245
>> 6EEE
>> >> > ___
>> >> > svn-src-head@freebsd.org mailing list
>> >> > http://lists.freebsd.org/mailman/listinfo/svn-src-head
>> >> > To unsubscribe, send any mail to "
>> svn-src-head-unsubscr...@freebsd.org"
>> >>
>> >
>> >
>> >
>> > --
>> > Ermal
>>
>
>
>
> --
> Ermal
>
___
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: r286946 - head/contrib/compiler-rt/lib/builtins

2015-08-19 Thread Ed Maste
Author: emaste
Date: Wed Aug 19 21:23:17 2015
New Revision: 286946
URL: https://svnweb.freebsd.org/changeset/base/286946

Log:
  compiler-rt: update __multc3 to upstream style and variable names
  
  I introduced a local copy of __multc3 in r281221, which has now been
  committed upstream to compiler-rt in revision 245296. Update our version
  to match the changes made there.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/compiler-rt/lib/builtins/multc3.c

Modified: head/contrib/compiler-rt/lib/builtins/multc3.c
==
--- head/contrib/compiler-rt/lib/builtins/multc3.c  Wed Aug 19 21:08:42 
2015(r286945)
+++ head/contrib/compiler-rt/lib/builtins/multc3.c  Wed Aug 19 21:23:17 
2015(r286946)
@@ -18,55 +18,50 @@
 /* Returns: the product of a + ib and c + id */
 
 COMPILER_RT_ABI long double _Complex
-__multc3(long double __a, long double __b, long double __c, long double __d)
+__multc3(long double a, long double b, long double c, long double d)
 {
-long double __ac = __a * __c;
-long double __bd = __b * __d;
-long double __ad = __a * __d;
-long double __bc = __b * __c;
+long double ac = a * c;
+long double bd = b * d;
+long double ad = a * d;
+long double bc = b * c;
 long double _Complex z;
-__real__ z = __ac - __bd;
-__imag__ z = __ad + __bc;
-if (crt_isnan(__real__ z) && crt_isnan(__imag__ z))
-{
-int __recalc = 0;
-if (crt_isinf(__a) || crt_isinf(__b))
-{
-__a = crt_copysignl(crt_isinf(__a) ? 1 : 0, __a);
-__b = crt_copysignl(crt_isinf(__b) ? 1 : 0, __b);
-if (crt_isnan(__c))
-__c = crt_copysignl(0, __c);
-if (crt_isnan(__d))
-__d = crt_copysignl(0, __d);
-__recalc = 1;
+__real__ z = ac - bd;
+__imag__ z = ad + bc;
+if (crt_isnan(__real__ z) && crt_isnan(__imag__ z)) {
+int recalc = 0;
+if (crt_isinf(a) || crt_isinf(b)) {
+a = crt_copysignl(crt_isinf(a) ? 1 : 0, a);
+b = crt_copysignl(crt_isinf(b) ? 1 : 0, b);
+if (crt_isnan(c))
+c = crt_copysignl(0, c);
+if (crt_isnan(d))
+d = crt_copysignl(0, d);
+recalc = 1;
 }
-if (crt_isinf(__c) || crt_isinf(__d))
-{
-__c = crt_copysignl(crt_isinf(__c) ? 1 : 0, __c);
-__d = crt_copysignl(crt_isinf(__d) ? 1 : 0, __d);
-if (crt_isnan(__a))
-__a = crt_copysignl(0, __a);
-if (crt_isnan(__b))
-__b = crt_copysignl(0, __b);
-__recalc = 1;
+if (crt_isinf(c) || crt_isinf(d)) {
+c = crt_copysignl(crt_isinf(c) ? 1 : 0, c);
+d = crt_copysignl(crt_isinf(d) ? 1 : 0, d);
+if (crt_isnan(a))
+a = crt_copysignl(0, a);
+if (crt_isnan(b))
+b = crt_copysignl(0, b);
+recalc = 1;
 }
-if (!__recalc && (crt_isinf(__ac) || crt_isinf(__bd) ||
-  crt_isinf(__ad) || crt_isinf(__bc)))
-{
-if (crt_isnan(__a))
-__a = crt_copysignl(0, __a);
-if (crt_isnan(__b))
-__b = crt_copysignl(0, __b);
-if (crt_isnan(__c))
-__c = crt_copysignl(0, __c);
-if (crt_isnan(__d))
-__d = crt_copysignl(0, __d);
-__recalc = 1;
+if (!recalc && (crt_isinf(ac) || crt_isinf(bd) ||
+  crt_isinf(ad) || crt_isinf(bc))) {
+if (crt_isnan(a))
+a = crt_copysignl(0, a);
+if (crt_isnan(b))
+b = crt_copysignl(0, b);
+if (crt_isnan(c))
+c = crt_copysignl(0, c);
+if (crt_isnan(d))
+d = crt_copysignl(0, d);
+recalc = 1;
 }
-if (__recalc)
-{
-__real__ z = CRT_INFINITY * (__a * __c - __b * __d);
-__imag__ z = CRT_INFINITY * (__a * __d + __b * __c);
+if (recalc) {
+__real__ z = CRT_INFINITY * (a * c - b * d);
+__imag__ z = CRT_INFINITY * (a * d + b * c);
 }
 }
 return z;
___
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: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300

2015-08-19 Thread Adrian Chadd
jim asked me again to do the MFC, so once I've finished doing some
more tidying up of bits and pieces I'll do the MFC.


-a


On 19 August 2015 at 14:13, Oliver Pinter  wrote:
> Cool! Thanks Ermal!
>
> On 8/19/15, Ermal Luçi  wrote:
>> Just an update there.
>>
>> Here is the patch i had prepared
>> https://github.com/pfsense/FreeBSD-src/commit/6ee75bdd7bf7c20359dd6e38c243586cb062edea
>> Now its public at least.
>>
>> On Thu, Aug 6, 2015 at 3:03 PM, Adrian Chadd  wrote:
>>
>>> Ermal - yes please. :) Or, just do the MFC yourself. :)
>>>
>>>
>>> -a
>>>
>>>
>>> On 6 August 2015 at 00:21, Ermal Luçi  wrote:
>>> > I did the port for pfSense and the whole stack works from HEAD into
>>> > 10-STABLE.
>>> >
>>> > Just minor modifications were required.
>>> > If you want i can try to send the diff.
>>> >
>>> > On Wed, Aug 5, 2015 at 11:55 PM, Oliver Pinter
>>> >  wrote:
>>> >>
>>> >> Yup. :) If you need testers with the backport, then ping me. ;)
>>> >>
>>> >> On Wed, Aug 5, 2015 at 11:23 PM, Adrian Chadd 
>>> wrote:
>>> >> > The whole wifi stack / drivers need backporting. :)
>>> >> >
>>> >> >
>>> >> >
>>> >> > -a
>>> >> >
>>> >> >
>>> >> > On 5 August 2015 at 12:41, Shawn Webb 
>>> >> > wrote:
>>> >> >> On Wed, 2015-08-05 at 19:32 +, Adrian Chadd wrote:
>>> >> >>> Author: adrian
>>> >> >>> Date: Wed Aug  5 19:32:35 2015
>>> >> >>> New Revision: 286337
>>> >> >>> URL: https://svnweb.freebsd.org/changeset/base/286337
>>> >> >>>
>>> >> >>> Log:
>>> >> >>>   Add TXOP enforce support to the AR9300 HAL.
>>> >> >>>
>>> >> >>>   This is required for (more) correct TDMA support.  Without it,
>>> >> >>> the
>>> >> >>>   code tries to calculate the required guard interval based on the
>>> >> >>>   current rate, and since this is an 11n NIC and people try using
>>> >> >>>   11n, it calls ath_hal_computetxtime() on an 11n rate which then
>>> >> >>>   panics.
>>> >> >>>
>>> >> >>>   This doesn't fix TDMA slave mode on AR9300 - it just makes it
>>> >> >>>   have one less bug.
>>> >> >>>
>>> >> >>>   Reported by:Berislav Purgar 
>>> >> >>>
>>> >> >>> Modified:
>>> >> >>>   head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c
>>> >> >>
>>> >> >> Hey Adrian,
>>> >> >>
>>> >> >> Can this be MFC'd?
>>> >> >>
>>> >> >> Thanks,
>>> >> >>
>>> >> >> --
>>> >> >> Shawn Webb
>>> >> >> HardenedBSD
>>> >> >>
>>> >> >> GPG Key ID:  0x6A84658F52456EEE
>>> >> >> GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245
>>> 6EEE
>>> >> > ___
>>> >> > svn-src-head@freebsd.org mailing list
>>> >> > http://lists.freebsd.org/mailman/listinfo/svn-src-head
>>> >> > To unsubscribe, send any mail to "
>>> svn-src-head-unsubscr...@freebsd.org"
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > Ermal
>>>
>>
>>
>>
>> --
>> Ermal
>>
___
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: r286947 - head/usr.sbin/watchdogd

2015-08-19 Thread Ian Lepore
Author: ian
Date: Wed Aug 19 21:46:12 2015
New Revision: 286947
URL: https://svnweb.freebsd.org/changeset/base/286947

Log:
  Add a new exit-timeout option to watchdogd.
  
  Watchdogd currently disables the watchdog when it exits, such as during
  rc.shutdown processing.  That leaves the system vulnerable to getting hung
  or deadlocked during the shutdown part of a reboot.  For embedded systems
  it's especially important that the hardware watchdog always be active.  It
  can also be useful for servers that are administered remotely.
  
  The new -x  option tells watchdogd to program the watchdog with the
  given timeout just before exiting.  The -x value can be longer or shorter
  than the -t normal time value, to allow for various exceptional conditions
  at shutdown such as allowing extra time for buffer flushing.
  
  The exit value is also used internally in the "failsafe" handling (which
  used to just disable the watchdog), on the theory that if you're using this
  option, "safe" means having the watchdog always running, not disabled.
  
  The default is still to disable the watchdog on exit if -x is not specified.
  
  Differential Revision:https://reviews.freebsd.org/D2556 (timed out)

Modified:
  head/usr.sbin/watchdogd/watchdogd.8
  head/usr.sbin/watchdogd/watchdogd.c

Modified: head/usr.sbin/watchdogd/watchdogd.8
==
--- head/usr.sbin/watchdogd/watchdogd.8 Wed Aug 19 21:23:17 2015
(r286946)
+++ head/usr.sbin/watchdogd/watchdogd.8 Wed Aug 19 21:46:12 2015
(r286947)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 16, 2014
+.Dd May 11, 2015
 .Dt WATCHDOGD 8
 .Os
 .Sh NAME
@@ -46,6 +46,7 @@
 .Op Fl s Ar sleep
 .Op Fl t Ar timeout
 .Op Fl T Ar script_timeout
+.Op Fl x Ar exit_timeout
 .Sh DESCRIPTION
 The
 .Nm
@@ -103,14 +104,25 @@ defaults to the value specified by the
 .Fl s Ar sleep
 option.
 .Pp
+The
+.Fl x Ar exit_timeout
+argument is the timeout period (in seconds) to leave in effect when the
+program exits.
+Using
+.Fl x
+with a non-zero value protects against lockup during a reboot by
+triggering a hardware reset if the software reboot doesn't complete
+before the given timeout expires.
+.Pp
 Upon receiving the
 .Dv SIGTERM
 or
 .Dv SIGINT
 signals,
 .Nm
-will first instruct the kernel to no longer perform watchdog checks and then
-will terminate.
+will terminate, after first instructing the kernel to either disable the
+timeout or reset it to the value given by
+.Fl x Ar exit_timeout .
 .Pp
 The
 .Nm

Modified: head/usr.sbin/watchdogd/watchdogd.c
==
--- head/usr.sbin/watchdogd/watchdogd.c Wed Aug 19 21:23:17 2015
(r286946)
+++ head/usr.sbin/watchdogd/watchdogd.c Wed Aug 19 21:46:12 2015
(r286947)
@@ -77,6 +77,7 @@ static int debugging = 0;
 static int end_program = 0;
 static const char *pidfile = _PATH_VARRUN "watchdogd.pid";
 static u_int timeout = WD_TO_128SEC;
+static u_int exit_timeout = WD_TO_NEVER;
 static u_int pretimeout = 0;
 static u_int timeout_sec;
 static u_int passive = 0;
@@ -461,10 +462,10 @@ watchdog_onoff(int onoff)
/* pat one more time for good measure */
return watchdog_patpat((timeout|WD_ACTIVE));
 } else {
-   return watchdog_patpat(0);
+   return watchdog_patpat(exit_timeout);
 }
 failsafe:
-   watchdog_patpat(0);
+   watchdog_patpat(exit_timeout);
return (error);
 }
 
@@ -476,8 +477,8 @@ usage(void)
 {
if (is_daemon)
fprintf(stderr, "usage:\n"
-"  watchdogd [-dnSw] [-e cmd] [-I file] [-s sleep] [-t timeout]\n"
-"[-T script_timeout]\n"
+"  watchdogd [-dnSw] [-e cmd] [-I pidfile] [-s sleep] [-t timeout]\n"
+"[-T script_timeout] [-x exit_timeout]\n"
 "[--debug]\n"
 "[--pretimeout seconds] [-pretimeout-action action]\n"
 "[--softtimeout] [-softtimeout-action action]\n"
@@ -697,7 +698,7 @@ parseargs(int argc, char *argv[])
is_daemon = 1;
 
if (is_daemon)
-   getopt_shortopts = "I:de:ns:t:ST:w?";
+   getopt_shortopts = "I:de:ns:t:ST:wx:?";
else
getopt_shortopts = "dt:?";
 
@@ -741,6 +742,11 @@ parseargs(int argc, char *argv[])
case 'w':
do_timedog = 1;
break;
+   case 'x':
+   exit_timeout = parse_timeout_to_pow2ns(c, NULL, optarg);
+   if (exit_timeout != 0)
+   exit_timeout |= WD_ACTIVE;
+   break;
case 0:
lopt = longopts[longindex].name;
if (!strcmp(lopt, "pretimeout")) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-h

Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300

2015-08-19 Thread Renato Botelho
> On Aug 19, 2015, at 18:31, Adrian Chadd  wrote:
> 
> jim asked me again to do the MFC, so once I've finished doing some
> more tidying up of bits and pieces I'll do the MFC.

Thank you very much!

--
Renato Botelho

___
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: r286948 - head/lib/libc/sys

2015-08-19 Thread Conrad E. Meyer
Author: cem
Date: Thu Aug 20 00:00:15 2015
New Revision: 286948
URL: https://svnweb.freebsd.org/changeset/base/286948

Log:
  getrlimit.2: Document RSS, AS/VMEM limit behavior more clearly
  
  Alphabetize the RLIMIT_ list while here.
  
  Reviewed by:  jilles (previous version), wblock (previous version)
  Approved by:  markj (mentor)
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D3433

Modified:
  head/lib/libc/sys/getrlimit.2

Modified: head/lib/libc/sys/getrlimit.2
==
--- head/lib/libc/sys/getrlimit.2   Wed Aug 19 21:46:12 2015
(r286947)
+++ head/lib/libc/sys/getrlimit.2   Thu Aug 20 00:00:15 2015
(r286948)
@@ -28,7 +28,7 @@
 .\" @(#)getrlimit.28.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd August 20, 2008
+.Dd August 19, 2015
 .Dt GETRLIMIT 2
 .Os
 .Sh NAME
@@ -74,6 +74,8 @@ this defines how far a program may exten
 function.
 .It Dv RLIMIT_FSIZE
 The largest size (in bytes) file that may be created.
+.It Dv RLIMIT_KQUEUES
+The maximum number of kqueues this user id is allowed to create.
 .It Dv RLIMIT_MEMLOCK
 The maximum size (in bytes) which a process may lock into memory
 using the
@@ -83,12 +85,25 @@ system call.
 The maximum number of open files for this process.
 .It Dv RLIMIT_NPROC
 The maximum number of simultaneous processes for this user id.
+.It Dv RLIMIT_NPTS
+The maximum number of pseudo-terminals this user id is allowed to create.
 .It Dv RLIMIT_RSS
-The maximum size (in bytes) to which a process's resident set size may
-grow.
-This imposes a limit on the amount of physical memory to be given to
-a process; if memory is tight, the system will prefer to take memory
-from processes that are exceeding their declared resident set size.
+When there is memory pressure and swap is available, prioritize eviction of
+a process' resident pages beyond this amount (in bytes).
+When memory is not under pressure, this rlimit is effectively ignored.
+Even when there is memory pressure, the amount of available swap space and some
+sysctl settings like
+.Xr vm.swap_enabled
+and
+.Xr vm.swap_idle_enabled
+can affect what happens to processes that have exceeded this size.
+.Pp
+Processes that exceed their set
+.Dv RLIMIT_RSS
+are not signalled or halted.
+The limit is merely a hint to the VM daemon to prefer to deactivate pages from
+processes that have exceeded their set
+.Dv RLIMIT_RSS .
 .It Dv RLIMIT_SBSIZE
 The maximum size (in bytes) of socket buffer usage for this user.
 This limits the amount of network memory, and hence the amount of
@@ -106,18 +121,20 @@ sysctl is set.
 Please see
 .Xr tuning 7
 for a complete description of this sysctl.
-.It Dv RLIMIT_NPTS
-The maximum number of pseudo-terminals created by this user id.
-.It Dv RLIMIT_KQUEUES
-The maximum number of kqueues created by this user id.
+.It Dv RLIMIT_VMEM
+An alias for
+.Dv RLIMIT_AS .
 .El
 .Pp
 A resource limit is specified as a soft limit and a hard limit.
-When a
-soft limit is exceeded a process may receive a signal (for example, if
-the cpu time or file size is exceeded), but it will be allowed to
-continue execution until it reaches the hard limit (or modifies
-its resource limit).
+When a soft limit is exceeded, a process might or might not receive a signal.
+For example, signals are generated when the cpu time or file size is exceeded,
+but not if the address space or RSS limit is exceeded.
+A program that exceeds the soft limit is allowed to continue execution until it
+reaches the hard limit, or modifies its own resource limit.
+Even reaching the hard limit does not necessarily halt a process.
+For example, if the RSS hard limit is exceeded, nothing happens.
+.Pp
 The
 .Vt rlimit
 structure is used to specify the hard and soft limits on a resource,
@@ -170,6 +187,20 @@ the soft cpu time limit is exceeded, a s
 .Dv SIGXCPU
 is sent to the
 offending process.
+.Pp
+When most operations would allocate more virtual memory than allowed by the
+soft limit of
+.Dv RLIMIT_AS ,
+the operation fails with
+.Dv ENOMEM
+and no signal is raised.
+A notable exception is stack extension, described above.
+If stack extension would allocate more virtual memory than allowed by the soft
+limit of
+.Dv RLIMIT_AS ,
+the signal SIGSEGV will be delivered.
+The caller is free to raise the soft address space limit up to the hard limit
+and retry the allocation.
 .Sh RETURN VALUES
 .Rv -std
 .Sh ERRORS
___
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: r286949 - head/sys/dev/usb/wlan

2015-08-19 Thread Adrian Chadd
Author: adrian
Date: Thu Aug 20 03:57:41 2015
New Revision: 286949
URL: https://svnweb.freebsd.org/changeset/base/286949

Log:
  Remove some if_softc references from urtwn(4).
  
  The only ones that are left are in if_start, if_stop and ioctl.
  
  Tested:
  
  * urtwn0: MAC/BB RTL8188CUS, RF 6052 1T1R, STA mode

Modified:
  head/sys/dev/usb/wlan/if_urtwn.c

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==
--- head/sys/dev/usb/wlan/if_urtwn.cThu Aug 20 00:00:15 2015
(r286948)
+++ head/sys/dev/usb/wlan/if_urtwn.cThu Aug 20 03:57:41 2015
(r286949)
@@ -1513,7 +1513,7 @@ urtwn_newstate(struct ieee80211vap *vap,
 {
struct urtwn_vap *uvp = URTWN_VAP(vap);
struct ieee80211com *ic = vap->iv_ic;
-   struct urtwn_softc *sc = ic->ic_ifp->if_softc;
+   struct urtwn_softc *sc = ic->ic_softc;
struct ieee80211_node *ni;
enum ieee80211_state ostate;
uint32_t reg;
@@ -1989,8 +1989,8 @@ urtwn_start_locked(struct ifnet *ifp, st
 static int
 urtwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 {
-   struct urtwn_softc *sc = ifp->if_softc;
struct ieee80211com *ic = ifp->if_l2com;
+   struct urtwn_softc *sc = ic->ic_softc;
struct ifreq *ifr = (struct ifreq *) data;
int error = 0, startall = 0;
 
@@ -2004,7 +2004,7 @@ urtwn_ioctl(struct ifnet *ifp, u_long cm
case SIOCSIFFLAGS:
if (ifp->if_flags & IFF_UP) {
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
-   urtwn_init(ifp->if_softc);
+   urtwn_init(sc);
startall = 1;
}
} else {
@@ -3134,7 +3134,7 @@ urtwn_scan_end(struct ieee80211com *ic)
 static void
 urtwn_set_channel(struct ieee80211com *ic)
 {
-   struct urtwn_softc *sc = ic->ic_ifp->if_softc;
+   struct urtwn_softc *sc = ic->ic_softc;
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
 
URTWN_LOCK(sc);
@@ -3524,7 +3524,7 @@ urtwn_raw_xmit(struct ieee80211_node *ni
 {
struct ieee80211com *ic = ni->ni_ic;
struct ifnet *ifp = ic->ic_ifp;
-   struct urtwn_softc *sc = ifp->if_softc;
+   struct urtwn_softc *sc = ic->ic_softc;
struct urtwn_data *bf;
 
/* prevent management frames from being sent if we're not ready */
___
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: r286950 - head/sys/dev/usb/wlan

2015-08-19 Thread Adrian Chadd
Author: adrian
Date: Thu Aug 20 05:13:54 2015
New Revision: 286950
URL: https://svnweb.freebsd.org/changeset/base/286950

Log:
  Further conversions from ifp->if_softc -> ic_softc.

Modified:
  head/sys/dev/usb/wlan/if_rsu.c
  head/sys/dev/usb/wlan/if_rum.c
  head/sys/dev/usb/wlan/if_run.c
  head/sys/dev/usb/wlan/if_uath.c
  head/sys/dev/usb/wlan/if_upgt.c
  head/sys/dev/usb/wlan/if_ural.c
  head/sys/dev/usb/wlan/if_urtw.c
  head/sys/dev/usb/wlan/if_zyd.c

Modified: head/sys/dev/usb/wlan/if_rsu.c
==
--- head/sys/dev/usb/wlan/if_rsu.c  Thu Aug 20 03:57:41 2015
(r286949)
+++ head/sys/dev/usb/wlan/if_rsu.c  Thu Aug 20 05:13:54 2015
(r286950)
@@ -509,8 +509,7 @@ static void
 rsu_scan_start(struct ieee80211com *ic)
 {
int error;
-   struct ifnet *ifp = ic->ic_ifp;
-   struct rsu_softc *sc = ifp->if_softc;
+   struct rsu_softc *sc = ic->ic_softc;
 
/* Scanning is done by the firmware. */
RSU_LOCK(sc);
@@ -935,7 +934,7 @@ rsu_newstate(struct ieee80211vap *vap, e
 {
struct rsu_vap *uvp = RSU_VAP(vap);
struct ieee80211com *ic = vap->iv_ic;
-   struct rsu_softc *sc = ic->ic_ifp->if_softc;
+   struct rsu_softc *sc = ic->ic_softc;
struct ieee80211_node *ni;
struct ieee80211_rateset *rs;
enum ieee80211_state ostate;
@@ -1819,6 +1818,7 @@ static int
 rsu_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 {
struct ieee80211com *ic = ifp->if_l2com;
+   struct rsu_softc *sc = ic->ic_softc;
struct ifreq *ifr = (struct ifreq *) data;
int error = 0, startall = 0;
 
@@ -1826,7 +1826,7 @@ rsu_ioctl(struct ifnet *ifp, u_long cmd,
case SIOCSIFFLAGS:
if (ifp->if_flags & IFF_UP) {
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
-   rsu_init(ifp->if_softc);
+   rsu_init(sc);
startall = 1;
}
} else {
@@ -2297,7 +2297,7 @@ rsu_raw_xmit(struct ieee80211_node *ni, 
 {
struct ieee80211com *ic = ni->ni_ic;
struct ifnet *ifp = ic->ic_ifp;
-   struct rsu_softc *sc = ifp->if_softc;
+   struct rsu_softc *sc = ic->ic_softc;
struct rsu_data *bf;
 
/* prevent management frames from being sent if we're not ready */

Modified: head/sys/dev/usb/wlan/if_rum.c
==
--- head/sys/dev/usb/wlan/if_rum.c  Thu Aug 20 03:57:41 2015
(r286949)
+++ head/sys/dev/usb/wlan/if_rum.c  Thu Aug 20 05:13:54 2015
(r286950)
@@ -595,7 +595,7 @@ rum_vap_create(struct ieee80211com *ic, 
 const uint8_t bssid[IEEE80211_ADDR_LEN],
 const uint8_t mac[IEEE80211_ADDR_LEN])
 {
-   struct rum_softc *sc = ic->ic_ifp->if_softc;
+   struct rum_softc *sc = ic->ic_softc;
struct rum_vap *rvp;
struct ieee80211vap *vap;
 
@@ -711,7 +711,7 @@ rum_newstate(struct ieee80211vap *vap, e
 {
struct rum_vap *rvp = RUM_VAP(vap);
struct ieee80211com *ic = vap->iv_ic;
-   struct rum_softc *sc = ic->ic_ifp->if_softc;
+   struct rum_softc *sc = ic->ic_softc;
const struct ieee80211_txparam *tp;
enum ieee80211_state ostate;
struct ieee80211_node *ni;
@@ -1333,8 +1333,8 @@ rum_start(struct ifnet *ifp)
 static int
 rum_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 {
-   struct rum_softc *sc = ifp->if_softc;
struct ieee80211com *ic = ifp->if_l2com;
+   struct rum_softc *sc = ic->ic_softc;
struct ifreq *ifr = (struct ifreq *) data;
int error;
int startall = 0;
@@ -1786,8 +1786,8 @@ rum_enable_tsf(struct rum_softc *sc)
 static void
 rum_update_slot(struct ifnet *ifp)
 {
-   struct rum_softc *sc = ifp->if_softc;
struct ieee80211com *ic = ifp->if_l2com;
+   struct rum_softc *sc = ic->ic_softc;
uint8_t slottime;
uint32_t tmp;
 
@@ -2189,7 +2189,7 @@ rum_raw_xmit(struct ieee80211_node *ni, 
 const struct ieee80211_bpf_params *params)
 {
struct ifnet *ifp = ni->ni_ic->ic_ifp;
-   struct rum_softc *sc = ifp->if_softc;
+   struct rum_softc *sc = ni->ni_ic->ic_softc;
 
RUM_LOCK(sc);
/* prevent management frames from being sent if we're not ready */
@@ -2263,7 +2263,7 @@ rum_ratectl_task(void *arg, int pending)
struct ieee80211vap *vap = &rvp->vap;
struct ieee80211com *ic = vap->iv_ic;
struct ifnet *ifp = ic->ic_ifp;
-   struct rum_softc *sc = ifp->if_softc;
+   struct rum_softc *sc = ic->ic_softc;
struct ieee80211_node *ni;
int ok, fail;
int sum, retrycnt;
@@ -2293,7 +2293,7 @@ static void
 rum_scan_start(struct ieee80211com *ic)
 {
struct ifnet *ifp = ic->ic_ifp;
-   struct rum_softc *sc = ifp->if_softc;
+   struct rum_softc *sc = ic->

Re: svn commit: r286948 - head/lib/libc/sys

2015-08-19 Thread Garrett Cooper

> On Aug 19, 2015, at 17:00, Conrad E. Meyer  wrote:
> 
> Author: cem
> Date: Thu Aug 20 00:00:15 2015
> New Revision: 286948
> URL: https://svnweb.freebsd.org/changeset/base/286948
> 
> Log:
>  getrlimit.2: Document RSS, AS/VMEM limit behavior more clearly
> 
>  Alphabetize the RLIMIT_ list while here.
> 
>  Reviewed by:jilles (previous version), wblock (previous version)
>  Approved by:markj (mentor)
>  Sponsored by:EMC / Isilon Storage Division
>  Differential Revision:https://reviews.freebsd.org/D3433
> 
> Modified:
>  head/lib/libc/sys/getrlimit.2

Should this be mfced?
___
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"