svn commit: r289743 - head/usr.sbin/makefs/tests

2015-10-22 Thread Garrett Cooper
Author: ngie
Date: Thu Oct 22 07:22:05 2015
New Revision: 289743
URL: https://svnweb.freebsd.org/changeset/base/289743

Log:
  Revise "create_test_inputs" to simplify the file structure as
  these testcases don't need to be nested as much as bin/ls/ls_tests.sh
  do when verifying ls -a, ls -A, etc. This allows the tests to make
  all paths relative to the top of the temporary directory instead of
  always tacking on $ATF_TMPDIR, thus complicating things unnecessarily
  
  Create non-empty files in create_test_inputs as well now, similar to
  create_test_inputs2 in bin/ls/ls_tests.sh
  
  Compare the input files to the output file contents using diff where
  possible:
  - Skip over the fifo comparison for now because it always fails
  - Skip over the symlink comparison on cd9660 because it always fails
today
  
  Sponsored by: EMC / Isilon Storage Division
  MFC after: 2 weeks
  X-MFC with: r289739

Modified:
  head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh
  head/usr.sbin/makefs/tests/makefs_ffs_tests.sh
  head/usr.sbin/makefs/tests/makefs_tests_common.sh

Modified: head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh
==
--- head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh   Thu Oct 22 07:01:01 
2015(r289742)
+++ head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh   Thu Oct 22 07:22:05 
2015(r289743)
@@ -30,7 +30,6 @@
 . "$(dirname "$0")/makefs_tests_common.sh"
 
 MAKEFS="makefs -t cd9660"
-TEST_IMAGE="test.iso"
 
 atf_test_case basic_cd9660 cleanup
 basic_cd9660_body()
@@ -43,12 +42,17 @@ basic_cd9660_body()
mdconfig -a -f $TEST_IMAGE
atf_check -e empty -o empty -s exit:0 \
mount_cd9660 /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR
-   atf_check -e empty -o not-empty -s exit:0 ls $TEST_MOUNT_DIR
+   # diffutils doesn't feature --no-dereference until v3.3, so
+   # $TEST_INPUTS_DIR/c will mismatch with $TEST_MOUNT_DIR/c (the
+   # former will look like a directory; the latter like a file).
+   #
+   # XXX: the latter behavior seems suspect; seems like it should be a
+   # symlink; need to verify this with mkisofs, etc
+   atf_check -e empty -o empty -s exit:0 \
+   diff --exclude c -Naur $TEST_INPUTS_DIR $TEST_MOUNT_DIR
 }
 basic_cd9660_cleanup()
 {
-   ls -a
-
test_md_device=$(cat $TEST_MD_DEVICE_FILE) || return
 
umount -f /dev/$test_md_device

Modified: head/usr.sbin/makefs/tests/makefs_ffs_tests.sh
==
--- head/usr.sbin/makefs/tests/makefs_ffs_tests.sh  Thu Oct 22 07:01:01 
2015(r289742)
+++ head/usr.sbin/makefs/tests/makefs_ffs_tests.sh  Thu Oct 22 07:22:05 
2015(r289743)
@@ -30,7 +30,6 @@
 . "$(dirname "$0")/makefs_tests_common.sh"
 
 MAKEFS="makefs -t ffs"
-TEST_IMAGE="test.img"
 
 atf_test_case basic_ffs cleanup
 basic_ffs_body()
@@ -45,12 +44,11 @@ basic_ffs_body()
tunefs -p /dev/$(cat $TEST_MD_DEVICE_FILE)
atf_check -e empty -o empty -s exit:0 \
mount /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR
-   atf_check -e empty -o not-empty -s exit:0 ls $TEST_MOUNT_DIR
+   atf_check -e empty -o empty -s exit:0 \
+   diff -Naur $TEST_INPUTS_DIR $TEST_MOUNT_DIR
 }
 basic_ffs_cleanup()
 {
-   ls -a
-
test_md_device=$(cat $TEST_MD_DEVICE_FILE) || return
 
umount -f /dev/$test_md_device

Modified: head/usr.sbin/makefs/tests/makefs_tests_common.sh
==
--- head/usr.sbin/makefs/tests/makefs_tests_common.sh   Thu Oct 22 07:01:01 
2015(r289742)
+++ head/usr.sbin/makefs/tests/makefs_tests_common.sh   Thu Oct 22 07:22:05 
2015(r289743)
@@ -27,30 +27,23 @@
 # $FreeBSD$
 #
 
+KB=1024
+TEST_IMAGE="test.img"
+TEST_INPUTS_DIR="inputs"
 TEST_MD_DEVICE_FILE="md.output"
 TEST_MOUNT_DIR="mnt"
 
-create_test_dir()
+create_test_dirs()
 {
-   [ -z "$ATF_TMPDIR" ] || return 0
-
-   export ATF_TMPDIR=$(pwd)
-
-   TEST_MD_DEVICE_FILE="${ATF_TMPDIR}/${TEST_MD_DEVICE_FILE}"
-   TEST_MOUNT_DIR="${ATF_TMPDIR}/${TEST_MOUNT_DIR}"
-
-   # XXX: need to nest this because of how kyua creates $TMPDIR; otherwise
-   # it will run into EPERM issues later
-   TEST_INPUTS_DIR="${ATF_TMPDIR}/test/inputs"
-
atf_check -e empty -s exit:0 mkdir -m 0777 -p $TEST_MOUNT_DIR
atf_check -e empty -s exit:0 mkdir -m 0777 -p $TEST_INPUTS_DIR
-   cd $TEST_INPUTS_DIR
 }
 
 create_test_inputs()
 {
-   create_test_dir
+   create_test_dirs
+
+   cd $TEST_INPUTS_DIR
 
atf_check -e empty -s exit:0 mkdir -m 0755 -p a/b/1
atf_check -e empty -s exit:0 ln -s a/b c
@@ -58,7 +51,9 @@ create_test_inputs()
atf_check -e empty -s exit:0 ln d e
atf_check -e empty -s exit:0 touch .f
atf_check -e empty -s exit:0 mkdir .g
-   atf_check 

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

2015-10-22 Thread Adrian Chadd
Author: adrian
Date: Thu Oct 22 08:08:06 2015
New Revision: 289745
URL: https://svnweb.freebsd.org/changeset/base/289745

Log:
  Add support for the TP-Link TL-WR740N v4.
  
  This is an AR9331 part based on the AP121 reference design but with
  32MB RAM.  Yes, it has 4MB flash and it has no USB, so clever hacks
  are required to get it up and working.
  
  But boot/work it does.

Added:
  head/sys/mips/conf/TL-WR740Nv4   (contents, props changed)
  head/sys/mips/conf/TL-WR740Nv4.hints   (contents, props changed)

Added: head/sys/mips/conf/TL-WR740Nv4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/TL-WR740Nv4  Thu Oct 22 08:08:06 2015
(r289745)
@@ -0,0 +1,53 @@
+#
+# TP-Link WR740N v4
+#
+# * AR9330 SoC
+# * 32MB RAM
+# * 4MB flash
+# * Integrated 1x1 2GHz wifi and 10/100 bridge
+#
+# $FreeBSD$
+#
+
+# Include the default AR933x parameters
+include "AR933X_BASE"
+
+ident   CARAMBOLA2
+
+# Override hints with board values
+hints   "CARAMBOLA2.hints"
+
+# Board memory - 32MB
+options AR71XX_REALMEM=(32*1024*1024)
+
+# i2c GPIO bus
+#devicegpioiic
+#deviceiicbb
+#deviceiicbus
+#deviceiic
+
+# Options required for miiproxy and mdiobus
+optionsARGE_MDIO   # Export an MDIO bus separate from arge
+device miiproxy# MDIO bus <-> MII PHY rendezvous
+
+device etherswitch
+device arswitch
+
+# read MSDOS formatted disks - USB
+#options   MSDOSFS
+
+# Enable the uboot environment stuff rather then the
+# redboot stuff.
+optionsAR71XX_ENV_UBOOT
+
+# uzip - to boot natively from flash
+device geom_uncompress
+optionsGEOM_UNCOMPRESS
+
+# Used for the static uboot partition map
+device  geom_map
+
+# Boot off of the rootfs, as defined in the geom_map setup.
+# options  ROOTDEVNAME=\"ufs:map/rootfs.uncompress\"
+# Note: we don't fit in 4MB flash, so the rootfs must be on USB for now
+optionsROOTDEVNAME=\"ufs:da0\"

Added: head/sys/mips/conf/TL-WR740Nv4.hints
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/TL-WR740Nv4.hintsThu Oct 22 08:08:06 2015
(r289745)
@@ -0,0 +1,87 @@
+#
+# This file adds to the values in AR933X_BASE.hints
+#
+# $FreeBSD$
+
+# mdiobus on arge1
+hint.argemdio.0.at="nexus0"
+hint.argemdio.0.maddr=0x1a00
+hint.argemdio.0.msize=0x1000
+hint.argemdio.0.order=0
+
+# Embedded Atheros Switch
+hint.arswitch.0.at="mdio0"
+
+# XXX this should really say it's an AR933x switch, as there
+# are some vlan specific differences here!
+hint.arswitch.0.is_7240=1
+hint.arswitch.0.numphys=4
+hint.arswitch.0.phy4cpu=1  # phy 4 is a "CPU" separate PHY
+hint.arswitch.0.is_rgmii=0
+hint.arswitch.0.is_gmii=1  # arge1 <-> switch PHY is GMII
+
+# arge0 - MII, autoneg, phy(4)
+hint.arge.0.phymask=0x10   # PHY4
+hint.arge.0.mdio=mdioproxy1# .. off of the switch mdiobus
+hint.arge.0.eeprommac=0x1fff
+
+# arge1 - GMII, 1000/full
+hint.arge.1.phymask=0x0# No directly mapped PHYs
+hint.arge.1.media=1000
+hint.arge.1.fduplex=1
+hint.arge.1.eeprommac=0x1fff0006
+
+# Where the ART is - last 64k in the flash
+# 0x9fff1000 ?
+hint.ath.0.eepromaddr=0x1fff
+hint.ath.0.eepromsize=16384
+
+# The TL-WR740N v4 is a default AP121 - it comes with 4MB flash.
+#
+# The boot parameters:
+# bootargs=console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init
+#mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),2752k(rootfs),
+#896k(uImage),64k(NVRAM),64k(ART)
+# bootcmd=bootm 0x9f02
+#
+# .. so uboot is 128K, there's no ubootenv, and the runtime image starts
+# at 0x9f02.
+
+hint.map.0.at="flash/spi0"
+hint.map.0.start=0x
+hint.map.0.end=0x2
+hint.map.0.name="uboot"
+hint.map.0.readonly=1
+
+hint.map.1.at="flash/spi0"
+hint.map.1.start=0x0002
+hint.map.1.end=0x003e
+hint.map.1.name="kernel"
+hint.map.1.readonly=0
+
+hint.map.2.at="flash/spi0"
+hint.map.2.start=0x003e
+hint.map.2.end=0x003f
+hint.map.2.name="cfg"
+hint.map.2.readonly=0
+
+# This is radio calibration section.  It is (or should be!) unique
+# for each board, to take into account thermal and electrical differences
+# as well as the regulatory compliance data.
+#
+hint.map.3.at="flash/spi0"
+hint.map.3.start=0x003f
+hint.map.3.end=0x0x40
+hint.map.3.name="art"
+hint.map.3.readonly=1
+
+# GPIO specific configuration block
+
+# Don't flip on anything that isn't already enabled.
+# This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're
+# not used here.
+hint.gpio.0.function_set=0x
+hint.gpio.0.function_clear=0x
+
+# These are the GPIO LEDs and buttons which can be software controlled.
+# 

svn commit: r289744 - head/sys/mips/atheros

2015-10-22 Thread Adrian Chadd
Author: adrian
Date: Thu Oct 22 08:02:27 2015
New Revision: 289744
URL: https://svnweb.freebsd.org/changeset/base/289744

Log:
  arge: use 1-byte TX and RX alignment for AR9330/AR9331.
  
  This part seems to work bug-free with single byte TX/RX buffer alignment.
  
  This drops the CPU requirement to bridge 100mbit iperf from 100% CPU
  to ~ 50% CPU.
  
  Tested:
  
  * AP121 (AR9330) SoC, highly magic netbooted kernel + USB rootfs
due to 4mb flash, 16mb RAM; doing bridging between arge0 and arge1.
  
  Notes:
  
  * Yes, I likely can also turn this on for the AR934x SoC family now.
  
But since hardware design apparently follows similar branching
strategies to software design, I'll go and make sure all the AR934x's
that made it out into shipping products work before I flip it on.

Modified:
  head/sys/mips/atheros/if_arge.c

Modified: head/sys/mips/atheros/if_arge.c
==
--- head/sys/mips/atheros/if_arge.c Thu Oct 22 07:22:05 2015
(r289743)
+++ head/sys/mips/atheros/if_arge.c Thu Oct 22 08:02:27 2015
(r289744)
@@ -653,6 +653,8 @@ arge_attach(device_t dev)
 * Hardware workarounds.
 */
switch (ar71xx_soc) {
+   case AR71XX_SOC_AR9330:
+   case AR71XX_SOC_AR9331:
case AR71XX_SOC_QCA9556:
case AR71XX_SOC_QCA9558:
/* Arbitrary alignment */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289746 - head/usr.sbin/bhyve

2015-10-22 Thread Garrett Cooper
Author: ngie
Date: Thu Oct 22 08:37:11 2015
New Revision: 289746
URL: https://svnweb.freebsd.org/changeset/base/289746

Log:
  Exit with a user-friendly message instead of tripping an assert
  if vm_activate_cpu(..) fails when called from fbsdrun_addcpu(..)
  
  MFC after: 1 week
  PR: 203884
  Reviewed by: grehan
  Submitted by: William Orr 

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

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Thu Oct 22 08:08:06 2015
(r289745)
+++ head/usr.sbin/bhyve/bhyverun.c  Thu Oct 22 08:37:11 2015
(r289746)
@@ -261,7 +261,8 @@ fbsdrun_addcpu(struct vmctx *ctx, int fr
 * with vm_suspend().
 */
error = vm_activate_cpu(ctx, newcpu);
-   assert(error == 0);
+   if (error != 0)
+   err(EX_OSERR, "could not activate CPU %d", newcpu);
 
CPU_SET_ATOMIC(newcpu, );
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289740 - stable/10/usr.bin/getconf

2015-10-22 Thread Baptiste Daroussin
Author: bapt
Date: Thu Oct 22 06:32:33 2015
New Revision: 289740
URL: https://svnweb.freebsd.org/changeset/base/289740

Log:
  getconf(1): Fix typo. _POSIX_V6_LP64_OFFBIG -> _POSIX_V6_LPBIG_OFFBIG.
  
  Submitted by: Sascha Wildner 
  Obtained from:DragonflyBSD

Modified:
  stable/10/usr.bin/getconf/sysconf.gperf
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/getconf/sysconf.gperf
==
--- stable/10/usr.bin/getconf/sysconf.gperf Thu Oct 22 05:32:45 2015
(r289739)
+++ stable/10/usr.bin/getconf/sysconf.gperf Thu Oct 22 06:32:33 2015
(r289740)
@@ -121,7 +121,7 @@ _POSIX_VERSION, _SC_VERSION
 _POSIX_V6_ILP32_OFF32, _SC_V6_ILP32_OFF32
 _POSIX_V6_ILP32_OFFBIG, _SC_V6_ILP32_OFFBIG
 _POSIX_V6_LP64_OFF64, _SC_V6_LP64_OFF64
-_POSIX_V6_LP64_OFFBIG, _SC_V6_LP64_OFFBIG
+_POSIX_V6_LPBIG_OFFBIG, _SC_V6_LPBIG_OFFBIG
 _XOPEN_CRYPT, _SC_XOPEN_CRYPT
 _XOPEN_ENH_I18N, _SC_XOPEN_ENH_I18N
 _XOPEN_LEGACY, _SC_XOPEN_LEGACY
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289764 - in head: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/html contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contrib/ntp/kernel/sys contrib...

2015-10-22 Thread Gleb Smirnoff
Author: glebius
Date: Thu Oct 22 19:42:57 2015
New Revision: 289764
URL: https://svnweb.freebsd.org/changeset/base/289764

Log:
  MFV ntp-4.2.8p4 (r289715)
  
  Security:   VuXML: c4a18a12-77fc-11e5-a687-206a8a720317
  Security: CVE-2015-7871
  Security: CVE-2015-7855
  Security: CVE-2015-7854
  Security: CVE-2015-7853
  Security: CVE-2015-7852
  Security: CVE-2015-7851
  Security: CVE-2015-7850
  Security: CVE-2015-7849
  Security: CVE-2015-7848
  Security: CVE-2015-7701
  Security: CVE-2015-7703
  Security: CVE-2015-7704, CVE-2015-7705
  Security: CVE-2015-7691, CVE-2015-7692, CVE-2015-7702
  Security: 
http://support.ntp.org/bin/view/Main/SecurityNotice#October_2015_NTP_Security_Vulner
  Sponsored by: Nginx, Inc.

Added:
  head/contrib/ntp/include/rc_cmdlength.h
 - copied unchanged from r289715, vendor/ntp/dist/include/rc_cmdlength.h
  head/contrib/ntp/sntp/m4/ntp_problemtests.m4
 - copied unchanged from r289715, 
vendor/ntp/dist/sntp/m4/ntp_problemtests.m4
  head/contrib/ntp/sntp/tests/fileHandlingTest.c
 - copied unchanged from r289715, 
vendor/ntp/dist/sntp/tests/fileHandlingTest.c
  head/contrib/ntp/sntp/tests/run-t-log.c
 - copied unchanged from r289715, vendor/ntp/dist/sntp/tests/run-t-log.c
  head/contrib/ntp/sntp/tests/sntptest.c
 - copied unchanged from r289715, vendor/ntp/dist/sntp/tests/sntptest.c
  head/contrib/ntp/sntp/tests/t-log.c
 - copied unchanged from r289715, vendor/ntp/dist/sntp/tests/t-log.c
  head/contrib/ntp/sntp/unity/auto/parseOutput.rb
 - copied unchanged from r289715, 
vendor/ntp/dist/sntp/unity/auto/parseOutput.rb
  head/contrib/ntp/sntp/unity/auto/type_sanitizer.rb
 - copied unchanged from r289715, 
vendor/ntp/dist/sntp/unity/auto/type_sanitizer.rb
  head/contrib/ntp/sntp/unity/auto/unity_test_summary.py
 - copied unchanged from r289715, 
vendor/ntp/dist/sntp/unity/auto/unity_test_summary.py
  head/contrib/ntp/sntp/unity/unity_config.h
 - copied unchanged from r289715, vendor/ntp/dist/sntp/unity/unity_config.h
  head/contrib/ntp/tests/libntp/lfptest.c
 - copied unchanged from r289715, vendor/ntp/dist/tests/libntp/lfptest.c
  head/contrib/ntp/tests/libntp/sockaddrtest.c
 - copied unchanged from r289715, 
vendor/ntp/dist/tests/libntp/sockaddrtest.c
  head/contrib/ntp/tests/ntpd/leapsec.c
 - copied unchanged from r289715, vendor/ntp/dist/tests/ntpd/leapsec.c
  head/contrib/ntp/tests/ntpd/ntp_prio_q.c
 - copied unchanged from r289715, vendor/ntp/dist/tests/ntpd/ntp_prio_q.c
  head/contrib/ntp/tests/ntpd/ntp_restrict.c
 - copied unchanged from r289715, vendor/ntp/dist/tests/ntpd/ntp_restrict.c
  head/contrib/ntp/tests/ntpd/rc_cmdlength.c
 - copied unchanged from r289715, vendor/ntp/dist/tests/ntpd/rc_cmdlength.c
  head/contrib/ntp/tests/ntpd/run-leapsec.c
 - copied unchanged from r289715, vendor/ntp/dist/tests/ntpd/run-leapsec.c
  head/contrib/ntp/tests/ntpd/run-ntp_prio_q.c
 - copied unchanged from r289715, 
vendor/ntp/dist/tests/ntpd/run-ntp_prio_q.c
  head/contrib/ntp/tests/ntpd/run-ntp_restrict.c
 - copied unchanged from r289715, 
vendor/ntp/dist/tests/ntpd/run-ntp_restrict.c
  head/contrib/ntp/tests/ntpd/run-rc_cmdlength.c
 - copied unchanged from r289715, 
vendor/ntp/dist/tests/ntpd/run-rc_cmdlength.c
  head/contrib/ntp/tests/ntpd/run-t-ntp_scanner.c
 - copied unchanged from r289715, 
vendor/ntp/dist/tests/ntpd/run-t-ntp_scanner.c
  head/contrib/ntp/tests/ntpd/run-t-ntp_signd.c
 - copied unchanged from r289715, 
vendor/ntp/dist/tests/ntpd/run-t-ntp_signd.c
  head/contrib/ntp/tests/ntpd/t-ntp_scanner.c
 - copied unchanged from r289715, vendor/ntp/dist/tests/ntpd/t-ntp_scanner.c
  head/contrib/ntp/tests/ntpd/t-ntp_signd.c
 - copied unchanged from r289715, vendor/ntp/dist/tests/ntpd/t-ntp_signd.c
  head/contrib/ntp/tests/ntpq/
 - copied from r289715, vendor/ntp/dist/tests/ntpq/
Deleted:
  head/contrib/ntp/FREEBSD-Xlist
  head/contrib/ntp/FREEBSD-upgrade
  head/contrib/ntp/sntp/libevent/sample/
  head/contrib/ntp/sntp/tests/fileHandlingTest.h
  head/contrib/ntp/sntp/tests/g_fileHandlingTest.h
  head/contrib/ntp/sntp/tests/g_networking.cpp
  head/contrib/ntp/sntp/tests/g_packetHandling.cpp
  head/contrib/ntp/sntp/tests/g_packetProcessing.cpp
  head/contrib/ntp/sntp/tests/g_sntptest.h
  head/contrib/ntp/sntp/tests_main.cpp
  head/contrib/ntp/sntp/tests_main.h
  head/contrib/ntp/tests/libntp/g_a_md5encrypt.cpp
  head/contrib/ntp/tests/libntp/g_atoint.cpp
  head/contrib/ntp/tests/libntp/g_atouint.cpp
  head/contrib/ntp/tests/libntp/g_authkeys.cpp
  head/contrib/ntp/tests/libntp/g_buftvtots.cpp
  head/contrib/ntp/tests/libntp/g_calendar.cpp
  head/contrib/ntp/tests/libntp/g_caljulian.cpp
  head/contrib/ntp/tests/libntp/g_caltontp.cpp
  head/contrib/ntp/tests/libntp/g_calyearstart.cpp
  head/contrib/ntp/tests/libntp/g_clocktime.cpp
  head/contrib/ntp/tests/libntp/g_decodenetnum.cpp
  

svn commit: r289763 - head/tools/bsdbox

2015-10-22 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct 22 18:05:11 2015
New Revision: 289763
URL: https://svnweb.freebsd.org/changeset/base/289763

Log:
  Fix warning about redefined *_crunchdir_hostname target after r289734.
  
  'hostname' was in the build list twice.
  
  X-MFC-With:   r289734
  MFC after:2 weeks
  Reported by:  sbruno
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tools/bsdbox/Makefile.base

Modified: head/tools/bsdbox/Makefile.base
==
--- head/tools/bsdbox/Makefile.base Thu Oct 22 17:08:12 2015
(r289762)
+++ head/tools/bsdbox/Makefile.base Thu Oct 22 18:05:11 2015
(r289763)
@@ -6,7 +6,7 @@
 #
 CRUNCH_PROGS_sbin+=dmesg sysctl init reboot
 CRUNCH_PROGS_bin+= ls cat dd df cp hostname kill mkdir sleep ps
-CRUNCH_PROGS_bin+= ln rm hostname kenv mv expr
+CRUNCH_PROGS_bin+= ln rm kenv mv expr
 CRUNCH_PROGS_usr.bin+= true false hexdump tail nc w head uname tset
 CRUNCH_PROGS_usr.sbin+=gpioctl
 CRUNCH_ALIAS_w=uptime
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289751 - head/usr.bin/sort

2015-10-22 Thread Gabor Kovesdan
Author: gabor
Date: Thu Oct 22 10:57:15 2015
New Revision: 289751
URL: https://svnweb.freebsd.org/changeset/base/289751

Log:
  -C and -c allow at most one input file. Ensure this is the case when the
  input files are specified through --files0-from.
  
  Submitted by: tim@OpenBSD
  Obtained from:OpenBSD
  MFC after:1 week

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

Modified: head/usr.bin/sort/sort.c
==
--- head/usr.bin/sort/sort.cThu Oct 22 09:55:40 2015(r289750)
+++ head/usr.bin/sort/sort.cThu Oct 22 10:57:15 2015(r289751)
@@ -1168,6 +1168,11 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
 
+   if (argv_from_file0) {
+   argc = argc_from_file0;
+   argv = argv_from_file0;
+   }
+
 #ifndef WITHOUT_NLS
catalog = catopen("sort", NL_CAT_LOCALE);
 #endif
@@ -1205,11 +1210,6 @@ main(int argc, char **argv)
ks->sm.func = get_sort_func(&(ks->sm));
}
 
-   if (argv_from_file0) {
-   argc = argc_from_file0;
-   argv = argv_from_file0;
-   }
-
if (debug_sort) {
printf("Memory to be used for sorting: 
%llu\n",available_free_memory);
 #if defined(SORT_THREADS)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289752 - in head: share/man/man4 sys/arm64/cloudabi64 sys/conf sys/modules

2015-10-22 Thread Ed Schouten
Author: ed
Date: Thu Oct 22 11:09:25 2015
New Revision: 289752
URL: https://svnweb.freebsd.org/changeset/base/289752

Log:
  Add support for CloudABI on ARM64.
  
  It turns out that it is pretty easy to make CloudABI work on ARM64. We
  essentially only need to copy over the sysvec from AMD64 and ensure that
  we use ARM64 specific registers.
  
  As there is an overlap between function argument and return registers,
  we do need to extend cloudabi64_schedtail() to only set its values if
  we're actually forking. Not when we're creating a new thread.
  
  Reviewed by:  kib
  Differential Revision:https://reviews.freebsd.org/D3917

Added:
  head/sys/arm64/cloudabi64/
  head/sys/arm64/cloudabi64/cloudabi64_sysvec.c
 - copied, changed from r289747, 
head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
Modified:
  head/share/man/man4/cloudabi.4
  head/sys/conf/files.arm64
  head/sys/modules/Makefile

Modified: head/share/man/man4/cloudabi.4
==
--- head/share/man/man4/cloudabi.4  Thu Oct 22 10:57:15 2015
(r289751)
+++ head/share/man/man4/cloudabi.4  Thu Oct 22 11:09:25 2015
(r289752)
@@ -22,7 +22,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd July 31, 2015
+.Dd October 22, 2015
 .Dt CLOUDABI 4
 .Os
 .Sh NAME
@@ -73,7 +73,7 @@ module can be loaded on any architecture
 .Fx ,
 the
 .Nm cloudabi64
-module is only available for amd64.
+module is only available for amd64 and arm64.
 .Pp
 A full cross compilation toolchain for CloudABI is available in the
 .Pa devel/cloudabi-toolchain
@@ -95,6 +95,9 @@ restricted set of resources.
 .Pp
 cloudlibc on GitHub:
 .Pa https://github.com/NuxiNL/cloudlibc .
+.Pp
+The CloudABI Ports Collection on GitHub:
+.Pa https://github.com/NuxiNL/cloudabi-ports .
 .Sh HISTORY
 CloudABI support first appeared in
 .Fx 11.0 .

Copied and modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c (from 
r289747, head/sys/amd64/cloudabi64/cloudabi64_sysvec.c)
==
--- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c   Thu Oct 22 09:07:53 
2015(r289747, copy source)
+++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c   Thu Oct 22 11:09:25 
2015(r289752)
@@ -51,24 +51,21 @@ static int
 cloudabi64_fetch_syscall_args(struct thread *td, struct syscall_args *sa)
 {
struct trapframe *frame = td->td_frame;
+   int i;
 
/* Obtain system call number. */
-   sa->code = frame->tf_rax;
+   sa->code = frame->tf_x[8];
if (sa->code >= CLOUDABI64_SYS_MAXSYSCALL)
return (ENOSYS);
sa->callp = _sysent[sa->code];
 
/* Fetch system call arguments. */
-   sa->args[0] = frame->tf_rdi;
-   sa->args[1] = frame->tf_rsi;
-   sa->args[2] = frame->tf_rdx;
-   sa->args[3] = frame->tf_rcx; /* Actually %r10. */
-   sa->args[4] = frame->tf_r8;
-   sa->args[5] = frame->tf_r9;
+   for (i = 0; i < MAXARGS; i++)
+   sa->args[i] = frame->tf_x[i];
 
/* Default system call return values. */
td->td_retval[0] = 0;
-   td->td_retval[1] = frame->tf_rdx;
+   td->td_retval[1] = frame->tf_x[1];
return (0);
 }
 
@@ -80,22 +77,20 @@ cloudabi64_set_syscall_retval(struct thr
switch (error) {
case 0:
/* System call succeeded. */
-   frame->tf_rax = td->td_retval[0];
-   frame->tf_rdx = td->td_retval[1];
-   frame->tf_rflags &= ~PSL_C;
+   frame->tf_x[0] = td->td_retval[0];
+   frame->tf_x[1] = td->td_retval[1];
+   frame->tf_spsr &= ~PSR_C;
break;
case ERESTART:
/* Restart system call. */
-   frame->tf_rip -= frame->tf_err;
-   frame->tf_r10 = frame->tf_rcx;
-   set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
+   frame->tf_elr -= 4;
break;
case EJUSTRETURN:
break;
default:
/* System call returned an error. */
-   frame->tf_rax = cloudabi_convert_errno(error);
-   frame->tf_rflags |= PSL_C;
+   frame->tf_x[0] = cloudabi_convert_errno(error);
+   frame->tf_spsr |= PSR_C;
break;
}
 }
@@ -105,9 +100,15 @@ cloudabi64_schedtail(struct thread *td)
 {
struct trapframe *frame = td->td_frame;
 
-   /* Initial register values for processes returning from fork. */
-   frame->tf_rax = CLOUDABI_PROCESS_CHILD;
-   frame->tf_rdx = td->td_tid;
+   /*
+* Initial register values for processes returning from fork.
+* Make sure that we only set these values when forking, not
+* when creating a new thread.
+*/
+   if ((td->td_pflags & TDP_FORKING) != 0) {
+   frame->tf_x[0] = CLOUDABI_PROCESS_CHILD;
+   frame->tf_x[1] = td->td_tid;
+ 

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

2015-10-22 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Oct 22 12:15:40 2015
New Revision: 289753
URL: https://svnweb.freebsd.org/changeset/base/289753

Log:
  Initialize radiotap header fields before calling ieee80211_radiotap_rx()
  
  Reviewed by:  kevlo
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D3951

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

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Thu Oct 22 11:09:25 2015
(r289752)
+++ head/sys/dev/usb/wlan/if_run.c  Thu Oct 22 12:15:40 2015
(r289753)
@@ -2847,13 +2847,6 @@ run_rx_frame(struct run_softc *sc, struc
 
m->m_pkthdr.len = m->m_len = len;
 
-   if (ni != NULL) {
-   (void)ieee80211_input(ni, m, rssi, nf);
-   ieee80211_free_node(ni);
-   } else {
-   (void)ieee80211_input_all(ic, m, rssi, nf);
-   }
-
if (__predict_false(ieee80211_radiotap_active(ic))) {
struct run_rx_radiotap_header *tap = >sc_rxtap;
uint16_t phy;
@@ -2892,6 +2885,13 @@ run_rx_frame(struct run_softc *sc, struc
break;
}
}
+
+   if (ni != NULL) {
+   (void)ieee80211_input(ni, m, rssi, nf);
+   ieee80211_free_node(ni);
+   } else {
+   (void)ieee80211_input_all(ic, m, rssi, nf);
+   }
 }
 
 static void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289765 - in head/sys: conf libkern sys

2015-10-22 Thread Conrad E. Meyer
Author: cem
Date: Thu Oct 22 20:28:37 2015
New Revision: 289765
URL: https://svnweb.freebsd.org/changeset/base/289765

Log:
  Add libkern ffsll() for parity with flsll()
  
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D3962

Added:
  head/sys/libkern/ffsll.c   (contents, props changed)
Modified:
  head/sys/conf/files.arm
  head/sys/conf/files.arm64
  head/sys/conf/files.i386
  head/sys/conf/files.mips
  head/sys/conf/files.pc98
  head/sys/conf/files.powerpc
  head/sys/conf/files.sparc64
  head/sys/sys/libkern.h

Modified: head/sys/conf/files.arm
==
--- head/sys/conf/files.arm Thu Oct 22 19:42:57 2015(r289764)
+++ head/sys/conf/files.arm Thu Oct 22 20:28:37 2015(r289765)
@@ -120,6 +120,7 @@ libkern/ashldi3.c   standard
 libkern/ashrdi3.c  standard
 libkern/divdi3.c   standard
 libkern/ffsl.c standard
+libkern/ffsll.cstandard
 libkern/fls.c  standard
 libkern/flsl.c standard
 libkern/flsll.cstandard

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Thu Oct 22 19:42:57 2015(r289764)
+++ head/sys/conf/files.arm64   Thu Oct 22 20:28:37 2015(r289765)
@@ -82,6 +82,7 @@ kern/subr_dummy_vdso_tc.c standard
 libkern/bcmp.c standard
 libkern/ffs.c  standard
 libkern/ffsl.c standard
+libkern/ffsll.cstandard
 libkern/fls.c  standard
 libkern/flsl.c standard
 libkern/flsll.cstandard

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Thu Oct 22 19:42:57 2015(r289764)
+++ head/sys/conf/files.i386Thu Oct 22 20:28:37 2015(r289765)
@@ -530,6 +530,7 @@ kern/imgact_aout.c  optional compat_aout
 kern/imgact_gzip.c optional gzip
 kern/subr_sfbuf.c  standard
 libkern/divdi3.c   standard
+libkern/ffsll.cstandard
 libkern/flsll.cstandard
 libkern/memmove.c  standard
 libkern/memset.c   standard

Modified: head/sys/conf/files.mips
==
--- head/sys/conf/files.mipsThu Oct 22 19:42:57 2015(r289764)
+++ head/sys/conf/files.mipsThu Oct 22 20:28:37 2015(r289765)
@@ -56,6 +56,7 @@ kern/subr_sfbuf.c optionalmips | 
mips
 
 # gcc/clang runtime
 libkern/ffsl.c standard
+libkern/ffsll.cstandard
 libkern/fls.c  standard
 libkern/flsl.c standard
 libkern/flsll.cstandard

Modified: head/sys/conf/files.pc98
==
--- head/sys/conf/files.pc98Thu Oct 22 19:42:57 2015(r289764)
+++ head/sys/conf/files.pc98Thu Oct 22 20:28:37 2015(r289765)
@@ -222,6 +222,7 @@ kern/imgact_aout.c  optional compat_aout
 kern/imgact_gzip.c optional gzip
 kern/subr_sfbuf.c  standard
 libkern/divdi3.c   standard
+libkern/ffsll.cstandard
 libkern/flsll.cstandard
 libkern/memmove.c  standard
 libkern/memset.c   standard

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Thu Oct 22 19:42:57 2015(r289764)
+++ head/sys/conf/files.powerpc Thu Oct 22 20:28:37 2015(r289765)
@@ -87,6 +87,7 @@ libkern/cmpdi2.c  optionalpowerpc
 libkern/divdi3.c   optionalpowerpc
 libkern/ffs.c  standard
 libkern/ffsl.c standard
+libkern/ffsll.cstandard
 libkern/fls.c  standard
 libkern/flsl.c standard
 libkern/flsll.cstandard

Modified: head/sys/conf/files.sparc64
==
--- head/sys/conf/files.sparc64 Thu Oct 22 19:42:57 2015(r289764)
+++ head/sys/conf/files.sparc64 Thu Oct 22 20:28:37 2015(r289765)
@@ -67,6 +67,7 @@ kern/syscalls.c   optionalktr
 kern/subr_sfbuf.c  standard
 libkern/ffs.c  standard
 libkern/ffsl.c standard
+libkern/ffsll.cstandard
 libkern/fls.c  standard
 libkern/flsl.c standard
 

Re: svn commit: r289767 - head/usr.sbin/mptable

2015-10-22 Thread NGie Cooper
On Thu, Oct 22, 2015 at 2:13 PM, Baptiste Daroussin  wrote:
> Author: bapt
> Date: Thu Oct 22 21:13:35 2015
> New Revision: 289767
> URL: https://svnweb.freebsd.org/changeset/base/289767
>
> Log:
>   Stop suggesting -grope argument when -grope argument was actually given

-grope is a weird option name... and it sounds like something I really
wouldn't want to describe to my boss.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r289772 - head/share/mk

2015-10-22 Thread Bryan Drewery
On 10/22/15 3:29 PM, Bryan Drewery wrote:
>  .endif
>  .endfor
> -.endif
> +.endif   # ${MK_MANCOMPRESS} == "no"
>  .endif
>  
>  .if !defined(NO_MLINKS) && defined(MLINKS) && !empty(MLINKS)

This shows oddly with local 'svn diff' using svn 1.9.2:

# svn diff -c r289772
<...>
 .endif
 .endfor
+.endif # ${MK_MANCOMPRESS} == "no"
 .endif
-.endif

 .if !defined(NO_MLINKS) && defined(MLINKS) && !empty(MLINKS)
 .for _oname _osect _dname _dsect in ${MLINKS:C/\.([^.]*)$/.\1 \1/}

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


svn commit: r289767 - head/usr.sbin/mptable

2015-10-22 Thread Baptiste Daroussin
Author: bapt
Date: Thu Oct 22 21:13:35 2015
New Revision: 289767
URL: https://svnweb.freebsd.org/changeset/base/289767

Log:
  Stop suggesting -grope argument when -grope argument was actually given

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

Modified: head/usr.sbin/mptable/mptable.c
==
--- head/usr.sbin/mptable/mptable.c Thu Oct 22 21:04:47 2015
(r289766)
+++ head/usr.sbin/mptable/mptable.c Thu Oct 22 21:13:35 2015
(r289767)
@@ -217,7 +217,8 @@ main( int argc, char *argv[] )
 apic_probe( ,  );
 if ( where <= 0 ) {
 fprintf( stderr, "\n MP FPS NOT found,\n" );
-fprintf( stderr, " suggest trying -grope option!!!\n\n" );
+if (!grope)
+fprintf( stderr, " suggest trying -grope option!!!\n\n" );
 return 1;
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r289772 - head/share/mk

2015-10-22 Thread Bryan Drewery
On 10/22/15 3:29 PM, Bryan Drewery wrote:
> Author: bdrewery
> Date: Thu Oct 22 22:29:25 2015
> New Revision: 289772
> URL: https://svnweb.freebsd.org/changeset/base/289772
> 
> Log:
>   Fix installation of manpages with WITHOUT_COMPRESS broken since r284685.

WITHOUT_MANCOMPRESS of course.

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


svn commit: r289768 - head/sys/amd64/linux32

2015-10-22 Thread John Baldwin
Author: jhb
Date: Thu Oct 22 21:23:58 2015
New Revision: 289768
URL: https://svnweb.freebsd.org/changeset/base/289768

Log:
  Merge r289055 to amd64/linux32:
  
  linux: fix handling of out-of-bounds syscall attempts
  
  Due to an off by one the code would read an entry past the table, as
  opposed to the last entry which contains the nosys handler.

Modified:
  head/sys/amd64/linux32/linux32_sysvec.c

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==
--- head/sys/amd64/linux32/linux32_sysvec.c Thu Oct 22 21:13:35 2015
(r289767)
+++ head/sys/amd64/linux32/linux32_sysvec.c Thu Oct 22 21:23:58 2015
(r289768)
@@ -741,7 +741,7 @@ linux32_fetch_syscall_args(struct thread
 
if (sa->code >= p->p_sysent->sv_size)
/* nosys */
-   sa->callp = >p_sysent->sv_table[LINUX_SYS_MAXSYSCALL];
+   sa->callp = >p_sysent->sv_table[p->p_sysent->sv_size - 1];
else
sa->callp = >p_sysent->sv_table[sa->code];
sa->narg = sa->callp->sy_narg;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289766 - head/sys/libkern

2015-10-22 Thread Conrad E. Meyer
Author: cem
Date: Thu Oct 22 21:04:47 2015
New Revision: 289766
URL: https://svnweb.freebsd.org/changeset/base/289766

Log:
  libkern: ffs, fls: s/4/3/ the 3rd BSD clause
  
  Approved by:  emaste
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/libkern/ffs.c
  head/sys/libkern/ffsl.c
  head/sys/libkern/ffsll.c
  head/sys/libkern/fls.c
  head/sys/libkern/flsl.c
  head/sys/libkern/flsll.c

Modified: head/sys/libkern/ffs.c
==
--- head/sys/libkern/ffs.c  Thu Oct 22 20:28:37 2015(r289765)
+++ head/sys/libkern/ffs.c  Thu Oct 22 21:04:47 2015(r289766)
@@ -10,7 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: head/sys/libkern/ffsl.c
==
--- head/sys/libkern/ffsl.c Thu Oct 22 20:28:37 2015(r289765)
+++ head/sys/libkern/ffsl.c Thu Oct 22 21:04:47 2015(r289766)
@@ -10,7 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: head/sys/libkern/ffsll.c
==
--- head/sys/libkern/ffsll.cThu Oct 22 20:28:37 2015(r289765)
+++ head/sys/libkern/ffsll.cThu Oct 22 21:04:47 2015(r289766)
@@ -10,7 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: head/sys/libkern/fls.c
==
--- head/sys/libkern/fls.c  Thu Oct 22 20:28:37 2015(r289765)
+++ head/sys/libkern/fls.c  Thu Oct 22 21:04:47 2015(r289766)
@@ -10,7 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: head/sys/libkern/flsl.c
==
--- head/sys/libkern/flsl.c Thu Oct 22 20:28:37 2015(r289765)
+++ head/sys/libkern/flsl.c Thu Oct 22 21:04:47 2015(r289766)
@@ -10,7 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: head/sys/libkern/flsll.c
==
--- head/sys/libkern/flsll.cThu Oct 22 20:28:37 2015(r289765)
+++ head/sys/libkern/flsll.cThu Oct 22 21:04:47 2015(r289766)
@@ -10,7 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its 

Re: svn commit: r289767 - head/usr.sbin/mptable

2015-10-22 Thread Bryan Drewery
On 10/22/15 2:22 PM, NGie Cooper wrote:
> On Thu, Oct 22, 2015 at 2:13 PM, Baptiste Daroussin  wrote:
>> Author: bapt
>> Date: Thu Oct 22 21:13:35 2015
>> New Revision: 289767
>> URL: https://svnweb.freebsd.org/changeset/base/289767
>>
>> Log:
>>   Stop suggesting -grope argument when -grope argument was actually given
> 
> -grope is a weird option name... and it sounds like something I really
> wouldn't want to describe to my boss.
> 

I *may* have violated the CoC due to this commit already. Yay.

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


svn commit: r289770 - in head/sys: kern sys

2015-10-22 Thread John Baldwin
Author: jhb
Date: Thu Oct 22 21:30:39 2015
New Revision: 289770
URL: https://svnweb.freebsd.org/changeset/base/289770

Log:
  Missing regen after last change to sys/kern/syscalls.master.

Modified:
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/kern/init_sysent.c
==
--- head/sys/kern/init_sysent.c Thu Oct 22 21:28:20 2015(r289769)
+++ head/sys/kern/init_sysent.c Thu Oct 22 21:30:39 2015(r289770)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 281714 2015-04-18 
21:50:13Z kib 
+ * created from FreeBSD: head/sys/kern/syscalls.master 285388 2015-07-11 
15:22:11Z adrian 
  */
 
 #include "opt_compat.h"

Modified: head/sys/kern/syscalls.c
==
--- head/sys/kern/syscalls.cThu Oct 22 21:28:20 2015(r289769)
+++ head/sys/kern/syscalls.cThu Oct 22 21:30:39 2015(r289770)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 281714 2015-04-18 
21:50:13Z kib 
+ * created from FreeBSD: head/sys/kern/syscalls.master 285388 2015-07-11 
15:22:11Z adrian 
  */
 
 const char *syscallnames[] = {

Modified: head/sys/sys/syscall.h
==
--- head/sys/sys/syscall.h  Thu Oct 22 21:28:20 2015(r289769)
+++ head/sys/sys/syscall.h  Thu Oct 22 21:30:39 2015(r289770)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 281714 2015-04-18 
21:50:13Z kib 
+ * created from FreeBSD: head/sys/kern/syscalls.master 285388 2015-07-11 
15:22:11Z adrian 
  */
 
 #defineSYS_syscall 0

Modified: head/sys/sys/syscall.mk
==
--- head/sys/sys/syscall.mk Thu Oct 22 21:28:20 2015(r289769)
+++ head/sys/sys/syscall.mk Thu Oct 22 21:30:39 2015(r289770)
@@ -1,7 +1,7 @@
 # FreeBSD system call names.
 # DO NOT EDIT-- this file is automatically generated.
 # $FreeBSD$
-# created from FreeBSD: head/sys/kern/syscalls.master 281714 2015-04-18 
21:50:13Z kib 
+# created from FreeBSD: head/sys/kern/syscalls.master 285388 2015-07-11 
15:22:11Z adrian 
 MIASM =  \
syscall.o \
exit.o \

Modified: head/sys/sys/sysproto.h
==
--- head/sys/sys/sysproto.h Thu Oct 22 21:28:20 2015(r289769)
+++ head/sys/sys/sysproto.h Thu Oct 22 21:30:39 2015(r289770)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 281714 2015-04-18 
21:50:13Z kib 
+ * created from FreeBSD: head/sys/kern/syscalls.master 285388 2015-07-11 
15:22:11Z adrian 
  */
 
 #ifndef _SYS_SYSPROTO_H_
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289769 - in head/sys: amd64/linux amd64/linux32 cddl/dev/systrace kern modules/dtrace modules/dtrace/systrace_linux modules/dtrace/systrace_linux32

2015-10-22 Thread John Baldwin
Author: jhb
Date: Thu Oct 22 21:28:20 2015
New Revision: 289769
URL: https://svnweb.freebsd.org/changeset/base/289769

Log:
  Rename remaining linux32 symbols such as linux_sysent[] and
  linux_syscallnames[] from linux_* to linux32_* to avoid conflicts with
  linux64.ko.  While here, add support for linux64 binaries to systrace.
  - Update NOPROTO entries in amd64/linux/syscalls.master to match the
main table to fix systrace build.
  - Add a special case for union l_semun arguments to the systrace
generation.
  - The systrace_linux32 module now only builds the systrace_linux32.ko.
module on amd64.
  - Add a new systrace_linux module that builds on both i386 and amd64.
For i386 it builds the existing systrace_linux.ko.  For amd64 it
builds a systrace_linux.ko for 64-bit binaries.
  
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D3954

Added:
  head/sys/modules/dtrace/systrace_linux/
  head/sys/modules/dtrace/systrace_linux/Makefile
 - copied, changed from r289767, 
head/sys/modules/dtrace/systrace_linux32/Makefile
Modified:
  head/sys/amd64/linux/syscalls.master
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/amd64/linux32/syscalls.conf
  head/sys/amd64/linux32/syscalls.master
  head/sys/cddl/dev/systrace/systrace.c
  head/sys/kern/makesyscalls.sh
  head/sys/modules/dtrace/Makefile
  head/sys/modules/dtrace/systrace_linux32/Makefile

Modified: head/sys/amd64/linux/syscalls.master
==
--- head/sys/amd64/linux/syscalls.masterThu Oct 22 21:23:58 2015
(r289768)
+++ head/sys/amd64/linux/syscalls.masterThu Oct 22 21:28:20 2015
(r289769)
@@ -49,8 +49,8 @@
struct l_newstat *buf); }
 6  AUE_LSTAT   STD { int linux_newlstat(char *path, \
struct l_newstat *buf); }
-7  AUE_POLLNOPROTO { int poll(struct pollfd*, \
-   unsigned int nfds, int timeout); }
+7  AUE_POLLNOPROTO { int poll(struct pollfd *fds, u_int nfds, \
+   int timeout); }
 8  AUE_LSEEK   STD { int linux_lseek(l_uint fdes, l_off_t off, \
l_int whence); }
 9  AUE_MMAPSTD { int linux_mmap2(l_ulong addr, l_ulong len, \
@@ -316,7 +316,7 @@
 161AUE_CHROOT  NOPROTO { int chroot(char *path); }
 162AUE_SYNCNOPROTO { int sync(void); }
 163AUE_ACCTNOPROTO { int acct(char *path); }
-164AUE_SETTIMEOFDAYNOPROTO { int settimeofday(struct l_timeval 
*tp, struct timezone *tzp); }
+164AUE_SETTIMEOFDAYNOPROTO { int settimeofday(struct l_timeval 
*tv, struct timezone *tzp); }
 165AUE_MOUNT   STD { int linux_mount(char *specialfile, \
char *dir, char *filesystemtype, \
l_ulong rwflag, void *data); }

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==
--- head/sys/amd64/linux32/linux32_sysvec.c Thu Oct 22 21:23:58 2015
(r289768)
+++ head/sys/amd64/linux32/linux32_sysvec.c Thu Oct 22 21:28:20 2015
(r289769)
@@ -115,7 +115,7 @@ static char *linux_shared_page_mapping;
 extern char _binary_linux32_locore_o_start;
 extern char _binary_linux32_locore_o_end;
 
-extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL];
+extern struct sysent linux32_sysent[LINUX32_SYS_MAXSYSCALL];
 
 SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler);
 
@@ -1008,8 +1008,8 @@ linux32_fixlimit(struct rlimit *rl, int 
 }
 
 struct sysentvec elf_linux_sysvec = {
-   .sv_size= LINUX_SYS_MAXSYSCALL,
-   .sv_table   = linux_sysent,
+   .sv_size= LINUX32_SYS_MAXSYSCALL,
+   .sv_table   = linux32_sysent,
.sv_mask= 0,
.sv_sigsize = 0,
.sv_sigtbl  = NULL,

Modified: head/sys/amd64/linux32/syscalls.conf
==
--- head/sys/amd64/linux32/syscalls.confThu Oct 22 21:23:58 2015
(r289768)
+++ head/sys/amd64/linux32/syscalls.confThu Oct 22 21:28:20 2015
(r289769)
@@ -1,11 +1,11 @@
 # $FreeBSD$
 sysnames="linux32_syscalls.c"
 sysproto="linux32_proto.h"
-sysproto_h=_LINUX_SYSPROTO_H_
+sysproto_h=_LINUX32_SYSPROTO_H_
 syshdr="linux32_syscall.h"
 syssw="linux32_sysent.c"
 sysmk="/dev/null"
-syscallprefix="LINUX_SYS_"
-switchname="linux_sysent"
-namesname="linux_syscallnames"
+syscallprefix="LINUX32_SYS_"
+switchname="linux32_sysent"
+namesname="linux32_syscallnames"
 systrace="linux32_systrace_args.c"

Modified: head/sys/amd64/linux32/syscalls.master
==
--- head/sys/amd64/linux32/syscalls.master  Thu Oct 22 

Re: svn commit: r289767 - head/usr.sbin/mptable

2015-10-22 Thread NGie Cooper
On Thu, Oct 22, 2015 at 2:24 PM, Bryan Drewery  wrote:
> On 10/22/15 2:22 PM, NGie Cooper wrote:
...
>> -grope is a weird option name... and it sounds like something I really
>> wouldn't want to describe to my boss.
>>
>
> I *may* have violated the CoC due to this commit already. Yay.

*hands bdrewery over to HR* :P
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289771 - in head/sys/amd64: linux linux32

2015-10-22 Thread John Baldwin
Author: jhb
Date: Thu Oct 22 21:33:37 2015
New Revision: 289771
URL: https://svnweb.freebsd.org/changeset/base/289771

Log:
  Regen for linux32 rename and linux64 systrace.

Modified:
  head/sys/amd64/linux/linux_proto.h
  head/sys/amd64/linux/linux_syscall.h
  head/sys/amd64/linux/linux_syscalls.c
  head/sys/amd64/linux/linux_sysent.c
  head/sys/amd64/linux/linux_systrace_args.c
  head/sys/amd64/linux32/linux32_proto.h
  head/sys/amd64/linux32/linux32_syscall.h
  head/sys/amd64/linux32/linux32_syscalls.c
  head/sys/amd64/linux32/linux32_sysent.c

Modified: head/sys/amd64/linux/linux_proto.h
==
--- head/sys/amd64/linux/linux_proto.h  Thu Oct 22 21:30:39 2015
(r289770)
+++ head/sys/amd64/linux/linux_proto.h  Thu Oct 22 21:33:37 2015
(r289771)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux/syscalls.master 283492 
2015-05-24 18:08:01Z dchagin 
+ * created from FreeBSD: head/sys/amd64/linux/syscalls.master 289769 
2015-10-22 21:28:20Z jhb 
  */
 
 #ifndef _LINUX_SYSPROTO_H_

Modified: head/sys/amd64/linux/linux_syscall.h
==
--- head/sys/amd64/linux/linux_syscall.hThu Oct 22 21:30:39 2015
(r289770)
+++ head/sys/amd64/linux/linux_syscall.hThu Oct 22 21:33:37 2015
(r289771)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux/syscalls.master 283492 
2015-05-24 18:08:01Z dchagin 
+ * created from FreeBSD: head/sys/amd64/linux/syscalls.master 289769 
2015-10-22 21:28:20Z jhb 
  */
 
 #defineLINUX_SYS_read  0

Modified: head/sys/amd64/linux/linux_syscalls.c
==
--- head/sys/amd64/linux/linux_syscalls.c   Thu Oct 22 21:30:39 2015
(r289770)
+++ head/sys/amd64/linux/linux_syscalls.c   Thu Oct 22 21:33:37 2015
(r289771)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux/syscalls.master 283492 
2015-05-24 18:08:01Z dchagin 
+ * created from FreeBSD: head/sys/amd64/linux/syscalls.master 289769 
2015-10-22 21:28:20Z jhb 
  */
 
 const char *linux_syscallnames[] = {

Modified: head/sys/amd64/linux/linux_sysent.c
==
--- head/sys/amd64/linux/linux_sysent.c Thu Oct 22 21:30:39 2015
(r289770)
+++ head/sys/amd64/linux/linux_sysent.c Thu Oct 22 21:33:37 2015
(r289771)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux/syscalls.master 283492 
2015-05-24 18:08:01Z dchagin 
+ * created from FreeBSD: head/sys/amd64/linux/syscalls.master 289769 
2015-10-22 21:28:20Z jhb 
  */
 
 #include 

Modified: head/sys/amd64/linux/linux_systrace_args.c
==
--- head/sys/amd64/linux/linux_systrace_args.c  Thu Oct 22 21:30:39 2015
(r289770)
+++ head/sys/amd64/linux/linux_systrace_args.c  Thu Oct 22 21:33:37 2015
(r289771)
@@ -73,8 +73,8 @@ systrace_args(int sysnum, void *params, 
/* poll */
case 7: {
struct poll_args *p = params;
-   iarg[0] = p->*; /* struct pollfd */
-   uarg[1] = p->nfds; /* unsigned int */
+   uarg[0] = (intptr_t) p->fds; /* struct pollfd * */
+   uarg[1] = p->nfds; /* u_int */
iarg[2] = p->timeout; /* int */
*n_args = 3;
break;
@@ -591,7 +591,7 @@ systrace_args(int sysnum, void *params, 
iarg[0] = p->semid; /* l_int */
iarg[1] = p->semnum; /* l_int */
iarg[2] = p->cmd; /* l_int */
-   uarg[3] = p->arg; /* union l_semun */
+   uarg[3] = p->arg.buf; /* union l_semun */
*n_args = 4;
break;
}
@@ -1327,7 +1327,7 @@ systrace_args(int sysnum, void *params, 
/* settimeofday */
case 164: {
struct settimeofday_args *p = params;
-   uarg[0] = (intptr_t) p->tp; /* struct l_timeval * */
+   uarg[0] = (intptr_t) p->tv; /* struct l_timeval * */
uarg[1] = (intptr_t) p->tzp; /* struct timezone * */
*n_args = 2;
break;
@@ -2380,10 +2380,10 @@ systrace_entry_setargdesc(int sysnum, in
case 7:
switch(ndx) {
case 0:
-   p = "struct pollfd";
+   p = "struct pollfd *";
break;
case 1:
-   p = "unsigned int";
+   p = "u_int";

svn commit: r289772 - head/share/mk

2015-10-22 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct 22 22:29:25 2015
New Revision: 289772
URL: https://svnweb.freebsd.org/changeset/base/289772

Log:
  Fix installation of manpages with WITHOUT_COMPRESS broken since r284685.
  
  This partially reverts r284685.  An attempt was made in r285295 to fix this
  but was not enough.  There were still $${} vars in the code that should have
  been using the ${_page} and ${_sect} vars, but the bigger problem was that
  .for cannot be used on .ALLSRC as it is not defined when the .for is 
evaluated.
  
  Using ${MAN} here in a .for loop doesn't work either as the paths are not
  expanded right for lib/libc/ subdirs despite having a .PATH set for all
  of them.
  
  Add some comments around long .else and .endif as well.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.man.mk

Modified: head/share/mk/bsd.man.mk
==
--- head/share/mk/bsd.man.mkThu Oct 22 21:33:37 2015(r289771)
+++ head/share/mk/bsd.man.mkThu Oct 22 22:29:25 2015(r289772)
@@ -104,8 +104,8 @@ ${__target}: ${__page}
 .endfor
 .endif
 .endfor
-.endif
-.else
+.endif # !empty(MAN)
+.else  # !defined(MANFILTER)
 .if defined(MAN) && !empty(MAN)
 CLEANFILES+=   ${MAN:T:S/$/${CATEXT}/g}
 .if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
@@ -120,9 +120,9 @@ ${__target}: ${__page}
 _manpages: ${MAN}
 .endif
 .endif
-.endif
+.endif # defined(MANFILTER)
 
-.else
+.else  # ${MK_MANCOMPRESS} == "yes"
 
 ZEXT=  ${MCOMPRESS_EXT}
 
@@ -169,7 +169,7 @@ ${__target}: ${__page}
 .endfor
 .endif
 
-.endif
+.endif # ${MK_MANCOMPRESS} == "no"
 
 maninstall: _maninstall
 _maninstall:
@@ -185,20 +185,26 @@ _maninstall: ${MAN}
${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page}
 .endif
 .endfor
-.else
-.for _page _sect in ${.ALLSRC:C/\.([^.]*)$/.\1 \1/}
-   @d=${DESTDIR}${MANDIR}${_sect}${MANSUBDIR}/; \
-   ${ECHO} ${MINSTALL} ${_page} $${d}; \
-   ${MINSTALL} $${page} $${d};
-.endfor
+.else  # !defined(MANFILTER)
+   @set ${.ALLSRC:C/\.([^.]*)$/.\1 \1/}; \
+   while : ; do \
+   case $$# in \
+   0) break;; \
+   1) echo "warn: missing extension: $$1"; break;; \
+   esac; \
+   page=$$1; shift; sect=$$1; shift; \
+   d=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}; \
+   ${ECHO} ${MINSTALL} $${page} $${d}; \
+   ${MINSTALL} $${page} $${d}; \
+   done
 .if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
 .for __page in ${MAN}
${MINSTALL} ${__page:T:S/$/${CATEXT}/} \
${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T}
 .endfor
 .endif
-.endif
-.else
+.endif # defined(MANFILTER)
+.else  # ${MK_MANCOMPRESS} == "yes"
 .for __page in ${MAN}
${MINSTALL} ${__page:T:S/$/${MCOMPRESS_EXT}/g} \
${DESTDIR}${MANDIR}${__page:E}${MANSUBDIR}/
@@ -207,7 +213,7 @@ _maninstall: ${MAN}

${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T:S/$/${MCOMPRESS_EXT}/}
 .endif
 .endfor
-.endif
+.endif # ${MK_MANCOMPRESS} == "no"
 .endif
 
 .if !defined(NO_MLINKS) && defined(MLINKS) && !empty(MLINKS)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r289778 - head/share/mk

2015-10-22 Thread Ian Lepore
On Thu, 2015-10-22 at 23:41 +, Bryan Drewery wrote:
> Author: bdrewery
> Date: Thu Oct 22 23:41:56 2015
> New Revision: 289778
> URL: https://svnweb.freebsd.org/changeset/base/289778
> 
> Log:
>   For SUBDIR_PARALLEL, when doing 'make clean*' or 'make obj' there
> is no need to
>   respect SUBDIR_DEPEND_* or .WAIT.
>   
>   MFC after:  2 weeks
>   Sponsored by:   EMC / Isilon Storage Division

This doesn't feel so safe.  People override these targets and do who
-knows-what with them.  The clean* seems especially risky since it will
match targets in end-user makefiles that you don't even know about.

-- Ian

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


svn commit: r289777 - head/sys/dev/ioat

2015-10-22 Thread Conrad E. Meyer
Author: cem
Date: Thu Oct 22 23:08:08 2015
New Revision: 289777
URL: https://svnweb.freebsd.org/changeset/base/289777

Log:
  ioat_test: Add a colon (':') for style
  
  Missed in r289776.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/dev/ioat/ioat_test.c

Modified: head/sys/dev/ioat/ioat_test.c
==
--- head/sys/dev/ioat/ioat_test.c   Thu Oct 22 23:03:33 2015
(r289776)
+++ head/sys/dev/ioat/ioat_test.c   Thu Oct 22 23:08:08 2015
(r289777)
@@ -77,7 +77,7 @@ MTX_SYSINIT(ioat_test_lk, _test_lk,
 static int g_thread_index = 1;
 static struct cdev *g_ioat_cdev = NULL;
 
-#defineioat_test_log(v, ...)   _ioat_test_log((v), "ioat " __VA_ARGS__)
+#defineioat_test_log(v, ...)   _ioat_test_log((v), "ioat_test: " 
__VA_ARGS__)
 static inline void _ioat_test_log(int verbosity, const char *fmt, ...);
 
 static void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289778 - head/share/mk

2015-10-22 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct 22 23:41:56 2015
New Revision: 289778
URL: https://svnweb.freebsd.org/changeset/base/289778

Log:
  For SUBDIR_PARALLEL, when doing 'make clean*' or 'make obj' there is no need 
to
  respect SUBDIR_DEPEND_* or .WAIT.
  
  MFC after:2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.subdir.mk

Modified: head/share/mk/bsd.subdir.mk
==
--- head/share/mk/bsd.subdir.mk Thu Oct 22 23:08:08 2015(r289777)
+++ head/share/mk/bsd.subdir.mk Thu Oct 22 23:41:56 2015(r289778)
@@ -83,6 +83,15 @@ ${SUBDIR:N.WAIT}: .PHONY .MAKE
dir=${.TARGET}; \
${_SUBDIR_SH};
 
+# .WAIT and dependencies can be skipped for some targets.
+.if defined(SUBDIR_PARALLEL)
+.if make(obj) || make(clean*)
+_skip_subdir_ordering= 1
+SUBDIR:=   ${SUBDIR:N.WAIT}
+.else
+_skip_subdir_ordering= 0
+.endif
+.endif # defined(SUBDIR_PARALLEL)
 # Work around parsing of .if nested in .for by putting .WAIT string into a var.
 __wait= .WAIT
 .for __target in ${ALL_SUBDIR_TARGETS}
@@ -94,9 +103,11 @@ __subdir_targets+= .WAIT
 .else
 __subdir_targets+= ${__target}_subdir_${__dir}
 __deps=
+.if ${_skip_subdir_ordering} == 0
 .for __dep in ${SUBDIR_DEPEND_${__dir}}
 __deps+= ${__target}_subdir_${__dep}
 .endfor
+.endif
 ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps}
 .if !defined(NO_SUBDIR)
@${_+_}target=${__target:realinstall=install}; \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r289773 - in head: sbin/sysctl sys/kern sys/sys

2015-10-22 Thread NGie Cooper
On Thu, Oct 22, 2015 at 4:03 PM, Conrad E. Meyer  wrote:
> Author: cem
> Date: Thu Oct 22 23:03:06 2015
> New Revision: 289773
> URL: https://svnweb.freebsd.org/changeset/base/289773
>
> Log:
>   Sysctl: Add common support for U8, U16 types
>
>   Sponsored by: EMC / Isilon Storage Division

- This is missing documentation in sysctl(9).
- It probably deserves `Relnotes: yes`.
- Shouldn't __FreeBSD_version be bumped for this change?

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


svn commit: r289780 - in stable: 10/lib/libc/sys 10/sys/kern 10/sys/sys 10/tests/sys/kern 9/lib/libc/sys 9/sys/kern 9/sys/sys

2015-10-22 Thread John Baldwin
Author: jhb
Date: Fri Oct 23 01:27:44 2015
New Revision: 289780
URL: https://svnweb.freebsd.org/changeset/base/289780

Log:
  MFC 287386,288949,288993:
  Export current system call code and argument count for system call entry
  and exit events.  To preserve the ABI, the new fields are moved to the
  end of struct thread in these branches (unlike HEAD) and explicitly copied
  when new threads are created.  In addition, the new tests are only added
  in 10.
  
  r287386:
  Export current system call code and argument count for system call entry
  and exit events. procfs stop events for system call tracing report these
  values (argument count for system call entry and code for system call exit),
  but ptrace() does not provide this information. (Note that while the system
  call code can be determined in an ABI-specific manner during system call
  entry, it is not generally available during system call exit.)
  
  The values are exported via new fields at the end of struct ptrace_lwpinfo
  available via PT_LWPINFO.
  
  r288949:
  Fix various edge cases related to system call tracing.
  - Always set td_dbg_sc_* when P_TRACED is set on system call entry
even if the debugger is not tracing system call entries.  This
ensures the fields are valid when reporting other stops that
occur at system call boundaries such as for PT_FOLLOW_FORKS or
when only tracing system call exits.
  - Set TDB_SCX when reporting the stop for a new child process in
fork_return().  This causes the event to be reported as a system
call exit.
  - Report a system call exit event in fork_return() for new threads in
a traced process.
  - Copy td_dbg_sc_* to new threads instead of zeroing.  This ensures
that td_dbg_sc_code in particular will report the system call that
created the new thread or process when it reports a system call
exit event in fork_return().
  - Add new ptrace tests to verify that new child processes and threads
report system call exit events with a valid pl_syscall_code via
PT_LWPINFO.
  
  r288993:
  Document the recently added pl_syscall_* fields in struct ptrace_lwpinfo.

Modified:
  stable/10/lib/libc/sys/ptrace.2
  stable/10/sys/kern/kern_fork.c
  stable/10/sys/kern/kern_thr.c
  stable/10/sys/kern/subr_syscall.c
  stable/10/sys/kern/sys_process.c
  stable/10/sys/sys/proc.h
  stable/10/sys/sys/ptrace.h
  stable/10/tests/sys/kern/Makefile
  stable/10/tests/sys/kern/ptrace_test.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/9/lib/libc/sys/ptrace.2
  stable/9/sys/kern/kern_fork.c
  stable/9/sys/kern/kern_thr.c
  stable/9/sys/kern/subr_syscall.c
  stable/9/sys/kern/sys_process.c
  stable/9/sys/sys/proc.h
  stable/9/sys/sys/ptrace.h
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libc/sys/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/10/lib/libc/sys/ptrace.2
==
--- stable/10/lib/libc/sys/ptrace.2 Fri Oct 23 00:48:00 2015
(r289779)
+++ stable/10/lib/libc/sys/ptrace.2 Fri Oct 23 01:27:44 2015
(r289780)
@@ -2,7 +2,7 @@
 .\"$NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $
 .\"
 .\" This file is in the public domain.
-.Dd July 3, 2015
+.Dd October 6, 2015
 .Dt PTRACE 2
 .Os
 .Sh NAME
@@ -307,6 +307,8 @@ struct ptrace_lwpinfo {
siginfo_t pl_siginfo;
charpl_tdname[MAXCOMLEN + 1];
int pl_child_pid;
+   u_int   pl_syscall_code;
+   u_int   pl_syscall_narg;
 };
 .Ed
 .Pp
@@ -395,6 +397,27 @@ stop when
 .Dv PL_FLAG_FORKED
 is set in
 .Va pl_flags .
+.It pl_syscall_code
+The ABI-specific identifier of the current system call.
+Note that for indirect system calls this field reports the indirected
+system call.
+Only valid when
+.Dv PL_FLAG_SCE
+or
+.Dv PL_FLAG_SCX
+is set in
+.Va pl_flags.
+.It pl_syscall_narg
+The number of arguments passed to the current system call not counting
+the system call identifier.
+Note that for indirect system calls this field reports the arguments
+passed to the indirected system call.
+Only valid when
+.Dv PL_FLAG_SCE
+or
+.Dv PL_FLAG_SCX
+is set in
+.Va pl_flags.
 .El
 .It PT_GETNUMLWPS
 This request returns the number of kernel threads associated with the

Modified: stable/10/sys/kern/kern_fork.c
==
--- stable/10/sys/kern/kern_fork.c  Fri Oct 23 00:48:00 2015
(r289779)
+++ stable/10/sys/kern/kern_fork.c  Fri Oct 23 01:27:44 2015
(r289780)
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -478,6 +479,8 @@ do_fork(struct thread *td, int flags, st
td2->td_sigstk = td->td_sigstk;
td2->td_flags = TDF_INMEM;
td2->td_lend_user_pri = PRI_MAX;
+   

svn commit: r289780 - in stable: 10/lib/libc/sys 10/sys/kern 10/sys/sys 10/tests/sys/kern 9/lib/libc/sys 9/sys/kern 9/sys/sys

2015-10-22 Thread John Baldwin
Author: jhb
Date: Fri Oct 23 01:27:44 2015
New Revision: 289780
URL: https://svnweb.freebsd.org/changeset/base/289780

Log:
  MFC 287386,288949,288993:
  Export current system call code and argument count for system call entry
  and exit events.  To preserve the ABI, the new fields are moved to the
  end of struct thread in these branches (unlike HEAD) and explicitly copied
  when new threads are created.  In addition, the new tests are only added
  in 10.
  
  r287386:
  Export current system call code and argument count for system call entry
  and exit events. procfs stop events for system call tracing report these
  values (argument count for system call entry and code for system call exit),
  but ptrace() does not provide this information. (Note that while the system
  call code can be determined in an ABI-specific manner during system call
  entry, it is not generally available during system call exit.)
  
  The values are exported via new fields at the end of struct ptrace_lwpinfo
  available via PT_LWPINFO.
  
  r288949:
  Fix various edge cases related to system call tracing.
  - Always set td_dbg_sc_* when P_TRACED is set on system call entry
even if the debugger is not tracing system call entries.  This
ensures the fields are valid when reporting other stops that
occur at system call boundaries such as for PT_FOLLOW_FORKS or
when only tracing system call exits.
  - Set TDB_SCX when reporting the stop for a new child process in
fork_return().  This causes the event to be reported as a system
call exit.
  - Report a system call exit event in fork_return() for new threads in
a traced process.
  - Copy td_dbg_sc_* to new threads instead of zeroing.  This ensures
that td_dbg_sc_code in particular will report the system call that
created the new thread or process when it reports a system call
exit event in fork_return().
  - Add new ptrace tests to verify that new child processes and threads
report system call exit events with a valid pl_syscall_code via
PT_LWPINFO.
  
  r288993:
  Document the recently added pl_syscall_* fields in struct ptrace_lwpinfo.

Modified:
  stable/9/lib/libc/sys/ptrace.2
  stable/9/sys/kern/kern_fork.c
  stable/9/sys/kern/kern_thr.c
  stable/9/sys/kern/subr_syscall.c
  stable/9/sys/kern/sys_process.c
  stable/9/sys/sys/proc.h
  stable/9/sys/sys/ptrace.h
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libc/sys/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/sys/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/lib/libc/sys/ptrace.2
  stable/10/sys/kern/kern_fork.c
  stable/10/sys/kern/kern_thr.c
  stable/10/sys/kern/subr_syscall.c
  stable/10/sys/kern/sys_process.c
  stable/10/sys/sys/proc.h
  stable/10/sys/sys/ptrace.h
  stable/10/tests/sys/kern/Makefile
  stable/10/tests/sys/kern/ptrace_test.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/9/lib/libc/sys/ptrace.2
==
--- stable/9/lib/libc/sys/ptrace.2  Fri Oct 23 00:48:00 2015
(r289779)
+++ stable/9/lib/libc/sys/ptrace.2  Fri Oct 23 01:27:44 2015
(r289780)
@@ -2,7 +2,7 @@
 .\"$NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $
 .\"
 .\" This file is in the public domain.
-.Dd February 7, 2013
+.Dd October 6, 2015
 .Dt PTRACE 2
 .Os
 .Sh NAME
@@ -307,6 +307,8 @@ struct ptrace_lwpinfo {
siginfo_t pl_siginfo;
charpl_tdname[MAXCOMLEN + 1];
int pl_child_pid;
+   u_int   pl_syscall_code;
+   u_int   pl_syscall_narg;
 };
 .Ed
 .Pp
@@ -395,6 +397,27 @@ stop when
 .Dv PL_FLAG_FORKED
 is set in
 .Va pl_flags .
+.It pl_syscall_code
+The ABI-specific identifier of the current system call.
+Note that for indirect system calls this field reports the indirected
+system call.
+Only valid when
+.Dv PL_FLAG_SCE
+or
+.Dv PL_FLAG_SCX
+is set in
+.Va pl_flags.
+.It pl_syscall_narg
+The number of arguments passed to the current system call not counting
+the system call identifier.
+Note that for indirect system calls this field reports the arguments
+passed to the indirected system call.
+Only valid when
+.Dv PL_FLAG_SCE
+or
+.Dv PL_FLAG_SCX
+is set in
+.Va pl_flags.
 .El
 .It PT_GETNUMLWPS
 This request returns the number of kernel threads associated with the

Modified: stable/9/sys/kern/kern_fork.c
==
--- stable/9/sys/kern/kern_fork.c   Fri Oct 23 00:48:00 2015
(r289779)
+++ stable/9/sys/kern/kern_fork.c   Fri Oct 23 01:27:44 2015
(r289780)
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -477,6 +478,8 @@ do_fork(struct thread *td, int flags, st
td2->td_sigmask = td->td_sigmask;
td2->td_flags = TDF_INMEM;
td2->td_lend_user_pri = PRI_MAX;
+   

svn commit: r289773 - in head: sbin/sysctl sys/kern sys/sys

2015-10-22 Thread Conrad E. Meyer
Author: cem
Date: Thu Oct 22 23:03:06 2015
New Revision: 289773
URL: https://svnweb.freebsd.org/changeset/base/289773

Log:
  Sysctl: Add common support for U8, U16 types
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sbin/sysctl/sysctl.c
  head/sys/kern/kern_sysctl.c
  head/sys/sys/sysctl.h

Modified: head/sbin/sysctl/sysctl.c
==
--- head/sbin/sysctl/sysctl.c   Thu Oct 22 22:29:25 2015(r289772)
+++ head/sbin/sysctl/sysctl.c   Thu Oct 22 23:03:06 2015(r289773)
@@ -96,6 +96,8 @@ static int ctl_size[CTLTYPE+1] = {
[CTLTYPE_ULONG] = sizeof(u_long),
[CTLTYPE_S64] = sizeof(int64_t),
[CTLTYPE_U64] = sizeof(uint64_t),
+   [CTLTYPE_U8] = sizeof(uint8_t),
+   [CTLTYPE_U16] = sizeof(uint16_t),
 };
 
 static const char *ctl_typename[CTLTYPE+1] = {
@@ -105,6 +107,8 @@ static const char *ctl_typename[CTLTYPE+
[CTLTYPE_ULONG] = "unsigned long",
[CTLTYPE_S64] = "int64_t",
[CTLTYPE_U64] = "uint64_t",
+   [CTLTYPE_U8] = "uint8_t",
+   [CTLTYPE_U16] = "uint16_t",
 };
 
 static void
@@ -221,6 +225,8 @@ parse(const char *string, int lineno)
int len, i, j;
const void *newval;
const char *newvalstr = NULL;
+   uint8_t u8val;
+   uint16_t u16val;
int intval;
unsigned int uintval;
long longval;
@@ -322,6 +328,8 @@ parse(const char *string, int lineno)
}
 
switch (kind & CTLTYPE) {
+   case CTLTYPE_U8:
+   case CTLTYPE_U16:
case CTLTYPE_INT:
case CTLTYPE_UINT:
case CTLTYPE_LONG:
@@ -345,6 +353,16 @@ parse(const char *string, int lineno)
errno = 0;
 
switch (kind & CTLTYPE) {
+   case CTLTYPE_U8:
+   u8val = (uint8_t)strtoul(newvalstr, , 0);
+   newval = 
+   newsize = sizeof(u8val);
+   break;
+   case CTLTYPE_U16:
+   u16val = (uint16_t)strtoul(newvalstr, , 
0);
+   newval = 
+   newsize = sizeof(u16val);
+   break;
case CTLTYPE_INT:
if (strncmp(fmt, "IK", 2) == 0)
intval = strIKtoi(newvalstr, , 
fmt);
@@ -890,6 +908,8 @@ show_var(int *oid, int nlen)
free(oval);
return (0);
 
+   case CTLTYPE_U8:
+   case CTLTYPE_U16:
case CTLTYPE_INT:
case CTLTYPE_UINT:
case CTLTYPE_LONG:
@@ -902,6 +922,14 @@ show_var(int *oid, int nlen)
sep1 = "";
while (len >= intlen) {
switch (kind & CTLTYPE) {
+   case CTLTYPE_U8:
+   umv = *(uint8_t *)p;
+   mv = *(int8_t *)p;
+   break;
+   case CTLTYPE_U16:
+   umv = *(uint16_t *)p;
+   mv = *(int16_t *)p;
+   break;
case CTLTYPE_INT:
case CTLTYPE_UINT:
umv = *(u_int *)p;

Modified: head/sys/kern/kern_sysctl.c
==
--- head/sys/kern/kern_sysctl.c Thu Oct 22 22:29:25 2015(r289772)
+++ head/sys/kern/kern_sysctl.c Thu Oct 22 23:03:06 2015(r289773)
@@ -1128,6 +1128,70 @@ static SYSCTL_NODE(_sysctl, 5, oiddescr,
  */
 
 /*
+ * Handle an int8_t, signed or unsigned.
+ * Two cases:
+ * a variable:  point arg1 at it.
+ * a constant:  pass it in arg2.
+ */
+
+int
+sysctl_handle_8(SYSCTL_HANDLER_ARGS)
+{
+   int8_t tmpout;
+   int error = 0;
+
+   /*
+* Attempt to get a coherent snapshot by making a copy of the data.
+*/
+   if (arg1)
+   tmpout = *(int8_t *)arg1;
+   else
+   tmpout = arg2;
+   error = SYSCTL_OUT(req, , sizeof(tmpout));
+
+   if (error || !req->newptr)
+   return (error);
+
+   if (!arg1)
+   error = EPERM;
+   else
+   error = SYSCTL_IN(req, arg1, sizeof(tmpout));
+   return (error);
+}
+
+/*
+ * Handle an int16_t, signed or unsigned.
+ * Two cases:
+ * a variable:  point arg1 at it.
+ * a constant:  pass it in arg2.
+ */
+
+int
+sysctl_handle_16(SYSCTL_HANDLER_ARGS)
+{
+   int16_t tmpout;
+   int error = 0;
+
+   /*
+* Attempt to get a coherent snapshot by making a copy of the data.
+*/
+   if (arg1)
+   tmpout = *(int16_t *)arg1;
+   else
+   tmpout = arg2;
+   error = SYSCTL_OUT(req, , 

svn commit: r289774 - head/sys/dev/ntb/ntb_hw

2015-10-22 Thread Conrad E. Meyer
Author: cem
Date: Thu Oct 22 23:03:15 2015
New Revision: 289774
URL: https://svnweb.freebsd.org/changeset/base/289774

Log:
  NTB: Add device introspection sysctl hierarchy
  
  This should export all of the same information as the Linux ntb_hw_intel
  debugfs info file, but with a bit more structure, in the sysctl tree
  rooted at 'dev.ntb_hw..debug_info'.
  
  Raw registers are marked as OPAQUE because reading them on some hardware
  revisions may cause a hard lockup (NTB errata).  They can be read with
  'sysctl -x dev.ntb_hw..debug_info.registers'.  On Xeon platforms,
  some additional registers are available under 'registers.xeon_stats' and
  'registers.xeon_hw_err'.  They are exported as big-endian values so that
  the 'sysctl -x' output is legible.
  
  Shrink the feature mask to 32 bits so we can use the %b formatter in
  'debug_info.features'.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/dev/ntb/ntb_hw/ntb_hw.c
  head/sys/dev/ntb/ntb_hw/ntb_hw.h
  head/sys/dev/ntb/ntb_hw/ntb_regs.h

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c
==
--- head/sys/dev/ntb/ntb_hw/ntb_hw.cThu Oct 22 23:03:06 2015
(r289773)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw.cThu Oct 22 23:03:15 2015
(r289774)
@@ -32,10 +32,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -168,7 +170,7 @@ struct ntb_b2b_addr {
 struct ntb_softc {
device_tdevice;
enum ntb_device_typetype;
-   uint64_tfeatures;
+   uint32_tfeatures;
 
struct ntb_pci_bar_info bar_info[NTB_MAX_BARS];
struct ntb_int_info int_info[MAX_MSIX_INTERRUPTS];
@@ -309,6 +311,10 @@ static void ntb_db_event(struct ntb_soft
 static void recover_atom_link(void *arg);
 static bool ntb_poll_link(struct ntb_softc *ntb);
 static void save_bar_parameters(struct ntb_pci_bar_info *bar);
+static void ntb_sysctl_init(struct ntb_softc *);
+static int sysctl_handle_features(SYSCTL_HANDLER_ARGS);
+static int sysctl_handle_link_status(SYSCTL_HANDLER_ARGS);
+static int sysctl_handle_register(SYSCTL_HANDLER_ARGS);
 
 static struct ntb_hw_info pci_ids[] = {
/* XXX: PS/SS IDs left out until they are supported. */
@@ -528,6 +534,7 @@ ntb_attach(device_t device)
error = ntb_init_isr(ntb);
if (error)
goto out;
+   ntb_sysctl_init(ntb);
 
pci_enable_busmaster(ntb->device);
 
@@ -1897,6 +1904,355 @@ ntb_link_sta_width(struct ntb_softc *ntb
return (NTB_LNK_STA_WIDTH(ntb->lnk_sta));
 }
 
+SYSCTL_NODE(_hw_ntb, OID_AUTO, debug_info, CTLFLAG_RW, 0,
+"Driver state, statistics, and HW registers");
+
+#define NTB_REGSZ_MASK (3ul << 30)
+#define NTB_REG_64 (1ul << 30)
+#define NTB_REG_32 (2ul << 30)
+#define NTB_REG_16 (3ul << 30)
+#define NTB_REG_8  (0ul << 30)
+
+#define NTB_DB_READ(1ul << 29)
+#define NTB_PCI_REG(1ul << 28)
+#define NTB_REGFLAGS_MASK  (NTB_REGSZ_MASK | NTB_DB_READ | NTB_PCI_REG)
+
+static void
+ntb_sysctl_init(struct ntb_softc *ntb)
+{
+   struct sysctl_oid_list *tree_par, *regpar, *statpar, *errpar;
+   struct sysctl_ctx_list *ctx;
+   struct sysctl_oid *tree, *tmptree;
+
+   ctx = device_get_sysctl_ctx(ntb->device);
+
+   tree = SYSCTL_ADD_NODE(ctx,
+   SYSCTL_CHILDREN(device_get_sysctl_tree(ntb->device)), OID_AUTO,
+   "debug_info", CTLFLAG_RD, NULL,
+   "Driver state, statistics, and HW registers");
+   tree_par = SYSCTL_CHILDREN(tree);
+
+   SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "conn_type", CTLFLAG_RD,
+   >conn_type, 0, "0 - Transparent; 1 - B2B; 2 - Root Port");
+   SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "dev_type", CTLFLAG_RD,
+   >dev_type, 0, "0 - USD; 1 - DSD");
+
+   if (ntb->b2b_mw_idx != B2B_MW_DISABLED) {
+   SYSCTL_ADD_U8(ctx, tree_par, OID_AUTO, "b2b_idx", CTLFLAG_RD,
+   >b2b_mw_idx, 0,
+   "Index of the MW used for B2B remote register access");
+   SYSCTL_ADD_UQUAD(ctx, tree_par, OID_AUTO, "b2b_off",
+   CTLFLAG_RD, >b2b_off,
+   "If non-zero, offset of B2B register region in shared MW");
+   }
+
+   SYSCTL_ADD_PROC(ctx, tree_par, OID_AUTO, "features",
+   CTLFLAG_RD | CTLTYPE_STRING, ntb, 0, sysctl_handle_features, "A",
+   "Features/errata of this NTB device");
+
+   SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "ntb_ctl", CTLFLAG_RD,
+   >ntb_ctl, 0, "NTB CTL register (cached)");
+   SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "lnk_sta", CTLFLAG_RD,
+   >lnk_sta, 0, "LNK STA register (cached)");
+
+   SYSCTL_ADD_PROC(ctx, tree_par, OID_AUTO, "link_status",
+   CTLFLAG_RD | CTLTYPE_STRING, ntb, 0, sysctl_handle_link_status,
+   "A", 

svn commit: r289776 - head/sys/dev/ioat

2015-10-22 Thread Conrad E. Meyer
Author: cem
Date: Thu Oct 22 23:03:33 2015
New Revision: 289776
URL: https://svnweb.freebsd.org/changeset/base/289776

Log:
  ioat: Clean up logging
  
  Replace custom Linux-like logging with a thin shim around
  device_printf(), when the softc is available.
  
  In ioat_test, shim around printf(9) instead.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/dev/ioat/ioat.c
  head/sys/dev/ioat/ioat_internal.h
  head/sys/dev/ioat/ioat_test.c

Modified: head/sys/dev/ioat/ioat.c
==
--- head/sys/dev/ioat/ioat.cThu Oct 22 23:03:24 2015(r289775)
+++ head/sys/dev/ioat/ioat.cThu Oct 22 23:03:33 2015(r289776)
@@ -80,6 +80,12 @@ static void ioat_comp_update_map(void *a
 static int ioat_reset_hw(struct ioat_softc *ioat);
 static void ioat_setup_sysctl(device_t device);
 
+#defineioat_log_message(v, ...) do {   
\
+   if ((v) <= g_ioat_debug_level) {\
+   device_printf(ioat->device, __VA_ARGS__);   \
+   }   \
+} while (0)
+
 MALLOC_DEFINE(M_IOAT, "ioat", "ioat driver memory allocations");
 SYSCTL_NODE(_hw, OID_AUTO, ioat, CTLFLAG_RD, 0, "ioat node");
 
@@ -87,7 +93,7 @@ static int g_force_legacy_interrupts;
 SYSCTL_INT(_hw_ioat, OID_AUTO, force_legacy_interrupts, CTLFLAG_RDTUN,
 _force_legacy_interrupts, 0, "Set to non-zero to force MSI-X disabled");
 
-static int g_ioat_debug_level = 0;
+int g_ioat_debug_level = 0;
 SYSCTL_INT(_hw_ioat, OID_AUTO, debug_level, CTLFLAG_RWTUN, _ioat_debug_level,
 0, "Set log level (0-3) for ioat(4). Higher is more verbose.");
 
@@ -614,8 +620,8 @@ ioat_release(bus_dmaengine_t dmaengine)
 {
struct ioat_softc *ioat;
 
-   ioat_log_message(3, "%s\n", __func__);
ioat = to_ioat_softc(dmaengine);
+   ioat_log_message(3, "%s\n", __func__);
ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, (uint16_t)ioat->head);
mtx_unlock(>submit_lock);
 }
@@ -1035,21 +1041,3 @@ ioat_setup_sysctl(device_t device)
"tail", CTLFLAG_RD, >tail,
0, "HW descriptor tail pointer index");
 }
-
-void
-ioat_log_message(int verbosity, char *fmt, ...)
-{
-   va_list argp;
-   char buffer[512];
-   struct timeval tv;
-
-   if (verbosity > g_ioat_debug_level)
-   return;
-
-   va_start(argp, fmt);
-   vsnprintf(buffer, sizeof(buffer) - 1, fmt, argp);
-   va_end(argp);
-   microuptime();
-
-   printf("[%d:%06d] ioat: %s", (int)tv.tv_sec, (int)tv.tv_usec, buffer);
-}

Modified: head/sys/dev/ioat/ioat_internal.h
==
--- head/sys/dev/ioat/ioat_internal.h   Thu Oct 22 23:03:24 2015
(r289775)
+++ head/sys/dev/ioat/ioat_internal.h   Thu Oct 22 23:03:33 2015
(r289776)
@@ -119,7 +119,7 @@ MALLOC_DECLARE(M_IOAT);
 
 SYSCTL_DECL(_hw_ioat);
 
-void ioat_log_message(int verbosity, char *fmt, ...);
+extern int g_ioat_debug_level;
 
 struct ioat_dma_hw_descriptor {
uint32_t size;

Modified: head/sys/dev/ioat/ioat_test.c
==
--- head/sys/dev/ioat/ioat_test.c   Thu Oct 22 23:03:24 2015
(r289775)
+++ head/sys/dev/ioat/ioat_test.c   Thu Oct 22 23:03:33 2015
(r289776)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -76,6 +77,9 @@ MTX_SYSINIT(ioat_test_lk, _test_lk,
 static int g_thread_index = 1;
 static struct cdev *g_ioat_cdev = NULL;
 
+#defineioat_test_log(v, ...)   _ioat_test_log((v), "ioat " __VA_ARGS__)
+static inline void _ioat_test_log(int verbosity, const char *fmt, ...);
+
 static void
 ioat_test_transaction_destroy(struct test_transaction *tx)
 {
@@ -138,7 +142,7 @@ ioat_dma_test_callback(void *arg)
test = tx->test;
 
if (test->verify && !ioat_compare_ok(tx)) {
-   ioat_log_message(0, "miscompare found\n");
+   ioat_test_log(0, "miscompare found\n");
atomic_add_32(>status[IOAT_TEST_MISCOMPARE], tx->depth);
} else if (!test->too_late)
atomic_add_32(>status[IOAT_TEST_OK], tx->depth);
@@ -160,7 +164,7 @@ ioat_test_prealloc_memory(struct ioat_te
tx = ioat_test_transaction_create(test->chain_depth * 2,
test->buffer_size);
if (tx == NULL) {
-   ioat_log_message(0, "tx == NULL - memory exhausted\n");
+   ioat_test_log(0, "tx == NULL - memory exhausted\n");
test->status[IOAT_TEST_NO_MEMORY]++;
return (ENOMEM);
}
@@ -248,13 +252,13 @@ ioat_dma_test(void *arg)
memset(__DEVOLATILE(void *, test->status), 0, sizeof(test->status));
 
if 

svn commit: r289775 - head/sys/dev/ntb/if_ntb

2015-10-22 Thread Conrad E. Meyer
Author: cem
Date: Thu Oct 22 23:03:24 2015
New Revision: 289775
URL: https://svnweb.freebsd.org/changeset/base/289775

Log:
  if_ntb: Use ffsll() now that it is broadly available
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/dev/ntb/if_ntb/if_ntb.c

Modified: head/sys/dev/ntb/if_ntb/if_ntb.c
==
--- head/sys/dev/ntb/if_ntb/if_ntb.cThu Oct 22 23:03:15 2015
(r289774)
+++ head/sys/dev/ntb/if_ntb/if_ntb.cThu Oct 22 23:03:24 2015
(r289775)
@@ -1150,14 +1150,7 @@ ntb_transport_doorbell_callback(void *da
 
vec_mask = ntb_db_vector_mask(nt->ntb, vector);
while (vec_mask != 0) {
-   qp_num = ffsl(vec_mask);
-   /* i386 doesn't have ffsll(), fake it */
-   if (qp_num == 0) {
-   qp_num = ffsl(vec_mask >> 32);
-   KASSERT(qp_num != 0, ("ffs"));
-   qp_num += 32;
-   }
-   qp_num--;
+   qp_num = ffsll(vec_mask) - 1;
 
if (test_bit(qp_num, _bits)) {
qp = >qp_vec[qp_num];
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r289778 - head/share/mk

2015-10-22 Thread Bryan Drewery


> On Oct 22, 2015, at 16:59, Ian Lepore  wrote:
> 
>> On Thu, 2015-10-22 at 23:41 +, Bryan Drewery wrote:
>> Author: bdrewery
>> Date: Thu Oct 22 23:41:56 2015
>> New Revision: 289778
>> URL: https://svnweb.freebsd.org/changeset/base/289778
>> 
>> Log:
>>  For SUBDIR_PARALLEL, when doing 'make clean*' or 'make obj' there
>> is no need to
>>  respect SUBDIR_DEPEND_* or .WAIT.
>> 
>>  MFC after:2 weeks
>>  Sponsored by:EMC / Isilon Storage Division
> 
> This doesn't feel so safe.  People override these targets and do who
> -knows-what with them.  The clean* seems especially risky since it will
> match targets in end-user makefiles that you don't even know about.
> 
> -- Ian
> 
> 

I can limit it to src tree builds if you want.

I cannot imagine any situation where "clean" depends on another 
directory going first. 

Similarly it makes sense to always build subdirs in parallel with 'obj' and I 
would argue 'clean*' too, regardless of SUBDIR_PARALLEL. I only just realized 
that. Yes there are mkdir -p and rm -f races, but we have not added any 
dependencies because of these as is.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r289778 - head/share/mk

2015-10-22 Thread Bryan Drewery

> On Oct 22, 2015, at 17:18, Bryan Drewery  wrote:
> 
> 
> 
>>> On Oct 22, 2015, at 16:59, Ian Lepore  wrote:
>>> 
>>> On Thu, 2015-10-22 at 23:41 +, Bryan Drewery wrote:
>>> Author: bdrewery
>>> Date: Thu Oct 22 23:41:56 2015
>>> New Revision: 289778
>>> URL: https://svnweb.freebsd.org/changeset/base/289778
>>> 
>>> Log:
>>> For SUBDIR_PARALLEL, when doing 'make clean*' or 'make obj' there
>>> is no need to
>>> respect SUBDIR_DEPEND_* or .WAIT.
>>> 
>>> MFC after:2 weeks
>>> Sponsored by:EMC / Isilon Storage Division
>> 
>> This doesn't feel so safe.  People override these targets and do who
>> -knows-what with them.  The clean* seems especially risky since it will
>> match targets in end-user makefiles that you don't even know about.

I can also not apply to SUBDIR_TARGETS which is the user-defined targets list. 
(Misspelled and should be LOCAL_SUBDIR_TARGETS)

>> 
>> -- Ian
> 
> I can limit it to src tree builds if you want.
> 
> I cannot imagine any situation where "clean" depends on another 
> directory going first. 
> 
> Similarly it makes sense to always build subdirs in parallel with 'obj' and I 
> would argue 'clean*' too, regardless of SUBDIR_PARALLEL. I only just realized 
> that. Yes there are mkdir -p and rm -f races, but we have not added any 
> dependencies because of these as is.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289779 - head/sys/dev/otus

2015-10-22 Thread Adrian Chadd
Author: adrian
Date: Fri Oct 23 00:48:00 2015
New Revision: 289779
URL: https://svnweb.freebsd.org/changeset/base/289779

Log:
  otus(4): begin supporting raw transmit parameters in otus_tx()
  
  * Add a comment about the parameters I should support, stolen shamelessly
from iwn(4);
  * Implement the rate bit for the raw transmit path;
  * Print out the host-order versions of each of the transmit bits, so
I have a hope in heck of debugging why things are going wrong.
  
  This still doesn't fix 5GHz in the office but that's likely due to a lot
  of other configuration parameters being 2GHz-specific.  That'll come next.
  
  Tested:
  
  * AR9170 + AR9103 (2/5GHz) 2x2, 5GHz association

Modified:
  head/sys/dev/otus/if_otus.c

Modified: head/sys/dev/otus/if_otus.c
==
--- head/sys/dev/otus/if_otus.c Thu Oct 22 23:41:56 2015(r289778)
+++ head/sys/dev/otus/if_otus.c Fri Oct 23 00:48:00 2015(r289779)
@@ -173,7 +173,8 @@ voidotus_cmd_rxeof(struct otus_softc *
 void   otus_sub_rxeof(struct otus_softc *, uint8_t *, int,
struct mbufq *);
 static int otus_tx(struct otus_softc *, struct ieee80211_node *,
-   struct mbuf *, struct otus_data *);
+   struct mbuf *, struct otus_data *,
+   const struct ieee80211_bpf_params *);
 intotus_ioctl(struct ifnet *, u_long, caddr_t);
 intotus_set_multi(struct otus_softc *);
 static voidotus_updateedca(struct otus_softc *sc);
@@ -509,7 +510,7 @@ _otus_start(struct otus_softc *sc)
ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
m->m_pkthdr.rcvif = NULL;
 
-   if (otus_tx(sc, ni, m, bf) != 0) {
+   if (otus_tx(sc, ni, m, bf, NULL) != 0) {
OTUS_DPRINTF(sc, OTUS_DEBUG_XMIT,
"%s: failed to transmit\n", __func__);
if_inc_counter(ni->ni_vap->iv_ifp,
@@ -554,10 +555,7 @@ otus_raw_xmit(struct ieee80211_node *ni,
goto error;
}
 
-   /*
-* XXX TODO: support TX bpf params
-*/
-   if (otus_tx(sc, ni, m, bf) != 0) {
+   if (otus_tx(sc, ni, m, bf, params) != 0) {
error = EIO;
goto error;
}
@@ -2178,10 +2176,20 @@ otus_tx_update_ratectl(struct otus_softc
 
 /*
  * XXX TODO: support tx bpf parameters for configuration!
+ *
+ * Relevant pieces:
+ *
+ * ac = params->ibp_pri & 3;
+ * rate = params->ibp_rate0;
+ * params->ibp_flags & IEEE80211_BPF_NOACK
+ * params->ibp_flags & IEEE80211_BPF_RTS
+ * params->ibp_flags & IEEE80211_BPF_CTS
+ * tx->rts_ntries = params->ibp_try1;
+ * tx->data_ntries = params->ibp_try0;
  */
 static int
 otus_tx(struct otus_softc *sc, struct ieee80211_node *ni, struct mbuf *m,
-struct otus_data *data)
+struct otus_data *data, const struct ieee80211_bpf_params *params)
 {
struct ieee80211com *ic = >sc_ic;
struct ieee80211vap *vap = ni->ni_vap;
@@ -2230,7 +2238,9 @@ otus_tx(struct otus_softc *sc, struct ie
}
 
/* Pickup a rate index. */
-   if (IEEE80211_IS_MULTICAST(wh->i_addr1) ||
+   if (params != NULL) {
+   rate = otus_rate_to_hw_rate(sc, params->ibp_rate0);
+   } else if (IEEE80211_IS_MULTICAST(wh->i_addr1) ||
(wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) != IEEE80211_FC0_TYPE_DATA) 
{
/* Get lowest rate */
rate = otus_rate_to_hw_rate(sc, 0);
@@ -2245,6 +2255,9 @@ otus_tx(struct otus_softc *sc, struct ie
phyctl = 0;
macctl = AR_TX_MAC_BACKOFF | AR_TX_MAC_HW_DUR | AR_TX_MAC_QID(qid);
 
+   /*
+* XXX TODO: params for NOACK, ACK, RTS, CTS, etc
+*/
if (IEEE80211_IS_MULTICAST(wh->i_addr1) ||
(hasqos && ((qos & IEEE80211_QOS_ACKPOLICY) ==
 IEEE80211_QOS_ACKPOLICY_NOACK)))
@@ -2293,7 +2306,7 @@ otus_tx(struct otus_softc *sc, struct ie
 
OTUS_DPRINTF(sc, OTUS_DEBUG_XMIT,
"%s: tx: m=%p; data=%p; len=%d mac=0x%04x phy=0x%08x rate=0x%02x, 
ni_txrate=%d\n",
-   __func__, m, data, head->len, head->macctl, head->phyctl,
+   __func__, m, data, le16toh(head->len), macctl, phyctl,
(int) rate, (int) ni->ni_txrate);
 
/* Submit transfer */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289749 - in head/sys: conf contrib/rdma/krping dev/cxgb/ulp/iw_cxgb dev/cxgbe/iw_cxgbe modules modules/linuxapi modules/linuxkpi ofed/drivers/infiniband/core ofed/drivers/infiniband/hw...

2015-10-22 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct 22 09:50:45 2015
New Revision: 289749
URL: https://svnweb.freebsd.org/changeset/base/289749

Log:
  Rename linuxapi[.ko] into linuxkpi[.ko], to reflect that it is a
  kernel programming interface module, KPI, to avoid confusion with the
  existing Linux userspace binary compatibility shims. Bump the
  FreeBSD_version number.
  
  Reviewed by:  np @
  Suggested by: dumbbell @
  Sponsored by: Mellanox Technologies

Added:
  head/sys/modules/linuxkpi/
 - copied from r289748, head/sys/modules/linuxapi/
Deleted:
  head/sys/modules/linuxapi/
Modified:
  head/sys/conf/files
  head/sys/conf/options
  head/sys/contrib/rdma/krping/krping.c
  head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c
  head/sys/dev/cxgbe/iw_cxgbe/device.c
  head/sys/modules/Makefile
  head/sys/modules/linuxkpi/Makefile
  head/sys/ofed/drivers/infiniband/core/device.c
  head/sys/ofed/drivers/infiniband/hw/mlx4/main.c
  head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c
  head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c
  head/sys/ofed/drivers/net/mlx4/en_main.c
  head/sys/ofed/drivers/net/mlx4/main.c
  head/sys/ofed/include/linux/linux_kmod.c
  head/sys/sys/param.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Oct 22 09:33:34 2015(r289748)
+++ head/sys/conf/files Thu Oct 22 09:50:45 2015(r289749)
@@ -3797,15 +3797,15 @@ nlm/nlm_prot_xdr.c  optional nfslockd | 
 nlm/sm_inter_xdr.c optional nfslockd | nfsd
 
 # Linux Kernel Compatibility API
-ofed/include/linux/linux_kmod.coptional ofed | 
compat_linuxapi \
+ofed/include/linux/linux_kmod.coptional ofed | 
compat_linuxkpi \
no-depend compile-with "${OFED_C}"
-ofed/include/linux/linux_compat.c  optional ofed | compat_linuxapi 
\
+ofed/include/linux/linux_compat.c  optional ofed | compat_linuxkpi 
\
no-depend compile-with "${OFED_C}"
-ofed/include/linux/linux_pci.c optional ofed | compat_linuxapi 
\
+ofed/include/linux/linux_pci.c optional ofed | compat_linuxkpi 
\
no-depend compile-with "${OFED_C}"
-ofed/include/linux/linux_idr.c optional ofed | compat_linuxapi 
\
+ofed/include/linux/linux_idr.c optional ofed | compat_linuxkpi 
\
no-depend compile-with "${OFED_C}"
-ofed/include/linux/linux_radix.c   optional ofed | compat_linuxapi 
\
+ofed/include/linux/linux_radix.c   optional ofed | compat_linuxkpi 
\
no-depend compile-with "${OFED_C}"
 # OpenFabrics Enterprise Distribution (Infiniband)
 ofed/drivers/infiniband/core/addr.coptional ofed   \

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Thu Oct 22 09:33:34 2015(r289748)
+++ head/sys/conf/options   Thu Oct 22 09:50:45 2015(r289749)
@@ -86,7 +86,7 @@ COMPAT_FREEBSD7   opt_compat.h
 COMPAT_FREEBSD9opt_compat.h
 COMPAT_FREEBSD10   opt_compat.h
 COMPAT_CLOUDABI64  opt_dontuse.h
-COMPAT_LINUXAPIopt_compat.h
+COMPAT_LINUXKPIopt_compat.h
 COMPILING_LINT opt_global.h
 CY_PCI_FASTINTR
 DEADLKRES  opt_watchdog.h

Modified: head/sys/contrib/rdma/krping/krping.c
==
--- head/sys/contrib/rdma/krping/krping.c   Thu Oct 22 09:33:34 2015
(r289748)
+++ head/sys/contrib/rdma/krping/krping.c   Thu Oct 22 09:50:45 2015
(r289749)
@@ -61,7 +61,7 @@ MODULE_AUTHOR("Steve Wise");
 MODULE_DESCRIPTION("RDMA ping client/server");
 MODULE_LICENSE("Dual BSD/GPL");
 MODULE_VERSION(krping, 1);
-MODULE_DEPEND(krping, linuxapi, 1, 1, 1);
+MODULE_DEPEND(krping, linuxkpi, 1, 1, 1);
 
 static __inline uint64_t
 get_cycles(void)

Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c
==
--- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Thu Oct 22 09:33:34 2015
(r289748)
+++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Thu Oct 22 09:50:45 2015
(r289749)
@@ -296,5 +296,5 @@ MODULE_DEPEND(t3_tom, cxgbc, 1, 1, 1);
 MODULE_DEPEND(iw_cxgb, toecore, 1, 1, 1);
 MODULE_DEPEND(iw_cxgb, t3_tom, 1, 1, 1);
 MODULE_DEPEND(iw_cxgb, ibcore, 1, 1, 1);
-MODULE_DEPEND(iw_cxgb, linuxapi, 1, 1, 1);
+MODULE_DEPEND(iw_cxgb, linuxkpi, 1, 1, 1);
 

Modified: head/sys/dev/cxgbe/iw_cxgbe/device.c
==
--- head/sys/dev/cxgbe/iw_cxgbe/device.cThu Oct 22 09:33:34 2015
(r289748)
+++ head/sys/dev/cxgbe/iw_cxgbe/device.cThu Oct 22 09:50:45 2015
(r289749)
@@ -363,5 +363,5 @@ MODULE_VERSION(iw_cxgbe, 1);
 MODULE_DEPEND(iw_cxgbe, t4nex, 1, 1, 1);
 MODULE_DEPEND(iw_cxgbe, t4_tom, 1, 1, 1);
 

svn commit: r289747 - in head/sys: amd64/cloudabi64 compat/cloudabi64 conf modules/cloudabi64

2015-10-22 Thread Ed Schouten
Author: ed
Date: Thu Oct 22 09:07:53 2015
New Revision: 289747
URL: https://svnweb.freebsd.org/changeset/base/289747

Log:
  Refactoring: move out generic bits from cloudabi64_sysvec.c.
  
  In order to make it easier to support CloudABI on ARM64, move out all of
  the bits from the AMD64 cloudabi_sysvec.c into a new file
  cloudabi_module.c that would otherwise remain identical. This reduces
  the AMD64 specific code to just ~160 lines.
  
  Reviewed by:  kib
  Differential Revision:https://reviews.freebsd.org/D3974

Added:
  head/sys/compat/cloudabi64/cloudabi64_module.c
 - copied, changed from r289745, 
head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
Modified:
  head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
  head/sys/compat/cloudabi64/cloudabi64_util.h
  head/sys/conf/files
  head/sys/modules/cloudabi64/Makefile

Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
==
--- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c   Thu Oct 22 08:37:11 
2015(r289746)
+++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c   Thu Oct 22 09:07:53 
2015(r289747)
@@ -27,107 +27,26 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
-#include 
-#include 
 #include 
-#include 
 #include 
-#include 
-#include 
 #include 
-#include 
 
-#include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
 
 #include 
-#include 
 #include 
 
 extern const char *cloudabi64_syscallnames[];
 extern struct sysent cloudabi64_sysent[];
 
-static register_t *
-cloudabi64_copyout_strings(struct image_params *imgp)
-{
-   uintptr_t begin;
-   size_t len;
-
-   /* Copy out program arguments. */
-   len = imgp->args->begin_envv - imgp->args->begin_argv;
-   begin = rounddown2(USRSTACK - len, sizeof(register_t));
-   copyout(imgp->args->begin_argv, (void *)begin, len);
-   return ((register_t *)begin);
-}
-
-static int
-cloudabi64_fixup(register_t **stack_base, struct image_params *imgp)
-{
-   char canarybuf[64];
-   Elf64_Auxargs *args;
-   struct thread *td;
-   void *argdata, *canary;
-   size_t argdatalen;
-   int error;
-
-   /*
-* CloudABI executables do not store the FreeBSD OS release
-* number in their header. Set the OS release number to the
-* latest version of FreeBSD, so that system calls behave as if
-* called natively.
-*/
-   td = curthread;
-   td->td_proc->p_osrel = __FreeBSD_version;
-
-   /* Store canary for stack smashing protection. */
-   argdata = *stack_base;
-   arc4rand(canarybuf, sizeof(canarybuf), 0);
-   *stack_base -= howmany(sizeof(canarybuf), sizeof(register_t));
-   canary = *stack_base;
-   error = copyout(canarybuf, canary, sizeof(canarybuf));
-   if (error != 0)
-   return (error);
-
-   /*
-* Compute length of program arguments. As the argument data is
-* binary safe, we had to add a trailing null byte in
-* exec_copyin_data_fds(). Undo this by reducing the length.
-*/
-   args = (Elf64_Auxargs *)imgp->auxargs;
-   argdatalen = imgp->args->begin_envv - imgp->args->begin_argv;
-   if (argdatalen > 0)
-   --argdatalen;
-
-   /* Write out an auxiliary vector. */
-   cloudabi64_auxv_t auxv[] = {
-#defineVAL(type, val)  { .a_type = (type), .a_val = (val) }
-#definePTR(type, ptr)  { .a_type = (type), .a_ptr = (uintptr_t)(ptr) }
-   PTR(CLOUDABI_AT_ARGDATA, argdata),
-   VAL(CLOUDABI_AT_ARGDATALEN, argdatalen),
-   PTR(CLOUDABI_AT_CANARY, canary),
-   VAL(CLOUDABI_AT_CANARYLEN, sizeof(canarybuf)),
-   VAL(CLOUDABI_AT_NCPUS, mp_ncpus),
-   VAL(CLOUDABI_AT_PAGESZ, args->pagesz),
-   PTR(CLOUDABI_AT_PHDR, args->phdr),
-   VAL(CLOUDABI_AT_PHNUM, args->phnum),
-   VAL(CLOUDABI_AT_TID, td->td_tid),
-#undef VAL
-#undef PTR
-   { .a_type = CLOUDABI_AT_NULL },
-   };
-   *stack_base -= howmany(sizeof(auxv), sizeof(register_t));
-   return (copyout(auxv, *stack_base, sizeof(auxv)));
-}
-
 static int
 cloudabi64_fetch_syscall_args(struct thread *td, struct syscall_args *sa)
 {
@@ -234,43 +153,9 @@ static struct sysentvec cloudabi64_elf_s
 
 INIT_SYSENTVEC(elf_sysvec, _elf_sysvec);
 
-static Elf64_Brandinfo cloudabi64_brand = {
+Elf64_Brandinfo cloudabi64_brand = {
.brand  = ELFOSABI_CLOUDABI,
.machine= EM_X86_64,
.sysvec = _elf_sysvec,
.compat_3_brand = "CloudABI",
 };
-
-static int
-cloudabi64_modevent(module_t mod, int type, void *data)
-{
-
-   switch (type) {
-   case MOD_LOAD:
-   if (elf64_insert_brand_entry(_brand) < 0) {
-   printf("Failed to add CloudABI ELF brand handler\n");
-   return (EINVAL);
-   

svn commit: r289748 - in head/sys: kern sys

2015-10-22 Thread Ed Schouten
Author: ed
Date: Thu Oct 22 09:33:34 2015
New Revision: 289748
URL: https://svnweb.freebsd.org/changeset/base/289748

Log:
  Add a way to distinguish between forking and thread creation in schedtail.
  
  For CloudABI we need to initialize the registers of new threads
  differently based on whether the thread got created through a fork or
  through simple thread creation.
  
  Add a flag, TDP_FORKING, that is set by do_fork() and cleared by
  fork_exit(). This can be tested against in schedtail.
  
  Reviewed by:  kib
  Differential Revision:https://reviews.freebsd.org/D3973

Modified:
  head/sys/kern/kern_fork.c
  head/sys/kern/subr_syscall.c
  head/sys/sys/proc.h

Modified: head/sys/kern/kern_fork.c
==
--- head/sys/kern/kern_fork.c   Thu Oct 22 09:07:53 2015(r289747)
+++ head/sys/kern/kern_fork.c   Thu Oct 22 09:33:34 2015(r289748)
@@ -586,7 +586,7 @@ do_fork(struct thread *td, int flags, st
 * been preserved.
 */
p2->p_flag |= p1->p_flag & P_SUGID;
-   td2->td_pflags |= td->td_pflags & TDP_ALTSTACK;
+   td2->td_pflags |= (td->td_pflags & TDP_ALTSTACK) | TDP_FORKING;
SESS_LOCK(p1->p_session);
if (p1->p_session->s_ttyvp != NULL && p1->p_flag & P_CONTROLT)
p2->p_flag |= P_CONTROLT;
@@ -1023,6 +1023,7 @@ fork_exit(void (*callout)(void *, struct
 
if (p->p_sysent->sv_schedtail != NULL)
(p->p_sysent->sv_schedtail)(td);
+   td->td_pflags &= ~TDP_FORKING;
 }
 
 /*

Modified: head/sys/kern/subr_syscall.c
==
--- head/sys/kern/subr_syscall.cThu Oct 22 09:07:53 2015
(r289747)
+++ head/sys/kern/subr_syscall.cThu Oct 22 09:33:34 2015
(r289748)
@@ -176,6 +176,9 @@ syscallret(struct thread *td, int error,
struct proc *p, *p2;
int traced;
 
+   KASSERT((td->td_pflags & TDP_FORKING) == 0,
+   ("fork() did not clear TDP_FORKING upon completion"));
+
p = td->td_proc;
 
/*

Modified: head/sys/sys/proc.h
==
--- head/sys/sys/proc.h Thu Oct 22 09:07:53 2015(r289747)
+++ head/sys/sys/proc.h Thu Oct 22 09:33:34 2015(r289748)
@@ -446,7 +446,7 @@ do {
\
 #defineTDP_RESETSPUR   0x0400 /* Reset spurious page fault 
history. */
 #defineTDP_NERRNO  0x0800 /* Last errno is already in td_errno 
*/
 #defineTDP_UIOHELD 0x1000 /* Current uio has pages held in 
td_ma */
-#defineTDP_UNUSED290x2000 /* --available-- */
+#defineTDP_FORKING 0x2000 /* Thread is being created through 
fork() */
 #defineTDP_EXECVMSPC   0x4000 /* Execve destroyed old vmspace */
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289750 - head/usr.sbin/rtadvd

2015-10-22 Thread Hiroki Sato
Author: hrs
Date: Thu Oct 22 09:55:40 2015
New Revision: 289750
URL: https://svnweb.freebsd.org/changeset/base/289750

Log:
  - Fix a bug which prevented dnssl[0-9] and rdnss[0-9] parameters from
working.
  
  - Fix a pointer calculation for padding when multiple dnssl[0-9]
parameters are specified [*].
  
  Reported by:  http://bugs.dragonflybsd.org/issues/2847 [*]

Modified:
  head/usr.sbin/rtadvd/config.c

Modified: head/usr.sbin/rtadvd/config.c
==
--- head/usr.sbin/rtadvd/config.c   Thu Oct 22 09:50:45 2015
(r289749)
+++ head/usr.sbin/rtadvd/config.c   Thu Oct 22 09:55:40 2015
(r289750)
@@ -808,7 +808,7 @@ getconfig_free_rti:
makeentry(entbuf, sizeof(entbuf), i, "rdnss");
addr = (char *)agetstr(entbuf, );
if (addr == NULL)
-   break;
+   continue;
ELM_MALLOC(rdn, exit(1));
 
TAILQ_INIT(>rd_list);
@@ -859,7 +859,7 @@ getconfig_free_rdn:
makeentry(entbuf, sizeof(entbuf), i, "dnssl");
addr = (char *)agetstr(entbuf, );
if (addr == NULL)
-   break;
+   continue;
 
ELM_MALLOC(dns, exit(1));
 
@@ -1528,6 +1528,7 @@ make_packet(struct rainfo *rai)
/* Padding to next 8 octets boundary */
len = buf - (char *)ndopt_dnssl;
len += (len % 8) ? 8 - len % 8 : 0;
+   buf = (char *)ndopt_dnssl + len;
 
/* Length field must be in 8 octets */
ndopt_dnssl->nd_opt_dnssl_len = len / 8;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r289773 - in head: sbin/sysctl sys/kern sys/sys

2015-10-22 Thread Bruce Evans

On Thu, 22 Oct 2015, Conrad E. Meyer wrote:


Log:
 Sysctl: Add common support for U8, U16 types

 Sponsored by:  EMC / Isilon Storage Division


This uses similar low-quality code to other sysctls, and more.


Modified: head/sbin/sysctl/sysctl.c
==
--- head/sbin/sysctl/sysctl.c   Thu Oct 22 22:29:25 2015(r289772)
+++ head/sbin/sysctl/sysctl.c   Thu Oct 22 23:03:06 2015(r289773)
@@ -96,6 +96,8 @@ static int ctl_size[CTLTYPE+1] = {
[CTLTYPE_ULONG] = sizeof(u_long),
[CTLTYPE_S64] = sizeof(int64_t),
[CTLTYPE_U64] = sizeof(uint64_t),
+   [CTLTYPE_U8] = sizeof(uint8_t),
+   [CTLTYPE_U16] = sizeof(uint16_t),
};


Unsorting.  The table was sorted on size, then alphabetically.
Alphabetical ordering also happens to give ordering on rank.  (This
ordering is the inverse of the ordering for declarations.)



static const char *ctl_typename[CTLTYPE+1] = {
@@ -105,6 +107,8 @@ static const char *ctl_typename[CTLTYPE+
[CTLTYPE_ULONG] = "unsigned long",
[CTLTYPE_S64] = "int64_t",
[CTLTYPE_U64] = "uint64_t",
+   [CTLTYPE_U8] = "uint8_t",
+   [CTLTYPE_U16] = "uint16_t",
};


Consistent unsorting.



static void
@@ -221,6 +225,8 @@ parse(const char *string, int lineno)
int len, i, j;
const void *newval;
const char *newvalstr = NULL;
+   uint8_t u8val;
+   uint16_t u16val;
int intval;
unsigned int uintval;
long longval;


Locally consistent, but backwards sorting.  The *val variables were sorted
on rank, and the addition matches this, but style(9) requires inverse
sorting on rank.  Other local variables are randomly ordered.


@@ -322,6 +328,8 @@ parse(const char *string, int lineno)
}

switch (kind & CTLTYPE) {
+   case CTLTYPE_U8:
+   case CTLTYPE_U16:
case CTLTYPE_INT:
case CTLTYPE_UINT:
case CTLTYPE_LONG:


Consistent sorting.  The types are sorted on rank.  Style(9) requires
sorting case stylements alpahbetically, but it is good to break that
here and sort on rank or inverse rank to match other orderings.


@@ -345,6 +353,16 @@ parse(const char *string, int lineno)
errno = 0;

switch (kind & CTLTYPE) {
+   case CTLTYPE_U8:
+   u8val = (uint8_t)strtoul(newvalstr, , 0);
+   newval = 
+   newsize = sizeof(u8val);
+   break;


Bug: blind truncation gives overflow before overflow can be checked for.
The overflow checking done by the subsequent errno check only checks for
representability of the return value.

Style bug: bogus cast to make the overflow more explicit and/or prevent
the compiler from detecting the bug and misleading the reader into thinking
that overflow is intentionally allowed.  The cast usually has no other
effect (the behaviour on conversion is only implementation-defined in
the overflow case.  Perhaps it can be different with the cast).

The other assignments are mostly similarly broken:
- CTLTYPE_INT: similar bogus cast to int
- CTLTYPE_UINT: unsimilar bogus cast to int.  The correct cast to u_int
  would have no effect, but casting to int gratuitously gives
  implementation defined behaviour even for representable values like
  UINT_MAX
- CTLTYPE_LONG, CTLTYPE_ULONG: correct (null conversion with no cast)
- CTLTYPE_S64: no cast, though overflow can occur if int64_t < intmax_t
- CTLTYPE_U64: no cast.  Correct since the type is unsigned
- CTLTYPE_IMAX, CTLTYPE_UIMAX: unsupported.


+   case CTLTYPE_U16:
+   u16val = (uint16_t)strtoul(newvalstr, , 
0);
+   newval = 
+   newsize = sizeof(u16val);
+   break;


As a bug, but another style bug from the cast (ling too long).


case CTLTYPE_INT:
if (strncmp(fmt, "IK", 2) == 0)
intval = strIKtoi(newvalstr, , 
fmt);


The error handling is somewhat obfuscated by having general code after the
switch statement to avoid almost repeating it for each case.  It could be
simplified by always assigning to uintmax_t uimaxval.  Then do general
error handling.  Then do specific error handling (range checking for each
case).

The error handling also has a silly check for empty values before the
main check.  The general error handling finds empty values and much
more as a special case of disallowing values with no digits (e.g.,
nonempty leading whitespace and/or sign before the empty value).  So
all the silly check does is give a special error message for empty
values.  Not worth it.

Style bug: you forgot to add the new types to the silly check.


free(oval);

Re: svn commit: r289764 - in head: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/html contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contrib/ntp/kernel/sys contri

2015-10-22 Thread Gleb Smirnoff
On Thu, Oct 22, 2015 at 10:13:09PM -0700, NGie Cooper wrote:
N> On Thu, Oct 22, 2015 at 12:42 PM, Gleb Smirnoff  wrote:
N> > Author: glebius
N> > Date: Thu Oct 22 19:42:57 2015
N> > New Revision: 289764
N> > URL: https://svnweb.freebsd.org/changeset/base/289764
N> >
N> > Log:
N> >   MFV ntp-4.2.8p4 (r289715)
N> 
N> MFC after..?

ASAP. Now testing builds and learning freebsd-update.

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


svn commit: r289782 - head/sys/dev/otus

2015-10-22 Thread Adrian Chadd
Author: adrian
Date: Fri Oct 23 02:09:23 2015
New Revision: 289782
URL: https://svnweb.freebsd.org/changeset/base/289782

Log:
  otus(4) - add missing ieee80211_free_node() call.

Modified:
  head/sys/dev/otus/if_otus.c

Modified: head/sys/dev/otus/if_otus.c
==
--- head/sys/dev/otus/if_otus.c Fri Oct 23 02:08:47 2015(r289781)
+++ head/sys/dev/otus/if_otus.c Fri Oct 23 02:09:23 2015(r289782)
@@ -1274,6 +1274,7 @@ otus_newstate(struct ieee80211vap *vap, 
taskqueue_enqueue_timeout(taskqueue_thread,
>calib_to, hz);
}
+   ieee80211_free_node(ni);
break;
default:
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289781 - head/sys/dev/otus

2015-10-22 Thread Adrian Chadd
Author: adrian
Date: Fri Oct 23 02:08:47 2015
New Revision: 289781
URL: https://svnweb.freebsd.org/changeset/base/289781

Log:
  otus(4) - demagicify register names.
  
  Obtained from:Linux carl9170 hw.h

Modified:
  head/sys/dev/otus/if_otus.c
  head/sys/dev/otus/if_otusreg.h

Modified: head/sys/dev/otus/if_otus.c
==
--- head/sys/dev/otus/if_otus.c Fri Oct 23 01:27:44 2015(r289780)
+++ head/sys/dev/otus/if_otus.c Fri Oct 23 02:08:47 2015(r289781)
@@ -2460,29 +2460,29 @@ otus_init_mac(struct otus_softc *sc)
otus_write(sc, AR_MAC_REG_RX_PE_DELAY, 0x70);
otus_write(sc, AR_MAC_REG_EIFS_AND_SIFS, 0xa144000);
otus_write(sc, AR_MAC_REG_SLOT_TIME, 9 << 10);
-   otus_write(sc, 0x1c3b2c, 0x1900);
+   otus_write(sc, AR_MAC_REG_TID_CFACK_CFEND_RATE, 0x1900);
/* NAV protects ACK only (in TXOP). */
-   otus_write(sc, 0x1c3b38, 0x201);
+   otus_write(sc, AR_MAC_REG_TXOP_DURATION, 0x201);
/* Set beacon Tx power to 0x7. */
otus_write(sc, AR_MAC_REG_BCN_HT1, 0x8000170);
otus_write(sc, AR_MAC_REG_BACKOFF_PROTECT, 0x105);
-   otus_write(sc, 0x1c3b9c, 0x1a);
+   otus_write(sc, AR_MAC_REG_AMPDU_FACTOR, 0x1a);
/* Filter any control frames, BAR is bit 24. */
-   otus_write(sc, 0x1c368c, 0x0500);
-   otus_write(sc, 0x1c3c40, 0x1);
+   otus_write(sc, AR_MAC_REG_FRAMETYPE_FILTER, 0x0500);
+   otus_write(sc, AR_MAC_REG_RX_CONTROL, 0x1);
otus_write(sc, AR_MAC_REG_BASIC_RATE, 0x150f);
otus_write(sc, AR_MAC_REG_MANDATORY_RATE, 0x150f);
otus_write(sc, AR_MAC_REG_RTS_CTS_RATE, 0x10b01bb);
-   otus_write(sc, 0x1c3694, 0x4003c1e);
+   otus_write(sc, AR_MAC_REG_ACK_TPC, 0x4003c1e);
/* Enable LED0 and LED1. */
-   otus_write(sc, 0x1d0100, 0x3);
-   otus_write(sc, 0x1d0104, 0x3);
+   otus_write(sc, AR_GPIO_REG_PORT_TYPE, 0x3);
+   otus_write(sc, AR_GPIO_REG_PORT_DATA, 0x3);
/* Switch MAC to OTUS interface. */
otus_write(sc, 0x1c3600, 0x3);
-   otus_write(sc, 0x1c3c50, 0x);
-   otus_write(sc, 0x1c3680, 0xf8);
+   otus_write(sc, AR_MAC_REG_AMPDU_RX_THRESH, 0x);
+   otus_write(sc, AR_MAC_REG_MISC_680, 0xf8);
/* Disable Rx timeout (workaround). */
-   otus_write(sc, 0x1c362c, 0);
+   otus_write(sc, AR_MAC_REG_RX_TIMEOUT, 0);
 
/* Set USB Rx stream mode maximum frame number to 2. */
otus_write(sc, 0x1e1110, 0x4);
@@ -2490,14 +2490,14 @@ otus_init_mac(struct otus_softc *sc)
otus_write(sc, 0x1e1114, 0x80);
 
/* Set clock frequency to 88/80MHz. */
-   otus_write(sc, 0x1d4008, 0x73);
+   otus_write(sc, AR_PWR_REG_CLOCK_SEL, 0x73);
/* Set WLAN DMA interrupt mode: generate intr per packet. */
-   otus_write(sc, 0x1c3d7c, 0x110011);
-   otus_write(sc, 0x1c3bb0, 0x4);
+   otus_write(sc, AR_MAC_REG_TXRX_MPI, 0x110011);
+   otus_write(sc, AR_MAC_REG_FCS_SELECT, 0x4);
otus_write(sc, AR_MAC_REG_TXOP_NOT_ENOUGH_INDICATION, 0x141e0f48);
 
/* Disable HW decryption for now. */
-   otus_write(sc, 0x1c3678, 0x78);
+   otus_write(sc, AR_MAC_REG_ENCRYPTION, 0x78);
 
if ((error = otus_write_barrier(sc)) != 0)
return error;
@@ -2649,9 +2649,9 @@ otus_program_phy(struct otus_softc *sc, 
otus_write(sc, AR_PHY_POWER_TX_RATE9, 0x3f3f3f3f);
 
if (IEEE80211_IS_CHAN_2GHZ(c))
-   otus_write(sc, 0x1d4014, 0x5163);
+   otus_write(sc, AR_PWR_REG_PLL_ADDAC, 0x5163);
else
-   otus_write(sc, 0x1d4014, 0x5143);
+   otus_write(sc, AR_PWR_REG_PLL_ADDAC, 0x5143);
 
return otus_write_barrier(sc);
 }
@@ -2763,10 +2763,10 @@ otus_set_chan(struct otus_softc *sc, str
OTUS_DPRINTF(sc, OTUS_DEBUG_RESET, "band switch\n");
 
/* Cold/Warm reset BB/ADDA. */
-   otus_write(sc, 0x1d4004, sc->bb_reset ? 0x800 : 0x400);
+   otus_write(sc, AR_PWR_REG_RESET, sc->bb_reset ? 0x800 : 0x400);
if ((error = otus_write_barrier(sc)) != 0)
goto finish;
-   otus_write(sc, 0x1d4004, 0);
+   otus_write(sc, AR_PWR_REG_RESET, 0);
if ((error = otus_write_barrier(sc)) != 0)
goto finish;
sc->bb_reset = 0;
@@ -3062,7 +3062,7 @@ otus_led_newstate_type3(struct otus_soft
state &= ~AR_LED0_ON;
}
if (state != sc->led_state) {
-   otus_write(sc, 0x1d0104, state);
+   otus_write(sc, AR_GPIO_REG_PORT_DATA, state);
if (otus_write_barrier(sc) == 0)
sc->led_state = state;
}
@@ -3097,18 +3097,18 @@ otus_init(struct otus_softc *sc)
 #ifdef notyet
 #ifndef IEEE80211_STA_ONLY
case IEEE80211_M_HOSTAP:
- 

svn commit: r289783 - head/usr.sbin/ntp

2015-10-22 Thread Gleb Smirnoff
Author: glebius
Date: Fri Oct 23 05:03:34 2015
New Revision: 289783
URL: https://svnweb.freebsd.org/changeset/base/289783

Log:
  A miss from r289764.

Modified:
  head/usr.sbin/ntp/config.h

Modified: head/usr.sbin/ntp/config.h
==
--- head/usr.sbin/ntp/config.h  Fri Oct 23 02:09:23 2015(r289782)
+++ head/usr.sbin/ntp/config.h  Fri Oct 23 05:03:34 2015(r289783)
@@ -1418,7 +1418,7 @@
 #define PACKAGE_NAME "ntp"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "ntp 4.2.8p3"
+#define PACKAGE_STRING "ntp 4.2.8p4"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "ntp"
@@ -1427,7 +1427,7 @@
 #define PACKAGE_URL "http://www.ntp.org./;
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "4.2.8p3"
+#define PACKAGE_VERSION "4.2.8p4"
 
 /* data dir */
 #define PERLLIBDIR "/usr/local/share/ntp/lib"
@@ -1608,7 +1608,7 @@ typedef unsigned int  uintptr_t;
 /* #undef USE_UDP_SIGPOLL */
 
 /* Version number of package */
-#define VERSION "4.2.8p3"
+#define VERSION "4.2.8p4"
 
 /* vsnprintf expands "%m" to strerror(errno) */
 /* #undef VSNPRINTF_PERCENT_M */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r289764 - in head: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/html contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contrib/ntp/kernel/sys contri

2015-10-22 Thread NGie Cooper
On Thu, Oct 22, 2015 at 12:42 PM, Gleb Smirnoff  wrote:
> Author: glebius
> Date: Thu Oct 22 19:42:57 2015
> New Revision: 289764
> URL: https://svnweb.freebsd.org/changeset/base/289764
>
> Log:
>   MFV ntp-4.2.8p4 (r289715)

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


Re: svn commit: r289421 - in head/etc: . mtree ntp

2015-10-22 Thread Cy Schubert
We already have an example to work from. The family of ports (ntp, 
ntp-devel) installs ${LOCALBASE}/sbin/update-leap. It would be fine except 
for the fact that it's written in Perl, not something we'd want to visit on 
FreeBSD again. I'm sure it could be rewritten in shell script or C/C++.


-- 
Cheers,
Cy Schubert  or 
FreeBSD UNIX:     Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.



In message <201510180200.t9i20kli062...@slippy.cwsent.com>, Cy Schubert 
writes:
> Agreed, this would be best. There was a suggestion a GSoC person could do 
> it (though I'm willing to roll up my sleeves if necessary).
> 
> 
> -- 
> Cheers,
> Cy Schubert  or 
> FreeBSD UNIX:     Web:  http://www.FreeBSD.org
> 
>   The need of the many outweighs the greed of the few.
> 
> 
> 
> In message <8154492e-c29e-41b1-a13b-34e33586d...@bsdimp.com>, Warner Losh 
> write
> s:
> > 
> > 
> > --Apple-Mail=_60572A67-97E7-4200-AEF6-88DC6354712B
> > Content-Transfer-Encoding: quoted-printable
> > Content-Type: text/plain;
> > charset=utf-8
> > 
> > Until the next leap second=E2=80=A6. It would be better to just
> > always try to grab the latest one=E2=80=A6 Can we put something
> > in periodic to do that so users that have releases
> > that are older than 6 months aren=E2=80=99t screwed?
> > 
> > Warner
> > 
> > > On Oct 16, 2015, at 8:04 AM, Cy Schubert  wrote:
> > >=20
> > > Author: cy
> > > Date: Fri Oct 16 14:04:16 2015
> > > New Revision: 289421
> > > URL: https://svnweb.freebsd.org/changeset/base/289421
> > >=20
> > > Log:
> > >  Add default leap-seconds file. This should help ntp networks get the
> > >  leap second date correct
> > >=20
> > >  Updates to the file can be obtained from ftp://time.nist.gov/pub/ or
> > >  ftp://tycho.usno.navy.mil/pub/ntp/.
> > >=20
> > >  Suggested by:dwmalone
> > >  Reviewed by: roberto, dwmalone, delphij
> > >  Approved by: roberto
> > >  MFC after:   1 week
> > >=20
> > > Added:
> > >  head/etc/ntp/
> > >  head/etc/ntp/Makefile   (contents, props changed)
> > >  head/etc/ntp/leap-seconds   (contents, props changed)
> > > Modified:
> > >  head/etc/Makefile
> > >  head/etc/mtree/BSD.var.dist
> > >  head/etc/ntp.conf
> > >=20
> > > Modified: head/etc/Makefile
> > > =
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> =
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> =
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> =
> > =3D=3D=3D
> > > --- head/etc/Makefile Fri Oct 16 12:53:22 2015(r289420)
> > > +++ head/etc/Makefile Fri Oct 16 14:04:16 2015(r289421)
> > > @@ -240,6 +240,9 @@ distribution:
> > >   ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
> > >   ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
> > >   ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
> > > +.if ${MK_NTP} !=3D "no"
> > > + ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
> > > +.endif
> > >   ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
> > > .if ${MK_PKGBOOTSTRAP} !=3D "no"
> > >   ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
> > >=20
> > > Modified: head/etc/mtree/BSD.var.dist
> > > =
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> =
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> =
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> =
> > =3D=3D=3D
> > > --- head/etc/mtree/BSD.var.dist   Fri Oct 16 12:53:22 2015=
> > (r289420)
> > > +++ head/etc/mtree/BSD.var.dist   Fri Oct 16 14:04:16 2015=
> > (r289421)
> > > @@ -46,6 +46,8 @@
> > > ..
> > > ipf mode=3D0700
> > > ..
> > > +ntp mode=3D0700
> > > +..
> > > pkg
> > > ..
> > > ports
> > >=20
> > > Modified: head/etc/ntp.conf
> > > =
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> =
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> =
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> =
> > =3D=3D=3D
> > > --- head/etc/ntp.conf Fri Oct 16 12:53:22 2015(r289420)
> > > +++ head/etc/ntp.conf Fri Oct 16 14:04:16 2015(r289421)
> > > @@ -77,3 +77,8 @@ restrict 127.127.1.0
> > > #
> > > #server 127.127.1.0
> > > #fudge 127.127.1.0 stratum 10
> > > +
> > > +# See =
> > http://support.ntp.org/bin/view/Support/ConfiguringNTP#Section_6.14.
> > > +# for documentation regarding leapfile. Updates to the file can be =
> > obtained
> > > +# from ftp://time.nist.gov/pub/ or =
> > ftp://tycho.usno.navy.mil/pub/ntp/.
> > > +leapfile "/etc/ntp/leap-seconds"
> > >=20
> > > Added: head/etc/ntp/Makefile
> > > =
> > 

Re: svn commit: r289728 - head

2015-10-22 Thread Julian Elischer

On 10/22/15 9:45 AM, Alexander Kabaev wrote:

On Thu, 22 Oct 2015 01:32:11 + (UTC)
Ed Maste  wrote:


Author: emaste
Date: Thu Oct 22 01:32:11 2015
New Revision: 289728
URL: https://svnweb.freebsd.org/changeset/base/289728

Log:
   Warn that NOCLEAN is deprecated - use NO_CLEAN instead
   
   NO_CLEAN has been the correct spelling for over a decade.


Modified:
   head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Oct 22 01:04:31 2015
(r289727) +++ head/Makefile.inc1Thu Oct 22 01:32:11
2015(r289728) @@ -128,6 +128,7 @@ SUBDIR+=etc
  .endif# !empty(SUBDIR_OVERRIDE)
  
  .if defined(NOCLEAN)

+.warning NOCLEAN option is deprecated. Use NO_CLEAN instead.
  NO_CLEAN= ${NOCLEAN}
  .endif
  .if defined(NO_CLEANDIR)


For some definition of 'correct'. It definitely is not for those who
have -DNOCLEAN wired into their finger memory and above mentioned
decade did not help with that any.

I think some of the common spellings were left as is in great NO_
revolution for a reason and I see no reason why the sudden itch to
change that.


I can never remember what the right way for WITHXXX WITH_XXX DO_XXX   
NO_XXX  NOXXX  etc. is..  I go look for examples every time.



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


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

2015-10-22 Thread Adrian Chadd
Author: adrian
Date: Thu Oct 22 15:15:45 2015
New Revision: 289756
URL: https://svnweb.freebsd.org/changeset/base/289756

Log:
  Commit the right board file - use the right name + hints.

Modified:
  head/sys/mips/conf/TL-WR740Nv4

Modified: head/sys/mips/conf/TL-WR740Nv4
==
--- head/sys/mips/conf/TL-WR740Nv4  Thu Oct 22 15:13:47 2015
(r289755)
+++ head/sys/mips/conf/TL-WR740Nv4  Thu Oct 22 15:15:45 2015
(r289756)
@@ -12,10 +12,10 @@
 # Include the default AR933x parameters
 include "AR933X_BASE"
 
-ident   CARAMBOLA2
+ident   TL-WR740Nv4
 
 # Override hints with board values
-hints   "CARAMBOLA2.hints"
+hints   "TL-WR740Nv4.hints"
 
 # Board memory - 32MB
 options AR71XX_REALMEM=(32*1024*1024)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289757 - head/sys/dev/wtap

2015-10-22 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Oct 22 15:20:33 2015
New Revision: 289757
URL: https://svnweb.freebsd.org/changeset/base/289757

Log:
  wtap: remove some obsolete radiotap(9) code
  
  This code is not needed since r192468.
  
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D3975

Modified:
  head/sys/dev/wtap/if_wtap.c

Modified: head/sys/dev/wtap/if_wtap.c
==
--- head/sys/dev/wtap/if_wtap.c Thu Oct 22 15:15:45 2015(r289756)
+++ head/sys/dev/wtap/if_wtap.c Thu Oct 22 15:20:33 2015(r289757)
@@ -527,15 +527,9 @@ wtap_rx_proc(void *arg, int npending)
/*
 * Sending station is known, dispatch directly.
 */
-#if 0
-   ieee80211_radiotap_rx(ni->ni_vap, m);
-#endif
type = ieee80211_input(ni, m, 1<<7, 10);
ieee80211_free_node(ni);
} else {
-#if 0
-   ieee80211_radiotap_rx_all(ic, m);
-#endif
type = ieee80211_input_all(ic, m, 1<<7, 10);
}

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


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

2015-10-22 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Oct 22 15:42:53 2015
New Revision: 289758
URL: https://svnweb.freebsd.org/changeset/base/289758

Log:
  urtwn(4): replace hardcoded rate indices with their names
  
  Reviewed by:  kevlo
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D3967

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

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==
--- head/sys/dev/usb/wlan/if_urtwn.cThu Oct 22 15:20:33 2015
(r289757)
+++ head/sys/dev/usb/wlan/if_urtwn.cThu Oct 22 15:42:53 2015
(r289758)
@@ -665,22 +665,7 @@ urtwn_rx_frame(struct urtwn_softc *sc, u
tap->wr_flags = 0;
/* Map HW rate index to 802.11 rate. */
if (!(rxdw3 & R92C_RXDW3_HT)) {
-   switch (rate) {
-   /* CCK. */
-   case  0: tap->wr_rate =   2; break;
-   case  1: tap->wr_rate =   4; break;
-   case  2: tap->wr_rate =  11; break;
-   case  3: tap->wr_rate =  22; break;
-   /* OFDM. */
-   case  4: tap->wr_rate =  12; break;
-   case  5: tap->wr_rate =  18; break;
-   case  6: tap->wr_rate =  24; break;
-   case  7: tap->wr_rate =  36; break;
-   case  8: tap->wr_rate =  48; break;
-   case  9: tap->wr_rate =  72; break;
-   case 10: tap->wr_rate =  96; break;
-   case 11: tap->wr_rate = 108; break;
-   }
+   tap->wr_rate = ridx2rate[rate];
} else if (rate >= 12) {/* MCS0~15. */
/* Bit 7 set means HT MCS instead of rate. */
tap->wr_rate = 0x80 | (rate - 12);
@@ -1411,8 +1396,6 @@ urtwn_r88e_read_rom(struct urtwn_softc *
 static int
 urtwn_ra_init(struct urtwn_softc *sc)
 {
-   static const uint8_t map[] =
-   { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 };
struct ieee80211com *ic = >sc_ic;
struct ieee80211vap *vap = TAILQ_FIRST(>ic_vaps);
struct ieee80211_node *ni;
@@ -1430,10 +1413,11 @@ urtwn_ra_init(struct urtwn_softc *sc)
maxrate = maxbasicrate = 0;
for (i = 0; i < rs->rs_nrates; i++) {
/* Convert 802.11 rate to HW rate index. */
-   for (j = 0; j < nitems(map); j++)
-   if ((rs->rs_rates[i] & IEEE80211_RATE_VAL) == map[j])
+   for (j = 0; j < nitems(ridx2rate); j++)
+   if ((rs->rs_rates[i] & IEEE80211_RATE_VAL) ==
+   ridx2rate[j])
break;
-   if (j == nitems(map))   /* Unknown rate, skip. */
+   if (j == nitems(ridx2rate)) /* Unknown rate, skip. */
continue;
rates |= 1 << j;
if (j > maxrate)
@@ -1740,7 +1724,7 @@ urtwn_update_avgrssi(struct urtwn_softc 
else
pwdb = 100 + rssi;
if (!(sc->chip & URTWN_CHIP_88E)) {
-   if (rate <= 3) {
+   if (rate <= URTWN_RIDX_CCK11) {
/* CCK gain is smaller than OFDM/MCS gain. */
pwdb += 6;
if (pwdb > 100)
@@ -1773,7 +1757,7 @@ urtwn_get_rssi(struct urtwn_softc *sc, i
uint8_t rpt;
int8_t rssi;
 
-   if (rate <= 3) {
+   if (rate <= URTWN_RIDX_CCK11) {
cck = (struct r92c_rx_cck *)physt;
if (sc->sc_flags & URTWN_FLAG_CCK_HIPWR) {
rpt = (cck->agc_rpt >> 5) & 0x3;
@@ -1799,7 +1783,7 @@ urtwn_r88e_get_rssi(struct urtwn_softc *
int8_t rssi;
 
rssi = 0;
-   if (rate <= 3) {
+   if (rate <= URTWN_RIDX_CCK11) {
cck = (struct r88e_rx_cck *)physt;
cck_agc_rpt = cck->agc_rpt;
lna_idx = (cck_agc_rpt & 0xe0) >> 5;
@@ -1932,10 +1916,12 @@ urtwn_tx_start(struct urtwn_softc *sc, s
}
}
/* Send RTS at OFDM24. */
-   txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, 8));
+   txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE,
+   URTWN_RIDX_OFDM24));
txd->txdw5 |= htole32(0x0001ff00);
/* Send data at OFDM54. */
-   txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 11));
+   txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE,
+   URTWN_RIDX_OFDM54));
} else {
txd->txdw1 |= htole32(
SM(R92C_TXDW1_MACID, 0) |
@@ -1944,7 +1930,8 @@ urtwn_tx_start(struct urtwn_softc *sc, s
 
/* Force CCK1. */

svn commit: r289755 - head/sys/dev/ispfw

2015-10-22 Thread Alexander Motin
Author: mav
Date: Thu Oct 22 15:13:47 2015
New Revision: 289755
URL: https://svnweb.freebsd.org/changeset/base/289755

Log:
  Remove residual verbosity.
  
  firmware_register() already reports errors.

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

Modified: head/sys/dev/ispfw/ispfw.c
==
--- head/sys/dev/ispfw/ispfw.c  Thu Oct 22 14:29:19 2015(r289754)
+++ head/sys/dev/ispfw/ispfw.c  Thu Oct 22 15:13:47 2015(r289755)
@@ -135,43 +135,27 @@ static intisp_2500_loaded;
 
 #defineISPFW_VERSION   1
 
-#if!defined(KLD_MODULE)
-#defineISPFW_KLD   0
-#else
-#defineISPFW_KLD   1
-#endif
-
 #defineRMACRO(token)   do {
\
if (token##_loaded) \
break;  \
if (firmware_register(#token, token##_risc_code,\
token##_risc_code[3] * sizeof(token##_risc_code[3]),\
-   ISPFW_VERSION, NULL) == NULL) { \
-   printf("%s: unable to register firmware <%s>\n",\
-   MODULE_NAME, #token);   \
+   ISPFW_VERSION, NULL) == NULL)   \
break;  \
-   }   \
token##_loaded++;   \
-   if (bootverbose || ISPFW_KLD)   \
-   printf("%s: registered firmware <%s>\n", MODULE_NAME,   \
-   #token);\
 } while (0)
 
 #defineUMACRO(token)   do {
\
if (!token##_loaded)\
break;  \
if (firmware_unregister(#token) != 0) { \
-   printf("%s: unable to unregister firmware <%s>\n",  \
-   MODULE_NAME, #token);   \
+   error = EBUSY;  \
break;  \
}   \
token##_loaded--;   \
-   if (bootverbose || ISPFW_KLD)   \
-   printf("%s: unregistered firmware <%s>\n", MODULE_NAME, \
-   #token);\
 } while (0)
 
-static void
+static int
 do_load_fw(void)
 {
 
@@ -214,11 +198,13 @@ do_load_fw(void)
 #ifdefined(ISP_2500)
RMACRO(isp_2500);
 #endif
+   return (0);
 }
 
-static void
+static int
 do_unload_fw(void)
 {
+   int error = 0;
 
 #ifdefined(ISP_1000)
UMACRO(isp_1000);
@@ -259,6 +245,7 @@ do_unload_fw(void)
 #ifdefined(ISP_2500)
UMACRO(isp_2500);
 #endif
+   return (error);
 }
 
 static int
@@ -267,17 +254,11 @@ module_handler(module_t mod, int what, v
 
switch (what) {
case MOD_LOAD:
-   do_load_fw();
-   break;
+   return (do_load_fw());
case MOD_UNLOAD:
-   do_unload_fw();
-   break;
-   case MOD_SHUTDOWN:
-   break;
-   default:
-   return (EOPNOTSUPP);
+   return (do_unload_fw());
}
-   return (0);
+   return (EOPNOTSUPP);
 }
 static moduledata_t ispfw_mod = {
MODULE_NAME, module_handler, NULL
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2015-10-22 Thread Jason A. Harmening
Author: jah
Date: Thu Oct 22 16:38:01 2015
New Revision: 289759
URL: https://svnweb.freebsd.org/changeset/base/289759

Log:
  Use pmap_quick* functions in armv6 busdma, for bounce buffers and cache 
maintenance.  This makes it safe to sync buffers that have no VA mapping 
associated with the busdma map, but may have other mappings, possibly on 
different CPUs.  This also makes it safe to sync unmapped bounce buffers in 
non-sleepable thread contexts.
  
  Similar to r286787 for x86, this treats userspace buffers the same as 
unmapped buffers and no longer borrows the UVA for sync operations.
  
  Submitted by: Svatopluk Kraus  (earlier revision)
  Tested by:Svatopluk Kraus
  Differential Revision:https://reviews.freebsd.org/D3869

Modified:
  head/sys/arm/arm/busdma_machdep-v6.c
  head/sys/arm/include/cpu-v6.h

Modified: head/sys/arm/arm/busdma_machdep-v6.c
==
--- head/sys/arm/arm/busdma_machdep-v6.cThu Oct 22 15:42:53 2015
(r289758)
+++ head/sys/arm/arm/busdma_machdep-v6.cThu Oct 22 16:38:01 2015
(r289759)
@@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #define MAX_BPAGES 64
@@ -104,14 +104,16 @@ struct bounce_page {
vm_offset_t vaddr;  /* kva of bounce buffer */
bus_addr_t  busaddr;/* Physical address */
vm_offset_t datavaddr;  /* kva of client data */
-   bus_addr_t  dataaddr;   /* client physical address */
+   vm_page_t   datapage;   /* physical page of client data */
+   vm_offset_t dataoffs;   /* page offset of client data */
bus_size_t  datacount;  /* client data count */
STAILQ_ENTRY(bounce_page) links;
 };
 
 struct sync_list {
vm_offset_t vaddr;  /* kva of client data */
-   bus_addr_t  busaddr;/* client physical address */
+   vm_page_t   pages;  /* starting page of client data */
+   vm_offset_t dataoffs;   /* page offset of client data */
bus_size_t  datacount;  /* client data count */
 };
 
@@ -181,7 +183,6 @@ struct bus_dmamap {
intpagesreserved;
bus_dma_tag_t  dmat;
struct memdesc mem;
-   pmap_t pmap;
bus_dmamap_callback_t *callback;
void  *callback_arg;
int   flags;
@@ -206,12 +207,14 @@ static bus_addr_t add_bounce_page(bus_dm
  vm_offset_t vaddr, bus_addr_t addr,
  bus_size_t size);
 static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage);
-static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
-void *buf, bus_size_t buflen, int flags);
+static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, pmap_t pmap,
+bus_dmamap_t map, void *buf, bus_size_t buflen, int flags);
 static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map,
 vm_paddr_t buf, bus_size_t buflen, int flags);
 static int _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
 int flags);
+static void dma_preread_safe(vm_offset_t va, vm_paddr_t pa, vm_size_t size);
+static void dma_dcache_sync(struct sync_list *sl, bus_dmasync_op_t op);
 
 static busdma_bufalloc_t coherent_allocator;   /* Cache of coherent buffers */
 static busdma_bufalloc_t standard_allocator;   /* Cache of standard buffers */
@@ -896,7 +899,8 @@ _bus_dmamap_count_phys(bus_dma_tag_t dma
while (buflen != 0) {
sgsize = MIN(buflen, dmat->maxsegsz);
if (must_bounce(dmat, map, curaddr, sgsize) != 0) {
-   sgsize = MIN(sgsize, PAGE_SIZE);
+   sgsize = MIN(sgsize,
+   PAGE_SIZE - (curaddr & PAGE_MASK));
map->pagesneeded++;
}
curaddr += sgsize;
@@ -907,7 +911,7 @@ _bus_dmamap_count_phys(bus_dma_tag_t dma
 }
 
 static void
-_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
+_bus_dmamap_count_pages(bus_dma_tag_t dmat, pmap_t pmap, bus_dmamap_t map,
 void *buf, bus_size_t buflen, int flags)
 {
vm_offset_t vaddr;
@@ -927,10 +931,10 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm
vendaddr = (vm_offset_t)buf + buflen;
 
while (vaddr < vendaddr) {
-   if (__predict_true(map->pmap == kernel_pmap))
+   if (__predict_true(pmap == kernel_pmap))
paddr = pmap_kextract(vaddr);
else
-   paddr = pmap_extract(map->pmap, vaddr);
+   paddr = pmap_extract(pmap, vaddr);
if 

svn commit: r289760 - head/sys/dev/ioat

2015-10-22 Thread Conrad E. Meyer
Author: cem
Date: Thu Oct 22 16:46:21 2015
New Revision: 289760
URL: https://svnweb.freebsd.org/changeset/base/289760

Log:
  ioat: Fix some attach/detach issues
  
  Don't run the selftest until after we've enabled bus mastering, or the
  DMA engine can't copy anything for our test.
  
  Create the ioat_test device on attach, if so tuned.  Destroy the
  ioat_test device on teardown.
  
  Replace deprecated 'CALLOUT_MPSAFE' with correct '1' in callout_init().
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/dev/ioat/ioat.c
  head/sys/dev/ioat/ioat_internal.h
  head/sys/dev/ioat/ioat_test.c

Modified: head/sys/dev/ioat/ioat.c
==
--- head/sys/dev/ioat/ioat.cThu Oct 22 16:38:01 2015(r289759)
+++ head/sys/dev/ioat/ioat.cThu Oct 22 16:46:21 2015(r289760)
@@ -56,6 +56,7 @@ static int ioat_detach(device_t device);
 static int ioat_setup_intr(struct ioat_softc *ioat);
 static int ioat_teardown_intr(struct ioat_softc *ioat);
 static int ioat3_attach(device_t device);
+static int ioat3_selftest(struct ioat_softc *ioat);
 static int ioat_map_pci_bar(struct ioat_softc *ioat);
 static void ioat_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg,
 int error);
@@ -239,7 +240,15 @@ ioat_attach(device_t device)
if (error != 0)
goto err;
 
+   error = ioat3_selftest(ioat);
+   if (error != 0)
+   return (error);
+
+   ioat_process_events(ioat);
+   ioat_setup_sysctl(device);
+
ioat_channel[ioat_channel_index++] = ioat;
+   ioat_test_attach();
 
 err:
if (error != 0)
@@ -254,6 +263,8 @@ ioat_detach(device_t device)
uint32_t i;
 
ioat = DEVICE2SOFTC(device);
+
+   ioat_test_detach();
callout_drain(>timer);
 
pci_disable_busmaster(device);
@@ -347,7 +358,7 @@ ioat3_attach(device_t device)
 
mtx_init(>submit_lock, "ioat_submit", NULL, MTX_DEF);
mtx_init(>cleanup_lock, "ioat_process_events", NULL, MTX_DEF);
-   callout_init(>timer, CALLOUT_MPSAFE);
+   callout_init(>timer, 1);
 
ioat->is_resize_pending = FALSE;
ioat->is_completion_pending = FALSE;
@@ -415,13 +426,6 @@ ioat3_attach(device_t device)
ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN);
ioat_write_chancmp(ioat, ioat->comp_update_bus_addr);
ioat_write_chainaddr(ioat, ring[0]->hw_desc_bus_addr);
-
-   error = ioat3_selftest(ioat);
-   if (error != 0)
-   return (error);
-
-   ioat_process_events(ioat);
-   ioat_setup_sysctl(device);
return (0);
 }
 

Modified: head/sys/dev/ioat/ioat_internal.h
==
--- head/sys/dev/ioat/ioat_internal.h   Thu Oct 22 16:38:01 2015
(r289759)
+++ head/sys/dev/ioat/ioat_internal.h   Thu Oct 22 16:46:21 2015
(r289760)
@@ -366,6 +366,9 @@ struct ioat_softc {
struct mtx  cleanup_lock;
 };
 
+void ioat_test_attach(void);
+void ioat_test_detach(void);
+
 static inline uint64_t
 ioat_get_chansts(struct ioat_softc *ioat)
 {

Modified: head/sys/dev/ioat/ioat_test.c
==
--- head/sys/dev/ioat/ioat_test.c   Thu Oct 22 16:38:01 2015
(r289759)
+++ head/sys/dev/ioat/ioat_test.c   Thu Oct 22 16:46:21 2015
(r289760)
@@ -367,6 +367,22 @@ static struct cdevsw ioat_cdevsw = {
 };
 
 static int
+enable_ioat_test(bool enable)
+{
+
+   mtx_assert(, MA_OWNED);
+
+   if (enable && g_ioat_cdev == NULL) {
+   g_ioat_cdev = make_dev(_cdevsw, 0, UID_ROOT, GID_WHEEL,
+   0600, "ioat_test");
+   } else if (!enable && g_ioat_cdev != NULL) {
+   destroy_dev(g_ioat_cdev);
+   g_ioat_cdev = NULL;
+   }
+   return (0);
+}
+
+static int
 sysctl_enable_ioat_test(SYSCTL_HANDLER_ARGS)
 {
int error, enabled;
@@ -376,15 +392,32 @@ sysctl_enable_ioat_test(SYSCTL_HANDLER_A
if (error != 0 || req->newptr == NULL)
return (error);
 
-   if (enabled != 0 && g_ioat_cdev == NULL) {
-   g_ioat_cdev = make_dev(_cdevsw, 0, UID_ROOT, GID_WHEEL,
-   0600, "ioat_test");
-   } else if (enabled == 0 && g_ioat_cdev != NULL) {
-   destroy_dev(g_ioat_cdev);
-   g_ioat_cdev = NULL;
-   }
+   enable_ioat_test(enabled);
return (0);
 }
 SYSCTL_PROC(_hw_ioat, OID_AUTO, enable_ioat_test, CTLTYPE_INT | CTLFLAG_RW,
 0, 0, sysctl_enable_ioat_test, "I",
 "Non-zero: Enable the /dev/ioat_test device");
+
+void
+ioat_test_attach(void)
+{
+   char *val;
+
+   val = kern_getenv("hw.ioat.enable_ioat_test");
+   if (val != NULL && strcmp(val, "0") != 0) {
+   mtx_lock();
+   enable_ioat_test(true);
+   mtx_unlock();
+   }
+   freeenv(val);
+}
+

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

2015-10-22 Thread Conrad E. Meyer
Author: cem
Date: Thu Oct 22 16:46:30 2015
New Revision: 289761
URL: https://svnweb.freebsd.org/changeset/base/289761

Log:
  getenv.9: Document behavior of freeenv(NULL)
  
  Fix a couple igor(1)-indicated spelling issues while here.
  
  Suggested by: jhb
  Sponsored by: EMC / Isilon Storage Division

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

Modified: head/share/man/man9/getenv.9
==
--- head/share/man/man9/getenv.9Thu Oct 22 16:46:21 2015
(r289760)
+++ head/share/man/man9/getenv.9Thu Oct 22 16:46:30 2015
(r289761)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 22, 2013
+.Dd October 22, 2015
 .Dt GETENV 9
 .Os
 .Sh NAME
@@ -78,7 +78,6 @@ function obtains the current value of th
 .Fa name
 and returns a pointer to the string value.
 The caller should not modify the string pointed to by the return value.
-.Pp
 The
 .Fn getenv
 function may allocate temporary storage,
@@ -88,12 +87,24 @@ function must be called to release any a
 returned by
 .Fn getenv
 is no longer needed.
+.Pp
+The
+.Fn freeenv
+function is used to release the resources allocated by a previous call to
+.Fn getenv .
 The
 .Fa env
 argument passed to
 .Fn freeenv
 is the pointer returned by the earlier call to
 .Fn getenv .
+Like
+.Xr free 3 ,
+the
+.Fa env
+argument can be
+.Va NULL ,
+in which case no action occurs.
 .Pp
 The
 .Fn setenv
@@ -156,7 +167,8 @@ Otherwise,
 the value is interpreted as decimal.
 The value may contain a single character suffix specifying a unit for
 the value.
-The interpreted value is multipled by the unit's magnitude before being 
returned.
+The interpreted value is multiplied by the unit's magnitude before being
+returned.
 The following unit suffixes are supported:
 .Bl -column -offset indent ".Sy Unit" ".Sy Magnitude"
 .It Sy Unit Ta Sy Magnitude
@@ -179,7 +191,7 @@ zero is returned.
 If the variable exists,
 up to
 .Fa size - 1
-characters of it's value are copied to the buffer pointed to by
+characters of its value are copied to the buffer pointed to by
 .Fa data
 followed by a null character and a non-zero value is returned.
 .Sh RETURN VALUES
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289762 - in head/tools/regression/net80211: ccmp tkip wep

2015-10-22 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Oct 22 17:08:12 2015
New Revision: 289762
URL: https://svnweb.freebsd.org/changeset/base/289762

Log:
  Unbreak regression testing tools for net80211 crypto cipher modules
  
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D3441

Modified:
  head/tools/regression/net80211/ccmp/test_ccmp.c
  head/tools/regression/net80211/tkip/test_tkip.c
  head/tools/regression/net80211/wep/test_wep.c

Modified: head/tools/regression/net80211/ccmp/test_ccmp.c
==
--- head/tools/regression/net80211/ccmp/test_ccmp.c Thu Oct 22 16:46:30 
2015(r289761)
+++ head/tools/regression/net80211/ccmp/test_ccmp.c Thu Oct 22 17:08:12 
2015(r289762)
@@ -53,6 +53,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -591,32 +592,32 @@ printtest(const struct ciphertest *t)
 }
 
 static int
-runtest(struct ieee80211com *ic, struct ciphertest *t)
+runtest(struct ieee80211vap *vap, struct ciphertest *t)
 {
-   struct ieee80211_key key;
+   struct ieee80211_key *key = >iv_nw_keys[t->keyix];
struct mbuf *m = NULL;
const struct ieee80211_cipher *cip;
-   u_int8_t mac[IEEE80211_ADDR_LEN];
+   int hdrlen;
 
printf("%s: ", t->name);
 
/*
 * Setup key.
 */
-   memset(, 0, sizeof(key));
-   key.wk_flags = IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV;
-   key.wk_cipher = _cipher_none;
-   if (!ieee80211_crypto_newkey(ic, t->cipher,
-   IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV, )) {
+   memset(key, 0, sizeof(*key));
+   key->wk_flags = IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV;
+   key->wk_cipher = _cipher_none;
+   if (!ieee80211_crypto_newkey(vap, t->cipher,
+   IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV, key)) {
printf("FAIL: ieee80211_crypto_newkey failed\n");
goto bad;
}
 
-   memcpy(key.wk_key, t->key, t->key_len);
-   key.wk_keylen = t->key_len;
-   key.wk_keyrsc = 0;
-   key.wk_keytsc = t->pn-1;/* PN-1 since we do encap */
-   if (!ieee80211_crypto_setkey(ic, , mac)) {
+   memcpy(key->wk_key, t->key, t->key_len);
+   key->wk_keylen = t->key_len;
+   memset(key->wk_keyrsc, 0, sizeof(key->wk_keyrsc));
+   key->wk_keytsc = t->pn-1;   /* PN-1 since we do encap */
+   if (!ieee80211_crypto_setkey(vap, key)) {
printf("FAIL: ieee80211_crypto_setkey failed\n");
goto bad;
}
@@ -624,17 +625,18 @@ runtest(struct ieee80211com *ic, struct 
/*
 * Craft frame from plaintext data.
 */
-   cip = key.wk_cipher;
+   cip = key->wk_cipher;
m = m_getcl(M_NOWAIT, MT_HEADER, M_PKTHDR);
m->m_data += cip->ic_header;
memcpy(mtod(m, void *), t->plaintext, t->plaintext_len);
m->m_len = t->plaintext_len;
m->m_pkthdr.len = m->m_len;
+   hdrlen = ieee80211_anyhdrsize(mtod(m, void *));
 
/*
 * Encrypt frame w/ MIC.
 */
-   if (!cip->ic_encap(, m, t->keyix<<6)) {
+   if (!cip->ic_encap(key, m)) {
printtest(t);
printf("FAIL: ccmp encap failed\n");
goto bad;
@@ -660,7 +662,7 @@ runtest(struct ieee80211com *ic, struct 
/*
 * Decrypt frame; strip MIC.
 */
-   if (!cip->ic_decap(, m)) {
+   if (!cip->ic_decap(key, m, hdrlen)) {
printf("FAIL: ccmp decap failed\n");
printtest(t);
cmpfail(mtod(m, const void *), m->m_len,
@@ -680,17 +682,17 @@ runtest(struct ieee80211com *ic, struct 
printf("FAIL: decap botch; data does not compare\n");
printtest(t);
cmpfail(mtod(m, const void *), m->m_pkthdr.len,
-   t->plaintext, t_plaintext_len);
+   t->plaintext, t->plaintext_len);
goto bad;
}
m_freem(m);
-   ieee80211_crypto_delkey(ic, );
+   ieee80211_crypto_delkey(vap, key);
printf("PASS\n");
return 1;
 bad:
if (m != NULL)
m_freem(m);
-   ieee80211_crypto_delkey(ic, );
+   ieee80211_crypto_delkey(vap, key);
return 0;
 }
 
@@ -704,26 +706,38 @@ staticint debug = 0;
 static int
 init_crypto_ccmp_test(void)
 {
-#defineN(a)(sizeof(a)/sizeof(a[0]))
struct ieee80211com ic;
+   struct ieee80211vap vap;
+   struct ifnet ifp;
int i, pass, total;
 
memset(, 0, sizeof(ic));
-   if (debug)
-   ic.ic_debug = IEEE80211_MSG_CRYPTO;
+   memset(, 0, sizeof(vap));
+   memset(, 0, sizeof(ifp));
+
ieee80211_crypto_attach();
 
+   /* some minimal initialization */
+   strncpy(ifp.if_xname, "test_ccmp", sizeof(ifp.if_xname));
+   vap.iv_ic = 
+   vap.iv_ifp = 
+   if (debug)
+   vap.iv_debug