From 5187751e0018ab6f6bdf99da792bc092393854a0 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Tue, 10 May 2011 01:05:41 +0000 Subject: [PATCH 01/16] Regenerated with latest configure script. MFC after: 1 month --- usr.bin/less/defines.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr.bin/less/defines.h b/usr.bin/less/defines.h index bc1b7173f0c1..e9ee8c673f01 100644 --- a/usr.bin/less/defines.h +++ b/usr.bin/less/defines.h @@ -221,6 +221,9 @@ /* Define HAVE_FILENO if you have the fileno() macro. */ #define HAVE_FILENO 1 +/* Define HAVE_FLOAT if your compiler supports the "double" type. */ +#define HAVE_FLOAT 1 + /* Define to 1 if you have the `fsync' function. */ #define HAVE_FSYNC 1 @@ -388,6 +391,9 @@ /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "less" +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + /* Define to the version of this package. */ #define PACKAGE_VERSION "1" From e1e3c301894fa6e2cb612e8688bafef54a5c4694 Mon Sep 17 00:00:00 2001 From: Bruce M Simpson Date: Tue, 10 May 2011 02:34:11 +0000 Subject: [PATCH 02/16] Typo. For USB devices, 'serial' should be 'sernum'. See sys/dev/usb/usb_device.c for what devctl_notify() gets. --- sbin/devd/devd.conf.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index 61643a7afe3f..e4dea72fd317 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -283,7 +283,7 @@ Hub port number (USB) Product ID (pccard/USB). .It Li release Hardware revision (USB) -.It Li serial +.It Li sernum Serial Number (USB). .It Li slot Card slot. From 459d19e0fab14054e8f89f2810f20bf1a48d5042 Mon Sep 17 00:00:00 2001 From: Bruce M Simpson Date: Tue, 10 May 2011 02:38:44 +0000 Subject: [PATCH 03/16] Add VID for Simtec Electronics. Add PID for Simtec Electronics EntropyKey, a hardware random number generator. --- sys/dev/usb/usbdevs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 60d791cb0055..3d3dc46807c9 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -681,6 +681,7 @@ vendor HAUPPAUGE2 0x2040 Hauppauge Computer Works vendor TLAYTECH 0x20b9 Tlay Tech vendor ENCORE 0x203d Encore vendor PARA 0x20b8 PARA Industrial +vendor SIMTEC 0x20df Simtec Electronics vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola vendor TRIPPLITE 0x2478 Tripp-Lite @@ -2513,6 +2514,9 @@ product PANASONIC TYTP50P6S 0x3900 TY-TP50P6-S 50in Touch Panel /* PARA Industrial products */ product PARA RT3070 0x8888 RT3070 +/* Simtec Electronics products */ +product SIMTEC ENTROPYKEY 0x0001 Entropy Key + /* Pegatron products */ product PEGATRON RT2870 0x0002 RT2870 product PEGATRON RT3070 0x000c RT3070 From 12c5d1f2bf2a702ec411eed04b3217375944ddf3 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Tue, 10 May 2011 04:32:27 +0000 Subject: [PATCH 04/16] AR9285 (Kite) fixes. * Correct some of the silicon revision checks to match what the Atheros HAL does. (See [1] below.) * Move the PA cal and init cal method assignment to -after- the mac version/revision IDs are stored. The AR9285 init cal was never being called. * Enable ANI. Note Kite 1.0 and 1.1 were prototypes that shouldn't be seen in the wild. Linux ath9k simply removed the prototype code from their codebase. I'm going to leave it in there for now but make it conditionally compilable in the future. Obtained from: Atheros --- sys/dev/ath/ath_hal/ar9002/ar9285_attach.c | 39 ++++++++++++++++++---- sys/dev/ath/ath_hal/ar9002/ar9285_cal.c | 9 ++--- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c index 129f094079f5..b7ed27d21324 100644 --- a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c +++ b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c @@ -74,8 +74,33 @@ static void ar9285WriteIni(struct ath_hal *ah, static void ar9285AniSetup(struct ath_hal *ah) { - /* NB: disable ANI for reliable RIFS rx */ - ar5416AniAttach(ah, AH_NULL, AH_NULL, AH_FALSE); + /* + * These are the parameters from the AR5416 ANI code; + * they likely need quite a bit of adjustment for the + * AR9285. + */ + static const struct ar5212AniParams aniparams = { + .maxNoiseImmunityLevel = 4, /* levels 0..4 */ + .totalSizeDesired = { -55, -55, -55, -55, -62 }, + .coarseHigh = { -14, -14, -14, -14, -12 }, + .coarseLow = { -64, -64, -64, -64, -70 }, + .firpwr = { -78, -78, -78, -78, -80 }, + .maxSpurImmunityLevel = 2, + .cycPwrThr1 = { 2, 4, 6 }, + .maxFirstepLevel = 2, /* levels 0..2 */ + .firstep = { 0, 4, 8 }, + .ofdmTrigHigh = 500, + .ofdmTrigLow = 200, + .cckTrigHigh = 200, + .cckTrigLow = 100, + .rssiThrHigh = 40, + .rssiThrLow = 7, + .period = 100, + }; + /* NB: disable ANI noise immmunity for reliable RIFS rx */ + AH5416(ah)->ah_ani_function &= ~ HAL_ANI_NOISE_IMMUNITY_LEVEL; + + ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE); } /* @@ -122,10 +147,6 @@ ar9285Attach(uint16_t devid, HAL_SOFTC sc, AH5416(ah)->ah_cal.adcDcCalInitData.calData = &ar9280_adc_init_dc_cal; AH5416(ah)->ah_cal.suppCals = ADC_GAIN_CAL | ADC_DC_CAL | IQ_MISMATCH_CAL; - if (AR_SREV_KITE_12_OR_LATER(ah)) - AH5416(ah)->ah_cal_initcal = ar9285InitCalHardware; - AH5416(ah)->ah_cal_pacal = ar9002_hw_pa_cal; - AH5416(ah)->ah_spurMitigate = ar9280SpurMitigate; AH5416(ah)->ah_writeIni = ar9285WriteIni; AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK; @@ -173,6 +194,12 @@ ar9285Attach(uint16_t devid, HAL_SOFTC sc, } ar5416AttachPCIE(ah); + /* Attach methods that require MAC version/revision info */ + if (AR_SREV_KITE_12_OR_LATER(ah)) + AH5416(ah)->ah_cal_initcal = ar9285InitCalHardware; + if (AR_SREV_KITE_11_OR_LATER(ah)) + AH5416(ah)->ah_cal_pacal = ar9002_hw_pa_cal; + ecode = ath_hal_v4kEepromAttach(ah); if (ecode != HAL_OK) goto bad; diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c b/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c index bcb5959c2cc7..f972ecb47f9d 100644 --- a/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c +++ b/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c @@ -60,13 +60,13 @@ ar9285_hw_pa_cal(struct ath_hal *ah, HAL_BOOL is_reset) { 0x7838, 0 }, }; - HALDEBUG(ah, HAL_DEBUG_PERCAL, "Running PA Calibration\n"); - /* PA CAL is not needed for high power solution */ if (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE, AH_NULL) == AR5416_EEP_TXGAIN_HIGH_POWER) return; + HALDEBUG(ah, HAL_DEBUG_PERCAL, "Running PA Calibration\n"); + for (i = 0; i < N(regList); i++) regList[i][1] = OS_REG_READ(ah, regList[i][0]); @@ -151,7 +151,7 @@ ar9285_hw_pa_cal(struct ath_hal *ah, HAL_BOOL is_reset) void ar9002_hw_pa_cal(struct ath_hal *ah, HAL_BOOL is_reset) { - if (AR_SREV_KITE_12_OR_LATER(ah)) { + if (AR_SREV_KITE_11_OR_LATER(ah)) { if (is_reset || !AH9285(ah)->pacal_info.skipcount) ar9285_hw_pa_cal(ah, is_reset); else @@ -260,7 +260,8 @@ HAL_BOOL ar9285InitCalHardware(struct ath_hal *ah, const struct ieee80211_channel *chan) { - if (! ar9285_hw_clc(ah, chan)) + if (AR_SREV_KITE(ah) && AR_SREV_KITE_10_OR_LATER(ah) && + (! ar9285_hw_clc(ah, chan))) return AH_FALSE; return AH_TRUE; From 4b89ae574cc5a147984ec1172d1af7fbcbfefeaa Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 10 May 2011 10:48:43 +0000 Subject: [PATCH 05/16] Another fallout from r220359: MK_GNU_CPIO was mistakenly re-added after being removed in r205702. Remove it again. --- share/mk/bsd.own.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 8b9dcf88f418..f8148cb4cb99 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -394,7 +394,6 @@ __DEFAULT_NO_OPTIONS = \ BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ - GNU_CPIO \ HESIOD \ ICONV \ IDEA \ @@ -405,7 +404,7 @@ __DEFAULT_NO_OPTIONS = \ # this means that we have to test TARGET_ARCH (the buildworld case) as well # as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not # used at all in bsd.*.mk, but we have to make an exception here if we want -# to allow defaults for some things like clang and ftd to vary by target +# to allow defaults for some things like clang and fdt to vary by target # architecture. # .if defined(TARGET_ARCH) From 9fc9ddee092fe25ffabe10302cc12250b03913e4 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Tue, 10 May 2011 10:58:57 +0000 Subject: [PATCH 06/16] Flush the scriptfile whenever we see a non-graphical character to get more real-time logging, without forcing a write(2) on every single character. --- usr.bin/tip/tip/tipout.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/usr.bin/tip/tip/tipout.c b/usr.bin/tip/tip/tipout.c index 42fc4a214e4f..3dff3bd36841 100644 --- a/usr.bin/tip/tip/tipout.c +++ b/usr.bin/tip/tip/tipout.c @@ -170,12 +170,18 @@ tipout(void) if (boolean(value(SCRIPT)) && fscript != NULL) { if (!boolean(value(BEAUTIFY))) { fwrite(buf, 1, cnt, fscript); - continue; + } else { + for (cp = buf; cp < buf + cnt; cp++) + if ((*cp >= ' ' && *cp <= '~') || + any(*cp, value(EXCEPTIONS))) + putc(*cp, fscript); + } + for (cp = buf; cp < buf + cnt; cp++) { + if (!isgraph(*cp)) { + fflush(fscript); + break; + } } - for (cp = buf; cp < buf + cnt; cp++) - if ((*cp >= ' ' && *cp <= '~') || - any(*cp, value(EXCEPTIONS))) - putc(*cp, fscript); } } } From 56c14fc8c51bc3cd0c89a3d17b0ef332d5d345da Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 10 May 2011 11:00:40 +0000 Subject: [PATCH 07/16] Removed unsupported options MK_BINUTILS and MK_GCC that were silently added in r218936. --- share/mk/bsd.own.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index f8148cb4cb99..cbbe7c92d71e 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -297,7 +297,6 @@ __DEFAULT_YES_OPTIONS = \ BIND_MTREE \ BIND_NAMED \ BIND_UTILS \ - BINUTILS \ BLUETOOTH \ BOOT \ BSD_CPIO \ @@ -318,7 +317,6 @@ __DEFAULT_YES_OPTIONS = \ FP_LIBC \ FREEBSD_UPDATE \ GAMES \ - GCC \ GCOV \ GDB \ GNU \ From 37730efb9adfed28a61ba51cb76296f85810eff1 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 10 May 2011 11:06:14 +0000 Subject: [PATCH 08/16] The Objective C support was removed in r220755. Submitted by: des --- tools/build/options/WITHOUT_OBJC | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 tools/build/options/WITHOUT_OBJC diff --git a/tools/build/options/WITHOUT_OBJC b/tools/build/options/WITHOUT_OBJC deleted file mode 100644 index 3a220ac06db9..000000000000 --- a/tools/build/options/WITHOUT_OBJC +++ /dev/null @@ -1,2 +0,0 @@ -.\" $FreeBSD$ -Set to not build Objective C support. From 2701a1b7a1e716aef71b266fb55c842281e8ade9 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 10 May 2011 11:14:40 +0000 Subject: [PATCH 09/16] - There now exist options that have different defaults depending on the architecture, reflect this in documentation. For such options, both WITH_FOO and WITHOUT_FOO description files should be provided. Prodded by: des - Setting a build option may enforce other build options, try harder to detect this case. - Setting a build option may change other option's default value, try harder to detect this case. --- tools/build/options/WITH_CLANG | 2 + tools/build/options/WITH_FDT | 3 + tools/build/options/makeman | 185 ++++++++++++++++++++++++--------- 3 files changed, 140 insertions(+), 50 deletions(-) create mode 100644 tools/build/options/WITH_CLANG create mode 100644 tools/build/options/WITH_FDT diff --git a/tools/build/options/WITH_CLANG b/tools/build/options/WITH_CLANG new file mode 100644 index 000000000000..b0e300a488b1 --- /dev/null +++ b/tools/build/options/WITH_CLANG @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build the Clang C/C++ compiler. diff --git a/tools/build/options/WITH_FDT b/tools/build/options/WITH_FDT new file mode 100644 index 000000000000..b812e3b33dc8 --- /dev/null +++ b/tools/build/options/WITH_FDT @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build Flattened Device Tree support as part of the base system. +This includes the device tree compiler (dtc) and libfdt support library. diff --git a/tools/build/options/makeman b/tools/build/options/makeman index 68ed87bead81..99c892ed4a3f 100755 --- a/tools/build/options/makeman +++ b/tools/build/options/makeman @@ -2,34 +2,98 @@ # # This file is in the public domain. +set -o errexit + ident='$FreeBSD$' +t=$(mktemp -d -t makeman) +trap 'test -d $t && rm -rf $t' exit + # -# usage: show { settings | options } ... +# usage: no_targets all_targets yes_targets +# +no_targets() +{ + for t1 in $1 ; do + for t2 in $2 ; do + if [ "${t1}" = "${t2}" ] ; then + continue 2 + fi + done + echo ${t1} + done +} + +show_options() +{ + ALL_TARGETS=$(echo $(make -C ../../.. targets | tail -n +2)) + rm -f $t/settings + for target in ${ALL_TARGETS} ; do + make -C ../../.. showconfig \ + SRCCONF=/dev/null __MAKE_CONF=/dev/null \ + TARGET_ARCH=${target#*/} TARGET=${target%/*} | + while read var _ val ; do + opt=${var#MK_} + case ${val} in + yes) + echo ${opt} ${target} + ;; + no) + echo ${opt} + ;; + *) + echo 'make showconfig broken' >&2 + exit 1 + ;; + esac + done > $t/settings.target + if [ -r $t/settings ] ; then + join -t\ $t/settings $t/settings.target > $t/settings.new + mv $t/settings.new $t/settings + else + mv $t/settings.target $t/settings + fi + done + + cat $t/settings | while read opt targets ; do + if [ "${targets}" = "${ALL_TARGETS}" ] ; then + echo "WITHOUT_${opt}" + elif [ -z "${targets}" ] ; then + echo "WITH_${opt}" + else + echo "WITHOUT_${opt}" $(no_targets "${ALL_TARGETS}" "${targets}") + echo "WITH_${opt} ${targets}" + fi + done +} + +# +# usage: show { settings | with | without } ... # show() { - mode=$1; shift + mode=$1 ; shift case ${mode} in settings) yes_prefix=WITH no_prefix=WITHOUT ;; - options) - yes_prefix=WITHOUT + with) + yes_prefix=WITH no_prefix=WITH ;; + without) + yes_prefix=WITHOUT + no_prefix=WITHOUT + ;; *) - echo "internal error" >/dev/stderr + echo 'internal error' >&2 exit 1 ;; esac - ( - cd ../../.. - make "$@" showconfig SRCCONF=/dev/null __MAKE_CONF=/dev/null - ) | - while read var _ val; do + make -C ../../.. "$@" showconfig __MAKE_CONF=/dev/null | + while read var _ val ; do opt=${var#MK_} case ${val} in yes) @@ -39,7 +103,7 @@ show() echo ${no_prefix}_${opt} ;; *) - echo "make showconfig broken" >/dev/stderr + echo 'make showconfig broken' >&2 exit 1 ;; esac @@ -49,7 +113,6 @@ show() main() { - trap 'rm -f _defcfg _config _config2 _deps _deps2' exit ident=${ident#$} ident=${ident% $} fbsdid='$'FreeBSD'$' @@ -57,7 +120,7 @@ main() .\" DO NOT EDIT-- this file is automatically generated. .\" from ${ident} .\" ${fbsdid} -.Dd $(LC_TIME=C date +'%B %e, %Y') +.Dd $(echo $(LC_TIME=C date +'%B %e, %Y')) .Dt SRC.CONF 5 .Os .Sh NAME @@ -134,46 +197,68 @@ The following list provides a name and short description for variables that can be used for source builds. .Bl -tag -width indent EOF - show settings |sort >_defcfg - show options | - while read opt; do - if [ -f ${opt} ]; then - cat </dev/stderr + show settings SRCCONF=/dev/null | sort > $t/config_default + show with SRCCONF=/dev/null | sort > $t/config_WITH_ALL + show without SRCCONF=/dev/null | sort > $t/config_WITHOUT_ALL + + show_options | + while read opt targets ; do + if [ ! -f ${opt} ] ; then + echo "no description found for ${opt}, skipping" >&2 continue + else + echo ".It Va ${opt}" + sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt} + if [ -n "${targets}" ] ; then + echo '.Pp' + echo 'It is a default setting on' + echo $(echo ${targets} | sed -e's/ /, /g' -e's/\(.*\), /\1 and /'). + fi fi - show settings -D${opt} |sort >_config - comm -13 _defcfg _config |grep -v "^${opt}$" >_deps - if [ -s _deps ]; then - cat <_config2 - comm -13 _config _config2 >_deps2 - if [ -s _deps2 ]; then - cat < $t/src.conf + show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITH_ALL_${opt} + comm -13 $t/config_WITH_ALL $t/config_WITH_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps + elif [ "${opt%%_*}" = "WITH" ] ; then + sed -n "/^WITHOUT${opt#WITH}$/!s/$/=/p" $t/config_WITHOUT_ALL > $t/src.conf + show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITHOUT_ALL_${opt} + comm -13 $t/config_WITHOUT_ALL $t/config_WITHOUT_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps + else + echo 'internal error' >&2 + exit 1 + fi + + if [ -s $t/deps ] ; then + echo 'When set, it also enforces the following options:' + echo '.Pp' + echo '.Bl -item -compact' + cat $t/deps | while read opt2 ; do + echo '.It' + echo ".Va ${opt2}" done - cat < $t/config_${opt} + comm -13 $t/config_default $t/config_${opt} | sed -n "/^${opt}$/!p" | + comm -13 $t/deps - > $t/deps2 + + if [ -s $t/deps2 ] ; then + if [ -s $t/deps ] ; then + echo '.Pp' + fi + echo 'When set, the following options are also in effect:' + echo '.Pp' + echo '.Bl -inset -compact' + cat $t/deps2 | while read opt2 ; do + echo ".It Va ${opt2}" + noopt=$(echo ${opt2} | sed -e's/WITH_/WITHOUT_/;t' -e's/WITHOUT_/WITH_/') + echo '(unless' + echo ".Va ${noopt}" + echo 'is set explicitly)' + done + echo '.El' fi done cat < Date: Tue, 10 May 2011 12:40:35 +0000 Subject: [PATCH 10/16] Add an entry for the SIIG Quartet Serial 850 which uses an Oxford chip with a non-default clock. PR: kern/147583 MFC after: 1 week --- sys/dev/puc/pucdata.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/puc/pucdata.c b/sys/dev/puc/pucdata.c index 4d19ddae2838..6b1dedaa5aef 100644 --- a/sys/dev/puc/pucdata.c +++ b/sys/dev/puc/pucdata.c @@ -638,6 +638,12 @@ const struct puc_cfg puc_pci_devices[] = { PUC_PORT_4S, 0x10, 0, 8, }, + { 0x1415, 0x9501, 0x131f, 0x2052, + "SIIG Quartet Serial 850", + DEFAULT_RCLK * 10, + PUC_PORT_4S, 0x10, 0, 8, + }, + { 0x1415, 0x9501, 0x14db, 0x2150, "Kuroutoshikou SERIAL4P-LPPCI2", DEFAULT_RCLK * 10, From cae68bef117ef7af964af88470e62b2fcb34ed43 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 10 May 2011 12:57:39 +0000 Subject: [PATCH 11/16] Style. --- tools/build/options/makeman | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/build/options/makeman b/tools/build/options/makeman index 99c892ed4a3f..ca69f1b7a96d 100755 --- a/tools/build/options/makeman +++ b/tools/build/options/makeman @@ -206,21 +206,21 @@ EOF if [ ! -f ${opt} ] ; then echo "no description found for ${opt}, skipping" >&2 continue - else - echo ".It Va ${opt}" - sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt} - if [ -n "${targets}" ] ; then - echo '.Pp' - echo 'It is a default setting on' - echo $(echo ${targets} | sed -e's/ /, /g' -e's/\(.*\), /\1 and /'). - fi fi - if [ "${opt%%_*}" = "WITHOUT" ] ; then + echo ".It Va ${opt}" + sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt} + if [ -n "${targets}" ] ; then + echo '.Pp' + echo 'It is a default setting on' + echo $(echo ${targets} | sed -e's/ /, /g' -e's/\(.*\), /\1 and /'). + fi + + if [ "${opt%%_*}" = 'WITHOUT' ] ; then sed -n "/^WITH_${opt#WITHOUT_}$/!s/$/=/p" $t/config_WITH_ALL > $t/src.conf show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITH_ALL_${opt} comm -13 $t/config_WITH_ALL $t/config_WITH_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps - elif [ "${opt%%_*}" = "WITH" ] ; then + elif [ "${opt%%_*}" = 'WITH' ] ; then sed -n "/^WITHOUT${opt#WITH}$/!s/$/=/p" $t/config_WITHOUT_ALL > $t/src.conf show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITHOUT_ALL_${opt} comm -13 $t/config_WITHOUT_ALL $t/config_WITHOUT_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps From e6a714e703732b32dfb6a62c9a84cdb7cc8e5d75 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 10 May 2011 13:01:11 +0000 Subject: [PATCH 12/16] Reassurance for impatient. --- tools/build/options/makeman | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/build/options/makeman b/tools/build/options/makeman index ca69f1b7a96d..d29fe0a20920 100755 --- a/tools/build/options/makeman +++ b/tools/build/options/makeman @@ -260,6 +260,7 @@ EOF done echo '.El' fi + twiddle >&2 done cat < Date: Tue, 10 May 2011 13:25:42 +0000 Subject: [PATCH 13/16] Regen. --- share/man/man5/src.conf.5 | 111 +++++++++++++++++++++++++------------- 1 file changed, 75 insertions(+), 36 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 88133dbdcc40..96561b742f9e 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: head/tools/build/options/makeman 221161 2011-04-28 11:21:49Z des +.\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd April 30, 2011 +.Dd May 10, 2011 .Dt SRC.CONF 5 .Os .Sh NAME @@ -78,9 +78,9 @@ The following list provides a name and short description for variables that can be used for source builds. .Bl -tag -width indent .It Va WITHOUT_ACCT -.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 221540 2011-05-06 19:13:03Z ru Set to not build process accounting tools such as -.Xr ac 8 +.Xr ac 8 and .Xr accton 8 . .It Va WITHOUT_ACPI @@ -132,6 +132,8 @@ When set, it also enforces the following options: .It .Va WITHOUT_BIND_ETC .It +.Va WITHOUT_BIND_LIBS +.It .Va WITHOUT_BIND_LIBS_LWRES .It .Va WITHOUT_BIND_MTREE @@ -253,6 +255,15 @@ When set, it also enforces the following options: .It Va WITHOUT_CLANG .\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG 208971 2010-06-10 06:20:26Z ed Set to not build the Clang C/C++ compiler. +.Pp +It is a default setting on +arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb, powerpc/powerpc64, sparc64/sparc64 and sun4v/sparc64. +.It Va WITH_CLANG +.\" from FreeBSD: head/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru +Set to build the Clang C/C++ compiler. +.Pp +It is a default setting on +amd64/amd64, i386/i386, pc98/i386 and powerpc/powerpc. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build @@ -264,10 +275,6 @@ When set, it also enforces the following options: .Pp .Bl -item -compact .It -.Va WITHOUT_GSSAPI -(can be overridden with -.Va WITH_GSSAPI ) -.It .Va WITHOUT_KERBEROS .It .Va WITHOUT_KERBEROS_SUPPORT @@ -276,6 +283,15 @@ When set, it also enforces the following options: .It .Va WITHOUT_OPENSSL .El +.Pp +When set, the following options are also in effect: +.Pp +.Bl -inset -compact +.It Va WITHOUT_GSSAPI +(unless +.Va WITH_GSSAPI +is set explicitly) +.El .It Va WITHOUT_CTM .\" from FreeBSD: head/tools/build/options/WITHOUT_CTM 183242 2008-09-21 22:02:26Z sam Set to not build @@ -285,7 +301,7 @@ and related utilities. .\" from FreeBSD: head/tools/build/options/WITHOUT_CVS 156932 2006-03-21 07:50:50Z ru Set to not build CVS. .It Va WITHOUT_CXX -.\" from FreeBSD: head/tools/build/options/WITHOUT_CXX 220401 2011-04-06 20:08:23Z uqs +.\" from FreeBSD: head/tools/build/options/WITHOUT_CXX 220402 2011-04-06 20:19:07Z uqs Set to not build .Xr g++ 1 and related libraries. @@ -316,12 +332,22 @@ dynamically. Set to avoid installing examples to .Pa /usr/share/examples/ . .It Va WITHOUT_FDT -.\" from FreeBSD: head/tools/build/options/WITHOUT_FDT 218942 2011-02-22 08:20:12Z uqs -Set to not build Flattened Device Tree support as part of the base system. This -includes the device tree compiler (dtc) and libfdt support library. +.\" from FreeBSD: head/tools/build/options/WITHOUT_FDT 221539 2011-05-06 19:10:27Z ru +Set to not build Flattened Device Tree support as part of the base system. +This includes the device tree compiler (dtc) and libfdt support library. +.Pp +It is a default setting on +amd64/amd64, i386/i386, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb, pc98/i386, powerpc/powerpc64, sparc64/sparc64 and sun4v/sparc64. +.It Va WITH_FDT +.\" from FreeBSD: head/tools/build/options/WITH_FDT 221730 2011-05-10 11:14:40Z ru +Set to build Flattened Device Tree support as part of the base system. +This includes the device tree compiler (dtc) and libfdt support library. +.Pp +It is a default setting on +arm/arm, arm/armeb and powerpc/powerpc. .It Va WITHOUT_FLOPPY -.\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 183306 2008-09-23 16:15:42Z sam -Set to not build or install programs +.\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru +Set to not build or install programs for operating floppy disk driver. .It Va WITHOUT_FORTH .\" from FreeBSD: head/tools/build/options/WITHOUT_FORTH 156932 2006-03-21 07:50:50Z ru @@ -367,9 +393,11 @@ Set to build some programs without optional GNU support. .It Va WITHOUT_GPIB .\" from FreeBSD: head/tools/build/options/WITHOUT_GPIB 156932 2006-03-21 07:50:50Z ru Set to not build GPIB bus support. -.It Va WITH_GPIO -.\" from FreeBSD: head/tools/build/options/WITH_GPIO 213463 2010-10-05 22:26:01Z gonzo -Set to build gpioctl(8) as part of the base system. +.It Va WITHOUT_GPIO +.\" from FreeBSD: head/tools/build/options/WITHOUT_GPIO 221541 2011-05-06 19:14:06Z ru +Set to not build +.Xr gpioctl 8 +as part of the base system. .It Va WITHOUT_GROFF .\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs Set to not build @@ -398,7 +426,7 @@ It is .Em "YOUR RESPONSIBILITY" to determine if you can legally use IDEA. .It Va WITHOUT_INET -.\" $FreeBSD$ +.\" from FreeBSD: head/tools/build/options/WITHOUT_INET 221266 2011-04-30 17:58:28Z bz Set to not build programs and libraries related to IPv4 networking. When set, it also enforces the following options: .Pp @@ -420,7 +448,7 @@ When set, it also enforces the following options: .\" from FreeBSD: head/tools/build/options/WITHOUT_INET6_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build libraries, programs, and kernel modules without IPv6 support. .It Va WITHOUT_INET_SUPPORT -.\" $FreeBSD$ +.\" from FreeBSD: head/tools/build/options/WITHOUT_INET_SUPPORT 221266 2011-04-30 17:58:28Z bz Set to build libraries, programs, and kernel modules without IPv4 support. .It Va WITHOUT_INFO .\" from FreeBSD: head/tools/build/options/WITHOUT_INFO 156932 2006-03-21 07:50:50Z ru @@ -464,12 +492,17 @@ When set, it also enforces the following options: .Pp .Bl -item -compact .It -.Va WITHOUT_GSSAPI -(can be overridden with -.Va WITH_GSSAPI ) -.It .Va WITHOUT_KERBEROS_SUPPORT .El +.Pp +When set, the following options are also in effect: +.Pp +.Bl -inset -compact +.It Va WITHOUT_GSSAPI +(unless +.Va WITH_GSSAPI +is set explicitly) +.El .It Va WITHOUT_KERBEROS_SUPPORT .\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without Kerberos support, like @@ -525,6 +558,8 @@ When set, it also enforces the following options: .It .Va WITHOUT_BIND_ETC .It +.Va WITHOUT_BIND_LIBS +.It .Va WITHOUT_BIND_LIBS_LWRES .It .Va WITHOUT_BIND_MTREE @@ -551,6 +586,8 @@ When set, it also enforces the following options: .It .Va WITHOUT_BIND_ETC .It +.Va WITHOUT_BIND_LIBS +.It .Va WITHOUT_BIND_LIBS_LWRES .It .Va WITHOUT_BIND_MTREE @@ -597,13 +634,13 @@ and related support files. .It Va WITHOUT_MAN .\" from FreeBSD: head/tools/build/options/WITHOUT_MAN 156932 2006-03-21 07:50:50Z ru Set to not build manual pages. -When set, it also enforces the following options: +When set, the following options are also in effect: .Pp -.Bl -item -compact -.It -.Va WITHOUT_MAN_UTILS -(can be overridden with -.Va WITH_MAN_UTILS ) +.Bl -inset -compact +.It Va WITHOUT_MAN_UTILS +(unless +.Va WITH_MAN_UTILS +is set explicitly) .El .It Va WITHOUT_MAN_UTILS .\" from FreeBSD: head/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim @@ -675,9 +712,6 @@ will not be built either if this option is set. Set to not build .Xr ntpd 8 and related programs. -.It Va WITHOUT_OBJC -.\" from FreeBSD: head/tools/build/options/WITHOUT_OBJC 156932 2006-03-21 07:50:50Z ru -Set to not build Objective C support. .It Va WITHOUT_OPENSSH .\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru Set to not build OpenSSH. @@ -688,16 +722,21 @@ When set, it also enforces the following options: .Pp .Bl -item -compact .It -.Va WITHOUT_GSSAPI -(can be overridden with -.Va WITH_GSSAPI ) -.It .Va WITHOUT_KERBEROS .It .Va WITHOUT_KERBEROS_SUPPORT .It .Va WITHOUT_OPENSSH .El +.Pp +When set, the following options are also in effect: +.Pp +.Bl -inset -compact +.It Va WITHOUT_GSSAPI +(unless +.Va WITH_GSSAPI +is set explicitly) +.El .It Va WITHOUT_PAM .\" from FreeBSD: head/tools/build/options/WITHOUT_PAM 174550 2007-12-12 16:43:17Z ru Set to not build PAM library and modules. From 919f46b349c27808f08e82be23bab647c07911dd Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Tue, 10 May 2011 14:03:05 +0000 Subject: [PATCH 14/16] Only try to set up IPIs at boot on systems that actually have more than one CPU. This fixes a panic observed on Heathrow-based systems without SMP-capable PICs when the kernel had both options SMP and INVARIANTS. MFC after: 5 days --- sys/powerpc/powerpc/intr_machdep.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c index b76ca41304ff..f2bfa33f2615 100644 --- a/sys/powerpc/powerpc/intr_machdep.c +++ b/sys/powerpc/powerpc/intr_machdep.c @@ -397,18 +397,22 @@ powerpc_enable_intr(void) #ifdef SMP /* Install an IPI handler. */ - for (n = 0; n < npics; n++) { - if (piclist[n].dev != root_pic) - continue; + if (mp_ncpus > 1) { + for (n = 0; n < npics; n++) { + if (piclist[n].dev != root_pic) + continue; - KASSERT(piclist[n].ipis != 0, ("%s", __func__)); - error = powerpc_setup_intr("IPI", - MAP_IRQ(piclist[n].node, piclist[n].irqs), - powerpc_ipi_handler, NULL, NULL, - INTR_TYPE_MISC | INTR_EXCL, &ipi_cookie); - if (error) { - printf("unable to setup IPI handler\n"); - return (error); + KASSERT(piclist[n].ipis != 0, + ("%s: SMP root PIC does not supply any IPIs", + __func__)); + error = powerpc_setup_intr("IPI", + MAP_IRQ(piclist[n].node, piclist[n].irqs), + powerpc_ipi_handler, NULL, NULL, + INTR_TYPE_MISC | INTR_EXCL, &ipi_cookie); + if (error) { + printf("unable to setup IPI handler\n"); + return (error); + } } } #endif From d9b8935fb95ec58621ca6c2bb657809b4f7b12d0 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Tue, 10 May 2011 15:05:27 +0000 Subject: [PATCH 15/16] dtrace: remove unused code Which is also useless, IMO. MFC after: 5 days --- sys/cddl/dev/dtrace/amd64/dtrace_subr.c | 22 +--------------------- sys/cddl/dev/dtrace/i386/dtrace_subr.c | 22 +--------------------- 2 files changed, 2 insertions(+), 42 deletions(-) diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c index 102ea0495aff..a081f6701ac2 100644 --- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c @@ -358,26 +358,6 @@ static uint64_t nsec_scale; /* See below for the explanation of this macro. */ #define SCALE_SHIFT 28 -static void -dtrace_gethrtime_init_sync(void *arg) -{ -#ifdef CHECK_SYNC - /* - * Delay this function from returning on one - * of the CPUs to check that the synchronisation - * works. - */ - uintptr_t cpu = (uintptr_t) arg; - - if (cpu == curcpu) { - int i; - for (i = 0; i < 1000000000; i++) - tgt_cpu_tsc = rdtsc(); - tgt_cpu_tsc = 0; - } -#endif -} - static void dtrace_gethrtime_init_cpu(void *arg) { @@ -434,7 +414,7 @@ dtrace_gethrtime_init(void *arg) pc = pcpu_find(i); map = PCPU_GET(cpumask) | pc->pc_cpumask; - smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync, + smp_rendezvous_cpus(map, NULL, dtrace_gethrtime_init_cpu, smp_no_rendevous_barrier, (void *)(uintptr_t) i); diff --git a/sys/cddl/dev/dtrace/i386/dtrace_subr.c b/sys/cddl/dev/dtrace/i386/dtrace_subr.c index 50793c4da4fc..2753ffc5bbf8 100644 --- a/sys/cddl/dev/dtrace/i386/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/i386/dtrace_subr.c @@ -358,26 +358,6 @@ static uint64_t nsec_scale; /* See below for the explanation of this macro. */ #define SCALE_SHIFT 28 -static void -dtrace_gethrtime_init_sync(void *arg) -{ -#ifdef CHECK_SYNC - /* - * Delay this function from returning on one - * of the CPUs to check that the synchronisation - * works. - */ - uintptr_t cpu = (uintptr_t) arg; - - if (cpu == curcpu) { - int i; - for (i = 0; i < 1000000000; i++) - tgt_cpu_tsc = rdtsc(); - tgt_cpu_tsc = 0; - } -#endif -} - static void dtrace_gethrtime_init_cpu(void *arg) { @@ -434,7 +414,7 @@ dtrace_gethrtime_init(void *arg) pc = pcpu_find(i); map = PCPU_GET(cpumask) | pc->pc_cpumask; - smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync, + smp_rendezvous_cpus(map, NULL, dtrace_gethrtime_init_cpu, smp_no_rendevous_barrier, (void *)(uintptr_t) i); From e33d2007d134792a8fe9dc74a3b896a686890ddf Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Tue, 10 May 2011 15:08:13 +0000 Subject: [PATCH 16/16] bitcount32: replace lengthy comment with a reference to SWAR MFC after: 5 days --- sys/sys/systm.h | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/sys/sys/systm.h b/sys/sys/systm.h index edd59c4a21be..80fb0a93fef6 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -374,44 +374,8 @@ int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); /* - * This is about as magic as it gets. fortune(1) has got similar code - * for reversing bits in a word. Who thinks up this stuff?? - * - * Yes, it does appear to be consistently faster than: - * while (i = ffs(m)) { - * m >>= i; - * bits++; - * } - * and - * while (lsb = (m & -m)) { // This is magic too - * m &= ~lsb; // or: m ^= lsb - * bits++; - * } - * Both of these latter forms do some very strange things on gcc-3.1 with - * -mcpu=pentiumpro and/or -march=pentiumpro and/or -O or -O2. - * There is probably an SSE or MMX popcnt instruction. - * - * I wonder if this should be in libkern? - * - * XXX Stop the presses! Another one: - * static __inline u_int32_t - * popcnt1(u_int32_t v) - * { - * v -= ((v >> 1) & 0x55555555); - * v = (v & 0x33333333) + ((v >> 2) & 0x33333333); - * v = (v + (v >> 4)) & 0x0F0F0F0F; - * return (v * 0x01010101) >> 24; - * } - * The downside is that it has a multiply. With a pentium3 with - * -mcpu=pentiumpro and -march=pentiumpro then gcc-3.1 will use - * an imull, and in that case it is faster. In most other cases - * it appears slightly slower. - * - * Another variant (also from fortune): - * #define BITCOUNT(x) (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255) - * #define BX_(x) ((x) - (((x)>>1)&0x77777777) \ - * - (((x)>>2)&0x33333333) \ - * - (((x)>>3)&0x11111111)) + * Population count algorithm using SWAR approach + * - "SIMD Within A Register". */ static __inline uint32_t bitcount32(uint32_t x)