svn commit: r262477 - head/sys/dev/usb/input

2014-02-25 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 25 08:37:06 2014
New Revision: 262477
URL: http://svnweb.freebsd.org/changeset/base/262477

Log:
  Updates for WSP driver:
  
  1) Add support for page back/forward.
  2) While doing HOR scrolling, disable VER scrolling.
  3) Checking dx_sum and dy_sum before emulate right button, this can
  avoids unexpected right button press.
  4) Fix stable pointer operation when emulating middle button.
  
  Submitted by: Huang Wen Hui huang...@gmail.com
  MFC after:2 weeks

Modified:
  head/sys/dev/usb/input/wsp.c

Modified: head/sys/dev/usb/input/wsp.c
==
--- head/sys/dev/usb/input/wsp.cTue Feb 25 07:59:33 2014
(r262476)
+++ head/sys/dev/usb/input/wsp.cTue Feb 25 08:37:06 2014
(r262477)
@@ -94,8 +94,8 @@ static struct wsp_tuning {
.z_factor = 5,
.pressure_touch_threshold = 50,
.pressure_untouch_threshold = 10,
-   .pressure_tap_threshold = 120,
-   .scr_hor_threshold = 50,
+   .pressure_tap_threshold = 100,
+   .scr_hor_threshold = 10,
 };
 
 static void
@@ -791,9 +791,13 @@ wsp_intr_callback(struct usb_xfer *xfer,
}
break;
case 2:
-   if (sc-distance  MAX_DISTANCE)
+   DPRINTFN(WSP_LLEVEL_INFO, sum_x=%5d, 
sum_y=%5d\n,
+   sc-dx_sum, sc-dy_sum);
+   if (sc-distance  MAX_DISTANCE  
abs(sc-dx_sum)  5 
+   abs(sc-dy_sum)  5) {
wsp_add_to_queue(sc, 0, 0, 0, 
MOUSE_BUTTON3DOWN);
-   DPRINTFN(WSP_LLEVEL_INFO, RIGHT 
CLICK!\n);
+   DPRINTFN(WSP_LLEVEL_INFO, 
RIGHT CLICK!\n);
+   }
break;
case 3:
wsp_add_to_queue(sc, 0, 0, 0, 
MOUSE_BUTTON2DOWN);
@@ -804,8 +808,7 @@ wsp_intr_callback(struct usb_xfer *xfer,
}
wsp_add_to_queue(sc, 0, 0, 0, 0);   /* 
button release */
}
-   if (sc-intr_count = WSP_TAP_MAX_COUNT 
-   (sc-dt_sum / tun.scr_hor_threshold) != 0 
+   if ((sc-dt_sum / tun.scr_hor_threshold) != 0 
sc-ntaps == 2  sc-scr_mode == WSP_SCR_HOR) {
 
/*
@@ -903,7 +906,7 @@ wsp_intr_callback(struct usb_xfer *xfer,
 
if (ntouch == 2  sc-sc_status.button == 0) {
if (sc-scr_mode == WSP_SCR_NONE 
-   abs(sc-dx_sum) + abs(sc-dy_sum)  50)
+   abs(sc-dx_sum) + abs(sc-dy_sum)  
tun.scr_hor_threshold)
sc-scr_mode = abs(sc-dx_sum) 
abs(sc-dy_sum) ? WSP_SCR_HOR :
WSP_SCR_VER;
@@ -918,10 +921,16 @@ wsp_intr_callback(struct usb_xfer *xfer,
dy = 0;
if (sc-dz_count == 0)
dz = sc-dz_sum / tun.z_factor;
-   if (abs(sc-pos_x[0] - sc-pos_x[1])  
MAX_DISTANCE ||
+   if (sc-scr_mode == WSP_SCR_HOR || 
+   abs(sc-pos_x[0] - sc-pos_x[1])  
MAX_DISTANCE ||
abs(sc-pos_y[0] - sc-pos_y[1])  
MAX_DISTANCE)
dz = 0;
}
+   if (ntouch == 3) {
+   dx = 0;
+   dy = 0;
+   dz = 0;
+   }
if (sc-intr_count  WSP_TAP_MAX_COUNT 
abs(dx)  3  abs(dy)  3  abs(dz)  3) {
dx = dy = dz = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/buil

2014-02-25 Thread David Chisnall
On 25 Feb 2014, at 07:52, Baptiste Daroussin b...@freebsd.org wrote:

 On Tue, Feb 25, 2014 at 05:22:22PM +1100, Peter Jeremy wrote:
 On 2014-Feb-22 13:14:38 +0100, Baptiste Daroussin b...@freebsd.org wrote:
 On Sat, Feb 22, 2014 at 07:23:50PM +1100, Peter Jeremy wrote:
 I'd also query the reason for including Debian-specific code in the
 FreeBSD base.
 
 Where have you seen debian specific code?
 
 /usr/src/contrib/dma/debian - as far as I can tell, this directory is
 Debion specific.  I thought we stripped out irrelevant code from third
 party imports but looking wider, there is similarly irrelevant code in
 a variety of other contrib imports.  I'll withdraw that objection.
 
 -- 
 Peter Jeremy
 
 Have you already looked at how contrib works? who cares FYI you can also find
 some win32 specific code in there, debian packaging code, rpm spec files etc.

For the libc++ imports, we strip out the support directory, which contains 
Solaris and Win32-specific stuff.  If we end up with a support/freebsd, then 
we'll bring that in, but not support/solaris and support/win32.  That stuff is 
in the vendor branch, but it just seems polite not to make people who check out 
head get files that are never used when building FreeBSD in any configuration.

David

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


svn commit: r262478 - head/sys/dev/usb/input

2014-02-25 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 25 09:34:30 2014
New Revision: 262478
URL: http://svnweb.freebsd.org/changeset/base/262478

Log:
  Don't generate devd rules for WSP device ID's found in the ATP driver yet.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/usb/input/atp.c

Modified: head/sys/dev/usb/input/atp.c
==
--- head/sys/dev/usb/input/atp.cTue Feb 25 08:37:06 2014
(r262477)
+++ head/sys/dev/usb/input/atp.cTue Feb 25 09:34:30 2014
(r262478)
@@ -509,7 +509,8 @@ static const struct wsp_dev_params wsp_d
 
 #define ATP_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) }
 
-static const STRUCT_USB_HOST_ID wsp_devs[] = {
+/* TODO: STRUCT_USB_HOST_ID */
+static const struct usb_device_id wsp_devs[] = {
/* MacbookAir1.1 */
ATP_DEV(APPLE, WELLSPRING_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING1)),
ATP_DEV(APPLE, WELLSPRING_ISO,  WELLSPRING_DRIVER_INFO(WELLSPRING1)),
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/buil

2014-02-25 Thread Baptiste Daroussin
On Tue, Feb 25, 2014 at 08:49:47AM +, David Chisnall wrote:
 On 25 Feb 2014, at 07:52, Baptiste Daroussin b...@freebsd.org wrote:
 
  On Tue, Feb 25, 2014 at 05:22:22PM +1100, Peter Jeremy wrote:
  On 2014-Feb-22 13:14:38 +0100, Baptiste Daroussin b...@freebsd.org wrote:
  On Sat, Feb 22, 2014 at 07:23:50PM +1100, Peter Jeremy wrote:
  I'd also query the reason for including Debian-specific code in the
  FreeBSD base.
  
  Where have you seen debian specific code?
  
  /usr/src/contrib/dma/debian - as far as I can tell, this directory is
  Debion specific.  I thought we stripped out irrelevant code from third
  party imports but looking wider, there is similarly irrelevant code in
  a variety of other contrib imports.  I'll withdraw that objection.
  
  -- 
  Peter Jeremy
  
  Have you already looked at how contrib works? who cares FYI you can also 
  find
  some win32 specific code in there, debian packaging code, rpm spec files 
  etc.
 
 For the libc++ imports, we strip out the support directory, which contains 
 Solaris and Win32-specific stuff.  If we end up with a support/freebsd, then 
 we'll bring that in, but not support/solaris and support/win32.  That stuff 
 is in the vendor branch, but it just seems polite not to make people who 
 check out head get files that are never used when building FreeBSD in any 
 configuration.
 
 David

Last time I asked about those (iirc when importing byacc) I have been told that
as long as they are not huge (aka take long to checkout) we do not care about
them anymore and that simplifies mergeing from vendor.

regards,
Bapt


pgppx2fjQwf0h.pgp
Description: PGP signature


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

2014-02-25 Thread Ian Lepore
Author: ian
Date: Tue Feb 25 15:22:40 2014
New Revision: 262482
URL: http://svnweb.freebsd.org/changeset/base/262482

Log:
  Invalidate the SCU cache tag ram on all 4 cores, not just 1-3.  I misread
  Juergen's original code, it was doing all 4 cores.  Also remove the L2
  cache invalidate operation, this code runs before L2 is activated.

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

Modified: head/sys/arm/freescale/imx/imx6_mp.c
==
--- head/sys/arm/freescale/imx/imx6_mp.cTue Feb 25 14:47:34 2014
(r262481)
+++ head/sys/arm/freescale/imx/imx6_mp.cTue Feb 25 15:22:40 2014
(r262482)
@@ -113,11 +113,11 @@ platform_mp_start_ap(void)
panic(Couldn't map the system reset controller (SRC)\n);
 
/*
-* Invalidate SCU cache tags.  The 0xfff0 constant invalidates all
-* ways on all cores 1-3 (leaving core 0 alone).  Per the ARM docs, it's
-* harmless to write to the bits for cores that are not present.
+* Invalidate SCU cache tags.  The 0x constant invalidates all
+* ways on all cores 0-3.  Per the ARM docs, it's harmless to write to
+* the bits for cores that are not present.
 */
-   bus_space_write_4(fdtbus_bs_tag, scu, SCU_INV_TAGS_REG, 0xfff0);
+   bus_space_write_4(fdtbus_bs_tag, scu, SCU_INV_TAGS_REG, 0x);
 
/*
 * Erratum ARM/MP: 764369 (problems with cache maintenance).
@@ -128,13 +128,17 @@ platform_mp_start_ap(void)
bus_space_write_4(fdtbus_bs_tag, scu, SCU_DIAG_CONTROL, 
val | SCU_DIAG_DISABLE_MIGBIT);
 
-   /* Enable the SCU. */
+   /*
+* Enable the SCU, then clean the cache on this core.  After these two
+* operations the cache tag ram in the SCU is coherent with the contents
+* of the cache on this core.  The other cores aren't running yet so
+* their caches can't contain valid data yet, but we've initialized
+* their SCU tag ram above, so they will be coherent from startup.
+*/
val = bus_space_read_4(fdtbus_bs_tag, scu, SCU_CONTROL_REG);
bus_space_write_4(fdtbus_bs_tag, scu, SCU_CONTROL_REG, 
val | SCU_CONTROL_ENABLE);
-
cpu_idcache_wbinv_all();
-   cpu_l2cache_wbinv_all();
 
/*
 * For each AP core, set the entry point address and argument registers,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262483 - in head/sys: arm/freescale/vybrid boot/fdt/dts

2014-02-25 Thread Ruslan Bukin
Author: br
Date: Tue Feb 25 17:02:11 2014
New Revision: 262483
URL: http://svnweb.freebsd.org/changeset/base/262483

Log:
  - Pin configuration is a complete iomux register now and includes
drive strength, pull mode, mux mode, speed, etc.
  - Add i2c devices to the tree
  - Add IPG clock

Modified:
  head/sys/arm/freescale/vybrid/vf_ccm.c
  head/sys/arm/freescale/vybrid/vf_iomuxc.c
  head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts
  head/sys/boot/fdt/dts/vybrid-cosmic.dts
  head/sys/boot/fdt/dts/vybrid-quartz.dts
  head/sys/boot/fdt/dts/vybrid.dtsi

Modified: head/sys/arm/freescale/vybrid/vf_ccm.c
==
--- head/sys/arm/freescale/vybrid/vf_ccm.c  Tue Feb 25 15:22:40 2014
(r262482)
+++ head/sys/arm/freescale/vybrid/vf_ccm.c  Tue Feb 25 17:02:11 2014
(r262483)
@@ -164,6 +164,18 @@ struct clk {
uint32_tsel_val;
 };
 
+static struct clk ipg_clk = {
+   .reg = CCM_CACRR,
+   .enable_reg = 0,
+   .div_mask = IPG_CLK_DIV_MASK,
+   .div_shift = IPG_CLK_DIV_SHIFT,
+   .div_val = 1, /* Divide by 2 */
+   .sel_reg = 0,
+   .sel_mask = 0,
+   .sel_shift = 0,
+   .sel_val = 0,
+};
+
 /*
   PLL4 clock divider (before switching the clocks should be gated)
   000 Divide by 1 (only if PLL frequency less than or equal to 650 MHz)
@@ -310,6 +322,7 @@ struct clock_entry {
 };
 
 static struct clock_entry clock_map[] = {
+   {ipg, ipg_clk},
{pll4,pll4_clk},
{sai3,sai3_clk},
{cko1,cko1_clk},

Modified: head/sys/arm/freescale/vybrid/vf_iomuxc.c
==
--- head/sys/arm/freescale/vybrid/vf_iomuxc.c   Tue Feb 25 15:22:40 2014
(r262482)
+++ head/sys/arm/freescale/vybrid/vf_iomuxc.c   Tue Feb 25 17:02:11 2014
(r262483)
@@ -56,21 +56,42 @@ __FBSDID($FreeBSD$);
 #include arm/freescale/vybrid/vf_iomuxc.h
 #include arm/freescale/vybrid/vf_common.h
 
-#defineIBE (1  0) /* Input Buffer Enable Field */
-#defineOBE (1  1) /* Output Buffer Enable Field. */
-#definePUE (1  2) /* Pull / Keep Select Field. */
-#definePKE (1  3) /* Pull / Keep Enable Field. */
-#definePUS_MASK(3  4) /* Pull Up / Down Config Field. */
-#defineDSE_MASK(7  6) /* Drive Strength Field. */
-#defineHYS (1  9) /* Hysteresis Enable Field */
-
 #defineMUX_MODE_MASK   7
 #defineMUX_MODE_SHIFT  20
 #defineMUX_MODE_GPIO   0
 #defineMUX_MODE_VBUS_EN_OTG2
 
-#definePUS_22_KOHM_PULL_UP (3  4)
-#defineDSE_25_OHM  (6  6)
+#defineIBE (1  0)/* Input Buffer Enable Field */
+#defineOBE (1  1)/* Output Buffer Enable Field. 
*/
+#definePUE (1  2)/* Pull / Keep Select Field. */
+#definePKE (1  3)/* Pull / Keep Enable Field. */
+#defineHYS (1  9)/* Hysteresis Enable Field */
+#defineODE (1  10)   /* Open Drain Enable Field. */
+#defineSRE (1  11)   /* Slew Rate Field. */
+
+#defineSPEED_SHIFT 12
+#defineSPEED_MASK  0x3
+#defineSPEED_LOW   0   /* 50 MHz */
+#defineSPEED_MEDIUM0x1 /* 100 MHz */
+#defineSPEED_HIGH  0x3 /* 200 MHz */
+
+#definePUS_SHIFT   4   /* Pull Up / Down Config Field 
Shift */
+#definePUS_MASK0x3
+#definePUS_100_KOHM_PULL_DOWN  0
+#definePUS_47_KOHM_PULL_UP 0x1
+#definePUS_100_KOHM_PULL_UP0x2
+#definePUS_22_KOHM_PULL_UP 0x3
+
+#defineDSE_SHIFT   6   /* Drive Strength Field Shift */
+#defineDSE_MASK0x7
+#defineDSE_DISABLED0   /* Output driver disabled */
+#defineDSE_150_OHM 0x1
+#defineDSE_75_OHM  0x2
+#defineDSE_50_OHM  0x3
+#defineDSE_37_OHM  0x4
+#defineDSE_30_OHM  0x5
+#defineDSE_25_OHM  0x6
+#defineDSE_20_OHM  0x7
 
 #defineMAX_MUX_LEN 1024
 
@@ -101,19 +122,6 @@ iomuxc_probe(device_t dev)
 }
 
 static int
-configure_pad(struct iomuxc_softc *sc, int pad, int mux_mode)
-{
-   int reg;
-
-   reg = READ4(sc, pad);
-   reg = ~(MUX_MODE_MASK  MUX_MODE_SHIFT);
-   reg |= (mux_mode  MUX_MODE_SHIFT);
-   WRITE4(sc, pad, reg);
-
-   return (0);
-}
-
-static int
 pinmux_set(struct iomuxc_softc *sc)
 {
phandle_t child, parent, root;
@@ -121,7 +129,7 @@ pinmux_set(struct iomuxc_softc *sc)
int len;
int 

Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/buil

2014-02-25 Thread Warner Losh

On Feb 24, 2014, at 11:52 PM, Baptiste Daroussin b...@freebsd.org wrote:

 On Tue, Feb 25, 2014 at 05:22:22PM +1100, Peter Jeremy wrote:
 On 2014-Feb-22 13:14:38 +0100, Baptiste Daroussin b...@freebsd.org wrote:
 On Sat, Feb 22, 2014 at 07:23:50PM +1100, Peter Jeremy wrote:
 I'd also query the reason for including Debian-specific code in the
 FreeBSD base.
 
 Where have you seen debian specific code?
 
 /usr/src/contrib/dma/debian - as far as I can tell, this directory is
 Debion specific.  I thought we stripped out irrelevant code from third
 party imports but looking wider, there is similarly irrelevant code in
 a variety of other contrib imports.  I'll withdraw that objection.
 
 -- 
 Peter Jeremy
 
 Have you already looked at how contrib works? who cares FYI you can also find
 some win32 specific code in there, debian packaging code, rpm spec files etc.

Historically we import everything into the vendor branch, but then only import 
the FreeBSD
specific stuff into src/contrib. Sure, there are some mistakes in this, but the 
mistakes don’t
prove the point.

Warner

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


svn commit: r262484 - head/usr.sbin/btxld

2014-02-25 Thread Christian Brueffer
Author: brueffer
Date: Tue Feb 25 17:13:42 2014
New Revision: 262484
URL: http://svnweb.freebsd.org/changeset/base/262484

Log:
  In puthdr(), start the ELF .data section on a new page, as this is
  what btxldr expects (.set MEM_DATA,start+0x1000 in btxldr.S).
  
  This makes resulting ELF binaries bootable with grub, gptboot and boot2.
  
  PR:   153801
  Submitted by: Gleb Kurtsou gleb.kurtsou at gmail.com
  Tested by:Ruben Kerkhof ruben at rubenkerkhof.com
  Glanced at by:jhb, peter
  MFC after:1 month

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

Modified: head/usr.sbin/btxld/btxld.c
==
--- head/usr.sbin/btxld/btxld.c Tue Feb 25 17:02:11 2014(r262483)
+++ head/usr.sbin/btxld/btxld.c Tue Feb 25 17:13:42 2014(r262484)
@@ -426,7 +426,7 @@ puthdr(int fd, struct hdr *hdr)
le32toh(eh.p[0].p_filesz));
eh.p[1].p_vaddr = eh.p[1].p_paddr =
htole32(align(le32toh(eh.p[0].p_paddr) + le32toh(eh.p[0].p_memsz),
-   4));
+   4096));
eh.p[1].p_filesz = eh.p[1].p_memsz = htole32(hdr-data);
eh.sh[2].sh_addr = eh.p[0].p_vaddr;
eh.sh[2].sh_offset = eh.p[0].p_offset;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262487 - head/sys/boot/userboot/userboot

2014-02-25 Thread Sean Bruno
Author: sbruno
Date: Tue Feb 25 18:00:55 2014
New Revision: 262487
URL: http://svnweb.freebsd.org/changeset/base/262487

Log:
  Teach userboot to comply with WITHOUT_CDDL/WITHOUT_ZFS
  
  Apparently, LIBZFS is set to a non-empty string when WITHOUT_CDDL/WITHOUT_ZFS
  are set, I think this is a bug, but work around this feature for now.
  
  Reviewed by:  grehan

Modified:
  head/sys/boot/userboot/userboot/Makefile

Modified: head/sys/boot/userboot/userboot/Makefile
==
--- head/sys/boot/userboot/userboot/MakefileTue Feb 25 17:51:41 2014
(r262486)
+++ head/sys/boot/userboot/userboot/MakefileTue Feb 25 18:00:55 2014
(r262487)
@@ -51,10 +51,12 @@ LIBFICL=${.OBJDIR}/../ficl/libficl.a
 LIBSTAND=  ${.OBJDIR}/../libstand/libstand.a
 .endif
 
+.if ${MK_CDDL} != no
 .if ${MK_ZFS} != no
 CFLAGS+=   -DUSERBOOT_ZFS_SUPPORT
 LIBZFS=${.OBJDIR}/../zfs/libzfsboot.a
 .endif
+.endif
 
 # Always add MI sources 
 .PATH: ${.CURDIR}/../../common
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262488 - head/sbin/fsck_ffs

2014-02-25 Thread Kirk McKusick
Author: mckusick
Date: Tue Feb 25 18:25:27 2014
New Revision: 262488
URL: http://svnweb.freebsd.org/changeset/base/262488

Log:
  Arguments for malloc and calloc should be size_t, not int.
  Use proper bounds check when trying to free cached memory.
  
  Spotted by: Xin Li
  Tested by:  Dmitry Sivachenko
  MFC after:  2 weeks

Modified:
  head/sbin/fsck_ffs/fsck.h
  head/sbin/fsck_ffs/fsutil.c

Modified: head/sbin/fsck_ffs/fsck.h
==
--- head/sbin/fsck_ffs/fsck.h   Tue Feb 25 18:00:55 2014(r262487)
+++ head/sbin/fsck_ffs/fsck.h   Tue Feb 25 18:25:27 2014(r262488)
@@ -369,7 +369,7 @@ int flushentry(void);
  * to get space.
  */
 static inline void*
-Malloc(int size)
+Malloc(size_t size)
 {
void *retval;
 
@@ -384,7 +384,7 @@ Malloc(int size)
  * to get space.
  */
 static inline void*
-Calloc(int cnt, int size)
+Calloc(size_t cnt, size_t size)
 {
void *retval;
 

Modified: head/sbin/fsck_ffs/fsutil.c
==
--- head/sbin/fsck_ffs/fsutil.c Tue Feb 25 18:00:55 2014(r262487)
+++ head/sbin/fsck_ffs/fsutil.c Tue Feb 25 18:25:27 2014(r262488)
@@ -225,7 +225,7 @@ cgget(int cg)
struct cg *cgp;
 
if (cgbufs == NULL) {
-   cgbufs = Calloc(sblock.fs_ncg, sizeof(struct bufarea));
+   cgbufs = calloc(sblock.fs_ncg, sizeof(struct bufarea));
if (cgbufs == NULL)
errx(EEXIT, cannot allocate cylinder group buffers);
}
@@ -254,6 +254,8 @@ flushentry(void)
 {
struct bufarea *cgbp;
 
+   if (flushtries == sblock.fs_ncg || cgbufs == NULL)
+   return (0);
cgbp = cgbufs[flushtries++];
if (cgbp-b_un.b_cg == NULL)
return (0);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262489 - in head/sys: net netinet netinet6 netipsec sys

2014-02-25 Thread John Baldwin
Author: jhb
Date: Tue Feb 25 18:44:33 2014
New Revision: 262489
URL: http://svnweb.freebsd.org/changeset/base/262489

Log:
  Remove more constants related to static sysctl nodes.  The MAXID constants
  were primarily used to size the sysctl name list macros that were removed
  in r254295.  A few other constants either did not have an associated
  sysctl node, or the associated node used OID_AUTO instead.
  
  PR:   ports/184525 (exp-run)

Modified:
  head/sys/net/if_pfsync.h
  head/sys/netinet/icmp_var.h
  head/sys/netinet/igmp_var.h
  head/sys/netinet/in.h
  head/sys/netinet/pim_var.h
  head/sys/netinet/tcp_var.h
  head/sys/netinet/udp_var.h
  head/sys/netinet6/pim6_var.h
  head/sys/netipsec/ipsec.h
  head/sys/netipsec/key_var.h
  head/sys/sys/socket.h
  head/sys/sys/sysctl.h

Modified: head/sys/net/if_pfsync.h
==
--- head/sys/net/if_pfsync.hTue Feb 25 18:25:27 2014(r262488)
+++ head/sys/net/if_pfsync.hTue Feb 25 18:44:33 2014(r262489)
@@ -205,12 +205,6 @@ struct pfsync_tdb {
 
 #definePFSYNC_HDRLEN   sizeof(struct pfsync_header)
 
-/*
- * Names for PFSYNC sysctl objects
- */
-#definePFSYNCCTL_STATS 1   /* PFSYNC stats */
-#definePFSYNCCTL_MAXID 2
-
 struct pfsyncstats {
u_int64_t   pfsyncs_ipackets;   /* total input packets, IPv4 */
u_int64_t   pfsyncs_ipackets6;  /* total input packets, IPv6 */

Modified: head/sys/netinet/icmp_var.h
==
--- head/sys/netinet/icmp_var.h Tue Feb 25 18:25:27 2014(r262488)
+++ head/sys/netinet/icmp_var.h Tue Feb 25 18:44:33 2014(r262489)
@@ -78,12 +78,11 @@ voidkmod_icmpstat_inc(int statnum);
 #endif
 
 /*
- * Names for ICMP sysctl objects
+ * Identifiers for ICMP sysctl nodes
  */
 #defineICMPCTL_MASKREPL1   /* allow replies to netmask 
requests */
 #defineICMPCTL_STATS   2   /* statistics (read-only) */
 #define ICMPCTL_ICMPLIM3
-#define ICMPCTL_MAXID  4
 
 #ifdef _KERNEL
 SYSCTL_DECL(_net_inet_icmp);

Modified: head/sys/netinet/igmp_var.h
==
--- head/sys/netinet/igmp_var.h Tue Feb 25 18:25:27 2014(r262488)
+++ head/sys/netinet/igmp_var.h Tue Feb 25 18:44:33 2014(r262489)
@@ -213,9 +213,8 @@ SYSCTL_DECL(_net_inet_igmp);
 #endif /* _KERNEL */
 
 /*
- * Names for IGMP sysctl objects
+ * Identifiers for IGMP sysctl nodes
  */
 #define IGMPCTL_STATS  1   /* statistics (read-only) */
-#define IGMPCTL_MAXID  2
 
 #endif

Modified: head/sys/netinet/in.h
==
--- head/sys/netinet/in.h   Tue Feb 25 18:25:27 2014(r262488)
+++ head/sys/netinet/in.h   Tue Feb 25 18:44:33 2014(r262489)
@@ -602,14 +602,7 @@ intgetsourcefilter(int, uint32_t, struc
 #defineIP_PORTRANGE_LOW2   /* low - vouchsafe security */
 
 /*
- * Definitions for inet sysctl operations.
- *
- * Third level is protocol number.
- * Fourth level is desired variable within that protocol.
- */
-
-/*
- * Names for IP sysctl objects
+ * Identifiers for IP sysctl nodes
  */
 #defineIPCTL_FORWARDING1   /* act as router */
 #defineIPCTL_SENDREDIRECTS 2   /* may send redirects when 
forwarding */
@@ -629,7 +622,6 @@ int getsourcefilter(int, uint32_t, struc
 #defineIPCTL_FASTFORWARDING14  /* use fast IP forwarding code 
*/
 #defineIPCTL_KEEPFAITH 15  /* FAITH IPv4-IPv6 translater 
ctl */
 #defineIPCTL_GIF_TTL   16  /* default TTL for gif encap 
packet */
-#defineIPCTL_MAXID 17
 
 #endif /* __BSD_VISIBLE */
 

Modified: head/sys/netinet/pim_var.h
==
--- head/sys/netinet/pim_var.h  Tue Feb 25 18:25:27 2014(r262488)
+++ head/sys/netinet/pim_var.h  Tue Feb 25 18:44:33 2014(r262489)
@@ -66,10 +66,9 @@ struct pimstat {
 #endif
 
 /*
- * Names for PIM sysctl objects
+ * Identifiers for PIM sysctl nodes
  */
 #define PIMCTL_STATS   1   /* statistics (read-only) */
-#define PIMCTL_MAXID   2
 
 #ifdef _KERNEL
 

Modified: head/sys/netinet/tcp_var.h
==
--- head/sys/netinet/tcp_var.h  Tue Feb 25 18:25:27 2014(r262488)
+++ head/sys/netinet/tcp_var.h  Tue Feb 25 18:44:33 2014(r262489)
@@ -576,7 +576,7 @@ struct  xtcpcb {
 #endif
 
 /*
- * Names for TCP sysctl objects
+ * Identifiers for TCP sysctl nodes
  */
 #defineTCPCTL_DO_RFC1323   1   /* use RFC-1323 extensions */
 #defineTCPCTL_MSSDFLT  3   /* MSS default */

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

2014-02-25 Thread John Baldwin
On Friday, February 21, 2014 5:29:09 pm Mateusz Guzik wrote:
 Author: mjg
 Date: Fri Feb 21 22:29:09 2014
 New Revision: 262309
 URL: http://svnweb.freebsd.org/changeset/base/262309
 
 Log:
   Fix a race between kern_proc_{o,}filedesc_out and fdescfree leading
   to use-after-free.
   
   fdescfree proceeds to free file pointers once fd_refcnt reaches 0, but
   kern_proc_{o,}filedesc_out only checked for hold count.

Can you describe the race in more detail?  The kern_* routines hold
FILEDESC_SLOCK() while they read the file which should prevent
fdescfree() from free'ing any files.  Note that fdfree() (called
under FILEDESC_XLOCK() clears the file pointer to NULL via the
bzero(), so the sysctl handler should only see non-NULL pointers
for files that are not yet free'd.

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


svn commit: r262494 - head/usr.sbin/bsnmpd/tools/bsnmptools

2014-02-25 Thread Christian Brueffer
Author: brueffer
Date: Tue Feb 25 21:01:55 2014
New Revision: 262494
URL: http://svnweb.freebsd.org/changeset/base/262494

Log:
  Rough cleanup (new sentence - new line, grammar, spelling, mdoc).
  This could use more work.
  
  PR:   187035 (in part)
  Submitted by: Bjorn Heidotting
  MFC after:1 week

Modified:
  head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1

Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1
==
--- head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1Tue Feb 25 20:27:51 
2014(r262493)
+++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1Tue Feb 25 21:01:55 
2014(r262494)
@@ -106,18 +106,18 @@ management information to a Simple Netwo
 .Pp
 Depending on the options
 .Nm bsnmpget
-constructs either a SMNP GetRequest, GetNextRequest
+constructs either a SNMP GetRequest, GetNextRequest
 or a GetBulkRequest packet, fills in the object identifiers (OIDs) of the
 objects whose values will be retrieved, waits for a response and prints it if
 received successfully.
 .Pp
 .Nm Bsnmpwalk
-queries an agent with ether SMNP GetNextRequest or GetBulkRequest packets,
+queries an agent with ether SNMP GetNextRequest or GetBulkRequest packets,
 asking for values of OID instances that are a part of the object subtree
 rooted at the provided OIDs.
 .Pp
 .Nm Bsnmpset
-constructs a SMNP SetRequest packet, fills in the OIDs (object identifiers),
+constructs a SNMP SetRequest packet, fills in the OIDs (object identifiers),
 syntaxes and values of the objects whose values are to be set and waits for a
 response from server.
 .Sh OPTIONS
@@ -151,7 +151,8 @@ The context to query with SNMPv3 PDUs.
 The context name. Default is  (empty).
 .It Cm context-engine=engine-id
 The SNMP Engine ID of the context to query with SNMPv3 PDUs, represented as
-binary octet string. By default, this is set to the Engine ID of the SNMP 
agent.
+binary octet string.
+By default, this is set to the Engine ID of the SNMP agent.
 .El
 .It Fl D
 Perform SNMP USM Engine Discovery, rather than sending a request for the value
@@ -177,7 +178,8 @@ Specifies the initial OID that was cut b
 .Xr gensnmpdef 1
 when producing the MIB description file.
 The default value is .iso(1).org(3).dod(6) which is what should have been
-used for all the files installed under /usr/share/snmp/defs.
+used for all the files installed under
+.Pa /usr/share/snmp/defs .
 Use this only if you generated your own files, providing a
 .Fl c
 option to
@@ -198,7 +200,8 @@ If using spaces make sure the entire opt
 example using quotes.
 .It Fl i Ar filelist
 List of MIB description files produced by
-.Xr gensnmpdef 1 which
+.Xr gensnmpdef 1
+which
 .Nm bsnmpget ,
 .Nm bsnmpwalk
 or
@@ -207,12 +210,13 @@ will search to translate numerical OIDs 
 Multiple files can be provided either giving this option multiple times
 or a comma separated list of file names.
 If a filename begins with a letter the default directory,
-/usr/share/snmp/defs,
+.Pa /usr/share/snmp/defs ,
 will be searched.
 .It Fl K
 Calculate and display the localized authentication and privacy keys
-corresponding to a plain text password. The password is obtain via the
-environment. Additionally, if one or more OIDs are specified, the calculated
+corresponding to a plain text password.
+The password is obtained via the environment.
+Additionally, if one or more OIDs are specified, the calculated
 keys are used when processing the SNMPv3 requests.
 .It Fl l Ar filename
 The path of the posix local (unix domain) socket if local
@@ -242,9 +246,9 @@ In addition to the short output verbose 
 Privacy options to use with SNMPv3 PDUs
 .Bl -tag -width \
 .It Cm proto=[aes|des]
-The protocol to use when encypting/decrypting SNMPv3 PDU data.
+The protocol to use when encrypting/decrypting SNMPv3 PDU data.
 .It Cm key=privkey
-A binary localized privacy key to use when encypting/decrypting SNMPv3 PDU 
data.
+A binary localized privacy key to use when encrypting/decrypting SNMPv3 PDU 
data.
 .El
 .Pp
 By default plain text SNMPv3 PDUs are sent.
@@ -267,14 +271,14 @@ not respond after the first try.
 Default is 3.
 .It Fl s Ar [trans::] Ns Ar [community@] Ns Ar [server] Ns Ar [:port]
 Each of the server specification components is optional but at least one
-has to be provided if
+has to be provided if the
 .Ar s
 option is used.
 The server specification is constructed in the following manner:
 .Bl -tag -width \
 .It Cm trans::
 Transport type may be one of udp, stream or dgram.
-If this option is not provided an udp inet/inet6 socket will be used, which
+If this option is not provided an UDP inet/inet6 socket will be used, which
 is the most common.
 Stream stands for a posix local stream socket and a posix local datagram
 socket will be used if dgram is specified.
@@ -317,11 +321,13 @@ The value of the snmpEngineTime of the S
 If any of the above is not specified, SNMP USM Engine Discovery is attempted.
 

svn commit: r262495 - head/sys/boot/userboot/userboot

2014-02-25 Thread Sean Bruno
Author: sbruno
Date: Tue Feb 25 21:07:18 2014
New Revision: 262495
URL: http://svnweb.freebsd.org/changeset/base/262495

Log:
  Slightly better revision of teaching userboot how to respect MK_CDDL
  
  Reviewed by:  grehan

Modified:
  head/sys/boot/userboot/userboot/Makefile

Modified: head/sys/boot/userboot/userboot/Makefile
==
--- head/sys/boot/userboot/userboot/MakefileTue Feb 25 21:01:55 2014
(r262494)
+++ head/sys/boot/userboot/userboot/MakefileTue Feb 25 21:07:18 2014
(r262495)
@@ -51,11 +51,11 @@ LIBFICL=${.OBJDIR}/../ficl/libficl.a
 LIBSTAND=  ${.OBJDIR}/../libstand/libstand.a
 .endif
 
-.if ${MK_CDDL} != no
 .if ${MK_ZFS} != no
 CFLAGS+=   -DUSERBOOT_ZFS_SUPPORT
 LIBZFS=${.OBJDIR}/../zfs/libzfsboot.a
-.endif
+DPADD= ${LIBZFS}
+LDADD= ${LIBZFS}
 .endif
 
 # Always add MI sources 
@@ -63,7 +63,7 @@ LIBZFS=   ${.OBJDIR}/../zfs/libzfsboot.a
 .include   ${.CURDIR}/../../common/Makefile.inc
 CFLAGS+=   -I${.CURDIR}/../../common
 CFLAGS+=   -I.
-DPADD= ${LIBFICL} ${LIBZFS} ${LIBSTAND} 
-LDADD= ${LIBFICL} ${LIBZFS} ${LIBSTAND}
+DPADD+=${LIBFICL} ${LIBSTAND} 
+LDADD+=${LIBFICL} ${LIBSTAND}
 
 .include bsd.lib.mk
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/buil

2014-02-25 Thread Ed Maste
On 25 February 2014 03:49, David Chisnall thera...@freebsd.org wrote:

 For the libc++ imports, we strip out the support directory, which contains 
 Solaris and Win32-specific stuff.  If we end up with a support/freebsd, then 
 we'll bring that in, but not support/solaris and support/win32.  That stuff 
 is in the vendor branch, but it just seems polite not to make people who 
 check out head get files that are never used when building FreeBSD in any 
 configuration.

And, this is the process documented in the subversion primer in the
committers guide:

 Unlike in CVS where only the needed parts were imported into the vendor tree 
 to avoid bloating the main tree, Subversion is able to store a full 
 distribution in the vendor tree. So, import everything, but merge only what 
 is required.

We should probably drop the Unlike in CVS bit, as differences vs.
the process used in 2008 become increasingly less relevant.  Some
additional advice or examples on how to merge only what is required
will be useful too -- for instance, identifying and excluding files
added since the last vendor import that are not desired in HEAD.

That said, for the LLDB imports to date I stripped the tree before the
import to vendor/.  When I do another import after the current work is
merged to HEAD I'll import everything in vendor/, and take notes as I
do the merge to HEAD in order to update the committer's guide.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262499 - in head: release share/man/man7

2014-02-25 Thread Glen Barber
Author: gjb
Date: Tue Feb 25 22:13:48 2014
New Revision: 262499
URL: http://svnweb.freebsd.org/changeset/base/262499

Log:
  release.sh:
  - Add a VCSCMD variable that defaults to 'svn checkout',
and update places 'svn co' is used directly.
  - After sourcing a configuration file, prefix SRCBRANCH,
PORTBRANCH, and DOCBRANCH with the SVNROOT.
  - Properly capitalize 'FreeBSD.org' in the default SVNROOT.
  - Update Copyright.
  
  release.conf.sample:
  - Add an example to use git instead of svn, by nullifying
SVNROOT, and setting SRCBRANCH, DOCBRANCH, and PORTBRANCH
to the URL fo a git repository.
  
  release.7:
  - Document VCSCMD.
  
  Submitted by: Rick Miller (based on)
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/release.conf.sample
  head/release/release.sh
  head/share/man/man7/release.7

Modified: head/release/release.conf.sample
==
--- head/release/release.conf.sampleTue Feb 25 21:43:46 2014
(r262498)
+++ head/release/release.conf.sampleTue Feb 25 22:13:48 2014
(r262499)
@@ -7,7 +7,7 @@
 CHROOTDIR=/scratch
 
 ## Set the svn host.
-SVNROOT=svn://svn.FreeBSD.org
+SVNROOT=svn://svn.FreeBSD.org/
 
 ## Set the src/, ports/, and doc/ branches or tags.
 SRCBRANCH=base/head@rHEAD
@@ -17,6 +17,13 @@ PORTBRANCH=ports/head@rHEAD
 ## Run svn co --force for src checkout.
 #SRC_FORCE_CHECKOUT=yes
 
+## Sample configuration for using git instead of svn.
+#VCSCMD=/usr/local/bin/git clone --branch master
+#SVNROOT=
+#SRCBRANCH=https://github.com/freebsd/freebsd;
+#DOCBRANCH=https://github.com/freebsd/freebsd-doc;
+#PORTBRANCH=https://github.com/freebsd/freebsd-ports;
+
 ## Set to override the default target architecture.
 #TARGET=amd64
 #TARGET_ARCH=amd64

Modified: head/release/release.sh
==
--- head/release/release.sh Tue Feb 25 21:43:46 2014(r262498)
+++ head/release/release.sh Tue Feb 25 22:13:48 2014(r262499)
@@ -1,9 +1,13 @@
 #!/bin/sh
 #-
+# Copyright (c) 2013, 2014 The FreeBSD Foundation
 # Copyright (c) 2013 Glen Barber
 # Copyright (c) 2011 Nathan Whitehorn
 # All rights reserved.
 #
+# Portions of this software were developed by Glen Barber
+# under sponsorship from the FreeBSD Foundation.
+#
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
 # are met:
@@ -38,9 +42,12 @@ export PATH
 # The directory within which the release will be built.
 CHROOTDIR=/scratch
 
+# The default version control system command to obtain the sources.
+VCSCMD=svn checkout
+
 # The default svn checkout server, and svn branches for src/, doc/,
 # and ports/.
-SVNROOT=svn://svn.freebsd.org
+SVNROOT=svn://svn.FreeBSD.org/
 SRCBRANCH=base/head@rHEAD
 DOCBRANCH=doc/head@rHEAD
 PORTBRANCH=ports/head@rHEAD
@@ -98,6 +105,11 @@ while getopts c: opt; do
 done
 shift $(($OPTIND - 1))
 
+# Prefix the branches with the SVNROOT for the full checkout URL.
+SRCBRANCH=${SVNROOT}${SRCBRANCH}
+DOCBRANCH=${SVNROOT}${DOCBRANCH}
+PORTBRANCH=${SVNROOT}${PORTBRANCH}
+
 # If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree
 # is required to build the documentation set.
 if [ x${NOPORTS} != x ]  [ x${NODOC} = x ]; then
@@ -155,12 +167,12 @@ set -e # Everything must succeed
 
 mkdir -p ${CHROOTDIR}/usr
 
-svn co ${FORCE_SRC_KEY} ${SVNROOT}/${SRCBRANCH} ${CHROOTDIR}/usr/src
+${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src
 if [ x${NODOC} = x ]; then
-   svn co ${SVNROOT}/${DOCBRANCH} ${CHROOTDIR}/usr/doc
+   ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc
 fi
 if [ x${NOPORTS} = x ]; then
-   svn co ${SVNROOT}/${PORTBRANCH} ${CHROOTDIR}/usr/ports
+   ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports
 fi
 
 cd ${CHROOTDIR}/usr/src

Modified: head/share/man/man7/release.7
==
--- head/share/man/man7/release.7   Tue Feb 25 21:43:46 2014
(r262498)
+++ head/share/man/man7/release.7   Tue Feb 25 22:13:48 2014
(r262499)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd December 2, 2013
+.Dd February 25, 2014
 .Dt RELEASE 7
 .Os
 .Sh NAME
@@ -245,6 +245,10 @@ Setting this also sets
 Set to a non-empty value to include the
 .Cm dvdrom
 target.
+.It Va VCSCMD
+The command run to obtain the source trees.
+Defaults to
+.Qq Cm svn checkout .
 .El
 .Sh MAKEFILE TARGETS
 The release makefile
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262501 - head/secure/lib/libcrypt

2014-02-25 Thread Xin LI
Author: delphij
Date: Tue Feb 25 23:03:48 2014
New Revision: 262501
URL: http://svnweb.freebsd.org/changeset/base/262501

Log:
  Refresh our implementation of OpenBSD's Blowfish password format.
  
  Notable changes:
  
   - Support of $2b$ password format to address a problem where very
 long passwords (more than 256 characters, when an integer
 overflow would happen and cause the length to wrap at 256).
   - Updated pseudo code in comments to reflect the reality.
   - Removed our local shortcut of processing magic string and rely
 on the centralized and tigntened validation.
   - Diff reduction from upstream.
  
  For now we are still generating the older $02a$ format of password
  but we will migrate to the new format once the format is formally
  finalized.
  
  MFC after:1 month

Modified:
  head/secure/lib/libcrypt/crypt-blowfish.c

Modified: head/secure/lib/libcrypt/crypt-blowfish.c
==
--- head/secure/lib/libcrypt/crypt-blowfish.c   Tue Feb 25 22:13:51 2014
(r262500)
+++ head/secure/lib/libcrypt/crypt-blowfish.c   Tue Feb 25 23:03:48 2014
(r262501)
@@ -1,3 +1,5 @@
+/* $OpenBSD: bcrypt.c,v 1.29 2014/02/24 19:45:43 tedu Exp $*/
+
 /*
  * Copyright 1997 Niels Provos pro...@physnet.uni-hamburg.de
  * All rights reserved.
@@ -35,10 +37,10 @@ __FBSDID($FreeBSD$);
  * d...@lcs.mit.edu and works as follows:
  *
  * 1. state := InitState ()
- * 2. state := ExpandKey (state, salt, password) 3.
- * REPEAT rounds:
+ * 2. state := ExpandKey (state, salt, password)
+ * 3. REPEAT rounds:
+ *  state := ExpandKey (state, 0, password)
  * state := ExpandKey (state, 0, salt)
- *  state := ExpandKey(state, 0, password)
  * 4. ctext := OrpheanBeholderScryDoubt
  * 5. REPEAT 64:
  * ctext := Encrypt_ECB (state, ctext);
@@ -48,6 +50,7 @@ __FBSDID($FreeBSD$);
 
 /*
  * FreeBSD implementation by Paul Herman pher...@frenchfries.net
+ * and updated by Xin Li delp...@freebsd.org
  */
 
 #include stdio.h
@@ -66,18 +69,18 @@ __FBSDID($FreeBSD$);
 #define BCRYPT_VERSION '2'
 #define BCRYPT_MAXSALT 16  /* Precomputation is just so nice */
 #define BCRYPT_BLOCKS 6/* Ciphertext blocks */
-#define BCRYPT_MINROUNDS 16/* we have log2(rounds) in salt */
+#define BCRYPT_MINLOGROUNDS 4  /* we have log2(rounds) in salt */
+
 
 static void encode_base64(u_int8_t *, u_int8_t *, u_int16_t);
 static void decode_base64(u_int8_t *, u_int16_t, const u_int8_t *);
 
 static charencrypted[_PASSWORD_LEN];
 
-static const u_int8_t Base64Code[] =
+const static u_int8_t Base64Code[] =
 ./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789;
 
-static const u_int8_t index_64[128] =
-{
+const static u_int8_t index_64[128] = {
255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
@@ -108,7 +111,7 @@ decode_base64(u_int8_t *buffer, u_int16_
if (c1 == 255 || c2 == 255)
break;
 
-   *bp++ = (u_int8_t)((c1  2) | ((c2  0x30)  4));
+   *bp++ = (c1  2) | ((c2  0x30)  4);
if (bp = buffer + len)
break;
 
@@ -138,23 +141,19 @@ crypt_blowfish(const char *key, const ch
blf_ctx state;
u_int32_t rounds, i, k;
u_int16_t j;
-   u_int8_t key_len, salt_len, logr, minr;
+   size_t key_len;
+   u_int8_t salt_len, logr, minr;
u_int8_t ciphertext[4 * BCRYPT_BLOCKS] = OrpheanBeholderScryDoubt;
u_int8_t csalt[BCRYPT_MAXSALT];
u_int32_t cdata[BCRYPT_BLOCKS];
-   static const char *magic = $2a$04$;
-   
-   /* Defaults */
-   minr = 'a';
-   logr = 4;
-   rounds = 1  logr;
+   char arounds[3];
 
-/* If it starts with the magic string, then skip that */
-   if(!strncmp(salt, magic, strlen(magic))) {
-   salt += strlen(magic);
-   }
-   else if (*salt == '$') {
+   /* Defaults */
+   minr = 'a';
+   logr = BCRYPT_MINLOGROUNDS;
+   rounds = 1U  logr;
 
+   if (*salt == '$') {
/* Discard $ identifier */
salt++;
 
@@ -166,9 +165,9 @@ crypt_blowfish(const char *key, const ch
/* Check for minor versions */
if (salt[1] != '$') {
 switch (salt[1]) {
-case 'a':
-/* 'ab' should not yield the same as 'abab' */
-minr = (u_int8_t)salt[1];
+case 'a':  /* 'ab' should not yield the same as 
'abab' */
+case 'b':  /* cap input length at 72 bytes */
+minr = salt[1];
 salt++;
 break;
 

svn commit: r262502 - head/sys/dev/syscons

2014-02-25 Thread Julio Merino
Author: jmmv
Date: Tue Feb 25 23:04:39 2014
New Revision: 262502
URL: http://svnweb.freebsd.org/changeset/base/262502

Log:
  Fix comment introduced in r262480: it's 1920x1200, not 1980x1200.
  
  PR:   kern/180558
  MFC after:5 days

Modified:
  head/sys/dev/syscons/syscons.h

Modified: head/sys/dev/syscons/syscons.h
==
--- head/sys/dev/syscons/syscons.h  Tue Feb 25 23:03:48 2014
(r262501)
+++ head/sys/dev/syscons/syscons.h  Tue Feb 25 23:04:39 2014
(r262502)
@@ -145,7 +145,7 @@
 /*
The following #defines are hard-coded for a maximum text
resolution corresponding to a maximum framebuffer
-   resolution of 1980x1200 with an 8x8 font...
+   resolution of 1920x1200 with an 8x8 font...
 */
 #defineCOL 240
 #defineROW 150
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r262480 - head/sys/dev/syscons

2014-02-25 Thread Julio Merino
On Tue, Feb 25, 2014 at 9:30 AM, Thomas Hoffmann trh...@gmail.com wrote:

 The math works out OK for COL 240, but the comment has it wrong. Should be
 1920x1200.


Doh, of course. Fixed in r262502.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262508 - head/sys/cddl/dev/systrace

2014-02-25 Thread Mark Johnston
Author: markj
Date: Wed Feb 26 01:00:00 2014
New Revision: 262508
URL: http://svnweb.freebsd.org/changeset/base/262508

Log:
  Revert r262466, as it does not compile on PowerPC.
  
  Reported by:  jhibbits

Modified:
  head/sys/cddl/dev/systrace/systrace.c

Modified: head/sys/cddl/dev/systrace/systrace.c
==
--- head/sys/cddl/dev/systrace/systrace.c   Wed Feb 26 00:54:59 2014
(r262507)
+++ head/sys/cddl/dev/systrace/systrace.c   Wed Feb 26 01:00:00 2014
(r262508)
@@ -168,9 +168,6 @@ static dtrace_pops_t systrace_pops = {
 static struct cdev *systrace_cdev;
 static dtrace_provider_id_tsystrace_id;
 
-typedef void (*systrace_dtrace_probe)(dtrace_id_t, uintptr_t, uintptr_t,
-uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
-
 #if !defined(LINUX_SYSTRACE)
 /*
  * Probe callback function.
@@ -214,8 +211,7 @@ systrace_probe(u_int32_t id, int sysnum,
}
 
/* Process the probe using the converted argments. */
-   ((systrace_dtrace_probe)(dtrace_probe))(id, uargs[0], uargs[1],
-   uargs[2], uargs[3], uargs[4], uargs[5], uargs[6], uargs[7]);
+   dtrace_probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4]);
 }
 
 #endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262515 - head/sys/mips/conf

2014-02-25 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 26 01:32:27 2014
New Revision: 262515
URL: http://svnweb.freebsd.org/changeset/base/262515

Log:
  Add the DB120 specific hints for the AR8327.
  
  Tested:
  
  * DB120

Modified:
  head/sys/mips/conf/DB120.hints

Modified: head/sys/mips/conf/DB120.hints
==
--- head/sys/mips/conf/DB120.hints  Wed Feb 26 01:32:06 2014
(r262514)
+++ head/sys/mips/conf/DB120.hints  Wed Feb 26 01:32:27 2014
(r262515)
@@ -21,30 +21,32 @@ hint.arswitch.0.numphys=5
 hint.arswitch.0.phy4cpu=0
 hint.arswitch.0.is_rgmii=1
 hint.arswitch.0.is_gmii=0
-# XXX other AR8327 configuration parameters
 
-# pad0 cfg:
-# .mode = AR8327_PAD_MAC_RGMII,
-# .txclk_delay_en = true,
-# .rxclk_delay_en = true,
-# .txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
-# .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
-
-# .led_ctrl0 = 0x,
-# .led_ctrl1 = 0xc737c737,
-# .led_ctrl2 = 0x,
-# .led_ctrl3 = 0x00c30c00,
-# .open_drain = true,
-
-# .port0_cfg = {
-# .force_link = 1,
-# .speed = AR8327_PORT_SPEED_1000,
-# .duplex = 1,
-# .txpause = 1,
-# .rxpause = 1,
-# },
+# Other AR8327 configuration parameters
 
-# port6 cfg?
+# AR8327_PAD_MAC_RGMII
+hint.arswitch.0.pad.0.mode=6
+hint.arswitch.0.pad.0.txclk_delay_en=1
+hint.arswitch.0.pad.0.rxclk_delay_en=1
+# AR8327_CLK_DELAY_SEL1
+hint.arswitch.0.pad.0.txclk_delay_sel=1
+# AR8327_CLK_DELAY_SEL2
+hint.arswitch.0.pad.0.rxclk_delay_sel=2
+
+# XXX there's no LED management just yet!
+hint.arswitch.0.led.ctrl0=0x
+hint.arswitch.0.led.ctrl1=0xc737c737
+hint.arswitch.0.led.ctrl2=0x
+hint.arswitch.0.led.ctrl3=0x00c30c00
+hint.arswitch.0.led.open_drain=1
+
+# force_link=1 is required for the rest of the parameters
+# to be configured.
+hint.arswitch.0.port.0.force_link=1
+hint.arswitch.0.port.0.speed=1000
+hint.arswitch.0.port.0.duplex=1
+hint.arswitch.0.port.0.txpause=1
+hint.arswitch.0.port.0.rxpause=1
 
 # XXX OpenWRT DB120 BSP doesn't have media/duplex set?
 hint.arge.0.phymask=0x0
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262519 - head/sys/dev/etherswitch/arswitch

2014-02-25 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 26 02:00:37 2014
New Revision: 262519
URL: http://svnweb.freebsd.org/changeset/base/262519

Log:
  Add LED setup support for the AR8327.
  
  Tested:
  
  * DB120
  
  Obtained from:OpenWRT

Modified:
  head/sys/dev/etherswitch/arswitch/arswitch_8327.c

Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c
==
--- head/sys/dev/etherswitch/arswitch/arswitch_8327.c   Wed Feb 26 01:57:55 
2014(r262518)
+++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c   Wed Feb 26 02:00:37 
2014(r262519)
@@ -435,6 +435,53 @@ ar8327_fetch_pdata_sgmii(struct arswitch
 }
 
 /*
+ * Fetch the LED configuration from the boot hints.
+ */
+static int
+ar8327_fetch_pdata_led(struct arswitch_softc *sc,
+struct ar8327_led_cfg *lcfg)
+{
+   int val;
+
+   val = 0;
+   if (resource_int_value(device_get_name(sc-sc_dev),
+   device_get_unit(sc-sc_dev),
+   led.ctrl0, val) != 0)
+   return (0);
+   lcfg-led_ctrl0 = val;
+
+   val = 0;
+   if (resource_int_value(device_get_name(sc-sc_dev),
+   device_get_unit(sc-sc_dev),
+   led.ctrl1, val) != 0)
+   return (0);
+   lcfg-led_ctrl1 = val;
+
+   val = 0;
+   if (resource_int_value(device_get_name(sc-sc_dev),
+   device_get_unit(sc-sc_dev),
+   led.ctrl2, val) != 0)
+   return (0);
+   lcfg-led_ctrl2 = val;
+
+   val = 0;
+   if (resource_int_value(device_get_name(sc-sc_dev),
+   device_get_unit(sc-sc_dev),
+   led.ctrl3, val) != 0)
+   return (0);
+   lcfg-led_ctrl3 = val;
+
+   val = 0;
+   if (resource_int_value(device_get_name(sc-sc_dev),
+   device_get_unit(sc-sc_dev),
+   led.open_drain, val) != 0)
+   return (0);
+   lcfg-open_drain = val;
+
+   return (1);
+}
+
+/*
  * Initialise the ar8327 specific hardware features from
  * the hints provided in the boot environment.
  */
@@ -444,6 +491,7 @@ ar8327_init_pdata(struct arswitch_softc 
struct ar8327_pad_cfg pc;
struct ar8327_port_cfg port_cfg;
struct ar8327_sgmii_cfg scfg;
+   struct ar8327_led_cfg lcfg;
uint32_t t, new_pos, pos;
 
/* Port 0 */
@@ -487,6 +535,25 @@ ar8327_init_pdata(struct arswitch_softc 
new_pos = pos;
 
/* XXX LED config */
+   bzero(lcfg, sizeof(lcfg));
+   if (ar8327_fetch_pdata_led(sc, lcfg)) {
+   if (lcfg.open_drain)
+   new_pos |= AR8327_POWER_ON_STRIP_LED_OPEN_EN;
+   else
+   new_pos = ~AR8327_POWER_ON_STRIP_LED_OPEN_EN;
+
+   arswitch_writereg(sc-sc_dev, AR8327_REG_LED_CTRL0,
+   lcfg.led_ctrl0);
+   arswitch_writereg(sc-sc_dev, AR8327_REG_LED_CTRL1,
+   lcfg.led_ctrl1);
+   arswitch_writereg(sc-sc_dev, AR8327_REG_LED_CTRL2,
+   lcfg.led_ctrl2);
+   arswitch_writereg(sc-sc_dev, AR8327_REG_LED_CTRL3,
+   lcfg.led_ctrl3);
+
+   if (new_pos != pos)
+   new_pos |= AR8327_POWER_ON_STRIP_POWER_ON_SEL;
+   }
 
/* SGMII config */
bzero(scfg, sizeof(scfg));
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262521 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2014-02-25 Thread Jason Evans
Author: jasone
Date: Wed Feb 26 02:36:59 2014
New Revision: 262521
URL: http://svnweb.freebsd.org/changeset/base/262521

Log:
  Update jemalloc to version 3.5.1.

Modified:
  head/contrib/jemalloc/ChangeLog
  head/contrib/jemalloc/FREEBSD-Xlist
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_macros.h
  head/contrib/jemalloc/include/jemalloc/internal/prof.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/huge.c

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Wed Feb 26 02:02:51 2014
(r262520)
+++ head/contrib/jemalloc/ChangeLog Wed Feb 26 02:36:59 2014
(r262521)
@@ -3,8 +3,26 @@ bug fixes are all mentioned, but interna
 brevity (even though they are more fun to write about).  Much more detail can 
be
 found in the git revision history:
 
-http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git
-git://canonware.com/jemalloc.git
+https://github.com/jemalloc/jemalloc
+
+* 3.5.1 (February 25, 2014)
+
+  This version primarily addresses minor bugs in test code.
+
+  Bug fixes:
+  - Configure Solaris/Illumos to use MADV_FREE.
+  - Fix junk filling for mremap(2)-based huge reallocation.  This is only
+relevant if configuring with the --enable-mremap option specified.
+  - Avoid compilation failure if 'restrict' C99 keyword is not supported by the
+compiler.
+  - Add a configure test for SSE2 rather than assuming it is usable on i686
+systems.  This fixes test compilation errors, especially on 32-bit Linux
+systems.
+  - Fix mallctl argument size mismatches (size_t vs. uint64_t) in the stats 
unit
+test.
+  - Fix/remove flawed alignment-related overflow tests.
+  - Prevent compiler optimizations that could change backtraces in the
+prof_accum unit test.
 
 * 3.5.0 (January 22, 2014)
 
@@ -16,7 +34,7 @@ found in the git revision history:
 API.  The *allocx() functions are slightly simpler to use because they have
 fewer parameters, they directly return the results of primary interest, and
 mallocx()/rallocx() avoid the strict aliasing pitfall that
-allocm()/rallocx() share with posix_memalign().  Note that *allocm() is
+allocm()/rallocm() share with posix_memalign().  Note that *allocm() is
 slated for removal in the next non-bugfix release.
   - Add support for LinuxThreads.
 

Modified: head/contrib/jemalloc/FREEBSD-Xlist
==
--- head/contrib/jemalloc/FREEBSD-Xlist Wed Feb 26 02:02:51 2014
(r262520)
+++ head/contrib/jemalloc/FREEBSD-Xlist Wed Feb 26 02:36:59 2014
(r262521)
@@ -28,6 +28,7 @@ include/jemalloc/internal/public_unnames
 include/jemalloc/internal/size_classes.sh
 include/jemalloc/jemalloc.h.in
 include/jemalloc/jemalloc.sh
+include/jemalloc/jemalloc_defs.h
 include/jemalloc/jemalloc_defs.h.in
 include/jemalloc/jemalloc_macros.h
 include/jemalloc/jemalloc_macros.h.in

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Wed Feb 26 02:02:51 2014
(r262520)
+++ head/contrib/jemalloc/VERSION   Wed Feb 26 02:36:59 2014
(r262521)
@@ -1 +1 @@
-3.5.0-0-gcc47dde16203a6ae7eb685b53e1ae501f3869bc6
+3.5.1-0-g7709a64c59daf0b1f938be49472fcc499e1bd136

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Wed Feb 26 02:02:51 2014
(r262520)
+++ head/contrib/jemalloc/doc/jemalloc.3Wed Feb 26 02:36:59 2014
(r262521)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 01/22/2014
+.\  Date: 02/25/2014
 .\Manual: User Manual
-.\Source: jemalloc 3.5.0-0-gcc47dde16203a6ae7eb685b53e1ae501f3869bc6
+.\Source: jemalloc 3.5.1-0-g7709a64c59daf0b1f938be49472fcc499e1bd136
 .\  Language: English
 .\
-.TH JEMALLOC 3 01/22/2014 jemalloc 3.5.0-0-gcc47dde16203 User Manual
+.TH JEMALLOC 3 02/25/2014 jemalloc 3.5.1-0-g7709a64c59da User Manual
 .\ -
 .\ * Define some portability stuff
 .\ -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH LIBRARY
 .PP
-This manual describes jemalloc 
3\.5\.0\-0\-gcc47dde16203a6ae7eb685b53e1ae501f3869bc6\. More information can 
be found at the
+This manual describes jemalloc 
3\.5\.1\-0\-g7709a64c59daf0b1f938be49472fcc499e1bd136\. More information can 
be found 

svn commit: r262523 - head/sys/boot/userboot/userboot

2014-02-25 Thread Peter Grehan
Author: grehan
Date: Wed Feb 26 04:49:09 2014
New Revision: 262523
URL: http://svnweb.freebsd.org/changeset/base/262523

Log:
  Change the MK_ZFS != no case slightly to avoid a name
  clash with LIBZFS in bsd.lib.mk
  
  Submitted by: Max N Boyarov   zotrix at bsd dot by
  OK'd by:  sbruno

Modified:
  head/sys/boot/userboot/userboot/Makefile

Modified: head/sys/boot/userboot/userboot/Makefile
==
--- head/sys/boot/userboot/userboot/MakefileWed Feb 26 03:26:00 2014
(r262522)
+++ head/sys/boot/userboot/userboot/MakefileWed Feb 26 04:49:09 2014
(r262523)
@@ -53,9 +53,7 @@ LIBSTAND= ${.OBJDIR}/../libstand/libstan
 
 .if ${MK_ZFS} != no
 CFLAGS+=   -DUSERBOOT_ZFS_SUPPORT
-LIBZFS=${.OBJDIR}/../zfs/libzfsboot.a
-DPADD= ${LIBZFS}
-LDADD= ${LIBZFS}
+LIBZFSBOOT=${.OBJDIR}/../zfs/libzfsboot.a
 .endif
 
 # Always add MI sources 
@@ -63,7 +61,7 @@ LDADD=${LIBZFS}
 .include   ${.CURDIR}/../../common/Makefile.inc
 CFLAGS+=   -I${.CURDIR}/../../common
 CFLAGS+=   -I.
-DPADD+=${LIBFICL} ${LIBSTAND} 
-LDADD+=${LIBFICL} ${LIBSTAND}
+DPADD+=${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} 
+LDADD+=${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND}
 
 .include bsd.lib.mk
___
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