Date: Sun, 5 Nov 2017 04:08:01 +0000 (UTC) From: Ngie Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r325423 - in projects/runtime-coverage: . contrib/llvm/lib/Support/Unix etc/autofs etc/rc.d lib/libc/stdlib lib/libc/sys lib/libcasper/libcasper lib/libcasper/services/cap_dns lib/libca... Message-ID: <201711050408.vA54813U042582@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Sun Nov 5 04:08:00 2017 New Revision: 325423 URL: https://svnweb.freebsd.org/changeset/base/325423 Log: MFhead@r325422 Added: projects/runtime-coverage/etc/autofs/include_nis - copied unchanged from r325422, head/etc/autofs/include_nis projects/runtime-coverage/sys/powerpc/mpc85xx/fsl_sata.c - copied unchanged from r325422, head/sys/powerpc/mpc85xx/fsl_sata.c projects/runtime-coverage/sys/powerpc/mpc85xx/fsl_sata.h - copied unchanged from r325422, head/sys/powerpc/mpc85xx/fsl_sata.h Modified: projects/runtime-coverage/Makefile projects/runtime-coverage/Makefile.inc1 projects/runtime-coverage/Makefile.libcompat projects/runtime-coverage/ObsoleteFiles.inc projects/runtime-coverage/contrib/llvm/lib/Support/Unix/Path.inc projects/runtime-coverage/etc/autofs/Makefile projects/runtime-coverage/etc/rc.d/automount projects/runtime-coverage/etc/rc.d/automountd projects/runtime-coverage/etc/rc.d/autounmountd projects/runtime-coverage/lib/libc/stdlib/quick_exit.3 projects/runtime-coverage/lib/libc/stdlib/quick_exit.c projects/runtime-coverage/lib/libc/sys/posix_fallocate.2 projects/runtime-coverage/lib/libcasper/libcasper/Makefile projects/runtime-coverage/lib/libcasper/services/cap_dns/Makefile projects/runtime-coverage/lib/libcasper/services/cap_grp/Makefile projects/runtime-coverage/lib/libcasper/services/cap_pwd/Makefile projects/runtime-coverage/lib/libcasper/services/cap_random/Makefile projects/runtime-coverage/lib/libcasper/services/cap_sysctl/Makefile projects/runtime-coverage/share/man/man9/Makefile projects/runtime-coverage/share/mk/auto.obj.mk projects/runtime-coverage/share/mk/bsd.dep.mk projects/runtime-coverage/share/mk/bsd.init.mk projects/runtime-coverage/share/mk/bsd.obj.mk projects/runtime-coverage/share/mk/src.sys.obj.mk projects/runtime-coverage/share/mk/suite.test.mk projects/runtime-coverage/share/mk/sys.mk projects/runtime-coverage/sys/amd64/amd64/genassym.c projects/runtime-coverage/sys/arm/allwinner/if_awg.c projects/runtime-coverage/sys/conf/files.powerpc projects/runtime-coverage/sys/i386/i386/genassym.c projects/runtime-coverage/sys/i386/i386/swtch.s projects/runtime-coverage/sys/kern/imgact_shell.c projects/runtime-coverage/sys/kern/kern_umtx.c projects/runtime-coverage/targets/pseudo/bootstrap-tools/Makefile projects/runtime-coverage/usr.sbin/ctld/login.c Directory Properties: projects/runtime-coverage/ (props changed) projects/runtime-coverage/contrib/llvm/ (props changed) Modified: projects/runtime-coverage/Makefile ============================================================================== --- projects/runtime-coverage/Makefile Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/Makefile Sun Nov 5 04:08:00 2017 (r325423) @@ -209,7 +209,7 @@ WANT_MAKE_VERSION= 20160604 # 20160220 - support .dinclude for FAST_DEPEND. WANT_MAKE_VERSION= 20160220 .endif -MYMAKE= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}/${WANT_MAKE} +MYMAKE= ${OBJROOT}make.${MACHINE}/${WANT_MAKE} .if defined(.PARSEDIR) HAVE_MAKE= bmake .else @@ -407,10 +407,13 @@ upgrade_checks: .PHONY # headers, libraries and tools. Also, allow the location of # the system bsdmake-like utility to be overridden. # -MMAKEENV= MAKEOBJDIRPREFIX=${MYMAKE:H} \ +MMAKEENV= \ DESTDIR= \ INSTALL="sh ${.CURDIR}/tools/install.sh" MMAKE= ${MMAKEENV} ${MAKE} \ + OBJTOP=${MYMAKE:H}/obj \ + OBJROOT='$${OBJTOP}/' \ + MAKEOBJDIRPREFIX= \ MAN= -DNO_SHARED \ -DNO_CPU_CFLAGS -DNO_WERROR \ -DNO_SUBDIR \ Modified: projects/runtime-coverage/Makefile.inc1 ============================================================================== --- projects/runtime-coverage/Makefile.inc1 Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/Makefile.inc1 Sun Nov 5 04:08:00 2017 (r325423) @@ -523,6 +523,7 @@ BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ BSARGS= DESTDIR= \ OBJTOP='${WORLDTMP}/obj-tools' \ OBJROOT='$${OBJTOP}/' \ + MAKEOBJDIRPREFIX= \ BOOTSTRAPPING=${OSRELDATE} \ BWPHASE=${.TARGET:C,^_,,} \ SSP_CFLAGS= \ @@ -566,6 +567,7 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} \ DESTDIR= \ OBJTOP='${WORLDTMP}/obj-kernel-tools' \ OBJROOT='$${OBJTOP}/' \ + MAKEOBJDIRPREFIX= \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ MK_COVERAGE=no MK_HTML=no -DNO_LINT MK_MAN=no \ Modified: projects/runtime-coverage/Makefile.libcompat ============================================================================== --- projects/runtime-coverage/Makefile.libcompat Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/Makefile.libcompat Sun Nov 5 04:08:00 2017 (r325423) @@ -108,8 +108,6 @@ LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/inclu # Yes, the flags are redundant. LIBCOMPATWMAKEENV+= \ - OBJTOP=${LIBCOMPAT_OBJTOP} \ - OBJROOT='$${OBJTOP}/' \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${TMPPATH} \ SYSROOT=${LIBCOMPATTMP} \ @@ -130,6 +128,9 @@ LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ -DNO_LINT \ MK_TESTS=no LIBCOMPATWMAKE+= ${LIBCOMPATWMAKEENV} ${MAKE} ${LIBCOMPATWMAKEFLAGS} \ + OBJTOP=${LIBCOMPAT_OBJTOP} \ + OBJROOT='$${OBJTOP}/' \ + MAKEOBJDIRPREFIX= \ MK_MAN=no MK_HTML=no LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR=*} \ MK_TOOLCHAIN=no ${IMAKE_INSTALL} \ @@ -186,9 +187,10 @@ build${libcompat}: .PHONY ${_+_}cd ${.CURDIR}/${_dir}; \ WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ + ${MAKE} SSP_CFLAGS= DESTDIR= \ OBJTOP=${LIBCOMPAT_OBJTOP} \ OBJROOT='$${OBJTOP}/' \ - ${MAKE} SSP_CFLAGS= DESTDIR= \ + MAKEOBJDIRPREFIX= \ DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ build-tools .endfor Modified: projects/runtime-coverage/ObsoleteFiles.inc ============================================================================== --- projects/runtime-coverage/ObsoleteFiles.inc Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/ObsoleteFiles.inc Sun Nov 5 04:08:00 2017 (r325423) @@ -38,6 +38,21 @@ # xargs -n1 | sort | uniq -d; # done +# 20171104: libcap_random should be in /lib not in /usr/lib +OLD_LIBS+=usr/lib/libcap_random.so.0 +# 20171104: Casper can work only as shared library +OLD_FILES+=usr/lib/libcasper.a +OLD_FILES+=usr/lib/libcasper_p.a +OLD_FILES+=usr/lib/libcap_dns.a +OLD_FILES+=usr/lib/libcap_dns_p.a +OLD_FILES+=usr/lib/libcap_grp.a +OLD_FILES+=usr/lib/libcap_grp_p.a +OLD_FILES+=usr/lib/libcap_pwd.a +OLD_FILES+=usr/lib/libcap_pwd_p.a +OLD_FILES+=usr/lib/libcap_random.a +OLD_FILES+=usr/lib/libcap_random_p.a +OLD_FILES+=usr/lib/libcap_sysctl.a +OLD_FILES+=usr/lib/libcap_sysctl_p.a # 20171031: Removal of obsolete man files OLD_FILES+=usr/share/man/man7/adding_user.7.gz # 20171031: Disconnected libpathconv tests Modified: projects/runtime-coverage/contrib/llvm/lib/Support/Unix/Path.inc ============================================================================== --- projects/runtime-coverage/contrib/llvm/lib/Support/Unix/Path.inc Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/contrib/llvm/lib/Support/Unix/Path.inc Sun Nov 5 04:08:00 2017 (r325423) @@ -427,7 +427,7 @@ std::error_code resize_file(int FD, uint64_t Size) { // If we have posix_fallocate use it. Unlike ftruncate it always allocates // space, so we get an error if the disk is full. if (int Err = ::posix_fallocate(FD, 0, Size)) { - if (Err != EOPNOTSUPP) + if (Err != EINVAL && Err != EOPNOTSUPP) return std::error_code(Err, std::generic_category()); } #endif Modified: projects/runtime-coverage/etc/autofs/Makefile ============================================================================== --- projects/runtime-coverage/etc/autofs/Makefile Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/etc/autofs/Makefile Sun Nov 5 04:08:00 2017 (r325423) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= include_ldap special_hosts special_media special_noauto special_null +FILES= include_ldap include_nis special_hosts special_media special_noauto special_null NO_OBJ= FILESDIR= /etc/autofs Copied: projects/runtime-coverage/etc/autofs/include_nis (from r325422, head/etc/autofs/include_nis) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/runtime-coverage/etc/autofs/include_nis Sun Nov 5 04:08:00 2017 (r325423, copy of r325422, head/etc/autofs/include_nis) @@ -0,0 +1,180 @@ +#!/usr/bin/awk -f +#- +# Copyright (c) 2017 G. Paul Ziemba +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. +# +# $FreeBSD$ +# + +# +# /etc/autofs/include_nis +# +# automountd Directory Services script for NIS +# +# SYNOPSIS +# include_nis <mapname> +# +# include_nis <mapname> <key> +# +# DESCRIPTION +# +# This script provides a Directory Services map for automountd +# based on NIS. Please see auto_master(5) for general information. +# +# The first form, with one argument, emits the entire named NIS map. +# The second form, with two arguments, emits the map entry for the +# key given in the second argument. +# +# This script attempts to determine the names and IP addresses +# of the local host. Map entries matching the local host are +# rewritten to specify nullfs mounts (instead of the default +# NFS) to reduce access overhead in the kernel. +# +# If a map entry contains multiple location fields, it is not changed. +# + + +# Populate list of names and IP addrs thet mean "this host" +# into myhostnames array +BEGIN { + # + # Set self hostnames + # + + "hostname -s" | getline; + myhostnames[$0] = 1; + + "hostname -f" | getline; + myhostnames[$0] = 1; + + myhostnames["localhost"] = 1 + + "hostname -f" | getline; + localdomain=$0 + myhostnames["localhost."localdomain] = 1 + + while ("ifconfig" | getline) { + if ($1 == "inet") { + myhostnames[$2] = 1; + } + } + + # debug +# print "--- hostname list start ----" +# for (i in myhostnames) { +# print i +# } +# print "--- hostname list end ----" + + if (ARGC == 2) { + # mapname only + while ("ypcat -k " ARGV[1] | getline) { + proc_mapline(1) + } + } + if (ARGC == 3) { + # mapname and keyname + while ("ypmatch " ARGV[2] " " ARGV[1] | getline) { + proc_mapline(0) + } + } + exit 0 +} + +function is_self(hostname) +{ + if (myhostnames[hostname]) { + return 1 + } + return 0 +} + +# +# Lines are of the form [key] [-opts] location1 [... locationN] +# +# indicate index of key field with first positional parameter +# 1 means keyfield is the first field +# 0 means keyfield is not present +# +function proc_mapline(keyfield) +{ + optionsfield = 0 + locationfield = 0 + locationcount = 0 + + for (i=keyfield+1; i <= NF; ++i) { + if (!optionsfield) { + if ($i ~ /^-/) { + # the first options field found on the line + optionsfield = i; + continue + } + } + # Assumption: location contains colon (":") + if (optionsfield && ($i ~ /:/) && ($i !~ /^-/)) { + ++locationcount + if (!locationfield) { + # the first location field found on the line + locationfield = i + } + } + } + + # + # If location not found, do not modify. + # + # If there is more than one location, do not modify. Rationale: + # Options are applied to all locations. We ca not have "nullfs" + # for only some locations and "nfs" for others for a given + # map key (i.e., a line). The usual reason for multiple + # locations is for redundancy using replicated volumes on + # multiple hosts, so multiple hosts imply fstype=nfs (the + # FreeBSD default for automounter maps). + # + # Hypothetically there could be a map entry with multiple + # locations all with host parts matching "me". In that case, + # it would be safe to rewrite the locations and specify + # nullfs, but the code does not handle this case. + # + if (locationcount == 1) { + # + # We have a line with exactly one location field + # + # Assumption: location has no more than one colon (":") + # + n=split($locationfield,location,":") + if (is_self(location[1])) { + $locationfield = ":" location[2] + if (optionsfield) { + # append to existing options + $optionsfield = $optionsfield ",fstype=nullfs" + } else { + # sneak in ahead of location + $locationfield = "-fstype=nullfs " $locationfield + } + } + } + + print +} Modified: projects/runtime-coverage/etc/rc.d/automount ============================================================================== --- projects/runtime-coverage/etc/rc.d/automount Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/etc/rc.d/automount Sun Nov 5 04:08:00 2017 (r325423) @@ -5,6 +5,7 @@ # PROVIDE: automount # REQUIRE: nfsclient automountd +# BEFORE: DAEMON # KEYWORD: nojail shutdown . /etc/rc.subr Modified: projects/runtime-coverage/etc/rc.d/automountd ============================================================================== --- projects/runtime-coverage/etc/rc.d/automountd Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/etc/rc.d/automountd Sun Nov 5 04:08:00 2017 (r325423) @@ -4,7 +4,8 @@ # # PROVIDE: automountd -# REQUIRE: DAEMON +# REQUIRE: rpcbind ypset nfsclient FILESYSTEMS ldconfig +# BEFORE: DAEMON # KEYWORD: nojail . /etc/rc.subr Modified: projects/runtime-coverage/etc/rc.d/autounmountd ============================================================================== --- projects/runtime-coverage/etc/rc.d/autounmountd Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/etc/rc.d/autounmountd Sun Nov 5 04:08:00 2017 (r325423) @@ -4,7 +4,8 @@ # # PROVIDE: autounmountd -# REQUIRE: DAEMON +# REQUIRE: FILESYSTEMS +# BEFORE: DAEMON # KEYWORD: nojail . /etc/rc.subr Modified: projects/runtime-coverage/lib/libc/stdlib/quick_exit.3 ============================================================================== --- projects/runtime-coverage/lib/libc/stdlib/quick_exit.3 Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/lib/libc/stdlib/quick_exit.3 Sun Nov 5 04:08:00 2017 (r325423) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2014 +.Dd November 4, 2017 .Dt QUICK_EXIT 3 .Os .Sh NAME @@ -44,6 +44,17 @@ with .Xr at_quick_exit 3 but not any C++ destructors or cleanup code registered with .Xr atexit 3 . +The +.Xr stdio 3 +file buffers are not flushed. +.Pp +The function +.Fn quick_exit +is +.Em async-signal safe +when the functions registered with +.Xr at_quick_exit 3 +are. .Sh RETURN VALUES The .Fn quick_exit Modified: projects/runtime-coverage/lib/libc/stdlib/quick_exit.c ============================================================================== --- projects/runtime-coverage/lib/libc/stdlib/quick_exit.c Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/lib/libc/stdlib/quick_exit.c Sun Nov 5 04:08:00 2017 (r325423) @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include <sys/types.h> +#include <machine/atomic.h> #include <stdlib.h> #include <pthread.h> @@ -60,6 +62,7 @@ at_quick_exit(void (*func)(void)) h->cleanup = func; pthread_mutex_lock(&atexit_mutex); h->next = handlers; + __compiler_membar(); handlers = h; pthread_mutex_unlock(&atexit_mutex); return (0); @@ -74,7 +77,9 @@ quick_exit(int status) * XXX: The C++ spec requires us to call std::terminate if there is an * exception here. */ - for (h = handlers; NULL != h; h = h->next) + for (h = handlers; NULL != h; h = h->next) { + __compiler_membar(); h->cleanup(); + } _Exit(status); } Modified: projects/runtime-coverage/lib/libc/sys/posix_fallocate.2 ============================================================================== --- projects/runtime-coverage/lib/libc/sys/posix_fallocate.2 Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/lib/libc/sys/posix_fallocate.2 Sun Nov 5 04:08:00 2017 (r325423) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd October 12, 2017 +.Dd November 4, 2017 .Dt POSIX_FALLOCATE 2 .Os .Sh NAME @@ -106,9 +106,10 @@ A signal was caught during execution. .It Bq Er EINVAL The .Fa len -argument was less than or equal to zero or the +argument was less than or equal to zero, the .Fa offset -argument was less than zero. +argument was less than zero, +or the operation is not supported by the file system. .It Bq Er EIO An I/O error occurred while reading from or writing to a file system. .It Bq Er ENODEV Modified: projects/runtime-coverage/lib/libcasper/libcasper/Makefile ============================================================================== --- projects/runtime-coverage/lib/libcasper/libcasper/Makefile Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/lib/libcasper/libcasper/Makefile Sun Nov 5 04:08:00 2017 (r325423) @@ -1,14 +1,14 @@ # $FreeBSD$ +SHLIBDIR?= /lib + .include <src.opts.mk> PACKAGE=${LIB} -SHLIB_MAJOR= 0 -SHLIBDIR?= /lib - .if ${MK_CASPER} != "no" -LIB= casper +SHLIB= casper +SHLIB_MAJOR= 0 SRCS= libcasper.c SRCS+= libcasper_impl.c Modified: projects/runtime-coverage/lib/libcasper/services/cap_dns/Makefile ============================================================================== --- projects/runtime-coverage/lib/libcasper/services/cap_dns/Makefile Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/lib/libcasper/services/cap_dns/Makefile Sun Nov 5 04:08:00 2017 (r325423) @@ -10,7 +10,7 @@ SHLIB_MAJOR= 0 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" -LIB= cap_dns +SHLIB= cap_dns SRCS= cap_dns.c .endif Modified: projects/runtime-coverage/lib/libcasper/services/cap_grp/Makefile ============================================================================== --- projects/runtime-coverage/lib/libcasper/services/cap_grp/Makefile Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/lib/libcasper/services/cap_grp/Makefile Sun Nov 5 04:08:00 2017 (r325423) @@ -10,7 +10,7 @@ SHLIB_MAJOR= 0 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" -LIB= cap_grp +SHLIB= cap_grp SRCS= cap_grp.c .endif Modified: projects/runtime-coverage/lib/libcasper/services/cap_pwd/Makefile ============================================================================== --- projects/runtime-coverage/lib/libcasper/services/cap_pwd/Makefile Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/lib/libcasper/services/cap_pwd/Makefile Sun Nov 5 04:08:00 2017 (r325423) @@ -10,7 +10,7 @@ SHLIB_MAJOR= 0 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" -LIB= cap_pwd +SHLIB= cap_pwd SRCS= cap_pwd.c .endif Modified: projects/runtime-coverage/lib/libcasper/services/cap_random/Makefile ============================================================================== --- projects/runtime-coverage/lib/libcasper/services/cap_random/Makefile Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/lib/libcasper/services/cap_random/Makefile Sun Nov 5 04:08:00 2017 (r325423) @@ -1,15 +1,16 @@ # $FreeBSD$ +SHLIBDIR?= /lib/casper + .include <src.opts.mk> PACKAGE=libcasper SHLIB_MAJOR= 0 -SHLIBDIR?= /lib/casper INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" -LIB= cap_random +SHLIB= cap_random SRCS= cap_random.c .endif Modified: projects/runtime-coverage/lib/libcasper/services/cap_sysctl/Makefile ============================================================================== --- projects/runtime-coverage/lib/libcasper/services/cap_sysctl/Makefile Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/lib/libcasper/services/cap_sysctl/Makefile Sun Nov 5 04:08:00 2017 (r325423) @@ -10,7 +10,7 @@ SHLIB_MAJOR= 0 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" -LIB= cap_sysctl +SHLIB= cap_sysctl SRCS= cap_sysctl.c .endif Modified: projects/runtime-coverage/share/man/man9/Makefile ============================================================================== --- projects/runtime-coverage/share/man/man9/Makefile Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/share/man/man9/Makefile Sun Nov 5 04:08:00 2017 (r325423) @@ -760,7 +760,8 @@ MLINKS+=devstat.9 devicestat.9 \ devstat.9 devstat_end_transaction.9 \ devstat.9 devstat_remove_entry.9 \ devstat.9 devstat_start_transaction.9 -MLINKS+=disk.9 disk_alloc.9 \ +MLINKS+=disk.9 disk_add_alias.9 \ + disk.9 disk_alloc.9 \ disk.9 disk_create.9 \ disk.9 disk_destroy.9 \ disk.9 disk_gone.9 \ Modified: projects/runtime-coverage/share/mk/auto.obj.mk ============================================================================== --- projects/runtime-coverage/share/mk/auto.obj.mk Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/share/mk/auto.obj.mk Sun Nov 5 04:08:00 2017 (r325423) @@ -61,11 +61,17 @@ __objdir_made != echo ${__objdir}/; umask ${OBJDIR_UMA .endif # This causes make to use the specified directory as .OBJDIR .OBJDIR: ${__objdir} -.if ${.OBJDIR:tA} != ${__objdir:tA} && ${__objdir_made:Uno:M${__objdir}/*} != "" +.if ${.OBJDIR:tA} != ${__objdir:tA} +# we did not get what we want - do we care? +.if ${__objdir_made:Uno:M${__objdir}/*} != "" # watch out for __objdir being relative path .if !(${__objdir:M/*} == "" && ${.OBJDIR:tA} == ${${.CURDIR}/${__objdir}:L:tA}) .error could not use ${__objdir}: .OBJDIR=${.OBJDIR} .endif +.endif +# apparently we can live with it +# make sure we know what we have +.OBJDIR: ${.CURDIR} .endif .endif .endif Modified: projects/runtime-coverage/share/mk/bsd.dep.mk ============================================================================== --- projects/runtime-coverage/share/mk/bsd.dep.mk Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/share/mk/bsd.dep.mk Sun Nov 5 04:08:00 2017 (r325423) @@ -327,6 +327,10 @@ cleandepend: .endif .ORDER: cleandepend all .ORDER: cleandepend depend +.if ${MK_AUTO_OBJ} == "yes" +.ORDER: cleanobj depend +.ORDER: cleandir depend +.endif .if !target(checkdpadd) && (defined(DPADD) || defined(LDADD)) _LDADD_FROM_DPADD= ${DPADD:R:T:C;^lib(.*)$;-l\1;g} Modified: projects/runtime-coverage/share/mk/bsd.init.mk ============================================================================== --- projects/runtime-coverage/share/mk/bsd.init.mk Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/share/mk/bsd.init.mk Sun Nov 5 04:08:00 2017 (r325423) @@ -10,6 +10,14 @@ __<bsd.init.mk>__: .include <bsd.opts.mk> .-include "local.init.mk" + +.if ${MK_AUTO_OBJ} == "yes" +# This is also done in bsd.obj.mk +.if defined(NO_OBJ) +.OBJDIR: ${.CURDIR} +.endif +.endif + .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" .endif @@ -56,7 +64,8 @@ _SKIP_BUILD= not building at level 0 ${.TARGETS:M*install*} == ${.TARGETS} || \ ${.TARGETS:Mclean*} == ${.TARGETS} || \ ${.TARGETS:Mdestroy*} == ${.TARGETS} || \ - make(obj) || make(analyze) || make(print-dir) + ${.TARGETS:Mobj} == ${.TARGETS} || \ + make(analyze) || make(print-dir) # Skip building, but don't show a warning. _SKIP_BUILD= .endif Modified: projects/runtime-coverage/share/mk/bsd.obj.mk ============================================================================== --- projects/runtime-coverage/share/mk/bsd.obj.mk Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/share/mk/bsd.obj.mk Sun Nov 5 04:08:00 2017 (r325423) @@ -47,6 +47,7 @@ __<bsd.obj.mk>__: objwarn: obj: CANONICALOBJDIR= ${.OBJDIR} +# This is also done in bsd.init.mk .if defined(NO_OBJ) # but this makefile does not want it! .OBJDIR: ${.CURDIR} @@ -84,6 +85,11 @@ OBJTOP?= ${MAKEOBJDIR} CANONICALOBJDIR:=/usr/obj${.CURDIR} .endif +.if defined(SRCTOP) && \ + (${CANONICALOBJDIR} == /${RELDIR} || ${.OBJDIR} == /${RELDIR}) +.error .OBJDIR incorrectly set to /${RELDIR} +.endif + OBJTOP?= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP} # @@ -158,7 +164,8 @@ whereobj: .endif # Same check in bsd.progs.mk -.if ${CANONICALOBJDIR} != ${.CURDIR} && exists(${CANONICALOBJDIR}/) +.if ${CANONICALOBJDIR} != ${.CURDIR} && exists(${CANONICALOBJDIR}/) && \ + (${MK_AUTO_OBJ} == "no" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} == "") cleanobj: -rm -rf ${CANONICALOBJDIR} .else @@ -182,6 +189,10 @@ clean: .endif .endif .ORDER: clean all +.if ${MK_AUTO_OBJ} == "yes" +.ORDER: cleanobj all +.ORDER: cleandir all +.endif .include <bsd.subdir.mk> Modified: projects/runtime-coverage/share/mk/src.sys.obj.mk ============================================================================== --- projects/runtime-coverage/share/mk/src.sys.obj.mk Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/share/mk/src.sys.obj.mk Sun Nov 5 04:08:00 2017 (r325423) @@ -77,13 +77,6 @@ OBJTOP:= ${OBJROOT}${TARGET:D${TARGET}.${TARGET_ARCH}: OBJTOP:= ${OBJROOT:H} .endif # ${MK_UNIFIED_OBJDIR} == "yes" -# Wait to validate MAKEOBJDIR until OBJTOP is set. -.if defined(MAKEOBJDIR) -.if ${MAKEOBJDIR:M/*} == "" -.error Cannot use MAKEOBJDIR=${MAKEOBJDIR}${.newline}Unset MAKEOBJDIR to get default: MAKEOBJDIR='${_default_makeobjdir}' -.endif -.endif - # Fixup OBJROOT/OBJTOP if using MAKEOBJDIRPREFIX but leave it alone # for DIRDEPS_BUILD which really wants to know the absolute top at # all times. This intenionally comes after adding TARGET.TARGET_ARCH @@ -94,9 +87,24 @@ OBJTOP:= ${MAKEOBJDIRPREFIX}${SRCTOP} OBJROOT:= ${OBJTOP}/ .endif -# Try to enable MK_AUTO_OBJ by default if we can write to the OBJROOT. Only -# do this if AUTO_OBJ is not disabled by the user, not cleaning, and this -# is the first make ran. +# Wait to validate MAKEOBJDIR until OBJTOP is set. +.if defined(MAKEOBJDIR) +.if ${MAKEOBJDIR:M/*} == "" +.error Cannot use MAKEOBJDIR=${MAKEOBJDIR}${.newline}Unset MAKEOBJDIR to get default: MAKEOBJDIR='${_default_makeobjdir}' +.endif +.endif + +# __objdir is the expected .OBJDIR we want to use and that auto.obj.mk will +# try to create. +.if !empty(MAKEOBJDIRPREFIX) +__objdir:= ${MAKEOBJDIRPREFIX}${.CURDIR} +.elif !empty(MAKEOBJDIR) +__objdir:= ${MAKEOBJDIR} +.endif + +# Try to enable MK_AUTO_OBJ by default if we can write to the __objdir. Only +# do this if AUTO_OBJ is not disabled by the user, not cleaning, and this is +# the first make ran. .if 0 && ${.MAKE.LEVEL} == 0 && \ ${MK_AUTO_OBJ} == "no" && empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) && \ !defined(WITHOUT_AUTO_OBJ) && !make(showconfig) && !make(print-dir) && \ @@ -138,15 +146,13 @@ CheckAutoObj() { \ echo no; \ fi; \ } -.if !empty(MAKEOBJDIRPREFIX) -WANTED_OBJDIR= ${MAKEOBJDIRPREFIX}${.CURDIR} -.else -WANTED_OBJDIR= ${MAKEOBJDIR} +.if !empty(__objdir) +__objdir_writable!= \ + ${CheckAutoObj}; CheckAutoObj "${__objdir}" || echo no .endif -OBJDIR_WRITABLE!= \ - ${CheckAutoObj}; CheckAutoObj "${WANTED_OBJDIR}" || echo no +__objdir_writable?= no # Export the decision to sub-makes. -MK_AUTO_OBJ:= ${OBJDIR_WRITABLE} +MK_AUTO_OBJ:= ${__objdir_writable} .export MK_AUTO_OBJ .elif make(showconfig) # Need to export for showconfig internally running make -dg1. It is enabled @@ -154,14 +160,11 @@ MK_AUTO_OBJ:= ${OBJDIR_WRITABLE} .export MK_AUTO_OBJ .endif # ${MK_AUTO_OBJ} == "no" && ... -# Assign this directory as .OBJDIR if possible after determining if AUTO_OBJ -# can be enabled by default. -.if ${MK_AUTO_OBJ} == "no" +# Assign this directory as .OBJDIR if possible. +# # The expected OBJDIR already exists, set it as .OBJDIR. -.if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}${.CURDIR}) -.OBJDIR: ${MAKEOBJDIRPREFIX}${.CURDIR} -.elif exists(${MAKEOBJDIR}) -.OBJDIR: ${MAKEOBJDIR} +.if !empty(__objdir) && exists(${__objdir}) +.OBJDIR: ${__objdir} # Special case to work around bmake bug. If the top-level .OBJDIR does not yet # exist and MAKEOBJDIR is passed into environment and yield a blank value, # bmake will incorrectly set .OBJDIR=${SRCTOP}/ rather than the expected @@ -169,5 +172,10 @@ MK_AUTO_OBJ:= ${OBJDIR_WRITABLE} .elif ${MAKE_VERSION} <= 20170720 && \ ${.CURDIR} == ${SRCTOP} && ${.OBJDIR} == ${SRCTOP}/ .OBJDIR: ${.CURDIR} +.else +# The OBJDIR we wanted does not yet exist, ensure we default to safe .CURDIR +# in case make started with a bogus MAKEOBJDIR, that expanded before OBJTOP +# was set, that happened to match some unexpected directory. Either +# auto.obj.mk or bsd.obj.mk will create the directory and fix .OBJDIR later. +.OBJDIR: ${.CURDIR} .endif -.endif # ${MK_AUTO_OBJ} == "no" Modified: projects/runtime-coverage/share/mk/suite.test.mk ============================================================================== --- projects/runtime-coverage/share/mk/suite.test.mk Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/share/mk/suite.test.mk Sun Nov 5 04:08:00 2017 (r325423) @@ -79,11 +79,11 @@ Kyuafile: Makefile KYUA= ${LOCALBASE}/bin/kyua -MAKE_CHECK_SANDBOX_DIR= ${.OBJDIR}/checkdir +MAKE_CHECK_SANDBOX_DIR= checkdir CLEANDIRS+= ${MAKE_CHECK_SANDBOX_DIR} .if ${MK_MAKE_CHECK_USE_SANDBOX} != "no" && make(check) -DESTDIR:= ${MAKE_CHECK_SANDBOX_DIR} +DESTDIR:= ${.OBJDIR}/${MAKE_CHECK_SANDBOX_DIR} .if ${MK_MAKE_CHECK_TEST_WITH_COVERAGE} != "no" GCOV?= gcov Modified: projects/runtime-coverage/share/mk/sys.mk ============================================================================== --- projects/runtime-coverage/share/mk/sys.mk Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/share/mk/sys.mk Sun Nov 5 04:08:00 2017 (r325423) @@ -125,12 +125,6 @@ NO_META_IGNORE_HOST_HEADERS= 1 # is not expected. .if !make(showconfig) && !make(print-dir) .sinclude <auto.obj.mk> -# The .OBJDIR was not set, disable MK_AUTO_OBJ so downstream checks won't -# assume .OBJDIR is proper. -.if defined(__objdir) && ${.OBJDIR} != ${__objdir} -.MAKEOVERRIDES+= MK_AUTO_OBJ -MK_AUTO_OBJ= no -.endif .endif .endif # ${MK_AUTO_OBJ} == "yes" .else # bmake Modified: projects/runtime-coverage/sys/amd64/amd64/genassym.c ============================================================================== --- projects/runtime-coverage/sys/amd64/amd64/genassym.c Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/sys/amd64/amd64/genassym.c Sun Nov 5 04:08:00 2017 (r325423) @@ -81,7 +81,6 @@ ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); ASSYM(TD_PFLAGS, offsetof(struct thread, td_pflags)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); -ASSYM(TD_TID, offsetof(struct thread, td_tid)); ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); Modified: projects/runtime-coverage/sys/arm/allwinner/if_awg.c ============================================================================== --- projects/runtime-coverage/sys/arm/allwinner/if_awg.c Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/sys/arm/allwinner/if_awg.c Sun Nov 5 04:08:00 2017 (r325423) @@ -92,7 +92,7 @@ __FBSDID("$FreeBSD$"); #define TX_SKIP(n, o) (((n) + (o)) & (TX_DESC_COUNT - 1)) #define RX_NEXT(n) (((n) + 1) & (RX_DESC_COUNT - 1)) -#define TX_MAX_SEGS 10 +#define TX_MAX_SEGS 20 #define SOFT_RST_RETRY 1000 #define MII_BUSY_RETRY 1000 @@ -192,6 +192,7 @@ struct awg_softc { struct resource *res[_RES_NITEMS]; struct mtx mtx; if_t ifp; + device_t dev; device_t miibus; struct callout stat_ch; struct task link_task; @@ -421,14 +422,18 @@ awg_setup_txbuf(struct awg_softc *sc, int index, struc sc->tx.buf_map[index].map, m, segs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { m = m_collapse(m, M_NOWAIT, TX_MAX_SEGS); - if (m == NULL) + if (m == NULL) { + device_printf(sc->dev, "awg_setup_txbuf: m_collapse failed\n"); return (0); + } *mp = m; error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag, sc->tx.buf_map[index].map, m, segs, &nsegs, BUS_DMA_NOWAIT); } - if (error != 0) + if (error != 0) { + device_printf(sc->dev, "awg_setup_txbuf: bus_dmamap_load_mbuf_sg failed\n"); return (0); + } bus_dmamap_sync(sc->tx.buf_tag, sc->tx.buf_map[index].map, BUS_DMASYNC_PREWRITE); @@ -1613,6 +1618,7 @@ awg_attach(device_t dev) int error; sc = device_get_softc(dev); + sc->dev = dev; sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; node = ofw_bus_get_node(dev); Modified: projects/runtime-coverage/sys/conf/files.powerpc ============================================================================== --- projects/runtime-coverage/sys/conf/files.powerpc Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/sys/conf/files.powerpc Sun Nov 5 04:08:00 2017 (r325423) @@ -141,6 +141,7 @@ powerpc/mpc85xx/ds1553_bus_fdt.c optional ds1553 fdt powerpc/mpc85xx/ds1553_core.c optional ds1553 powerpc/mpc85xx/fsl_diu.c optional mpc85xx diu powerpc/mpc85xx/fsl_espi.c optional mpc85xx spibus +powerpc/mpc85xx/fsl_sata.c optional mpc85xx ata powerpc/mpc85xx/i2c.c optional iicbus fdt powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx Modified: projects/runtime-coverage/sys/i386/i386/genassym.c ============================================================================== --- projects/runtime-coverage/sys/i386/i386/genassym.c Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/sys/i386/i386/genassym.c Sun Nov 5 04:08:00 2017 (r325423) @@ -88,7 +88,6 @@ ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); ASSYM(TD_PFLAGS, offsetof(struct thread, td_pflags)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); ASSYM(TD_MD, offsetof(struct thread, td_md)); -ASSYM(TD_TID, offsetof(struct thread, td_tid)); ASSYM(TDP_CALLCHAIN, TDP_CALLCHAIN); Modified: projects/runtime-coverage/sys/i386/i386/swtch.s ============================================================================== --- projects/runtime-coverage/sys/i386/i386/swtch.s Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/sys/i386/i386/swtch.s Sun Nov 5 04:08:00 2017 (r325423) @@ -258,7 +258,6 @@ sw1: movl %eax,(%esp) movl %edx, PCPU(CURPCB) - movl TD_TID(%ecx),%eax movl %ecx, PCPU(CURTHREAD) /* into next thread */ /* Modified: projects/runtime-coverage/sys/kern/imgact_shell.c ============================================================================== --- projects/runtime-coverage/sys/kern/imgact_shell.c Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/sys/kern/imgact_shell.c Sun Nov 5 04:08:00 2017 (r325423) @@ -97,8 +97,7 @@ CTASSERT(MAXSHELLCMDLEN >= MAXINTERP + 3); * 6.x branch on May 28, 2005 (matching __FreeBSD_version 600029). */ int -exec_shell_imgact(imgp) - struct image_params *imgp; +exec_shell_imgact(struct image_params *imgp) { const char *image_header = imgp->image_header; const char *ihp, *interpb, *interpe, *maxp, *optb, *opte, *fname; @@ -125,7 +124,7 @@ exec_shell_imgact(imgp) * However, we don't know how far into the page the contents are * valid -- the actual file might be much shorter than the page. * So find out the file size. - */ + */ error = VOP_GETATTR(imgp->vp, &vattr, imgp->proc->p_ucred); if (error) return (error); Modified: projects/runtime-coverage/sys/kern/kern_umtx.c ============================================================================== --- projects/runtime-coverage/sys/kern/kern_umtx.c Sun Nov 5 03:02:19 2017 (r325422) +++ projects/runtime-coverage/sys/kern/kern_umtx.c Sun Nov 5 04:08:00 2017 (r325423) @@ -1579,8 +1579,7 @@ umtx_pi_setowner(struct umtx_pi *pi, struct thread *ow uq_owner = owner->td_umtxq; mtx_assert(&umtx_lock, MA_OWNED); - if (pi->pi_owner != NULL) - panic("pi_owner != NULL"); + MPASS(pi->pi_owner == NULL); pi->pi_owner = owner; TAILQ_INSERT_TAIL(&uq_owner->uq_pi_contested, pi, pi_link); } Copied: projects/runtime-coverage/sys/powerpc/mpc85xx/fsl_sata.c (from r325422, head/sys/powerpc/mpc85xx/fsl_sata.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/runtime-coverage/sys/powerpc/mpc85xx/fsl_sata.c Sun Nov 5 04:08:00 2017 (r325423, copy of r325422, head/sys/powerpc/mpc85xx/fsl_sata.c) @@ -0,0 +1,1917 @@ +/*- + * Copyright (c) 2009-2012 Alexander Motin <mav@FreeBSD.org> + * Copyright (c) 2017 Justin Hibbits <jhibbits@FreeBSD.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/param.h> +#include <sys/module.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/bus.h> +#include <sys/conf.h> +#include <sys/endian.h> +#include <sys/lock.h> +#include <sys/malloc.h> +#include <sys/mutex.h> +#include <sys/rman.h> + +#include <cam/cam.h> +#include <cam/cam_ccb.h> +#include <cam/cam_sim.h> +#include <cam/cam_xpt_sim.h> +#include <cam/cam_debug.h> + +#include <dev/ofw/ofw_bus_subr.h> + +#include <machine/bus.h> +#include <machine/resource.h> + +#include "fsl_sata.h" + +struct fsl_sata_channel; +struct fsl_sata_slot; +enum fsl_sata_err_type; +struct fsl_sata_cmd_tab; + + +/* local prototypes */ +static int fsl_sata_init(device_t dev); +static int fsl_sata_deinit(device_t dev); +static int fsl_sata_suspend(device_t dev); +static int fsl_sata_resume(device_t dev); +static void fsl_sata_pm(void *arg); +static void fsl_sata_intr(void *arg); +static void fsl_sata_intr_main(struct fsl_sata_channel *ch, uint32_t istatus); +static void fsl_sata_begin_transaction(struct fsl_sata_channel *ch, union ccb *ccb); +static void fsl_sata_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error); +static void fsl_sata_execute_transaction(struct fsl_sata_slot *slot); +static void fsl_sata_timeout(struct fsl_sata_slot *slot); +static void fsl_sata_end_transaction(struct fsl_sata_slot *slot, enum fsl_sata_err_type et); +static int fsl_sata_setup_fis(struct fsl_sata_channel *ch, struct fsl_sata_cmd_tab *ctp, union ccb *ccb, int tag); +static void fsl_sata_dmainit(device_t dev); +static void fsl_sata_dmasetupc_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); +static void fsl_sata_dmafini(device_t dev); +static void fsl_sata_slotsalloc(device_t dev); +static void fsl_sata_slotsfree(device_t dev); +static void fsl_sata_reset(struct fsl_sata_channel *ch); +static void fsl_sata_start(struct fsl_sata_channel *ch); +static void fsl_sata_stop(struct fsl_sata_channel *ch); + +static void fsl_sata_issue_recovery(struct fsl_sata_channel *ch); +static void fsl_sata_process_read_log(struct fsl_sata_channel *ch, union ccb *ccb); +static void fsl_sata_process_request_sense(struct fsl_sata_channel *ch, union ccb *ccb); + +static void fsl_sataaction(struct cam_sim *sim, union ccb *ccb); +static void fsl_satapoll(struct cam_sim *sim); + +static MALLOC_DEFINE(M_FSL_SATA, "FSL SATA driver", "FSL SATA driver data buffers"); + +#define recovery_type spriv_field0 +#define RECOVERY_NONE 0 +#define RECOVERY_READ_LOG 1 +#define RECOVERY_REQUEST_SENSE 2 +#define recovery_slot spriv_field1 + +#define FSL_SATA_P_CQR 0x0 +#define FSL_SATA_P_CAR 0x4 +#define FSL_SATA_P_CCR 0x10 +#define FSL_SATA_P_CER 0x18 +#define FSL_SATA_P_DER 0x20 +#define FSL_SATA_P_CHBA 0x24 +#define FSL_SATA_P_HSTS 0x28 +#define FSL_SATA_P_HSTS_HS_ON 0x80000000 +#define FSL_SATA_P_HSTS_ME 0x00040000 +#define FSL_SATA_P_HSTS_DLM 0x00001000 +#define FSL_SATA_P_HSTS_FOT 0x00000200 +#define FSL_SATA_P_HSTS_FOR 0x00000100 +#define FSL_SATA_P_HSTS_FE 0x00000020 +#define FSL_SATA_P_HSTS_PR 0x00000010 +#define FSL_SATA_P_HSTS_SNTFU 0x00000004 +#define FSL_SATA_P_HSTS_DE 0x00000002 +#define FSL_SATA_P_HCTRL 0x2c +#define FSL_SATA_P_HCTRL_HC_ON 0x80000000 +#define FSL_SATA_P_HCTRL_HC_FORCE_OFF 0x40000000 +#define FSL_SATA_P_HCTRL_ENT 0x10000000 +#define FSL_SATA_P_HCTRL_SNOOP 0x00000400 +#define FSL_SATA_P_HCTRL_PM 0x00000200 +#define FSL_SATA_P_HCTRL_FATAL 0x00000020 +#define FSL_SATA_P_HCTRL_PHYRDY 0x00000010 +#define FSL_SATA_P_HCTRL_SIG 0x00000008 +#define FSL_SATA_P_HCTRL_SNTFY 0x00000004 *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711050408.vA54813U042582>