From owner-svn-src-vendor@freebsd.org Mon Sep 5 15:20:57 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE727B96D95; Mon, 5 Sep 2016 15:20:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90595FF1; Mon, 5 Sep 2016 15:20:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u85FKu3x042513; Mon, 5 Sep 2016 15:20:56 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u85FKuSO042503; Mon, 5 Sep 2016 15:20:56 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201609051520.u85FKuSO042503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 5 Sep 2016 15:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r305420 - in vendor/libarchive/dist: . build/cmake libarchive libarchive/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2016 15:20:57 -0000 Author: mm Date: Mon Sep 5 15:20:55 2016 New Revision: 305420 URL: https://svnweb.freebsd.org/changeset/base/305420 Log: Update vendor/libarchive to git b4099917d6893ed77af24caff1156e044ebd4fa5 Vendor issues fixed: PR #777: Multiple bugfixes for setup_acls() This fixes a bug that caused ACLs not to be read properly for files and directories inside subdirectories and as a result not being stored in tar archives. Added: vendor/libarchive/dist/README.md Deleted: vendor/libarchive/dist/README Modified: vendor/libarchive/dist/CMakeLists.txt vendor/libarchive/dist/build/cmake/config.h.in vendor/libarchive/dist/configure.ac vendor/libarchive/dist/libarchive/archive_acl.c vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c vendor/libarchive/dist/libarchive/archive_read_disk_posix.c vendor/libarchive/dist/libarchive/config_freebsd.h vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c Modified: vendor/libarchive/dist/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/CMakeLists.txt Mon Sep 5 13:45:45 2016 (r305419) +++ vendor/libarchive/dist/CMakeLists.txt Mon Sep 5 15:20:55 2016 (r305420) @@ -1278,6 +1278,10 @@ CHECK_C_SOURCE_COMPILES( "#include \n#include \nint main(void) { struct vfsconf v; return sizeof(v);}" HAVE_STRUCT_VFSCONF) +CHECK_C_SOURCE_COMPILES( + "#include \n#include \nint main(void) { struct xvfsconf v; return sizeof(v);}" + HAVE_STRUCT_XVFSCONF) + # Make sure we have the POSIX version of readdir_r, not the # older 2-argument version. CHECK_C_SOURCE_COMPILES( @@ -1600,6 +1604,7 @@ IF(ENABLE_ACL) # test for specific permissions in a permset.) Linux uses the obvious # name, FreeBSD adds _np to mark it as "non-Posix extension." # Test for both as a double-check that we really have POSIX-style ACL support. + CHECK_FUNCTION_EXISTS(acl_get_fd_np HAVE_ACL_GET_FD_NP) CHECK_FUNCTION_EXISTS(acl_get_perm HAVE_ACL_GET_PERM) CHECK_FUNCTION_EXISTS(acl_get_perm_np HAVE_ACL_GET_PERM_NP) CHECK_FUNCTION_EXISTS(acl_get_link HAVE_ACL_GET_LINK) Added: vendor/libarchive/dist/README.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/README.md Mon Sep 5 15:20:55 2016 (r305420) @@ -0,0 +1,222 @@ +# Welcome to libarchive! + +The libarchive project develops a portable, efficient C library that +can read and write streaming archives in a variety of formats. It +also includes implementations of the common `tar`, `cpio`, and `zcat` +command-line tools that use the libarchive library. + +## Questions? Issues? + +* http://www.libarchive.org is the home for ongoing + libarchive development, including documentation, + and links to the libarchive mailing lists. +* To report an issue, use the issue tracker at + https://github.com/libarchive/libarchive/issues +* To submit an enhancement to libarchive, please + submit a pull request via GitHub: https://github.com/libarchive/libarchive/pulls + +## Contents of the Distribution + +This distribution bundle includes the following major components: + +* **libarchive**: a library for reading and writing streaming archives +* **tar**: the 'bsdtar' program is a full-featured 'tar' implementation built on libarchive +* **cpio**: the 'bsdcpio' program is a different interface to essentially the same functionality +* **cat**: the 'bsdcat' program is a simple replacement tool for zcat, bzcat, xzcat, and such +* **examples**: Some small example programs that you may find useful. +* **examples/minitar**: a compact sample demonstrating use of libarchive. +* **contrib**: Various items sent to me by third parties; please contact the authors with any questions. + +The top-level directory contains the following information files: + +* **NEWS** - highlights of recent changes +* **COPYING** - what you can do with this +* **INSTALL** - installation instructions +* **README** - this file +* **CMakeLists.txt** - input for "cmake" build tool, see INSTALL +* **configure** - configuration script, see INSTALL for details. If your copy of the source lacks a `configure` script, you can try to construct it by running the script in `build/autogen.sh` (or use `cmake`). + +The following files in the top-level directory are used by the 'configure' script: +* `Makefile.am`, `aclocal.m4`, `configure.ac` - used to build this distribution, only needed by maintainers +* `Makefile.in`, `config.h.in` - templates used by configure script + +## Documentation + +In addition to the informational articles and documentation +in the online [libarchive Wiki](https://github.com/libarchive/libarchive/wiki), +the distribution also includes a number of manual pages: + + * bsdtar.1 explains the use of the bsdtar program + * bsdcpio.1 explains the use of the bsdcpio program + * bsdcat.1 explains the use of the bsdcat program + * libarchive.3 gives an overview of the library as a whole + * archive_read.3, archive_write.3, archive_write_disk.3, and + archive_read_disk.3 provide detailed calling sequences for the read + and write APIs + * archive_entry.3 details the "struct archive_entry" utility class + * archive_internals.3 provides some insight into libarchive's + internal structure and operation. + * libarchive-formats.5 documents the file formats supported by the library + * cpio.5, mtree.5, and tar.5 provide detailed information about these + popular archive formats, including hard-to-find details about + modern cpio and tar variants. + +The manual pages above are provided in the 'doc' directory in +a number of different formats. + +You should also read the copious comments in `archive.h` and the +source code for the sample programs for more details. Please let us +know about any errors or omissions you find. + +## Supported Formats + +Currently, the library automatically detects and reads the following fomats: + * Old V7 tar archives + * POSIX ustar + * GNU tar format (including GNU long filenames, long link names, and sparse files) + * Solaris 9 extended tar format (including ACLs) + * POSIX pax interchange format + * POSIX octet-oriented cpio + * SVR4 ASCII cpio + * POSIX octet-oriented cpio + * Binary cpio (big-endian or little-endian) + * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) + * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) + * GNU and BSD 'ar' archives + * 'mtree' format + * 7-Zip archives + * Microsoft CAB format + * LHA and LZH archives + * RAR archives (with some limitations due to RAR's proprietary status) + * XAR archives + +The library also detects and handles any of the following before evaluating the archive: + * uuencoded files + * files with RPM wrapper + * gzip compression + * bzip2 compression + * compress/LZW compression + * lzma, lzip, and xz compression + * lz4 compression + * lzop compression + +The library can create archives in any of the following formats: + * POSIX ustar + * POSIX pax interchange format + * "restricted" pax format, which will create ustar archives except for + entries that require pax extensions (for long filenames, ACLs, etc). + * Old GNU tar format + * Old V7 tar format + * POSIX octet-oriented cpio + * SVR4 "newc" cpio + * shar archives + * ZIP archives (with uncompressed or "deflate" compressed entries) + * GNU and BSD 'ar' archives + * 'mtree' format + * ISO9660 format + * 7-Zip archives + * XAR archives + +When creating archives, the result can be filtered with any of the following: + * uuencode + * gzip compression + * bzip2 compression + * compress/LZW compression + * lzma, lzip, and xz compression + * lz4 compression + * lzop compression + +## Notes about the Library Design + +The following notes address many of the most common +questions we are asked about libarchive: + +* This is a heavily stream-oriented system. That means that + it is optimized to read or write the archive in a single + pass from beginning to end. For example, this allows + libarchive to process archives too large to store on disk + by processing them on-the-fly as they are read from or + written to a network or tape drive. This also makes + libarchive useful for tools that need to produce + archives on-the-fly (such as webservers that provide + archived contents of a users account). + +* In-place modification and random access to the contents + of an archive are not directly supported. For some formats, + this is not an issue: For example, tar.gz archives are not + designed for random access. In some other cases, libarchive + can re-open an archive and scan it from the beginning quickly + enough to provide the needed abilities even without true + random access. Of course, some applications do require true + random access; those applications should consider alternatives + to libarchive. + +* The library is designed to be extended with new compression and + archive formats. The only requirement is that the format be + readable or writable as a stream and that each archive entry be + independent. There are articles on the libarchive Wiki explaining + how to extend libarchive. + +* On read, compression and format are always detected automatically. + +* The same API is used for all formats; in particular, it's very + easy for software using libarchive to transparently handle + any of libarchive's archiving formats. + +* Libarchive's automatic support for decompression can be used + without archiving by explicitly selecting the "raw" and "empty" + formats. + +* I've attempted to minimize static link pollution. If you don't + explicitly invoke a particular feature (such as support for a + particular compression or format), it won't get pulled in to + statically-linked programs. In particular, if you don't explicitly + enable a particular compression or decompression support, you won't + need to link against the corresponding compression or decompression + libraries. This also reduces the size of statically-linked + binaries in environments where that matters. + +* The library is generally _thread safe_ depending on the platform: + it does not define any global variables of its own. However, some + platforms do not provide fully thread-safe versions of key C library + functions. On those platforms, libarchive will use the non-thread-safe + functions. Patches to improve this are of great interest to us. + +* In particular, libarchive's modules to read or write a directory + tree do use `chdir()` to optimize the directory traversals. This + can cause problems for programs that expect to do disk access from + multiple threads. Of course, those modules are completely + optional and you can use the rest of libarchive without them. + +* The library is _not_ thread aware, however. It does no locking + or thread management of any kind. If you create a libarchive + object and need to access it from multiple threads, you will + need to provide your own locking. + +* On read, the library accepts whatever blocks you hand it. + Your read callback is free to pass the library a byte at a time + or mmap the entire archive and give it to the library at once. + On write, the library always produces correctly-blocked output. + +* The object-style approach allows you to have multiple archive streams + open at once. bsdtar uses this in its "@archive" extension. + +* The archive itself is read/written using callback functions. + You can read an archive directly from an in-memory buffer or + write it to a socket, if you wish. There are some utility + functions to provide easy-to-use "open file," etc, capabilities. + +* The read/write APIs are designed to allow individual entries + to be read or written to any data source: You can create + a block of data in memory and add it to a tar archive without + first writing a temporary file. You can also read an entry from + an archive and write the data directly to a socket. If you want + to read/write entries to disk, there are convenience functions to + make this especially easy. + +* Note: The "pax interchange format" is a POSIX standard extended tar + format that should be used when the older _ustar_ format is not + appropriate. It has many advantages over other tar formats + (including the legacy GNU tar format) and is widely supported by + current tar implementations. + Modified: vendor/libarchive/dist/build/cmake/config.h.in ============================================================================== --- vendor/libarchive/dist/build/cmake/config.h.in Mon Sep 5 13:45:45 2016 (r305419) +++ vendor/libarchive/dist/build/cmake/config.h.in Mon Sep 5 15:20:55 2016 (r305420) @@ -293,6 +293,9 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the `acl_create_entry' function. */ #cmakedefine HAVE_ACL_CREATE_ENTRY 1 +/* Define to 1 if you have the `acl_get_fd_np' function. */ +#cmakedefine HAVE_ACL_GET_FD_NP 1 + /* Define to 1 if you have the `acl_get_link' function. */ #cmakedefine HAVE_ACL_GET_LINK 1 @@ -929,6 +932,9 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have `struct vfsconf'. */ #cmakedefine HAVE_STRUCT_VFSCONF 1 +/* Define to 1 if you have `struct xvfsconf'. */ +#cmakedefine HAVE_STRUCT_XVFSCONF 1 + /* Define to 1 if you have the `symlink' function. */ #cmakedefine HAVE_SYMLINK 1 Modified: vendor/libarchive/dist/configure.ac ============================================================================== --- vendor/libarchive/dist/configure.ac Mon Sep 5 13:45:45 2016 (r305419) +++ vendor/libarchive/dist/configure.ac Mon Sep 5 15:20:55 2016 (r305420) @@ -624,6 +624,13 @@ AC_CHECK_TYPES(struct vfsconf,,, #include ]) +AC_CHECK_TYPES(struct xvfsconf,,, + [#if HAVE_SYS_TYPES_H + #include + #endif + #include + ]) + # There are several variants of readdir_r around; we only # accept the POSIX-compliant version. AC_COMPILE_IFELSE( @@ -688,7 +695,8 @@ if test "x$enable_acl" != "xno"; then AC_CHECK_HEADERS([acl/libacl.h]) AC_CHECK_HEADERS([sys/acl.h]) AC_CHECK_LIB([acl],[acl_get_file]) - AC_CHECK_FUNCS([acl_create_entry acl_init acl_set_fd acl_set_fd_np acl_set_file]) + AC_CHECK_FUNCS([acl_create_entry acl_get_fd_np]) + AC_CHECK_FUNCS([acl_init acl_set_fd acl_set_fd_np acl_set_file]) AC_CHECK_TYPES(acl_permset_t,,, [#if HAVE_SYS_TYPES_H Modified: vendor/libarchive/dist/libarchive/archive_acl.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_acl.c Mon Sep 5 13:45:45 2016 (r305419) +++ vendor/libarchive/dist/libarchive/archive_acl.c Mon Sep 5 15:20:55 2016 (r305420) @@ -707,10 +707,11 @@ archive_acl_text_l(struct archive_acl *a if (r != 0) return (-1); *p++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) + if (name == NULL || (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)) { id = ap->id; - else + } else { id = -1; + } append_entry(&p, NULL, ap->tag, name, ap->permset, id); count++; Modified: vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c Mon Sep 5 13:45:45 2016 (r305419) +++ vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c Mon Sep 5 15:20:55 2016 (r305420) @@ -419,12 +419,32 @@ setup_acls(struct archive_read_disk *a, if (accpath == NULL) accpath = archive_entry_pathname(entry); + if (*fd < 0 && a->tree != NULL) { + if (a->follow_symlinks || + archive_entry_filetype(entry) != AE_IFLNK) + *fd = a->open_on_current_dir(a->tree, + accpath, O_RDONLY | O_NONBLOCK); + if (*fd < 0) { + if (a->tree_enter_working_dir(a->tree) != 0) { + archive_set_error(&a->archive, errno, + "Couldn't access %s", accpath); + return (ARCHIVE_FAILED); + } + } + } + archive_entry_acl_clear(entry); + acl = NULL; + #ifdef ACL_TYPE_NFS4 /* Try NFS4 ACL first. */ if (*fd >= 0) +#if HAVE_ACL_GET_FD_NP + acl = acl_get_fd_np(*fd, ACL_TYPE_NFS4); +#else acl = acl_get_fd(*fd); +#endif #if HAVE_ACL_GET_LINK_NP else if (!a->follow_symlinks) acl = acl_get_link_np(accpath, ACL_TYPE_NFS4); @@ -437,12 +457,19 @@ setup_acls(struct archive_read_disk *a, #endif else acl = acl_get_file(accpath, ACL_TYPE_NFS4); + #if HAVE_ACL_IS_TRIVIAL_NP - /* Ignore "trivial" ACLs that just mirror the file mode. */ - acl_is_trivial_np(acl, &r); - if (r) { - acl_free(acl); - acl = NULL; + if (acl != NULL && acl_is_trivial_np(acl, &r) == 0) { + /* Ignore "trivial" ACLs that just mirror the file mode. */ + if (r) { + acl_free(acl); + acl = NULL; + /* + * Simultaneous NFSv4 and POSIX.1e ACLs for the same + * entry are not allowed, so we should return here + */ + return (ARCHIVE_OK); + } } #endif if (acl != NULL) { @@ -450,7 +477,7 @@ setup_acls(struct archive_read_disk *a, acl_free(acl); return (ARCHIVE_OK); } -#endif +#endif /* ACL_TYPE_NFS4 */ /* Retrieve access ACL from file. */ if (*fd >= 0) @@ -467,10 +494,22 @@ setup_acls(struct archive_read_disk *a, #endif else acl = acl_get_file(accpath, ACL_TYPE_ACCESS); + +#if HAVE_ACL_IS_TRIVIAL_NP + /* Ignore "trivial" ACLs that just mirror the file mode. */ + if (acl != NULL && acl_is_trivial_np(acl, &r) == 0) { + if (r) { + acl_free(acl); + acl = NULL; + } + } +#endif + if (acl != NULL) { translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); acl_free(acl); + acl = NULL; } /* Only directories can have default ACLs. */ Modified: vendor/libarchive/dist/libarchive/archive_read_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Mon Sep 5 13:45:45 2016 (r305419) +++ vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Mon Sep 5 15:20:55 2016 (r305420) @@ -1504,10 +1504,19 @@ setup_current_filesystem(struct archive_ struct tree *t = a->tree; struct statfs sfs; #if defined(HAVE_GETVFSBYNAME) && defined(VFCF_SYNTHETIC) -# if defined(HAVE_STRUCT_VFSCONF) - struct vfsconf vfc; -# else +/* TODO: configure should set GETVFSBYNAME_ARG_TYPE to make + * this accurate; some platforms have both and we need the one that's + * used by getvfsbyname() + * + * Then the following would become: + * #if defined(GETVFSBYNAME_ARG_TYPE) + * GETVFSBYNAME_ARG_TYPE vfc; + * #endif + */ +# if defined(HAVE_STRUCT_XVFSCONF) struct xvfsconf vfc; +# else + struct vfsconf vfc; # endif #endif int r, xr = 0; Modified: vendor/libarchive/dist/libarchive/config_freebsd.h ============================================================================== --- vendor/libarchive/dist/libarchive/config_freebsd.h Mon Sep 5 13:45:45 2016 (r305419) +++ vendor/libarchive/dist/libarchive/config_freebsd.h Mon Sep 5 15:20:55 2016 (r305420) @@ -28,6 +28,7 @@ /* FreeBSD 5.0 and later have ACL and extattr support. */ #if __FreeBSD__ > 4 #define HAVE_ACL_CREATE_ENTRY 1 +#define HAVE_ACL_GET_FD_NP 1 #define HAVE_ACL_GET_LINK_NP 1 #define HAVE_ACL_GET_PERM_NP 1 #define HAVE_ACL_INIT 1 Modified: vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c Mon Sep 5 13:45:45 2016 (r305419) +++ vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c Mon Sep 5 15:20:55 2016 (r305420) @@ -70,15 +70,9 @@ set_acls(struct archive_entry *ae, struc } static int -acl_match(acl_entry_t aclent, struct myacl_t *myacl) -{ - gid_t g, *gp; - uid_t u, *up; - acl_tag_t tag_type; - acl_permset_t opaque_ps; +acl_entry_get_perm(acl_entry_t aclent) { int permset = 0; - - acl_get_tag_type(aclent, &tag_type); + acl_permset_t opaque_ps; /* translate the silly opaque permset to a bitmap */ acl_get_permset(aclent, &opaque_ps); @@ -88,10 +82,61 @@ acl_match(acl_entry_t aclent, struct mya permset |= ARCHIVE_ENTRY_ACL_WRITE; if (acl_get_perm_np(opaque_ps, ACL_READ)) permset |= ARCHIVE_ENTRY_ACL_READ; + return permset; +} + +#if 0 +static int +acl_get_specific_entry(acl_t acl, acl_tag_t requested_tag_type, int requested_tag) { + int entry_id = ACL_FIRST_ENTRY; + acl_entry_t acl_entry; + acl_tag_t acl_tag_type; + + while (1 == acl_get_entry(acl, entry_id, &acl_entry)) { + /* After the first time... */ + entry_id = ACL_NEXT_ENTRY; + + /* If this matches, return perm mask */ + acl_get_tag_type(acl_entry, &acl_tag_type); + if (acl_tag_type == requested_tag_type) { + switch (acl_tag_type) { + case ACL_USER_OBJ: + if ((uid_t)requested_tag == *(uid_t *)(acl_get_qualifier(acl_entry))) { + return acl_entry_get_perm(acl_entry); + } + break; + case ACL_GROUP_OBJ: + if ((gid_t)requested_tag == *(gid_t *)(acl_get_qualifier(acl_entry))) { + return acl_entry_get_perm(acl_entry); + } + break; + case ACL_USER: + case ACL_GROUP: + case ACL_OTHER: + return acl_entry_get_perm(acl_entry); + default: + failure("Unexpected ACL tag type"); + assert(0); + } + } + - if (permset != myacl->permset) + } + return -1; +} +#endif + +static int +acl_match(acl_entry_t aclent, struct myacl_t *myacl) +{ + gid_t g, *gp; + uid_t u, *up; + acl_tag_t tag_type; + + if (myacl->permset != acl_entry_get_perm(aclent)) return (0); + acl_get_tag_type(aclent, &tag_type); switch (tag_type) { case ACL_USER_OBJ: if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0); @@ -190,7 +235,7 @@ compare_acls(acl_t acl, struct myacl_t * * Verify ACL restore-to-disk. This test is FreeBSD-specific. */ -DEFINE_TEST(test_acl_freebsd_posix1e) +DEFINE_TEST(test_acl_freebsd_posix1e_restore) { #if !defined(__FreeBSD__) skipping("FreeBSD-specific ACL restore test"); @@ -263,3 +308,111 @@ DEFINE_TEST(test_acl_freebsd_posix1e) acl_free(acl); #endif } + +/* + * Verify ACL reaed-from-disk. This test is FreeBSD-specific. + */ +DEFINE_TEST(test_acl_freebsd_posix1e_read) +{ +#if !defined(__FreeBSD__) + skipping("FreeBSD-specific ACL read test"); +#elif __FreeBSD__ < 5 + skipping("ACL read supported only on FreeBSD 5.0 and later"); +#else + struct archive *a; + struct archive_entry *ae; + int n, fd; + const char *acl1_text, *acl2_text; + acl_t acl1, acl2; + + /* + * Manually construct a directory and two files with + * different ACLs. This also serves to verify that ACLs + * are supported on the local filesystem. + */ + + /* Create a test file f1 with acl1 */ + acl1_text = "user::rwx,group::rwx,other::rwx,user:1:rw-,group:15:r-x,mask::rwx"; + acl1 = acl_from_text(acl1_text); + assert((void *)acl1 != NULL); + fd = open("f1", O_WRONLY | O_CREAT | O_EXCL, 0777); + failure("Could not create test file?!"); + if (!assert(fd >= 0)) { + acl_free(acl1); + return; + } + n = acl_set_fd(fd, acl1); + acl_free(acl1); + if (n != 0 && errno == EOPNOTSUPP) { + close(fd); + skipping("ACL tests require that ACL support be enabled on the filesystem"); + return; + } + if (n != 0 && errno == EINVAL) { + close(fd); + skipping("This filesystem does not support POSIX.1e ACLs"); + return; + } + failure("acl_set_fd(): errno = %d (%s)", + errno, strerror(errno)); + assertEqualInt(0, n); + close(fd); + + assertMakeDir("d", 0700); + + /* + * Create file d/f1 with acl2 + * + * This differs from acl1 in the u:1: and g:15: permissions. + * + * This file deliberately has the same name but a different ACL. + * Github Issue #777 explains how libarchive's directory traversal + * did not always correctly enter directories before attempting + * to read ACLs, resulting in reading the ACL from a like-named + * file in the wrong directory. + */ + acl2_text = "user::rwx,group::rwx,other::---,user:1:r--,group:15:r--,mask::rwx"; + acl2 = acl_from_text(acl2_text); + assert((void *)acl2 != NULL); + fd = open("d/f1", O_WRONLY | O_CREAT | O_EXCL, 0777); + failure("Could not create test file?!"); + if (!assert(fd >= 0)) { + acl_free(acl2); + return; + } + n = acl_set_fd(fd, acl2); + acl_free(acl2); + if (n != 0 && errno == EOPNOTSUPP) { + close(fd); + skipping("ACL tests require that ACL support be enabled on the filesystem"); + return; + } + if (n != 0 && errno == EINVAL) { + close(fd); + skipping("This filesystem does not support POSIX.1e ACLs"); + return; + } + failure("acl_set_fd(): errno = %d (%s)", + errno, strerror(errno)); + assertEqualInt(0, n); + close(fd); + + /* Create a read-from-disk object. */ + assert(NULL != (a = archive_read_disk_new())); + assertEqualIntA(a, ARCHIVE_OK, archive_read_disk_open(a, ".")); + assert(NULL != (ae = archive_entry_new())); + + /* Walk the dir until we see both of the files */ + while (ARCHIVE_OK == archive_read_next_header2(a, ae)) { + archive_read_disk_descend(a); + if (strcmp(archive_entry_pathname(ae), "./f1") == 0) { + assertEqualString(archive_entry_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS), acl1_text); + + } else if (strcmp(archive_entry_pathname(ae), "./d/f1") == 0) { + assertEqualString(archive_entry_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS), acl2_text); + } + } + + archive_free(a); +#endif +} From owner-svn-src-vendor@freebsd.org Tue Sep 6 14:26:43 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06C16BC71F6; Tue, 6 Sep 2016 14:26:43 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2EF36D1; Tue, 6 Sep 2016 14:26:42 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u86EQgBg072039; Tue, 6 Sep 2016 14:26:42 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u86EQfEQ072033; Tue, 6 Sep 2016 14:26:41 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201609061426.u86EQfEQ072033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Tue, 6 Sep 2016 14:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r305475 - in vendor-sys/alpine-hal: 2.7a 2.7a/eth dist dist/eth X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2016 14:26:43 -0000 Author: wma Date: Tue Sep 6 14:26:41 2016 New Revision: 305475 URL: https://svnweb.freebsd.org/changeset/base/305475 Log: Update Annapurna Alpine HAL to a newer version. HAL version: 2.7a Added: vendor-sys/alpine-hal/2.7a/ vendor-sys/alpine-hal/2.7a/al_hal_common.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_iofic.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_iofic.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_iofic_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_nb_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pbs_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pcie.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pcie.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pcie_axi_reg.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pcie_interrupts.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pcie_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pcie_w_reg.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_plat_services.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_plat_types.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_reg_utils.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_25g.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_25g.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_25g_internal_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_25g_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_hssp.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_hssp_internal_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_hssp_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_interface.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_internal_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_types.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_config.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_config.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_debug.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_debug.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_iofic.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_iofic.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_iofic_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_main.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_regs_gen.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_regs_m2s.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_regs_s2m.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_unit_adapter_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_serdes.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_serdes.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/ vendor-sys/alpine-hal/2.7a/eth/al_hal_an_lt_wrapper_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth_alu.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth_ec_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth_kr.c (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth_kr.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth_mac_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth_main.c (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_25g.c (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_25g.h (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_25g_internal_regs.h (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_25g_regs.h (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_hssp.h (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_hssp_internal_regs.h (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_hssp_regs.h (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_interface.h (contents, props changed) vendor-sys/alpine-hal/dist/al_serdes.c (contents, props changed) vendor-sys/alpine-hal/dist/al_serdes.h (contents, props changed) Modified: vendor-sys/alpine-hal/dist/al_hal_iofic.c vendor-sys/alpine-hal/dist/al_hal_iofic.h vendor-sys/alpine-hal/dist/al_hal_iofic_regs.h vendor-sys/alpine-hal/dist/al_hal_nb_regs.h vendor-sys/alpine-hal/dist/al_hal_pbs_regs.h vendor-sys/alpine-hal/dist/al_hal_pcie.c vendor-sys/alpine-hal/dist/al_hal_pcie.h vendor-sys/alpine-hal/dist/al_hal_pcie_axi_reg.h vendor-sys/alpine-hal/dist/al_hal_pcie_interrupts.h vendor-sys/alpine-hal/dist/al_hal_pcie_regs.h vendor-sys/alpine-hal/dist/al_hal_pcie_w_reg.h vendor-sys/alpine-hal/dist/al_hal_plat_services.h vendor-sys/alpine-hal/dist/al_hal_plat_types.h vendor-sys/alpine-hal/dist/al_hal_reg_utils.h vendor-sys/alpine-hal/dist/al_hal_serdes.c vendor-sys/alpine-hal/dist/al_hal_serdes.h vendor-sys/alpine-hal/dist/al_hal_udma.h vendor-sys/alpine-hal/dist/al_hal_udma_config.c vendor-sys/alpine-hal/dist/al_hal_udma_config.h vendor-sys/alpine-hal/dist/al_hal_udma_debug.c vendor-sys/alpine-hal/dist/al_hal_udma_iofic.h vendor-sys/alpine-hal/dist/al_hal_udma_main.c vendor-sys/alpine-hal/dist/al_hal_udma_regs_gen.h vendor-sys/alpine-hal/dist/al_hal_unit_adapter_regs.h vendor-sys/alpine-hal/dist/eth/al_hal_eth.h vendor-sys/alpine-hal/dist/eth/al_hal_eth_mac_regs.h vendor-sys/alpine-hal/dist/eth/al_hal_eth_main.c Added: vendor-sys/alpine-hal/2.7a/al_hal_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/alpine-hal/2.7a/al_hal_common.h Tue Sep 6 14:26:41 2016 (r305475) @@ -0,0 +1,70 @@ +/*- +******************************************************************************** +Copyright (C) 2015 Annapurna Labs Ltd. + +This file may be licensed under the terms of the Annapurna Labs Commercial +License Agreement. + +Alternatively, this file can be distributed under the terms of the GNU General +Public License V2 as published by the Free Software Foundation and can be +found at http://www.gnu.org/licenses/gpl-2.0.html + +Alternatively, redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + +/** + * @defgroup group_common HAL Common Layer + * Includes all common header files used by HAL + * @{ + * @file al_hal_common.h + * + */ + +#ifndef __AL_HAL_COMMON_H__ +#define __AL_HAL_COMMON_H__ + +#include "al_hal_plat_types.h" +#include "al_hal_plat_services.h" + +#include "al_hal_types.h" +#include "al_hal_reg_utils.h" + +/* Get the maximal value out of two typed values */ +#define al_max_t(type, x, y) ({ \ + type __max1 = (x); \ + type __max2 = (y); \ + __max1 > __max2 ? __max1 : __max2; }) + +/* Get the minimal value out of two typed values */ +#define al_min_t(type, x, y) ({ \ + type __min1 = (x); \ + type __min2 = (y); \ + __min1 < __min2 ? __min1 : __min2; }) + +/* Get the number of elements in an array */ +#define AL_ARR_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) + +/** @} end of Common group */ +#endif /* __AL_HAL_COMMON_H__ */ Added: vendor-sys/alpine-hal/2.7a/al_hal_iofic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/alpine-hal/2.7a/al_hal_iofic.c Tue Sep 6 14:26:41 2016 (r305475) @@ -0,0 +1,291 @@ +/*- +******************************************************************************* +Copyright (C) 2015 Annapurna Labs Ltd. + +This file may be licensed under the terms of the Annapurna Labs Commercial +License Agreement. + +Alternatively, this file can be distributed under the terms of the GNU General +Public License V2 as published by the Free Software Foundation and can be +found at http://www.gnu.org/licenses/gpl-2.0.html + +Alternatively, redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + +/** + * @{ + * @file al_hal_iofic.c + * + * @brief interrupt controller hal + * + */ + +#include "al_hal_iofic.h" +#include "al_hal_iofic_regs.h" + +/* + * configure the interrupt registers, interrupts will are kept masked + */ +int al_iofic_config(void __iomem *regs_base, int group, uint32_t flags) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + al_reg_write32(®s->ctrl[group].int_control_grp, flags); + + return 0; +} + +/* + * configure the moderation timer resolution for a given group + */ +int al_iofic_moder_res_config(void __iomem *regs_base, int group, + uint8_t resolution) + +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + uint32_t reg; + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + reg = al_reg_read32(®s->ctrl[group].int_control_grp); + AL_REG_FIELD_SET(reg, + INT_CONTROL_GRP_MOD_RES_MASK, + INT_CONTROL_GRP_MOD_RES_SHIFT, + resolution); + al_reg_write32(®s->ctrl[group].int_control_grp, reg); + + return 0; +} + +/* + * configure the moderation timer interval for a given legacy interrupt group + */ +int al_iofic_legacy_moder_interval_config(void __iomem *regs_base, int group, + uint8_t interval) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + uint32_t reg; + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + reg = al_reg_read32(®s->ctrl[group].int_control_grp); + AL_REG_FIELD_SET(reg, + INT_CONTROL_GRP_MOD_INTV_MASK, + INT_CONTROL_GRP_MOD_INTV_SHIFT, + interval); + al_reg_write32(®s->ctrl[group].int_control_grp, reg); + + return 0; +} + + +/* + * configure the moderation timer interval for a given msix vector. + */ +int al_iofic_msix_moder_interval_config(void __iomem *regs_base, int group, + uint8_t vector, uint8_t interval) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + uint32_t reg; + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + reg = al_reg_read32(®s->grp_int_mod[group][vector].grp_int_mod_reg); + AL_REG_FIELD_SET(reg, + INT_MOD_INTV_MASK, + INT_MOD_INTV_SHIFT, + interval); + al_reg_write32(®s->grp_int_mod[group][vector].grp_int_mod_reg, reg); + + return 0; +} + +/* + * configure the target-id attributes for a given msix vector. + */ +int al_iofic_msix_tgtid_attributes_config(void __iomem *regs_base, int group, + uint8_t vector, uint32_t tgtid, uint8_t tgtid_en) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + uint32_t reg = 0; + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + AL_REG_FIELD_SET(reg, + INT_MSIX_TGTID_MASK, + INT_MSIX_TGTID_SHIFT, + tgtid); + AL_REG_BIT_VAL_SET(reg, + INT_MSIX_TGTID_EN_SHIFT, + tgtid_en); + + al_reg_write32(®s->grp_int_mod[group][vector].grp_int_tgtid_reg, reg); + + return 0; +} + +/* + * return the offset of the unmask register for a given group + */ +uint32_t __iomem * al_iofic_unmask_offset_get(void __iomem *regs_base, int group) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + return ®s->ctrl[group].int_mask_clear_grp; +} + + +/* + * unmask specific interrupts for a given group + */ +void al_iofic_unmask(void __iomem *regs_base, int group, uint32_t mask) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + /* + * use the mask clear register, no need to read the mask register + * itself. write 0 to unmask, 1 has no effect + */ + al_reg_write32_relaxed(®s->ctrl[group].int_mask_clear_grp, ~mask); +} + +/* + * mask specific interrupts for a given group + */ +void al_iofic_mask(void __iomem *regs_base, int group, uint32_t mask) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + uint32_t reg; + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + reg = al_reg_read32(®s->ctrl[group].int_mask_grp); + + al_reg_write32(®s->ctrl[group].int_mask_grp, reg | mask); +} + +/* + * read the mask for a given group + */ +uint32_t al_iofic_read_mask(void __iomem *regs_base, int group) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + return al_reg_read32(®s->ctrl[group].int_mask_grp); +} + +/* + * read interrupt cause register for a given group + */ +uint32_t al_iofic_read_cause(void __iomem *regs_base, int group) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + return al_reg_read32(®s->ctrl[group].int_cause_grp); +} + +/* + * clear bits in the interrupt cause register for a given group + */ +void al_iofic_clear_cause(void __iomem *regs_base, int group, uint32_t mask) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + /* inverse mask, writing 1 has no effect */ + al_reg_write32(®s->ctrl[group].int_cause_grp, ~mask); +} + +/* + * Set the cause register for a given group + */ +void al_iofic_set_cause(void __iomem *regs_base, int group, uint32_t mask) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + al_reg_write32(®s->ctrl[group].int_cause_set_grp, mask); +} + + +/* + * unmask specific interrupts from aborting the udma a given group + */ +void al_iofic_abort_mask(void __iomem *regs_base, int group, uint32_t mask) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + al_reg_write32(®s->ctrl[group].int_abort_msk_grp, mask); + +} + +/* + * trigger all interrupts that are waiting for moderation timers to expire + */ +void al_iofic_interrupt_moderation_reset(void __iomem *regs_base, int group) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + uint32_t reg = 0; + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + reg = al_reg_read32(®s->ctrl[group].int_control_grp); + reg |= INT_CONTROL_GRP_MOD_RST; + + al_reg_write32(®s->ctrl[group].int_control_grp, reg); +} + +/** @} end of interrupt controller group */ Added: vendor-sys/alpine-hal/2.7a/al_hal_iofic.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/alpine-hal/2.7a/al_hal_iofic.h Tue Sep 6 14:26:41 2016 (r305475) @@ -0,0 +1,222 @@ +/*- +******************************************************************************** +Copyright (C) 2015 Annapurna Labs Ltd. + +This file may be licensed under the terms of the Annapurna Labs Commercial +License Agreement. + +Alternatively, this file can be distributed under the terms of the GNU General +Public License V2 as published by the Free Software Foundation and can be +found at http://www.gnu.org/licenses/gpl-2.0.html + +Alternatively, redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + +/** + * @defgroup group_interrupts Common I/O Fabric Interrupt Controller + * This HAL provides the API for programming the Common I/O Fabric Interrupt + * Controller (IOFIC) found in most of the units attached to the I/O Fabric of + * Alpine platform + * @{ + * @file al_hal_iofic.h + * + * @brief Header file for the interrupt controller that's embedded in various units + * + */ + +#ifndef __AL_HAL_IOFIC_H__ +#define __AL_HAL_IOFIC_H__ + +#include + +/* *INDENT-OFF* */ +#ifdef __cplusplus +extern "C" { +#endif +/* *INDENT-ON* */ + +#define AL_IOFIC_MAX_GROUPS 4 + +/* + * Configurations + */ + +/** + * Configure the interrupt controller registers, actual interrupts are still + * masked at this stage. + * + * @param regs_base regs pointer to interrupt controller registers + * @param group the interrupt group. + * @param flags flags of Interrupt Control Register + * + * @return 0 on success. -EINVAL otherwise. + */ +int al_iofic_config(void __iomem *regs_base, int group, + uint32_t flags); + +/** + * configure the moderation timer resolution for a given group + * Applies for both msix and legacy mode. + * + * @param regs_base pointer to unit registers + * @param group the interrupt group + * @param resolution resolution of the timer interval, the resolution determines the rate + * of decrementing the interval timer, setting value N means that the interval + * timer will be decremented each (N+1) * (0.68) micro seconds. + * + * @return 0 on success. -EINVAL otherwise. + */ +int al_iofic_moder_res_config(void __iomem *regs_base, int group, + uint8_t resolution); + +/** + * configure the moderation timer interval for a given legacy interrupt group + * + * @param regs_base regs pointer to unit registers + * @param group the interrupt group + * @param interval between interrupts in resolution units. 0 disable + * + * @return 0 on success. -EINVAL otherwise. + */ +int al_iofic_legacy_moder_interval_config(void __iomem *regs_base, int group, + uint8_t interval); + +/** + * configure the moderation timer interval for a given msix vector + * + * @param regs_base pointer to unit registers + * @param group the interrupt group + * @param vector vector index + * @param interval interval between interrupts, 0 disable + * + * @return 0 on success. -EINVAL otherwise. + */ +int al_iofic_msix_moder_interval_config(void __iomem *regs_base, int group, + uint8_t vector, uint8_t interval); + +/** +* configure the tgtid attributes for a given msix vector. +* +* @param group the interrupt group +* @param vector index +* @param tgtid the target-id value +* @param tgtid_en take target-id from the intc +* +* @return 0 on success. -EINVAL otherwise. +*/ +int al_iofic_msix_tgtid_attributes_config(void __iomem *regs_base, int group, + uint8_t vector, uint32_t tgtid, uint8_t tgtid_en); + +/** + * return the offset of the unmask register for a given group. + * this function can be used when the upper layer wants to directly + * access the unmask regiter and bypass the al_iofic_unmask() API. + * + * @param regs_base regs pointer to unit registers + * @param group the interrupt group + * @return the offset of the unmask register. + */ +uint32_t __iomem * al_iofic_unmask_offset_get(void __iomem *regs_base, int group); + +/** + * unmask specific interrupts for a given group + * this functions guarantees atomic operations, it is performance optimized as + * it will not require read-modify-write. The unmask done using the interrupt + * mask clear register, so it's safe to call it while the mask is changed by + * the HW (auto mask) or another core. + * + * @param regs_base pointer to unit registers + * @param group the interrupt group + * @param mask bitwise of interrupts to unmask, set bits will be unmasked. + */ +void al_iofic_unmask(void __iomem *regs_base, int group, uint32_t mask); + +/** + * mask specific interrupts for a given group + * this functions modifies interrupt mask register, the callee must make sure + * the mask is not changed by another cpu. + * + * @param regs_base pointer to unit registers + * @param group the interrupt group + * @param mask bitwise of interrupts to mask, set bits will be masked. + */ +void al_iofic_mask(void __iomem *regs_base, int group, uint32_t mask); + +/** + * read the mask register for a given group + * this functions return the interrupt mask register + * + * @param regs_base pointer to unit registers + * @param group the interrupt group + */ +uint32_t al_iofic_read_mask(void __iomem *regs_base, int group); + +/** + * read interrupt cause register for a given group + * this will clear the set bits if the Clear on Read mode enabled. + * @param regs_base pointer to unit registers + * @param group the interrupt group + */ +uint32_t al_iofic_read_cause(void __iomem *regs_base, int group); + +/** + * clear bits in the interrupt cause register for a given group + * + * @param regs_base pointer to unit registers + * @param group the interrupt group + * @param mask bitwise of bits to be cleared, set bits will be cleared. + */ +void al_iofic_clear_cause(void __iomem *regs_base, int group, uint32_t mask); + +/** + * set the cause register for a given group + * this function set the cause register. It will generate an interrupt (if + * the the interrupt isn't masked ) + * + * @param regs_base pointer to unit registers + * @param group the interrupt group + * @param mask bitwise of bits to be set. + */ +void al_iofic_set_cause(void __iomem *regs_base, int group, uint32_t mask); + +/** + * unmask specific interrupts from aborting the udma a given group + * + * @param regs_base pointer to unit registers + * @param group the interrupt group + * @param mask bitwise of interrupts to mask + */ +void al_iofic_abort_mask(void __iomem *regs_base, int group, uint32_t mask); + +/** + * trigger all interrupts that are waiting for moderation timers to expire + * + * @param regs_base pointer to unit registers + * @param group the interrupt group + */ +void al_iofic_interrupt_moderation_reset(void __iomem *regs_base, int group); + +#endif +/** @} end of interrupt controller group */ Added: vendor-sys/alpine-hal/2.7a/al_hal_iofic_regs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/alpine-hal/2.7a/al_hal_iofic_regs.h Tue Sep 6 14:26:41 2016 (r305475) @@ -0,0 +1,127 @@ +/*_ +******************************************************************************** +Copyright (C) 2015 Annapurna Labs Ltd. + +This file may be licensed under the terms of the Annapurna Labs Commercial +License Agreement. + +Alternatively, this file can be distributed under the terms of the GNU General +Public License V2 as published by the Free Software Foundation and can be +found at http://www.gnu.org/licenses/gpl-2.0.html + +Alternatively, redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + + +#ifndef __AL_HAL_IOFIC_REG_H +#define __AL_HAL_IOFIC_REG_H + +#ifdef __cplusplus +extern "C" { +#endif +/* +* Unit Registers +*/ + +struct al_iofic_grp_ctrl { + uint32_t int_cause_grp; /* Interrupt Cause RegisterSet by hardware */ + uint32_t rsrvd1; + uint32_t int_cause_set_grp; /* Interrupt Cause Set RegisterWriting 1 to a bit in t ... */ + uint32_t rsrvd2; + uint32_t int_mask_grp; /* Interrupt Mask RegisterIf Auto-mask control bit =TR ... */ + uint32_t rsrvd3; + uint32_t int_mask_clear_grp; /* Interrupt Mask Clear RegisterUsed when auto-mask co ... */ + uint32_t rsrvd4; + uint32_t int_status_grp; /* Interrupt status RegisterThis register latch the st ... */ + uint32_t rsrvd5; + uint32_t int_control_grp; /* Interrupt Control Register */ + uint32_t rsrvd6; + uint32_t int_abort_msk_grp; /* Interrupt Mask RegisterEach bit in this register ma ... */ + uint32_t rsrvd7; + uint32_t int_log_msk_grp; /* Interrupt Log RegisterEach bit in this register mas ... */ + uint32_t rsrvd8; +}; + +struct al_iofic_grp_mod { + uint32_t grp_int_mod_reg; /* Interrupt moderation registerDedicated moderation in ... */ + uint32_t grp_int_tgtid_reg; +}; + +struct al_iofic_regs { + struct al_iofic_grp_ctrl ctrl[0]; + uint32_t rsrvd1[0x400 >> 2]; + struct al_iofic_grp_mod grp_int_mod[0][32]; +}; + + +/* +* Registers Fields +*/ + + +/**** int_control_grp register ****/ +/* When Clear_on_Read =1, All bits of Cause register ... */ +#define INT_CONTROL_GRP_CLEAR_ON_READ (1 << 0) +/* (must be set only when MSIX is enabled)When Auto-Ma ... */ +#define INT_CONTROL_GRP_AUTO_MASK (1 << 1) +/* Auto_Clear (RW)When Auto-Clear =1, the bits in the ... */ +#define INT_CONTROL_GRP_AUTO_CLEAR (1 << 2) +/* When Set_on_Posedge =1, the bits in the interrupt c ... */ +#define INT_CONTROL_GRP_SET_ON_POSEDGE (1 << 3) +/* When Moderation_Reset =1, all Moderation timers ass ... */ +#define INT_CONTROL_GRP_MOD_RST (1 << 4) +/* When mask_msi_x =1, No MSI-X from this group is sen ... */ +#define INT_CONTROL_GRP_MASK_MSI_X (1 << 5) +/* MSI-X AWID value, same ID for all cause bits */ +#define INT_CONTROL_GRP_AWID_MASK 0x00000F00 +#define INT_CONTROL_GRP_AWID_SHIFT 8 +/* This value determines the interval between interrup ... */ +#define INT_CONTROL_GRP_MOD_INTV_MASK 0x00FF0000 +#define INT_CONTROL_GRP_MOD_INTV_SHIFT 16 +/* This value determines the Moderation_Timer_Clock sp ... */ +#define INT_CONTROL_GRP_MOD_RES_MASK 0x0F000000 +#define INT_CONTROL_GRP_MOD_RES_SHIFT 24 + +/**** grp_int_mod_reg register ****/ +/* Interrupt Moderation Interval registerDedicated reg ... */ +#define INT_MOD_INTV_MASK 0x000000FF +#define INT_MOD_INTV_SHIFT 0 + +/**** grp_int_tgtid_reg register ****/ +/* Interrupt tgtid value registerDedicated reg ... */ +#define INT_MSIX_TGTID_MASK 0x0000FFFF +#define INT_MSIX_TGTID_SHIFT 0 +/* Interrupt tgtid_en value registerDedicated reg ... */ +#define INT_MSIX_TGTID_EN_SHIFT 31 + +#ifdef __cplusplus +} +#endif + +#endif /* __AL_HAL_IOFIC_REG_H */ + + + + Added: vendor-sys/alpine-hal/2.7a/al_hal_nb_regs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/alpine-hal/2.7a/al_hal_nb_regs.h Tue Sep 6 14:26:41 2016 (r305475) @@ -0,0 +1,1826 @@ +/*- +******************************************************************************** +Copyright (C) 2015 Annapurna Labs Ltd. + +This file may be licensed under the terms of the Annapurna Labs Commercial +License Agreement. + +Alternatively, this file can be distributed under the terms of the GNU General +Public License V2 as published by the Free Software Foundation and can be +found at http://www.gnu.org/licenses/gpl-2.0.html + +Alternatively, redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + +/** + * @{ + * @file al_hal_nb_regs.h + * + * @brief North Bridge service registers + * + */ + +#ifndef __AL_HAL_NB_REGS_H__ +#define __AL_HAL_NB_REGS_H__ + +#include "al_hal_plat_types.h" + +#ifdef __cplusplus +extern "C" { +#endif +/* +* Unit Registers +*/ + + + +struct al_nb_global { + /* [0x0] */ + uint32_t cpus_config; + /* [0x4] */ + uint32_t cpus_secure; + /* [0x8] Force init reset. */ + uint32_t cpus_init_control; + /* [0xc] Force init reset per DECEI mode. */ + uint32_t cpus_init_status; + /* [0x10] */ + uint32_t nb_int_cause; + /* [0x14] */ + uint32_t sev_int_cause; + /* [0x18] */ + uint32_t pmus_int_cause; + /* [0x1c] */ + uint32_t sev_mask; + /* [0x20] */ + uint32_t cpus_hold_reset; + /* [0x24] */ + uint32_t cpus_software_reset; + /* [0x28] */ + uint32_t wd_timer0_reset; + /* [0x2c] */ + uint32_t wd_timer1_reset; + /* [0x30] */ + uint32_t wd_timer2_reset; + /* [0x34] */ + uint32_t wd_timer3_reset; + /* [0x38] */ + uint32_t ddrc_hold_reset; + /* [0x3c] */ + uint32_t fabric_software_reset; + /* [0x40] */ + uint32_t cpus_power_ctrl; + uint32_t rsrvd_0[7]; + /* [0x60] */ + uint32_t acf_base_high; + /* [0x64] */ + uint32_t acf_base_low; + /* [0x68] */ + uint32_t acf_control_override; + /* [0x6c] Read-only that reflects CPU Cluster Local GIC base high address */ + uint32_t lgic_base_high; + /* [0x70] Read-only that reflects CPU Cluster Local GIC base low address */ + uint32_t lgic_base_low; + /* [0x74] Read-only that reflects the device's IOGIC base high address. */ + uint32_t iogic_base_high; + /* [0x78] Read-only that reflects IOGIC base low address */ + uint32_t iogic_base_low; + /* [0x7c] */ + uint32_t io_wr_split_control; + /* [0x80] */ + uint32_t io_rd_rob_control; + /* [0x84] */ + uint32_t sb_pos_error_log_1; + /* [0x88] */ + uint32_t sb_pos_error_log_0; + /* [0x8c] */ + uint32_t c2swb_config; + /* [0x90] */ + uint32_t msix_error_log; + /* [0x94] */ + uint32_t error_cause; + /* [0x98] */ + uint32_t error_mask; + uint32_t rsrvd_1; + /* [0xa0] */ + uint32_t qos_peak_control; + /* [0xa4] */ + uint32_t qos_set_control; + /* [0xa8] */ + uint32_t ddr_qos; + uint32_t rsrvd_2[9]; + /* [0xd0] */ + uint32_t acf_misc; + /* [0xd4] */ + uint32_t config_bus_control; + uint32_t rsrvd_3[2]; + /* [0xe0] */ + uint32_t pos_id_match; + uint32_t rsrvd_4[3]; + /* [0xf0] */ + uint32_t sb_sel_override_awuser; + /* [0xf4] */ + uint32_t sb_override_awuser; + /* [0xf8] */ + uint32_t sb_sel_override_aruser; + /* [0xfc] */ + uint32_t sb_override_aruser; + /* [0x100] */ + uint32_t cpu_max_pd_timer; + /* [0x104] */ + uint32_t cpu_max_pu_timer; + uint32_t rsrvd_5[2]; + /* [0x110] */ + uint32_t auto_ddr_self_refresh_counter; + uint32_t rsrvd_6[3]; + /* [0x120] */ + uint32_t coresight_pd; + /* [0x124] */ + uint32_t coresight_internal_0; + /* [0x128] */ + uint32_t coresight_dbgromaddr; + /* [0x12c] */ + uint32_t coresight_dbgselfaddr; + /* [0x130] */ + uint32_t coresght_targetid; + /* [0x134] */ + uint32_t coresght_targetid0; + uint32_t rsrvd_7[10]; + /* [0x160] */ + uint32_t sb_force_same_id_cfg_0; + /* [0x164] */ + uint32_t sb_mstr_force_same_id_sel_0; + /* [0x168] */ + uint32_t sb_force_same_id_cfg_1; + /* [0x16c] */ + uint32_t sb_mstr_force_same_id_sel_1; + uint32_t rsrvd[932]; +}; +struct al_nb_system_counter { + /* [0x0] */ + uint32_t cnt_control; + /* [0x4] */ + uint32_t cnt_base_freq; + /* [0x8] */ + uint32_t cnt_low; + /* [0xc] */ + uint32_t cnt_high; + /* [0x10] */ + uint32_t cnt_init_low; + /* [0x14] */ + uint32_t cnt_init_high; + uint32_t rsrvd[58]; +}; +struct al_nb_rams_control_misc { + /* [0x0] */ + uint32_t ca15_rf_misc; + uint32_t rsrvd_0; + /* [0x8] */ + uint32_t nb_rf_misc; + uint32_t rsrvd[61]; +}; +struct al_nb_ca15_rams_control { + /* [0x0] */ + uint32_t rf_0; + /* [0x4] */ + uint32_t rf_1; + /* [0x8] */ + uint32_t rf_2; + uint32_t rsrvd; +}; +struct al_nb_semaphores { + /* [0x0] This configuration is only sampled during reset of the processor */ + uint32_t lockn; +}; +struct al_nb_debug { + /* [0x0] */ + uint32_t ca15_outputs_1; + /* [0x4] */ + uint32_t ca15_outputs_2; + uint32_t rsrvd_0[2]; + /* [0x10] */ + uint32_t cpu_msg[4]; + /* [0x20] */ + uint32_t rsv0_config; + /* [0x24] */ + uint32_t rsv1_config; + uint32_t rsrvd_1[2]; + /* [0x30] */ + uint32_t rsv0_status; + /* [0x34] */ + uint32_t rsv1_status; + uint32_t rsrvd_2[2]; + /* [0x40] */ + uint32_t ddrc; + /* [0x44] */ + uint32_t ddrc_phy_smode_control; + /* [0x48] */ + uint32_t ddrc_phy_smode_status; + uint32_t rsrvd_3[5]; + /* [0x60] */ + uint32_t pmc; + uint32_t rsrvd_4[3]; + /* [0x70] */ + uint32_t cpus_general; + /* [0x74] */ + uint32_t cpus_general_1; + uint32_t rsrvd_5[2]; + /* [0x80] */ + uint32_t cpus_int_out; + uint32_t rsrvd_6[3]; + /* [0x90] */ + uint32_t latch_pc_req; + uint32_t rsrvd_7; + /* [0x98] */ + uint32_t latch_pc_low; + /* [0x9c] */ + uint32_t latch_pc_high; + uint32_t rsrvd_8[24]; + /* [0x100] */ + uint32_t track_dump_ctrl; + /* [0x104] */ + uint32_t track_dump_rdata_0; + /* [0x108] */ + uint32_t track_dump_rdata_1; + uint32_t rsrvd_9[5]; + /* [0x120] */ + uint32_t track_events; + uint32_t rsrvd_10[3]; + /* [0x130] */ + uint32_t pos_track_dump_ctrl; + /* [0x134] */ + uint32_t pos_track_dump_rdata_0; + /* [0x138] */ + uint32_t pos_track_dump_rdata_1; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Wed Sep 7 20:00:23 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6949ABD0CB0; Wed, 7 Sep 2016 20:00:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36BAD935; Wed, 7 Sep 2016 20:00:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u87K0MB8048702; Wed, 7 Sep 2016 20:00:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u87K0MST048701; Wed, 7 Sep 2016 20:00:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609072000.u87K0MST048701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 7 Sep 2016 20:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r305560 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2016 20:00:23 -0000 Author: mav Date: Wed Sep 7 20:00:22 2016 New Revision: 305560 URL: https://svnweb.freebsd.org/changeset/base/305560 Log: 7278 tuning zfs_arc_max does not impact arc_c_min When changing zfs_arc_max (e.g. as zdb does), it may be set to less than the default arc_c_min. arc_c_min should decrease to not be more than arc_c_max, but it doesn't; therefore tuning of arc_c_max is ineffective. Reviewed by: Dan Kimmel Reviewed by: Paul Dagnelie Reviewed by: Prakash Surya Reviewed by: Igor Kozhukhov Author: Matthew Ahrens openzfs/openzfs@608764beadaf4bb71c5d8fe1818e8392ac66a61b Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Wed Sep 7 19:29:15 2016 (r305559) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Wed Sep 7 20:00:22 2016 (r305560) @@ -5618,8 +5618,10 @@ arc_init(void) * Allow the tunables to override our calculations if they are * reasonable (ie. over 64MB) */ - if (zfs_arc_max > 64 << 20 && zfs_arc_max < allmem) + if (zfs_arc_max > 64 << 20 && zfs_arc_max < allmem) { arc_c_max = zfs_arc_max; + arc_c_min = MIN(arc_c_min, arc_c_max); + } if (zfs_arc_min > 64 << 20 && zfs_arc_min <= arc_c_max) arc_c_min = zfs_arc_min; From owner-svn-src-vendor@freebsd.org Wed Sep 7 20:07:40 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EB36BD011A; Wed, 7 Sep 2016 20:07:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35D44DE; Wed, 7 Sep 2016 20:07:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u87K7dsK052316; Wed, 7 Sep 2016 20:07:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u87K7duB052315; Wed, 7 Sep 2016 20:07:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609072007.u87K7duB052315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 7 Sep 2016 20:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r305562 - vendor-sys/illumos/dist/uts/common/fs/zfs/sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2016 20:07:40 -0000 Author: mav Date: Wed Sep 7 20:07:39 2016 New Revision: 305562 URL: https://svnweb.freebsd.org/changeset/base/305562 Log: 7259 DS_FIELD_LARGE_BLOCKS is unused The DS_FIELD_LARGE_BLOCKS macro has been unused since the integration of this patch: commit ca0cc3918a1789fa839194af2a9245f801a06b1a Author: Matthew Ahrens Date: Fri Jul 24 09:53:55 2015 -0700 5959 clean up per-dataset feature count code Reviewed by: Toomas Soome Reviewed by: George Wilson Reviewed by: Alex Reece Approved by: Richard Lowe This patch simply removes this macro from dsl_dataset.h. Reviewed by: Dan Kimmel Reviewed by: Prakash Surya Reviewed by: Dan McDonald Reviewed by: Igor Kozhukhov Author: Matthew Ahrens Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h Wed Sep 7 20:05:10 2016 (r305561) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h Wed Sep 7 20:07:39 2016 (r305562) @@ -86,13 +86,6 @@ struct dsl_pool; #define DS_FIELD_BOOKMARK_NAMES "com.delphix:bookmarks" /* - * This field is present (with value=0) if this dataset may contain large - * blocks (>128KB). If it is present, then this dataset - * is counted in the refcount of the SPA_FEATURE_LARGE_BLOCKS feature. - */ -#define DS_FIELD_LARGE_BLOCKS "org.open-zfs:large_blocks" - -/* * These fields are set on datasets that are in the middle of a resumable * receive, and allow the sender to resume the send if it is interrupted. */ From owner-svn-src-vendor@freebsd.org Thu Sep 8 23:49:36 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88C5BBD2963; Thu, 8 Sep 2016 23:49:36 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5321AA50; Thu, 8 Sep 2016 23:49:36 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u88NnZ5M085774; Thu, 8 Sep 2016 23:49:35 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u88NnYQa085758; Thu, 8 Sep 2016 23:49:34 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201609082349.u88NnYQa085758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 8 Sep 2016 23:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r305631 - in vendor/NetBSD/bmake/dist: . mk X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2016 23:49:36 -0000 Author: sjg Date: Thu Sep 8 23:49:33 2016 New Revision: 305631 URL: https://svnweb.freebsd.org/changeset/base/305631 Log: Import bmake-20160818 Interesting changes: o meta.c: move handling of .MAKE.META.IGNORE_* to meta_ignore() so we can call it before adding entries to missingFiles. Thus we do not track files we have been told to ignore. o meta_oodate: apply .MAKE.META.IGNORE_FILTER (if defined) to pathnames, and skip if the expansion is empty. Useful for dirdeps.mk when checking DIRDEPS_CACHE. o meta.c: remove all missingFiles entries that match a deleted dir. o main.c: set .ERROR_CMD if possible. Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/bmake.1 vendor/NetBSD/bmake/dist/bmake.cat1 vendor/NetBSD/bmake/dist/main.c vendor/NetBSD/bmake/dist/make.1 vendor/NetBSD/bmake/dist/meta.c vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/dirdeps.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/lib.mk vendor/NetBSD/bmake/dist/mk/meta.sys.mk vendor/NetBSD/bmake/dist/mk/prog.mk vendor/NetBSD/bmake/dist/os.sh vendor/NetBSD/bmake/dist/suff.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/ChangeLog Thu Sep 8 23:49:33 2016 (r305631) @@ -1,3 +1,32 @@ +2016-08-18 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160818 + its a neater number; pick up whitespace fixes to man page. + +2016-08-17 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160817 + Merge with NetBSD make, pick up + o meta.c: move handling of .MAKE.META.IGNORE_* to meta_ignore() + so we can call it before adding entries to missingFiles. + Thus we do not track files we have been told to ignore. + +2016-08-15 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160815 + Merge with NetBSD make, pick up + o meta_oodate: apply .MAKE.META.IGNORE_FILTER (if defined) to + pathnames, and skip if the expansion is empty. + Useful for dirdeps.mk when checking DIRDEPS_CACHE. + +2016-08-12 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160812 + Merge with NetBSD make, pick up + o meta.c: remove all missingFiles entries that match a deleted + dir. + o main.c: set .ERROR_CMD if possible. + 2016-06-06 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20160606 Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/Makefile Thu Sep 8 23:49:33 2016 (r305631) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.67 2016/06/07 00:46:12 sjg Exp $ +# $Id: Makefile,v 1.72 2016/08/18 23:02:26 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160606 +_MAKE_VERSION= 20160818 PROG= bmake Modified: vendor/NetBSD/bmake/dist/bmake.1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.1 Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/bmake.1 Thu Sep 8 23:49:33 2016 (r305631) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.259 2016/06/03 07:07:37 wiz Exp $ +.\" $NetBSD: make.1,v 1.262 2016/08/18 19:23:20 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd June 2, 2016 +.Dd August 15, 2016 .Dt MAKE 1 .Os .Sh NAME @@ -927,6 +927,9 @@ The default list includes: .It Va .MAKE.META.IGNORE_PATTERNS Provides a list of patterns to match against pathnames. Ignore any that match. +.It Va .MAKE.META.IGNORE_FILTER +Provides a list of variable modifiers to apply to each pathname. +Ignore if the expansion is an empty string. .It Va .MAKE.META.PREFIX Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: @@ -974,7 +977,19 @@ per normal evaluation rules. .It Va MAKE_PRINT_VAR_ON_ERROR When .Nm -stops due to an error, it prints its name and the value of +stops due to an error, it sets +.Ql Va .ERROR_TARGET +to the name of the target that failed, +.Ql Va .ERROR_CMD +to the commands of the failed target, +and in "meta" mode, it also sets +.Ql Va .ERROR_CWD +to the +.Xr getcwd 3 , +and +.Ql Va .ERROR_META_FILE +to the path of the meta file (if any) describing the failed target. +It then prints its name and the value of .Ql Va .CURDIR as well as the value of any variables named in .Ql Va MAKE_PRINT_VAR_ON_ERROR . Modified: vendor/NetBSD/bmake/dist/bmake.cat1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.cat1 Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/bmake.cat1 Thu Sep 8 23:49:33 2016 (r305631) @@ -604,6 +604,10 @@ VVAARRIIAABBLLEE AASSSSIIGG Provides a list of patterns to match against pathnames. Ignore any that match. + _._M_A_K_E_._M_E_T_A_._I_G_N_O_R_E___F_I_L_T_E_R + Provides a list of variable modifiers to apply to each + pathname. Ignore if the expansion is an empty string. + _._M_A_K_E_._M_E_T_A_._P_R_E_F_I_X Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: @@ -635,9 +639,14 @@ VVAARRIIAABBLLEE AASSSSIIGG becomes `$' per normal evaluation rules. _M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R - When bbmmaakkee stops due to an error, it prints its name and - the value of `_._C_U_R_D_I_R' as well as the value of any vari- - ables named in `_M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R'. + When bbmmaakkee stops due to an error, it sets `_._E_R_R_O_R___T_A_R_G_E_T' + to the name of the target that failed, `_._E_R_R_O_R___C_M_D' to + the commands of the failed target, and in "meta" mode, it + also sets `_._E_R_R_O_R___C_W_D' to the getcwd(3), and + `_._E_R_R_O_R___M_E_T_A___F_I_L_E' to the path of the meta file (if any) + describing the failed target. It then prints its name + and the value of `_._C_U_R_D_I_R' as well as the value of any + variables named in `_M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R'. _._n_e_w_l_i_n_e This variable is simply assigned a newline character as its value. This allows expansions using the ::@@ modifier @@ -1489,4 +1498,4 @@ BBUUGGSS There is no way of escaping a space character in a filename. -NetBSD 5.1 June 2, 2016 NetBSD 5.1 +NetBSD 5.1 August 15, 2016 NetBSD 5.1 Modified: vendor/NetBSD/bmake/dist/main.c ============================================================================== --- vendor/NetBSD/bmake/dist/main.c Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/main.c Thu Sep 8 23:49:33 2016 (r305631) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.247 2016/06/05 01:39:17 christos Exp $ */ +/* $NetBSD: main.c,v 1.250 2016/08/11 19:53:17 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.247 2016/06/05 01:39:17 christos Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.250 2016/08/11 19:53:17 sjg Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.247 2016/06/05 01:39:17 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.250 2016/08/11 19:53:17 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -1903,11 +1903,10 @@ cached_realpath(const char *pathname, ch #endif } - rp = Var_Value(pathname, cache, &cp); - if (rp) { + if ((rp = Var_Value(pathname, cache, &cp)) != NULL) { /* a hit */ strlcpy(resolved, rp, MAXPATHLEN); - } else if ((rp = realpath(pathname, resolved))) { + } else if ((rp = realpath(pathname, resolved)) != NULL) { Var_Set(pathname, rp, cache, 0); } free(cp); @@ -1922,6 +1921,14 @@ PrintAddr(void *a, void *b) } +static int +addErrorCMD(void *cmdp, void *gnp) +{ + if (cmdp == NULL) + return 1; /* stop */ + Var_Append(".ERROR_CMD", cmdp, VAR_GLOBAL); + return 0; +} void PrintOnError(GNode *gn, const char *s) @@ -1942,6 +1949,8 @@ PrintOnError(GNode *gn, const char *s) * We can print this even if there is no .ERROR target. */ Var_Set(".ERROR_TARGET", gn->name, VAR_GLOBAL, 0); + Var_Delete(".ERROR_CMD", VAR_GLOBAL); + Lst_ForEach(gn->commands, addErrorCMD, gn); } strncpy(tmp, "${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'\n@}", sizeof(tmp) - 1); Modified: vendor/NetBSD/bmake/dist/make.1 ============================================================================== --- vendor/NetBSD/bmake/dist/make.1 Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/make.1 Thu Sep 8 23:49:33 2016 (r305631) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.259 2016/06/03 07:07:37 wiz Exp $ +.\" $NetBSD: make.1,v 1.262 2016/08/18 19:23:20 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd June 2, 2016 +.Dd August 15, 2016 .Dt MAKE 1 .Os .Sh NAME @@ -927,6 +927,9 @@ The default list includes: .It Va .MAKE.META.IGNORE_PATTERNS Provides a list of patterns to match against pathnames. Ignore any that match. +.It Va .MAKE.META.IGNORE_FILTER +Provides a list of variable modifiers to apply to each pathname. +Ignore if the expansion is an empty string. .It Va .MAKE.META.PREFIX Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: @@ -974,7 +977,19 @@ per normal evaluation rules. .It Va MAKE_PRINT_VAR_ON_ERROR When .Nm -stops due to an error, it prints its name and the value of +stops due to an error, it sets +.Ql Va .ERROR_TARGET +to the name of the target that failed, +.Ql Va .ERROR_CMD +to the commands of the failed target, +and in "meta" mode, it also sets +.Ql Va .ERROR_CWD +to the +.Xr getcwd 3 , +and +.Ql Va .ERROR_META_FILE +to the path of the meta file (if any) describing the failed target. +It then prints its name and the value of .Ql Va .CURDIR as well as the value of any variables named in .Ql Va MAKE_PRINT_VAR_ON_ERROR . Modified: vendor/NetBSD/bmake/dist/meta.c ============================================================================== --- vendor/NetBSD/bmake/dist/meta.c Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/meta.c Thu Sep 8 23:49:33 2016 (r305631) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.61 2016/06/07 00:40:00 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.67 2016/08/17 15:52:42 sjg Exp $ */ /* * Implement 'meta' mode. @@ -69,6 +69,9 @@ static char *metaIgnorePathsStr; /* stri #ifndef MAKE_META_IGNORE_PATTERNS #define MAKE_META_IGNORE_PATTERNS ".MAKE.META.IGNORE_PATTERNS" #endif +#ifndef MAKE_META_IGNORE_FILTER +#define MAKE_META_IGNORE_FILTER ".MAKE.META.IGNORE_FILTER" +#endif Boolean useMeta = FALSE; static Boolean useFilemon = FALSE; @@ -79,6 +82,7 @@ static Boolean metaEnv = FALSE; /* don' static Boolean metaVerbose = FALSE; static Boolean metaIgnoreCMDs = FALSE; /* ignore CMDs in .meta files */ static Boolean metaIgnorePatterns = FALSE; /* do we need to do pattern matches */ +static Boolean metaIgnoreFilter = FALSE; /* do we have more complex filtering? */ static Boolean metaCurdirOk = FALSE; /* write .meta in .CURDIR Ok? */ static Boolean metaSilent = FALSE; /* if we have a .meta be SILENT */ @@ -645,6 +649,11 @@ meta_mode_init(const char *make_mode) metaIgnorePatterns = TRUE; free(cp); } + cp = NULL; + if (Var_Value(MAKE_META_IGNORE_FILTER, VAR_GLOBAL, &cp)) { + metaIgnoreFilter = TRUE; + free(cp); + } } /* @@ -869,6 +878,7 @@ fgetLine(char **bufp, size_t *szp, int o return 0; } +/* Lst_ForEach wants 1 to stop search */ static int prefix_match(void *p, void *q) { @@ -879,6 +889,32 @@ prefix_match(void *p, void *q) return (0 == strncmp(path, prefix, n)); } +/* + * looking for exact or prefix/ match to + * Lst_Find wants 0 to stop search + */ +static int +path_match(const void *p, const void *q) +{ + const char *prefix = q; + const char *path = p; + size_t n = strlen(prefix); + int rc; + + if ((rc = strncmp(path, prefix, n)) == 0) { + switch (path[n]) { + case '\0': + case '/': + break; + default: + rc = 1; + break; + } + } + return rc; +} + +/* Lst_Find wants 0 to stop search */ static int string_match(const void *p, const void *q) { @@ -889,6 +925,67 @@ string_match(const void *p, const void * } +static int +meta_ignore(GNode *gn, const char *p) +{ + char fname[MAXPATHLEN]; + + if (p == NULL) + return TRUE; + + if (*p == '/') { + cached_realpath(p, fname); /* clean it up */ + if (Lst_ForEach(metaIgnorePaths, prefix_match, fname)) { +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, "meta_oodate: ignoring path: %s\n", + p); +#endif + return TRUE; + } + } + + if (metaIgnorePatterns) { + char *pm; + + snprintf(fname, sizeof(fname), + "${%s:@m@${%s:L:M$m}@}", + MAKE_META_IGNORE_PATTERNS, p); + pm = Var_Subst(NULL, fname, gn, VARF_WANTRES); + if (*pm) { +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, "meta_oodate: ignoring pattern: %s\n", + p); +#endif + free(pm); + return TRUE; + } + free(pm); + } + + if (metaIgnoreFilter) { + char *fm; + + /* skip if filter result is empty */ + snprintf(fname, sizeof(fname), + "${%s:L:${%s:ts:}}", + p, MAKE_META_IGNORE_FILTER); + fm = Var_Subst(NULL, fname, gn, VARF_WANTRES); + if (*fm == '\0') { +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, "meta_oodate: ignoring filtered: %s\n", + p); +#endif + free(fm); + return TRUE; + } + free(fm); + } + return FALSE; +} + /* * When running with 'meta' functionality, a target can be out-of-date * if any of the references in its meta data file is more recent. @@ -1170,12 +1267,19 @@ meta_oodate(GNode *gn, Boolean oodate) /* FALLTHROUGH */ case 'D': /* unlink */ if (*p == '/' && !Lst_IsEmpty(missingFiles)) { - /* remove p from the missingFiles list if present */ - if ((ln = Lst_Find(missingFiles, p, string_match)) != NULL) { - char *tp = Lst_Datum(ln); - Lst_Remove(missingFiles, ln); - free(tp); - ln = NULL; /* we're done with it */ + /* remove any missingFiles entries that match p */ + if ((ln = Lst_Find(missingFiles, p, + path_match)) != NULL) { + LstNode nln; + char *tp; + + do { + nln = Lst_FindFrom(missingFiles, Lst_Succ(ln), + p, path_match); + tp = Lst_Datum(ln); + Lst_Remove(missingFiles, ln); + free(tp); + } while ((ln = nln) != NULL); } } if (buf[0] == 'M') { @@ -1240,8 +1344,10 @@ meta_oodate(GNode *gn, Boolean oodate) if ((link_src != NULL && cached_lstat(p, &fs) < 0) || (link_src == NULL && cached_stat(p, &fs) < 0)) { - if (Lst_Find(missingFiles, p, string_match) == NULL) + if (!meta_ignore(gn, p)) { + if (Lst_Find(missingFiles, p, string_match) == NULL) Lst_AtEnd(missingFiles, bmake_strdup(p)); + } } break; check_link_src: @@ -1259,37 +1365,9 @@ meta_oodate(GNode *gn, Boolean oodate) * be part of the dependencies because * they are _expected_ to change. */ - if (*p == '/') { - cached_realpath(p, fname1); /* clean it up */ - if (Lst_ForEach(metaIgnorePaths, prefix_match, fname1)) { -#ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "meta_oodate: ignoring path: %s\n", - p); -#endif - break; - } - } - - if (metaIgnorePatterns) { - char *pm; - - snprintf(fname1, sizeof(fname1), - "${%s:@m@${%s:L:M$m}@}", - MAKE_META_IGNORE_PATTERNS, p); - pm = Var_Subst(NULL, fname1, gn, VARF_WANTRES); - if (*pm) { -#ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "meta_oodate: ignoring pattern: %s\n", - p); -#endif - free(pm); - break; - } - free(pm); - } - + if (meta_ignore(gn, p)) + break; + /* * The rest of the record is the file name. * Check if it's not an absolute path. @@ -1474,6 +1552,7 @@ meta_oodate(GNode *gn, Boolean oodate) if (DEBUG(META)) fprintf(debug_file, "%s: required but missing\n", fname); oodate = TRUE; + needOODATE = TRUE; /* assume the worst */ } } } @@ -1546,6 +1625,7 @@ meta_compat_parent(void) while (fgets(buf, sizeof(buf), fp)) { meta_job_output(NULL, buf, ""); printf("%s", buf); + fflush(stdout); } fclose(fp); } Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ChangeLog Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/mk/ChangeLog Thu Sep 8 23:49:33 2016 (r305631) @@ -1,3 +1,34 @@ +2016-08-15 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160815 + + * dirdeps.mk (.MAKE.META.IGNORE_FILTER): set filter to only + consider Makefile.depend* when checking if DIRDEPS_CACHE is up-to-date. + +2016-08-13 Simon J. Gerraty + + * meta.sys.mk (.MAKE.META.IGNORE_PATHS): + in meta mode we can ignore the mtime of makefiles + +2016-08-02 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160802 + + * lib.mk (libinstall): depends on beforinstall + + * prog.mk (proginstall): depends on beforinstall + patch from Lauri Tirkkonen + + * dirdeps.mk (bootstrap): When bootstrapping; creat + .MAKE.DEPENDFILE_DEFAULT and allow additional filtering via + .MAKE.DEPENDFILE_BOOTSTRAP_SED + + * dirdeps.mk: move some comments to where they make sense. + +2016-07-27 Simon J. Gerraty + + * dirdeps.mk (DIRDEPS_CACHE): no dirname. + 2016-06-02 Simon J. Gerraty * install-mk (MK_VERSION): 20160602 Modified: vendor/NetBSD/bmake/dist/mk/dirdeps.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/dirdeps.mk Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/mk/dirdeps.mk Thu Sep 8 23:49:33 2016 (r305631) @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.67 2016/04/18 21:50:47 sjg Exp $ +# $Id: dirdeps.mk,v 1.73 2016/08/15 19:28:13 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -116,12 +116,17 @@ _DIRDEP_USE_LEVEL?= 0 .if ${.MAKE.LEVEL} == ${_DIRDEP_USE_LEVEL} # only the first instance is interested in all this -# First off, we want to know what ${MACHINE} to build for. -# This can be complicated if we are using a mixture of ${MACHINE} specific -# and non-specific Makefile.depend* - .if !target(_DIRDEP_USE) +# do some setup we only need once +_CURDIR ?= ${.CURDIR} +_OBJDIR ?= ${.OBJDIR} + +now_utc = ${%s:L:gmtime} +.if !defined(start_utc) +start_utc := ${now_utc} +.endif + .if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} != "" # This little trick let's us do # @@ -144,15 +149,6 @@ MK_DIRDEPS_CACHE = no # make sure we get the behavior we expect .MAKE.SAVE_DOLLARS = no -# do some setup we only need once -_CURDIR ?= ${.CURDIR} -_OBJDIR ?= ${.OBJDIR} - -now_utc = ${%s:L:gmtime} -.if !defined(start_utc) -start_utc := ${now_utc} -.endif - # make sure these are empty to start with _DEP_TARGET_SPEC = @@ -223,6 +219,10 @@ N_notmachine := ${.MAKE.DEPENDFILE_PREFE .endif # !target(_DIRDEP_USE) +# First off, we want to know what ${MACHINE} to build for. +# This can be complicated if we are using a mixture of ${MACHINE} specific +# and non-specific Makefile.depend* + # if we were included recursively _DEP_TARGET_SPEC should be valid. .if empty(_DEP_TARGET_SPEC) # we may or may not have included a dependfile yet @@ -385,7 +385,7 @@ BUILD_DIRDEPS ?= yes .if !defined(NO_DIRDEPS) && !defined(NO_DIRDEPS_BELOW) .if ${MK_DIRDEPS_CACHE} == "yes" # this is where we will cache all our work -DIRDEPS_CACHE?= ${_OBJDIR}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.} +DIRDEPS_CACHE?= ${_OBJDIR:tA}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.} # just ensure this exists build-dirdeps: @@ -397,6 +397,9 @@ M_oneperline = @x@\\${.newline} $$x@ # we do this via sub-make BUILD_DIRDEPS = no +# ignore anything but these +.MAKE.META.IGNORE_FILTER = M*/${.MAKE.DEPENDFILE_PREFIX}* + dirdeps: dirdeps-cached dirdeps-cached: ${DIRDEPS_CACHE} .MAKE @echo "${TRACER}Using ${DIRDEPS_CACHE}" @@ -669,7 +672,10 @@ _DEP_RELDIR := ${RELDIR} make(bootstrap-recurse) || \ make(bootstrap-empty)) -.if exists(${.CURDIR}/${.MAKE.DEPENDFILE:T}) +# if we are bootstrapping create the default +_want = ${.CURDIR}/${.MAKE.DEPENDFILE_DEFAULT:T} + +.if exists(${_want}) # stop here ${.TARGETS:Mboot*}: .elif !make(bootstrap-empty) @@ -679,12 +685,19 @@ _src != cd ${.CURDIR} && for m in ${.MAK .error cannot find any of ${.MAKE.DEPENDFILE_PREFERENCE:T}${.newline}Use: bootstrap-empty .endif -_src?= ${.MAKE.DEPENDFILE:T} +_src?= ${.MAKE.DEPENDFILE} + +.MAKE.DEPENDFILE_BOOTSTRAP_SED+= -e 's,${_src:E},${MACHINE},g' # just create Makefile.depend* for this dir bootstrap-this: .NOTMAIN - @echo Bootstrapping ${RELDIR}/${.MAKE.DEPENDFILE:T} from ${_src:T} - (cd ${.CURDIR} && sed 's,${_src:E},${MACHINE},g' ${_src} > ${.MAKE.DEPENDFILE:T}) + @echo Bootstrapping ${RELDIR}/${_want:T} from ${_src:T}; \ + echo You need to build ${RELDIR} to correctly populate it. +.if ${_src:T} != ${.MAKE.DEPENDFILE_PREFIX:T} + (cd ${.CURDIR} && sed ${.MAKE.DEPENDFILE_BOOTSTRAP_SED} ${_src} > ${_want}) +.else + cp ${.CURDIR}/${_src} ${_want} +.endif # create Makefile.depend* for this dir and its dependencies bootstrap: bootstrap-recurse @@ -704,8 +717,8 @@ bootstrap-recurse: .NOTMAIN .MAKE # create an empty Makefile.depend* to get the ball rolling. bootstrap-empty: .NOTMAIN .NOMETA - @echo Creating empty ${RELDIR}/${.MAKE.DEPENDFILE:T}; \ + @echo Creating empty ${RELDIR}/${_want:T}; \ echo You need to build ${RELDIR} to correctly populate it. - @{ echo DIRDEPS=; echo ".include "; } > ${.CURDIR}/${.MAKE.DEPENDFILE:T} + @{ echo DIRDEPS=; echo ".include "; } > ${_want} .endif Modified: vendor/NetBSD/bmake/dist/mk/install-mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/install-mk Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/mk/install-mk Thu Sep 8 23:49:33 2016 (r305631) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.128 2016/06/03 17:22:32 sjg Exp $ +# $Id: install-mk,v 1.130 2016/08/15 19:28:13 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20160602 +MK_VERSION=20160815 OWNER= GROUP= MODE=444 Modified: vendor/NetBSD/bmake/dist/mk/lib.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/lib.mk Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/mk/lib.mk Thu Sep 8 23:49:33 2016 (r305631) @@ -1,4 +1,4 @@ -# $Id: lib.mk,v 1.53 2016/03/22 20:45:14 sjg Exp $ +# $Id: lib.mk,v 1.54 2016/08/02 20:52:17 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -564,6 +564,7 @@ libinstall: install: maninstall _SUBDIRUSE maninstall: afterinstall afterinstall: realinstall +libinstall: beforeinstall realinstall: beforeinstall .endif Modified: vendor/NetBSD/bmake/dist/mk/meta.sys.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta.sys.mk Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/mk/meta.sys.mk Thu Sep 8 23:49:33 2016 (r305631) @@ -1,4 +1,4 @@ -# $Id: meta.sys.mk,v 1.28 2016/04/05 15:58:37 sjg Exp $ +# $Id: meta.sys.mk,v 1.29 2016/08/13 17:51:45 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -25,6 +25,10 @@ # absoulte path to what we are reading. _PARSEDIR = ${.PARSEDIR:tA} +.if !defined(SYS_MK_DIR) +SYS_MK_DIR := ${_PARSEDIR} +.endif + META_MODE += meta verbose .MAKE.MODE ?= ${META_MODE} @@ -119,6 +123,15 @@ MKDEP_MK = meta.autodep.mk # re-running needlessly META_COOKIE_TOUCH= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}} META_NOPHONY= + +# some targets involve old pre-built targets +# ignore mtime of shell +# and mtime of makefiles does not matter in meta mode +.MAKE.META.IGNORE_PATHS += \ + ${MAKEFILE} \ + ${SHELL} \ + ${SYS_MK_DIR} + .if ${UPDATE_DEPENDFILE:Uyes:tl} != "no" .if ${.MAKEFLAGS:Uno:M-k} != "" # make this more obvious Modified: vendor/NetBSD/bmake/dist/mk/prog.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/prog.mk Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/mk/prog.mk Thu Sep 8 23:49:33 2016 (r305631) @@ -1,4 +1,4 @@ -# $Id: prog.mk,v 1.26 2016/03/22 20:45:14 sjg Exp $ +# $Id: prog.mk,v 1.27 2016/08/02 20:52:17 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -191,6 +191,7 @@ install_links: maninstall: afterinstall afterinstall: realinstall +proginstall: beforeinstall realinstall: beforeinstall .endif Modified: vendor/NetBSD/bmake/dist/os.sh ============================================================================== --- vendor/NetBSD/bmake/dist/os.sh Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/os.sh Thu Sep 8 23:49:33 2016 (r305631) @@ -17,7 +17,7 @@ # Simon J. Gerraty # RCSid: -# $Id: os.sh,v 1.50 2015/12/17 17:06:29 sjg Exp $ +# $Id: os.sh,v 1.52 2016/06/17 05:15:14 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -139,7 +139,7 @@ SunOS) case $OS in NetBSD) HOST_ARCH=$MACHINE - SHARE_ARCH=$OS/$HOST + SHARE_ARCH=$OS/$HOST_ARCH ;; OpenBSD) arch=`Which arch /usr/bin:/usr/ucb:$PATH` @@ -208,7 +208,8 @@ TMP_DIRS=${TMP_DIRS:-"/tmp /var/tmp"} MACHINE_ARCH=${MACHINE_ARCH:-$MACHINE} HOST_ARCH=${HOST_ARCH:-$MACHINE_ARCH} # we mount server:/share/arch/$SHARE_ARCH as /usr/local -SHARE_ARCH=${SHARE_ARCH:-$OS/$OSMAJOR.X/$HOST_ARCH} +SHARE_ARCH_DEFAULT=$OS/$OSMAJOR.X/$HOST_ARCH +SHARE_ARCH=${SHARE_ARCH:-$SHARE_ARCH_DEFAULT} LN=${LN:-ln} TR=${TR:-tr} Modified: vendor/NetBSD/bmake/dist/suff.c ============================================================================== --- vendor/NetBSD/bmake/dist/suff.c Thu Sep 8 22:38:20 2016 (r305630) +++ vendor/NetBSD/bmake/dist/suff.c Thu Sep 8 23:49:33 2016 (r305631) @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $ */ +/* $NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $"); +__RCSID("$NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $"); #endif #endif /* not lint */ #endif @@ -766,6 +766,8 @@ Suff_EndTransform(void *gnp, void *dummy { GNode *gn = (GNode *)gnp; + (void)dummy; + if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (gn->cohorts)) gn = (GNode *)Lst_Datum(Lst_Last(gn->cohorts)); if ((gn->type & OP_TRANSFORM) && Lst_IsEmpty(gn->commands) && @@ -809,7 +811,7 @@ Suff_EndTransform(void *gnp, void *dummy fprintf(debug_file, "transformation %s complete\n", gn->name); } - return(dummy ? 0 : 0); + return 0; } /*- @@ -1215,7 +1217,7 @@ SuffAddSrc(void *sp, void *lsp) #ifdef DEBUG_SRC s2->cp = Lst_Init(FALSE); Lst_AtEnd(targ->cp, s2); - fprintf(debug_file, "1 add %x %x to %x:", targ, s2, ls->l); + fprintf(debug_file, "1 add %p %p to %p:", targ, s2, ls->l); Lst_ForEach(ls->l, PrintAddr, NULL); fprintf(debug_file, "\n"); #endif @@ -1233,7 +1235,7 @@ SuffAddSrc(void *sp, void *lsp) #ifdef DEBUG_SRC s2->cp = Lst_Init(FALSE); Lst_AtEnd(targ->cp, s2); - fprintf(debug_file, "2 add %x %x to %x:", targ, s2, ls->l); + fprintf(debug_file, "2 add %p %p to %p:", targ, s2, ls->l); Lst_ForEach(ls->l, PrintAddr, NULL); fprintf(debug_file, "\n"); #endif @@ -1305,14 +1307,14 @@ SuffRemoveSrc(Lst l) free(s->pref); else { #ifdef DEBUG_SRC - LstNode ln = Lst_Member(s->parent->cp, s); - if (ln != NULL) - Lst_Remove(s->parent->cp, ln); + LstNode ln2 = Lst_Member(s->parent->cp, s); + if (ln2 != NULL) + Lst_Remove(s->parent->cp, ln2); #endif --s->parent->children; } #ifdef DEBUG_SRC - fprintf(debug_file, "free: [l=%x] p=%x %d\n", l, s, s->children); + fprintf(debug_file, "free: [l=%p] p=%p %d\n", l, s, s->children); Lst_Destroy(s->cp, NULL); #endif Lst_Remove(l, ln); @@ -1323,7 +1325,7 @@ SuffRemoveSrc(Lst l) } #ifdef DEBUG_SRC else { - fprintf(debug_file, "keep: [l=%x] p=%x %d: ", l, s, s->children); + fprintf(debug_file, "keep: [l=%p] p=%p %d: ", l, s, s->children); Lst_ForEach(s->cp, PrintAddr, NULL); fprintf(debug_file, "\n"); } @@ -1372,7 +1374,7 @@ SuffFindThem(Lst srcs, Lst slst) */ if (Targ_FindNode(s->file, TARG_NOCREATE) != NULL) { #ifdef DEBUG_SRC - fprintf(debug_file, "remove %x from %x\n", s, srcs); + fprintf(debug_file, "remove %p from %p\n", s, srcs); #endif rs = s; break; @@ -1381,7 +1383,7 @@ SuffFindThem(Lst srcs, Lst slst) if ((ptr = Dir_FindFile(s->file, s->suff->searchPath)) != NULL) { rs = s; #ifdef DEBUG_SRC - fprintf(debug_file, "remove %x from %x\n", s, srcs); + fprintf(debug_file, "remove %p from %p\n", s, srcs); #endif free(ptr); break; @@ -1497,7 +1499,7 @@ SuffFindCmds(Src *targ, Lst slst) targ->children += 1; #ifdef DEBUG_SRC ret->cp = Lst_Init(FALSE); - fprintf(debug_file, "3 add %x %x\n", targ, ret); + fprintf(debug_file, "3 add %p %p\n", targ, ret); Lst_AtEnd(targ->cp, ret); #endif Lst_AtEnd(slst, ret); @@ -1616,7 +1618,7 @@ SuffExpandChildren(LstNode cln, GNode *p } free(freeIt); - } else if (*cp == '\\' && *cp != '\0') { + } else if (*cp == '\\' && cp[1] != '\0') { /* * Escaped something -- skip over it */ @@ -2597,8 +2599,10 @@ Suff_End(void) static int SuffPrintName(void *s, void *dummy) { + (void)dummy; + fprintf(debug_file, "%s ", ((Suff *)s)->name); - return (dummy ? 0 : 0); + return 0; } static int @@ -2608,6 +2612,8 @@ SuffPrintSuff(void *sp, void *dummy) int flags; int flag; + (void)dummy; + fprintf(debug_file, "# `%s' [%d] ", s->name, s->refCount); flags = s->flags; @@ -2640,7 +2646,7 @@ SuffPrintSuff(void *sp, void *dummy) fprintf(debug_file, "#\tSearch Path: "); Dir_PrintPath(s->searchPath); fputc('\n', debug_file); - return (dummy ? 0 : 0); + return 0; } static int @@ -2648,12 +2654,14 @@ SuffPrintTrans(void *tp, void *dummy) { GNode *t = (GNode *)tp; + (void)dummy; + fprintf(debug_file, "%-16s: ", t->name); Targ_PrintType(t->type); fputc('\n', debug_file); Lst_ForEach(t->commands, Targ_PrintCmd, NULL); fputc('\n', debug_file); - return(dummy ? 0 : 0); + return 0; } void From owner-svn-src-vendor@freebsd.org Thu Sep 8 23:49:48 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFA54BD2994; Thu, 8 Sep 2016 23:49:48 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A52A2BA0; Thu, 8 Sep 2016 23:49:48 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u88NnlNh085823; Thu, 8 Sep 2016 23:49:47 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u88NnlDF085822; Thu, 8 Sep 2016 23:49:47 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201609082349.u88NnlDF085822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 8 Sep 2016 23:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r305632 - vendor/NetBSD/bmake/20160818 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2016 23:49:49 -0000 Author: sjg Date: Thu Sep 8 23:49:47 2016 New Revision: 305632 URL: https://svnweb.freebsd.org/changeset/base/305632 Log: tag bmake-20160818 Added: vendor/NetBSD/bmake/20160818/ - copied from r305631, vendor/NetBSD/bmake/dist/