svn commit: r325093 - in head/sys/boot: . efi/boot1 efi/fdt efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm64 efi/loader/arch/i386

2017-10-28 Thread Warner Losh
Author: imp
Date: Sun Oct 29 05:26:59 2017
New Revision: 325093
URL: https://svnweb.freebsd.org/changeset/base/325093

Log:
  Define new EFI variables
  
  Define EFISRC, EFIINC and EFIINCMD. Use them, as well as using other
  symbols defined in defs.mk. Prefer  to ../../Makefile.inc
  or .
  
  Sponsored by: Netflix

Modified:
  head/sys/boot/defs.mk
  head/sys/boot/efi/boot1/Makefile
  head/sys/boot/efi/fdt/Makefile
  head/sys/boot/efi/libefi/Makefile
  head/sys/boot/efi/loader/Makefile
  head/sys/boot/efi/loader/arch/amd64/Makefile.inc
  head/sys/boot/efi/loader/arch/arm64/Makefile.inc
  head/sys/boot/efi/loader/arch/i386/Makefile.inc

Modified: head/sys/boot/defs.mk
==
--- head/sys/boot/defs.mk   Sun Oct 29 04:53:33 2017(r325092)
+++ head/sys/boot/defs.mk   Sun Oct 29 05:26:59 2017(r325093)
@@ -6,6 +6,9 @@
 __BOOT_DEFS_MK__=${MFILE}
 
 BOOTSRC=   ${SRCTOP}/sys/boot
+EFISRC=${BOOTSRC}/efi
+EFIINC=${EFISRC}/include
+EFIINCMD=  ${EFIINC}/${MACHINE}
 FDTSRC=${BOOTSRC}/fdt
 FICLSRC=   ${BOOTSRC}/ficl
 LDRSRC=${BOOTSRC}/common

Modified: head/sys/boot/efi/boot1/Makefile
==
--- head/sys/boot/efi/boot1/MakefileSun Oct 29 04:53:33 2017
(r325092)
+++ head/sys/boot/efi/boot1/MakefileSun Oct 29 05:26:59 2017
(r325093)
@@ -2,7 +2,7 @@
 
 MAN=
 
-.include "../Makefile.inc"
+.include 
 
 MK_SSP=no
 MK_FORTH=  no
@@ -40,7 +40,7 @@ SRCS+=zfs_module.c
 SRCS+= skein.c skein_block.c
 # Do not unroll skein loops, reduce code size
 CFLAGS+=   -DSKEIN_LOOP=111
-.PATH: ${.CURDIR}/../../../crypto/skein
+.PATH: ${SYSDIR}/crypto/skein
 .endif
 
 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201
@@ -48,32 +48,32 @@ CWARNFLAGS.self_reloc.c+=   -Wno-error=maybe-uninitializ
 .endif
 
 CFLAGS+=   -I.
-CFLAGS+=   -I${.CURDIR}/../include
-CFLAGS+=   -I${.CURDIR}/../include/${MACHINE}
-CFLAGS+=   -I${.CURDIR}/../../../contrib/dev/acpica/include
-CFLAGS+=   -I${.CURDIR}/../../..
+CFLAGS+=   -I${EFIINC}
+CFLAGS+=   -I${EFIINCMD}
+CFLAGS+=   -I${SYSDIR}/contrib/dev/acpica/include
+CFLAGS+=   -I${SYSDIR}
 CFLAGS+=   -DEFI_UFS_BOOT
 .ifdef(EFI_DEBUG)
 CFLAGS+=   -DEFI_DEBUG
 .endif
 
 .if ${MK_ZFS} != "no"
-CFLAGS+=   -I${.CURDIR}/../../zfs/
-CFLAGS+=   -I${.CURDIR}/../../../cddl/boot/zfs/
-CFLAGS+=   -I${.CURDIR}/../../../crypto/skein
+CFLAGS+=   -I${BOOTSRC}/zfs/
+CFLAGS+=   -I${SYSDIR}/cddl/boot/zfs/
+CFLAGS+=   -I${SYSDIR}/crypto/skein
 CFLAGS+=   -DEFI_ZFS_BOOT
 .endif
 
 # Always add MI sources and REGULAR efi loader bits
-.PATH: ${.CURDIR}/../loader/arch/${MACHINE}
-.PATH: ${.CURDIR}/../loader
-.PATH: ${.CURDIR}/../../common
-CFLAGS+=   -I${.CURDIR}/../../common
+.PATH: ${EFISRC}/loader/arch/${MACHINE}
+.PATH: ${EFISRC}/loader
+.PATH: ${LDRSRC}
+CFLAGS+=   -I${LDRSRC}
 
 FILES= boot1.efi boot1.efifat
 FILESMODE_boot1.efi=   ${BINMODE}
 
-LDSCRIPT=  ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE}
+LDSCRIPT=  ${EFISRC}/loader/arch/${MACHINE}/ldscript.${MACHINE}
 LDFLAGS+=  -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared
 
 .if ${MACHINE_CPUARCH} == "aarch64"
@@ -84,7 +84,7 @@ CFLAGS+=  -fPIC
 LDFLAGS+=  -Wl,-znocombreloc
 .endif
 
-LIBEFI=${.OBJDIR}/../libefi/libefi.a
+LIBEFI=${BOOTOBJ}/efi/libefi/libefi.a
 
 #
 # Add libstand for the runtime functions used by the compiler - for example
@@ -148,12 +148,12 @@ beforedepend ${OBJS}: machine
 CLEANFILES+=   machine
 
 machine: .NOMETA
-   ln -sf ${.CURDIR}/../../../${MACHINE}/include machine
+   ln -sf ${SYSDIR}/${MACHINE}/include machine
 
 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
 beforedepend ${OBJS}: x86
 CLEANFILES+=   x86
 
 x86: .NOMETA
-   ln -sf ${.CURDIR}/../../../x86/include x86
+   ln -sf ${SYSDIR}/x86/include x86
 .endif

Modified: head/sys/boot/efi/fdt/Makefile
==
--- head/sys/boot/efi/fdt/Makefile  Sun Oct 29 04:53:33 2017
(r325092)
+++ head/sys/boot/efi/fdt/Makefile  Sun Oct 29 05:26:59 2017
(r325093)
@@ -1,8 +1,8 @@
 # $FreeBSD$
 
-.include 
+.include 
 
-.PATH: ${.CURDIR}/../../common
+.PATH: ${LDRSRC}
 
 LIB=   efi_fdt
 INTERNALLIB=
@@ -18,17 +18,17 @@ CFLAGS+=-msoft-float
 .endif
 
 # EFI library headers
-CFLAGS+=   -I${.CURDIR}/../include
-CFLAGS+=   -I${.CURDIR}/../include/${MACHINE}
+CFLAGS+=   -I${EFISRC}/include
+CFLAGS+=   -I${EFISRC}/include/${MACHINE}
 
 # libfdt headers
-CFLAGS+=   -I${.CURDIR}/../../fdt
+CFLAGS+=   -I${FDTSRC}
 
 # Pick up the bootstrap 

svn commit: r325094 - in head/sys/boot: . fdt ficl geli ofw/libofw uboot/fdt uboot/lib zfs

2017-10-28 Thread Warner Losh
Author: imp
Date: Sun Oct 29 05:27:22 2017
New Revision: 325094
URL: https://svnweb.freebsd.org/changeset/base/325094

Log:
  Cleanup non-arch Makefiles
  
  Use SYSDIR, BOOTSRC, LDRSRC and FDTSRC in preference to relative
  paths. Also, use bsd.init.mk where needed.
  
  Sponsored by: Netflix

Modified:
  head/sys/boot/fdt/Makefile
  head/sys/boot/ficl.mk
  head/sys/boot/ficl/Makefile
  head/sys/boot/geli/Makefile
  head/sys/boot/ofw/libofw/Makefile
  head/sys/boot/uboot/fdt/Makefile
  head/sys/boot/uboot/lib/Makefile
  head/sys/boot/zfs/Makefile

Modified: head/sys/boot/fdt/Makefile
==
--- head/sys/boot/fdt/Makefile  Sun Oct 29 05:26:59 2017(r325093)
+++ head/sys/boot/fdt/Makefile  Sun Oct 29 05:27:22 2017(r325094)
@@ -14,7 +14,7 @@ SRCS+=fdt.c fdt_ro.c fdt_wip.c fdt_sw.c 
fdt_rw.c fdt
 # Loader's fdt commands extension sources.
 SRCS+= fdt_loader_cmd.c fdt_overlay.c
 
-CFLAGS+=   -I${SYSDIR}/contrib/libfdt/ -I${BOOTSRC}/common/
+CFLAGS+=   -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC}
 
 CFLAGS+=   -ffreestanding
 

Modified: head/sys/boot/ficl.mk
==
--- head/sys/boot/ficl.mk   Sun Oct 29 05:26:59 2017(r325093)
+++ head/sys/boot/ficl.mk   Sun Oct 29 05:27:22 2017(r325094)
@@ -38,7 +38,7 @@ beforedepend ${OBJS}: machine
 .endif
 
 machine: .NOMETA
-   ln -sf ${.CURDIR}/../../i386/include machine
+   ln -sf ${SYSDIR}/i386/include machine
 
 CLEANFILES+=   machine
 .endif

Modified: head/sys/boot/ficl/Makefile
==
--- head/sys/boot/ficl/Makefile Sun Oct 29 05:26:59 2017(r325093)
+++ head/sys/boot/ficl/Makefile Sun Oct 29 05:27:22 2017(r325094)
@@ -1,7 +1,8 @@
 # $FreeBSD$
 #
 
-.include   "../ficl.mk"
+.include 
+.include "${BOOTSRC}/ficl.mk"
 
 BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \
prefix.c search.c stack.c tools.c vm.c words.c

Modified: head/sys/boot/geli/Makefile
==
--- head/sys/boot/geli/Makefile Sun Oct 29 05:26:59 2017(r325093)
+++ head/sys/boot/geli/Makefile Sun Oct 29 05:27:22 2017(r325094)
@@ -40,7 +40,7 @@ SRCS+=md5c.c
 # AES implementation from sys/crypto
 .PATH: ${SYSDIR}/crypto/rijndael
 CFLAGS+=   -I${SYSDIR}
-CFLAGS+=   -I${.CURDIR}/../common/
+CFLAGS+=   -I${LDRSRC}
 # Remove asserts
 CFLAGS+=   -DNDEBUG
 SRCS+= rijndael-alg-fst.c rijndael-api-fst.c rijndael-api.c

Modified: head/sys/boot/ofw/libofw/Makefile
==
--- head/sys/boot/ofw/libofw/Makefile   Sun Oct 29 05:26:59 2017
(r325093)
+++ head/sys/boot/ofw/libofw/Makefile   Sun Oct 29 05:27:22 2017
(r325094)
@@ -6,11 +6,11 @@ INTERNALLIB=
 SRCS=  devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \
ofw_memory.c ofw_module.c ofw_net.c ofw_reboot.c \
ofw_time.c openfirm.c
-.PATH: ${.CURDIR}/../../zfs
+.PATH: ${BOOTSRC}/zfs
 SRCS+=  devicename_stubs.c
 
 # Pick up the bootstrap header for some interface items
-CFLAGS+=   -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
+CFLAGS+=   -I${LDRSRC} -I${SYSDIR} -I.
 
 CFLAGS+=   -ffreestanding
 .if ${MACHINE_CPUARCH} == "powerpc"
@@ -24,7 +24,7 @@ CFLAGS+= -DDISK_DEBUG
 .endif
 
 machine: .NOMETA
-   ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine
+   ln -sf ${SYSDIR}/${MACHINE_CPUARCH}/include machine
 
 CLEANFILES+=   machine
 

Modified: head/sys/boot/uboot/fdt/Makefile
==
--- head/sys/boot/uboot/fdt/MakefileSun Oct 29 05:26:59 2017
(r325093)
+++ head/sys/boot/uboot/fdt/MakefileSun Oct 29 05:27:22 2017
(r325094)
@@ -1,8 +1,8 @@
 # $FreeBSD$
 
-.include 
+.include 
 
-.PATH: ${.CURDIR}/../../common
+.PATH: ${LDRSRC}
 
 LIB=   uboot_fdt
 INTERNALLIB=
@@ -13,16 +13,16 @@ SRCS=   uboot_fdt.c
 CFLAGS+=   -ffreestanding -msoft-float
 
 # U-Boot library headers
-CFLAGS+=   -I${.CURDIR}/../lib
+CFLAGS+=   -I${UBOOTSRC}/lib
 
 # libfdt headers
-CFLAGS+=   -I${.CURDIR}/../../fdt
+CFLAGS+=   -I${FDTSRC}
 
 # Pick up the bootstrap header for some interface items
-CFLAGS+=   -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
+CFLAGS+=   -I${LDRSRC} -I${SYSDIR} -I.
 
 machine: .NOMETA
-   ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine
+   ln -sf ${SYSDIR}/${MACHINE_CPUARCH}/include machine
 
 CLEANFILES+=   machine
 

Modified: head/sys/boot/uboot/lib/Makefile
==
--- head/sys/boot/uboot/lib/MakefileSun Oct 29 

Re: svn commit: r325062 - in head/lib: . libcasper libcasper/libcasper libcasper/services libcasper/services/cap_dns libcasper/services/cap_dns/tests libcasper/services/cap_grp libcasper/services/cap_

2017-10-28 Thread Mariusz Zaborski
On 29 October 2017 at 01:49, Conrad Meyer  wrote:
> Hi,
>
> On Sat, Oct 28, 2017 at 12:23 PM, Mariusz Zaborski  
> wrote:
>> Author: oshogbo
>> Date: Sat Oct 28 19:23:57 2017
>> New Revision: 325062
>> URL: https://svnweb.freebsd.org/changeset/base/325062
>>
>> Log:
>>   Introduce caspermocks.
>>
>>   The idea behinds mocks is that we don't need to ifdef a lot of code in
>>   tools itself but those defines are hidden in the casper library.
>>   Right now the mocks are implemented as define/inlines functions.
>>   There was a very long discussion how this should be implemented.
>>   This approach has some advantages like we don't need to link to any 
>> additional
>>   libraries. Unfortunately there are also some disadvantages for example it 
>> is
>>   easy to get library out of sync between two versions of functions or that 
>> we
>>   need extra define to compile program with casper support.
>>   This isn't an ideal solution but it's good enough for now and should 
>> simplify
>>   capsicumizing programs. This also doesn't close us any other ways to do 
>> those
>>   mocks and this should evolve in time.
>>
>>   Discussed with:   pjd, emaste, ed, rwatson, bapt, cem, bdrewery
>>   Differential Revision:https://reviews.freebsd.org/D8753
>
> It's worth pointing out "discussed with" here very much does not mean
> "approved by" — several of the people mentioned above raised concerns
> with this approach and only one person explicitly supported the
> change.

Sorry for my in precision,

Approved by:   pjd, emaste, ed, rwatson
Discussed with:   pjd, emaste, ed, rwatson, bapt, cem, bdrewery

Like I mention in a commit log there were some concerns. This is also
the reason why
I wouldn't commit it with only one 'go for it'.

Thanks,
Mariusz

>
> Best,
> Conrad
___
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: r325092 - head/usr.bin/fortune/datfiles

2017-10-28 Thread Eitan Adler
Author: eadler
Date: Sun Oct 29 04:53:33 2017
New Revision: 325092
URL: https://svnweb.freebsd.org/changeset/base/325092

Log:
  Modernize freebsd-tips a bit
  
  - Prefer UTF-8 over ISO-8859-1
  - Remove some references to printing man pages
  - Combine duplicate '!!' tips
  - 'rehash' is no longer needed

Modified:
  head/usr.bin/fortune/datfiles/freebsd-tips

Modified: head/usr.bin/fortune/datfiles/freebsd-tips
==
--- head/usr.bin/fortune/datfiles/freebsd-tips  Sun Oct 29 04:41:01 2017
(r325091)
+++ head/usr.bin/fortune/datfiles/freebsd-tips  Sun Oct 29 04:53:33 2017
(r325092)
@@ -47,10 +47,6 @@ reinstall it with gpart(8). See
 If you accidentally end up inside vi, you can quit it by pressing Escape, colon
 (:), q (q), bang (!) and pressing return.
 %
-If you are in the C shell and have just installed a new program, you won't
-be able to run it unless you first type "rehash".
-   -- Dru 
-%
 If you do not want to get beeps in X11 (X Windows), you can turn them off with
 
xset b off
@@ -115,7 +111,7 @@ also do a lot more advanced searches - type 'man grep'
 %
 In order to support national characters for European languages in tools like
 less without creating other nationalisation aspects, set the environment
-variable LC_ALL to 'en_US.ISO8859-1'.
+variable LC_ALL to 'en_US.UTF-8'.
 %
 "man firewall" will give advice for building a FreeBSD firewall using ipfw(8).
-- David Scheidt 
@@ -154,11 +150,6 @@ Use "lock -p". When you return, use your password as t
 terminal.
-- Dru 
 %
-Need to print a manpage? Use
-
-   man name_of_manpage | col -bx | lpr
-   -- Dru 
-%
 Need to quickly empty a file? Use ": > filename".
-- Dru 
 %
@@ -256,9 +247,6 @@ To read a compressed file without having to first unco
 and "xzless".
-- Dru 
 %
-To repeat the last command in the C shell, type "!!".
-   -- Dru 
-%
 To save disk space in your home directory, compress files you rarely
 use with "gzip filename".
-- Dru 
@@ -467,7 +455,7 @@ Try "whereis firefox" and "whereis whereis".
-- Konstantinos Konstantinidis 
 %
 Want to run the same command again?
-In tcsh you can type "!!".
+Type "!!".
 %
 Want to go the directory you were just in?
 Type "cd -"
___
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: r325091 - head/usr.bin/fortune/datfiles

2017-10-28 Thread Eitan Adler
Author: eadler
Date: Sun Oct 29 04:41:01 2017
New Revision: 325091
URL: https://svnweb.freebsd.org/changeset/base/325091

Log:
  Prefer using https over http

Modified:
  head/usr.bin/fortune/datfiles/freebsd-tips

Modified: head/usr.bin/fortune/datfiles/freebsd-tips
==
--- head/usr.bin/fortune/datfiles/freebsd-tips  Sun Oct 29 04:33:50 2017
(r325090)
+++ head/usr.bin/fortune/datfiles/freebsd-tips  Sun Oct 29 04:41:01 2017
(r325091)
@@ -69,7 +69,7 @@ If you need a reminder to leave your terminal, type "l
 %
 If you need to ask a question on the FreeBSD-questions mailing list then
 
-   http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/\
+   https://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/\
freebsd-questions/index.html
 
 contains lots of useful advice to help you get the best results.
@@ -100,7 +100,7 @@ environment variable in order to make cdcontrol want t
 If you'd like to keep track of applications in the FreeBSD ports tree, take a
 look at FreshPorts;
 
-   http://www.freshports.org/
+   https://www.freshports.org/
 %
 In order to make fetch (the FreeBSD downloading tool) ask for
 username/password when it encounters a password-protected web page, you can set
@@ -455,7 +455,7 @@ You can use "pkg info" to see a list of packages you h
 %
 You can use the 'fetch' command to retrieve files over ftp, http or https.
 
-fetch http://www.FreeBSD.org/index.html
+fetch https://www.FreeBSD.org/index.html
 
 will download the front page of the FreeBSD web site.
 %
___
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: r325090 - in stable: 10/include 11/include

2017-10-28 Thread Cy Schubert
Author: cy
Date: Sun Oct 29 04:33:50 2017
New Revision: 325090
URL: https://svnweb.freebsd.org/changeset/base/325090

Log:
  Sync (make same) the offsetof macro definition in include/ with the
  definition of the same in sys/sys/. The problem was discovered while
  working on implementing a new C11 gets_s() for libc. (The new gets_s()
  requires rsize_t found in include/stddef.h.) The solution to sync the two
  definitions was suggested by ed@ while discussing D12667.
  
  Suggested by: ed

Modified:
  stable/11/include/stddef.h
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/include/stddef.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/include/stddef.h
==
--- stable/11/include/stddef.h  Sun Oct 29 01:21:52 2017(r325089)
+++ stable/11/include/stddef.h  Sun Oct 29 04:33:50 2017(r325090)
@@ -70,7 +70,7 @@ typedef   __max_align_t   max_align_t;
 #endif
 #endif
 
-#defineoffsetof(type, member)  __offsetof(type, member)
+#defineoffsetof(type, field)   __offsetof(type, field)
 
 #if __EXT1_VISIBLE
 /* ISO/IEC 9899:2011 K.3.3.2 */
___
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: r325090 - in stable: 10/include 11/include

2017-10-28 Thread Cy Schubert
Author: cy
Date: Sun Oct 29 04:33:50 2017
New Revision: 325090
URL: https://svnweb.freebsd.org/changeset/base/325090

Log:
  Sync (make same) the offsetof macro definition in include/ with the
  definition of the same in sys/sys/. The problem was discovered while
  working on implementing a new C11 gets_s() for libc. (The new gets_s()
  requires rsize_t found in include/stddef.h.) The solution to sync the two
  definitions was suggested by ed@ while discussing D12667.
  
  Suggested by: ed

Modified:
  stable/10/include/stddef.h
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/include/stddef.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/include/stddef.h
==
--- stable/10/include/stddef.h  Sun Oct 29 01:21:52 2017(r325089)
+++ stable/10/include/stddef.h  Sun Oct 29 04:33:50 2017(r325090)
@@ -67,6 +67,6 @@ typedef   __max_align_t   max_align_t;
 #endif
 #endif
 
-#defineoffsetof(type, member)  __offsetof(type, member)
+#defineoffsetof(type, field)   __offsetof(type, field)
 
 #endif /* _STDDEF_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: r325080 - in head: . share/man/man7

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:22 2017
New Revision: 325080
URL: https://svnweb.freebsd.org/changeset/base/325080

Log:
  build(7): Document native-xtools.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile
  head/share/man/man7/build.7

Modified: head/Makefile
==
--- head/Makefile   Sun Oct 29 01:21:19 2017(r325079)
+++ head/Makefile   Sun Oct 29 01:21:22 2017(r325080)
@@ -39,7 +39,9 @@
 # xdev-install- Install cross-development tools.
 # xdev-links  - Create traditional links in /usr/bin for cc, etc
 # native-xtools   - Create host binaries that produce target objects
-#   for use in qemu user-mode jails.
+#   for use in qemu user-mode jails.  Override
+#   target location with NXBDESTDIR.  TARGET and
+#   TARGET_ARCH should be defined.
 # 
 # "quick" way to test all kernel builds:
 #  _jflag=`sysctl -n hw.ncpu`

Modified: head/share/man/man7/build.7
==
--- head/share/man/man7/build.7 Sun Oct 29 01:21:19 2017(r325079)
+++ head/share/man/man7/build.7 Sun Oct 29 01:21:22 2017(r325080)
@@ -222,6 +222,18 @@ variable
 .Va DISTDIR .
 This target is used while building a release; see
 .Xr release 7 .
+.It Cm native-xtools
+This target builds a cross-toolchain for the given
+.Sy TARGET
+and
+.Sy TARGET_ARCH ,
+as well as a select list of static userland tools for the host system.
+This is intended to be used in a jail where QEMU is used to improve
+performance by avoiding emulating binaries that do not need to be emulated.
+.Sy TARGET
+and
+.Sy TARGET_ARCH
+should be defined.
 .It Cm packageworld
 Archive the results of
 .Cm distributeworld ,
___
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: r325081 - head/share/man/man7

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:26 2017
New Revision: 325081
URL: https://svnweb.freebsd.org/changeset/base/325081

Log:
  build(7): Document xdev targets.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/share/man/man7/build.7

Modified: head/share/man/man7/build.7
==
--- head/share/man/man7/build.7 Sun Oct 29 01:21:22 2017(r325080)
+++ head/share/man/man7/build.7 Sun Oct 29 01:21:26 2017(r325081)
@@ -288,6 +288,43 @@ In addition print a summary of all failed targets at t
 exit with an error if there were any.
 .It Cm toolchains
 Create a build toolchain for each architecture supported by the build system.
+.It Cm xdev
+Builds and installs a cross-toolchain and sysroot for the given
+.Sy TARGET
+and
+.Sy TARGET_ARCH .
+The sysroot contains target library and headers.
+The target is an alias for
+.Cm xdev-build
+and
+.Cm xdev-install .
+The location of the files installed can be controlled with
+.Va DESTDIR .
+The target location in
+.Va DESTDIR
+is
+.Pa ${DESTDIR}/${XDTP}
+where
+.Va XDTP
+defaults to
+.Pa /usr/${XDDIR}
+and
+.Va XDDIR
+defaults to
+.Pa ${TARGET_ARCH}-freebsd .
+.It Cm xdev-build
+Builds for the
+.Cm xdev
+target.
+.It Cm xdev-install
+Installs the files for the
+.Cm xdev
+target.
+.It Cm xdev-links
+Installs autoconf-style symlinks to
+.Pa ${DESTDIR}/usr/bin
+pointing into the xdev toolchain in
+.Pa ${DESTDIR}/${XDTP} .
 .El
 .Pp
 Kernel specific build targets in
___
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: r325085 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:39 2017
New Revision: 325085
URL: https://svnweb.freebsd.org/changeset/base/325085

Log:
  lib32/libsoft: Store object files in a more consistent structure.
  
  Having objects in world32 and a sysroot in lib32 was confusing and
  inconsistent with the normal build.  Now objects are stored in
  obj-lib32 (or obj-libsoft) and the sysroot (analagous to WORLDTMP)
  is stored in obj-lib32/tmp.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile.libcompat

Modified: head/Makefile.libcompat
==
--- head/Makefile.libcompat Sun Oct 29 01:21:36 2017(r325084)
+++ head/Makefile.libcompat Sun Oct 29 01:21:39 2017(r325085)
@@ -79,8 +79,8 @@ LIBCOMPAT${_var}?=${LIB${LIBCOMPAT}${_var}}
 .endfor
 
 # Shared flags
-LIBCOMPAT_OBJTREE?=${OBJTREE}${.CURDIR}/world${libcompat}
-LIBCOMPATTMP?= ${OBJTREE}${.CURDIR}/lib${libcompat}
+LIBCOMPAT_OBJTREE?=${OBJTREE}${.CURDIR}/obj-lib${libcompat}
+LIBCOMPATTMP?= ${LIBCOMPAT_OBJTREE}/tmp
 
 LIBCOMPATCFLAGS+=  ${LIBCOMPATCPUFLAGS} \
-L${LIBCOMPATTMP}/usr/lib${libcompat} \
___
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: r325089 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:52 2017
New Revision: 325089
URL: https://svnweb.freebsd.org/changeset/base/325089

Log:
  xdev: Consolidate duplicate cross-tools build/install list into XDEVDIRS.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:21:49 2017(r325088)
+++ head/Makefile.inc1  Sun Oct 29 01:21:52 2017(r325089)
@@ -2846,8 +2846,7 @@ _xb-build-tools: .PHONY
${_+_}@cd ${.CURDIR}; \
${CDBENV} ${MAKE} -f Makefile.inc1 ${NOFUN} build-tools
 
-_xb-cross-tools: .PHONY
-.for _tool in \
+XDEVDIRS= \
 ${_lld} \
 ${_binutils} \
 ${_elftctools} \
@@ -2855,6 +2854,9 @@ _xb-cross-tools: .PHONY
 ${_clang_libs} \
 ${_clang} \
 ${_gcc}
+
+_xb-cross-tools: .PHONY
+.for _tool in ${XDEVDIRS}
${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,all)"; \
cd ${.CURDIR}/${_tool}; \
if [ -z "${NO_OBJ}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ obj; fi; \
@@ -2885,14 +2887,7 @@ xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi
 
 _xi-cross-tools: .PHONY
@echo "_xi-cross-tools"
-.for _tool in \
-${_lld} \
-${_binutils} \
-${_elftctools} \
-usr.bin/ar \
-${_clang_libs} \
-${_clang} \
-${_gcc}
+.for _tool in ${XDEVDIRS}
${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \
cd ${.CURDIR}/${_tool}; \
${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR}
___
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: r325084 - head/share/mk

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:36 2017
New Revision: 325084
URL: https://svnweb.freebsd.org/changeset/base/325084

Log:
  AUTO_OBJ: auto.obj.mk mkdir -p simplification
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/share/mk/local.sys.env.mk

Modified: head/share/mk/local.sys.env.mk
==
--- head/share/mk/local.sys.env.mk  Sun Oct 29 01:21:33 2017
(r325083)
+++ head/share/mk/local.sys.env.mk  Sun Oct 29 01:21:36 2017
(r325084)
@@ -40,4 +40,8 @@ TIME_STAMP = ${TIME_STAMP_FMT:localtime}
 TIME_STAMP_DATE = `date '+${TIME_STAMP_FMT}'`
 TIME_STAMP_END?= ${TIME_STAMP_DATE}
 
+# Simplify auto.obj.mk mkdir -p handling and avoid unneeded/redundant
+# error spam and show a proper error.
+Mkdirs= Mkdirs() { mkdir -p $$* || :; }
+
 .include "src.sys.env.mk"
___
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: r325086 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:42 2017
New Revision: 325086
URL: https://svnweb.freebsd.org/changeset/base/325086

Log:
  xdev: Add missing 'make obj' treewalk for 'make includes'.
  
  It is possible that building headers requires an OBJDIR.
  The other phases of xdev have their own 'make obj' calls
  where needed, such as inside 'make libraries' itself.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:21:39 2017(r325085)
+++ head/Makefile.inc1  Sun Oct 29 01:21:42 2017(r325086)
@@ -2897,6 +2897,10 @@ _xi-cross-tools: .PHONY
 .endfor
 
 _xi-includes: .PHONY
+.if !defined(NO_OBJ)
+   ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 _obj \
+   DESTDIR=${XDDESTDIR}
+.endif
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 includes \
DESTDIR=${XDDESTDIR}
 
___
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: r325088 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:49 2017
New Revision: 325088
URL: https://svnweb.freebsd.org/changeset/base/325088

Log:
  xdev: Remove excess '/' since XDTP is asserted to be an absolute path.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:21:46 2017(r325087)
+++ head/Makefile.inc1  Sun Oct 29 01:21:49 2017(r325088)
@@ -2817,7 +2817,7 @@ CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/u
 # Don't rebuild build-tools targets during normal build.
 CD2MAKE+=  BUILD_TOOLS_META=.NOMETA
 .endif
-XDDESTDIR=${DESTDIR}/${XDTP}
+XDDESTDIR=${DESTDIR}${XDTP}
 
 .ORDER: xdev-build xdev-install xdev-links
 xdev: xdev-build xdev-install .PHONY
___
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: r325087 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:46 2017
New Revision: 325087
URL: https://svnweb.freebsd.org/changeset/base/325087

Log:
  xdev: Fix build for platforms needing LLD.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:21:42 2017(r325086)
+++ head/Makefile.inc1  Sun Oct 29 01:21:46 2017(r325087)
@@ -2848,6 +2848,7 @@ _xb-build-tools: .PHONY
 
 _xb-cross-tools: .PHONY
 .for _tool in \
+${_lld} \
 ${_binutils} \
 ${_elftctools} \
 usr.bin/ar \
@@ -2885,6 +2886,7 @@ xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi
 _xi-cross-tools: .PHONY
@echo "_xi-cross-tools"
 .for _tool in \
+${_lld} \
 ${_binutils} \
 ${_elftctools} \
 usr.bin/ar \
___
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: r325072 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:20:56 2017
New Revision: 325072
URL: https://svnweb.freebsd.org/changeset/base/325072

Log:
  FAST_DEPEND clean hack: Remove lib32/soft files properly.
  
  Only remove them if the option is enabled and also handle libsoft
  by using the proper LIBCOMPAT_OBJTREE.  LIBCOMPAT:D will expand
  the text after it as a proper glob to the command line if LIBCOMPAT
  is defined.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:20:53 2017(r325071)
+++ head/Makefile.inc1  Sun Oct 29 01:20:56 2017(r325072)
@@ -782,7 +782,7 @@ _cleanobj_fast_depend_hack: .PHONY
${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.o; then \
echo Removing stale dependencies for ${f} syscall wrappers; \
rm -f ${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.* \
-  
${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/.depend.${f}.*; \
+  
${LIBCOMPAT:D${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.*}; \
fi
 .endif
 .endfor
@@ -793,7 +793,7 @@ _cleanobj_fast_depend_hack: .PHONY
${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.o; then \
echo Removing stale dependencies for ${f} syscall wrappers; \
rm -f ${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.* \
-  
${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/.depend.${f}.*; \
+  
${LIBCOMPAT:D${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.*}; \
fi
 .endif
 .endfor
@@ -805,8 +805,8 @@ _cleanobj_fast_depend_hack: .PHONY
@echo Removing stale generated ${f} syscall files
@rm -f ${OBJTREE}${.CURDIR}/lib/libc/${f}.* \
${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.* \
-   ${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/${f}.* \
-   ${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/.depend.${f}.*
+   ${LIBCOMPAT:D${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc/${f}.*} \
+   ${LIBCOMPAT:D${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.*}
 .endif
 .endfor
 
___
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: r325071 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:20:53 2017
New Revision: 325071
URL: https://svnweb.freebsd.org/changeset/base/325071

Log:
  Move FAST_DEPEND cleanup hack into its own target and call from _cleanobj.
  
  The _worldtmp target is for setting up WORLDTMP.  Nothing between _worldtmp
  and _cleanobj will read these files.  Move to its own target since it is
  so large.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:20:50 2017(r325070)
+++ head/Makefile.inc1  Sun Oct 29 01:20:53 2017(r325071)
@@ -768,41 +768,10 @@ _sanity_check: .PHONY .MAKE
@false
 .endif
 
-_worldtmp: .PHONY
-   @echo
-   @echo "--"
-   @echo ">>> Rebuilding the temporary build tree"
-   @echo "--"
-.if !defined(NO_CLEAN)
-   rm -rf ${WORLDTMP}
-.if defined(LIBCOMPAT)
-   rm -rf ${LIBCOMPATTMP}
-.endif
-.else
-.if exists(${WORLDTMP})
-   @echo ">>> Deleting stale files in build tree..."
-   ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \
-   delete-old delete-old-libs >/dev/null
-.endif
-.if defined(LIBCOMPAT) && exists(${LIBCOMPATTMP})
-   ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \
-   DESTDIR=${LIBCOMPATTMP} \
-   delete-old delete-old-libs >/dev/null
-.endif
-   rm -rf ${WORLDTMP}/legacy/usr/include
-.if ${USING_SYSTEM_COMPILER} == "yes"
-.for cc in cc c++
-   if [ -x ${WORLDTMP}/usr/bin/${cc} ]; then \
-   inum=$$(stat -f %i ${WORLDTMP}/usr/bin/${cc}); \
-   find ${WORLDTMP}/usr/bin -inum $${inum} -delete; \
-   fi
-.endfor
-.endif # ${USING_SYSTEM_COMPILER} == "yes"
-
 # Our current approach to dependency tracking cannot cope with certain source
 # tree changes, particularly with respect to removing source files and
 # replacing generated files.  Handle these cases here in an ad-hoc fashion.
-#
+_cleanobj_fast_depend_hack: .PHONY
 # Syscall stubs rewritten in C
 # Date  SVN Rev  Syscalls
 # 20160829  r305012  ptrace
@@ -841,6 +810,36 @@ _worldtmp: .PHONY
 .endif
 .endfor
 
+_worldtmp: .PHONY
+   @echo
+   @echo "--"
+   @echo ">>> Rebuilding the temporary build tree"
+   @echo "--"
+.if !defined(NO_CLEAN)
+   rm -rf ${WORLDTMP}
+.if defined(LIBCOMPAT)
+   rm -rf ${LIBCOMPATTMP}
+.endif
+.else
+.if exists(${WORLDTMP})
+   @echo ">>> Deleting stale files in build tree..."
+   ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \
+   delete-old delete-old-libs >/dev/null
+.endif
+.if defined(LIBCOMPAT) && exists(${LIBCOMPATTMP})
+   ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \
+   DESTDIR=${LIBCOMPATTMP} \
+   delete-old delete-old-libs >/dev/null
+.endif
+   rm -rf ${WORLDTMP}/legacy/usr/include
+.if ${USING_SYSTEM_COMPILER} == "yes"
+.for cc in cc c++
+   if [ -x ${WORLDTMP}/usr/bin/${cc} ]; then \
+   inum=$$(stat -f %i ${WORLDTMP}/usr/bin/${cc}); \
+   find ${WORLDTMP}/usr/bin -inum $${inum} -delete; \
+   fi
+.endfor
+.endif # ${USING_SYSTEM_COMPILER} == "yes"
 .endif # !defined(NO_CLEAN)
 
 .for _dir in \
@@ -898,7 +897,9 @@ _cleanobj:
 .if defined(LIBCOMPAT)
${_+_}cd ${.CURDIR}; ${LIBCOMPATWMAKE} -f Makefile.inc1 ${CLEANDIR}
 .endif
-.endif
+.else
+   ${_+_}cd ${.CURDIR}; ${WMAKE} _cleanobj_fast_depend_hack
+.endif # !defined(NO_CLEAN)
 _obj:
@echo
@echo "--"
___
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: r325075 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:06 2017
New Revision: 325075
URL: https://svnweb.freebsd.org/changeset/base/325075

Log:
  Remove comment: debug files can be useful for build tools.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:21:02 2017(r325074)
+++ head/Makefile.inc1  Sun Oct 29 01:21:06 2017(r325075)
@@ -848,7 +848,6 @@ _worldtmp: .PHONY
-p ${WORLDTMP}/usr/include >/dev/null
ln -sf ${.CURDIR}/sys ${WORLDTMP}
 .if ${MK_DEBUG_FILES} != "no"
-   # We could instead disable debug files for these build stages
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
-p ${WORLDTMP}/legacy/usr/lib >/dev/null
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r325083 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:33 2017
New Revision: 325083
URL: https://svnweb.freebsd.org/changeset/base/325083

Log:
  Suggest TARGET/TARGET_ARCH, XDEV/XDEV_ARCH are depcrecated in r269031.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile

Modified: head/Makefile
==
--- head/Makefile   Sun Oct 29 01:21:29 2017(r325082)
+++ head/Makefile   Sun Oct 29 01:21:33 2017(r325083)
@@ -34,7 +34,7 @@
 #   for world and kernel targets.
 # toolchains  - Build a toolchain for all world and kernel targets.
 # xdev- xdev-build + xdev-install for the architecture
-#   specified with XDEV and XDEV_ARCH.
+#   specified with TARGET and TARGET_ARCH.
 # xdev-build  - Build cross-development tools.
 # xdev-install- Install cross-development tools.
 # xdev-links  - Create traditional links in /usr/bin for cc, etc
___
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: r325076 - head/release/scripts

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:09 2017
New Revision: 325076
URL: https://svnweb.freebsd.org/changeset/base/325076

Log:
  Rework r254951 to not reach into private OBJDIR areas.
  
  The original change was dealing with the build wanting to run a newer
  install(1) that was not yet installed.  The solution to look into the private
  legacy directory of the existing build conflicts with 2 upcoming features: a
  changed OBJDIR format, and splitting the host tools into arch-dependent and
  arch-independent directories.  Rather than hardcoding and changing the paths 
in
  this script, just let kernel-toolchain do the work, while disabling much of 
the
  meat.  With -j15 this finishes in 25 seconds for me and 117 seconds with -j1.
  All that is really needed is bootstrap-tools, but the system is not currently
  written in a way that all previous dependent steps will have ran.  The 
previous
  steps, such as _worldtmp, are being reworked and renamed and so cannot be
  relied upon to be right.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/release/scripts/mm-mtree.sh

Modified: head/release/scripts/mm-mtree.sh
==
--- head/release/scripts/mm-mtree.shSun Oct 29 01:21:06 2017
(r325075)
+++ head/release/scripts/mm-mtree.shSun Oct 29 01:21:09 2017
(r325076)
@@ -81,11 +81,6 @@ if [ ! -f ${SOURCEDIR}/Makefile.inc1 -a \
 fi
 
 # Setup make to use system files from SOURCEDIR
-objp=${MAKEOBJDIRPREFIX}
-[ -z "${objp}" ] && objp=/usr/obj
-legacydir=${objp}${SOURCEDIR}/tmp/legacy
-legacypath=${legacydir}/usr/sbin:${legacydir}/usr/bin:${legacydir}/bin
-MM_MAKE_ARGS="${MM_MAKE_ARGS} PATH=${legacypath}:${PATH}"
 MM_MAKE="make ${ARCHSTRING} ${MM_MAKE_ARGS} -m ${SOURCEDIR}/share/mk"
 
 delete_temproot () {
@@ -121,6 +116,9 @@ echo ''
   esac
   od=${TEMPROOT}/usr/obj
   ${MM_MAKE} DESTDIR=${TEMPROOT} distrib-dirs &&
+  MAKEOBJDIRPREFIX=$od ${MM_MAKE} kernel-toolchain \
+  MK_TOOLCHAIN=no MK_CROSS_COMPILER=no \
+  MK_CDDL=no MK_TESTS=no MK_RESCUE=no &&
   MAKEOBJDIRPREFIX=$od ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc &&
   MAKEOBJDIRPREFIX=$od ${MM_MAKE} everything SUBDIR_OVERRIDE=etc &&
   MAKEOBJDIRPREFIX=$od ${MM_MAKE} DESTDIR=${TEMPROOT} distribution;} ||
___
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: r325073 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:20:59 2017
New Revision: 325073
URL: https://svnweb.freebsd.org/changeset/base/325073

Log:
  MK_TESTS is disabled in early phases, no need for TESTBASE extraction here.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:20:56 2017(r325072)
+++ head/Makefile.inc1  Sun Oct 29 01:20:59 2017(r325073)
@@ -862,16 +862,6 @@ _worldtmp: .PHONY
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
-p ${WORLDTMP}/usr/lib >/dev/null
 .endif
-.if ${MK_TESTS} != "no"
-   mkdir -p ${WORLDTMP}${TESTSBASE}
-   mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
-   -p ${WORLDTMP}${TESTSBASE} >/dev/null
-.if ${MK_DEBUG_FILES} != "no"
-   mkdir -p ${WORLDTMP}/usr/lib/debug/${TESTSBASE}
-   mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
-   -p ${WORLDTMP}/usr/lib/debug/${TESTSBASE} >/dev/null
-.endif
-.endif
 .for _mtree in ${LOCAL_MTREE}
mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
 .endfor
___
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: r325082 - in head: . share/man/man7

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:29 2017
New Revision: 325082
URL: https://svnweb.freebsd.org/changeset/base/325082

Log:
  Change native-xtools to not install by default; add a native-xtools-install.
  
  Without this the user has to mess with 'make -f Makefile.inc1 ...' to figure
  out where the files are installed in the OBJDIR and then they need to copy 
them
  to where they really wanted them. Using DESTDIR may be problematic after
  r325001 as well.
  
  The files will be installed to DESTDIR/NXTP where NXTP defaults to /nxb-bin.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile
  head/Makefile.inc1
  head/UPDATING
  head/share/man/man7/build.7

Modified: head/Makefile
==
--- head/Makefile   Sun Oct 29 01:21:26 2017(r325081)
+++ head/Makefile   Sun Oct 29 01:21:29 2017(r325082)
@@ -39,9 +39,11 @@
 # xdev-install- Install cross-development tools.
 # xdev-links  - Create traditional links in /usr/bin for cc, etc
 # native-xtools   - Create host binaries that produce target objects
-#   for use in qemu user-mode jails.  Override
-#   target location with NXBDESTDIR.  TARGET and
+#   for use in qemu user-mode jails.  TARGET and
 #   TARGET_ARCH should be defined.
+# native-xtools-install
+# - Install the files to the given DESTDIR/NXTP where
+#   NXTP defaults to /nxb-bin.
 # 
 # "quick" way to test all kernel builds:
 #  _jflag=`sysctl -n hw.ncpu`
@@ -132,13 +134,15 @@ TGTS= all all-man buildenv buildenvvars buildkernel bu
_build-tools _build-metadata _cross-tools _includes _libraries \
build32 distribute32 install32 buildsoft distributesoft installsoft \
builddtb xdev xdev-build xdev-install \
-   xdev-links native-xtools stageworld stagekernel stage-packages \
+   xdev-links native-xtools native-xtools-install stageworld stagekernel \
+   stage-packages \
create-packages-world create-packages-kernel create-packages \
packages installconfig real-packages sign-packages package-pkg \
print-dir test-system-compiler
 
 # These targets require a TARGET and TARGET_ARCH be defined.
-XTGTS= native-xtools xdev xdev-build xdev-install xdev-links
+XTGTS= native-xtools native-xtools-install xdev xdev-build xdev-install \
+   xdev-links
 
 # XXX: r156740: This can't work since bsd.subdir.mk is not included ever.
 # It will only work for SUBDIR_TARGETS in make.conf.

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:21:26 2017(r325081)
+++ head/Makefile.inc1  Sun Oct 29 01:21:29 2017(r325082)
@@ -2098,7 +2098,11 @@ cross-tools: .MAKE .PHONY
 # to pickup.
 #
 NXBOBJDIR= ${MAKEOBJDIRPREFIX}/nxb/${TARGET}.${TARGET_ARCH}
-NXBDESTDIR=${NXBOBJDIR}${.CURDIR}/nxb-bin
+NXTP?= /nxb-bin
+.if ${NXTP:N/*}
+.error NXTP variable should be an absolute path
+.endif
+NXBDESTDIR?=   ${DESTDIR}${NXTP}
 
 # This is the list of tools to be built/installed as static and where
 # appropriate to build for the given TARGET.TARGET_ARCH.
@@ -2227,6 +2231,9 @@ native-xtools: .PHONY
 .endif
${_+_}cd ${.CURDIR}; ${NXBMAKE} SUBDIR_OVERRIDE="${NXBDIRS:M*}" \
everything
+   @echo ">> native-xtools done.  Use 'make native-xtools-install' to 
install to a given DESTDIR"
+
+native-xtools-install: .PHONY
mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
-p ${NXBDESTDIR}/usr >/dev/null

Modified: head/UPDATING
==
--- head/UPDATING   Sun Oct 29 01:21:26 2017(r325081)
+++ head/UPDATING   Sun Oct 29 01:21:29 2017(r325082)
@@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 
 ** SPECIAL WARNING: ******
 
+20171028:
+   The native-xtools target no longer installs the files by default to the
+   OBJDIR.  Use the native-xtools-install target with a DESTDIR to install
+   to ${DESTDIR}/${NXTP} where NXTP defaults to /nxb-bin.
+
 20171021:
As part of the boot loader infrastructure cleanup, LOADER_*_SUPPORT
options are changing from controlling the build if defined / undefined

Modified: head/share/man/man7/build.7
==
--- head/share/man/man7/build.7 Sun Oct 29 01:21:26 2017(r325081)
+++ head/share/man/man7/build.7 Sun Oct 29 01:21:29 2017(r325082)
@@ -234,6 +234,17 @@ performance by avoiding emulating binaries that do not
 and
 .Sy TARGET_ARCH
 s

svn commit: r325078 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:15 2017
New Revision: 325078
URL: https://svnweb.freebsd.org/changeset/base/325078

Log:
  Disable AUTO_OBJ as a make argument to ensure it really is disabled.
  
  If the user sets this to yes as a make argument too we still want
  to ensure these do not get enabled.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile
  head/Makefile.inc1

Modified: head/Makefile
==
--- head/Makefile   Sun Oct 29 01:21:12 2017(r325077)
+++ head/Makefile   Sun Oct 29 01:21:15 2017(r325078)
@@ -179,7 +179,7 @@ META_TGT_WHITELIST+= \
 
 PATH=  /sbin:/bin:/usr/sbin:/usr/bin
 MAKEOBJDIRPREFIX?= /usr/obj
-_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} MK_AUTO_OBJ=no ${MAKE} \
+_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} MK_AUTO_OBJ=no \
 ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \
 -f /dev/null -V MAKEOBJDIRPREFIX dummy
 .if !empty(_MAKEOBJDIRPREFIX)

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:21:12 2017(r325077)
+++ head/Makefile.inc1  Sun Oct 29 01:21:15 2017(r325078)
@@ -365,11 +365,11 @@ OSRELDATE=0
 
 # Set VERSION for CTFMERGE to use via the default CTFFLAGS=-L VERSION.
 .if !defined(_REVISION)
-_REVISION!=MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V REVISION
+_REVISION!=${MAKE} -C ${SRCDIR}/release MK_AUTO_OBJ=no -V REVISION
 .export _REVISION
 .endif
 .if !defined(_BRANCH)
-_BRANCH!=  MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V BRANCH
+_BRANCH!=  ${MAKE} -C ${SRCDIR}/release MK_AUTO_OBJ=no -V BRANCH
 .export _BRANCH
 .endif
 .if !defined(SRCRELDATE)
@@ -439,8 +439,8 @@ _TARGET_CPUTYPE=${TARGET_CPUTYPE}
 .else
 _TARGET_CPUTYPE=dummy
 .endif
-_CPUTYPE!= MK_AUTO_OBJ=no MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \
-   -f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE
+_CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \
+   -m ${.CURDIR}/share/mk MK_AUTO_OBJ=no -V CPUTYPE
 .if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
 .error CPUTYPE global should be set with ?=.
 .endif
___
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: r325077 - head/share/mk

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:12 2017
New Revision: 325077
URL: https://svnweb.freebsd.org/changeset/base/325077

Log:
  MAKEOBJDIR should be an absolute path, not any path with a slash.
  
  Using MAKEOBJDIR=foo did not work but MAKEOBJDIR=foo/ did, but
  really it needs to be absolute.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/share/mk/local.meta.sys.mk

Modified: head/share/mk/local.meta.sys.mk
==
--- head/share/mk/local.meta.sys.mk Sun Oct 29 01:21:09 2017
(r325076)
+++ head/share/mk/local.meta.sys.mk Sun Oct 29 01:21:12 2017
(r325077)
@@ -107,7 +107,7 @@ TARGET_OBJ_SPEC:= ${TARGET_SPEC:S;,;.;g}
 OBJTOP:= ${OBJROOT}${TARGET_OBJ_SPEC}
 
 .if defined(MAKEOBJDIR)
-.if ${MAKEOBJDIR:M*/*} == ""
+.if ${MAKEOBJDIR:M/*} == ""
 .error Cannot use MAKEOBJDIR=${MAKEOBJDIR}${.newline}Unset MAKEOBJDIR to get 
default:  MAKEOBJDIR='${_default_makeobjdir}'
 .endif
 .endif
___
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: r325079 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:19 2017
New Revision: 325079
URL: https://svnweb.freebsd.org/changeset/base/325079

Log:
  Fix xdev TARGET/TARGET_ARCH assertion and expand to native-xtools.
  
  The top of Makefile.inc1 requires TARGET/TARGET_ARCH be defined.  Just
  building 'make xdev' would already set them, so this error was never
  triggered.  Moving it to Makefile fixes the problem.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile
  head/Makefile.inc1

Modified: head/Makefile
==
--- head/Makefile   Sun Oct 29 01:21:15 2017(r325078)
+++ head/Makefile   Sun Oct 29 01:21:19 2017(r325079)
@@ -135,6 +135,9 @@ TGTS=   all all-man buildenv buildenvvars buildkernel bu
packages installconfig real-packages sign-packages package-pkg \
print-dir test-system-compiler
 
+# These targets require a TARGET and TARGET_ARCH be defined.
+XTGTS= native-xtools xdev xdev-build xdev-install xdev-links
+
 # XXX: r156740: This can't work since bsd.subdir.mk is not included ever.
 # It will only work for SUBDIR_TARGETS in make.conf.
 TGTS+= ${SUBDIR_TARGETS}
@@ -270,6 +273,11 @@ _TARGET=   ${XDEV}
 .if defined(XDEV_ARCH)
 _TARGET_ARCH=  ${XDEV_ARCH}
 .endif
+# Some targets require a set TARGET/TARGET_ARCH, check before the default
+# MACHINE and after the compatibility handling.
+.if !defined(_TARGET) || !defined(_TARGET_ARCH)
+${XTGTS}: _assert_target
+.endif
 # Otherwise, default to current machine type and architecture.
 _TARGET?=  ${MACHINE}
 _TARGET_ARCH?= ${MACHINE_ARCH}
@@ -277,6 +285,14 @@ _TARGET_ARCH?= ${MACHINE_ARCH}
 .if make(print-dir)
 .SILENT:
 .endif
+
+_assert_target: .PHONY .MAKE
+.for _tgt in ${XTGTS}
+.if make(${_tgt})
+   @echo "*** Error: Both TARGET and TARGET_ARCH must be defined for 
\"${_tgt}\" target"
+   @false
+.endif
+.endfor
 
 #
 # Make sure we have an up-to-date make(1). Only world and buildworld

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:21:15 2017(r325078)
+++ head/Makefile.inc1  Sun Oct 29 01:21:19 2017(r325079)
@@ -2760,8 +2760,6 @@ cleanworld: .PHONY
${_+_}@cd ${.CURDIR}; ${MAKE} cleandir
 .endif
 
-.if defined(TARGET) && defined(TARGET_ARCH)
-
 .if ${TARGET} == ${MACHINE} && ${TARGET_ARCH} == ${MACHINE_ARCH}
 XDEV_CPUTYPE?=${CPUTYPE}
 .else
@@ -2908,7 +2906,3 @@ xdev-links: .PHONY
ln -sf ../../${XDTP}/usr/bin/$$i \
../../../../usr/bin/${XDDIR}${_REVISION}-$$i; \
done
-.else
-xdev xdev-build xdev-install xdev-links: .PHONY
-   @echo "*** Error: Both TARGET and TARGET_ARCH must be defined for 
\"${.TARGET}\" target"
-.endif
___
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: r325074 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:21:02 2017
New Revision: 325074
URL: https://svnweb.freebsd.org/changeset/base/325074

Log:
  Move some LIBCOMPAT tmpdir logic setup to its own build target.
  
  Its own build target was already handling mtree extractions
  just as _worldtmp did, so the other cleaning of the
  tmpdir makes sense here as well.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile.inc1
  head/Makefile.libcompat

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:20:59 2017(r325073)
+++ head/Makefile.inc1  Sun Oct 29 01:21:02 2017(r325074)
@@ -817,18 +817,10 @@ _worldtmp: .PHONY
@echo "--"
 .if !defined(NO_CLEAN)
rm -rf ${WORLDTMP}
-.if defined(LIBCOMPAT)
-   rm -rf ${LIBCOMPATTMP}
-.endif
 .else
 .if exists(${WORLDTMP})
@echo ">>> Deleting stale files in build tree..."
${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \
-   delete-old delete-old-libs >/dev/null
-.endif
-.if defined(LIBCOMPAT) && exists(${LIBCOMPATTMP})
-   ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \
-   DESTDIR=${LIBCOMPATTMP} \
delete-old delete-old-libs >/dev/null
 .endif
rm -rf ${WORLDTMP}/legacy/usr/include

Modified: head/Makefile.libcompat
==
--- head/Makefile.libcompat Sun Oct 29 01:20:59 2017(r325073)
+++ head/Makefile.libcompat Sun Oct 29 01:21:02 2017(r325074)
@@ -148,6 +148,16 @@ build${libcompat}: .PHONY
@echo "--"
@echo ">>> stage 5.1: building lib${libcompat} shim libraries"
@echo "--"
+.if !defined(NO_CLEAN)
+   rm -rf ${LIBCOMPATTMP}
+.else
+.if exists(${LIBCOMPATTMP})
+   ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \
+   DESTDIR=${LIBCOMPATTMP} \
+   delete-old delete-old-libs >/dev/null
+.endif
+.endif # !defined(NO_CLEAN)
+
mkdir -p ${LIBCOMPATTMP}/usr/include
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
-p ${LIBCOMPATTMP}/usr >/dev/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: r325068 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:20:43 2017
New Revision: 325068
URL: https://svnweb.freebsd.org/changeset/base/325068

Log:
  Move sendmail special check into a _sanity_check target.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sat Oct 28 21:26:49 2017(r325067)
+++ head/Makefile.inc1  Sun Oct 29 01:20:43 2017(r325068)
@@ -752,7 +752,7 @@ KMAKE=  ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} 
${KERNEL_FLA
 # Attempt to rebuild the entire system, with reasonable chance of
 # success, regardless of how old your existing system is.
 #
-_worldtmp: .PHONY
+_sanity_check: .PHONY
 .if ${.CURDIR:C/[^,]//g} != ""
 #  The m4 build of sendmail files doesn't like it if ',' is used
 #  anywhere in the path of it's files.
@@ -761,6 +761,8 @@ _worldtmp: .PHONY
@echo
false
 .endif
+
+_worldtmp: .PHONY
@echo
@echo "--"
@echo ">>> Rebuilding the temporary build tree"
@@ -957,7 +959,7 @@ everything: .PHONY
 
 WMAKE_TGTS=
 .if !defined(WORLDFAST)
-WMAKE_TGTS+=   _worldtmp _legacy
+WMAKE_TGTS+=   _sanity_check _worldtmp _legacy
 .if empty(SUBDIR_OVERRIDE)
 WMAKE_TGTS+=   _bootstrap-tools
 .endif
___
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: r325070 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:20:50 2017
New Revision: 325070
URL: https://svnweb.freebsd.org/changeset/base/325070

Log:
  We don't need LIB32 directories extracted in early phase legacy/WORLDTMP dirs.
  
  This reverts some changes from r289662
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:20:47 2017(r325069)
+++ head/Makefile.inc1  Sun Oct 29 01:20:50 2017(r325070)
@@ -863,16 +863,6 @@ _worldtmp: .PHONY
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
-p ${WORLDTMP}/usr/lib >/dev/null
 .endif
-.if defined(LIBCOMPAT)
-   mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
-   -p ${WORLDTMP}/usr >/dev/null
-.if ${MK_DEBUG_FILES} != "no"
-   mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
-   -p ${WORLDTMP}/legacy/usr/lib/debug/usr >/dev/null
-   mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
-   -p ${WORLDTMP}/usr/lib/debug/usr >/dev/null
-.endif
-.endif
 .if ${MK_TESTS} != "no"
mkdir -p ${WORLDTMP}${TESTSBASE}
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r325069 - head

2017-10-28 Thread Bryan Drewery
Author: bdrewery
Date: Sun Oct 29 01:20:47 2017
New Revision: 325069
URL: https://svnweb.freebsd.org/changeset/base/325069

Log:
  Disallow using a colon ':' in source checkout paths.
  
  This leaks into the PATH handling for WORLDTMP and breaks
  finding cross-tools.  The PATH handling could be fixed to
  properly quote but is not worth the effort.
  
  Also allow this sanity check to always run even with 'make -n'.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Oct 29 01:20:43 2017(r325068)
+++ head/Makefile.inc1  Sun Oct 29 01:20:47 2017(r325069)
@@ -752,14 +752,20 @@ KMAKE=${KMAKEENV} ${MAKE} ${.MAKEFLAGS} 
${KERNEL_FLA
 # Attempt to rebuild the entire system, with reasonable chance of
 # success, regardless of how old your existing system is.
 #
-_sanity_check: .PHONY
+_sanity_check: .PHONY .MAKE
 .if ${.CURDIR:C/[^,]//g} != ""
 #  The m4 build of sendmail files doesn't like it if ',' is used
 #  anywhere in the path of it's files.
@echo
@echo "*** Error: path to source tree contains a comma ','"
@echo
-   false
+   @false
+.elif ${.CURDIR:M*\:*} != ""
+#  Using ':' leaks into PATH and breaks finding cross-tools.
+   @echo
+   @echo "*** Error: path to source tree contains a colon ':'"
+   @echo
+   @false
 .endif
 
 _worldtmp: .PHONY
___
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: r325062 - in head/lib: . libcasper libcasper/libcasper libcasper/services libcasper/services/cap_dns libcasper/services/cap_dns/tests libcasper/services/cap_grp libcasper/services/cap_

2017-10-28 Thread Conrad Meyer
Hi,

On Sat, Oct 28, 2017 at 12:23 PM, Mariusz Zaborski  wrote:
> Author: oshogbo
> Date: Sat Oct 28 19:23:57 2017
> New Revision: 325062
> URL: https://svnweb.freebsd.org/changeset/base/325062
>
> Log:
>   Introduce caspermocks.
>
>   The idea behinds mocks is that we don't need to ifdef a lot of code in
>   tools itself but those defines are hidden in the casper library.
>   Right now the mocks are implemented as define/inlines functions.
>   There was a very long discussion how this should be implemented.
>   This approach has some advantages like we don't need to link to any 
> additional
>   libraries. Unfortunately there are also some disadvantages for example it is
>   easy to get library out of sync between two versions of functions or that we
>   need extra define to compile program with casper support.
>   This isn't an ideal solution but it's good enough for now and should 
> simplify
>   capsicumizing programs. This also doesn't close us any other ways to do 
> those
>   mocks and this should evolve in time.
>
>   Discussed with:   pjd, emaste, ed, rwatson, bapt, cem, bdrewery
>   Differential Revision:https://reviews.freebsd.org/D8753

It's worth pointing out "discussed with" here very much does not mean
"approved by" — several of the people mentioned above raised concerns
with this approach and only one person explicitly supported the
change.

Best,
Conrad
___
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: r325067 - head/usr.sbin/bsnmpd/modules/snmp_hostres

2017-10-28 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Oct 28 21:26:49 2017
New Revision: 325067
URL: https://svnweb.freebsd.org/changeset/base/325067

Log:
  bsnmpd: Only refresh devtree if devd event is a new or removed device.
  
  It makes sense to refresh the tree only when a device is inserted or
  removed, otherwise bsnmpd wastes lot of CPU.
  
  PR:   209368
  MFC after:1 week

Modified:
  head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c

Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
==
--- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c  Sat Oct 
28 20:09:34 2017(r325066)
+++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c  Sat Oct 
28 21:26:49 2017(r325067)
@@ -479,7 +479,9 @@ again:
} else {
if (read_len == sizeof(buf))
goto again;
-   refresh_device_tbl(1);
+   /* Only refresh device table on a device add or remove event. */
+   if (buf[0] == '+' || buf[0] == '-')
+   refresh_device_tbl(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"


svn commit: r325066 - head/lib/libc/regex

2017-10-28 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Oct 28 20:09:34 2017
New Revision: 325066
URL: https://svnweb.freebsd.org/changeset/base/325066

Log:
  Fix out-of-bounds read in libc/regex.
  
  The bug is an out-of-bounds read detected with address sanitizer that
  happens when 'sp' in p_b_coll_elems() includes NUL byte[s], e.g. if it's
  equal to "GS\x00". In that case len will be equal to 4, and the
  strncmp(cp->name, sp, len) call will succeed when cp->name is "GS" but the
  cp->name[len] == '\0' comparison will cause the read to go out-of-bounds.
  
  Checking the length using strlen() instead eliminates the issue.
  
  The bug was found in LLVM with oss-fuzz:
https://reviews.llvm.org/D39380
  
  MFC after:1 week
  Obtained from:Vlad Tsyrklevich through posting on openbsd-tech

Modified:
  head/lib/libc/regex/regcomp.c

Modified: head/lib/libc/regex/regcomp.c
==
--- head/lib/libc/regex/regcomp.c   Sat Oct 28 20:03:29 2017
(r325065)
+++ head/lib/libc/regex/regcomp.c   Sat Oct 28 20:09:34 2017
(r325066)
@@ -1059,7 +1059,7 @@ p_b_coll_elem(struct parse *p,
}
len = p->next - sp;
for (cp = cnames; cp->name != NULL; cp++)
-   if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0')
+   if (strncmp(cp->name, sp, len) == 0 && strlen(cp->name) == len)
return(cp->code);   /* known name */
memset(, 0, sizeof(mbs));
if ((clen = mbrtowc(, sp, len, )) == len)
___
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: r325065 - head/sys/dev/ffec

2017-10-28 Thread Ian Lepore
Author: ian
Date: Sat Oct 28 20:03:29 2017
New Revision: 325065
URL: https://svnweb.freebsd.org/changeset/base/325065

Log:
  Split the hardware type enum and the hw feature flags bits into separate
  fields in the softc; they're ORed together in the ofw_compat_data.
  
  I already caught myself doing 'sc->fectype == ' without masking
  out the feature bits in one place, and that's sure to happen again.
  Glomming them together is convenient for storing them in the ofw_compat_data
  array, but there's no reason to keep them together in the softc.

Modified:
  head/sys/dev/ffec/if_ffec.c

Modified: head/sys/dev/ffec/if_ffec.c
==
--- head/sys/dev/ffec/if_ffec.c Sat Oct 28 19:39:22 2017(r325064)
+++ head/sys/dev/ffec/if_ffec.c Sat Oct 28 20:03:29 2017(r325065)
@@ -103,12 +103,15 @@ enum {
 
 /*
  * Flags that describe general differences between the FEC hardware in various
- * SoCs.  These are ORed into the FECTYPE enum values.
+ * SoCs.  These are ORed into the FECTYPE enum values in the ofw_compat_data, 
so
+ * the low 8 bits are reserved for the type enum.  In the softc, the type and
+ * flags are put into separate members, so that you don't need to mask the 
flags
+ * out of the type to compare it.
  */
-#defineFECTYPE_MASK0x
-#defineFECFLAG_GBE (1 << 16)
-#defineFECFLAG_AVB (1 << 17)
-#defineFECFLAG_RACC(1 << 18)
+#defineFECTYPE_MASK0x00ff
+#defineFECFLAG_GBE (1 <<  8)
+#defineFECFLAG_AVB (1 <<  9)
+#defineFECFLAG_RACC(1 << 10)
 
 /*
  * Table of supported FDT compat strings and their associated FECTYPE values.
@@ -154,7 +157,8 @@ struct ffec_softc {
void *  intr_cookie[MAX_IRQ_COUNT];
struct callout  ffec_callout;
mii_contype_t   phy_conn_type;
-   uintptr_t   fectype;
+   uint32_tfecflags;
+   uint8_t fectype;
boolean_t   link_is_up;
boolean_t   is_attached;
boolean_t   is_detaching;
@@ -261,7 +265,7 @@ ffec_miigasket_setup(struct ffec_softc *sc)
 * We only need the gasket for MII and RMII connections on certain SoCs.
 */
 
-   switch (sc->fectype & FECTYPE_MASK)
+   switch (sc->fectype)
{
case FECTYPE_IMX53:
break;
@@ -762,7 +766,7 @@ ffec_setup_rxbuf(struct ffec_softc *sc, int idx, struc
int error, nsegs;
struct bus_dma_segment seg;
 
-   if ((sc->fectype & FECFLAG_RACC) == 0) {
+   if (!(sc->fecflags & FECFLAG_RACC)) {
/*
 * The RACC[SHIFT16] feature is not available.  So, we need to
 * leave at least ETHER_ALIGN bytes free at the beginning of the
@@ -842,8 +846,7 @@ ffec_rxfinish_onebuf(struct ffec_softc *sc, int len)
 *  to it? That way we'd only need to copy like 64 bytes or whatever the
 *  biggest header is, instead of the whole 1530ish-byte frame.
 */
-
-   if (sc->fectype & FECFLAG_RACC) {
+   if (sc->fecflags & FECFLAG_RACC) {
m->m_data = mtod(m, uint8_t *) + 2;
} else {
src = mtod(m, uint8_t*);
@@ -1224,7 +1227,7 @@ ffec_init_locked(struct ffec_softc *sc)
ffec_clear_stats(sc);
WR4(sc, FEC_MIBC_REG, regval & ~FEC_MIBC_DIS);
 
-   if (sc->fectype & FECFLAG_RACC) {
+   if (sc->fecflags & FECFLAG_RACC) {
/*
 * RACC - Receive Accelerator Function Configuration.
 */
@@ -1460,10 +1463,11 @@ ffec_attach(device_t dev)
struct ifnet *ifp = NULL;
struct mbuf *m;
void *dummy;
+   uintptr_t typeflags;
phandle_t ofw_node;
+   uint32_t idx, mscr;
int error, phynum, rid, irq;
uint8_t eaddr[ETHER_ADDR_LEN];
-   uint32_t idx, mscr;
 
sc = device_get_softc(dev);
sc->dev = dev;
@@ -1474,9 +1478,11 @@ ffec_attach(device_t dev)
 * There are differences in the implementation and features of the FEC
 * hardware on different SoCs, so figure out what type we are.
 */
-   sc->fectype = ofw_bus_search_compatible(dev, compat_data)->ocd_data;
+   typeflags = ofw_bus_search_compatible(dev, compat_data)->ocd_data;
+   sc->fectype = (uint8_t)(typeflags & FECTYPE_MASK);
+   sc->fecflags = (uint32_t)(typeflags & ~FECTYPE_MASK);
 
-   if (sc->fectype & FECFLAG_AVB) {
+   if (sc->fecflags & FECFLAG_AVB) {
sc->rxbuf_align = 64;
sc->txbuf_align = 1;
} else {
@@ -1670,7 +1676,7 @@ ffec_attach(device_t dev)
 * be done unconditionally for all hardware variants, but that hasn't
 * been tested.
 */
-   if (sc->fectype & FECFLAG_AVB)
+   if 

svn commit: r325064 - head/sbin/ping

2017-10-28 Thread Mariusz Zaborski
Author: oshogbo
Date: Sat Oct 28 19:39:22 2017
New Revision: 325064
URL: https://svnweb.freebsd.org/changeset/base/325064

Log:
  Simplify ping sandbox.
  
  We don't need to check if casper is present, this is done in the library 
itself.
  
  Reviewed by:  emaste, cem, ed
  Differential Revision:https://reviews.freebsd.org/D8754

Modified:
  head/sbin/ping/ping.c

Modified: head/sbin/ping/ping.c
==
--- head/sbin/ping/ping.c   Sat Oct 28 19:34:08 2017(r325063)
+++ head/sbin/ping/ping.c   Sat Oct 28 19:39:22 2017(r325064)
@@ -76,10 +76,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef WITH_CASPER
 #include 
 #include 
-#endif
 
 #ifdef IPSEC
 #include 
@@ -204,15 +202,11 @@ static double tsumsq = 0.0;   /* sum of all times 
square
 static volatile sig_atomic_t finish_up;
 static volatile sig_atomic_t siginfo_p;
 
-#ifdef WITH_CASPER
 static cap_channel_t *capdns;
-#endif
 
 static void fill(char *, char *);
 static u_short in_cksum(u_short *, int);
-#ifdef WITH_CASPER
 static cap_channel_t *capdns_setup(void);
-#endif
 static void check_status(void);
 static void finish(void) __dead2;
 static void pinger(void);
@@ -563,21 +557,17 @@ main(int argc, char *const *argv)
if (options & F_PINGFILLED) {
fill((char *)datap, payload);
}
-#ifdef WITH_CASPER
capdns = capdns_setup();
-#endif
if (source) {
bzero((char *)_in, sizeof(sock_in));
sock_in.sin_family = AF_INET;
if (inet_aton(source, _in.sin_addr) != 0) {
shostname = source;
} else {
-#ifdef WITH_CASPER
if (capdns != NULL)
hp = cap_gethostbyname2(capdns, source,
AF_INET);
else
-#endif
hp = gethostbyname2(source, AF_INET);
if (!hp)
errx(EX_NOHOST, "cannot resolve %s: %s",
@@ -606,11 +596,9 @@ main(int argc, char *const *argv)
if (inet_aton(target, >sin_addr) != 0) {
hostname = target;
} else {
-#ifdef WITH_CASPER
if (capdns != NULL)
hp = cap_gethostbyname2(capdns, target, AF_INET);
else
-#endif
hp = gethostbyname2(target, AF_INET);
if (!hp)
errx(EX_NOHOST, "cannot resolve %s: %s",
@@ -624,7 +612,6 @@ main(int argc, char *const *argv)
hostname = hnamebuf;
}
 
-#ifdef WITH_CASPER
/* From now on we will use only reverse DNS lookups. */
if (capdns != NULL) {
const char *types[1];
@@ -633,7 +620,6 @@ main(int argc, char *const *argv)
if (cap_dns_type_limit(capdns, types, 1) < 0)
err(1, "unable to limit access to system.dns service");
}
-#endif
 
if (connect(ssend, (struct sockaddr *), sizeof(whereto)) != 0)
err(1, "connect");
@@ -722,10 +708,8 @@ main(int argc, char *const *argv)
 
if (options & F_NUMERIC)
cansandbox = true;
-#ifdef WITH_CASPER
else if (capdns != NULL)
cansandbox = true;
-#endif
else
cansandbox = false;
 
@@ -1707,11 +1691,9 @@ pr_addr(struct in_addr ina)
if (options & F_NUMERIC)
return inet_ntoa(ina);
 
-#ifdef WITH_CASPER
if (capdns != NULL)
hp = cap_gethostbyaddr(capdns, (char *), 4, AF_INET);
else
-#endif
hp = gethostbyaddr((char *), 4, AF_INET);
 
if (hp == NULL)
@@ -1791,7 +1773,6 @@ fill(char *bp, char *patp)
}
 }
 
-#ifdef WITH_CASPER
 static cap_channel_t *
 capdns_setup(void)
 {
@@ -1817,7 +1798,6 @@ capdns_setup(void)
 
return (capdnsloc);
 }
-#endif /* WITH_CASPER */
 
 #if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC)
 #defineSECOPT  " [-P policy]"
___
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: r325063 - head/sys/dev/ffec

2017-10-28 Thread Ian Lepore
Author: ian
Date: Sat Oct 28 19:34:08 2017
New Revision: 325063
URL: https://svnweb.freebsd.org/changeset/base/325063

Log:
  Use the 16-bit receive shift feature in ffec hardware that supports it.
  
  When available, enabling this feature causes the hardware to write data
  to the receive buffer starting at a 16-bit offset from the start address.
  This eliminates the need to copy the data after receiving to re-align
  the protocol headers to a 32-bit boundary.
  
  PR:   222634
  Submitted by: sebastian.hu...@embedded-brains.de

Modified:
  head/sys/dev/ffec/if_ffec.c

Modified: head/sys/dev/ffec/if_ffec.c
==
--- head/sys/dev/ffec/if_ffec.c Sat Oct 28 19:23:57 2017(r325062)
+++ head/sys/dev/ffec/if_ffec.c Sat Oct 28 19:34:08 2017(r325063)
@@ -108,6 +108,7 @@ enum {
 #defineFECTYPE_MASK0x
 #defineFECFLAG_GBE (1 << 16)
 #defineFECFLAG_AVB (1 << 17)
+#defineFECFLAG_RACC(1 << 18)
 
 /*
  * Table of supported FDT compat strings and their associated FECTYPE values.
@@ -115,10 +116,11 @@ enum {
 static struct ofw_compat_data compat_data[] = {
{"fsl,imx51-fec",   FECTYPE_GENERIC},
{"fsl,imx53-fec",   FECTYPE_IMX53},
-   {"fsl,imx6q-fec",   FECTYPE_IMX6 | FECFLAG_GBE},
-   {"fsl,imx6ul-fec",  FECTYPE_IMX6},
-   {"fsl,imx7d-fec",   FECTYPE_IMX6 | FECFLAG_GBE | FECFLAG_AVB},
-   {"fsl,mvf600-fec",  FECTYPE_MVF},
+   {"fsl,imx6q-fec",   FECTYPE_IMX6 | FECFLAG_RACC | FECFLAG_GBE },
+   {"fsl,imx6ul-fec",  FECTYPE_IMX6 | FECFLAG_RACC },
+   {"fsl,imx7d-fec",   FECTYPE_IMX6 | FECFLAG_RACC | FECFLAG_GBE |
+   FECFLAG_AVB },
+   {"fsl,mvf600-fec",  FECTYPE_MVF  | FECFLAG_RACC },
{"fsl,mvf-fec", FECTYPE_MVF},
{NULL,  FECTYPE_NONE},
 };
@@ -760,14 +762,17 @@ ffec_setup_rxbuf(struct ffec_softc *sc, int idx, struc
int error, nsegs;
struct bus_dma_segment seg;
 
-   /*
-* We need to leave at least ETHER_ALIGN bytes free at the beginning of
-* the buffer to allow the data to be re-aligned after receiving it (by
-* copying it backwards ETHER_ALIGN bytes in the same buffer).  We also
-* have to ensure that the beginning of the buffer is aligned to the
-* hardware's requirements.
-*/
-   m_adj(m, roundup(ETHER_ALIGN, sc->rxbuf_align));
+   if ((sc->fectype & FECFLAG_RACC) == 0) {
+   /*
+* The RACC[SHIFT16] feature is not available.  So, we need to
+* leave at least ETHER_ALIGN bytes free at the beginning of the
+* buffer to allow the data to be re-aligned after receiving it
+* (by copying it backwards ETHER_ALIGN bytes in the same
+* buffer).  We also have to ensure that the beginning of the
+* buffer is aligned to the hardware's requirements.
+*/
+   m_adj(m, roundup(ETHER_ALIGN, sc->rxbuf_align));
+   }
 
error = bus_dmamap_load_mbuf_sg(sc->rxbuf_tag, sc->rxbuf_map[idx].map,
m, , , 0);
@@ -815,23 +820,6 @@ ffec_rxfinish_onebuf(struct ffec_softc *sc, int len)
return;
}
 
-   /*
-*  Unfortunately, the protocol headers need to be aligned on a 32-bit
-*  boundary for the upper layers.  The hardware requires receive
-*  buffers to be 16-byte aligned.  The ethernet header is 14 bytes,
-*  leaving the protocol header unaligned.  We used m_adj() after
-*  allocating the buffer to leave empty space at the start of the
-*  buffer, now we'll use the alignment agnostic bcopy() routine to
-*  shuffle all the data backwards 2 bytes and adjust m_data.
-*
-*  XXX imx6 hardware is able to do this 2-byte alignment by setting the
-*  SHIFT16 bit in the RACC register.  Older hardware doesn't have that
-*  feature, but for them could we speed this up by copying just the
-*  protocol headers into their own small mbuf then chaining the cluster
-*  to it?  That way we'd only need to copy like 64 bytes or whatever
-*  the biggest header is, instead of the whole 1530ish-byte frame.
-*/
-
FFEC_UNLOCK(sc);
 
bmap = >rxbuf_map[sc->rx_idx];
@@ -844,10 +832,25 @@ ffec_rxfinish_onebuf(struct ffec_softc *sc, int len)
m->m_pkthdr.len = len;
m->m_pkthdr.rcvif = sc->ifp;
 
-   src = mtod(m, uint8_t*);
-   dst = src - ETHER_ALIGN;
-   bcopy(src, dst, len);
-   m->m_data = dst;
+   /*
+* Align the protocol headers in the receive buffer on a 32-bit
+* boundary.  Newer hardware does the alignment for us.  On hardware
+* that doesn't support this feature, we have to copy-align 

svn commit: r325062 - in head/lib: . libcasper libcasper/libcasper libcasper/services libcasper/services/cap_dns libcasper/services/cap_dns/tests libcasper/services/cap_grp libcasper/services/cap_g...

2017-10-28 Thread Mariusz Zaborski
Author: oshogbo
Date: Sat Oct 28 19:23:57 2017
New Revision: 325062
URL: https://svnweb.freebsd.org/changeset/base/325062

Log:
  Introduce caspermocks.
  
  The idea behinds mocks is that we don't need to ifdef a lot of code in
  tools itself but those defines are hidden in the casper library.
  Right now the mocks are implemented as define/inlines functions.
  There was a very long discussion how this should be implemented.
  This approach has some advantages like we don't need to link to any additional
  libraries. Unfortunately there are also some disadvantages for example it is
  easy to get library out of sync between two versions of functions or that we
  need extra define to compile program with casper support.
  This isn't an ideal solution but it's good enough for now and should simplify
  capsicumizing programs. This also doesn't close us any other ways to do those
  mocks and this should evolve in time.
  
  Discussed with:   pjd, emaste, ed, rwatson, bapt, cem, bdrewery
  Differential Revision:https://reviews.freebsd.org/D8753

Modified:
  head/lib/Makefile
  head/lib/libcasper/Makefile.inc
  head/lib/libcasper/libcasper/Makefile
  head/lib/libcasper/libcasper/libcasper.h
  head/lib/libcasper/services/Makefile
  head/lib/libcasper/services/cap_dns/Makefile
  head/lib/libcasper/services/cap_dns/cap_dns.h
  head/lib/libcasper/services/cap_dns/tests/Makefile
  head/lib/libcasper/services/cap_dns/tests/dns_test.c
  head/lib/libcasper/services/cap_grp/Makefile
  head/lib/libcasper/services/cap_grp/cap_grp.h
  head/lib/libcasper/services/cap_grp/tests/Makefile
  head/lib/libcasper/services/cap_grp/tests/grp_test.c
  head/lib/libcasper/services/cap_pwd/Makefile
  head/lib/libcasper/services/cap_pwd/cap_pwd.h
  head/lib/libcasper/services/cap_pwd/tests/Makefile
  head/lib/libcasper/services/cap_pwd/tests/pwd_test.c
  head/lib/libcasper/services/cap_random/Makefile
  head/lib/libcasper/services/cap_random/cap_random.h
  head/lib/libcasper/services/cap_sysctl/Makefile
  head/lib/libcasper/services/cap_sysctl/cap_sysctl.h
  head/lib/libcasper/services/cap_sysctl/tests/Makefile

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Sat Oct 28 19:08:06 2017(r325061)
+++ head/lib/Makefile   Sat Oct 28 19:23:57 2017(r325062)
@@ -35,6 +35,7 @@ SUBDIR=   ${SUBDIR_BOOTSTRAP} \
libcalendar \
libcam \
libcapsicum \
+   libcasper \
libcompat \
libcrypt \
libdevctl \
@@ -127,7 +128,6 @@ SUBDIR.${MK_ATM}+=  libngatm
 SUBDIR.${MK_BLACKLIST}+=libblacklist
 SUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp
 SUBDIR.${MK_BSNMP}+=   libbsnmp
-SUBDIR.${MK_CASPER}+=  libcasper
 
 .if !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP)
 SUBDIR.${MK_CLANG}+=   clang

Modified: head/lib/libcasper/Makefile.inc
==
--- head/lib/libcasper/Makefile.inc Sat Oct 28 19:08:06 2017
(r325061)
+++ head/lib/libcasper/Makefile.inc Sat Oct 28 19:23:57 2017
(r325062)
@@ -1,3 +1,9 @@
 # $FreeBSD$
 
+.include 
+
+.if ${MK_CASPER} != "no"
+CFLAGS+=-DWITH_CASPER
+.endif
+
 .include "../Makefile.inc"

Modified: head/lib/libcasper/libcasper/Makefile
==
--- head/lib/libcasper/libcasper/Makefile   Sat Oct 28 19:08:06 2017
(r325061)
+++ head/lib/libcasper/libcasper/Makefile   Sat Oct 28 19:23:57 2017
(r325062)
@@ -1,16 +1,21 @@
 # $FreeBSD$
 
+.include 
+
 PACKAGE=${LIB}
-LIB=   casper
 
 SHLIB_MAJOR=   0
 SHLIBDIR?= /lib
 
+.if ${MK_CASPER} != "no"
+LIB=   casper
+
 SRCS=  libcasper.c
 SRCS+= libcasper_impl.c
 SRCS+= libcasper_service.c
 SRCS+= service.c
 SRCS+= zygote.c
+.endif
 
 INCS=  libcasper.h
 INCS+= libcasper_service.h

Modified: head/lib/libcasper/libcasper/libcasper.h
==
--- head/lib/libcasper/libcasper/libcasper.hSat Oct 28 19:08:06 2017
(r325061)
+++ head/lib/libcasper/libcasper/libcasper.hSat Oct 28 19:23:57 2017
(r325062)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2012-2013 The FreeBSD Foundation
- * Copyright (c) 2015 Mariusz Zaborski 
+ * Copyright (c) 2015-2017 Mariusz Zaborski 
  * All rights reserved.
  *
  * This software was developed by Pawel Jakub Dawidek under sponsorship from
@@ -33,8 +33,16 @@
 #ifndef_LIBCASPER_H_
 #define_LIBCASPER_H_
 
+#ifdef HAVE_CASPER
+#define WITH_CASPER
+#endif
+
 #include 
+#include 
 
+#include 
+#include 
+
 #ifndef_NVLIST_T_DECLARED
 #define_NVLIST_T_DECLARED
 struct nvlist;
@@ -44,72 +52,191 @@ typedef struct nvlist nvlist_t;
 
 #ifndef_CAP_CHANNEL_T_DECLARED
 #define_CAP_CHANNEL_T_DECLARED
+#ifdef WITH_CASPER
 struct cap_channel;
 
 typedef struct cap_channel 

svn commit: r325061 - head/sys/dev/ffec

2017-10-28 Thread Ian Lepore
Author: ian
Date: Sat Oct 28 19:08:06 2017
New Revision: 325061
URL: https://svnweb.freebsd.org/changeset/base/325061

Log:
  Support up to 3 IRQs in the ffec driver.
  
  Newer hardware splits the interrupts onto 3 different irq lines, but the
  docs barely mention that there are multiple interrupts, and do not detail
  how they're split up.  The code now supports 1-3 irqs, and uses the same
  interrupt service routine to handle all of them.
  
  I modified the submitted changes to use bus_alloc_resources() instead of
  using loops to allocate each irq separately.  Thus, blame any bugs on me (I
  can't actually test on imx7 hardware).
  
  PR:   222634
  Submitted by: sebastian.hu...@embedded-brains.de

Modified:
  head/sys/dev/ffec/if_ffec.c

Modified: head/sys/dev/ffec/if_ffec.c
==
--- head/sys/dev/ffec/if_ffec.c Sat Oct 28 18:56:27 2017(r325060)
+++ head/sys/dev/ffec/if_ffec.c Sat Oct 28 19:08:06 2017(r325061)
@@ -133,6 +133,8 @@ static struct ofw_compat_data compat_data[] = {
 
 #defineWATCHDOG_TIMEOUT_SECS   5
 
+#defineMAX_IRQ_COUNT 3
+
 struct ffec_bufmap {
struct mbuf *mbuf;
bus_dmamap_tmap;
@@ -145,9 +147,9 @@ struct ffec_softc {
struct ifnet*ifp;
int if_flags;
struct mtx  mtx;
-   struct resource *irq_res;
+   struct resource *irq_res[MAX_IRQ_COUNT];
struct resource *mem_res;
-   void *  intr_cookie;
+   void *  intr_cookie[MAX_IRQ_COUNT];
struct callout  ffec_callout;
mii_contype_t   phy_conn_type;
uintptr_t   fectype;
@@ -177,6 +179,13 @@ struct ffec_softc {
int txcount;
 };
 
+static struct resource_spec irq_res_spec[MAX_IRQ_COUNT + 1] = {
+   { SYS_RES_IRQ,  0,  RF_ACTIVE },
+   { SYS_RES_IRQ,  1,  RF_ACTIVE | RF_OPTIONAL },
+   { SYS_RES_IRQ,  2,  RF_ACTIVE | RF_OPTIONAL },
+   RESOURCE_SPEC_END
+};
+
 #defineFFEC_LOCK(sc)   mtx_lock(&(sc)->mtx)
 #defineFFEC_UNLOCK(sc) mtx_unlock(&(sc)->mtx)
 #defineFFEC_LOCK_INIT(sc)  mtx_init(&(sc)->mtx, \
@@ -1364,7 +1373,7 @@ ffec_detach(device_t dev)
 {
struct ffec_softc *sc;
bus_dmamap_t map;
-   int idx;
+   int idx, irq;
 
/*
 * NB: This function can be called internally to unwind a failure to
@@ -1415,15 +1424,17 @@ ffec_detach(device_t dev)
bus_dmamap_destroy(sc->txdesc_tag, sc->txdesc_map);
}
if (sc->txdesc_tag != NULL)
-   bus_dma_tag_destroy(sc->txdesc_tag);
+   bus_dma_tag_destroy(sc->txdesc_tag);
 
/* Release bus resources. */
-   if (sc->intr_cookie)
-   bus_teardown_intr(dev, sc->irq_res, sc->intr_cookie);
+   for (irq = 0; irq < MAX_IRQ_COUNT; ++irq) {
+   if (sc->intr_cookie[irq] != NULL) {
+   bus_teardown_intr(dev, sc->irq_res[irq],
+   sc->intr_cookie[irq]);
+   }
+   }
+   bus_release_resources(dev, irq_res_spec, sc->irq_res);
 
-   if (sc->irq_res != NULL)
-   bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res);
-
if (sc->mem_res != NULL)
bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res);
 
@@ -1439,7 +1450,7 @@ ffec_attach(device_t dev)
struct mbuf *m;
void *dummy;
phandle_t ofw_node;
-   int error, phynum, rid;
+   int error, phynum, rid, irq;
uint8_t eaddr[ETHER_ADDR_LEN];
uint32_t idx, mscr;
 
@@ -1490,12 +1501,10 @@ ffec_attach(device_t dev)
error = ENOMEM;
goto out;
}
-   rid = 0;
-   sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, ,
-   RF_ACTIVE);
-   if (sc->irq_res == NULL) {
-   device_printf(dev, "could not allocate interrupt resources.\n");
-   error = ENOMEM;
+
+   error = bus_alloc_resources(dev, irq_res_spec, sc->irq_res);
+   if (error != 0) {
+   device_printf(dev, "could not allocate interrupt resources\n");
goto out;
}
 
@@ -1656,11 +1665,17 @@ ffec_attach(device_t dev)
WR4(sc, FEC_ECR_REG, FEC_ECR_RESET);
 
/* Setup interrupt handler. */
-   error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
-   NULL, ffec_intr, sc, >intr_cookie);
-   if (error != 0) {
-   device_printf(dev, "could not setup interrupt handler.\n");
-   goto out;
+   for (irq = 0; irq < MAX_IRQ_COUNT; ++irq) {
+   if (sc->irq_res[irq] != NULL) {
+   error = bus_setup_intr(dev, sc->irq_res[irq],
+   

svn commit: r325060 - head/sys/sys

2017-10-28 Thread Ian Lepore
Author: ian
Date: Sat Oct 28 18:56:27 2017
New Revision: 325060
URL: https://svnweb.freebsd.org/changeset/base/325060

Log:
  Add a #define RESOURCE_SPEC_END.  Similar to DEVMETHOD_END and
  KOBJMETHOD_END, this is to serve as the end marker in an array of
  resource_spec structures.

Modified:
  head/sys/sys/bus.h

Modified: head/sys/sys/bus.h
==
--- head/sys/sys/bus.h  Sat Oct 28 18:54:45 2017(r325059)
+++ head/sys/sys/bus.h  Sat Oct 28 18:56:27 2017(r325060)
@@ -491,6 +491,7 @@ struct resource_spec {
int rid;
int flags;
 };
+#defineRESOURCE_SPEC_END   {-1, 0, 0}
 
 intbus_alloc_resources(device_t dev, struct resource_spec *rs,
struct resource **res);
___
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: r325059 - head/contrib/tzdata

2017-10-28 Thread Philip Paeps
Author: philip
Date: Sat Oct 28 18:54:45 2017
New Revision: 325059
URL: https://svnweb.freebsd.org/changeset/base/325059

Log:
  Import tzdata 2017c
  
  Changes: https://mm.icann.org/pipermail/tz-announce/2017-October/47.html
  
  MFC after:2 days

Added:
  head/contrib/tzdata/calendars
 - copied unchanged from r325057, vendor/tzdata/dist/calendars
  head/contrib/tzdata/theory.html
 - copied unchanged from r325057, vendor/tzdata/dist/theory.html
  head/contrib/tzdata/zishrink.awk
 - copied unchanged from r325057, vendor/tzdata/dist/zishrink.awk
Deleted:
  head/contrib/tzdata/Theory
Modified:
  head/contrib/tzdata/CONTRIBUTING
  head/contrib/tzdata/LICENSE
  head/contrib/tzdata/Makefile
  head/contrib/tzdata/NEWS
  head/contrib/tzdata/africa
  head/contrib/tzdata/antarctica
  head/contrib/tzdata/asia
  head/contrib/tzdata/australasia
  head/contrib/tzdata/backward
  head/contrib/tzdata/backzone
  head/contrib/tzdata/checklinks.awk
  head/contrib/tzdata/europe
  head/contrib/tzdata/leap-seconds.list
  head/contrib/tzdata/leapseconds
  head/contrib/tzdata/leapseconds.awk
  head/contrib/tzdata/northamerica
  head/contrib/tzdata/southamerica
  head/contrib/tzdata/version
  head/contrib/tzdata/zone.tab
  head/contrib/tzdata/zone1970.tab
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/CONTRIBUTING
==
--- head/contrib/tzdata/CONTRIBUTINGSat Oct 28 17:45:42 2017
(r325058)
+++ head/contrib/tzdata/CONTRIBUTINGSat Oct 28 18:54:45 2017
(r325059)
@@ -5,20 +5,26 @@ change timekeeping rules erratically and sometimes wit
 warning, the data entries do not cover all of civil time before
 1970, and undoubtedly errors remain in the code and data.  Feel
 free to fill gaps or fix mistakes, and please email improvements
-to t...@iana.org for use in the future.
+to t...@iana.org for use in the future.  In your email, please give
+reliable sources that reviewers can check.
 
+-
+
+Developers can contribute technical changes to the source code and
+data as follows.
+
 To email small changes, please run a POSIX shell command like
 'diff -u old/europe new/europe >myfix.patch', and attach
 myfix.patch to the email.
 
-For more-elaborate changes, please read the Theory file and browse
-the mailing list archives  for
-examples of patches that tend to work well.  Ideally, additions to
+For more-elaborate changes, please read the theory.html file and browse
+the mailing list archives  for
+examples of patches that tend to work well.  Additions to
 data should contain commentary citing reliable sources as
-justification.
+justification.  Citations should use https: URLs if available.
 
 Please submit changes against either the latest release in
- or the master branch of the development
+ or the master branch of the development
 repository.  If you use Git the following workflow may be helpful:
 
   * Copy the development repository.

Modified: head/contrib/tzdata/LICENSE
==
--- head/contrib/tzdata/LICENSE Sat Oct 28 17:45:42 2017(r325058)
+++ head/contrib/tzdata/LICENSE Sat Oct 28 18:54:45 2017(r325059)
@@ -1,4 +1,5 @@
-With a few exceptions, all files in the tz code and data (including
-this one) are in the public domain.  The exceptions are date.c,
-newstrftime.3, and strftime.c, which contain material derived from BSD
-and which use the BSD 3-clause license.
+Unless specified below, all files in the tz code and data (including
+this LICENSE file) are in the public domain.
+
+If the files date.c, newstrftime.3, and strftime.c are present, they
+contain material derived from BSD and use the BSD 3-clause license.

Modified: head/contrib/tzdata/Makefile
==
--- head/contrib/tzdata/MakefileSat Oct 28 17:45:42 2017
(r325058)
+++ head/contrib/tzdata/MakefileSat Oct 28 18:54:45 2017
(r325059)
@@ -49,6 +49,7 @@ TOPDIR=   /usr/local
 # "Compiled" time zone information is placed in the "TZDIR" directory
 # (and subdirectories).
 # Use an absolute path name for TZDIR unless you're just testing the software.
+# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
 
 TZDIR_BASENAME=zoneinfo
 TZDIR= $(TOPDIR)/etc/$(TZDIR_BASENAME)
@@ -75,7 +76,7 @@ LIBDIR=   $(TOPDIR)/lib
 # If you want only POSIX time, with time values interpreted as
 # seconds since the epoch (not counting leap seconds), use
 #  REDO=   posix_only
-# below.  If you want want only "right" time, with values interpreted
+# below.  If you want only "right" time, with values interpreted
 # as seconds since the epoch (counting 

svn commit: r325058 - vendor/tzdata/tzdata2017c

2017-10-28 Thread Philip Paeps
Author: philip
Date: Sat Oct 28 17:45:42 2017
New Revision: 325058
URL: https://svnweb.freebsd.org/changeset/base/325058

Log:
  Tag import of tzdata 2017c

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


svn commit: r325057 - vendor/tzdata/dist

2017-10-28 Thread Philip Paeps
Author: philip
Date: Sat Oct 28 17:43:05 2017
New Revision: 325057
URL: https://svnweb.freebsd.org/changeset/base/325057

Log:
  Import tzdata 2017c

Added:
  vendor/tzdata/dist/calendars
  vendor/tzdata/dist/theory.html   (contents, props changed)
  vendor/tzdata/dist/zishrink.awk   (contents, props changed)
Deleted:
  vendor/tzdata/dist/Theory
Modified:
  vendor/tzdata/dist/CONTRIBUTING
  vendor/tzdata/dist/LICENSE
  vendor/tzdata/dist/Makefile
  vendor/tzdata/dist/NEWS
  vendor/tzdata/dist/africa
  vendor/tzdata/dist/antarctica
  vendor/tzdata/dist/asia
  vendor/tzdata/dist/australasia
  vendor/tzdata/dist/backward
  vendor/tzdata/dist/backzone
  vendor/tzdata/dist/checklinks.awk
  vendor/tzdata/dist/europe
  vendor/tzdata/dist/leap-seconds.list
  vendor/tzdata/dist/leapseconds
  vendor/tzdata/dist/leapseconds.awk
  vendor/tzdata/dist/northamerica
  vendor/tzdata/dist/southamerica
  vendor/tzdata/dist/version
  vendor/tzdata/dist/zone.tab
  vendor/tzdata/dist/zone1970.tab

Modified: vendor/tzdata/dist/CONTRIBUTING
==
--- vendor/tzdata/dist/CONTRIBUTING Sat Oct 28 17:30:49 2017
(r325056)
+++ vendor/tzdata/dist/CONTRIBUTING Sat Oct 28 17:43:05 2017
(r325057)
@@ -5,20 +5,26 @@ change timekeeping rules erratically and sometimes wit
 warning, the data entries do not cover all of civil time before
 1970, and undoubtedly errors remain in the code and data.  Feel
 free to fill gaps or fix mistakes, and please email improvements
-to t...@iana.org for use in the future.
+to t...@iana.org for use in the future.  In your email, please give
+reliable sources that reviewers can check.
 
+-
+
+Developers can contribute technical changes to the source code and
+data as follows.
+
 To email small changes, please run a POSIX shell command like
 'diff -u old/europe new/europe >myfix.patch', and attach
 myfix.patch to the email.
 
-For more-elaborate changes, please read the Theory file and browse
-the mailing list archives  for
-examples of patches that tend to work well.  Ideally, additions to
+For more-elaborate changes, please read the theory.html file and browse
+the mailing list archives  for
+examples of patches that tend to work well.  Additions to
 data should contain commentary citing reliable sources as
-justification.
+justification.  Citations should use https: URLs if available.
 
 Please submit changes against either the latest release in
- or the master branch of the development
+ or the master branch of the development
 repository.  If you use Git the following workflow may be helpful:
 
   * Copy the development repository.

Modified: vendor/tzdata/dist/LICENSE
==
--- vendor/tzdata/dist/LICENSE  Sat Oct 28 17:30:49 2017(r325056)
+++ vendor/tzdata/dist/LICENSE  Sat Oct 28 17:43:05 2017(r325057)
@@ -1,4 +1,5 @@
-With a few exceptions, all files in the tz code and data (including
-this one) are in the public domain.  The exceptions are date.c,
-newstrftime.3, and strftime.c, which contain material derived from BSD
-and which use the BSD 3-clause license.
+Unless specified below, all files in the tz code and data (including
+this LICENSE file) are in the public domain.
+
+If the files date.c, newstrftime.3, and strftime.c are present, they
+contain material derived from BSD and use the BSD 3-clause license.

Modified: vendor/tzdata/dist/Makefile
==
--- vendor/tzdata/dist/Makefile Sat Oct 28 17:30:49 2017(r325056)
+++ vendor/tzdata/dist/Makefile Sat Oct 28 17:43:05 2017(r325057)
@@ -49,6 +49,7 @@ TOPDIR=   /usr/local
 # "Compiled" time zone information is placed in the "TZDIR" directory
 # (and subdirectories).
 # Use an absolute path name for TZDIR unless you're just testing the software.
+# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
 
 TZDIR_BASENAME=zoneinfo
 TZDIR= $(TOPDIR)/etc/$(TZDIR_BASENAME)
@@ -75,7 +76,7 @@ LIBDIR=   $(TOPDIR)/lib
 # If you want only POSIX time, with time values interpreted as
 # seconds since the epoch (not counting leap seconds), use
 #  REDO=   posix_only
-# below.  If you want want only "right" time, with values interpreted
+# below.  If you want only "right" time, with values interpreted
 # as seconds since the epoch (counting leap seconds), use
 #  REDO=   right_only
 # below.  If you want both sets of data available, with leap seconds not
@@ -92,6 +93,24 @@ LIBDIR=  $(TOPDIR)/lib
 
 REDO=  posix_right
 
+# To install data in text form that has all the information of the binary data,
+# (optionally incorporating leap second information), use
+#  

svn commit: r325056 - head/sys/dev/ffec

2017-10-28 Thread Ian Lepore
Author: ian
Date: Sat Oct 28 17:30:49 2017
New Revision: 325056
URL: https://svnweb.freebsd.org/changeset/base/325056

Log:
  Avoid AXI bus issues due to a MAC reset on imx6sx and imx7.
  
  When the FEC is connected to the AXI bus (indicated by AVB flag), a
  MAC reset while a bus transaction is pending can hang the bus.
  Instead of resetting, turn off the ENABLE bit, which allows the
  hardware to complete any in-progress transfers (appending a bad CRC
  to any partial packet) and release the AXI bus.  This could probably
  be done unconditionally for all hardware variants, but that hasn't
  been tested.
  
  PR:   222634
  Submitted by: sebastian.hu...@embedded-brains.de

Modified:
  head/sys/dev/ffec/if_ffec.c

Modified: head/sys/dev/ffec/if_ffec.c
==
--- head/sys/dev/ffec/if_ffec.c Sat Oct 28 17:06:13 2017(r325055)
+++ head/sys/dev/ffec/if_ffec.c Sat Oct 28 17:30:49 2017(r325056)
@@ -1639,8 +1639,21 @@ ffec_attach(device_t dev)
/* Try to get the MAC address from the hardware before resetting it. */
ffec_get_hwaddr(sc, eaddr);
 
-   /* Reset the hardware.  Disables all interrupts. */
-   WR4(sc, FEC_ECR_REG, FEC_ECR_RESET);
+   /*
+* Reset the hardware.  Disables all interrupts.
+*
+* When the FEC is connected to the AXI bus (indicated by AVB flag), a
+* MAC reset while a bus transaction is pending can hang the bus.
+* Instead of resetting, turn off the ENABLE bit, which allows the
+* hardware to complete any in-progress transfers (appending a bad CRC
+* to any partial packet) and release the AXI bus.  This could probably
+* be done unconditionally for all hardware variants, but that hasn't
+* been tested.
+*/
+   if (sc->fectype & FECFLAG_AVB)
+   WR4(sc, FEC_ECR_REG, 0);
+   else
+   WR4(sc, FEC_ECR_REG, FEC_ECR_RESET);
 
/* Setup interrupt handler. */
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
___
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: r325055 - head/sys/dev/ffec

2017-10-28 Thread Ian Lepore
Author: ian
Date: Sat Oct 28 17:06:13 2017
New Revision: 325055
URL: https://svnweb.freebsd.org/changeset/base/325055

Log:
  Add FECFLAG_AVB variant flag to support new features on imx7.
  
  This flag is analogous to the Linux driver FEC_QUIRK_HAS_AVB.  It
  indicates an FEC with support for Audio Video Bridging (AVB).  This
  indicator is used for various other parts in the Linux driver
  (drivers/net/ethernet/freescale/fec_main.c).
  
  Use it to customize the receive/transmit buffer alignment.  The receive
  buffer alignment increased to 64-bytes on the i.MX 6SoloX and i.MX
  7Dual.  There are no hard alignment restrictions for transmit buffers on
  these chips.
  
  Fix the ffec_softc::fectype type to provide enough storage for the
  feature flags.
  
  PR:   222634
  Submitted by: sebastian.hu...@embedded-brains.de

Modified:
  head/sys/dev/ffec/if_ffec.c
  head/sys/dev/ffec/if_ffecreg.h

Modified: head/sys/dev/ffec/if_ffec.c
==
--- head/sys/dev/ffec/if_ffec.c Sat Oct 28 16:50:23 2017(r325054)
+++ head/sys/dev/ffec/if_ffec.c Sat Oct 28 17:06:13 2017(r325055)
@@ -97,7 +97,7 @@ enum {
FECTYPE_NONE,
FECTYPE_GENERIC,
FECTYPE_IMX53,
-   FECTYPE_IMX6,
+   FECTYPE_IMX6,   /* imx6 and imx7 */
FECTYPE_MVF,
 };
 
@@ -106,7 +106,8 @@ enum {
  * SoCs.  These are ORed into the FECTYPE enum values.
  */
 #defineFECTYPE_MASK0x
-#defineFECFLAG_GBE (0x0001 << 16)
+#defineFECFLAG_GBE (1 << 16)
+#defineFECFLAG_AVB (1 << 17)
 
 /*
  * Table of supported FDT compat strings and their associated FECTYPE values.
@@ -116,6 +117,7 @@ static struct ofw_compat_data compat_data[] = {
{"fsl,imx53-fec",   FECTYPE_IMX53},
{"fsl,imx6q-fec",   FECTYPE_IMX6 | FECFLAG_GBE},
{"fsl,imx6ul-fec",  FECTYPE_IMX6},
+   {"fsl,imx7d-fec",   FECTYPE_IMX6 | FECFLAG_GBE | FECFLAG_AVB},
{"fsl,mvf600-fec",  FECTYPE_MVF},
{"fsl,mvf-fec", FECTYPE_MVF},
{NULL,  FECTYPE_NONE},
@@ -148,11 +150,13 @@ struct ffec_softc {
void *  intr_cookie;
struct callout  ffec_callout;
mii_contype_t   phy_conn_type;
-   uint8_t fectype;
+   uintptr_t   fectype;
boolean_t   link_is_up;
boolean_t   is_attached;
boolean_t   is_detaching;
int tx_watchdog_count;
+   int rxbuf_align;
+   int txbuf_align;
 
bus_dma_tag_t   rxdesc_tag;
bus_dmamap_trxdesc_map;
@@ -754,7 +758,7 @@ ffec_setup_rxbuf(struct ffec_softc *sc, int idx, struc
 * have to ensure that the beginning of the buffer is aligned to the
 * hardware's requirements.
 */
-   m_adj(m, roundup(ETHER_ALIGN, FEC_RXBUF_ALIGN));
+   m_adj(m, roundup(ETHER_ALIGN, sc->rxbuf_align));
 
error = bus_dmamap_load_mbuf_sg(sc->rxbuf_tag, sc->rxbuf_map[idx].map,
m, , , 0);
@@ -1098,7 +1102,7 @@ ffec_init_locked(struct ffec_softc *sc)
 * when we support jumbo frames and receiving fragments of them into
 * separate buffers.
 */
-   maxbuf = MCLBYTES - roundup(ETHER_ALIGN, FEC_RXBUF_ALIGN);
+   maxbuf = MCLBYTES - roundup(ETHER_ALIGN, sc->rxbuf_align);
maxfl = min(maxbuf, 0x7ff);
 
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
@@ -1450,6 +1454,14 @@ ffec_attach(device_t dev)
 */
sc->fectype = ofw_bus_search_compatible(dev, compat_data)->ocd_data;
 
+   if (sc->fectype & FECFLAG_AVB) {
+   sc->rxbuf_align = 64;
+   sc->txbuf_align = 1;
+   } else {
+   sc->rxbuf_align = 16;
+   sc->txbuf_align = 16;
+   }
+
/*
 * We have to be told what kind of electrical connection exists between
 * the MAC and PHY or we can't operate correctly.
@@ -1525,7 +1537,7 @@ ffec_attach(device_t dev)
 
error = bus_dma_tag_create(
bus_get_dma_tag(dev),   /* Parent tag. */
-   FEC_TXBUF_ALIGN, 0, /* alignment, boundary */
+   sc->txbuf_align, 0, /* alignment, boundary */
BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
BUS_SPACE_MAXADDR,  /* highaddr */
NULL, NULL, /* filter, filterarg */

Modified: head/sys/dev/ffec/if_ffecreg.h
==
--- head/sys/dev/ffec/if_ffecreg.h  Sat Oct 28 16:50:23 2017
(r325054)
+++ head/sys/dev/ffec/if_ffecreg.h  Sat Oct 28 17:06:13 2017
(r325055)
@@ -318,7 +318,5 @@ struct ffec_hwdesc
  * DMA transfers.  These values are expressed in bytes (not bits).
  */
 

svn commit: r325054 - head/sys/dev/ffec

2017-10-28 Thread Ian Lepore
Author: ian
Date: Sat Oct 28 16:50:23 2017
New Revision: 325054
URL: https://svnweb.freebsd.org/changeset/base/325054

Log:
  Increase the alignment of the rx/tx descriptor ring buffers to 64 bytes.
  
  16 was the correct alignment for older hardware, but the imx7 requires
  64-byte alignment, which is a fine value to use on all systems.
  
  PR:   222634
  Submitted by: sebastian.hu...@embedded-brains.de

Modified:
  head/sys/dev/ffec/if_ffecreg.h

Modified: head/sys/dev/ffec/if_ffecreg.h
==
--- head/sys/dev/ffec/if_ffecreg.h  Sat Oct 28 07:06:57 2017
(r325053)
+++ head/sys/dev/ffec/if_ffecreg.h  Sat Oct 28 16:50:23 2017
(r325054)
@@ -317,7 +317,7 @@ struct ffec_hwdesc
  * The hardware imposes alignment restrictions on various objects involved in
  * DMA transfers.  These values are expressed in bytes (not bits).
  */
-#defineFEC_DESC_RING_ALIGN 16
+#defineFEC_DESC_RING_ALIGN 64
 #defineFEC_RXBUF_ALIGN 16
 #defineFEC_TXBUF_ALIGN 16
 
___
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: r325053 - in stable/10/share/man: man5 man8

2017-10-28 Thread Stefan Esser
Author: se
Date: Sat Oct 28 07:06:57 2017
New Revision: 325053
URL: https://svnweb.freebsd.org/changeset/base/325053

Log:
  MFC 324721: Add references to sysrc(8) to SEE ALSO.
  MFC 324823: Mention sysrc(8) as scripting interface for config files.

Modified:
  stable/10/share/man/man5/rc.conf.5
  stable/10/share/man/man8/rc.8
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man5/rc.conf.5
==
--- stable/10/share/man/man5/rc.conf.5  Sat Oct 28 07:06:30 2017
(r325052)
+++ stable/10/share/man/man5/rc.conf.5  Sat Oct 28 07:06:57 2017
(r325053)
@@ -64,6 +64,9 @@ is used to override settings in
 .Pa /etc/rc.conf
 for historical reasons.
 .Pp
+The sysrc(8) command provides a scripting interface to modify system
+config files.
+.Pp
 In addition to
 .Pa /etc/rc.conf.local
 you can also place smaller configuration files for each
@@ -4693,6 +4696,7 @@ configuration file.
 .Xr swapon 8 ,
 .Xr sysctl 8 ,
 .Xr syslogd 8 ,
+.Xr sysrc 8 ,
 .Xr timed 8 ,
 .Xr unbound 8 ,
 .Xr usbconfig 8 ,

Modified: stable/10/share/man/man8/rc.8
==
--- stable/10/share/man/man8/rc.8   Sat Oct 28 07:06:30 2017
(r325052)
+++ stable/10/share/man/man8/rc.8   Sat Oct 28 07:06:57 2017
(r325053)
@@ -91,6 +91,9 @@ The
 .Nm rc.d/
 directories contain scripts which will be automatically
 executed at boot time and shutdown time.
+.Pp
+The sysrc(8) command provides a scripting interface to modify system
+config files.
 .Ss Operation of Nm
 .Bl -enum
 .It
@@ -557,7 +560,8 @@ is unnecessary, but is often included.
 .Xr rcorder 8 ,
 .Xr rc.subr 8 ,
 .Xr reboot 8 ,
-.Xr savecore 8
+.Xr savecore 8 ,
+.Xr sysrc 8
 .Sh HISTORY
 The
 .Nm
___
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: r325052 - in stable/11/share/man: man5 man8

2017-10-28 Thread Stefan Esser
Author: se
Date: Sat Oct 28 07:06:30 2017
New Revision: 325052
URL: https://svnweb.freebsd.org/changeset/base/325052

Log:
  MFC 324721: Add references to sysrc(8) to SEE ALSO.
  MFC 324823: Mention sysrc(8) as scripting interface for config files.

Modified:
  stable/11/share/man/man5/rc.conf.5
  stable/11/share/man/man8/rc.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man5/rc.conf.5
==
--- stable/11/share/man/man5/rc.conf.5  Sat Oct 28 02:51:27 2017
(r325051)
+++ stable/11/share/man/man5/rc.conf.5  Sat Oct 28 07:06:30 2017
(r325052)
@@ -64,6 +64,9 @@ is used to override settings in
 .Pa /etc/rc.conf
 for historical reasons.
 .Pp
+The sysrc(8) command provides a scripting interface to modify system
+config files.
+.Pp
 In addition to
 .Pa /etc/rc.conf.local
 you can also place smaller configuration files for each
@@ -4666,6 +4669,7 @@ configuration file.
 .Xr swapon 8 ,
 .Xr sysctl 8 ,
 .Xr syslogd 8 ,
+.Xr sysrc 8 ,
 .Xr timed 8 ,
 .Xr unbound 8 ,
 .Xr usbconfig 8 ,

Modified: stable/11/share/man/man8/rc.8
==
--- stable/11/share/man/man8/rc.8   Sat Oct 28 02:51:27 2017
(r325051)
+++ stable/11/share/man/man8/rc.8   Sat Oct 28 07:06:30 2017
(r325052)
@@ -87,6 +87,9 @@ The
 .Nm rc.d/
 directories contain scripts which will be automatically
 executed at boot time and shutdown time.
+.Pp
+The sysrc(8) command provides a scripting interface to modify system
+config files.
 .Ss Operation of Nm
 .Bl -enum
 .It
@@ -557,7 +560,8 @@ is unnecessary, but is often included.
 .Xr rc.subr 8 ,
 .Xr rcorder 8 ,
 .Xr reboot 8 ,
-.Xr savecore 8
+.Xr savecore 8 ,
+.Xr sysrc 8
 .Sh HISTORY
 The
 .Nm
___
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"