Merge ^/head r320042 through r320397.
This commit is contained in:
commit
a3604b95ed
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/projects/clang500-import/; revision=320398
5
Makefile
5
Makefile
@ -131,7 +131,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \
|
||||
build32 distribute32 install32 buildsoft distributesoft installsoft \
|
||||
builddtb xdev xdev-build xdev-install \
|
||||
xdev-links native-xtools stageworld stagekernel stage-packages \
|
||||
create-world-packages create-kernel-packages create-packages \
|
||||
create-packages-world create-packages-kernel create-packages \
|
||||
packages installconfig real-packages sign-packages package-pkg \
|
||||
print-dir test-system-compiler
|
||||
|
||||
@ -195,7 +195,8 @@ HAVE_MAKE= bmake
|
||||
.else
|
||||
HAVE_MAKE= fmake
|
||||
.endif
|
||||
.if ${HAVE_MAKE} != ${WANT_MAKE} || \
|
||||
.if defined(ALWAYS_BOOTSTRAP_MAKE) || \
|
||||
${HAVE_MAKE} != ${WANT_MAKE} || \
|
||||
(defined(WANT_MAKE_VERSION) && ${MAKE_VERSION} < ${WANT_MAKE_VERSION})
|
||||
NEED_MAKE_UPGRADE= t
|
||||
.endif
|
||||
|
116
Makefile.inc1
116
Makefile.inc1
@ -87,7 +87,8 @@ OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}
|
||||
|
||||
# Pull in compiler metadata from buildworld/toolchain if possible to avoid
|
||||
# running CC from bsd.compiler.mk.
|
||||
.if make(installworld) || make(install)
|
||||
.if make(installworld) || make(install) || make(distributeworld) || \
|
||||
make(stageworld)
|
||||
.-include "${OBJTREE}${.CURDIR}/compiler-metadata.mk"
|
||||
.endif
|
||||
|
||||
@ -149,7 +150,8 @@ TEST_SYSTEM_COMPILER_VARS= \
|
||||
WANT_COMPILER_TYPE WANT_COMPILER_VERSION WANT_COMPILER_VERSION_FILE \
|
||||
WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \
|
||||
CC COMPILER_TYPE COMPILER_FEATURES COMPILER_VERSION \
|
||||
COMPILER_FREEBSD_VERSION
|
||||
COMPILER_FREEBSD_VERSION \
|
||||
LINKER_TYPE LINKER_VERSION
|
||||
test-system-compiler: .PHONY
|
||||
.for v in ${TEST_SYSTEM_COMPILER_VARS}
|
||||
${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}"
|
||||
@ -181,7 +183,9 @@ CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \
|
||||
_COMPILER_METADATA_VARS= COMPILER_VERSION \
|
||||
COMPILER_TYPE \
|
||||
COMPILER_FEATURES \
|
||||
COMPILER_FREEBSD_VERSION
|
||||
COMPILER_FREEBSD_VERSION \
|
||||
LINKER_VERSION \
|
||||
LINKER_TYPE
|
||||
compiler-metadata.mk: .PHONY .META
|
||||
@: > ${.TARGET}
|
||||
@echo ".info Using cached compiler metadata from build at $$(hostname) on $$(date)" \
|
||||
@ -518,6 +522,7 @@ BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
||||
# need to keep this in sync with targets/pseudo/bootstrap-tools/Makefile
|
||||
BSARGS= DESTDIR= \
|
||||
BOOTSTRAPPING=${OSRELDATE} \
|
||||
BWPHASE=${.TARGET:C,^_,,} \
|
||||
SSP_CFLAGS= \
|
||||
MK_HTML=no NO_LINT=yes MK_MAN=no \
|
||||
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
|
||||
@ -536,6 +541,7 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
|
||||
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
||||
DESTDIR= \
|
||||
BOOTSTRAPPING=${OSRELDATE} \
|
||||
BWPHASE=${.TARGET:C,^_,,} \
|
||||
SSP_CFLAGS= \
|
||||
-DNO_LINT \
|
||||
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
|
||||
@ -563,7 +569,8 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \
|
||||
# world stage
|
||||
WMAKEENV= ${CROSSENV} \
|
||||
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
||||
PATH=${TMPPATH}
|
||||
PATH=${TMPPATH} \
|
||||
SYSROOT=${WORLDTMP}
|
||||
|
||||
# make hierarchy
|
||||
HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q}
|
||||
@ -688,7 +695,9 @@ NO_META_IGNORE_HOST_HEADERS= 1
|
||||
host-osreldate.h: # DO NOT ADD /usr/include/osreldate.h here
|
||||
@cp -f /usr/include/osreldate.h ${.TARGET}
|
||||
|
||||
WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=${WORLDTMP}
|
||||
WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
||||
BWPHASE=${.TARGET:C,^_,,} \
|
||||
DESTDIR=${WORLDTMP}
|
||||
|
||||
IMAKEENV= ${CROSSENV}
|
||||
IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \
|
||||
@ -709,6 +718,7 @@ _INSTALL_DDIR= ${DESTDIR}/${DISTDIR}
|
||||
INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::}
|
||||
.if defined(NO_ROOT)
|
||||
METALOG?= ${DESTDIR}/${DISTDIR}/METALOG
|
||||
METALOG:= ${METALOG:C,//+,/,g}
|
||||
IMAKE+= -DNO_ROOT METALOG=${METALOG}
|
||||
INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR}
|
||||
MTREEFLAGS+= -W
|
||||
@ -722,7 +732,7 @@ IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}"
|
||||
.endif
|
||||
|
||||
# kernel stage
|
||||
KMAKEENV= ${WMAKEENV}
|
||||
KMAKEENV= ${WMAKEENV:NSYSROOT=*}
|
||||
KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME}
|
||||
|
||||
#
|
||||
@ -752,14 +762,18 @@ _worldtmp: .PHONY
|
||||
.else
|
||||
rm -rf ${WORLDTMP}/legacy/usr/include
|
||||
.endif
|
||||
# Dependencies cannot cope with certain source tree changes, particularly
|
||||
# with respect to removing source files and replacing generated files.
|
||||
# Handle these cases here in an ad-hoc fashion.
|
||||
# 20160829 remove stale dependencies for ptrace stub, rewritten in C
|
||||
# in r305012
|
||||
.for f in ptrace
|
||||
|
||||
# Our current approach to dependency tracking cannot cope with certain source
|
||||
# tree changes, particularly with respect to removing source files and
|
||||
# replacing generated files. Handle these cases here in an ad-hoc fashion.
|
||||
#
|
||||
# Syscall stubs rewritten in C
|
||||
# Date SVN Rev Syscalls
|
||||
# 20160829 r305012 ptrace
|
||||
# 20170624 r320278 fstat fstatat fstatfs getdirentries getfsstat statfs
|
||||
.for f in fstat fstatat fstatfs getdirentries getfsstat ptrace statfs
|
||||
.if exists(${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.o)
|
||||
@if egrep -q '/${f}.[sS]' \
|
||||
@if egrep -qw '${f}\.[sS]' \
|
||||
${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.o; then \
|
||||
echo Removing stale dependencies for ${f} syscall wrappers; \
|
||||
rm -f ${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.* \
|
||||
@ -873,7 +887,7 @@ _cross-tools:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> stage 3: cross tools"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@rm -f ${.OBJDIR}/compiler-metadata.mk
|
||||
@rm -f ${OBJTREE}${.CURDIR}/compiler-metadata.mk
|
||||
${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
|
||||
${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools
|
||||
_build-metadata:
|
||||
@ -1527,21 +1541,36 @@ package-pkg: .PHONY
|
||||
|
||||
real-packages: stage-packages create-packages sign-packages .PHONY
|
||||
|
||||
stage-packages: .PHONY
|
||||
@mkdir -p ${REPODIR} ${WSTAGEDIR} ${KSTAGEDIR}
|
||||
stage-packages-world: .PHONY
|
||||
@mkdir -p ${WSTAGEDIR}
|
||||
${_+_}@cd ${.CURDIR}; \
|
||||
${MAKE} DESTDIR=${WSTAGEDIR} -DNO_ROOT -B stageworld ; \
|
||||
${MAKE} DESTDIR=${KSTAGEDIR} -DNO_ROOT -B stagekernel
|
||||
${MAKE} DESTDIR=${WSTAGEDIR} -DNO_ROOT stageworld
|
||||
|
||||
create-packages: _pkgbootstrap .PHONY
|
||||
@mkdir -p ${REPODIR}
|
||||
stage-packages-kernel: .PHONY
|
||||
@mkdir -p ${KSTAGEDIR}
|
||||
${_+_}@cd ${.CURDIR}; \
|
||||
${MAKE} DESTDIR=${WSTAGEDIR} \
|
||||
PKG_VERSION=${PKG_VERSION} create-world-packages ; \
|
||||
${MAKE} DESTDIR=${KSTAGEDIR} \
|
||||
${MAKE} DESTDIR=${KSTAGEDIR} -DNO_ROOT stagekernel
|
||||
|
||||
stage-packages: .PHONY stage-packages-world stage-packages-kernel
|
||||
|
||||
_repodir: .PHONY
|
||||
@mkdir -p ${REPODIR}
|
||||
|
||||
create-packages-world: _pkgbootstrap _repodir .PHONY
|
||||
${_+_}@cd ${.CURDIR}; \
|
||||
${MAKE} -f Makefile.inc1 \
|
||||
DESTDIR=${WSTAGEDIR} \
|
||||
PKG_VERSION=${PKG_VERSION} create-world-packages
|
||||
|
||||
create-packages-kernel: _pkgbootstrap _repodir .PHONY
|
||||
${_+_}@cd ${.CURDIR}; \
|
||||
${MAKE} -f Makefile.inc1 \
|
||||
DESTDIR=${KSTAGEDIR} \
|
||||
PKG_VERSION=${PKG_VERSION} DISTDIR=kernel \
|
||||
create-kernel-packages
|
||||
|
||||
create-packages: .PHONY create-packages-world create-packages-kernel
|
||||
|
||||
create-world-packages: _pkgbootstrap .PHONY
|
||||
@rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || :
|
||||
@cd ${WSTAGEDIR} ; \
|
||||
@ -1550,26 +1579,39 @@ create-world-packages: _pkgbootstrap .PHONY
|
||||
@for plist in ${WSTAGEDIR}/*.plist; do \
|
||||
plist=$${plist##*/} ; \
|
||||
pkgname=$${plist%.plist} ; \
|
||||
sh ${SRCDIR}/release/packages/generate-ucl.sh -o $${pkgname} \
|
||||
-s ${SRCDIR} -u ${WSTAGEDIR}/$${pkgname}.ucl ; \
|
||||
done
|
||||
@for plist in ${WSTAGEDIR}/*.plist; do \
|
||||
plist=$${plist##*/} ; \
|
||||
pkgname=$${plist%.plist} ; \
|
||||
awk -F\" ' \
|
||||
echo "_PKGS+= $${pkgname}" ; \
|
||||
done > ${WSTAGEDIR}/packages.mk
|
||||
${_+_}@cd ${.CURDIR}; \
|
||||
${MAKE} -f Makefile.inc1 create-world-packages-jobs \
|
||||
.MAKE.JOB.PREFIX=
|
||||
|
||||
.if make(create-world-packages-jobs)
|
||||
.include "${WSTAGEDIR}/packages.mk"
|
||||
.endif
|
||||
|
||||
create-world-packages-jobs: .PHONY
|
||||
.for pkgname in ${_PKGS}
|
||||
create-world-packages-jobs: create-world-package-${pkgname}
|
||||
create-world-package-${pkgname}: .PHONY
|
||||
@sh ${SRCDIR}/release/packages/generate-ucl.sh -o ${pkgname} \
|
||||
-s ${SRCDIR} -u ${WSTAGEDIR}/${pkgname}.ucl
|
||||
@awk -F\" ' \
|
||||
/^name/ { printf("===> Creating %s-", $$2); next } \
|
||||
/^version/ { print $$2; next } \
|
||||
' ${WSTAGEDIR}/$${pkgname}.ucl ; \
|
||||
' ${WSTAGEDIR}/${pkgname}.ucl ; \
|
||||
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
|
||||
create -M ${WSTAGEDIR}/$${pkgname}.ucl \
|
||||
-p ${WSTAGEDIR}/$${pkgname}.plist \
|
||||
create -M ${WSTAGEDIR}/${pkgname}.ucl \
|
||||
-p ${WSTAGEDIR}/${pkgname}.plist \
|
||||
-r ${WSTAGEDIR} \
|
||||
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \
|
||||
done
|
||||
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}
|
||||
.endfor
|
||||
|
||||
create-kernel-packages: _pkgbootstrap .PHONY
|
||||
create-kernel-packages: .PHONY
|
||||
_default_flavor= -default
|
||||
.if exists(${KSTAGEDIR}/kernel.meta)
|
||||
.for flavor in "" -debug
|
||||
create-kernel-packages: create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}
|
||||
create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap .PHONY
|
||||
@cd ${KSTAGEDIR}/${DISTDIR} ; \
|
||||
awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
|
||||
-v kernel=yes -v _kernconf=${INSTALLKERNEL} \
|
||||
@ -1599,6 +1641,8 @@ create-kernel-packages: _pkgbootstrap .PHONY
|
||||
.for _kernel in ${BUILDKERNELS:[2..-1]}
|
||||
.if exists(${KSTAGEDIR}/kernel.${_kernel}.meta)
|
||||
.for flavor in "" -debug
|
||||
create-kernel-packages: create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}
|
||||
create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap .PHONY
|
||||
@cd ${KSTAGEDIR}/kernel.${_kernel} ; \
|
||||
awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
|
||||
-v kernel=yes -v _kernconf=${_kernel} \
|
||||
|
@ -111,6 +111,7 @@ LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \
|
||||
LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${LIBCOMPAT_OBJTREE} \
|
||||
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
||||
PATH=${TMPPATH} \
|
||||
SYSROOT=${LIBCOMPATTMP} \
|
||||
LIBDIR=/usr/lib${libcompat} \
|
||||
SHLIBDIR=/usr/lib${libcompat} \
|
||||
DTRACE="${LIB$COMPATDTRACE:U${DTRACE}}"
|
||||
|
48
UPDATING
48
UPDATING
@ -56,6 +56,46 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
|
||||
Please see the 20141231 entry below for information about prerequisites
|
||||
and upgrading, if you are not already using clang 3.5.0 or higher.
|
||||
|
||||
20170625:
|
||||
The FreeBSD/powerpc platform now uses a 64-bit type for time_t. This is
|
||||
a very major ABI incompatible change, so users of FreeBSD/powerpc must
|
||||
be careful when performing source upgrades. It is best to run
|
||||
'make installworld' from an alternate root system, either a live
|
||||
CD/memory stick, or a temporary root partition. Additionally, all ports
|
||||
must be recompiled. powerpc64 is largely unaffected, except in the case
|
||||
of 32-bit compatibility. All 32-bit binaries will be affected.
|
||||
|
||||
20170623:
|
||||
Forward compatibility for the "ino64" project have been committed. This
|
||||
will allow most new binaries to run on older kernels in a limited
|
||||
fashion. This prevents many of the common foot-shooting actions in the
|
||||
upgrade as well as the limited ability to roll back the kernel across
|
||||
the ino64 upgrade. Complicated use cases may not work properly, though
|
||||
enough simpler ones work to allow recovery in most situations.
|
||||
|
||||
20170620:
|
||||
Switch back to the BSDL dtc (Device Tree Compiler). Set WITH_GPL_DTC
|
||||
if you require the GPL compiler.
|
||||
|
||||
20170618:
|
||||
The internal ABI used for communication between the NFS kernel modules
|
||||
was changed by r320085, so __FreeBSD_version was bumped to
|
||||
ensure all the NFS related modules are updated together.
|
||||
|
||||
20170617:
|
||||
The ABI of struct event was changed by extending the data
|
||||
member to 64bit and adding ext fields. For upgrade, same
|
||||
precautions as for the entry 20170523 "ino64" must be
|
||||
followed.
|
||||
|
||||
20170531:
|
||||
The GNU roff toolchain has been removed from base. To render manpages
|
||||
which are not supported by mandoc(1), man(1) can fallback on GNU roff
|
||||
from ports (and recommends to install it).
|
||||
To render roff(7) documents, consider using GNU roff from ports or the
|
||||
heirloom doctools roff toolchain from ports via pkg install groff or
|
||||
via pkg install heirloom-doctools.
|
||||
|
||||
20170524:
|
||||
The ath(4) and ath_hal(4) modules now build piecemeal to allow for
|
||||
smaller runtime footprint builds. This is useful for embedded systems
|
||||
@ -81,14 +121,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
|
||||
|
||||
For further comments/feedback, poke adrian@ .
|
||||
|
||||
20170531:
|
||||
The GNU roff toolchain has been removed from base. To render manpages
|
||||
which are not supported by mandoc(1), man(1) can fallback on GNU roff
|
||||
from ports (and recommends to install it).
|
||||
To render roff(7) documents, consider using GNU roff from ports or the
|
||||
heirloom doctools roff toolchain from ports via pkg install groff or
|
||||
via pkg install heirloom-doctools.
|
||||
|
||||
20170523:
|
||||
The "ino64" 64-bit inode project has been committed, which extends
|
||||
a number of types to 64 bits. Upgrading in place requires care and
|
||||
|
@ -27,23 +27,27 @@
|
||||
#
|
||||
|
||||
atf_test_case n_output
|
||||
n_output_head() {
|
||||
n_output_head()
|
||||
{
|
||||
atf_set "descr" "Verify that echo(1) does not print the trailing " \
|
||||
"newline character with option '-n'"
|
||||
}
|
||||
|
||||
n_output_body() {
|
||||
n_output_body()
|
||||
{
|
||||
atf_check -s ignore -o inline:"Hello world" \
|
||||
/bin/echo -n "Hello world"
|
||||
}
|
||||
|
||||
atf_test_case append_c_output
|
||||
append_c_output_head() {
|
||||
append_c_output_head()
|
||||
{
|
||||
atf_set "descr" "Verify that echo(1) does not print the trailing newline " \
|
||||
"character when '\c' is appended to the end of the string"
|
||||
}
|
||||
|
||||
append_c_output_body() {
|
||||
append_c_output_body()
|
||||
{
|
||||
atf_check -s ignore -o inline:"Hello world" \
|
||||
/bin/echo "Hello world\c"
|
||||
}
|
||||
|
@ -245,11 +245,11 @@ linkit(const char *source, const char *target, int isdir)
|
||||
|
||||
/*
|
||||
* If the target is a directory (and not a symlink if hflag),
|
||||
* append the source's name.
|
||||
* append the source's name, unless Fflag is set.
|
||||
*/
|
||||
if (isdir ||
|
||||
if (!Fflag && (isdir ||
|
||||
(lstat(target, &sb) == 0 && S_ISDIR(sb.st_mode)) ||
|
||||
(!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode))) {
|
||||
(!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode)))) {
|
||||
if (strlcpy(bbuf, source, sizeof(bbuf)) >= sizeof(bbuf) ||
|
||||
(p = basename(bbuf)) == NULL ||
|
||||
snprintf(path, sizeof(path), "%s/%s", target, p) >=
|
||||
|
@ -160,10 +160,10 @@ sF_flag_head()
|
||||
|
||||
sF_flag_body()
|
||||
{
|
||||
atf_expect_fail "B isn't being unlinked (bug 219943)"
|
||||
atf_check mkdir A B
|
||||
atf_check ln -sF A B
|
||||
atf_check -o inline:'Symbolic Link\n' stat -f %SHT B
|
||||
atf_check -o inline:'A\n' readlink B
|
||||
}
|
||||
|
||||
atf_test_case sf_flag
|
||||
|
11
bin/sh/cd.c
11
bin/sh/cd.c
@ -164,8 +164,17 @@ docd(char *dest, int print, int phys)
|
||||
if ((phys || (rc = cdlogical(dest)) < 0) && (rc = cdphysical(dest)) < 0)
|
||||
return (-1);
|
||||
|
||||
if (print && iflag && curdir)
|
||||
if (print && iflag && curdir) {
|
||||
out1fmt("%s\n", curdir);
|
||||
/*
|
||||
* Ignore write errors to preserve the invariant that the
|
||||
* current directory is changed iff the exit status is 0
|
||||
* (or 1 if -e was given and the full pathname could not be
|
||||
* determined).
|
||||
*/
|
||||
flushout(out1);
|
||||
outclearerror(out1);
|
||||
}
|
||||
|
||||
return (rc);
|
||||
}
|
||||
|
@ -2018,6 +2018,11 @@ to return exit status 1 if the full pathname of the new directory
|
||||
cannot be determined reliably or at all.
|
||||
Normally this is not considered an error,
|
||||
although a warning is printed.
|
||||
.Pp
|
||||
If changing the directory fails, the exit status is greater than 1.
|
||||
If the directory is changed, the exit status is 0, or also 1 if
|
||||
.Fl e
|
||||
was given.
|
||||
.It Ic chdir
|
||||
A synonym for the
|
||||
.Ic cd
|
||||
|
@ -51,6 +51,7 @@ ${PACKAGE}FILES+= cd6.0
|
||||
${PACKAGE}FILES+= cd7.0
|
||||
${PACKAGE}FILES+= cd8.0
|
||||
${PACKAGE}FILES+= cd9.0 cd9.0.stdout
|
||||
${PACKAGE}FILES+= cd10.0
|
||||
${PACKAGE}FILES+= command1.0
|
||||
${PACKAGE}FILES+= command2.0
|
||||
${PACKAGE}FILES+= command3.0
|
||||
|
6
bin/sh/tests/builtins/cd10.0
Normal file
6
bin/sh/tests/builtins/cd10.0
Normal file
@ -0,0 +1,6 @@
|
||||
# $FreeBSD$
|
||||
|
||||
# Precondition
|
||||
(cd /bin) || exit
|
||||
# Verify write error is ignored.
|
||||
$SH +m -ic 'CDPATH=/:; cd bin 1</dev/null'
|
@ -59,6 +59,7 @@
|
||||
#include <sys/arc.h>
|
||||
#include <sys/ddt.h>
|
||||
#include <sys/zfeature.h>
|
||||
#include <sys/abd.h>
|
||||
#include <zfs_comutil.h>
|
||||
#undef verify
|
||||
#include <libzfs.h>
|
||||
@ -2410,7 +2411,7 @@ zdb_blkptr_done(zio_t *zio)
|
||||
zdb_cb_t *zcb = zio->io_private;
|
||||
zbookmark_phys_t *zb = &zio->io_bookmark;
|
||||
|
||||
zio_data_buf_free(zio->io_data, zio->io_size);
|
||||
abd_free(zio->io_abd);
|
||||
|
||||
mutex_enter(&spa->spa_scrub_lock);
|
||||
spa->spa_scrub_inflight--;
|
||||
@ -2477,7 +2478,7 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
||||
if (!BP_IS_EMBEDDED(bp) &&
|
||||
(dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata))) {
|
||||
size_t size = BP_GET_PSIZE(bp);
|
||||
void *data = zio_data_buf_alloc(size);
|
||||
abd_t *abd = abd_alloc(size, B_FALSE);
|
||||
int flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB | ZIO_FLAG_RAW;
|
||||
|
||||
/* If it's an intent log block, failure is expected. */
|
||||
@ -2490,7 +2491,7 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
||||
spa->spa_scrub_inflight++;
|
||||
mutex_exit(&spa->spa_scrub_lock);
|
||||
|
||||
zio_nowait(zio_read(NULL, spa, bp, data, size,
|
||||
zio_nowait(zio_read(NULL, spa, bp, abd, size,
|
||||
zdb_blkptr_done, zcb, ZIO_PRIORITY_ASYNC_READ, flags, zb));
|
||||
}
|
||||
|
||||
@ -3270,6 +3271,13 @@ zdb_vdev_lookup(vdev_t *vdev, char *path)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
random_get_pseudo_bytes_cb(void *buf, size_t len, void *unused)
|
||||
{
|
||||
return (random_get_pseudo_bytes(buf, len));
|
||||
}
|
||||
|
||||
/*
|
||||
* Read a block from a pool and print it out. The syntax of the
|
||||
* block descriptor is:
|
||||
@ -3301,7 +3309,8 @@ zdb_read_block(char *thing, spa_t *spa)
|
||||
uint64_t offset = 0, size = 0, psize = 0, lsize = 0, blkptr_offset = 0;
|
||||
zio_t *zio;
|
||||
vdev_t *vd;
|
||||
void *pbuf, *lbuf, *buf;
|
||||
abd_t *pabd;
|
||||
void *lbuf, *buf;
|
||||
char *s, *p, *dup, *vdev, *flagstr;
|
||||
int i, error;
|
||||
|
||||
@ -3373,7 +3382,7 @@ zdb_read_block(char *thing, spa_t *spa)
|
||||
psize = size;
|
||||
lsize = size;
|
||||
|
||||
pbuf = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
|
||||
pabd = abd_alloc_linear(SPA_MAXBLOCKSIZE, B_FALSE);
|
||||
lbuf = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
|
||||
|
||||
BP_ZERO(bp);
|
||||
@ -3401,15 +3410,15 @@ zdb_read_block(char *thing, spa_t *spa)
|
||||
/*
|
||||
* Treat this as a normal block read.
|
||||
*/
|
||||
zio_nowait(zio_read(zio, spa, bp, pbuf, psize, NULL, NULL,
|
||||
zio_nowait(zio_read(zio, spa, bp, pabd, psize, NULL, NULL,
|
||||
ZIO_PRIORITY_SYNC_READ,
|
||||
ZIO_FLAG_CANFAIL | ZIO_FLAG_RAW, NULL));
|
||||
} else {
|
||||
/*
|
||||
* Treat this as a vdev child I/O.
|
||||
*/
|
||||
zio_nowait(zio_vdev_child_io(zio, bp, vd, offset, pbuf, psize,
|
||||
ZIO_TYPE_READ, ZIO_PRIORITY_SYNC_READ,
|
||||
zio_nowait(zio_vdev_child_io(zio, bp, vd, offset, pabd,
|
||||
psize, ZIO_TYPE_READ, ZIO_PRIORITY_SYNC_READ,
|
||||
ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE |
|
||||
ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY |
|
||||
ZIO_FLAG_CANFAIL | ZIO_FLAG_RAW, NULL, NULL));
|
||||
@ -3432,21 +3441,21 @@ zdb_read_block(char *thing, spa_t *spa)
|
||||
void *pbuf2 = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
|
||||
void *lbuf2 = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
|
||||
|
||||
bcopy(pbuf, pbuf2, psize);
|
||||
abd_copy_to_buf(pbuf2, pabd, psize);
|
||||
|
||||
VERIFY(random_get_pseudo_bytes((uint8_t *)pbuf + psize,
|
||||
SPA_MAXBLOCKSIZE - psize) == 0);
|
||||
VERIFY0(abd_iterate_func(pabd, psize, SPA_MAXBLOCKSIZE - psize,
|
||||
random_get_pseudo_bytes_cb, NULL));
|
||||
|
||||
VERIFY(random_get_pseudo_bytes((uint8_t *)pbuf2 + psize,
|
||||
SPA_MAXBLOCKSIZE - psize) == 0);
|
||||
VERIFY0(random_get_pseudo_bytes((uint8_t *)pbuf2 + psize,
|
||||
SPA_MAXBLOCKSIZE - psize));
|
||||
|
||||
for (lsize = SPA_MAXBLOCKSIZE; lsize > psize;
|
||||
lsize -= SPA_MINBLOCKSIZE) {
|
||||
for (c = 0; c < ZIO_COMPRESS_FUNCTIONS; c++) {
|
||||
if (zio_decompress_data(c, pbuf, lbuf,
|
||||
psize, lsize) == 0 &&
|
||||
zio_decompress_data(c, pbuf2, lbuf2,
|
||||
psize, lsize) == 0 &&
|
||||
if (zio_decompress_data(c, pabd,
|
||||
lbuf, psize, lsize) == 0 &&
|
||||
zio_decompress_data_buf(c, pbuf2,
|
||||
lbuf2, psize, lsize) == 0 &&
|
||||
bcmp(lbuf, lbuf2, lsize) == 0)
|
||||
break;
|
||||
}
|
||||
@ -3465,7 +3474,7 @@ zdb_read_block(char *thing, spa_t *spa)
|
||||
buf = lbuf;
|
||||
size = lsize;
|
||||
} else {
|
||||
buf = pbuf;
|
||||
buf = abd_to_buf(pabd);
|
||||
size = psize;
|
||||
}
|
||||
|
||||
@ -3483,7 +3492,7 @@ zdb_read_block(char *thing, spa_t *spa)
|
||||
zdb_dump_block(thing, buf, size, flags);
|
||||
|
||||
out:
|
||||
umem_free(pbuf, SPA_MAXBLOCKSIZE);
|
||||
abd_free(pabd);
|
||||
umem_free(lbuf, SPA_MAXBLOCKSIZE);
|
||||
free(dup);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013, 2014 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2013, 2016 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -41,6 +41,7 @@
|
||||
#include <sys/resource.h>
|
||||
#include <sys/zil.h>
|
||||
#include <sys/zil_impl.h>
|
||||
#include <sys/abd.h>
|
||||
|
||||
extern uint8_t dump_opt[256];
|
||||
|
||||
@ -116,14 +117,28 @@ zil_prt_rec_rename(zilog_t *zilog, int txtype, lr_rename_t *lr)
|
||||
(void) printf("%ssrc %s tgt %s\n", prefix, snm, tnm);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
zil_prt_rec_write_cb(void *data, size_t len, void *unused)
|
||||
{
|
||||
char *cdata = data;
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (isprint(*cdata))
|
||||
(void) printf("%c ", *cdata);
|
||||
else
|
||||
(void) printf("%2X", *cdata);
|
||||
cdata++;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
zil_prt_rec_write(zilog_t *zilog, int txtype, lr_write_t *lr)
|
||||
{
|
||||
char *data, *dlimit;
|
||||
abd_t *data;
|
||||
blkptr_t *bp = &lr->lr_blkptr;
|
||||
zbookmark_phys_t zb;
|
||||
char buf[SPA_MAXBLOCKSIZE];
|
||||
int verbose = MAX(dump_opt['d'], dump_opt['i']);
|
||||
int error;
|
||||
|
||||
@ -144,7 +159,6 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, lr_write_t *lr)
|
||||
if (BP_IS_HOLE(bp)) {
|
||||
(void) printf("\t\t\tLSIZE 0x%llx\n",
|
||||
(u_longlong_t)BP_GET_LSIZE(bp));
|
||||
bzero(buf, sizeof (buf));
|
||||
(void) printf("%s<hole>\n", prefix);
|
||||
return;
|
||||
}
|
||||
@ -157,28 +171,26 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, lr_write_t *lr)
|
||||
lr->lr_foid, ZB_ZIL_LEVEL,
|
||||
lr->lr_offset / BP_GET_LSIZE(bp));
|
||||
|
||||
data = abd_alloc(BP_GET_LSIZE(bp), B_FALSE);
|
||||
error = zio_wait(zio_read(NULL, zilog->zl_spa,
|
||||
bp, buf, BP_GET_LSIZE(bp), NULL, NULL,
|
||||
bp, data, BP_GET_LSIZE(bp), NULL, NULL,
|
||||
ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL, &zb));
|
||||
if (error)
|
||||
return;
|
||||
data = buf;
|
||||
goto out;
|
||||
} else {
|
||||
data = (char *)(lr + 1);
|
||||
/* data is stored after the end of the lr_write record */
|
||||
data = abd_alloc(lr->lr_length, B_FALSE);
|
||||
abd_copy_from_buf(data, lr + 1, lr->lr_length);
|
||||
}
|
||||
|
||||
dlimit = data + MIN(lr->lr_length,
|
||||
(verbose < 6 ? 20 : SPA_MAXBLOCKSIZE));
|
||||
|
||||
(void) printf("%s", prefix);
|
||||
while (data < dlimit) {
|
||||
if (isprint(*data))
|
||||
(void) printf("%c ", *data);
|
||||
else
|
||||
(void) printf("%2X", *data);
|
||||
data++;
|
||||
}
|
||||
(void) abd_iterate_func(data,
|
||||
0, MIN(lr->lr_length, (verbose < 6 ? 20 : SPA_MAXBLOCKSIZE)),
|
||||
zil_prt_rec_write_cb, NULL);
|
||||
(void) printf("\n");
|
||||
|
||||
out:
|
||||
abd_free(data);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
|
@ -112,6 +112,7 @@
|
||||
#include <sys/refcount.h>
|
||||
#include <sys/zfeature.h>
|
||||
#include <sys/dsl_userhold.h>
|
||||
#include <sys/abd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdio_ext.h>
|
||||
#include <stdlib.h>
|
||||
@ -190,6 +191,7 @@ extern uint64_t metaslab_df_alloc_threshold;
|
||||
extern uint64_t zfs_deadman_synctime_ms;
|
||||
extern int metaslab_preload_limit;
|
||||
extern boolean_t zfs_compressed_arc_enabled;
|
||||
extern boolean_t zfs_abd_scatter_enabled;
|
||||
|
||||
static ztest_shared_opts_t *ztest_shared_opts;
|
||||
static ztest_shared_opts_t ztest_opts;
|
||||
@ -5042,7 +5044,7 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
|
||||
enum zio_checksum checksum = spa_dedup_checksum(spa);
|
||||
dmu_buf_t *db;
|
||||
dmu_tx_t *tx;
|
||||
void *buf;
|
||||
abd_t *abd;
|
||||
blkptr_t blk;
|
||||
int copies = 2 * ZIO_DEDUPDITTO_MIN;
|
||||
|
||||
@ -5122,14 +5124,14 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
|
||||
* Damage the block. Dedup-ditto will save us when we read it later.
|
||||
*/
|
||||
psize = BP_GET_PSIZE(&blk);
|
||||
buf = zio_buf_alloc(psize);
|
||||
ztest_pattern_set(buf, psize, ~pattern);
|
||||
abd = abd_alloc_linear(psize, B_TRUE);
|
||||
ztest_pattern_set(abd_to_buf(abd), psize, ~pattern);
|
||||
|
||||
(void) zio_wait(zio_rewrite(NULL, spa, 0, &blk,
|
||||
buf, psize, NULL, NULL, ZIO_PRIORITY_SYNC_WRITE,
|
||||
abd, psize, NULL, NULL, ZIO_PRIORITY_SYNC_WRITE,
|
||||
ZIO_FLAG_CANFAIL | ZIO_FLAG_INDUCE_DAMAGE, NULL));
|
||||
|
||||
zio_buf_free(buf, psize);
|
||||
abd_free(abd);
|
||||
|
||||
(void) rw_unlock(&ztest_name_lock);
|
||||
}
|
||||
@ -5413,6 +5415,12 @@ ztest_resume_thread(void *arg)
|
||||
*/
|
||||
if (ztest_random(10) == 0)
|
||||
zfs_compressed_arc_enabled = ztest_random(2);
|
||||
|
||||
/*
|
||||
* Periodically change the zfs_abd_scatter_enabled setting.
|
||||
*/
|
||||
if (ztest_random(10) == 0)
|
||||
zfs_abd_scatter_enabled = ztest_random(2);
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
@ -199,19 +199,19 @@ dump_record(dmu_replay_record_t *drr, void *payload, int payload_len,
|
||||
{
|
||||
ASSERT3U(offsetof(dmu_replay_record_t, drr_u.drr_checksum.drr_checksum),
|
||||
==, sizeof (dmu_replay_record_t) - sizeof (zio_cksum_t));
|
||||
fletcher_4_incremental_native(drr,
|
||||
(void) fletcher_4_incremental_native(drr,
|
||||
offsetof(dmu_replay_record_t, drr_u.drr_checksum.drr_checksum), zc);
|
||||
if (drr->drr_type != DRR_BEGIN) {
|
||||
ASSERT(ZIO_CHECKSUM_IS_ZERO(&drr->drr_u.
|
||||
drr_checksum.drr_checksum));
|
||||
drr->drr_u.drr_checksum.drr_checksum = *zc;
|
||||
}
|
||||
fletcher_4_incremental_native(&drr->drr_u.drr_checksum.drr_checksum,
|
||||
sizeof (zio_cksum_t), zc);
|
||||
(void) fletcher_4_incremental_native(
|
||||
&drr->drr_u.drr_checksum.drr_checksum, sizeof (zio_cksum_t), zc);
|
||||
if (write(outfd, drr, sizeof (*drr)) == -1)
|
||||
return (errno);
|
||||
if (payload_len != 0) {
|
||||
fletcher_4_incremental_native(payload, payload_len, zc);
|
||||
(void) fletcher_4_incremental_native(payload, payload_len, zc);
|
||||
if (write(outfd, payload, payload_len) == -1)
|
||||
return (errno);
|
||||
}
|
||||
@ -2096,9 +2096,9 @@ recv_read(libzfs_handle_t *hdl, int fd, void *buf, int ilen,
|
||||
|
||||
if (zc) {
|
||||
if (byteswap)
|
||||
fletcher_4_incremental_byteswap(buf, ilen, zc);
|
||||
(void) fletcher_4_incremental_byteswap(buf, ilen, zc);
|
||||
else
|
||||
fletcher_4_incremental_native(buf, ilen, zc);
|
||||
(void) fletcher_4_incremental_native(buf, ilen, zc);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
@ -3688,7 +3688,8 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap,
|
||||
* recv_read() above; do it again correctly.
|
||||
*/
|
||||
bzero(&zcksum, sizeof (zio_cksum_t));
|
||||
fletcher_4_incremental_byteswap(&drr, sizeof (drr), &zcksum);
|
||||
(void) fletcher_4_incremental_byteswap(&drr,
|
||||
sizeof (drr), &zcksum);
|
||||
flags->byteswap = B_TRUE;
|
||||
|
||||
drr.drr_type = BSWAP_32(drr.drr_type);
|
||||
|
@ -11,16 +11,10 @@ SRCS=
|
||||
# Use #include <zfsd/xxx.h> in test programs.
|
||||
INCFLAGS+= -I${.CURDIR:H:H}
|
||||
|
||||
.if defined(DESTDIR)
|
||||
INCFLAGS+= -I${DESTDIR}/usr/include
|
||||
LIBRARY_PATH= ${DESTDIR}/lib:${DESTDIR}/usr/lib
|
||||
LDFLAGS.zfsd_unittest+= -L${DESTDIR}/lib -L${DESTDIR}/usr/lib
|
||||
.elif defined(WORLDTMP)
|
||||
INCFLAGS+= -I${WORLDTMP}/usr/include
|
||||
LIBRARY_PATH= ${WORLDTMP}/lib:${WORLDTMP}/usr/lib
|
||||
LDFLAGS.zfsd_unittest+= -L${WORLDTMP}/lib -L${WORLDTMP}/usr/lib
|
||||
.else
|
||||
LIBRARY_PATH=
|
||||
.if defined(DESTDIR) || defined(SYSROOT)
|
||||
INCFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include
|
||||
LDFLAGS.zfsd_unittest+= -L${SYSROOT:U${DESTDIR}}/lib \
|
||||
-L${SYSROOT:U${DESTDIR}}/usr/lib
|
||||
.endif
|
||||
|
||||
# Googletest options
|
||||
|
@ -437,7 +437,7 @@ void
|
||||
ZfsDaemon::ClosePIDFile()
|
||||
{
|
||||
if (s_pidFH != NULL)
|
||||
pidfile_close(s_pidFH);
|
||||
pidfile_remove(s_pidFH);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -50,7 +50,7 @@
|
||||
|
||||
#include "_elftc.h"
|
||||
|
||||
ELFTC_VCSID("$Id: elfdump.c 3497 2016-10-17 20:57:22Z emaste $");
|
||||
ELFTC_VCSID("$Id: elfdump.c 3521 2017-06-04 20:07:09Z jkoshy $");
|
||||
|
||||
#if defined(ELFTC_NEED_ELF_NOTE_DEFINITION)
|
||||
#include "native-elf-format.h"
|
||||
@ -2226,8 +2226,8 @@ elf_print_svr4_hash64(struct elfdump *ed, struct section *s)
|
||||
uint64_t *buf;
|
||||
uint64_t *bucket, *chain;
|
||||
uint64_t nbucket, nchain;
|
||||
uint64_t *bl, *c, maxl, total;
|
||||
uint64_t i, j;
|
||||
uint64_t *bl, *c, j, maxl, total;
|
||||
size_t i;
|
||||
int elferr, first;
|
||||
char idx[10];
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: _libelftc.h 3174 2015-03-27 17:13:41Z emaste $
|
||||
* $Id: _libelftc.h 3531 2017-06-05 05:08:43Z kaiwang27 $
|
||||
*/
|
||||
|
||||
#ifndef __LIBELFTC_H_
|
||||
@ -82,6 +82,8 @@ bool vector_str_init(struct vector_str *_vs);
|
||||
bool vector_str_pop(struct vector_str *_vs);
|
||||
bool vector_str_push(struct vector_str *_vs, const char *_str,
|
||||
size_t _len);
|
||||
bool vector_str_push_vector(struct vector_str *_dst,
|
||||
struct vector_str *_org);
|
||||
bool vector_str_push_vector_head(struct vector_str *_dst,
|
||||
struct vector_str *_org);
|
||||
char *vector_str_substr(const struct vector_str *_vs, size_t _begin,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -33,7 +33,7 @@
|
||||
|
||||
#include "_libelftc.h"
|
||||
|
||||
ELFTC_VCSID("$Id: libelftc_vstr.c 2065 2011-10-26 15:24:47Z jkoshy $");
|
||||
ELFTC_VCSID("$Id: libelftc_vstr.c 3531 2017-06-05 05:08:43Z kaiwang27 $");
|
||||
|
||||
/**
|
||||
* @file vector_str.c
|
||||
@ -280,6 +280,47 @@ vector_str_push_vector_head(struct vector_str *dst, struct vector_str *org)
|
||||
return (true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Push org vector to the tail of det vector.
|
||||
* @return false at failed, true at success.
|
||||
*/
|
||||
bool
|
||||
vector_str_push_vector(struct vector_str *dst, struct vector_str *org)
|
||||
{
|
||||
size_t i, j, tmp_cap;
|
||||
char **tmp_ctn;
|
||||
|
||||
if (dst == NULL || org == NULL)
|
||||
return (false);
|
||||
|
||||
tmp_cap = (dst->size + org->size) * BUFFER_GROWFACTOR;
|
||||
|
||||
if ((tmp_ctn = malloc(sizeof(char *) * tmp_cap)) == NULL)
|
||||
return (false);
|
||||
|
||||
for (i = 0; i < dst->size; ++i)
|
||||
tmp_ctn[i] = dst->container[i];
|
||||
|
||||
for (i = 0; i < org->size; ++i)
|
||||
if ((tmp_ctn[i + dst->size] = strdup(org->container[i])) ==
|
||||
NULL) {
|
||||
for (j = 0; j < i + dst->size; ++j)
|
||||
free(tmp_ctn[j]);
|
||||
|
||||
free(tmp_ctn);
|
||||
|
||||
return (false);
|
||||
}
|
||||
|
||||
free(dst->container);
|
||||
|
||||
dst->container = tmp_ctn;
|
||||
dst->capacity = tmp_cap;
|
||||
dst->size += org->size;
|
||||
|
||||
return (true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get new allocated flat string from vector between begin and end.
|
||||
*
|
||||
|
@ -4,7 +4,7 @@ const char *familyname(int family)
|
||||
{
|
||||
if (family == AF_INET)
|
||||
return "inet";
|
||||
#ifdef AF_INET6
|
||||
#ifdef USE_INET6
|
||||
if (family == AF_INET6)
|
||||
return "inet6";
|
||||
#endif
|
||||
|
@ -35,7 +35,7 @@ printhashnode(iph, ipep, copyfunc, opts, fields)
|
||||
}
|
||||
printf("\n");
|
||||
} else if ((opts & OPT_DEBUG) != 0) {
|
||||
#ifdef AF_INET6
|
||||
#ifdef USE_INET6
|
||||
if (ipe.ipe_family == AF_INET6) {
|
||||
char buf[INET6_ADDRSTRLEN + 1];
|
||||
const char *str;
|
||||
@ -59,7 +59,7 @@ printhashnode(iph, ipep, copyfunc, opts, fields)
|
||||
} else if (ipe.ipe_family == AF_INET) {
|
||||
#else
|
||||
if (ipe.ipe_family == AF_INET) {
|
||||
#endif /* AF_INET6 */
|
||||
#endif /* USE_INET6 */
|
||||
PRINTF("\t%d\tAddress: %s", hv,
|
||||
inet_ntoa(ipe.ipe_addr.in4));
|
||||
printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr);
|
||||
|
@ -25,7 +25,7 @@ printip(family, addr)
|
||||
else
|
||||
PRINTF("%s", inet_ntoa(ipa));
|
||||
}
|
||||
#ifdef AF_INET6
|
||||
#ifdef USE_INET6
|
||||
else if (family == AF_INET6) {
|
||||
char buf[INET6_ADDRSTRLEN + 1];
|
||||
const char *str;
|
||||
|
@ -33,7 +33,7 @@ printpoolnode(np, opts, fields)
|
||||
printmask(np->ipn_addr.adf_family,
|
||||
(u_32_t *)&np->ipn_mask.adf_addr);
|
||||
} else {
|
||||
#ifdef AF_INET6
|
||||
#ifdef USE_INET6
|
||||
if (np->ipn_addr.adf_family == AF_INET6) {
|
||||
char buf[INET6_ADDRSTRLEN + 1];
|
||||
const char *str;
|
||||
@ -54,9 +54,7 @@ printpoolnode(np, opts, fields)
|
||||
} else {
|
||||
PRINTF("\tAddress: family: %d\n",
|
||||
np->ipn_addr.adf_family);
|
||||
#ifdef AF_INET6
|
||||
}
|
||||
#endif
|
||||
printmask(np->ipn_addr.adf_family,
|
||||
(u_32_t *)&np->ipn_mask.adf_addr);
|
||||
#ifdef USE_QUAD_T
|
||||
|
@ -2303,7 +2303,7 @@ makepool(list)
|
||||
|
||||
for (n = top, a = list; (n != NULL) && (a != NULL); a = a->al_next) {
|
||||
if (use_inet6 == 1) {
|
||||
#ifdef AF_INET6
|
||||
#ifdef USE_INET6
|
||||
n->ipn_addr.adf_family = AF_INET6;
|
||||
n->ipn_addr.adf_addr = a->al_i6addr;
|
||||
n->ipn_addr.adf_len = offsetof(addrfamily_t,
|
||||
|
@ -201,17 +201,27 @@ poolnodecommand(remove, argc, argv)
|
||||
}
|
||||
break;
|
||||
case 'T' :
|
||||
if (remove == 0) {
|
||||
ttl = atoi(optarg);
|
||||
if (ttl < 0) {
|
||||
fprintf(stderr, "cannot set negative ttl\n");
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
usage(argv[0]);
|
||||
}
|
||||
break;
|
||||
case 'v' :
|
||||
opts |= OPT_VERBOSE;
|
||||
break;
|
||||
default :
|
||||
usage(argv[0]);
|
||||
break; /* keep compiler happy */
|
||||
}
|
||||
|
||||
if (argc - 1 - optind > 0)
|
||||
usage(argv[0]);
|
||||
|
||||
if (argv[optind] != NULL && ipset == 0) {
|
||||
if (setnodeaddr(type, role, ptr, argv[optind]) == 0)
|
||||
ipset = 1;
|
||||
@ -268,7 +278,7 @@ poolcommand(remove, argc, argv)
|
||||
bzero((char *)&iph, sizeof(iph));
|
||||
bzero((char *)&pool, sizeof(pool));
|
||||
|
||||
while ((c = getopt(argc, argv, "dm:no:RSv")) != -1)
|
||||
while ((c = getopt(argc, argv, "dm:no:RS:v")) != -1)
|
||||
switch (c)
|
||||
{
|
||||
case 'd' :
|
||||
@ -292,13 +302,22 @@ poolcommand(remove, argc, argv)
|
||||
opts |= OPT_NORESOLVE;
|
||||
break;
|
||||
case 'S' :
|
||||
if (remove == 0)
|
||||
iph.iph_seed = atoi(optarg);
|
||||
else
|
||||
usage(argv[0]);
|
||||
break;
|
||||
case 'v' :
|
||||
opts |= OPT_VERBOSE;
|
||||
break;
|
||||
default :
|
||||
usage(argv[0]);
|
||||
break; /* keep compiler happy */
|
||||
}
|
||||
|
||||
if (argc - 1 - optind > 0)
|
||||
usage(argv[0]);
|
||||
|
||||
if (opts & OPT_DEBUG)
|
||||
fprintf(stderr, "poolcommand: opts = %#x\n", opts);
|
||||
|
||||
@ -568,7 +587,7 @@ poolflush(argc, argv)
|
||||
break; /* keep compiler happy */
|
||||
}
|
||||
|
||||
if (argc - 1 - optind > 0)
|
||||
if (argc - optind > 0)
|
||||
usage(argv[0]);
|
||||
|
||||
if (opts & OPT_DEBUG)
|
||||
|
@ -273,7 +273,7 @@ grouplist:
|
||||
| addrmask next { $$ = calloc(1, sizeof(iphtent_t));
|
||||
$$->ipe_addr = $1[0].adf_addr;
|
||||
$$->ipe_mask = $1[1].adf_addr;
|
||||
#ifdef AF_INET6
|
||||
#ifdef USE_INET6
|
||||
if (use_inet6)
|
||||
$$->ipe_family = AF_INET6;
|
||||
else
|
||||
@ -297,7 +297,7 @@ groupentry:
|
||||
$$->ipe_mask = $1[1].adf_addr;
|
||||
strncpy($$->ipe_group, $3,
|
||||
FR_GROUPLEN);
|
||||
#ifdef AF_INET6
|
||||
#ifdef USE_INET6
|
||||
if (use_inet6)
|
||||
$$->ipe_family = AF_INET6;
|
||||
else
|
||||
|
@ -139,11 +139,7 @@ ATF_TC_BODY(proc1, tc)
|
||||
printf(" NOTE_FORK");
|
||||
}
|
||||
if (event[0].fflags & NOTE_CHILD)
|
||||
#ifdef __FreeBSD__
|
||||
printf(" NOTE_CHILD, parent = %" PRIdPTR, event[0].data);
|
||||
#else
|
||||
printf(" NOTE_CHILD, parent = %" PRId64, event[0].data);
|
||||
#endif
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
@ -127,11 +127,7 @@ ATF_TC_BODY(sig, tc)
|
||||
if (n == 0)
|
||||
continue;
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
(void)printf("sig: kevent flags: 0x%x, data: %" PRIdPTR " (# "
|
||||
#else
|
||||
(void)printf("sig: kevent flags: 0x%x, data: %" PRId64 " (# "
|
||||
#endif
|
||||
"times signal posted)\n", event[0].flags, event[0].data);
|
||||
}
|
||||
|
||||
|
@ -28,10 +28,6 @@ static char sccs_id[] = "@(#) scaffold.c 1.6 97/03/21 19:27:24";
|
||||
#define INADDR_NONE (-1) /* XXX should be 0xffffffff */
|
||||
#endif
|
||||
|
||||
#ifndef INET6
|
||||
extern char *malloc();
|
||||
#endif
|
||||
|
||||
/* Application-specific. */
|
||||
|
||||
#include "tcpd.h"
|
||||
|
@ -15,12 +15,17 @@
|
||||
# are transmitted by almost all time services.
|
||||
#
|
||||
# The first column shows an epoch as a number of seconds
|
||||
# since 1900.0 and the second column shows the number of
|
||||
# seconds that must be added to UTC to compute TAI for
|
||||
# any timestamp at or after that epoch. The value on
|
||||
# each line is valid from the indicated initial instant
|
||||
# until the epoch given on the next one or indefinitely
|
||||
# into the future if there is no next line.
|
||||
# since 1 January 1900, 00:00:00 (1900.0 is also used to
|
||||
# indicate the same epoch.) Both of these time stamp formats
|
||||
# ignore the complexities of the time scales that were
|
||||
# used before the current definition of UTC at the start
|
||||
# of 1972. (See note 3 below.)
|
||||
# The second column shows the number of seconds that
|
||||
# must be added to UTC to compute TAI for any timestamp
|
||||
# at or after that epoch. The value on each line is
|
||||
# valid from the indicated initial instant until the
|
||||
# epoch given on the next one or indefinitely into the
|
||||
# future if there is no next line.
|
||||
# (The comment on each line shows the representation of
|
||||
# the corresponding initial epoch in the usual
|
||||
# day-month-year format. The epoch always begins at
|
||||
@ -42,11 +47,11 @@
|
||||
# and can be ignored for many purposes. These differences
|
||||
# are tabulated in Circular T, which is published monthly
|
||||
# by the International Bureau of Weights and Measures
|
||||
# (BIPM). See www.bipm.fr for more information.
|
||||
# (BIPM). See www.bipm.org for more information.
|
||||
#
|
||||
# 3. The current defintion of the relationship between UTC
|
||||
# 3. The current definition of the relationship between UTC
|
||||
# and TAI dates from 1 January 1972. A number of different
|
||||
# time scales were in use before than epoch, and it can be
|
||||
# time scales were in use before that epoch, and it can be
|
||||
# quite difficult to compute precise timestamps and time
|
||||
# intervals in those "prehistoric" days. For more information,
|
||||
# consult:
|
||||
@ -58,21 +63,19 @@
|
||||
# of Time," Proc. of the IEEE, Vol. 79, pp. 894-905,
|
||||
# July, 1991.
|
||||
#
|
||||
# 4. The insertion of leap seconds into UTC is currently the
|
||||
# responsibility of the International Earth Rotation Service,
|
||||
# which is located at the Paris Observatory:
|
||||
# 4. The decision to insert a leap second into UTC is currently
|
||||
# the responsibility of the International Earth Rotation and
|
||||
# Reference Systems Service. (The name was changed from the
|
||||
# International Earth Rotation Service, but the acronym IERS
|
||||
# is still used.)
|
||||
#
|
||||
# Central Bureau of IERS
|
||||
# 61, Avenue de l'Observatoire
|
||||
# 75014 Paris, France.
|
||||
# Leap seconds are announced by the IERS in its Bulletin C.
|
||||
#
|
||||
# Leap seconds are announced by the IERS in its Bulletin C
|
||||
# See www.iers.org for more details.
|
||||
#
|
||||
# See hpiers.obspm.fr or www.iers.org for more details.
|
||||
#
|
||||
# All national laboratories and timing centers use the
|
||||
# data from the BIPM and the IERS to construct their
|
||||
# local realizations of UTC.
|
||||
# Every national laboratory and timing center uses the
|
||||
# data from the BIPM and the IERS to construct UTC(lab),
|
||||
# their local realization of UTC.
|
||||
#
|
||||
# Although the definition also includes the possibility
|
||||
# of dropping seconds ("negative" leap seconds), this has
|
||||
@ -102,7 +105,7 @@
|
||||
#
|
||||
# If your system realizes the leap second by repeating 00:00:00 UTC twice
|
||||
# (this is possible but not usual), then the advance to the next entry
|
||||
# in the table must occur the second time that a time equivlent to
|
||||
# in the table must occur the second time that a time equivalent to
|
||||
# 00:00:00 UTC is used. Thus, using the same example as above:
|
||||
#
|
||||
# ...
|
||||
@ -112,7 +115,10 @@
|
||||
# ...
|
||||
#
|
||||
# in both cases the use of timestamps based on TAI produces a smooth
|
||||
# time scale with no discontinuity in the time interval.
|
||||
# time scale with no discontinuity in the time interval. However,
|
||||
# although the long-term behavior of the time scale is correct in both
|
||||
# methods, the second method is technically not correct because it adds
|
||||
# the extra second to the wrong day.
|
||||
#
|
||||
# This complexity would not be needed for negative leap seconds (if they
|
||||
# are ever used). The UTC time would skip 23:59:59 and advance from
|
||||
@ -121,14 +127,23 @@
|
||||
# with, since the difficulty of unambiguously representing the epoch
|
||||
# during the leap second does not arise.
|
||||
#
|
||||
# Questions or comments to:
|
||||
# Jeff Prillaman
|
||||
# Time Service Department
|
||||
# US Naval Observatory
|
||||
# Washington, DC
|
||||
# jeffrey.prillaman@usno.navy.mil
|
||||
# Some systems implement leap seconds by amortizing the leap second
|
||||
# over the last few minutes of the day. The frequency of the local
|
||||
# clock is decreased (or increased) to realize the positive (or
|
||||
# negative) leap second. This method removes the time step described
|
||||
# above. Although the long-term behavior of the time scale is correct
|
||||
# in this case, this method introduces an error during the adjustment
|
||||
# period both in time and in frequency with respect to the official
|
||||
# definition of UTC.
|
||||
#
|
||||
# Last Update of leap second values: 6 Jul 2016
|
||||
# Questions or comments to:
|
||||
# Judah Levine
|
||||
# Time and Frequency Division
|
||||
# NIST
|
||||
# Boulder, Colorado
|
||||
# Judah.Levine@nist.gov
|
||||
#
|
||||
# Last Update of leap second values: 8 July 2016
|
||||
#
|
||||
# The following line shows this last update date in NTP timestamp
|
||||
# format. This is the date on which the most recent change to
|
||||
@ -136,7 +151,22 @@
|
||||
# be identified by the unique pair of characters in the first two
|
||||
# columns as shown below.
|
||||
#
|
||||
#$ 3676752000
|
||||
#$ 3676924800
|
||||
#
|
||||
# The NTP timestamps are in units of seconds since the NTP epoch,
|
||||
# which is 1 January 1900, 00:00:00. The Modified Julian Day number
|
||||
# corresponding to the NTP time stamp, X, can be computed as
|
||||
#
|
||||
# X/86400 + 15020
|
||||
#
|
||||
# where the first term converts seconds to days and the second
|
||||
# term adds the MJD corresponding to the time origin defined above.
|
||||
# The integer portion of the result is the integer MJD for that
|
||||
# day, and any remainder is the time of day, expressed as the
|
||||
# fraction of the day since 0 hours UTC. The conversion from day
|
||||
# fraction to seconds or to hours, minutes, and seconds may involve
|
||||
# rounding or truncation, depending on the method used in the
|
||||
# computation.
|
||||
#
|
||||
# The data in this file will be updated periodically as new leap
|
||||
# seconds are announced. In addition to being entered on the line
|
||||
@ -149,10 +179,11 @@
|
||||
# is announced.
|
||||
#
|
||||
# The following entry specifies the expiration date of the data
|
||||
# in this file in units of seconds since 1900.0. This expiration date
|
||||
# will be changed at least twice per year whether or not a new leap
|
||||
# second is announced. These semi-annual changes will be made no
|
||||
# later than 1 June and 1 December of each year to indicate what
|
||||
# in this file in units of seconds since the origin at the instant
|
||||
# 1 January 1900, 00:00:00. This expiration date will be changed
|
||||
# at least twice per year whether or not a new leap second is
|
||||
# announced. These semi-annual changes will be made no later
|
||||
# than 1 June and 1 December of each year to indicate what
|
||||
# action (if any) is to be taken on 30 June and 31 December,
|
||||
# respectively. (These are the customary effective dates for new
|
||||
# leap seconds.) This expiration date will be identified by a
|
||||
@ -168,10 +199,10 @@
|
||||
# current -- the update time stamp, the data and the name of the file
|
||||
# will not change.
|
||||
#
|
||||
# Updated through IERS Bulletin C 52
|
||||
# File expires on: 1 Jun 2017
|
||||
# Updated through IERS Bulletin C53
|
||||
# File expires on: 28 December 2017
|
||||
#
|
||||
#@ 3705264000
|
||||
#@ 3723408000
|
||||
#
|
||||
2272060800 10 # 1 Jan 1972
|
||||
2287785600 11 # 1 Jul 1972
|
||||
@ -205,7 +236,7 @@
|
||||
# the following special comment contains the
|
||||
# hash value of the data in this file computed
|
||||
# use the secure hash algorithm as specified
|
||||
# by FIPS 180-1. See the files in ~/sha for
|
||||
# by FIPS 180-1. See the files in ~/pub/sha for
|
||||
# the details of how this hash value is
|
||||
# computed. Note that the hash computation
|
||||
# ignores comments and whitespace characters
|
||||
@ -216,5 +247,4 @@
|
||||
# the hash line is also ignored in the
|
||||
# computation.
|
||||
#
|
||||
#h 63f8fea8 587c099d abcf130a ad525eae 3e105052
|
||||
#
|
||||
#h 62cf8c5d 8bbb6dcc c61e3b56 c308343 869bb80d
|
||||
|
@ -14,7 +14,7 @@ SRCS= closeout.c dfa.c error.c exclude.c grep.c grepmat.c hard-locale.c \
|
||||
xstrtoumax.c
|
||||
CLEANFILES+= gnugrep.1
|
||||
|
||||
CFLAGS+=-I${.CURDIR} -I${DESTDIR}/usr/include/gnu -DHAVE_CONFIG_H
|
||||
CFLAGS+=-I${.CURDIR} -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DHAVE_CONFIG_H
|
||||
|
||||
.if ${MK_BSD_GREP} != "yes"
|
||||
LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \
|
||||
|
115
include/Makefile
115
include/Makefile
@ -133,23 +133,24 @@ _MARCHS+= x86
|
||||
|
||||
META_TARGETS+= compat
|
||||
stage_includes: ${SHARED}
|
||||
SDESTDIR= ${SYSROOT:U${DESTDIR}}
|
||||
|
||||
# Take care of stale directory-level symlinks.
|
||||
compat:
|
||||
.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto
|
||||
if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
|
||||
rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
|
||||
if [ -L ${SDESTDIR}${INCLUDEDIR}/$i ]; then \
|
||||
rm -f ${SDESTDIR}${INCLUDEDIR}/$i; \
|
||||
fi
|
||||
.endfor
|
||||
mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
|
||||
-f ${SRCTOP}/etc/mtree/BSD.include.dist \
|
||||
-p ${DESTDIR}${INCLUDEDIR} > /dev/null
|
||||
-p ${SDESTDIR}${INCLUDEDIR} > /dev/null
|
||||
|
||||
copies: .PHONY .META
|
||||
.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto machine machine/pc \
|
||||
${_MARCHS}
|
||||
if [ -d ${DESTDIR}${INCLUDEDIR}/$i ]; then \
|
||||
cd ${DESTDIR}${INCLUDEDIR}/$i; \
|
||||
if [ -d ${SDESTDIR}${INCLUDEDIR}/$i ]; then \
|
||||
cd ${SDESTDIR}${INCLUDEDIR}/$i; \
|
||||
for h in *.h; do \
|
||||
if [ -L $$h ]; then rm -f $$h; fi; \
|
||||
done; \
|
||||
@ -158,101 +159,101 @@ copies: .PHONY .META
|
||||
.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci} ${LSUBSUBDIRS}
|
||||
cd ${SRCTOP}/sys; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
|
||||
${DESTDIR}${INCLUDEDIR}/$i
|
||||
${SDESTDIR}${INCLUDEDIR}/$i
|
||||
.endfor
|
||||
cd ${SRCTOP}/sys/dev/acpica; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/acpica; \
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/acpica; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 acpi_hpet.h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/acpica
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/acpica
|
||||
cd ${SRCTOP}/sys/dev/agp; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/agp
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/agp
|
||||
cd ${SRCTOP}/sys/dev/bktr; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/bktr
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/bktr
|
||||
.if ${MK_NAND} != "no"
|
||||
cd ${SRCTOP}/sys/dev/nand; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nandsim.h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/nand; \
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/nand; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nand_dev.h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/nand
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/nand
|
||||
.endif
|
||||
cd ${SRCTOP}/sys/dev/evdev; \
|
||||
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 input.h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/evdev; \
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/evdev; \
|
||||
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 input-event-codes.h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/evdev; \
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/evdev; \
|
||||
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 uinput.h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/evdev
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/evdev
|
||||
cd ${SRCTOP}/sys/dev/hyperv/include; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 hyperv.h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/hyperv
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/hyperv
|
||||
cd ${SRCTOP}/sys/dev/hyperv/utilities; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 hv_snapshot.h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/hyperv
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/hyperv
|
||||
cd ${SRCTOP}/sys/dev/pci; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/pci
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/pci
|
||||
cd ${SRCTOP}/sys/fs/cd9660/; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
|
||||
${DESTDIR}${INCLUDEDIR}/isofs/cd9660
|
||||
${SDESTDIR}${INCLUDEDIR}/isofs/cd9660
|
||||
.if ${MK_IPFILTER} != "no"
|
||||
cd ${SRCTOP}/sys/contrib/ipfilter/netinet; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
|
||||
${DESTDIR}${INCLUDEDIR}/netinet
|
||||
${SDESTDIR}${INCLUDEDIR}/netinet
|
||||
.endif
|
||||
.if ${MK_PF} != "no"
|
||||
cd ${SRCTOP}/sys/netpfil/pf; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
|
||||
${DESTDIR}${INCLUDEDIR}/netpfil/pf
|
||||
${SDESTDIR}${INCLUDEDIR}/netpfil/pf
|
||||
.endif
|
||||
cd ${SRCTOP}/sys/crypto; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
|
||||
${DESTDIR}${INCLUDEDIR}/crypto
|
||||
${SDESTDIR}${INCLUDEDIR}/crypto
|
||||
cd ${SRCTOP}/sys/opencrypto; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
|
||||
${DESTDIR}${INCLUDEDIR}/crypto
|
||||
${SDESTDIR}${INCLUDEDIR}/crypto
|
||||
cd ${SRCTOP}/sys/${MACHINE}/include; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
|
||||
${DESTDIR}${INCLUDEDIR}/machine
|
||||
${SDESTDIR}${INCLUDEDIR}/machine
|
||||
.if exists(${SRCTOP}/sys/${MACHINE}/include/pc)
|
||||
cd ${SRCTOP}/sys/${MACHINE}/include/pc; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
|
||||
${DESTDIR}${INCLUDEDIR}/machine/pc
|
||||
${SDESTDIR}${INCLUDEDIR}/machine/pc
|
||||
.endif
|
||||
.for _MARCH in ${_MARCHS}
|
||||
.if exists(${SRCTOP}/sys/${_MARCH}/include)
|
||||
${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
|
||||
${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
|
||||
${SDESTDIR}${INCLUDEDIR}/${_MARCH}; \
|
||||
cd ${SRCTOP}/sys/${_MARCH}/include; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
|
||||
${DESTDIR}${INCLUDEDIR}/${_MARCH}
|
||||
${SDESTDIR}${INCLUDEDIR}/${_MARCH}
|
||||
.if exists(${SRCTOP}/sys/${_MARCH}/include/pc)
|
||||
${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
|
||||
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
|
||||
${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
|
||||
cd ${SRCTOP}/sys/${_MARCH}/include/pc; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
|
||||
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
|
||||
${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc
|
||||
.endif
|
||||
.endif
|
||||
.endfor
|
||||
cd ${SRCTOP}/sys/rpc; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 types.h \
|
||||
${DESTDIR}${INCLUDEDIR}/rpc
|
||||
${SDESTDIR}${INCLUDEDIR}/rpc
|
||||
cd ${SRCTOP}/sys/teken; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 teken.h \
|
||||
${DESTDIR}${INCLUDEDIR}/teken
|
||||
${SDESTDIR}${INCLUDEDIR}/teken
|
||||
.if ${MK_CDDL} != "no"
|
||||
cd ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libzfs_core.h \
|
||||
${DESTDIR}${INCLUDEDIR}
|
||||
${SDESTDIR}${INCLUDEDIR}
|
||||
cd ${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libnvpair.h \
|
||||
${DESTDIR}${INCLUDEDIR}
|
||||
${SDESTDIR}${INCLUDEDIR}
|
||||
cd ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys; \
|
||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nvpair.h \
|
||||
${DESTDIR}${INCLUDEDIR}/sys
|
||||
${SDESTDIR}${INCLUDEDIR}/sys
|
||||
.endif
|
||||
|
||||
symlinks: .PHONY .META
|
||||
@ -260,115 +261,115 @@ symlinks: .PHONY .META
|
||||
.for i in ${LDIRS}
|
||||
cd ${SRCTOP}/sys/$i; \
|
||||
for h in *.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/$i/$$h ${SDESTDIR}${INCLUDEDIR}/$i; \
|
||||
done
|
||||
.endfor
|
||||
.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci}
|
||||
cd ${SRCTOP}/sys/$i; \
|
||||
for h in *.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/$i/$$h ${SDESTDIR}${INCLUDEDIR}/$i; \
|
||||
done
|
||||
.endfor
|
||||
cd ${SRCTOP}/sys/dev/acpica; \
|
||||
for h in acpiio.h acpi_hpet.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/acpica/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/acpica; \
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/acpica; \
|
||||
done
|
||||
cd ${SRCTOP}/sys/dev/agp; \
|
||||
for h in agpreg.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/agp/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/agp; \
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/agp; \
|
||||
done
|
||||
cd ${SRCTOP}/sys/dev/bktr; \
|
||||
for h in ioctl_*.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/bktr/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/bktr; \
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/bktr; \
|
||||
done
|
||||
.if ${MK_NAND} != "no"
|
||||
cd ${SRCTOP}/sys/dev/nand; \
|
||||
for h in nandsim.h nand_dev.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/nand/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/nand; \
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/nand; \
|
||||
done
|
||||
.endif
|
||||
cd ${SRCTOP}/sys/dev/evdev; \
|
||||
for h in input.h input-event-codes.h uinput.h; do \
|
||||
ln -fs ../../../../sys/dev/evdev/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/evdev; \
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/evdev; \
|
||||
done
|
||||
cd ${SRCTOP}/sys/dev/hyperv/include; \
|
||||
for h in hyperv.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/hyperv/include/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/hyperv; \
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/hyperv; \
|
||||
done
|
||||
cd ${SRCTOP}/sys/dev/hyperv/utilities; \
|
||||
for h in hv_snapshot.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/hyperv/utilities/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/hyperv; \
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/hyperv; \
|
||||
done
|
||||
cd ${SRCTOP}/sys/dev/pci; \
|
||||
for h in pcireg.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/pci/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/dev/pci; \
|
||||
${SDESTDIR}${INCLUDEDIR}/dev/pci; \
|
||||
done
|
||||
.for i in ${LSUBSUBDIRS}
|
||||
cd ${SRCTOP}/sys/$i; \
|
||||
for h in *.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../../sys/$i/$$h ${SDESTDIR}${INCLUDEDIR}/$i; \
|
||||
done
|
||||
.endfor
|
||||
.if ${MK_IPFILTER} != "no"
|
||||
cd ${SRCTOP}/sys/contrib/ipfilter/netinet; \
|
||||
for h in *.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/contrib/ipfilter/netinet/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/netinet; \
|
||||
${SDESTDIR}${INCLUDEDIR}/netinet; \
|
||||
done
|
||||
.endif
|
||||
.if ${MK_PF} != "no"
|
||||
cd ${SRCTOP}/sys/netpfil/pf; \
|
||||
for h in *.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/netpfil/pf/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/netpfil/pf; \
|
||||
${SDESTDIR}${INCLUDEDIR}/netpfil/pf; \
|
||||
done
|
||||
.endif
|
||||
cd ${SRCTOP}/sys/crypto; \
|
||||
for h in rijndael/rijndael.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/crypto/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/crypto; \
|
||||
${SDESTDIR}${INCLUDEDIR}/crypto; \
|
||||
done
|
||||
cd ${SRCTOP}/sys/opencrypto; \
|
||||
for h in *.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/opencrypto/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/crypto; \
|
||||
${SDESTDIR}${INCLUDEDIR}/crypto; \
|
||||
done
|
||||
cd ${SRCTOP}/sys/${MACHINE}/include; \
|
||||
for h in *.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/${MACHINE}/include/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/machine; \
|
||||
${SDESTDIR}${INCLUDEDIR}/machine; \
|
||||
done
|
||||
.if exists(${SRCTOP}/sys/${MACHINE}/include/pc)
|
||||
cd ${SRCTOP}/sys/${MACHINE}/include/pc; \
|
||||
for h in *.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/${MACHINE}/include/pc/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/machine/pc; \
|
||||
${SDESTDIR}${INCLUDEDIR}/machine/pc; \
|
||||
done
|
||||
.endif
|
||||
.for _MARCH in ${_MARCHS}
|
||||
.if exists(${SRCTOP}/sys/${_MARCH}/include)
|
||||
${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
|
||||
${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
|
||||
${SDESTDIR}${INCLUDEDIR}/${_MARCH}; \
|
||||
cd ${SRCTOP}/sys/${_MARCH}/include; \
|
||||
for h in *.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/${_MARCH}/include/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
|
||||
${SDESTDIR}${INCLUDEDIR}/${_MARCH}; \
|
||||
done
|
||||
.if exists(${SRCTOP}/sys/${_MARCH}/include/pc)
|
||||
${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
|
||||
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
|
||||
${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
|
||||
cd ${SRCTOP}/sys/${_MARCH}/include/pc; \
|
||||
for h in *.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/${_MARCH}/include/pc/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
|
||||
${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
|
||||
done
|
||||
.endif
|
||||
.endif
|
||||
@ -376,12 +377,12 @@ symlinks: .PHONY .META
|
||||
cd ${SRCTOP}/sys/fs/cd9660; \
|
||||
for h in *.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/fs/cd9660/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \
|
||||
${SDESTDIR}${INCLUDEDIR}/isofs/cd9660; \
|
||||
done
|
||||
cd ${SRCTOP}/sys/rpc; \
|
||||
for h in types.h; do \
|
||||
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/rpc/$$h \
|
||||
${DESTDIR}${INCLUDEDIR}/rpc; \
|
||||
${SDESTDIR}${INCLUDEDIR}/rpc; \
|
||||
done
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -62,7 +62,7 @@ typedef ___wchar_t wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
|
||||
#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
|
||||
#ifndef __CLANG_MAX_ALIGN_T_DEFINED
|
||||
typedef __max_align_t max_align_t;
|
||||
#define __CLANG_MAX_ALIGN_T_DEFINED
|
||||
|
@ -34,8 +34,10 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
ENTRY(sigsetjmp)
|
||||
cmp x1, #0
|
||||
b.eq _C_LABEL(_setjmp)
|
||||
b.eq 1f
|
||||
b _C_LABEL(setjmp)
|
||||
1:
|
||||
b _C_LABEL(_setjmp)
|
||||
END(sigsetjmp)
|
||||
|
||||
ENTRY(siglongjmp)
|
||||
@ -45,8 +47,10 @@ ENTRY(siglongjmp)
|
||||
|
||||
/* Check the magic */
|
||||
cmp x2, x3
|
||||
b.eq _C_LABEL(_longjmp)
|
||||
b.eq 1f
|
||||
b _C_LABEL(longjmp)
|
||||
1:
|
||||
b _C_LABEL(_longjmp)
|
||||
.align 3
|
||||
.Lmagic:
|
||||
.quad _JB_MAGIC__SETJMP
|
||||
|
@ -129,8 +129,8 @@ syslog(int pri, const char *fmt, ...)
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void
|
||||
vsyslog(int pri, const char *fmt, va_list ap)
|
||||
static void
|
||||
vsyslog1(int pri, const char *fmt, va_list ap)
|
||||
{
|
||||
int cnt;
|
||||
char ch, *p;
|
||||
@ -151,13 +151,9 @@ vsyslog(int pri, const char *fmt, va_list ap)
|
||||
|
||||
saved_errno = errno;
|
||||
|
||||
THREAD_LOCK();
|
||||
|
||||
/* Check priority against setlogmask values. */
|
||||
if (!(LOG_MASK(LOG_PRI(pri)) & LogMask)) {
|
||||
THREAD_UNLOCK();
|
||||
if (!(LOG_MASK(LOG_PRI(pri)) & LogMask))
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set default facility if none specified. */
|
||||
if ((pri & LOG_FACMASK) == 0)
|
||||
@ -167,10 +163,8 @@ vsyslog(int pri, const char *fmt, va_list ap)
|
||||
tbuf_cookie.base = tbuf;
|
||||
tbuf_cookie.left = sizeof(tbuf);
|
||||
fp = fwopen(&tbuf_cookie, writehook);
|
||||
if (fp == NULL) {
|
||||
THREAD_UNLOCK();
|
||||
if (fp == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Build the message. */
|
||||
(void)time(&now);
|
||||
@ -200,7 +194,6 @@ vsyslog(int pri, const char *fmt, va_list ap)
|
||||
fmt_fp = fwopen(&fmt_cookie, writehook);
|
||||
if (fmt_fp == NULL) {
|
||||
fclose(fp);
|
||||
THREAD_UNLOCK();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -285,10 +278,8 @@ vsyslog(int pri, const char *fmt, va_list ap)
|
||||
*/
|
||||
disconnectlog();
|
||||
connectlog();
|
||||
if (send(LogFile, tbuf, cnt, 0) >= 0) {
|
||||
THREAD_UNLOCK();
|
||||
if (send(LogFile, tbuf, cnt, 0) >= 0)
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* if the resend failed, fall through to
|
||||
* possible scenario 2
|
||||
@ -303,15 +294,11 @@ vsyslog(int pri, const char *fmt, va_list ap)
|
||||
if (status == CONNPRIV)
|
||||
break;
|
||||
_usleep(1);
|
||||
if (send(LogFile, tbuf, cnt, 0) >= 0) {
|
||||
THREAD_UNLOCK();
|
||||
if (send(LogFile, tbuf, cnt, 0) >= 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
THREAD_UNLOCK();
|
||||
} else
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Output the message to the console; try not to block
|
||||
@ -333,10 +320,25 @@ vsyslog(int pri, const char *fmt, va_list ap)
|
||||
(void)_writev(fd, iov, 2);
|
||||
(void)_close(fd);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
syslog_cancel_cleanup(void *arg __unused)
|
||||
{
|
||||
|
||||
THREAD_UNLOCK();
|
||||
}
|
||||
|
||||
void
|
||||
vsyslog(int pri, const char *fmt, va_list ap)
|
||||
{
|
||||
|
||||
THREAD_LOCK();
|
||||
pthread_cleanup_push(syslog_cancel_cleanup, NULL);
|
||||
vsyslog1(pri, fmt, ap);
|
||||
pthread_cleanup_pop(1);
|
||||
}
|
||||
|
||||
/* Should be called with mutex acquired */
|
||||
static void
|
||||
disconnectlog(void)
|
||||
@ -423,9 +425,11 @@ openlog_unlocked(const char *ident, int logstat, int logfac)
|
||||
void
|
||||
openlog(const char *ident, int logstat, int logfac)
|
||||
{
|
||||
|
||||
THREAD_LOCK();
|
||||
pthread_cleanup_push(syslog_cancel_cleanup, NULL);
|
||||
openlog_unlocked(ident, logstat, logfac);
|
||||
THREAD_UNLOCK();
|
||||
pthread_cleanup_pop(1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -65,6 +65,8 @@ __sym_compat(statfs, freebsd11_statfs, FBSD_1.0);
|
||||
__sym_compat(mknod, freebsd11_mknod, FBSD_1.0);
|
||||
__sym_compat(mknodat, freebsd11_mknodat, FBSD_1.1);
|
||||
|
||||
__sym_compat(kevent, freebsd11_kevent, FBSD_1.0);
|
||||
|
||||
#undef __sym_compat
|
||||
|
||||
#define __weak_reference(sym,alias) \
|
||||
|
@ -311,6 +311,7 @@ struct rusage;
|
||||
struct sigaction;
|
||||
struct sockaddr;
|
||||
struct stat;
|
||||
struct statfs;
|
||||
struct timespec;
|
||||
struct timeval;
|
||||
struct timezone;
|
||||
@ -327,13 +328,16 @@ int __sys_clock_nanosleep(__clockid_t, int,
|
||||
const struct timespec *, struct timespec *);
|
||||
int __sys_close(int);
|
||||
int __sys_connect(int, const struct sockaddr *, __socklen_t);
|
||||
__ssize_t __sys_getdirentries(int, char *, __size_t, __off_t *);
|
||||
int __sys_fcntl(int, int, ...);
|
||||
int __sys_fdatasync(int);
|
||||
int __sys_fstat(int fd, struct stat *);
|
||||
int __sys_fstatfs(int fd, struct statfs *);
|
||||
int __sys_fstatat(int, const char *, struct stat *, int);
|
||||
int __sys_fsync(int);
|
||||
__pid_t __sys_fork(void);
|
||||
int __sys_ftruncate(int, __off_t);
|
||||
__ssize_t __sys_getdirentries(int, char *, __size_t, __off_t *);
|
||||
int __sys_getfsstat(struct statfs *, long, int);
|
||||
int __sys_gettimeofday(struct timeval *, struct timezone *);
|
||||
int __sys_kevent(int, const struct kevent *, int, struct kevent *,
|
||||
int, const struct timespec *);
|
||||
@ -372,6 +376,7 @@ int __sys_sigtimedwait(const __sigset_t *, struct __siginfo *,
|
||||
const struct timespec *);
|
||||
int __sys_sigwait(const __sigset_t *, int *);
|
||||
int __sys_sigwaitinfo(const __sigset_t *, struct __siginfo *);
|
||||
int __sys_statfs(const char *, struct statfs *);
|
||||
int __sys_swapcontext(struct __ucontext *,
|
||||
const struct __ucontext *);
|
||||
int __sys_thr_kill(long, int);
|
||||
|
@ -499,14 +499,15 @@ local_rpcb(void)
|
||||
hostname = IN6_LOCALHOST_STRING;
|
||||
}
|
||||
}
|
||||
endnetconfig(nc_handle);
|
||||
if (tmpnconf == NULL) {
|
||||
endnetconfig(nc_handle);
|
||||
rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
|
||||
mutex_unlock(&loopnconf_lock);
|
||||
return (NULL);
|
||||
}
|
||||
loopnconf = getnetconfigent(tmpnconf->nc_netid);
|
||||
/* loopnconf is never freed */
|
||||
endnetconfig(nc_handle);
|
||||
}
|
||||
mutex_unlock(&loopnconf_lock);
|
||||
client = getclnthandle(hostname, loopnconf, NULL);
|
||||
|
@ -37,6 +37,14 @@ SRCS+= \
|
||||
|
||||
SRCS+= getdents.c lstat.c mknod.c stat.c
|
||||
|
||||
SRCS+= fstat.c fstatat.c fstatfs.c getfsstat.c statfs.c
|
||||
NOASM+= fstat.o fstatat.o fstatfs.o getfsstat.o statfs.o
|
||||
PSEUDO+= _fstat.o _fstatat.o _fstatfs.o _getfsstat.o _statfs.o
|
||||
|
||||
SRCS+= getdirentries.c
|
||||
NOASM+= getdirentries.o
|
||||
PSEUDO+= _getdirentries.o
|
||||
|
||||
SRCS+= pipe.c
|
||||
|
||||
INTERPOSED = \
|
||||
@ -421,8 +429,7 @@ MLINKS+=open.2 openat.2
|
||||
MLINKS+=pathconf.2 fpathconf.2
|
||||
MLINKS+=pathconf.2 lpathconf.2
|
||||
MLINKS+=pdfork.2 pdgetpid.2\
|
||||
pdfork.2 pdkill.2 \
|
||||
pdfork.2 pdwait4.2
|
||||
pdfork.2 pdkill.2
|
||||
MLINKS+=pipe.2 pipe2.2
|
||||
MLINKS+=poll.2 ppoll.2
|
||||
MLINKS+=rctl_add_rule.2 rctl_get_limits.2 \
|
||||
|
@ -121,7 +121,6 @@ FBSD_1.0 {
|
||||
jail;
|
||||
jail_attach;
|
||||
kenv;
|
||||
kevent;
|
||||
kill;
|
||||
kldfind;
|
||||
kldfirstmod;
|
||||
@ -393,6 +392,7 @@ FBSD_1.5 {
|
||||
getdents;
|
||||
getdirentries;
|
||||
getfsstat;
|
||||
kevent;
|
||||
lstat;
|
||||
mknod;
|
||||
mknodat;
|
||||
|
102
lib/libc/sys/compat-ino64.h
Normal file
102
lib/libc/sys/compat-ino64.h
Normal file
@ -0,0 +1,102 @@
|
||||
/*-
|
||||
* Copyright (c) 2017 M. Warner Losh <imp@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.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Forward compatibility shim to convert old stat buffer to
|
||||
* new so we can call the old system call, but return data in
|
||||
* the new system call's format.
|
||||
*/
|
||||
#define _WANT_FREEBSD11_STATFS
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
#define _WANT_FREEBSD11_STAT
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define INO64_FIRST 1200031
|
||||
|
||||
static __inline void
|
||||
__stat11_to_stat(const struct freebsd11_stat *sb11, struct stat *sb)
|
||||
{
|
||||
|
||||
sb->st_dev = sb11->st_dev;
|
||||
sb->st_ino = sb11->st_ino;
|
||||
sb->st_nlink = sb11->st_nlink;
|
||||
sb->st_mode = sb11->st_mode;
|
||||
sb->st_uid = sb11->st_uid;
|
||||
sb->st_gid = sb11->st_gid;
|
||||
sb->st_rdev = sb11->st_rdev;
|
||||
sb->st_atim = sb11->st_atim;
|
||||
sb->st_mtim = sb11->st_mtim;
|
||||
sb->st_ctim = sb11->st_ctim;
|
||||
#ifdef __STAT_TIME_T_EXT
|
||||
sb->st_atim_ext = 0;
|
||||
sb->st_mtim_ext = 0;
|
||||
sb->st_ctim_ext = 0;
|
||||
sb->st_btim_ext = 0;
|
||||
#endif
|
||||
sb->st_birthtim = sb11->st_birthtim;
|
||||
sb->st_size = sb11->st_size;
|
||||
sb->st_blocks = sb11->st_blocks;
|
||||
sb->st_blksize = sb11->st_blksize;
|
||||
sb->st_flags = sb11->st_flags;
|
||||
sb->st_gen = sb11->st_gen;
|
||||
sb->st_padding0 = 0;
|
||||
sb->st_padding1 = 0;
|
||||
memset(sb->st_spare, 0, sizeof(sb->st_spare));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
__statfs11_to_statfs(const struct freebsd11_statfs *sf11, struct statfs *sf)
|
||||
{
|
||||
|
||||
sf->f_version = STATFS_VERSION;
|
||||
sf->f_type = sf11->f_type;
|
||||
sf->f_flags = sf11->f_flags;
|
||||
sf->f_bsize = sf11->f_bsize;
|
||||
sf->f_iosize = sf11->f_iosize;
|
||||
sf->f_blocks = sf11->f_blocks;
|
||||
sf->f_bfree = sf11->f_bfree;
|
||||
sf->f_bavail = sf11->f_bavail;
|
||||
sf->f_files = sf11->f_files;
|
||||
sf->f_ffree = sf11->f_ffree;
|
||||
sf->f_syncwrites = sf11->f_syncwrites;
|
||||
sf->f_asyncwrites = sf11->f_asyncwrites;
|
||||
sf->f_syncreads = sf11->f_syncreads;
|
||||
sf->f_asyncreads = sf11->f_asyncreads;
|
||||
sf->f_namemax = sf11->f_namemax;
|
||||
sf->f_owner = sf11->f_owner;
|
||||
sf->f_fsid = sf11->f_fsid;
|
||||
memset(sf->f_spare, 0, sizeof(sf->f_spare));
|
||||
memset(sf->f_charspare, 0, sizeof(sf->f_charspare));
|
||||
strlcpy(sf->f_fstypename, sf11->f_fstypename, sizeof(sf->f_fstypename));
|
||||
strlcpy(sf->f_mntfromname, sf11->f_mntfromname, sizeof(sf->f_mntfromname));
|
||||
strlcpy(sf->f_mntonname, sf11->f_mntonname, sizeof(sf->f_mntonname));
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2016 Emmanuel Vadot <manu@bidouilliste.com>
|
||||
* Copyright (c) 2017 M. Warner Losh <imp@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -22,24 +22,33 @@
|
||||
* 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$
|
||||
*/
|
||||
|
||||
#include "sun6i-a31s-sinovoip-bpi-m2.dts"
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
&mmc2 {
|
||||
status = "disabled";
|
||||
};
|
||||
#include "namespace.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/syscall.h>
|
||||
#include "compat-ino64.h"
|
||||
#include <unistd.h>
|
||||
|
||||
&p2wi {
|
||||
status = "okay";
|
||||
axp22x: pmic@68 {
|
||||
compatible = "x-powers,axp221";
|
||||
reg = <0x68>;
|
||||
interrupt-parent = <&nmi_intc>;
|
||||
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
|
||||
};
|
||||
};
|
||||
#include "libc_private.h"
|
||||
|
||||
#include "axp22x.dtsi"
|
||||
#undef fstat
|
||||
__weak_reference(_fstat, fstat);
|
||||
|
||||
#pragma weak _fstat
|
||||
int
|
||||
_fstat(int fd, struct stat *sb)
|
||||
{
|
||||
struct freebsd11_stat stat11;
|
||||
int rv;
|
||||
|
||||
if (__getosreldate() >= INO64_FIRST)
|
||||
return (__sys_fstat(fd, sb));
|
||||
rv = syscall(SYS_freebsd11_fstat, fd, &stat11);
|
||||
if (rv == 0)
|
||||
__stat11_to_stat(&stat11, sb);
|
||||
return (rv);
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2016 Emmanuel Vadot <manu@freebsd.org>
|
||||
* Copyright (c) 2017 M. Warner Losh <imp@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -22,27 +22,29 @@
|
||||
* 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$
|
||||
*/
|
||||
|
||||
#include "sun7i-a20-pcduino3.dts"
|
||||
#include "sun7i-a20-hdmi.dtsi"
|
||||
#include "xpowers-axp209.dtsi"
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
/ {
|
||||
soc@01c00000 {
|
||||
hdmi@01c16000 {
|
||||
status = "okay";
|
||||
};
|
||||
#include "namespace.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/syscall.h>
|
||||
#include "compat-ino64.h"
|
||||
#include <unistd.h>
|
||||
|
||||
hdmiaudio {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
#include "libc_private.h"
|
||||
|
||||
&gmac {
|
||||
pinctrl-0 = <&gmac_pins_rgmii_a>;
|
||||
phy-mode = "rgmii";
|
||||
};
|
||||
int
|
||||
fstatat(int fd, const char *path, struct stat *sb, int flag)
|
||||
{
|
||||
struct freebsd11_stat stat11;
|
||||
int rv;
|
||||
|
||||
if (__getosreldate() >= INO64_FIRST)
|
||||
return (__sys_fstatat(fd, path, sb, flag));
|
||||
rv = syscall(SYS_freebsd11_fstatat, fd, path, &stat11, flag);
|
||||
if (rv == 0)
|
||||
__stat11_to_stat(&stat11, sb);
|
||||
return (rv);
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2013 Ganbold Tsagaankhuu <ganbold@freebsd.org>
|
||||
* Copyright (c) 2016 Emmanuel Vadot <manu@bidouilliste.com>
|
||||
* Copyright (c) 2017 M. Warner Losh <imp@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -23,22 +22,33 @@
|
||||
* 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$
|
||||
*/
|
||||
|
||||
#include "sun7i-a20-cubieboard2.dts"
|
||||
#include "sun7i-a20-hdmi.dtsi"
|
||||
#include "xpowers-axp209.dtsi"
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
/ {
|
||||
soc@01c00000 {
|
||||
hdmi@01c16000 {
|
||||
status = "okay";
|
||||
};
|
||||
#include "namespace.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/syscall.h>
|
||||
#include "compat-ino64.h"
|
||||
#include <unistd.h>
|
||||
|
||||
hdmiaudio {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
#include "libc_private.h"
|
||||
|
||||
#undef fstatfs
|
||||
__weak_reference(_fstatfs, fstatfs);
|
||||
|
||||
#pragma weak _fstatfs
|
||||
int
|
||||
_fstatfs(int fd, struct statfs *buf)
|
||||
{
|
||||
struct freebsd11_statfs statfs11;
|
||||
int rv;
|
||||
|
||||
if (__getosreldate() >= INO64_FIRST)
|
||||
return (__sys_fstatfs(fd, buf));
|
||||
rv = syscall(SYS_freebsd11_fstatfs, fd, &statfs11);
|
||||
if (rv == 0)
|
||||
__statfs11_to_statfs(&statfs11, buf);
|
||||
return (rv);
|
||||
}
|
@ -36,6 +36,11 @@ __FBSDID("$FreeBSD$");
|
||||
ssize_t
|
||||
getdents(int fd, char *buf, size_t nbytes)
|
||||
{
|
||||
/*
|
||||
* _getdirentries knows how to call the right thing and
|
||||
* return it in the new format. It assumes that the entire
|
||||
* libc expecting the new format.
|
||||
*/
|
||||
|
||||
return (__sys_getdirentries(fd, buf, nbytes, NULL));
|
||||
return (_getdirentries(fd, buf, nbytes, NULL));
|
||||
}
|
||||
|
117
lib/libc/sys/getdirentries.c
Normal file
117
lib/libc/sys/getdirentries.c
Normal file
@ -0,0 +1,117 @@
|
||||
/*-
|
||||
* Copyright (c) 2017 M. Warner Losh <imp@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.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#define _WANT_FREEBSD11_DIRENT
|
||||
|
||||
#include "namespace.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/syscall.h>
|
||||
#include "compat-ino64.h"
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "libc_private.h"
|
||||
|
||||
static ssize_t
|
||||
__cvt_dirents_from11(const char *de11, ssize_t len11, char *de, ssize_t len)
|
||||
{
|
||||
struct dirent *dst;
|
||||
const struct freebsd11_dirent *src;
|
||||
const char *edst, *esrc;
|
||||
ssize_t rlen;
|
||||
|
||||
src = (const struct freebsd11_dirent *)de11;
|
||||
dst = (struct dirent *)de;
|
||||
esrc = de11 + len11;
|
||||
edst = de + len;
|
||||
while ((const char *)src < esrc && (const char *)dst < edst) {
|
||||
rlen = roundup(offsetof(struct dirent, d_name) + src->d_namlen + 1, 8);
|
||||
if ((const char *)dst + rlen >= edst)
|
||||
break;
|
||||
dst->d_fileno = src->d_fileno;
|
||||
dst->d_off = 0; /* nothing uses it yet, so safe for now */
|
||||
dst->d_reclen = rlen;
|
||||
dst->d_type = src->d_type;
|
||||
dst->d_pad0 = 0;
|
||||
dst->d_namlen = src->d_namlen;
|
||||
dst->d_pad1 = 0;
|
||||
memset(dst->d_name, 0, roundup(src->d_namlen + 1, 8));
|
||||
memcpy(dst->d_name, src->d_name, src->d_namlen);
|
||||
dst = (struct dirent *)((char *)dst + rlen);
|
||||
src = (const struct freebsd11_dirent *)((const char *)src + src->d_reclen);
|
||||
}
|
||||
return ((char *)dst - de);
|
||||
}
|
||||
|
||||
#undef getdirentries
|
||||
__weak_reference(_getdirentries, getdirentries);
|
||||
|
||||
#pragma weak _getdirentries
|
||||
ssize_t
|
||||
_getdirentries(int fd, char *buf, size_t nbytes, off_t *basep)
|
||||
{
|
||||
char *oldbuf;
|
||||
size_t len;
|
||||
ssize_t rv;
|
||||
|
||||
if (__getosreldate() >= INO64_FIRST)
|
||||
return (__sys_getdirentries(fd, buf, nbytes, basep));
|
||||
|
||||
/*
|
||||
* Because the old system call returns entries that are smaller than the
|
||||
* new, we could wind up in a situation where we have too many to fit in
|
||||
* the buffer with the new encoding. So sacrifice a small bit of
|
||||
* efficiency to ensure that never happens. We pick 1/4 the size round
|
||||
* up to the next DIRBLKSIZ. This will guarnatee enough room exists in
|
||||
* the dst buffer due to changes in efficiency in packing dirent
|
||||
* entries. We don't check against minimum block size to avoid a lot of
|
||||
* stat calls, we'll see if that's wise or not.
|
||||
* TBD: Will this difference matter to lseek?
|
||||
*/
|
||||
len = roundup(nbytes / 4, DIRBLKSIZ);
|
||||
oldbuf = malloc(len);
|
||||
if (oldbuf == NULL) {
|
||||
errno = EINVAL; /* ENOMEM not in possible list */
|
||||
return (-1);
|
||||
}
|
||||
rv = syscall(SYS_freebsd11_getdirentries, fd, oldbuf, len, basep);
|
||||
if (rv == -1) {
|
||||
free(oldbuf);
|
||||
return (rv);
|
||||
}
|
||||
if (rv > 0)
|
||||
rv = __cvt_dirents_from11(oldbuf, rv, buf, nbytes);
|
||||
free(oldbuf);
|
||||
|
||||
return (rv);
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2015 Emmanuel Vadot <manu@bidouilliste.com>
|
||||
* Copyright (c) 2017 M. Warner Losh <imp@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -22,64 +22,44 @@
|
||||
* 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$
|
||||
*/
|
||||
|
||||
#include "sun7i-a20-olimex-som-evb.dts"
|
||||
#include "sun7i-a20-hdmi.dtsi"
|
||||
#include "xpowers-axp209.dtsi"
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
/ {
|
||||
soc@01c00000 {
|
||||
hdmi@01c16000 {
|
||||
status = "okay";
|
||||
};
|
||||
#include "namespace.h"
|
||||
#include <sys/param.h>
|
||||
#include "compat-ino64.h"
|
||||
#include <sys/errno.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
hdmiaudio {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
#include "libc_private.h"
|
||||
|
||||
&cpu0 {
|
||||
cpu-supply = <®_dcdc2>;
|
||||
};
|
||||
int
|
||||
getfsstat(struct statfs *buf, long bufsize, int flags)
|
||||
{
|
||||
struct freebsd11_statfs *statfs11 = NULL;
|
||||
ssize_t len = 0;
|
||||
int rv, i;
|
||||
|
||||
&i2c1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c1_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c2_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi1_pins_a>,
|
||||
<&spi1_cs0_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi2_pins_a>,
|
||||
<&spi2_cs0_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart6 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart6_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart7 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart7_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
if (__getosreldate() >= INO64_FIRST)
|
||||
return (__sys_getfsstat(buf, bufsize, flags));
|
||||
if (buf != NULL) {
|
||||
len = sizeof(struct freebsd11_statfs) * /* Round down on purpose to avoid */
|
||||
(bufsize / sizeof(struct statfs)); /* overflow on translation. */
|
||||
statfs11 = malloc(len);
|
||||
if (statfs11 == NULL) {
|
||||
errno = ENOMEM;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
rv = syscall(SYS_freebsd11_getfsstat, statfs11, len, flags);
|
||||
if (rv != -1 && buf != NULL) {
|
||||
for (i = 0; i < rv; i++)
|
||||
__statfs11_to_statfs(&statfs11[i], &buf[i]);
|
||||
}
|
||||
free(statfs11);
|
||||
return (rv);
|
||||
}
|
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd April 18, 2017
|
||||
.Dd June 22, 2017
|
||||
.Dt KQUEUE 2
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -152,8 +152,9 @@ struct kevent {
|
||||
short filter; /* filter for event */
|
||||
u_short flags; /* action flags for kqueue */
|
||||
u_int fflags; /* filter flag value */
|
||||
intptr_t data; /* filter data value */
|
||||
int64_t data; /* filter data value */
|
||||
void *udata; /* opaque user data identifier */
|
||||
uint64_t ext[4]; /* extentions */
|
||||
};
|
||||
.Ed
|
||||
.Pp
|
||||
@ -177,6 +178,20 @@ Filter-specific flags.
|
||||
Filter-specific data value.
|
||||
.It Fa udata
|
||||
Opaque user-defined value passed through the kernel unchanged.
|
||||
.It Fa ext
|
||||
Extended data passed to and from kernel.
|
||||
The
|
||||
.Fa ext[0]
|
||||
and
|
||||
.Fa ext[1]
|
||||
members use is defined by the filter.
|
||||
If the filter does not use them, the members are copied unchanged.
|
||||
The
|
||||
.Fa ext[2]
|
||||
and
|
||||
.Fa ext[3]
|
||||
members are always passed throught the kernel as-is,
|
||||
making additional context available to application.
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
@ -336,33 +351,18 @@ case.
|
||||
Takes a descriptor as the identifier, and returns whenever
|
||||
there is no remaining data in the write buffer.
|
||||
.It Dv EVFILT_AIO
|
||||
The sigevent portion of the AIO request is filled in, with
|
||||
.Va sigev_notify_kqueue
|
||||
containing the descriptor of the kqueue that the event should
|
||||
be attached to,
|
||||
.Va sigev_notify_kevent_flags
|
||||
containing the kevent flags which should be
|
||||
.Dv EV_ONESHOT ,
|
||||
.Dv EV_CLEAR
|
||||
or
|
||||
.Dv EV_DISPATCH ,
|
||||
.Va sigev_value
|
||||
containing the udata value, and
|
||||
.Va sigev_notify
|
||||
set to
|
||||
.Dv SIGEV_KEVENT .
|
||||
When the
|
||||
.Fn aio_*
|
||||
system call is made, the event will be registered
|
||||
with the specified kqueue, and the
|
||||
.Va ident
|
||||
argument set to the
|
||||
.Fa struct aiocb
|
||||
returned by the
|
||||
.Fn aio_*
|
||||
system call.
|
||||
Events for this filter are not registered with
|
||||
.Fn kevent
|
||||
directly but are registered via the
|
||||
.Va aio_sigevent
|
||||
member of an asychronous I/O request when it is scheduled via an asychronous I/O
|
||||
system call such as
|
||||
.Fn aio_read .
|
||||
The filter returns under the same conditions as
|
||||
.Fn aio_error .
|
||||
For more details on this filter see
|
||||
.Xr sigevent 3 and
|
||||
.Xr aio 4 .
|
||||
.It Dv EVFILT_VNODE
|
||||
Takes a file descriptor as the identifier and the events to watch for in
|
||||
.Va fflags ,
|
||||
@ -515,16 +515,26 @@ Establishes an arbitrary timer identified by
|
||||
.Va ident .
|
||||
When adding a timer,
|
||||
.Va data
|
||||
specifies the timeout period.
|
||||
specifies the moment to fire the timer (for
|
||||
.Dv NOTE_ABSTIME )
|
||||
or the timeout period.
|
||||
The timer will be periodic unless
|
||||
.Dv EV_ONESHOT
|
||||
or
|
||||
.Dv NOTE_ABSTIME
|
||||
is specified.
|
||||
On return,
|
||||
.Va data
|
||||
contains the number of times the timeout has expired since the last call to
|
||||
.Fn kevent .
|
||||
This filter automatically sets the EV_CLEAR flag internally.
|
||||
.Bl -tag -width "Dv NOTE_USECONDS"
|
||||
For non-monotonic timers, this filter automatically sets the
|
||||
.Dv EV_CLEAR
|
||||
flag internally.
|
||||
.Pp
|
||||
The filter accepts the following flags in the
|
||||
.Va fflags
|
||||
argument:
|
||||
.Bl -tag -width "Dv NOTE_MSECONDS"
|
||||
.It Dv NOTE_SECONDS
|
||||
.Va data
|
||||
is in seconds.
|
||||
@ -537,6 +547,8 @@ is in microseconds.
|
||||
.It Dv NOTE_NSECONDS
|
||||
.Va data
|
||||
is in nanoseconds.
|
||||
.It Dv NOTE_ABSTIME
|
||||
The specified expiration time is absolute.
|
||||
.El
|
||||
.Pp
|
||||
If
|
||||
|
@ -1,4 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2017 M. Warner Losh <imp@FreeBSD.org>
|
||||
* Copyright (c) 2012 Gleb Kurtsou <gleb@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -29,15 +30,22 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include "namespace.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/stat.h>
|
||||
#include "compat-ino64.h"
|
||||
#include <unistd.h>
|
||||
|
||||
#include "libc_private.h"
|
||||
|
||||
int
|
||||
lstat(const char *path, struct stat *sb)
|
||||
{
|
||||
struct freebsd11_stat stat11;
|
||||
int rv;
|
||||
|
||||
if (__getosreldate() >= INO64_FIRST)
|
||||
return (__sys_fstatat(AT_FDCWD, path, sb, AT_SYMLINK_NOFOLLOW));
|
||||
rv = syscall(SYS_freebsd11_lstat, path, &stat11);
|
||||
if (rv == 0)
|
||||
__stat11_to_stat(&stat11, sb);
|
||||
return (rv);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
.\" @(#)mmap.2 8.4 (Berkeley) 5/11/95
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd February 4, 2017
|
||||
.Dd June 22, 2017
|
||||
.Dt MMAP 2
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -69,7 +69,7 @@ current) offsets in the object.
|
||||
In particular, the
|
||||
.Fa offset
|
||||
value cannot be negative.
|
||||
If the object is truncated and the process later accesses a pages that
|
||||
If the object is truncated and the process later accesses a page that
|
||||
is wholly within the truncated region, the access is aborted and a
|
||||
.Dv SIGBUS
|
||||
signal is delivered to the process.
|
||||
@ -199,9 +199,21 @@ In contrast, if
|
||||
.Dv MAP_EXCL
|
||||
is specified, the request will fail if a mapping
|
||||
already exists within the range.
|
||||
.It Dv MAP_HASSEMAPHORE
|
||||
Notify the kernel that the region may contain semaphores and that special
|
||||
handling may be necessary.
|
||||
.It Dv MAP_GUARD
|
||||
Instead of a mapping, create a guard of the specified size.
|
||||
Guards allow a process to create reservations in its address space,
|
||||
which can later be replaced by actual mappings.
|
||||
.Pp
|
||||
.Fa mmap
|
||||
will not create mappings in the address range of a guard unless
|
||||
the request specifies
|
||||
.Dv MAP_FIXED .
|
||||
Guards can be destroyed with
|
||||
.Xr munmap 2 .
|
||||
Any memory access by a thread to the guarded range results
|
||||
in the delivery of a
|
||||
.Dv SIGSEGV
|
||||
signal to that thread.
|
||||
.It Dv MAP_NOCORE
|
||||
Region is not included in a core file.
|
||||
.It Dv MAP_NOSYNC
|
||||
@ -306,6 +318,7 @@ must include at least
|
||||
.Dv PROT_READ
|
||||
and
|
||||
.Dv PROT_WRITE .
|
||||
.Pp
|
||||
This option creates
|
||||
a memory region that grows to at most
|
||||
.Fa len
|
||||
@ -316,6 +329,10 @@ stack top is the starting address returned by the call, plus
|
||||
bytes.
|
||||
The bottom of the stack at maximum growth is the starting
|
||||
address returned by the call.
|
||||
The system uses guards to prevent the inadvertent use of
|
||||
regions into which stacks created with
|
||||
.Dv MAP_STACK
|
||||
will automatically grow, without mapping the whole stack in advance.
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
@ -409,6 +426,7 @@ were specified.
|
||||
.It Bq Er EINVAL
|
||||
None of
|
||||
.Dv MAP_ANON ,
|
||||
.Dv MAP_GUARD ,
|
||||
.Dv MAP_PRIVATE ,
|
||||
.Dv MAP_SHARED ,
|
||||
or
|
||||
@ -458,6 +476,25 @@ were specified, but the requested region is already used by a mapping.
|
||||
was specified, but
|
||||
.Dv MAP_FIXED
|
||||
was not.
|
||||
.It Bq Er EINVAL
|
||||
.Dv MAP_GUARD
|
||||
was specified, but the
|
||||
.Fa offset
|
||||
argument was not zero, the
|
||||
.Fa fd
|
||||
argument was not -1, or the
|
||||
.Fa prot
|
||||
argument was not
|
||||
.Dv PROT_NONE .
|
||||
.It Bq Er EINVAL
|
||||
.Dv MAP_GUARD
|
||||
was specified together with one of the flags
|
||||
.Dv MAP_ANON ,
|
||||
.Dv MAP_PREFAULT ,
|
||||
.Dv MAP_PREFAULT_READ ,
|
||||
.Dv MAP_PRIVATE ,
|
||||
.Dv MAP_SHARED ,
|
||||
.Dv MAP_STACK .
|
||||
.It Bq Er ENODEV
|
||||
.Dv MAP_ANON
|
||||
has not been specified and
|
||||
|
@ -28,7 +28,7 @@
|
||||
.\" @(#)munmap.2 8.3 (Berkeley) 5/27/94
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd May 27, 1994
|
||||
.Dd June 22, 2017
|
||||
.Dt MUNMAP 2
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -44,7 +44,7 @@
|
||||
The
|
||||
.Fn munmap
|
||||
system call
|
||||
deletes the mappings for the specified address range,
|
||||
deletes the mappings and guards for the specified address range,
|
||||
and causes further references to addresses within the range
|
||||
to generate invalid memory references.
|
||||
.Sh RETURN VALUES
|
||||
|
@ -32,14 +32,13 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd June 8, 2016
|
||||
.Dd June 17, 2017
|
||||
.Dt PDFORK 2
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm pdfork ,
|
||||
.Nm pdgetpid ,
|
||||
.Nm pdkill ,
|
||||
.Nm pdwait4
|
||||
.Nm pdkill
|
||||
.Nd System calls to manage process descriptors
|
||||
.Sh LIBRARY
|
||||
.Lb libc
|
||||
@ -51,8 +50,6 @@
|
||||
.Fn pdgetpid "int fd" "pid_t *pidp"
|
||||
.Ft int
|
||||
.Fn pdkill "int fd" "int signum"
|
||||
.Ft int
|
||||
.Fn pdwait4 "int fd" "int *status" "int options" "struct rusage *rusage"
|
||||
.Sh DESCRIPTION
|
||||
Process descriptors are special file descriptors that represent processes,
|
||||
and are created using
|
||||
@ -96,11 +93,6 @@ except that it accepts a process descriptor,
|
||||
.Fa fd ,
|
||||
rather than a PID.
|
||||
.Pp
|
||||
.Fn pdwait4
|
||||
behaves identically to
|
||||
.Xr wait4 2 ,
|
||||
but operates with respect to a process descriptor argument rather than a PID.
|
||||
.Pp
|
||||
The following system calls also have effects specific to process descriptors:
|
||||
.Pp
|
||||
.Xr fstat 2
|
||||
@ -146,9 +138,6 @@ does.
|
||||
and
|
||||
.Fn pdkill
|
||||
return 0 on success and -1 on failure.
|
||||
.Pp
|
||||
.Fn pdwait4
|
||||
returns a PID on success and -1 on failure.
|
||||
.Sh ERRORS
|
||||
These functions may return the same error numbers as their PID-based equivalents
|
||||
(e.g.
|
||||
@ -180,9 +169,8 @@ for
|
||||
The
|
||||
.Fn pdfork ,
|
||||
.Fn pdgetpid ,
|
||||
.Fn pdkill
|
||||
and
|
||||
.Fn pdwait4
|
||||
.Fn pdkill
|
||||
system calls first appeared in
|
||||
.Fx 9.0 .
|
||||
.Pp
|
||||
@ -197,6 +185,3 @@ and
|
||||
.An Jonathan Anderson Aq Mt jonathan@FreeBSD.org
|
||||
at the University of Cambridge Computer Laboratory with support from a grant
|
||||
from Google, Inc.
|
||||
.Sh BUGS
|
||||
.Fn pdwait4
|
||||
has not yet been implemented.
|
||||
|
@ -28,7 +28,7 @@
|
||||
.\" @(#)stat.2 8.4 (Berkeley) 5/1/95
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd January 14, 2016
|
||||
.Dd June 23, 2017
|
||||
.Dt STAT 2
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -62,7 +62,7 @@ The
|
||||
.Fn lstat
|
||||
system call is like
|
||||
.Fn stat
|
||||
except in the case where the named file is a symbolic link,
|
||||
except when the named file is a symbolic link,
|
||||
in which case
|
||||
.Fn lstat
|
||||
returns information about the link,
|
||||
@ -82,7 +82,7 @@ system call is equivalent to
|
||||
.Fn stat
|
||||
and
|
||||
.Fn lstat
|
||||
except in the case where the
|
||||
except when the
|
||||
.Fa path
|
||||
specifies a relative path.
|
||||
In this case the status is retrieved from a file relative to
|
||||
@ -92,7 +92,7 @@ instead of the current working directory.
|
||||
.Pp
|
||||
The values for the
|
||||
.Fa flag
|
||||
are constructed by a bitwise-inclusive OR of flags from the following list,
|
||||
are constructed by a bitwise-inclusive OR of flags from this list,
|
||||
defined in
|
||||
.In fcntl.h :
|
||||
.Bl -tag -width indent
|
||||
@ -129,16 +129,16 @@ and into which information is placed concerning the file.
|
||||
.Pp
|
||||
The fields of
|
||||
.Vt "struct stat"
|
||||
related to the file system are as follows:
|
||||
related to the file system are:
|
||||
.Bl -tag -width ".Va st_nlink"
|
||||
.It Va st_dev
|
||||
The numeric ID of the device containing the file.
|
||||
Numeric ID of the device containing the file.
|
||||
.It Va st_ino
|
||||
The file's inode number.
|
||||
.It Va st_nlink
|
||||
The number of hard links to the file.
|
||||
Number of hard links to the file.
|
||||
.It Va st_flags
|
||||
The flags enabled for the file.
|
||||
Flags enabled for the file.
|
||||
See
|
||||
.Xr chflags 2
|
||||
for the list of flags and their description.
|
||||
@ -152,10 +152,10 @@ fields together identify the file uniquely within the system.
|
||||
.Pp
|
||||
The time-related fields of
|
||||
.Vt "struct stat"
|
||||
are as follows:
|
||||
are:
|
||||
.Bl -tag -width ".Va st_birthtim"
|
||||
.It Va st_atim
|
||||
Time when file data last accessed.
|
||||
Time when file data was last accessed.
|
||||
Changed by the
|
||||
.Xr mknod 2 ,
|
||||
.Xr utimes 2 ,
|
||||
@ -164,7 +164,7 @@ and
|
||||
.Xr readv 2
|
||||
system calls.
|
||||
.It Va st_mtim
|
||||
Time when file data last modified.
|
||||
Time when file data was last modified.
|
||||
Changed by the
|
||||
.Xr mkdir 2 ,
|
||||
.Xr mkfifo 2 ,
|
||||
@ -199,7 +199,7 @@ system calls.
|
||||
Time when the inode was created.
|
||||
.El
|
||||
.Pp
|
||||
The following time-related macros are defined for compatibility:
|
||||
These time-related macros are defined for compatibility:
|
||||
.Bd -literal
|
||||
#define st_atime st_atim.tv_sec
|
||||
#define st_mtime st_mtim.tv_sec
|
||||
@ -216,35 +216,35 @@ The following time-related macros are defined for compatibility:
|
||||
#endif
|
||||
.Ed
|
||||
.Pp
|
||||
The size-related fields of the
|
||||
Size-related fields of the
|
||||
.Vt "struct stat"
|
||||
are as follows:
|
||||
are:
|
||||
.Bl -tag -width ".Va st_blksize"
|
||||
.It Va st_size
|
||||
The file size in bytes.
|
||||
File size in bytes.
|
||||
.It Va st_blksize
|
||||
The optimal I/O block size for the file.
|
||||
Optimal I/O block size for the file.
|
||||
.It Va st_blocks
|
||||
The actual number of blocks allocated for the file in 512-byte units.
|
||||
Actual number of blocks allocated for the file in 512-byte units.
|
||||
As short symbolic links are stored in the inode, this number may
|
||||
be zero.
|
||||
.El
|
||||
.Pp
|
||||
The access-related fields of
|
||||
.Vt "struct stat"
|
||||
are as follows:
|
||||
are:
|
||||
.Bl -tag -width ".Va st_mode"
|
||||
.It Va st_uid
|
||||
The user ID of the file's owner.
|
||||
User ID of the file's owner.
|
||||
.It Va st_gid
|
||||
The group ID of the file.
|
||||
Group ID of the file.
|
||||
.It Va st_mode
|
||||
Status of the file (see below).
|
||||
.El
|
||||
.Pp
|
||||
The status information word
|
||||
.Fa st_mode
|
||||
has the following bits:
|
||||
has these bits:
|
||||
.Bd -literal
|
||||
#define S_IFMT 0170000 /* type of file mask */
|
||||
#define S_IFIFO 0010000 /* named pipe (fifo) */
|
||||
@ -277,7 +277,7 @@ For a list of access modes, see
|
||||
.Xr access 2
|
||||
and
|
||||
.Xr chmod 2 .
|
||||
The following macros are available to test whether a
|
||||
These macros are available to test whether a
|
||||
.Va st_mode
|
||||
value passed in the
|
||||
.Fa m
|
||||
|
@ -1,4 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2017 M. Warner Losh <imp@FreeBSD.org>
|
||||
* Copyright (c) 2012 Gleb Kurtsou <gleb@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -29,15 +30,22 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include "namespace.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/stat.h>
|
||||
#include "compat-ino64.h"
|
||||
#include <unistd.h>
|
||||
|
||||
#include "libc_private.h"
|
||||
|
||||
int
|
||||
stat(const char *path, struct stat *sb)
|
||||
{
|
||||
struct freebsd11_stat stat11;
|
||||
int rv;
|
||||
|
||||
if (__getosreldate() >= INO64_FIRST)
|
||||
return (__sys_fstatat(AT_FDCWD, path, sb, 0));
|
||||
rv = syscall(SYS_freebsd11_stat, path, &stat11);
|
||||
if (rv == 0)
|
||||
__stat11_to_stat(&stat11, sb);
|
||||
return (rv);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2015 Oleksandr Tymoshenko <gonzo@freebsd.org>
|
||||
* Copyright (c) 2017 M. Warner Losh <imp@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -22,24 +22,29 @@
|
||||
* 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$
|
||||
*/
|
||||
|
||||
/ {
|
||||
ocp {
|
||||
pruss@4A300000 {
|
||||
compatible = "ti,pruss-v2";
|
||||
reg = <0x4A300000 0x80000>;
|
||||
interrupt-parent = <&intc>;
|
||||
interrupts = <20 21 22 23 24 25 26 27>;
|
||||
};
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
};
|
||||
#include "namespace.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/syscall.h>
|
||||
#include "compat-ino64.h"
|
||||
#include <unistd.h>
|
||||
|
||||
};
|
||||
#include "libc_private.h"
|
||||
|
||||
&tps {
|
||||
interrupt-parent = <&intc>;
|
||||
interrupts = <7>;
|
||||
};
|
||||
int
|
||||
statfs(const char *path, struct statfs *buf)
|
||||
{
|
||||
struct freebsd11_statfs statfs11;
|
||||
int rv;
|
||||
|
||||
if (__getosreldate() >= INO64_FIRST)
|
||||
return (__sys_statfs(path, buf));
|
||||
rv = syscall(SYS_freebsd11_statfs, path, &statfs11);
|
||||
if (rv == 0)
|
||||
__statfs11_to_statfs(&statfs11, buf);
|
||||
return (rv);
|
||||
}
|
@ -28,7 +28,7 @@
|
||||
.\" @(#)wait.2 8.2 (Berkeley) 4/19/94
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd June 1, 2016
|
||||
.Dd June 17, 2017
|
||||
.Dt WAIT 2
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -601,9 +601,7 @@ must be checked against zero to determine if a process reported status.
|
||||
called with -1 to wait for any child process will ignore a child that is
|
||||
referenced by a process descriptor (see
|
||||
.Xr pdfork 2 ) .
|
||||
Specific processes can still be waited on by specifying the process ID
|
||||
or descriptor (see
|
||||
.Xr pdwait 4 ) .
|
||||
Specific processes can still be waited on by specifying the process ID.
|
||||
.Sh ERRORS
|
||||
The
|
||||
.Fn wait
|
||||
|
@ -21,7 +21,7 @@ OTHERSRCS+= yp_passwd.c yp_update.c
|
||||
|
||||
RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen -C
|
||||
|
||||
INCDIRS= -I${DESTDIR}/usr/include/rpcsvc
|
||||
INCDIRS= -I${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc
|
||||
|
||||
CFLAGS+= -DYP ${INCDIRS}
|
||||
|
||||
|
@ -114,7 +114,7 @@ CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}}
|
||||
|
||||
DEPENDOBJS+= tables.h
|
||||
tables.h: mktables
|
||||
sh ${.CURDIR}/mktables ${DESTDIR}${INCLUDEDIR} ${.TARGET}
|
||||
sh ${.CURDIR}/mktables ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} ${.TARGET}
|
||||
|
||||
# mkioctls runs find(1) for headers so needs to rebuild every time. This used
|
||||
# to be a hack only done in buildworld.
|
||||
@ -123,7 +123,7 @@ ioctl.c: .PHONY
|
||||
.endif
|
||||
ioctl.c: mkioctls .META
|
||||
env CPP="${CPP}" \
|
||||
/bin/sh ${.CURDIR}/mkioctls ${DESTDIR}${INCLUDEDIR} > ${.TARGET}
|
||||
/bin/sh ${.CURDIR}/mkioctls ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} > ${.TARGET}
|
||||
|
||||
beforedepend: ioctl.c tables.h
|
||||
|
||||
|
@ -65,10 +65,11 @@ gen_table()
|
||||
else
|
||||
filter="egrep -v"
|
||||
fi
|
||||
all_headers="${all_headers:+${all_headers} }${file}"
|
||||
cat <<_EOF_
|
||||
TABLE_START(${name})
|
||||
_EOF_
|
||||
if [ -e "${include_dir}/${file}" ]; then
|
||||
all_headers="${all_headers:+${all_headers} }${file}"
|
||||
egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \
|
||||
$include_dir/$file | ${filter} ${excl} | \
|
||||
awk '{ for (i = 1; i <= NF; i++) \
|
||||
@ -76,6 +77,7 @@ _EOF_
|
||||
break; \
|
||||
++i; \
|
||||
printf "TABLE_ENTRY(%s)\n", $i }'
|
||||
fi
|
||||
cat <<_EOF_
|
||||
TABLE_END
|
||||
|
||||
|
@ -41,6 +41,8 @@
|
||||
static Elf_Ehdr *get_elf_header(int, const char *, const struct stat *);
|
||||
static int convert_flags(int); /* Elf flags -> mmap flags */
|
||||
|
||||
int __getosreldate(void);
|
||||
|
||||
/*
|
||||
* Map a shared object into memory. The "fd" argument is a file descriptor,
|
||||
* which must be open on the object and positioned at its beginning.
|
||||
@ -190,7 +192,8 @@ map_object(int fd, const char *path, const struct stat *sb)
|
||||
base_vlimit = round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz);
|
||||
mapsize = base_vlimit - base_vaddr;
|
||||
base_addr = (caddr_t) base_vaddr;
|
||||
base_flags = MAP_PRIVATE | MAP_ANON | MAP_NOCORE;
|
||||
base_flags = __getosreldate() >= P_OSREL_MAP_GUARD ? MAP_GUARD :
|
||||
MAP_PRIVATE | MAP_ANON | MAP_NOCORE;
|
||||
if (npagesizes > 1 && round_page(segs[0]->p_filesz) >= pagesizes[1])
|
||||
base_flags |= MAP_ALIGNED_SUPER;
|
||||
if (base_vaddr != 0)
|
||||
|
@ -30,8 +30,6 @@ arm_install_uboot() {
|
||||
chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
|
||||
chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \
|
||||
${FATMOUNT}/ubldr.bin
|
||||
chroot ${CHROOTDIR} ln ${UFSMOUNT}/boot/dtb/cubieboard2.dtb \
|
||||
${UFSMOUNT}/boot/dtb/sun7i-a20-cubieboard2.dtb
|
||||
chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
|
||||
sync
|
||||
umount_loop ${CHROOTDIR}/${FATMOUNT}
|
||||
|
65
release/arm64/RPI3.conf
Normal file
65
release/arm64/RPI3.conf
Normal file
@ -0,0 +1,65 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
CHROOT_MAKEENV="TARGET=amd64 TARGET_ARCH=amd64"
|
||||
SRCBRANCH="base/head@rHEAD"
|
||||
EMBEDDEDBUILD=1
|
||||
EMBEDDED_TARGET="arm64"
|
||||
EMBEDDED_TARGET_ARCH="aarch64"
|
||||
EMBEDDEDPORTS="sysutils/u-boot-rpi3 security/ca_root_nss"
|
||||
KERNEL="GENERIC"
|
||||
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000"
|
||||
IMAGE_SIZE="2G"
|
||||
PART_SCHEME="MBR"
|
||||
FAT_SIZE="50m -b 1m"
|
||||
FAT_TYPE="16"
|
||||
MD_ARGS="-x 63 -y 255"
|
||||
NODOC=1
|
||||
DTB_REPO="https://github.com/raspberrypi/firmware/blob/master/boot"
|
||||
DTB="bcm2710-rpi-3-b.dtb"
|
||||
OVERLAYS="mmc.dtbo pi3-disable-bt.dtbo"
|
||||
export BOARDNAME="RPI3"
|
||||
|
||||
arm_install_uboot() {
|
||||
UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi3"
|
||||
UBOOT_FILES="LICENCE.broadcom README armstub8.bin bootcode.bin config.txt \
|
||||
fixup.dat fixup_cd.dat fixup_x.dat start.elf start_cd.elf \
|
||||
start_x.elf u-boot.bin"
|
||||
FATMOUNT="${DESTDIR%${KERNEL}}fat"
|
||||
UFSMOUNT="${DESTDIR%${KERNEL}}ufs"
|
||||
chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
|
||||
chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
|
||||
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
|
||||
for _UF in ${UBOOT_FILES}; do
|
||||
chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \
|
||||
${FATMOUNT}/${_UF}
|
||||
done
|
||||
chroot ${CHROOTDIR} fetch -o "${FATMOUNT}/${DTB}" "${DTB_REPO}/${DTB}?raw=true"
|
||||
chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays
|
||||
for _OL in ${OVERLAYS}; do
|
||||
chroot ${CHROOTDIR} fetch -o "${FATMOUNT}/overlays/${_OL}"\
|
||||
"${DTB_REPO}/overlays/${_OL}?raw=true"
|
||||
done
|
||||
|
||||
_OBJDIR="$(chroot ${CHROOTDIR} make -C ${WORLDDIR} -V .OBJDIR)"
|
||||
_OBJDIR="$(realpath ${_OBJDIR})"
|
||||
if [ -d "${CHROOTDIR}/${_OBJDIR%%/usr/src}/${EMBEDDED_TARGET}.${EMBEDDED_TARGET_ARCH}" ]; then
|
||||
BOOTFILES="/${_OBJDIR%%/usr/src}/${EMBEDDED_TARGET}.${EMBEDDED_TARGET_ARCH}/usr/src/sys/boot"
|
||||
else
|
||||
BOOTFILES="/${_OBJDIR}/sys/boot"
|
||||
fi
|
||||
|
||||
chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/EFI/BOOT
|
||||
chroot ${CHROOTDIR} cp -p ${BOOTFILES}/efi/boot1/boot1.efi \
|
||||
${FATMOUNT}/EFI/BOOT/bootaa64.efi
|
||||
chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
|
||||
sync
|
||||
umount_loop ${CHROOTDIR}/${FATMOUNT}
|
||||
umount_loop ${CHROOTDIR}/${UFSMOUNT}
|
||||
chroot ${CHROOTDIR} rmdir ${FATMOUNT}
|
||||
chroot ${CHROOTDIR} rmdir ${UFSMOUNT}
|
||||
|
||||
return 0
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#-
|
||||
# Copyright (c) 2013-2015 The FreeBSD Foundation
|
||||
# Copyright (c) 2013-2017 The FreeBSD Foundation
|
||||
# Copyright (c) 2013 Glen Barber
|
||||
# Copyright (c) 2011 Nathan Whitehorn
|
||||
# All rights reserved.
|
||||
@ -148,10 +148,11 @@ env_check() {
|
||||
WITH_COMPRESSED_IMAGES=
|
||||
NODOC=yes
|
||||
case ${EMBEDDED_TARGET}:${EMBEDDED_TARGET_ARCH} in
|
||||
arm:armv6)
|
||||
chroot_build_release_cmd="chroot_arm_armv6_build_release"
|
||||
arm:armv6|arm64:aarch64)
|
||||
chroot_build_release_cmd="chroot_arm_build_release"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@ -205,8 +206,8 @@ env_check() {
|
||||
CHROOT_MAKEENV="${CHROOT_MAKEENV} \
|
||||
MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj"
|
||||
CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}"
|
||||
CHROOT_IMAKEFLAGS="${CONF_FILES}"
|
||||
CHROOT_DMAKEFLAGS="${CONF_FILES}"
|
||||
CHROOT_IMAKEFLAGS="${WORLD_FLAGS} ${CONF_FILES}"
|
||||
CHROOT_DMAKEFLAGS="${WORLD_FLAGS} ${CONF_FILES}"
|
||||
RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} \
|
||||
${CONF_FILES}"
|
||||
RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} \
|
||||
@ -346,13 +347,19 @@ chroot_build_release() {
|
||||
return 0
|
||||
} # chroot_build_release()
|
||||
|
||||
# chroot_arm_armv6_build_release(): Create arm/armv6 SD card image.
|
||||
chroot_arm_armv6_build_release() {
|
||||
# chroot_arm_build_release(): Create arm SD card image.
|
||||
chroot_arm_build_release() {
|
||||
load_target_env
|
||||
eval chroot ${CHROOTDIR} make -C /usr/src/release obj
|
||||
if [ -e "${RELENGDIR}/tools/${EMBEDDED_TARGET}.subr" ]; then
|
||||
. "${RELENGDIR}/tools/${EMBEDDED_TARGET}.subr"
|
||||
case ${EMBEDDED_TARGET} in
|
||||
arm|arm64)
|
||||
if [ -e "${RELENGDIR}/tools/arm.subr" ]; then
|
||||
. "${RELENGDIR}/tools/arm.subr"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
[ ! -z "${RELEASECONF}" ] && . "${RELEASECONF}"
|
||||
WORLDDIR="$(eval chroot ${CHROOTDIR} make -C /usr/src/release -V WORLDDIR)"
|
||||
OBJDIR="$(eval chroot ${CHROOTDIR} make -C /usr/src/release -V .OBJDIR)"
|
||||
@ -381,7 +388,7 @@ chroot_arm_armv6_build_release() {
|
||||
> CHECKSUM.SHA256
|
||||
|
||||
return 0
|
||||
} # chroot_arm_armv6_build_release()
|
||||
} # chroot_arm_build_release()
|
||||
|
||||
# main(): Start here.
|
||||
main() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#-
|
||||
# Copyright (c) 2015 The FreeBSD Foundation
|
||||
# Copyright (c) 2015-2017 The FreeBSD Foundation
|
||||
# All rights reserved.
|
||||
#
|
||||
# Portions of this software were developed by Glen Barber
|
||||
@ -27,7 +27,7 @@
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# Common subroutines used to build arm/armv6 images.
|
||||
# Common subroutines used to build arm SD card images.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
@ -65,7 +65,7 @@ umount_loop() {
|
||||
arm_create_disk() {
|
||||
# Create the target raw file and temporary work directory.
|
||||
chroot ${CHROOTDIR} gpart create -s ${PART_SCHEME} ${mddev}
|
||||
chroot ${CHROOTDIR} gpart add -t '!12' -a 63 -s ${FAT_SIZE} ${mddev}
|
||||
chroot ${CHROOTDIR} gpart add -t '!12' -a 512k -s ${FAT_SIZE} ${mddev}
|
||||
chroot ${CHROOTDIR} gpart set -a active -i 1 ${mddev}
|
||||
chroot ${CHROOTDIR} newfs_msdos -L msdosboot -F ${FAT_TYPE} /dev/${mddev}s1
|
||||
chroot ${CHROOTDIR} gpart add -t freebsd ${mddev}
|
||||
|
@ -1108,6 +1108,7 @@ event_loop(void)
|
||||
if (FD_ISSET(seqpacket_fd, &fds))
|
||||
new_client(seqpacket_fd, SOCK_SEQPACKET);
|
||||
}
|
||||
cfg.remove_pidfile();
|
||||
close(seqpacket_fd);
|
||||
close(stream_fd);
|
||||
close(fd);
|
||||
|
@ -1,7 +1,8 @@
|
||||
# $FreeBSD$
|
||||
|
||||
ATF_TESTS_C= client_test
|
||||
TEST_METADATA.client_test= required_programs="devd"
|
||||
TEST_METADATA.client_test= required_files="/var/run/devd.pid"
|
||||
TEST_METADATA.client_test+= required_programs="devd"
|
||||
TEST_METADATA.client_test+= required_user="root"
|
||||
TEST_METADATA.client_test+= timeout=15
|
||||
|
||||
|
@ -6,7 +6,7 @@ SRCS= gvinum.c gvinum.h geom_vinum_share.c
|
||||
MAN= gvinum.8
|
||||
|
||||
WARNS?= 2
|
||||
CFLAGS+= -I${SRCTOP}/sys -I${DESTDIR}/${INCLUDEDIR}/edit
|
||||
CFLAGS+= -I${SRCTOP}/sys -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit
|
||||
|
||||
LIBADD= edit geom
|
||||
|
||||
|
@ -626,6 +626,8 @@ list_pipes(struct dn_id *oid, struct dn_id *end)
|
||||
/* data rate */
|
||||
if (b == 0)
|
||||
sprintf(bwbuf, "unlimited ");
|
||||
else if (b >= 1000000000)
|
||||
sprintf(bwbuf, "%7.3f Gbit/s", b/1000000000);
|
||||
else if (b >= 1000000)
|
||||
sprintf(bwbuf, "%7.3f Mbit/s", b/1000000);
|
||||
else if (b >= 1000)
|
||||
@ -818,6 +820,9 @@ read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen)
|
||||
} else if (*end == 'M' || *end == 'm') {
|
||||
end++;
|
||||
bw *= 1000000;
|
||||
} else if (*end == 'G' || *end == 'g') {
|
||||
end++;
|
||||
bw *= 1000000000;
|
||||
}
|
||||
if ((*end == 'B' &&
|
||||
_substrcmp2(end, "Bi", "Bit/s") != 0) ||
|
||||
|
@ -2499,7 +2499,7 @@ The following parameters can be configured for a pipe:
|
||||
.It Cm bw Ar bandwidth | device
|
||||
Bandwidth, measured in
|
||||
.Sm off
|
||||
.Op Cm K | M
|
||||
.Op Cm K | M | G
|
||||
.Brq Cm bit/s | Byte/s .
|
||||
.Sm on
|
||||
.Pp
|
||||
|
@ -150,7 +150,8 @@ main(int argc, char *argv[])
|
||||
case 'L':
|
||||
volumelabel = optarg;
|
||||
i = -1;
|
||||
while (isalnum(volumelabel[++i]));
|
||||
while (isalnum(volumelabel[++i]) ||
|
||||
volumelabel[i] == '_');
|
||||
if (volumelabel[i] != '\0') {
|
||||
errx(1, "bad volume label. Valid characters are alphanumerics.");
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd July 21, 2016
|
||||
.Dd June 22, 2017
|
||||
.Dt AIO 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -161,11 +161,27 @@ field which can be used to request notification when an operation completes.
|
||||
For
|
||||
.Dv SIGEV_KEVENT
|
||||
notifications,
|
||||
the posted kevent will contain:
|
||||
the
|
||||
.Va sigevent
|
||||
.Ap
|
||||
s
|
||||
.Va sigev_notify_kqueue
|
||||
field should contain the descriptor of the kqueue that the event should be attached
|
||||
to, its
|
||||
.Va sigev_notify_kevent_flags
|
||||
field may contain
|
||||
.Dv EV_ONESHOT ,
|
||||
.Dv EV_CLEAR , and/or
|
||||
.Dv EV_DISPATCH , and its
|
||||
.Va sigev_notify
|
||||
field should be set to
|
||||
.Dv SIGEV_KEVENT .
|
||||
The posted kevent will contain:
|
||||
.Bl -column ".Va filter"
|
||||
.It Sy Member Ta Sy Value
|
||||
.It Va ident Ta asynchronous I/O control buffer pointer
|
||||
.It Va filter Ta Dv EVFILT_AIO
|
||||
.It Va flags Ta Dv EV_EOF
|
||||
.It Va udata Ta
|
||||
value stored in
|
||||
.Va aio_sigevent.sigev_value
|
||||
|
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd March 29, 2016
|
||||
.Dd February 23, 2017
|
||||
.Dt MAKE.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -176,6 +176,11 @@ value, use
|
||||
.Dq Li +=
|
||||
instead of
|
||||
.Dq Li = .
|
||||
.It Va DTC
|
||||
.Pq Vt str
|
||||
Select the compiler for DTS (Device Tree Syntax) file.
|
||||
.Va DTC
|
||||
is initially set to the value of dtc
|
||||
.It Va INSTALL
|
||||
.Pq Vt str
|
||||
the default install command.
|
||||
|
@ -1,6 +1,6 @@
|
||||
.\" DO NOT EDIT-- this file is generated by tools/build/options/makeman.
|
||||
.\" $FreeBSD$
|
||||
.Dd June 8, 2017
|
||||
.Dd June 20, 2017
|
||||
.Dt SRC.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -764,9 +764,9 @@ by linking against libgnuregex.
|
||||
Set to not build
|
||||
.Xr gpioctl 8
|
||||
as part of the base system.
|
||||
.It Va WITHOUT_GPL_DTC
|
||||
Set to build the BSD licensed version of the device tree compiler rather
|
||||
than the GPLed one from elinux.org.
|
||||
.It Va WITH_GPL_DTC
|
||||
Set to build the GPL'd version of the device tree compiler from elinux.org,
|
||||
instead of the BSD licensed one.
|
||||
.It Va WITHOUT_GSSAPI
|
||||
Set to not build libgssapi.
|
||||
.It Va WITHOUT_HAST
|
||||
|
@ -203,8 +203,8 @@ Machine-dependent type sizes:
|
||||
.It mips64el Ta 8 Ta 8 Ta 8
|
||||
.It mips64elhf Ta 8 Ta 8 Ta 8
|
||||
.It mips64hf Ta 8 Ta 8 Ta 8
|
||||
.It powerpc Ta 4 Ta 8 Ta 4
|
||||
.It powerpcspe Ta 4 Ta 8 Ta 4
|
||||
.It powerpc Ta 4 Ta 8 Ta 8
|
||||
.It powerpcspe Ta 4 Ta 8 Ta 8
|
||||
.It powerpc64 Ta 8 Ta 8 Ta 8
|
||||
.It riscv64 Ta 8 Ta 16 Ta 8
|
||||
.It riscv64sf Ta 8 Ta 16 Ta 8
|
||||
|
@ -33,6 +33,7 @@ FILES= \
|
||||
bsd.kmod.mk \
|
||||
bsd.lib.mk \
|
||||
bsd.libnames.mk \
|
||||
bsd.linker.mk \
|
||||
bsd.links.mk \
|
||||
bsd.man.mk \
|
||||
bsd.mkopt.mk \
|
||||
|
@ -9,7 +9,7 @@
|
||||
#
|
||||
# COMPILER_VERSION is a numeric constant equal to:
|
||||
# major * 10000 + minor * 100 + tiny
|
||||
# It too can be overriden on the command line. When testing it, be sure to
|
||||
# It too can be overridden on the command line. When testing it, be sure to
|
||||
# make sure that you are limiting the test to a specific compiler. Testing
|
||||
# against 30300 for gcc likely isn't what you wanted (since versions of gcc
|
||||
# prior to 4.2 likely have no prayer of working).
|
||||
@ -194,4 +194,5 @@ ${var}.${${X_}_cc_hash}:= ${${var}}
|
||||
.endif # ${cc} == "CC" || !empty(XCC)
|
||||
.endfor # .for cc in CC XCC
|
||||
|
||||
.include <bsd.linker.mk>
|
||||
.endif # !target(__<bsd.compiler.mk>__)
|
||||
|
@ -86,11 +86,13 @@ _meta_filemon= 1
|
||||
# Skip reading .depend when not needed to speed up tree-walks and simple
|
||||
# lookups. See _SKIP_BUILD logic in bsd.init.mk for more details.
|
||||
# Also skip generating or including .depend.* files if in meta+filemon mode
|
||||
# since it will track dependencies itself. OBJS_DEPEND_GUESS is still used.
|
||||
.if defined(_SKIP_BUILD) || defined(_meta_filemon)
|
||||
_SKIP_READ_DEPEND= 1
|
||||
.if ${MK_DIRDEPS_BUILD} == "no" || make(analyze) || make(print-dir) || \
|
||||
make(obj) || make(clean*) || make(destroy*)
|
||||
# since it will track dependencies itself. OBJS_DEPEND_GUESS is still used
|
||||
# for _meta_filemon but not for _SKIP_DEPEND.
|
||||
.if defined(_SKIP_BUILD)
|
||||
_SKIP_DEPEND= 1
|
||||
.endif
|
||||
.if ${MK_DIRDEPS_BUILD} == "no"
|
||||
.if defined(_SKIP_DEPEND) || defined(_meta_filemon)
|
||||
.MAKE.DEPENDFILE= /dev/null
|
||||
.endif
|
||||
.endif
|
||||
@ -181,6 +183,15 @@ DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc}
|
||||
DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,}
|
||||
.endif
|
||||
DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./}
|
||||
.if defined(_SKIP_DEPEND)
|
||||
# Don't bother statting any .meta files for .depend*
|
||||
${DEPENDOBJS}: .NOMETA
|
||||
${DEPENDFILE}: .NOMETA
|
||||
# Unset these to avoid looping/statting on them later.
|
||||
.undef DEPENDSRCS
|
||||
.undef DEPENDOBJS
|
||||
.undef DEPENDFILES_OBJS
|
||||
.endif # defined(_SKIP_DEPEND)
|
||||
DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}}
|
||||
DEPEND_CFLAGS+= -MT${.TARGET}
|
||||
.if !defined(_meta_filemon)
|
||||
@ -192,7 +203,6 @@ CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:}
|
||||
.else
|
||||
CFLAGS+= ${DEPEND_CFLAGS}
|
||||
.endif
|
||||
.if !defined(_SKIP_READ_DEPEND)
|
||||
.for __depend_obj in ${DEPENDFILES_OBJS}
|
||||
.if ${MAKE_VERSION} < 20160220
|
||||
.sinclude "${.OBJDIR}/${__depend_obj}"
|
||||
@ -200,7 +210,6 @@ CFLAGS+= ${DEPEND_CFLAGS}
|
||||
.dinclude "${.OBJDIR}/${__depend_obj}"
|
||||
.endif
|
||||
.endfor
|
||||
.endif # !defined(_SKIP_READ_DEPEND)
|
||||
.endif # !defined(_meta_filemon)
|
||||
.endif # defined(SRCS)
|
||||
|
||||
@ -267,12 +276,14 @@ DPSRCS+= ${SRCS}
|
||||
# targets are kept as they be used for generating something. The target is
|
||||
# kept to allow 'make depend' to generate files.
|
||||
${DEPENDFILE}: ${DPSRCS}
|
||||
.if !defined(_SKIP_DEPEND)
|
||||
.if exists(${.OBJDIR}/${DEPENDFILE}) || \
|
||||
((commands(beforedepend) || \
|
||||
(!defined(_meta_filemon) && commands(_EXTRADEPEND)) || \
|
||||
commands(afterdepend)) && !empty(.MAKE.MODE:Mmeta))
|
||||
rm -f ${DEPENDFILE}
|
||||
.endif
|
||||
.endif
|
||||
.if !defined(_meta_filemon) && target(_EXTRADEPEND)
|
||||
_EXTRADEPEND: .USE
|
||||
${DEPENDFILE}: _EXTRADEPEND
|
||||
|
@ -50,8 +50,9 @@ $xGRP= ${_gid}
|
||||
_SKIP_BUILD= not building at level 0
|
||||
.elif !empty(.MAKEFLAGS:M-V${_V_DO_BUILD}) || \
|
||||
${.TARGETS:M*install*} == ${.TARGETS} || \
|
||||
make(clean*) || make(obj) || make(analyze) || make(print-dir) || \
|
||||
make(destroy*)
|
||||
${.TARGETS:Mclean*} == ${.TARGETS} || \
|
||||
${.TARGETS:Mdestroy*} == ${.TARGETS} || \
|
||||
make(obj) || make(analyze) || make(print-dir)
|
||||
# Skip building, but don't show a warning.
|
||||
_SKIP_BUILD=
|
||||
.endif
|
||||
|
@ -8,166 +8,168 @@
|
||||
.error bsd.libnames.mk cannot be included directly.
|
||||
.endif
|
||||
|
||||
LIBDESTDIR= ${SYSROOT:U${DESTDIR}}
|
||||
|
||||
.sinclude <src.libnames.mk>
|
||||
|
||||
# Src directory locations are also defined in src.libnames.mk.
|
||||
|
||||
LIBCRT0?= ${DESTDIR}${LIBDIR}/crt0.o
|
||||
LIBCRT0?= ${LIBDESTDIR}${LIBDIR_BASE}/crt0.o
|
||||
|
||||
LIB80211?= ${DESTDIR}${LIBDIR}/lib80211.a
|
||||
LIBALIAS?= ${DESTDIR}${LIBDIR}/libalias.a
|
||||
LIBARCHIVE?= ${DESTDIR}${LIBDIR}/libarchive.a
|
||||
LIBASN1?= ${DESTDIR}${LIBDIR}/libasn1.a
|
||||
LIBATM?= ${DESTDIR}${LIBDIR}/libatm.a
|
||||
LIBAUDITD?= ${DESTDIR}${LIBDIR}/libauditd.a
|
||||
LIBAVL?= ${DESTDIR}${LIBDIR}/libavl.a
|
||||
LIBBEGEMOT?= ${DESTDIR}${LIBDIR}/libbegemot.a
|
||||
LIBBLACKLIST?= ${DESTDIR}${LIBDIR}/libblacklist.a
|
||||
LIBBLUETOOTH?= ${DESTDIR}${LIBDIR}/libbluetooth.a
|
||||
LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxml.a
|
||||
LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a
|
||||
LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a
|
||||
LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a
|
||||
LIBC?= ${DESTDIR}${LIBDIR}/libc.a
|
||||
LIBCALENDAR?= ${DESTDIR}${LIBDIR}/libcalendar.a
|
||||
LIBCAM?= ${DESTDIR}${LIBDIR}/libcam.a
|
||||
LIBCAP_DNS?= ${DESTDIR}${LIBDIR}/libcap_dns.a
|
||||
LIBCAP_GRP?= ${DESTDIR}${LIBDIR}/libcap_grp.a
|
||||
LIBCAP_PWD?= ${DESTDIR}${LIBDIR}/libcap_pwd.a
|
||||
LIBCAP_RANDOM?= ${DESTDIR}${LIBDIR}/libcap_random.a
|
||||
LIBCAP_SYSCTL?= ${DESTDIR}${LIBDIR}/libcap_sysctl.a
|
||||
LIBCASPER?= ${DESTDIR}${LIBDIR}/libcasper.a
|
||||
LIBCOMPAT?= ${DESTDIR}${LIBDIR}/libcompat.a
|
||||
LIBCOMPILER_RT?=${DESTDIR}${LIBDIR}/libcompiler_rt.a
|
||||
LIBCOM_ERR?= ${DESTDIR}${LIBDIR}/libcom_err.a
|
||||
LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a
|
||||
LIBCRYPT?= ${DESTDIR}${LIBDIR}/libcrypt.a
|
||||
LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypto.a
|
||||
LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a
|
||||
LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a
|
||||
LIBCUSE?= ${DESTDIR}${LIBDIR}/libcuse.a
|
||||
LIBCXGB4?= ${DESTDIR}${LIBDIR}/libcxgb4.a
|
||||
LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a
|
||||
LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a
|
||||
LIBDEVCTL?= ${DESTDIR}${LIBDIR}/libdevctl.a
|
||||
LIBDEVDCTL?= ${DESTDIR}${LIBDIR}/libdevdctl.a
|
||||
LIBDEVINFO?= ${DESTDIR}${LIBDIR}/libdevinfo.a
|
||||
LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a
|
||||
LIBDIALOG?= ${DESTDIR}${LIBDIR}/libdialog.a
|
||||
LIBDNS?= ${DESTDIR}${LIBDIR}/libdns.a
|
||||
LIBDPV?= ${DESTDIR}${LIBDIR}/libdpv.a
|
||||
LIBDTRACE?= ${DESTDIR}${LIBDIR}/libdtrace.a
|
||||
LIBDWARF?= ${DESTDIR}${LIBDIR}/libdwarf.a
|
||||
LIBEDIT?= ${DESTDIR}${LIBDIR}/libedit.a
|
||||
LIBEFIVAR?= ${DESTDIR}${LIBDIR}/libefivar.a
|
||||
LIBELF?= ${DESTDIR}${LIBDIR}/libelf.a
|
||||
LIBEXECINFO?= ${DESTDIR}${LIBDIR}/libexecinfo.a
|
||||
LIBFETCH?= ${DESTDIR}${LIBDIR}/libfetch.a
|
||||
LIBFIGPAR?= ${DESTDIR}${LIBDIR}/libfigpar.a
|
||||
LIB80211?= ${LIBDESTDIR}${LIBDIR_BASE}/lib80211.a
|
||||
LIBALIAS?= ${LIBDESTDIR}${LIBDIR_BASE}/libalias.a
|
||||
LIBARCHIVE?= ${LIBDESTDIR}${LIBDIR_BASE}/libarchive.a
|
||||
LIBASN1?= ${LIBDESTDIR}${LIBDIR_BASE}/libasn1.a
|
||||
LIBATM?= ${LIBDESTDIR}${LIBDIR_BASE}/libatm.a
|
||||
LIBAUDITD?= ${LIBDESTDIR}${LIBDIR_BASE}/libauditd.a
|
||||
LIBAVL?= ${LIBDESTDIR}${LIBDIR_BASE}/libavl.a
|
||||
LIBBEGEMOT?= ${LIBDESTDIR}${LIBDIR_BASE}/libbegemot.a
|
||||
LIBBLACKLIST?= ${LIBDESTDIR}${LIBDIR_BASE}/libblacklist.a
|
||||
LIBBLUETOOTH?= ${LIBDESTDIR}${LIBDIR_BASE}/libbluetooth.a
|
||||
LIBBSDXML?= ${LIBDESTDIR}${LIBDIR_BASE}/libbsdxml.a
|
||||
LIBBSM?= ${LIBDESTDIR}${LIBDIR_BASE}/libbsm.a
|
||||
LIBBSNMP?= ${LIBDESTDIR}${LIBDIR_BASE}/libbsnmp.a
|
||||
LIBBZ2?= ${LIBDESTDIR}${LIBDIR_BASE}/libbz2.a
|
||||
LIBC?= ${LIBDESTDIR}${LIBDIR_BASE}/libc.a
|
||||
LIBCALENDAR?= ${LIBDESTDIR}${LIBDIR_BASE}/libcalendar.a
|
||||
LIBCAM?= ${LIBDESTDIR}${LIBDIR_BASE}/libcam.a
|
||||
LIBCAP_DNS?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_dns.a
|
||||
LIBCAP_GRP?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_grp.a
|
||||
LIBCAP_PWD?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_pwd.a
|
||||
LIBCAP_RANDOM?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_random.a
|
||||
LIBCAP_SYSCTL?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_sysctl.a
|
||||
LIBCASPER?= ${LIBDESTDIR}${LIBDIR_BASE}/libcasper.a
|
||||
LIBCOMPAT?= ${LIBDESTDIR}${LIBDIR_BASE}/libcompat.a
|
||||
LIBCOMPILER_RT?=${LIBDESTDIR}${LIBDIR_BASE}/libcompiler_rt.a
|
||||
LIBCOM_ERR?= ${LIBDESTDIR}${LIBDIR_BASE}/libcom_err.a
|
||||
LIBCPLUSPLUS?= ${LIBDESTDIR}${LIBDIR_BASE}/libc++.a
|
||||
LIBCRYPT?= ${LIBDESTDIR}${LIBDIR_BASE}/libcrypt.a
|
||||
LIBCRYPTO?= ${LIBDESTDIR}${LIBDIR_BASE}/libcrypto.a
|
||||
LIBCTF?= ${LIBDESTDIR}${LIBDIR_BASE}/libctf.a
|
||||
LIBCURSES?= ${LIBDESTDIR}${LIBDIR_BASE}/libcurses.a
|
||||
LIBCUSE?= ${LIBDESTDIR}${LIBDIR_BASE}/libcuse.a
|
||||
LIBCXGB4?= ${LIBDESTDIR}${LIBDIR_BASE}/libcxgb4.a
|
||||
LIBCXXRT?= ${LIBDESTDIR}${LIBDIR_BASE}/libcxxrt.a
|
||||
LIBC_PIC?= ${LIBDESTDIR}${LIBDIR_BASE}/libc_pic.a
|
||||
LIBDEVCTL?= ${LIBDESTDIR}${LIBDIR_BASE}/libdevctl.a
|
||||
LIBDEVDCTL?= ${LIBDESTDIR}${LIBDIR_BASE}/libdevdctl.a
|
||||
LIBDEVINFO?= ${LIBDESTDIR}${LIBDIR_BASE}/libdevinfo.a
|
||||
LIBDEVSTAT?= ${LIBDESTDIR}${LIBDIR_BASE}/libdevstat.a
|
||||
LIBDIALOG?= ${LIBDESTDIR}${LIBDIR_BASE}/libdialog.a
|
||||
LIBDNS?= ${LIBDESTDIR}${LIBDIR_BASE}/libdns.a
|
||||
LIBDPV?= ${LIBDESTDIR}${LIBDIR_BASE}/libdpv.a
|
||||
LIBDTRACE?= ${LIBDESTDIR}${LIBDIR_BASE}/libdtrace.a
|
||||
LIBDWARF?= ${LIBDESTDIR}${LIBDIR_BASE}/libdwarf.a
|
||||
LIBEDIT?= ${LIBDESTDIR}${LIBDIR_BASE}/libedit.a
|
||||
LIBEFIVAR?= ${LIBDESTDIR}${LIBDIR_BASE}/libefivar.a
|
||||
LIBELF?= ${LIBDESTDIR}${LIBDIR_BASE}/libelf.a
|
||||
LIBEXECINFO?= ${LIBDESTDIR}${LIBDIR_BASE}/libexecinfo.a
|
||||
LIBFETCH?= ${LIBDESTDIR}${LIBDIR_BASE}/libfetch.a
|
||||
LIBFIGPAR?= ${LIBDESTDIR}${LIBDIR_BASE}/libfigpar.a
|
||||
LIBFL?= "don't use LIBFL, use LIBL"
|
||||
LIBFORM?= ${DESTDIR}${LIBDIR}/libform.a
|
||||
LIBG2C?= ${DESTDIR}${LIBDIR}/libg2c.a
|
||||
LIBGEOM?= ${DESTDIR}${LIBDIR}/libgeom.a
|
||||
LIBGNUREGEX?= ${DESTDIR}${LIBDIR}/libgnuregex.a
|
||||
LIBGPIO?= ${DESTDIR}${LIBDIR}/libgpio.a
|
||||
LIBGSSAPI?= ${DESTDIR}${LIBDIR}/libgssapi.a
|
||||
LIBGSSAPI_KRB5?= ${DESTDIR}${LIBDIR}/libgssapi_krb5.a
|
||||
LIBHDB?= ${DESTDIR}${LIBDIR}/libhdb.a
|
||||
LIBHEIMBASE?= ${DESTDIR}${LIBDIR}/libheimbase.a
|
||||
LIBHEIMNTLM?= ${DESTDIR}${LIBDIR}/libheimntlm.a
|
||||
LIBHEIMSQLITE?= ${DESTDIR}${LIBDIR}/libheimsqlite.a
|
||||
LIBHX509?= ${DESTDIR}${LIBDIR}/libhx509.a
|
||||
LIBIBCM?= ${DESTDIR}${LIBDIR}/libibcm.a
|
||||
LIBIBCOMMON?= ${DESTDIR}${LIBDIR}/libibcommon.a
|
||||
LIBIBMAD?= ${DESTDIR}${LIBDIR}/libibmad.a
|
||||
LIBIBSDP?= ${DESTDIR}${LIBDIR}/libibsdp.a
|
||||
LIBIBUMAD?= ${DESTDIR}${LIBDIR}/libibumad.a
|
||||
LIBIBVERBS?= ${DESTDIR}${LIBDIR}/libibverbs.a
|
||||
LIBIFCONFIG?= ${DESTDIR}${LIBDIR}/libifconfig.a
|
||||
LIBIPSEC?= ${DESTDIR}${LIBDIR}/libipsec.a
|
||||
LIBJAIL?= ${DESTDIR}${LIBDIR}/libjail.a
|
||||
LIBKADM5CLNT?= ${DESTDIR}${LIBDIR}/libkadm5clnt.a
|
||||
LIBKADM5SRV?= ${DESTDIR}${LIBDIR}/libkadm5srv.a
|
||||
LIBKAFS5?= ${DESTDIR}${LIBDIR}/libkafs5.a
|
||||
LIBKDC?= ${DESTDIR}${LIBDIR}/libkdc.a
|
||||
LIBKEYCAP?= ${DESTDIR}${LIBDIR}/libkeycap.a
|
||||
LIBKICONV?= ${DESTDIR}${LIBDIR}/libkiconv.a
|
||||
LIBKRB5?= ${DESTDIR}${LIBDIR}/libkrb5.a
|
||||
LIBKVM?= ${DESTDIR}${LIBDIR}/libkvm.a
|
||||
LIBL?= ${DESTDIR}${LIBDIR}/libl.a
|
||||
LIBFORM?= ${LIBDESTDIR}${LIBDIR_BASE}/libform.a
|
||||
LIBG2C?= ${LIBDESTDIR}${LIBDIR_BASE}/libg2c.a
|
||||
LIBGEOM?= ${LIBDESTDIR}${LIBDIR_BASE}/libgeom.a
|
||||
LIBGNUREGEX?= ${LIBDESTDIR}${LIBDIR_BASE}/libgnuregex.a
|
||||
LIBGPIO?= ${LIBDESTDIR}${LIBDIR_BASE}/libgpio.a
|
||||
LIBGSSAPI?= ${LIBDESTDIR}${LIBDIR_BASE}/libgssapi.a
|
||||
LIBGSSAPI_KRB5?= ${LIBDESTDIR}${LIBDIR_BASE}/libgssapi_krb5.a
|
||||
LIBHDB?= ${LIBDESTDIR}${LIBDIR_BASE}/libhdb.a
|
||||
LIBHEIMBASE?= ${LIBDESTDIR}${LIBDIR_BASE}/libheimbase.a
|
||||
LIBHEIMNTLM?= ${LIBDESTDIR}${LIBDIR_BASE}/libheimntlm.a
|
||||
LIBHEIMSQLITE?= ${LIBDESTDIR}${LIBDIR_BASE}/libheimsqlite.a
|
||||
LIBHX509?= ${LIBDESTDIR}${LIBDIR_BASE}/libhx509.a
|
||||
LIBIBCM?= ${LIBDESTDIR}${LIBDIR_BASE}/libibcm.a
|
||||
LIBIBCOMMON?= ${LIBDESTDIR}${LIBDIR_BASE}/libibcommon.a
|
||||
LIBIBMAD?= ${LIBDESTDIR}${LIBDIR_BASE}/libibmad.a
|
||||
LIBIBSDP?= ${LIBDESTDIR}${LIBDIR_BASE}/libibsdp.a
|
||||
LIBIBUMAD?= ${LIBDESTDIR}${LIBDIR_BASE}/libibumad.a
|
||||
LIBIBVERBS?= ${LIBDESTDIR}${LIBDIR_BASE}/libibverbs.a
|
||||
LIBIFCONFIG?= ${LIBDESTDIR}${LIBDIR_BASE}/libifconfig.a
|
||||
LIBIPSEC?= ${LIBDESTDIR}${LIBDIR_BASE}/libipsec.a
|
||||
LIBJAIL?= ${LIBDESTDIR}${LIBDIR_BASE}/libjail.a
|
||||
LIBKADM5CLNT?= ${LIBDESTDIR}${LIBDIR_BASE}/libkadm5clnt.a
|
||||
LIBKADM5SRV?= ${LIBDESTDIR}${LIBDIR_BASE}/libkadm5srv.a
|
||||
LIBKAFS5?= ${LIBDESTDIR}${LIBDIR_BASE}/libkafs5.a
|
||||
LIBKDC?= ${LIBDESTDIR}${LIBDIR_BASE}/libkdc.a
|
||||
LIBKEYCAP?= ${LIBDESTDIR}${LIBDIR_BASE}/libkeycap.a
|
||||
LIBKICONV?= ${LIBDESTDIR}${LIBDIR_BASE}/libkiconv.a
|
||||
LIBKRB5?= ${LIBDESTDIR}${LIBDIR_BASE}/libkrb5.a
|
||||
LIBKVM?= ${LIBDESTDIR}${LIBDIR_BASE}/libkvm.a
|
||||
LIBL?= ${LIBDESTDIR}${LIBDIR_BASE}/libl.a
|
||||
LIBLN?= "don't use LIBLN, use LIBL"
|
||||
LIBLZMA?= ${DESTDIR}${LIBDIR}/liblzma.a
|
||||
LIBM?= ${DESTDIR}${LIBDIR}/libm.a
|
||||
LIBMAGIC?= ${DESTDIR}${LIBDIR}/libmagic.a
|
||||
LIBMD?= ${DESTDIR}${LIBDIR}/libmd.a
|
||||
LIBMEMSTAT?= ${DESTDIR}${LIBDIR}/libmemstat.a
|
||||
LIBMENU?= ${DESTDIR}${LIBDIR}/libmenu.a
|
||||
LIBMILTER?= ${DESTDIR}${LIBDIR}/libmilter.a
|
||||
LIBMLX4?= ${DESTDIR}${LIBDIR}/libmlx4.a
|
||||
LIBMP?= ${DESTDIR}${LIBDIR}/libmp.a
|
||||
LIBMT?= ${DESTDIR}${LIBDIR}/libmt.a
|
||||
LIBMTHCA?= ${DESTDIR}${LIBDIR}/libmthca.a
|
||||
LIBNANDFS?= ${DESTDIR}${LIBDIR}/libnandfs.a
|
||||
LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncurses.a
|
||||
LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a
|
||||
LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnetgraph.a
|
||||
LIBNGATM?= ${DESTDIR}${LIBDIR}/libngatm.a
|
||||
LIBNV?= ${DESTDIR}${LIBDIR}/libnv.a
|
||||
LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpair.a
|
||||
LIBOPENSM?= ${DESTDIR}${LIBDIR}/libopensm.a
|
||||
LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a
|
||||
LIBOSMCOMP?= ${DESTDIR}${LIBDIR}/libosmcomp.a
|
||||
LIBOSMVENDOR?= ${DESTDIR}${LIBDIR}/libosmvendor.a
|
||||
LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a
|
||||
LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel.a
|
||||
LIBPANELW?= ${DESTDIR}${LIBDIR}/libpanelw.a
|
||||
LIBPCAP?= ${DESTDIR}${LIBDIR}/libpcap.a
|
||||
LIBPJDLOG?= ${DESTDIR}${LIBDIR}/libpjdlog.a
|
||||
LIBPMC?= ${DESTDIR}${LIBDIR}/libpmc.a
|
||||
LIBPROC?= ${DESTDIR}${LIBDIR}/libproc.a
|
||||
LIBPROCSTAT?= ${DESTDIR}${LIBDIR}/libprocstat.a
|
||||
LIBPTHREAD?= ${DESTDIR}${LIBDIR}/libpthread.a
|
||||
LIBRADIUS?= ${DESTDIR}${LIBDIR}/libradius.a
|
||||
LIBRDMACM?= ${DESTDIR}${LIBDIR}/librdmacm.a
|
||||
LIBROKEN?= ${DESTDIR}${LIBDIR}/libroken.a
|
||||
LIBRPCSEC_GSS?= ${DESTDIR}${LIBDIR}/librpcsec_gss.a
|
||||
LIBRPCSVC?= ${DESTDIR}${LIBDIR}/librpcsvc.a
|
||||
LIBRT?= ${DESTDIR}${LIBDIR}/librt.a
|
||||
LIBRTLD_DB?= ${DESTDIR}${LIBDIR}/librtld_db.a
|
||||
LIBSBUF?= ${DESTDIR}${LIBDIR}/libsbuf.a
|
||||
LIBSDP?= ${DESTDIR}${LIBDIR}/libsdp.a
|
||||
LIBSMB?= ${DESTDIR}${LIBDIR}/libsmb.a
|
||||
LIBSSL?= ${DESTDIR}${LIBDIR}/libssl.a
|
||||
LIBSSP_NONSHARED?= ${DESTDIR}${LIBDIR}/libssp_nonshared.a
|
||||
LIBSTAND?= ${DESTDIR}${LIBDIR}/libstand.a
|
||||
LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libstdc++.a
|
||||
LIBSTDTHREADS?= ${DESTDIR}${LIBDIR}/libstdthreads.a
|
||||
LIBSYSDECODE?= ${DESTDIR}${LIBDIR}/libsysdecode.a
|
||||
LIBTACPLUS?= ${DESTDIR}${LIBDIR}/libtacplus.a
|
||||
LIBTERMCAP?= ${DESTDIR}${LIBDIR}/libtermcap.a
|
||||
LIBTERMCAPW?= ${DESTDIR}${LIBDIR}/libtermcapw.a
|
||||
LIBLZMA?= ${LIBDESTDIR}${LIBDIR_BASE}/liblzma.a
|
||||
LIBM?= ${LIBDESTDIR}${LIBDIR_BASE}/libm.a
|
||||
LIBMAGIC?= ${LIBDESTDIR}${LIBDIR_BASE}/libmagic.a
|
||||
LIBMD?= ${LIBDESTDIR}${LIBDIR_BASE}/libmd.a
|
||||
LIBMEMSTAT?= ${LIBDESTDIR}${LIBDIR_BASE}/libmemstat.a
|
||||
LIBMENU?= ${LIBDESTDIR}${LIBDIR_BASE}/libmenu.a
|
||||
LIBMILTER?= ${LIBDESTDIR}${LIBDIR_BASE}/libmilter.a
|
||||
LIBMLX4?= ${LIBDESTDIR}${LIBDIR_BASE}/libmlx4.a
|
||||
LIBMP?= ${LIBDESTDIR}${LIBDIR_BASE}/libmp.a
|
||||
LIBMT?= ${LIBDESTDIR}${LIBDIR_BASE}/libmt.a
|
||||
LIBMTHCA?= ${LIBDESTDIR}${LIBDIR_BASE}/libmthca.a
|
||||
LIBNANDFS?= ${LIBDESTDIR}${LIBDIR_BASE}/libnandfs.a
|
||||
LIBNCURSES?= ${LIBDESTDIR}${LIBDIR_BASE}/libncurses.a
|
||||
LIBNCURSESW?= ${LIBDESTDIR}${LIBDIR_BASE}/libncursesw.a
|
||||
LIBNETGRAPH?= ${LIBDESTDIR}${LIBDIR_BASE}/libnetgraph.a
|
||||
LIBNGATM?= ${LIBDESTDIR}${LIBDIR_BASE}/libngatm.a
|
||||
LIBNV?= ${LIBDESTDIR}${LIBDIR_BASE}/libnv.a
|
||||
LIBNVPAIR?= ${LIBDESTDIR}${LIBDIR_BASE}/libnvpair.a
|
||||
LIBOPENSM?= ${LIBDESTDIR}${LIBDIR_BASE}/libopensm.a
|
||||
LIBOPIE?= ${LIBDESTDIR}${LIBDIR_BASE}/libopie.a
|
||||
LIBOSMCOMP?= ${LIBDESTDIR}${LIBDIR_BASE}/libosmcomp.a
|
||||
LIBOSMVENDOR?= ${LIBDESTDIR}${LIBDIR_BASE}/libosmvendor.a
|
||||
LIBPAM?= ${LIBDESTDIR}${LIBDIR_BASE}/libpam.a
|
||||
LIBPANEL?= ${LIBDESTDIR}${LIBDIR_BASE}/libpanel.a
|
||||
LIBPANELW?= ${LIBDESTDIR}${LIBDIR_BASE}/libpanelw.a
|
||||
LIBPCAP?= ${LIBDESTDIR}${LIBDIR_BASE}/libpcap.a
|
||||
LIBPJDLOG?= ${LIBDESTDIR}${LIBDIR_BASE}/libpjdlog.a
|
||||
LIBPMC?= ${LIBDESTDIR}${LIBDIR_BASE}/libpmc.a
|
||||
LIBPROC?= ${LIBDESTDIR}${LIBDIR_BASE}/libproc.a
|
||||
LIBPROCSTAT?= ${LIBDESTDIR}${LIBDIR_BASE}/libprocstat.a
|
||||
LIBPTHREAD?= ${LIBDESTDIR}${LIBDIR_BASE}/libpthread.a
|
||||
LIBRADIUS?= ${LIBDESTDIR}${LIBDIR_BASE}/libradius.a
|
||||
LIBRDMACM?= ${LIBDESTDIR}${LIBDIR_BASE}/librdmacm.a
|
||||
LIBROKEN?= ${LIBDESTDIR}${LIBDIR_BASE}/libroken.a
|
||||
LIBRPCSEC_GSS?= ${LIBDESTDIR}${LIBDIR_BASE}/librpcsec_gss.a
|
||||
LIBRPCSVC?= ${LIBDESTDIR}${LIBDIR_BASE}/librpcsvc.a
|
||||
LIBRT?= ${LIBDESTDIR}${LIBDIR_BASE}/librt.a
|
||||
LIBRTLD_DB?= ${LIBDESTDIR}${LIBDIR_BASE}/librtld_db.a
|
||||
LIBSBUF?= ${LIBDESTDIR}${LIBDIR_BASE}/libsbuf.a
|
||||
LIBSDP?= ${LIBDESTDIR}${LIBDIR_BASE}/libsdp.a
|
||||
LIBSMB?= ${LIBDESTDIR}${LIBDIR_BASE}/libsmb.a
|
||||
LIBSSL?= ${LIBDESTDIR}${LIBDIR_BASE}/libssl.a
|
||||
LIBSSP_NONSHARED?= ${LIBDESTDIR}${LIBDIR_BASE}/libssp_nonshared.a
|
||||
LIBSTAND?= ${LIBDESTDIR}${LIBDIR_BASE}/libstand.a
|
||||
LIBSTDCPLUSPLUS?= ${LIBDESTDIR}${LIBDIR_BASE}/libstdc++.a
|
||||
LIBSTDTHREADS?= ${LIBDESTDIR}${LIBDIR_BASE}/libstdthreads.a
|
||||
LIBSYSDECODE?= ${LIBDESTDIR}${LIBDIR_BASE}/libsysdecode.a
|
||||
LIBTACPLUS?= ${LIBDESTDIR}${LIBDIR_BASE}/libtacplus.a
|
||||
LIBTERMCAP?= ${LIBDESTDIR}${LIBDIR_BASE}/libtermcap.a
|
||||
LIBTERMCAPW?= ${LIBDESTDIR}${LIBDIR_BASE}/libtermcapw.a
|
||||
LIBTERMLIB?= "don't use LIBTERMLIB, use LIBTERMCAP"
|
||||
LIBTINFO?= "don't use LIBTINFO, use LIBNCURSES"
|
||||
LIBUFS?= ${DESTDIR}${LIBDIR}/libufs.a
|
||||
LIBUGIDFW?= ${DESTDIR}${LIBDIR}/libugidfw.a
|
||||
LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a
|
||||
LIBUMEM?= ${DESTDIR}${LIBDIR}/libumem.a
|
||||
LIBUSB?= ${DESTDIR}${LIBDIR}/libusb.a
|
||||
LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a
|
||||
LIBUTIL?= ${DESTDIR}${LIBDIR}/libutil.a
|
||||
LIBUUTIL?= ${DESTDIR}${LIBDIR}/libuutil.a
|
||||
LIBVGL?= ${DESTDIR}${LIBDIR}/libvgl.a
|
||||
LIBVMMAPI?= ${DESTDIR}${LIBDIR}/libvmmapi.a
|
||||
LIBWIND?= ${DESTDIR}${LIBDIR}/libwind.a
|
||||
LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a
|
||||
LIBXO?= ${DESTDIR}${LIBDIR}/libxo.a
|
||||
LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a
|
||||
LIBY?= ${DESTDIR}${LIBDIR}/liby.a
|
||||
LIBYPCLNT?= ${DESTDIR}${LIBDIR}/libypclnt.a
|
||||
LIBZ?= ${DESTDIR}${LIBDIR}/libz.a
|
||||
LIBZFS?= ${DESTDIR}${LIBDIR}/libzfs.a
|
||||
LIBZFS_CORE?= ${DESTDIR}${LIBDIR}/libzfs_core.a
|
||||
LIBZPOOL?= ${DESTDIR}${LIBDIR}/libzpool.a
|
||||
LIBUFS?= ${LIBDESTDIR}${LIBDIR_BASE}/libufs.a
|
||||
LIBUGIDFW?= ${LIBDESTDIR}${LIBDIR_BASE}/libugidfw.a
|
||||
LIBULOG?= ${LIBDESTDIR}${LIBDIR_BASE}/libulog.a
|
||||
LIBUMEM?= ${LIBDESTDIR}${LIBDIR_BASE}/libumem.a
|
||||
LIBUSB?= ${LIBDESTDIR}${LIBDIR_BASE}/libusb.a
|
||||
LIBUSBHID?= ${LIBDESTDIR}${LIBDIR_BASE}/libusbhid.a
|
||||
LIBUTIL?= ${LIBDESTDIR}${LIBDIR_BASE}/libutil.a
|
||||
LIBUUTIL?= ${LIBDESTDIR}${LIBDIR_BASE}/libuutil.a
|
||||
LIBVGL?= ${LIBDESTDIR}${LIBDIR_BASE}/libvgl.a
|
||||
LIBVMMAPI?= ${LIBDESTDIR}${LIBDIR_BASE}/libvmmapi.a
|
||||
LIBWIND?= ${LIBDESTDIR}${LIBDIR_BASE}/libwind.a
|
||||
LIBWRAP?= ${LIBDESTDIR}${LIBDIR_BASE}/libwrap.a
|
||||
LIBXO?= ${LIBDESTDIR}${LIBDIR_BASE}/libxo.a
|
||||
LIBXPG4?= ${LIBDESTDIR}${LIBDIR_BASE}/libxpg4.a
|
||||
LIBY?= ${LIBDESTDIR}${LIBDIR_BASE}/liby.a
|
||||
LIBYPCLNT?= ${LIBDESTDIR}${LIBDIR_BASE}/libypclnt.a
|
||||
LIBZ?= ${LIBDESTDIR}${LIBDIR_BASE}/libz.a
|
||||
LIBZFS?= ${LIBDESTDIR}${LIBDIR_BASE}/libzfs.a
|
||||
LIBZFS_CORE?= ${LIBDESTDIR}${LIBDIR_BASE}/libzfs_core.a
|
||||
LIBZPOOL?= ${LIBDESTDIR}${LIBDIR_BASE}/libzpool.a
|
||||
|
||||
# enforce the 2 -lpthread and -lc to always be the last in that exact order
|
||||
.if defined(LDADD)
|
||||
@ -184,7 +186,7 @@ LDADD:= ${LDADD:N-lc} -lc
|
||||
.if defined(_LIBRARIES) && defined(LIB) && \
|
||||
${_LIBRARIES:M${LIB}} != ""
|
||||
.if !defined(LIB${LIB:tu})
|
||||
.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${DESTDIR}$${LIBDIR}/lib${LIB}.a
|
||||
.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${LIBDESTDIR}$${LIBDIR_BASE}/lib${LIB}.a
|
||||
.endif
|
||||
.endif
|
||||
|
||||
@ -192,4 +194,26 @@ LDADD:= ${LDADD:N-lc} -lc
|
||||
.for lib in ${_LIBRARIES}
|
||||
LIB${lib:tu}SRCDIR?= ${SRCTOP}/${LIB${lib:tu}DIR:S,^${OBJTOP}/,,}
|
||||
.endfor
|
||||
.else
|
||||
|
||||
# Out of tree builds
|
||||
|
||||
# There are LIBADD defined in an out-of-tree build. Are they *all*
|
||||
# in-tree libraries? If so convert them to LDADD to support
|
||||
# partial checkouts.
|
||||
.if !empty(LIBADD)
|
||||
_convert_libadd= 1
|
||||
.for l in ${LIBADD}
|
||||
.if empty(LIB${l:tu})
|
||||
_convert_libadd= 0
|
||||
.endif
|
||||
.endfor
|
||||
.if ${_convert_libadd} == 1
|
||||
.warning Converting out-of-tree build LIBADDs into LDADD. This is not fully supported.
|
||||
.for l in ${LIBADD}
|
||||
LDADD+= -l${l}
|
||||
.endfor
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.endif # defined(SRCTOP)
|
||||
|
91
share/mk/bsd.linker.mk
Normal file
91
share/mk/bsd.linker.mk
Normal file
@ -0,0 +1,91 @@
|
||||
# $FreeBSD$
|
||||
|
||||
# Setup variables for the linker.
|
||||
#
|
||||
# LINKER_TYPE is the major type of linker. Currently binutils and lld support
|
||||
# automatic detection.
|
||||
#
|
||||
# LINKER_VERSION is a numeric constant equal to:
|
||||
# major * 10000 + minor * 100 + tiny
|
||||
# It too can be overridden on the command line.
|
||||
#
|
||||
# LINKER_FEATURES may contain one or more of the following, based on
|
||||
# linker support for that feature:
|
||||
#
|
||||
# - build-id : support for generating a Build-ID note
|
||||
#
|
||||
# These variables with an X_ prefix will also be provided if XLD is set.
|
||||
#
|
||||
# This file may be included multiple times, but only has effect the first time.
|
||||
#
|
||||
|
||||
.if !target(__<bsd.linker.mk>__)
|
||||
__<bsd.linker.mk>__:
|
||||
|
||||
.for ld X_ in LD $${_empty_var_} XLD X_
|
||||
.if ${ld} == "LD" || !empty(XLD)
|
||||
# Try to import LINKER_TYPE and LINKER_VERSION from parent make.
|
||||
# The value is only used/exported for the same environment that impacts
|
||||
# LD and LINKER_* settings here.
|
||||
_exported_vars= ${X_}LINKER_TYPE ${X_}LINKER_VERSION ${X_}LINKER_FEATURES
|
||||
${X_}_ld_hash= ${${ld}}${MACHINE}${PATH}
|
||||
${X_}_ld_hash:= ${${X_}_ld_hash:hash}
|
||||
# Only import if none of the vars are set somehow else.
|
||||
_can_export= yes
|
||||
.for var in ${_exported_vars}
|
||||
.if defined(${var})
|
||||
_can_export= no
|
||||
.endif
|
||||
.endfor
|
||||
.if ${_can_export} == yes
|
||||
.for var in ${_exported_vars}
|
||||
.if defined(${var}.${${X_}_ld_hash})
|
||||
${var}= ${${var}.${${X_}_ld_hash}}
|
||||
.endif
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
.if ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD})
|
||||
.if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION)
|
||||
_ld_version!= ${${ld}} --version 2>/dev/null | head -n 1 || echo none
|
||||
.if ${_ld_version} == "none"
|
||||
.error Unable to determine linker type from ${ld}=${${ld}}
|
||||
.endif
|
||||
.if ${_ld_version:[1..2]} == "GNU ld"
|
||||
${X_}LINKER_TYPE= bfd
|
||||
_v= ${_ld_version:M[1-9].[0-9]*:[1]}
|
||||
.elif ${_ld_version:[1]} == "LLD"
|
||||
${X_}LINKER_TYPE= lld
|
||||
_v= ${_ld_version:[2]}
|
||||
.else
|
||||
.error Unknown linker from ${ld}=${${ld}}: ${_ld_version}
|
||||
.endif
|
||||
${X_}LINKER_VERSION!= echo "${_v:M[1-9].[0-9]*}" | \
|
||||
awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}'
|
||||
.undef _ld_version
|
||||
.undef _v
|
||||
${X_}LINKER_FEATURES=
|
||||
.if ${${X_}LINKER_TYPE} != "bfd" || ${${X_}LINKER_VERSION} > 21750
|
||||
${X_}LINKER_FEATURES+= build-id
|
||||
.endif
|
||||
.endif
|
||||
.else
|
||||
# Use LD's values
|
||||
X_LINKER_TYPE= ${LINKER_TYPE}
|
||||
X_LINKER_VERSION= ${LINKER_VERSION}
|
||||
X_LINKER_FEATURES= ${LINKER_FEATURES}
|
||||
.endif # ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD})
|
||||
|
||||
# Export the values so sub-makes don't have to look them up again, using the
|
||||
# hash key computed above.
|
||||
.for var in ${_exported_vars}
|
||||
${var}.${${X_}_ld_hash}:= ${${var}}
|
||||
.export-env ${var}.${${X_}_ld_hash}
|
||||
.undef ${var}.${${X_}_ld_hash}
|
||||
.endfor
|
||||
|
||||
.endif # ${ld} == "LD" || !empty(XLD)
|
||||
.endfor # .for ld in LD XLD
|
||||
|
||||
|
||||
.endif # !target(__<bsd.linker.mk>__)
|
@ -102,7 +102,7 @@ OBJTOP?= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP}
|
||||
# case 2 (using MAKEOBJDIR), don't issue a warning. Otherwise,
|
||||
# issue a warning differentiating between cases 6 and (3 or 4).
|
||||
#
|
||||
objwarn:
|
||||
objwarn: .PHONY
|
||||
.if !defined(NO_OBJ) && ${.OBJDIR} != ${CANONICALOBJDIR} && \
|
||||
!(defined(MAKEOBJDIRPREFIX) && exists(${CANONICALOBJDIR}/)) && \
|
||||
!(defined(MAKEOBJDIR) && exists(${MAKEOBJDIR}/))
|
||||
|
@ -152,7 +152,13 @@ DTBOWN?= root
|
||||
DTBGRP?= wheel
|
||||
DTBMODE?= 444
|
||||
|
||||
LIBDIR?= /usr/lib
|
||||
# Use make.conf / environment LIBDIR as default if set...
|
||||
.if !empty(_PREMK_LIBDIR)
|
||||
LIBDIR_BASE?= ${_PREMK_LIBDIR}
|
||||
.endif
|
||||
# otherwise use our expected default value.
|
||||
LIBDIR_BASE?= /usr/lib
|
||||
LIBDIR?= ${LIBDIR_BASE}
|
||||
LIBCOMPATDIR?= /usr/lib/compat
|
||||
LIBDATADIR?= /usr/libdata
|
||||
LIBEXECDIR?= /usr/libexec
|
||||
|
@ -53,7 +53,7 @@ STANDALONE_SUBDIR_TARGETS+= \
|
||||
maninstall manlint obj objlink
|
||||
|
||||
# It is safe to install in parallel when staging.
|
||||
.if defined(NO_ROOT)
|
||||
.if defined(NO_ROOT) || !empty(SYSROOT)
|
||||
STANDALONE_SUBDIR_TARGETS+= realinstall
|
||||
.endif
|
||||
|
||||
|
@ -42,6 +42,10 @@ MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFILES .PATH
|
||||
OBJTOP?= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP}
|
||||
.endif
|
||||
|
||||
.if !empty(LIBDIR)
|
||||
_PREMK_LIBDIR:= ${LIBDIR}
|
||||
.endif
|
||||
|
||||
.include "src.sys.mk"
|
||||
|
||||
.if ${.MAKE.MODE:Mmeta*} != ""
|
||||
|
@ -343,13 +343,13 @@ _DP_rdmacm= ibverbs
|
||||
|
||||
# Define special cases
|
||||
LDADD_supcplusplus= -lsupc++
|
||||
LIBATF_C= ${DESTDIR}${LIBDIR}/libprivateatf-c.a
|
||||
LIBATF_CXX= ${DESTDIR}${LIBDIR}/libprivateatf-c++.a
|
||||
LIBATF_C= ${LIBDESTDIR}${LIBDIR_BASE}/libprivateatf-c.a
|
||||
LIBATF_CXX= ${LIBDESTDIR}${LIBDIR_BASE}/libprivateatf-c++.a
|
||||
LDADD_atf_c= -lprivateatf-c
|
||||
LDADD_atf_cxx= -lprivateatf-c++
|
||||
|
||||
.for _l in ${_PRIVATELIBS}
|
||||
LIB${_l:tu}?= ${DESTDIR}${LIBDIR}/libprivate${_l}.a
|
||||
LIB${_l:tu}?= ${LIBDESTDIR}${LIBDIR_BASE}/libprivate${_l}.a
|
||||
.endfor
|
||||
|
||||
.for _l in ${_LIBRARIES}
|
||||
|
@ -101,7 +101,6 @@ __DEFAULT_YES_OPTIONS = \
|
||||
GNU_DIFF \
|
||||
GNU_GREP \
|
||||
GPIO \
|
||||
GPL_DTC \
|
||||
HAST \
|
||||
HTML \
|
||||
HYPERV \
|
||||
@ -222,16 +221,16 @@ __TT=${MACHINE}
|
||||
${__T} == "amd64" || ${__TT} == "arm" || ${__T} == "i386")
|
||||
# Clang is enabled, and will be installed as the default /usr/bin/cc.
|
||||
__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC LLD
|
||||
__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX
|
||||
__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC
|
||||
.elif ${COMPILER_FEATURES:Mc++11} && ${__T} != "riscv64" && ${__T} != "sparc64"
|
||||
# If an external compiler that supports C++11 is used as ${CC} and Clang
|
||||
# supports the target, then Clang is enabled but GCC is installed as the
|
||||
# default /usr/bin/cc.
|
||||
__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL GCC GCC_BOOTSTRAP GNUCXX
|
||||
__DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC LLD
|
||||
__DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC GPL_DTC LLD
|
||||
.else
|
||||
# Everything else disables Clang, and uses GCC instead.
|
||||
__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX
|
||||
__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC
|
||||
__DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC LLD
|
||||
.endif
|
||||
# In-tree binutils/gcc are older versions without modern architecture support.
|
||||
|
@ -1,6 +1,7 @@
|
||||
# $FreeBSD$
|
||||
|
||||
FILES= gallant.fnt \
|
||||
terminus-b32.fnt \
|
||||
vgarom-8x8.fnt \
|
||||
vgarom-8x14.fnt \
|
||||
vgarom-8x16.fnt \
|
||||
|
1294
share/vt/fonts/terminus-b32.hex
Normal file
1294
share/vt/fonts/terminus-b32.hex
Normal file
File diff suppressed because it is too large
Load Diff
@ -83,14 +83,19 @@ zoneinfo: yearistype ${TDATA}
|
||||
zic -D -d ${TZBUILDDIR} -p ${POSIXRULES} -m ${NOBINMODE} \
|
||||
${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES}
|
||||
|
||||
.if make(*install*)
|
||||
TZS!= cd ${TZBUILDDIR} && find -s * -type f
|
||||
.endif
|
||||
|
||||
beforeinstall: install-zoneinfo
|
||||
install-zoneinfo:
|
||||
mkdir -p ${DESTDIR}/usr/share/zoneinfo
|
||||
cd ${DESTDIR}/usr/share/zoneinfo; mkdir -p ${TZBUILDSUBDIRS}
|
||||
cd ${TZBUILDDIR} && \
|
||||
find -s * -type f -exec ${INSTALL} ${TAG_ARGS} \
|
||||
.for f in ${TZS}
|
||||
${INSTALL} ${TAG_ARGS} \
|
||||
-o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
|
||||
\{} ${DESTDIR}/usr/share/zoneinfo/\{} \;
|
||||
${TZBUILDDIR:C,^${.OBJDIR}/,,}/${f} ${DESTDIR}/usr/share/zoneinfo/${f}
|
||||
.endfor
|
||||
${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
|
||||
${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
|
||||
|
||||
|
@ -156,7 +156,7 @@ fill_fpregs32(struct thread *td, struct fpreg32 *regs)
|
||||
/* FPU control/status */
|
||||
penv_87->en_cw = penv_xmm->en_cw;
|
||||
penv_87->en_sw = penv_xmm->en_sw;
|
||||
penv_87->en_tw = penv_xmm->en_tw;
|
||||
|
||||
/*
|
||||
* XXX for en_fip/fcs/foo/fos, check if the fxsave format
|
||||
* uses the old-style layout for 32 bit user apps. If so,
|
||||
@ -170,9 +170,13 @@ fill_fpregs32(struct thread *td, struct fpreg32 *regs)
|
||||
/* Entry into the kernel always sets TF_HASSEGS */
|
||||
penv_87->en_fos = td->td_frame->tf_ds;
|
||||
|
||||
/* FPU registers */
|
||||
for (i = 0; i < 8; ++i)
|
||||
/* FPU registers and tags */
|
||||
penv_87->en_tw = 0xffff;
|
||||
for (i = 0; i < 8; ++i) {
|
||||
sv_87->sv_ac[i] = sv_fpu->sv_fp[i].fp_acc;
|
||||
if ((penv_xmm->en_tw & (1 << i)) != 0)
|
||||
penv_87->en_tw &= ~(3 << i * 2);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
@ -189,15 +193,19 @@ set_fpregs32(struct thread *td, struct fpreg32 *regs)
|
||||
/* FPU control/status */
|
||||
penv_xmm->en_cw = penv_87->en_cw;
|
||||
penv_xmm->en_sw = penv_87->en_sw;
|
||||
penv_xmm->en_tw = penv_87->en_tw;
|
||||
penv_xmm->en_rip = penv_87->en_fip;
|
||||
/* penv_87->en_fcs and en_fos ignored, see above */
|
||||
penv_xmm->en_opcode = penv_87->en_opcode;
|
||||
penv_xmm->en_rdp = penv_87->en_foo;
|
||||
|
||||
/* FPU registers */
|
||||
for (i = 0; i < 8; ++i)
|
||||
/* FPU registers and tags */
|
||||
penv_xmm->en_tw = 0;
|
||||
for (i = 0; i < 8; ++i) {
|
||||
sv_fpu->sv_fp[i].fp_acc = sv_87->sv_ac[i];
|
||||
if ((penv_87->en_tw & (3 << i * 2)) != (3 << i * 2))
|
||||
penv_xmm->en_tw |= 1 << i;
|
||||
}
|
||||
|
||||
for (i = 8; i < 16; ++i)
|
||||
bzero(&sv_fpu->sv_fp[i].fp_acc, sizeof(sv_fpu->sv_fp[i].fp_acc));
|
||||
fpuuserinited(td);
|
||||
|
@ -565,25 +565,39 @@ aw_fdt_configure_pins(device_t dev, phandle_t cfgxref)
|
||||
ret = 0;
|
||||
|
||||
/* Getting all prop for configuring pins */
|
||||
pins_nb = ofw_bus_string_list_to_array(node, "allwinner,pins", &pinlist);
|
||||
pins_nb = ofw_bus_string_list_to_array(node, "pins", &pinlist);
|
||||
if (pins_nb <= 0) {
|
||||
pins_nb = ofw_bus_string_list_to_array(node, "allwinner,pins",
|
||||
&pinlist);
|
||||
if (pins_nb <= 0)
|
||||
return (ENOENT);
|
||||
}
|
||||
if (OF_getprop_alloc(node, "function",
|
||||
sizeof(*pin_function),
|
||||
(void **)&pin_function) == -1) {
|
||||
if (OF_getprop_alloc(node, "allwinner,function",
|
||||
sizeof(*pin_function),
|
||||
(void **)&pin_function) == -1) {
|
||||
ret = ENOENT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
if (OF_getencprop(node, "drive",
|
||||
&pin_drive, sizeof(pin_drive)) == -1) {
|
||||
if (OF_getencprop(node, "allwinner,drive",
|
||||
&pin_drive, sizeof(pin_drive)) == -1) {
|
||||
ret = ENOENT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
if (OF_getencprop(node, "pull",
|
||||
&pin_pull, sizeof(pin_pull)) == -1) {
|
||||
if (OF_getencprop(node, "allwinner,pull",
|
||||
&pin_pull, sizeof(pin_pull)) == -1) {
|
||||
ret = ENOENT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/* Configure each pin to the correct function, drive and pull */
|
||||
for (i = 0; i < pins_nb; i++) {
|
||||
@ -697,6 +711,8 @@ a10_gpio_attach(device_t dev)
|
||||
/*
|
||||
* Register as a pinctrl device
|
||||
*/
|
||||
fdt_pinctrl_register(dev, "pins");
|
||||
fdt_pinctrl_configure_tree(dev);
|
||||
fdt_pinctrl_register(dev, "allwinner,pins");
|
||||
fdt_pinctrl_configure_tree(dev);
|
||||
|
||||
|
@ -82,6 +82,7 @@ static struct ofw_compat_data compat_data[] = {
|
||||
{ "allwinner,sun50i-a64", CLOCK_CCU },
|
||||
{ "allwinner,sun8i-a33", CLOCK_CCU },
|
||||
{ "allwinner,sun8i-a83t", CLOCK_CCU|CLOCK_PRCM|CLOCK_SYSCTRL },
|
||||
{ "allwinner,sun8i-h2-plus", CLOCK_CCU|CLOCK_PRCM },
|
||||
{ "allwinner,sun8i-h3", CLOCK_CCU|CLOCK_PRCM },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
@ -261,6 +261,21 @@ static platform_method_t a83t_methods[] = {
|
||||
FDT_PLATFORM_DEF(a83t, "a83t", 0, "allwinner,sun8i-a83t", 200);
|
||||
#endif
|
||||
|
||||
#if defined(SOC_ALLWINNER_H2PLUS)
|
||||
static platform_method_t h2_plus_methods[] = {
|
||||
PLATFORMMETHOD(platform_attach, h3_attach),
|
||||
PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init),
|
||||
PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset),
|
||||
|
||||
#ifdef SMP
|
||||
PLATFORMMETHOD(platform_mp_start_ap, aw_mp_start_ap),
|
||||
PLATFORMMETHOD(platform_mp_setmaxid, aw_mp_setmaxid),
|
||||
#endif
|
||||
PLATFORMMETHOD_END,
|
||||
};
|
||||
FDT_PLATFORM_DEF(h2_plus, "h2_plus", 0, "allwinner,sun8i-h2-plus", 200);
|
||||
#endif
|
||||
|
||||
#if defined(SOC_ALLWINNER_H3)
|
||||
static platform_method_t h3_methods[] = {
|
||||
PLATFORMMETHOD(platform_attach, h3_attach),
|
||||
@ -276,6 +291,8 @@ static platform_method_t h3_methods[] = {
|
||||
FDT_PLATFORM_DEF(h3, "h3", 0, "allwinner,sun8i-h3", 200);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
u_int
|
||||
allwinner_soc_type(void)
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <machine/atomic.h>
|
||||
#include <machine/bus.h>
|
||||
#include <machine/cpu-v6.h>
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/md_var.h>
|
||||
|
||||
#define BUSDMA_DCACHE_ALIGN cpuinfo.dcache_line_size
|
||||
@ -491,6 +491,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
|
||||
newtag->highaddr = MAX(parent->highaddr, newtag->highaddr);
|
||||
newtag->alignment = MAX(parent->alignment, newtag->alignment);
|
||||
newtag->flags |= parent->flags & BUS_DMA_COULD_BOUNCE;
|
||||
newtag->flags |= parent->flags & BUS_DMA_COHERENT;
|
||||
if (newtag->boundary == 0)
|
||||
newtag->boundary = parent->boundary;
|
||||
else if (parent->boundary != 0)
|
||||
@ -755,11 +756,19 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int flags,
|
||||
}
|
||||
map->flags = DMAMAP_DMAMEM_ALLOC;
|
||||
|
||||
/* Choose a busdma buffer allocator based on memory type flags. */
|
||||
if (flags & BUS_DMA_COHERENT) {
|
||||
/* For coherent memory, set the map flag that disables sync ops. */
|
||||
if (flags & BUS_DMA_COHERENT)
|
||||
map->flags |= DMAMAP_COHERENT;
|
||||
|
||||
/*
|
||||
* Choose a busdma buffer allocator based on memory type flags.
|
||||
* If the tag's COHERENT flag is set, that means normal memory
|
||||
* is already coherent, use the normal allocator.
|
||||
*/
|
||||
if ((flags & BUS_DMA_COHERENT) &&
|
||||
((dmat->flags & BUS_DMA_COHERENT) == 0)) {
|
||||
memattr = VM_MEMATTR_UNCACHEABLE;
|
||||
ba = coherent_allocator;
|
||||
map->flags |= DMAMAP_COHERENT;
|
||||
} else {
|
||||
memattr = VM_MEMATTR_DEFAULT;
|
||||
ba = standard_allocator;
|
||||
@ -829,7 +838,8 @@ bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)
|
||||
struct busdma_bufzone *bufzone;
|
||||
busdma_bufalloc_t ba;
|
||||
|
||||
if (map->flags & DMAMAP_COHERENT)
|
||||
if ((map->flags & DMAMAP_COHERENT) &&
|
||||
((dmat->flags & BUS_DMA_COHERENT) == 0))
|
||||
ba = coherent_allocator;
|
||||
else
|
||||
ba = standard_allocator;
|
||||
@ -1030,7 +1040,7 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf,
|
||||
sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & PAGE_MASK));
|
||||
curaddr = add_bounce_page(dmat, map, 0, curaddr,
|
||||
sgsize);
|
||||
} else {
|
||||
} else if ((dmat->flags & BUS_DMA_COHERENT) == 0) {
|
||||
if (map->sync_count > 0)
|
||||
sl_end = sl->paddr + sl->datacount;
|
||||
|
||||
@ -1144,7 +1154,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
|
||||
sgsize)) {
|
||||
curaddr = add_bounce_page(dmat, map, kvaddr, curaddr,
|
||||
sgsize);
|
||||
} else {
|
||||
} else if ((dmat->flags & BUS_DMA_COHERENT) == 0) {
|
||||
if (map->sync_count > 0) {
|
||||
sl_pend = sl->paddr + sl->datacount;
|
||||
sl_vend = sl->vaddr + sl->datacount;
|
||||
@ -1353,8 +1363,9 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
|
||||
bpage->datacount);
|
||||
if (tempvaddr != 0)
|
||||
pmap_quick_remove_page(tempvaddr);
|
||||
dcache_wb_poc(bpage->vaddr, bpage->busaddr,
|
||||
bpage->datacount);
|
||||
if ((dmat->flags & BUS_DMA_COHERENT) == 0)
|
||||
dcache_wb_poc(bpage->vaddr,
|
||||
bpage->busaddr, bpage->datacount);
|
||||
bpage = STAILQ_NEXT(bpage, links);
|
||||
}
|
||||
dmat->bounce_zone->total_bounced++;
|
||||
@ -1374,8 +1385,9 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
|
||||
if ((op & BUS_DMASYNC_PREREAD) && !(op & BUS_DMASYNC_PREWRITE)) {
|
||||
bpage = STAILQ_FIRST(&map->bpages);
|
||||
while (bpage != NULL) {
|
||||
dcache_inv_poc_dma(bpage->vaddr, bpage->busaddr,
|
||||
bpage->datacount);
|
||||
if ((dmat->flags & BUS_DMA_COHERENT) == 0)
|
||||
dcache_inv_poc_dma(bpage->vaddr,
|
||||
bpage->busaddr, bpage->datacount);
|
||||
bpage = STAILQ_NEXT(bpage, links);
|
||||
}
|
||||
}
|
||||
@ -1391,8 +1403,9 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
|
||||
*/
|
||||
if (op & BUS_DMASYNC_POSTREAD) {
|
||||
while (bpage != NULL) {
|
||||
dcache_inv_poc(bpage->vaddr, bpage->busaddr,
|
||||
bpage->datacount);
|
||||
if ((dmat->flags & BUS_DMA_COHERENT) == 0)
|
||||
dcache_inv_poc(bpage->vaddr,
|
||||
bpage->busaddr, bpage->datacount);
|
||||
tempvaddr = 0;
|
||||
datavaddr = bpage->datavaddr;
|
||||
if (datavaddr == 0) {
|
||||
@ -1421,6 +1434,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
|
||||
if (map->flags & DMAMAP_COHERENT) {
|
||||
if (op & BUS_DMASYNC_PREWRITE) {
|
||||
dsb();
|
||||
if ((dmat->flags & BUS_DMA_COHERENT) == 0)
|
||||
cpu_l2cache_drain_writebuf();
|
||||
}
|
||||
return;
|
||||
|
@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <machine/cpu.h>
|
||||
@ -77,6 +78,14 @@ void
|
||||
cpuinfo_init(void)
|
||||
{
|
||||
|
||||
/*
|
||||
* Prematurely fetch CPU quirks. Standard fetch for tunable
|
||||
* sysctls is handled using SYSINIT, thus too late for boot CPU.
|
||||
* Keep names in sync with sysctls.
|
||||
*/
|
||||
TUNABLE_INT_FETCH("hw.cpu.quirks.actlr_mask", &cpu_quirks_actlr_mask);
|
||||
TUNABLE_INT_FETCH("hw.cpu.quirks.actlr_set", &cpu_quirks_actlr_set);
|
||||
|
||||
cpuinfo.midr = cp15_midr_get();
|
||||
/* Test old version id schemes first */
|
||||
if ((cpuinfo.midr & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_ARM_LTD) {
|
||||
|
@ -1445,11 +1445,11 @@ arm_gicv2m_alloc_msi(device_t dev, device_t child, int count, int maxcount,
|
||||
break;
|
||||
}
|
||||
|
||||
KASSERT((psc->gic_irqs[irq].gi_flags & GI_FLAG_MSI)!= 0,
|
||||
KASSERT((psc->gic_irqs[end_irq].gi_flags & GI_FLAG_MSI)!= 0,
|
||||
("%s: Non-MSI interrupt found", __func__));
|
||||
|
||||
/* This is already used */
|
||||
if ((psc->gic_irqs[irq].gi_flags & GI_FLAG_MSI_USED) ==
|
||||
if ((psc->gic_irqs[end_irq].gi_flags & GI_FLAG_MSI_USED) ==
|
||||
GI_FLAG_MSI_USED) {
|
||||
found = false;
|
||||
break;
|
||||
|
@ -365,7 +365,7 @@ svcstk:
|
||||
* Memory for the initial pagetable. We are unable to place this in
|
||||
* the bss as this will be cleared after the table is loaded.
|
||||
*/
|
||||
.section ".init_pagetable"
|
||||
.section ".init_pagetable", "aw", %nobits
|
||||
.align 14 /* 16KiB aligned */
|
||||
pagetable:
|
||||
.space L1_TABLE_SIZE
|
||||
|
@ -436,7 +436,7 @@ svcstk:
|
||||
* Memory for the initial pagetable. We are unable to place this in
|
||||
* the bss as this will be cleared after the table is loaded.
|
||||
*/
|
||||
.section ".init_pagetable"
|
||||
.section ".init_pagetable", "aw", %nobits
|
||||
.align 14 /* 16KiB aligned */
|
||||
.globl boot_pt1
|
||||
boot_pt1:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user