Merge from head@274131

This commit is contained in:
Baptiste Daroussin 2015-06-16 20:01:01 +00:00
commit baec3daef1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/release-pkg/; revision=284461
46 changed files with 424 additions and 257 deletions

View File

@ -99,7 +99,10 @@
#
# For more information, see the build(7) manual page.
#
.if ${MK_META_MODE:Uno} == "yes"
# Note: we use this awkward construct to be compatible with FreeBSD's
# old make used in 10.0 and 9.2 and earlier.
.if defined(MK_META_MODE) && ${MK_META_MODE} == "yes"
# targets/Makefile plays the role of top-level
.include "targets/Makefile"
.else
@ -436,9 +439,13 @@ universe_epilogue: universe_${target}
universe_${target}: universe_${target}_prologue
universe_${target}_prologue: universe_prologue
@echo ">> ${target} started on `LC_ALL=C date`"
universe_${target}_worlds:
.if !defined(MAKE_JUST_KERNELS)
.for target_arch in ${TARGET_ARCHES_${target}}
universe_${target}: universe_${target}_${target_arch}
universe_${target}_worlds: universe_${target}_${target_arch}
universe_${target}_done: universe_${target}_worlds
universe_${target}_${target_arch}: universe_${target}_prologue .MAKE
@echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`"
@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
@ -451,15 +458,12 @@ universe_${target}_${target_arch}: universe_${target}_prologue .MAKE
${MAKEFAIL}))
@echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`"
.endfor
.endif
.endif # !MAKE_JUST_KERNELS
.if !defined(MAKE_JUST_WORLDS)
# If we are building world and kernels wait for the required worlds to finish
.if !defined(MAKE_JUST_KERNELS)
.for target_arch in ${TARGET_ARCHES_${target}}
universe_${target}_kernels: universe_${target}_${target_arch}
.endfor
.endif
universe_${target}: universe_${target}_kernels
universe_${target}_done: universe_${target}_kernels
universe_${target}_kernels: universe_${target}_worlds
universe_${target}_kernels: universe_${target}_prologue .MAKE
.if exists(${KERNSRCDIR}/${target}/conf/NOTES)
@(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \
@ -469,7 +473,11 @@ universe_${target}_kernels: universe_${target}_prologue .MAKE
.endif
@cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \
universe_kernels
.endif
.endif # !MAKE_JUST_WORLDS
# Tell the user the worlds and kernels have completed
universe_${target}: universe_${target}_done
universe_${target}_done:
@echo ">> ${target} completed on `LC_ALL=C date`"
.endfor
universe_kernels: universe_kernconfs
@ -522,6 +530,7 @@ universe_epilogue:
buildLINT:
${MAKE} -C ${.CURDIR}/sys/${_TARGET}/conf LINT
.if defined(.PARSEDIR)
# This makefile does not run in meta mode
.MAKE.MODE= normal
# Normally the things we run from here don't either.
@ -539,5 +548,6 @@ UPDATE_DEPENDFILE= NO
MAKE_JOB_ERROR_TOKEN= no
.export MAKE_JOB_ERROR_TOKEN
.endif
.endif # bmake
.endif # META_MODE

View File

@ -466,6 +466,8 @@ LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${LIB32_OBJTREE} \
LIB32WMAKEFLAGS+= CC="${XCC} ${LIB32FLAGS}" \
CXX="${XCXX} ${LIB32FLAGS}" \
DESTDIR=${LIB32TMP} \
SHLIBDIR=/usr/lib32 \
LIBDIR=/usr/lib32 \
-DCOMPAT_32BIT \
-DLIBRARIES_ONLY \
-DNO_CPU_CFLAGS \

View File

@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
20150615:
The fix for the issue described in the 20150614 sendmail entry
below has been been committed in revision 284436. The work
around described in that entry is no longer needed unless the
default setting is overridden by a confDH_PARAMETERS configuration
setting of '5' or pointing to a 512 bit DH parameter file.
20150614:
ALLOW_DEPRECATED_ATF_TOOLS/ATFFILE support has been removed from
atf.test.mk (included from bsd.test.mk). Please upgrade devel/atf

View File

@ -37,7 +37,6 @@ SRCS+= libzfs_changelist.c \
zfs_comutil.c \
zfs_deleg.c \
zfs_fletcher.c \
zfs_ioctl_compat.c \
zfs_namecheck.c \
zfs_prop.c \
zpool_prop.c \

View File

@ -11,7 +11,8 @@ DPADD= ${LIBNVPAIR}
LDADD= -lnvpair
SRCS= libzfs_core.c \
libzfs_core_compat.c
libzfs_core_compat.c \
zfs_ioctl_compat.c
SRCS+= libzfs_compat.c

View File

@ -650,7 +650,7 @@ inittls(ctx, req, options, srv, certfile, keyfile, cacertpath, cacertfile, dhpar
** 1024 generate 1024 bit parameters
** 2048 generate 2048 bit parameters
** /file/name read parameters from /file/name
** default is: 1024 for server, 512 for client (OK? XXX)
** default is: 1024
*/
if (bitset(TLS_I_TRY_DH, req))
@ -676,8 +676,8 @@ inittls(ctx, req, options, srv, certfile, keyfile, cacertpath, cacertfile, dhpar
}
if (dhparam == NULL)
{
dhparam = srv ? "1" : "5";
req |= (srv ? TLS_I_DH1024 : TLS_I_DH512);
dhparam = "1";
req |= TLS_I_DH1024;
}
else if (*dhparam == '/')
{

View File

@ -27,13 +27,5 @@ SRCS+= aeabi_memcmp.S \
aeabi_memmove.S \
aeabi_memset.S
# Mark the functions as hidden so they are not available outside of libc.
CFLAGS.aeabi_memcmp.S= -DVISIBILITY_HIDDEN
CFLAGS.aeabi_memcpy.S= -DVISIBILITY_HIDDEN
CFLAGS.aeabi_memmove.S= -DVISIBILITY_HIDDEN
CFLAGS.aeabi_memset.S= -DVISIBILITY_HIDDEN
CFLAGS+= ${CFLAGS.${.IMPSRC:T}}
SYM_MAPS+=${LIBC_SRCTOP}/arm/aeabi/Symbol.map

View File

@ -52,4 +52,21 @@ FBSDprivate_1.0 {
__aeabi_i2d;
__aeabi_i2f;
__aeabi_memclr;
__aeabi_memclr4;
__aeabi_memclr8;
__aeabi_memcmp;
__aeabi_memcmp4;
__aeabi_memcmp8;
__aeabi_memcpy;
__aeabi_memcpy4;
__aeabi_memcpy8;
__aeabi_memmove;
__aeabi_memmove4;
__aeabi_memmove8;
__aeabi_memset;
__aeabi_memset4;
__aeabi_memset8;
};

View File

@ -0,0 +1,14 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
include \
include/xlocale \
lib/libelf \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
.endif

View File

@ -32,6 +32,8 @@
*
* Exceptional values are noted in the comments within the source code.
* These values and the return value were taken from n1124.pdf.
* The sign of the result for some exceptional values is unspecified but
* must satisfy both cosh(conj(z)) == conj(cosh(z)) and cosh(-z) == cosh(z).
*/
#include <sys/cdefs.h>
@ -63,7 +65,7 @@ ccosh(double complex z)
if (ix < 0x7ff00000 && iy < 0x7ff00000) {
if ((iy | ly) == 0)
return (CMPLX(cosh(x), x * y));
if (ix < 0x40360000) /* small x: normal case */
if (ix < 0x40360000) /* |x| < 22: normal case */
return (CMPLX(cosh(x) * cos(y), sinh(x) * sin(y)));
/* |x| >= 22, so cosh(x) ~= exp(|x|) */
@ -83,28 +85,27 @@ ccosh(double complex z)
}
/*
* cosh(+-0 +- I Inf) = dNaN + I sign(d(+-0, dNaN))0.
* The sign of 0 in the result is unspecified. Choice = normally
* the same as dNaN. Raise the invalid floating-point exception.
* cosh(+-0 +- I Inf) = dNaN + I (+-)(+-)0.
* The sign of 0 in the result is unspecified. Choice = product
* of the signs of the argument. Raise the invalid floating-point
* exception.
*
* cosh(+-0 +- I NaN) = d(NaN) + I sign(d(+-0, NaN))0.
* The sign of 0 in the result is unspecified. Choice = normally
* the same as d(NaN).
* cosh(+-0 +- I NaN) = d(NaN) + I (+-)(+-)0.
* The sign of 0 in the result is unspecified. Choice = product
* of the signs of the argument.
*/
if ((ix | lx) == 0 && iy >= 0x7ff00000)
return (CMPLX(y - y, copysign(0, x * (y - y))));
if ((ix | lx) == 0) /* && iy >= 0x7ff00000 */
return (CMPLX(y - y, x * copysign(0, y)));
/*
* cosh(+-Inf +- I 0) = +Inf + I (+-)(+-)0.
*
* cosh(NaN +- I 0) = d(NaN) + I sign(d(NaN, +-0))0.
* The sign of 0 in the result is unspecified.
* cosh(NaN +- I 0) = d(NaN) + I (+-)(+-)0.
* The sign of 0 in the result is unspecified. Choice = product
* of the signs of the argument.
*/
if ((iy | ly) == 0 && ix >= 0x7ff00000) {
if (((hx & 0xfffff) | lx) == 0)
return (CMPLX(x * x, copysign(0, x) * y));
return (CMPLX(x * x, copysign(0, (x + x) * y)));
}
if ((iy | ly) == 0) /* && ix >= 0x7ff00000 */
return (CMPLX(x * x, copysign(0, x) * y));
/*
* cosh(x +- I Inf) = dNaN + I dNaN.
@ -114,7 +115,7 @@ ccosh(double complex z)
* Optionally raises the invalid floating-point exception for finite
* nonzero x. Choice = don't raise (except for signaling NaNs).
*/
if (ix < 0x7ff00000 && iy >= 0x7ff00000)
if (ix < 0x7ff00000) /* && iy >= 0x7ff00000 */
return (CMPLX(y - y, x * (y - y)));
/*
@ -126,10 +127,10 @@ ccosh(double complex z)
*
* cosh(+-Inf + I y) = +Inf cos(y) +- I Inf sin(y)
*/
if (ix >= 0x7ff00000 && ((hx & 0xfffff) | lx) == 0) {
if (ix == 0x7ff00000 && lx == 0) {
if (iy >= 0x7ff00000)
return (CMPLX(x * x, x * (y - y)));
return (CMPLX((x * x) * cos(y), x * sin(y)));
return (CMPLX(INFINITY, x * (y - y)));
return (CMPLX(INFINITY * cos(y), x * sin(y)));
}
/*

View File

@ -25,7 +25,7 @@
*/
/*
* Hyperbolic cosine of a complex argument. See s_ccosh.c for details.
* Float version of ccosh(). See s_ccosh.c for details.
*/
#include <sys/cdefs.h>
@ -56,13 +56,13 @@ ccoshf(float complex z)
if (ix < 0x7f800000 && iy < 0x7f800000) {
if (iy == 0)
return (CMPLXF(coshf(x), x * y));
if (ix < 0x41100000) /* small x: normal case */
if (ix < 0x41100000) /* |x| < 9: normal case */
return (CMPLXF(coshf(x) * cosf(y), sinhf(x) * sinf(y)));
/* |x| >= 9, so cosh(x) ~= exp(|x|) */
if (ix < 0x42b17218) {
/* x < 88.7: expf(|x|) won't overflow */
h = expf(fabsf(x)) * 0.5f;
h = expf(fabsf(x)) * 0.5F;
return (CMPLXF(h * cosf(y), copysignf(h, x) * sinf(y)));
} else if (ix < 0x4340b1e7) {
/* x < 192.7: scale to avoid overflow */
@ -75,22 +75,19 @@ ccoshf(float complex z)
}
}
if (ix == 0 && iy >= 0x7f800000)
return (CMPLXF(y - y, copysignf(0, x * (y - y))));
if (ix == 0) /* && iy >= 0x7f800000 */
return (CMPLXF(y - y, x * copysignf(0, y)));
if (iy == 0 && ix >= 0x7f800000) {
if ((hx & 0x7fffff) == 0)
return (CMPLXF(x * x, copysignf(0, x) * y));
return (CMPLXF(x * x, copysignf(0, (x + x) * y)));
}
if (iy == 0) /* && ix >= 0x7f800000 */
return (CMPLXF(x * x, copysignf(0, x) * y));
if (ix < 0x7f800000 && iy >= 0x7f800000)
if (ix < 0x7f800000) /* && iy >= 0x7f800000 */
return (CMPLXF(y - y, x * (y - y)));
if (ix >= 0x7f800000 && (hx & 0x7fffff) == 0) {
if (ix == 0x7f800000) {
if (iy >= 0x7f800000)
return (CMPLXF(x * x, x * (y - y)));
return (CMPLXF((x * x) * cosf(y), x * sinf(y)));
return (CMPLXF(INFINITY, x * (y - y)));
return (CMPLXF(INFINITY * cosf(y), x * sinf(y)));
}
return (CMPLXF((x * x) * (y - y), (x + x) * (y - y)));

View File

@ -32,6 +32,8 @@
*
* Exceptional values are noted in the comments within the source code.
* These values and the return value were taken from n1124.pdf.
* The sign of the result for some exceptional values is unspecified but
* must satisfy both sinh(conj(z)) == conj(sinh(z)) and sinh(-z) == -sinh(z).
*/
#include <sys/cdefs.h>
@ -63,7 +65,7 @@ csinh(double complex z)
if (ix < 0x7ff00000 && iy < 0x7ff00000) {
if ((iy | ly) == 0)
return (CMPLX(sinh(x), y));
if (ix < 0x40360000) /* small x: normal case */
if (ix < 0x40360000) /* |x| < 22: normal case */
return (CMPLX(sinh(x) * cos(y), cosh(x) * sin(y)));
/* |x| >= 22, so cosh(x) ~= exp(|x|) */
@ -83,27 +85,24 @@ csinh(double complex z)
}
/*
* sinh(+-0 +- I Inf) = sign(d(+-0, dNaN))0 + I dNaN.
* The sign of 0 in the result is unspecified. Choice = normally
* the same as dNaN. Raise the invalid floating-point exception.
* sinh(+-0 +- I Inf) = +-0 + I dNaN.
* The sign of 0 in the result is unspecified. Choice = same sign
* as the argument. Raise the invalid floating-point exception.
*
* sinh(+-0 +- I NaN) = sign(d(+-0, NaN))0 + I d(NaN).
* The sign of 0 in the result is unspecified. Choice = normally
* the same as d(NaN).
* sinh(+-0 +- I NaN) = +-0 + I d(NaN).
* The sign of 0 in the result is unspecified. Choice = same sign
* as the argument.
*/
if ((ix | lx) == 0 && iy >= 0x7ff00000)
return (CMPLX(copysign(0, x * (y - y)), y - y));
if ((ix | lx) == 0) /* && iy >= 0x7ff00000 */
return (CMPLX(x, y - y));
/*
* sinh(+-Inf +- I 0) = +-Inf + I +-0.
*
* sinh(NaN +- I 0) = d(NaN) + I +-0.
*/
if ((iy | ly) == 0 && ix >= 0x7ff00000) {
if (((hx & 0xfffff) | lx) == 0)
return (CMPLX(x, y));
return (CMPLX(x, copysign(0, y)));
}
if ((iy | ly) == 0) /* && ix >= 0x7ff00000 */
return (CMPLX(x + x, y));
/*
* sinh(x +- I Inf) = dNaN + I dNaN.
@ -113,45 +112,45 @@ csinh(double complex z)
* Optionally raises the invalid floating-point exception for finite
* nonzero x. Choice = don't raise (except for signaling NaNs).
*/
if (ix < 0x7ff00000 && iy >= 0x7ff00000)
return (CMPLX(y - y, x * (y - y)));
if (ix < 0x7ff00000) /* && iy >= 0x7ff00000 */
return (CMPLX(y - y, y - y));
/*
* sinh(+-Inf + I NaN) = +-Inf + I d(NaN).
* The sign of Inf in the result is unspecified. Choice = normally
* the same as d(NaN).
* The sign of Inf in the result is unspecified. Choice = same sign
* as the argument.
*
* sinh(+-Inf +- I Inf) = +Inf + I dNaN.
* The sign of Inf in the result is unspecified. Choice = always +.
* Raise the invalid floating-point exception.
* sinh(+-Inf +- I Inf) = +-Inf + I dNaN.
* The sign of Inf in the result is unspecified. Choice = same sign
* as the argument. Raise the invalid floating-point exception.
*
* sinh(+-Inf + I y) = +-Inf cos(y) + I Inf sin(y)
*/
if (ix >= 0x7ff00000 && ((hx & 0xfffff) | lx) == 0) {
if (ix == 0x7ff00000 && lx == 0) {
if (iy >= 0x7ff00000)
return (CMPLX(x * x, x * (y - y)));
return (CMPLX(x, y - y));
return (CMPLX(x * cos(y), INFINITY * sin(y)));
}
/*
* sinh(NaN + I NaN) = d(NaN) + I d(NaN).
* sinh(NaN1 + I NaN2) = d(NaN1, NaN2) + I d(NaN1, NaN2).
*
* sinh(NaN +- I Inf) = d(NaN) + I d(NaN).
* sinh(NaN +- I Inf) = d(NaN, dNaN) + I d(NaN, dNaN).
* Optionally raises the invalid floating-point exception.
* Choice = raise.
*
* sinh(NaN + I y) = d(NaN) + I d(NaN).
* sinh(NaN + I y) = d(NaN) + I d(NaN).
* Optionally raises the invalid floating-point exception for finite
* nonzero y. Choice = don't raise (except for signaling NaNs).
*/
return (CMPLX((x * x) * (y - y), (x + x) * (y - y)));
return (CMPLX((x + x) * (y - y), (x * x) * (y - y)));
}
double complex
csin(double complex z)
{
/* csin(z) = -I * csinh(I * z) */
z = csinh(CMPLX(-cimag(z), creal(z)));
return (CMPLX(cimag(z), -creal(z)));
/* csin(z) = -I * csinh(I * z) = I * conj(csinh(I * conj(z))). */
z = csinh(CMPLX(cimag(z), creal(z)));
return (CMPLX(cimag(z), creal(z)));
}

View File

@ -25,7 +25,7 @@
*/
/*
* Hyperbolic sine of a complex argument z. See s_csinh.c for details.
* Float version of csinh(). See s_csinh.c for details.
*/
#include <sys/cdefs.h>
@ -56,13 +56,13 @@ csinhf(float complex z)
if (ix < 0x7f800000 && iy < 0x7f800000) {
if (iy == 0)
return (CMPLXF(sinhf(x), y));
if (ix < 0x41100000) /* small x: normal case */
if (ix < 0x41100000) /* |x| < 9: normal case */
return (CMPLXF(sinhf(x) * cosf(y), coshf(x) * sinf(y)));
/* |x| >= 9, so cosh(x) ~= exp(|x|) */
if (ix < 0x42b17218) {
/* x < 88.7: expf(|x|) won't overflow */
h = expf(fabsf(x)) * 0.5f;
h = expf(fabsf(x)) * 0.5F;
return (CMPLXF(copysignf(h, x) * cosf(y), h * sinf(y)));
} else if (ix < 0x4340b1e7) {
/* x < 192.7: scale to avoid overflow */
@ -75,31 +75,28 @@ csinhf(float complex z)
}
}
if (ix == 0 && iy >= 0x7f800000)
return (CMPLXF(copysignf(0, x * (y - y)), y - y));
if (ix == 0) /* && iy >= 0x7f800000 */
return (CMPLXF(x, y - y));
if (iy == 0 && ix >= 0x7f800000) {
if ((hx & 0x7fffff) == 0)
return (CMPLXF(x, y));
return (CMPLXF(x, copysignf(0, y)));
}
if (iy == 0) /* && ix >= 0x7f800000 */
return (CMPLXF(x + x, y));
if (ix < 0x7f800000 && iy >= 0x7f800000)
return (CMPLXF(y - y, x * (y - y)));
if (ix < 0x7f800000) /* && iy >= 0x7f800000 */
return (CMPLXF(y - y, y - y));
if (ix >= 0x7f800000 && (hx & 0x7fffff) == 0) {
if (ix == 0x7f800000) {
if (iy >= 0x7f800000)
return (CMPLXF(x * x, x * (y - y)));
return (CMPLXF(x, y - y));
return (CMPLXF(x * cosf(y), INFINITY * sinf(y)));
}
return (CMPLXF((x * x) * (y - y), (x + x) * (y - y)));
return (CMPLXF((x + x) * (y - y), (x * x) * (y - y)));
}
float complex
csinf(float complex z)
{
z = csinhf(CMPLXF(-cimagf(z), crealf(z)));
return (CMPLXF(cimagf(z), -crealf(z)));
z = csinhf(CMPLXF(cimagf(z), crealf(z)));
return (CMPLXF(cimagf(z), crealf(z)));
}

View File

@ -25,7 +25,7 @@
*/
/*
* Hyperbolic tangent of a complex argument z = x + i y.
* Hyperbolic tangent of a complex argument z = x + I y.
*
* The algorithm is from:
*
@ -44,15 +44,15 @@
*
* tanh(z) = sinh(z) / cosh(z)
*
* sinh(x) cos(y) + i cosh(x) sin(y)
* sinh(x) cos(y) + I cosh(x) sin(y)
* = ---------------------------------
* cosh(x) cos(y) + i sinh(x) sin(y)
* cosh(x) cos(y) + I sinh(x) sin(y)
*
* cosh(x) sinh(x) / cos^2(y) + i tan(y)
* cosh(x) sinh(x) / cos^2(y) + I tan(y)
* = -------------------------------------
* 1 + sinh^2(x) / cos^2(y)
*
* beta rho s + i t
* beta rho s + I t
* = ----------------
* 1 + beta s^2
*
@ -85,16 +85,16 @@ ctanh(double complex z)
ix = hx & 0x7fffffff;
/*
* ctanh(NaN + i 0) = NaN + i 0
* ctanh(NaN +- I 0) = d(NaN) +- I 0
*
* ctanh(NaN + i y) = NaN + i NaN for y != 0
* ctanh(NaN + I y) = d(NaN,y) + I d(NaN,y) for y != 0
*
* The imaginary part has the sign of x*sin(2*y), but there's no
* special effort to get this right.
*
* ctanh(+-Inf +- i Inf) = +-1 +- 0
* ctanh(+-Inf +- I Inf) = +-1 +- I 0
*
* ctanh(+-Inf + i y) = +-1 + 0 sin(2y) for y finite
* ctanh(+-Inf + I y) = +-1 + I 0 sin(2y) for y finite
*
* The imaginary part of the sign is unspecified. This special
* case is only needed to avoid a spurious invalid exception when
@ -102,24 +102,25 @@ ctanh(double complex z)
*/
if (ix >= 0x7ff00000) {
if ((ix & 0xfffff) | lx) /* x is NaN */
return (CMPLX(x, (y == 0 ? y : x * y)));
return (CMPLX((x + 0) * (y + 0),
y == 0 ? y : (x + 0) * (y + 0)));
SET_HIGH_WORD(x, hx - 0x40000000); /* x = copysign(1, x) */
return (CMPLX(x, copysign(0, isinf(y) ? y : sin(y) * cos(y))));
}
/*
* ctanh(x + i NAN) = NaN + i NaN
* ctanh(x +- i Inf) = NaN + i NaN
* ctanh(x + I NaN) = d(NaN) + I d(NaN)
* ctanh(x +- I Inf) = dNaN + I dNaN
*/
if (!isfinite(y))
return (CMPLX(y - y, y - y));
/*
* ctanh(+-huge + i +-y) ~= +-1 +- i 2sin(2y)/exp(2x), using the
* ctanh(+-huge +- I y) ~= +-1 +- I 2sin(2y)/exp(2x), using the
* approximation sinh^2(huge) ~= exp(2*huge) / 4.
* We use a modified formula to avoid spurious overflow.
*/
if (ix >= 0x40360000) { /* x >= 22 */
if (ix >= 0x40360000) { /* |x| >= 22 */
double exp_mx = exp(-fabs(x));
return (CMPLX(copysign(1, x),
4 * sin(y) * cos(y) * exp_mx * exp_mx));
@ -138,7 +139,7 @@ double complex
ctan(double complex z)
{
/* ctan(z) = -I * ctanh(I * z) */
z = ctanh(CMPLX(-cimag(z), creal(z)));
return (CMPLX(cimag(z), -creal(z)));
/* ctan(z) = -I * ctanh(I * z) = I * conj(ctanh(I * conj(z))) */
z = ctanh(CMPLX(cimag(z), creal(z)));
return (CMPLX(cimag(z), creal(z)));
}

View File

@ -51,7 +51,8 @@ ctanhf(float complex z)
if (ix >= 0x7f800000) {
if (ix & 0x7fffff)
return (CMPLXF(x, (y == 0 ? y : x * y)));
return (CMPLXF((x + 0) * (y + 0),
y == 0 ? y : (x + 0) * (y + 0)));
SET_FLOAT_WORD(x, hx - 0x40000000);
return (CMPLXF(x,
copysignf(0, isinf(y) ? y : sinf(y) * cosf(y))));
@ -60,7 +61,7 @@ ctanhf(float complex z)
if (!isfinite(y))
return (CMPLXF(y - y, y - y));
if (ix >= 0x41300000) { /* x >= 11 */
if (ix >= 0x41300000) { /* |x| >= 11 */
float exp_mx = expf(-fabsf(x));
return (CMPLXF(copysignf(1, x),
4 * sinf(y) * cosf(y) * exp_mx * exp_mx));
@ -78,7 +79,7 @@ float complex
ctanf(float complex z)
{
z = ctanhf(CMPLXF(-cimagf(z), crealf(z)));
return (CMPLXF(cimagf(z), -crealf(z)));
z = ctanhf(CMPLXF(cimagf(z), crealf(z)));
return (CMPLXF(cimagf(z), crealf(z)));
}

View File

@ -1172,7 +1172,7 @@ structure to be the first element in that list.
(A pointer to
this address structure is saved in the
.Vt ifnet
structure and shall be accessed by the
structure and is accessed by the
.Fn ifaddr_byindex
function.)
The

View File

@ -1,7 +1,5 @@
# $FreeBSD$
.include "src.opts.mk"
.if ${.MAKE.MODE:Unormal:Mmeta*} != ""
.if !empty(SUBDIR) && !defined(LIB) && !defined(PROG) && ${.MAKE.MAKEFILES:M*bsd.prog.mk} == ""
.if ${.MAKE.MODE:Mleaf*} != ""

View File

@ -29,6 +29,7 @@ M_whence = ${M_type}:M/*:[1]
# convert a path to a valid shell variable
M_P2V = tu:C,[./-],_,g
.if ${MK_META_MODE} == "yes"
MAKE_PRINT_VAR_ON_ERROR+= \
.CURDIR \
.MAKE \
@ -48,6 +49,7 @@ MAKE_PRINT_VAR_ON_ERROR+= \
.if ${.MAKE.LEVEL} > 0
MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFILES .PATH
.endif
.endif
# these are handy
# we can use this for a cheap timestamp at the start of a target's script,

View File

@ -123,6 +123,8 @@ _LIBRARIES= \
nv \
opie \
pam \
panel \
panelw \
pcap \
pcsclite \
pjdlog \

View File

@ -240,7 +240,7 @@ ASENTRY_NP(init_mmu)
* - All is set to uncacheable memory
*/
ldr r0, =0xAAAAA
mrc CP15_PRRR(r0)
mcr CP15_PRRR(r0)
mov r0, #0
mcr CP15_NMRR(r0)
#endif

View File

@ -78,10 +78,6 @@
* Created : 28/11/94
*/
#ifdef KDTRACE_HOOKS
#include <sys/dtrace_bsd.h>
#endif
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@ -109,6 +105,10 @@ __FBSDID("$FreeBSD$");
#include <sys/kdb.h>
#endif
#ifdef KDTRACE_HOOKS
#include <sys/dtrace_bsd.h>
#endif
extern char fusubailout[];
#ifdef DEBUG

View File

@ -348,8 +348,7 @@ getdents_common(struct thread *td, struct linux_getdents64_args *args,
} else
justone = 0;
error = getvnode(td->td_proc->p_fd, args->fd,
cap_rights_init(&rights, CAP_READ), &fp);
error = getvnode(td, args->fd, cap_rights_init(&rights, CAP_READ), &fp);
if (error != 0)
return (error);

View File

@ -262,8 +262,7 @@ svr4_sys_getdents64(td, uap)
DPRINTF(("svr4_sys_getdents64(%d, *, %d)\n",
uap->fd, uap->nbytes));
error = getvnode(td->td_proc->p_fd, uap->fd,
cap_rights_init(&rights, CAP_READ), &fp);
error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp);
if (error != 0)
return (error);
@ -442,8 +441,7 @@ svr4_sys_getdents(td, uap)
if (uap->nbytes < 0)
return (EINVAL);
error = getvnode(td->td_proc->p_fd, uap->fd,
cap_rights_init(&rights, CAP_READ), &fp);
error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp);
if (error != 0)
return (error);
@ -622,7 +620,7 @@ svr4_sys_fchroot(td, uap)
struct thread *td;
struct svr4_sys_fchroot_args *uap;
{
struct filedesc *fdp = td->td_proc->p_fd;
cap_rights_t rights;
struct vnode *vp;
struct file *fp;
int error;
@ -630,7 +628,7 @@ svr4_sys_fchroot(td, uap)
if ((error = priv_check(td, PRIV_VFS_FCHROOT)) != 0)
return error;
/* XXX: we have the chroot priv... what cap might we need? all? */
if ((error = getvnode(fdp, uap->fd, 0, &fp)) != 0)
if ((error = getvnode(td, uap->fd, cap_rights_init(&rights), &fp)) != 0)
return error;
vp = fp->f_vnode;
VREF(vp);

View File

@ -239,7 +239,7 @@ beforedepend: ${_ILINKS}
# causes all the modules to be rebuilt when the directory pointed to changes.
.for _link in ${_ILINKS}
.if !exists(${.OBJDIR}/${_link})
${OBJS}: ${.OBJDIR}/${_link}
${OBJS}: ${_link}
.endif
.endfor

View File

@ -5102,7 +5102,7 @@ enable_trackpoint(struct psm_softc *sc, enum probearg arg)
id = read_aux_data(kbdc);
if (id < 0x01)
return (FALSE);
if (sc != NULL)
if (arg == PROBE)
sc->tphw = id;
if (!trackpoint_support)
return (FALSE);

View File

@ -206,6 +206,9 @@ enum {
INTR_OFLD_RXQ = (1 << 5), /* All TOE rxq's take interrupts */
INTR_NM_RXQ = (1 << 6), /* All netmap rxq's take interrupts */
INTR_ALL = (INTR_RXQ | INTR_OFLD_RXQ | INTR_NM_RXQ),
/* adapter debug_flags */
DF_DUMP_MBOX = (1 << 0),
};
#define IS_DOOMED(pi) ((pi)->flags & DOOMED)
@ -762,6 +765,7 @@ struct adapter {
int active_ulds; /* ULDs activated on this adapter */
#endif
int flags;
int debug_flags;
char ifp_lockname[16];
struct mtx ifp_lock;
@ -846,6 +850,24 @@ struct adapter {
#define TXQ_LOCK_ASSERT_OWNED(txq) EQ_LOCK_ASSERT_OWNED(&(txq)->eq)
#define TXQ_LOCK_ASSERT_NOTOWNED(txq) EQ_LOCK_ASSERT_NOTOWNED(&(txq)->eq)
#define CH_DUMP_MBOX(sc, mbox, data_reg) \
do { \
if (sc->debug_flags & DF_DUMP_MBOX) { \
log(LOG_NOTICE, \
"%s mbox %u: %016llx %016llx %016llx %016llx " \
"%016llx %016llx %016llx %016llx\n", \
device_get_nameunit(sc->dev), mbox, \
(unsigned long long)t4_read_reg64(sc, data_reg), \
(unsigned long long)t4_read_reg64(sc, data_reg + 8), \
(unsigned long long)t4_read_reg64(sc, data_reg + 16), \
(unsigned long long)t4_read_reg64(sc, data_reg + 24), \
(unsigned long long)t4_read_reg64(sc, data_reg + 32), \
(unsigned long long)t4_read_reg64(sc, data_reg + 40), \
(unsigned long long)t4_read_reg64(sc, data_reg + 48), \
(unsigned long long)t4_read_reg64(sc, data_reg + 56)); \
} \
} while (0)
#define for_each_txq(pi, iter, q) \
for (q = &pi->adapter->sge.txq[pi->first_txq], iter = 0; \
iter < pi->ntxq; ++iter, ++q)

View File

@ -262,6 +262,8 @@ int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size,
for (i = 0; i < size; i += 8, p++)
t4_write_reg64(adap, data_reg + i, be64_to_cpu(*p));
CH_DUMP_MBOX(adap, mbox, data_reg);
t4_write_reg(adap, ctl_reg, F_MBMSGVALID | V_MBOWNER(X_MBOWNER_FW));
t4_read_reg(adap, ctl_reg); /* flush write */
@ -287,6 +289,8 @@ int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size,
continue;
}
CH_DUMP_MBOX(adap, mbox, data_reg);
res = t4_read_reg64(adap, data_reg);
if (G_FW_CMD_OP(res >> 32) == FW_DEBUG_CMD) {
fw_asrt(adap, data_reg);

View File

@ -585,6 +585,9 @@ t4_attach(device_t dev)
sc = device_get_softc(dev);
sc->dev = dev;
#ifdef INVARIANTS
sc->debug_flags = DF_DUMP_MBOX;
#endif
pci_enable_busmaster(dev);
if (pci_find_cap(dev, PCIY_EXPRESS, &i) == 0) {
@ -4603,6 +4606,9 @@ t4_sysctls(struct adapter *sc)
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW,
&sc->lro_timeout, 0, "lro inactive-flush timeout (in us)");
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "debug_flags", CTLFLAG_RW,
&sc->debug_flags, 0, "flags to enable runtime debugging");
#ifdef SBUF_DRAIN
/*
* dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload.

View File

@ -155,6 +155,66 @@ ttm_caching_state_to_vm(enum ttm_caching_state cstate)
panic("caching state %d\n", cstate);
}
static vm_page_t
ttm_vm_page_alloc_dma32(int req, vm_memattr_t memattr)
{
vm_page_t p;
int tries;
for (tries = 0; ; tries++) {
p = vm_page_alloc_contig(NULL, 0, req, 1, 0, 0xffffffff,
PAGE_SIZE, 0, memattr);
if (p != NULL || tries > 2)
return (p);
/*
* Before growing the cache see if this is just a normal
* memory shortage.
*/
VM_WAIT;
vm_pageout_grow_cache(tries, 0, 0xffffffff);
}
}
static vm_page_t
ttm_vm_page_alloc_any(int req, vm_memattr_t memattr)
{
vm_page_t p;
while (1) {
p = vm_page_alloc(NULL, 0, req);
if (p != NULL)
break;
VM_WAIT;
}
pmap_page_set_memattr(p, memattr);
return (p);
}
static vm_page_t
ttm_vm_page_alloc(int flags, enum ttm_caching_state cstate)
{
vm_page_t p;
vm_memattr_t memattr;
int req;
memattr = ttm_caching_state_to_vm(cstate);
req = VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ;
if ((flags & TTM_PAGE_FLAG_ZERO_ALLOC) != 0)
req |= VM_ALLOC_ZERO;
if ((flags & TTM_PAGE_FLAG_DMA32) != 0)
p = ttm_vm_page_alloc_dma32(req, memattr);
else
p = ttm_vm_page_alloc_any(req, memattr);
if (p != NULL) {
p->oflags &= ~VPO_UNMANAGED;
p->flags |= PG_FICTITIOUS;
}
return (p);
}
static void ttm_pool_kobj_release(struct ttm_pool_manager *m)
{
@ -461,14 +521,6 @@ static void ttm_handle_caching_state_failure(struct pglist *pages,
}
}
static vm_paddr_t
ttm_alloc_high_bound(int ttm_alloc_flags)
{
return ((ttm_alloc_flags & TTM_PAGE_FLAG_DMA32) ? 0xffffffff :
VM_MAX_ADDRESS);
}
/**
* Allocate new pages with correct caching.
*
@ -481,32 +533,17 @@ static int ttm_alloc_new_pages(struct pglist *pages, int ttm_alloc_flags,
vm_page_t *caching_array;
vm_page_t p;
int r = 0;
unsigned i, cpages, aflags;
unsigned i, cpages;
unsigned max_cpages = min(count,
(unsigned)(PAGE_SIZE/sizeof(vm_page_t)));
int tries;
aflags = VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ |
((ttm_alloc_flags & TTM_PAGE_FLAG_ZERO_ALLOC) != 0 ?
VM_ALLOC_ZERO : 0);
/* allocate array for page caching change */
caching_array = malloc(max_cpages * sizeof(vm_page_t), M_TEMP,
M_WAITOK | M_ZERO);
for (i = 0, cpages = 0; i < count; ++i) {
tries = 0;
retry:
p = vm_page_alloc_contig(NULL, 0, aflags, 1, 0,
ttm_alloc_high_bound(ttm_alloc_flags),
PAGE_SIZE, 0, ttm_caching_state_to_vm(cstate));
p = ttm_vm_page_alloc(ttm_alloc_flags, cstate);
if (!p) {
if (tries < 3) {
vm_pageout_grow_cache(tries, 0,
ttm_alloc_high_bound(ttm_alloc_flags));
tries++;
goto retry;
}
printf("[TTM] Unable to get page %u\n", i);
/* store already allocated pages in the pool after
@ -522,8 +559,6 @@ static int ttm_alloc_new_pages(struct pglist *pages, int ttm_alloc_flags,
r = -ENOMEM;
goto out;
}
p->oflags &= ~VPO_UNMANAGED;
p->flags |= PG_FICTITIOUS;
#ifdef CONFIG_HIGHMEM /* KIB: nop */
/* gfp flags of highmem page should never be dma32 so we
@ -705,34 +740,18 @@ static int ttm_get_pages(vm_page_t *pages, unsigned npages, int flags,
struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);
struct pglist plist;
vm_page_t p = NULL;
int gfp_flags, aflags;
int gfp_flags;
unsigned count;
int r;
int tries;
aflags = VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED |
((flags & TTM_PAGE_FLAG_ZERO_ALLOC) != 0 ? VM_ALLOC_ZERO : 0);
/* No pool for cached pages */
if (pool == NULL) {
for (r = 0; r < npages; ++r) {
tries = 0;
retry:
p = vm_page_alloc_contig(NULL, 0, aflags, 1, 0,
ttm_alloc_high_bound(flags), PAGE_SIZE,
0, ttm_caching_state_to_vm(cstate));
p = ttm_vm_page_alloc(flags, cstate);
if (!p) {
if (tries < 3) {
vm_pageout_grow_cache(tries, 0,
ttm_alloc_high_bound(flags));
tries++;
goto retry;
}
printf("[TTM] Unable to allocate page\n");
return -ENOMEM;
}
p->oflags &= ~VPO_UNMANAGED;
p->flags |= PG_FICTITIOUS;
pages[r] = p;
}
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mii.h,v 1.9 2001/05/31 03:07:14 thorpej Exp $ */
/* $NetBSD: mii.h,v 1.18 2014/06/16 14:43:22 msaitoh Exp $ */
/*-
* Copyright (c) 1997 Manuel Bouyer. All rights reserved.
@ -87,7 +87,7 @@
/*
* Note that the EXTSTAT bit indicates that there is extended status
* info available in register 15, but 802.3 section 22.2.4.3 also
* states that that all 1000 Mb/s capable PHYs will set this bit to 1.
* states that all 1000 Mb/s capable PHYs will set this bit to 1.
*/
#define BMSR_MEDIAMASK (BMSR_100T4|BMSR_100TXFDX|BMSR_100TXHDX| \
@ -111,6 +111,7 @@
#define ANAR_NP 0x8000 /* Next page (ro) */
#define ANAR_ACK 0x4000 /* link partner abilities acknowledged (ro) */
#define ANAR_RF 0x2000 /* remote fault (ro) */
/* Annex 28B.2 */
#define ANAR_FC 0x0400 /* local device supports PAUSE */
#define ANAR_T4 0x0200 /* local device supports 100bT4 */
#define ANAR_TX_FD 0x0100 /* local device supports 100bTx FD */
@ -123,6 +124,7 @@
#define ANAR_PAUSE_ASYM (2 << 10)
#define ANAR_PAUSE_TOWARDS (3 << 10)
/* Annex 28D */
#define ANAR_X_FD 0x0020 /* local device supports 1000BASE-X FD */
#define ANAR_X_HD 0x0040 /* local device supports 1000BASE-X HD */
#define ANAR_X_PAUSE_NONE (0 << 7)
@ -184,12 +186,47 @@
#define GTSR_MAN_MS_FLT 0x8000 /* master/slave config fault */
#define GTSR_MS_RES 0x4000 /* result: 1 = master, 0 = slave */
#define GTSR_LRS 0x2000 /* local rx status, 1 = ok */
#define GTSR_RRS 0x1000 /* remove rx status, 1 = ok */
#define GTSR_RRS 0x1000 /* remote rx status, 1 = ok */
#define GTSR_LP_1000TFDX 0x0800 /* link partner 1000baseT FDX capable */
#define GTSR_LP_1000THDX 0x0400 /* link partner 1000baseT HDX capable */
#define GTSR_LP_ASM_DIR 0x0200 /* link partner asym. pause dir. capable */
#define GTSR_IDLE_ERR 0x00ff /* IDLE error count */
#define MII_PSECR 0x0b /* PSE control register */
#define PSECR_PACTLMASK 0x000c /* pair control mask */
#define PSECR_PSEENMASK 0x0003 /* PSE enable mask */
#define PSECR_PINOUTB 0x0008 /* PSE pinout Alternative B */
#define PSECR_PINOUTA 0x0004 /* PSE pinout Alternative A */
#define PSECR_FOPOWTST 0x0002 /* Force Power Test Mode */
#define PSECR_PSEEN 0x0001 /* PSE Enabled */
#define PSECR_PSEDIS 0x0000 /* PSE Disabled */
#define MII_PSESR 0x0c /* PSE status register */
#define PSESR_PWRDENIED 0x1000 /* Power Denied */
#define PSESR_VALSIG 0x0800 /* Valid PD signature detected */
#define PSESR_INVALSIG 0x0400 /* Inalid PD signature detected */
#define PSESR_SHORTCIRC 0x0200 /* Short circuit condition detected */
#define PSESR_OVERLOAD 0x0100 /* Overload condition detected */
#define PSESR_MPSABSENT 0x0080 /* MPS absent condition detected */
#define PSESR_PDCLMASK 0x0070 /* PD Class mask */
#define PSESR_STATMASK 0x000e /* PSE Status mask */
#define PSESR_PAIRCTABL 0x0001 /* PAIR Control Ability */
#define PSESR_PDCL_4 (4 << 4) /* Class 4 */
#define PSESR_PDCL_3 (3 << 4) /* Class 3 */
#define PSESR_PDCL_2 (2 << 4) /* Class 2 */
#define PSESR_PDCL_1 (1 << 4) /* Class 1 */
#define PSESR_PDCL_0 (0 << 4) /* Class 0 */
#define MII_MMDACR 0x0d /* MMD access control register */
#define MMDACR_FUNCMASK 0xc000 /* function */
#define MMDACR_DADDRMASK 0x001f /* device address */
#define MMDACR_FN_ADDRESS (0 << 14) /* address */
#define MMDACR_FN_DATANPI (1 << 14) /* data, no post increment */
#define MMDACR_FN_DATAPIRW (2 << 14) /* data, post increment on r/w */
#define MMDACR_FN_DATAPIW (3 << 14) /* data, post increment on wr only */
#define MII_MMDAADR 0x0e /* MMD access address data register */
#define MII_EXTSR 0x0f /* Extended status register */
#define EXTSR_1000XFDX 0x8000 /* 1000X full-duplex capable */
#define EXTSR_1000XHDX 0x4000 /* 1000X half-duplex capable */

View File

@ -482,7 +482,7 @@ fdesc_setattr(ap)
/*
* Allow setattr where there is an underlying vnode.
*/
error = getvnode(td->td_proc->p_fd, fd,
error = getvnode(td, fd,
cap_rights_init(&rights, CAP_EXTATTR_SET), &fp);
if (error) {
/*

View File

@ -342,8 +342,7 @@ ibcs2_getdents(td, uap)
#define BSD_DIRENT(cp) ((struct dirent *)(cp))
#define IBCS2_RECLEN(reclen) (reclen + sizeof(u_short))
error = getvnode(td->td_proc->p_fd, uap->fd,
cap_rights_init(&rights, CAP_READ), &fp);
error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp);
if (error != 0)
return (error);
if ((fp->f_flag & FREAD) == 0) {
@ -498,8 +497,7 @@ ibcs2_read(td, uap)
u_long *cookies = NULL, *cookiep;
int ncookies;
error = getvnode(td->td_proc->p_fd, uap->fd,
cap_rights_init(&rights, CAP_READ), &fp);
error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp);
if (error != 0) {
if (error == EINVAL)
return sys_read(td, (struct read_args *)uap);

View File

@ -746,7 +746,8 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg)
arg = arg ? 128 * 1024: 0;
/* FALLTHROUGH */
case F_READAHEAD:
error = fget_unlocked(fdp, fd, NULL, &fp, NULL);
error = fget_unlocked(fdp, fd,
cap_rights_init(&rights), &fp, NULL);
if (error != 0)
break;
if (fp->f_type != DTYPE_VNODE) {
@ -2368,11 +2369,9 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp,
if (fp == NULL)
return (EBADF);
#ifdef CAPABILITIES
if (needrightsp != NULL) {
error = cap_check(&haverights, needrightsp);
if (error != 0)
return (error);
}
error = cap_check(&haverights, needrightsp);
if (error != 0)
return (error);
#endif
retry:
count = fp->f_count;
@ -2433,11 +2432,9 @@ _fget(struct thread *td, int fd, struct file **fpp, int flags,
*fpp = NULL;
fdp = td->td_proc->p_fd;
if (needrightsp != NULL)
needrights = *needrightsp;
else
cap_rights_init(&needrights);
error = fget_unlocked(fdp, fd, &needrights, &fp, seqp);
if (needrightsp == NULL)
needrightsp = cap_rights_init(&needrights);
error = fget_unlocked(fdp, fd, needrightsp, &fp, seqp);
if (error != 0)
return (error);
if (fp->f_ops == &badfileops) {

View File

@ -406,7 +406,7 @@ sys___acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap)
cap_rights_t rights;
int error;
error = getvnode(td->td_proc->p_fd, uap->filedes,
error = getvnode(td, uap->filedes,
cap_rights_init(&rights, CAP_ACL_GET), &fp);
if (error == 0) {
error = vacl_get_acl(td, fp->f_vnode, uap->type, uap->aclp);
@ -425,7 +425,7 @@ sys___acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap)
cap_rights_t rights;
int error;
error = getvnode(td->td_proc->p_fd, uap->filedes,
error = getvnode(td, uap->filedes,
cap_rights_init(&rights, CAP_ACL_SET), &fp);
if (error == 0) {
error = vacl_set_acl(td, fp->f_vnode, uap->type, uap->aclp);
@ -480,7 +480,7 @@ sys___acl_delete_fd(struct thread *td, struct __acl_delete_fd_args *uap)
cap_rights_t rights;
int error;
error = getvnode(td->td_proc->p_fd, uap->filedes,
error = getvnode(td, uap->filedes,
cap_rights_init(&rights, CAP_ACL_DELETE), &fp);
if (error == 0) {
error = vacl_delete(td, fp->f_vnode, uap->type);
@ -535,7 +535,7 @@ sys___acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap)
cap_rights_t rights;
int error;
error = getvnode(td->td_proc->p_fd, uap->filedes,
error = getvnode(td, uap->filedes,
cap_rights_init(&rights, CAP_ACL_CHECK), &fp);
if (error == 0) {
error = vacl_aclcheck(td, fp->f_vnode, uap->type, uap->aclp);

View File

@ -226,7 +226,7 @@ sys_extattr_set_fd(td, uap)
return (error);
AUDIT_ARG_TEXT(attrname);
error = getvnode(td->td_proc->p_fd, uap->fd,
error = getvnode(td, uap->fd,
cap_rights_init(&rights, CAP_EXTATTR_SET), &fp);
if (error)
return (error);
@ -401,7 +401,7 @@ sys_extattr_get_fd(td, uap)
return (error);
AUDIT_ARG_TEXT(attrname);
error = getvnode(td->td_proc->p_fd, uap->fd,
error = getvnode(td, uap->fd,
cap_rights_init(&rights, CAP_EXTATTR_GET), &fp);
if (error)
return (error);
@ -545,7 +545,7 @@ sys_extattr_delete_fd(td, uap)
return (error);
AUDIT_ARG_TEXT(attrname);
error = getvnode(td->td_proc->p_fd, uap->fd,
error = getvnode(td, uap->fd,
cap_rights_init(&rights, CAP_EXTATTR_DELETE), &fp);
if (error)
return (error);
@ -697,7 +697,7 @@ sys_extattr_list_fd(td, uap)
AUDIT_ARG_FD(uap->fd);
AUDIT_ARG_VALUE(uap->attrnamespace);
error = getvnode(td->td_proc->p_fd, uap->fd,
error = getvnode(td, uap->fd,
cap_rights_init(&rights, CAP_EXTATTR_LIST), &fp);
if (error)
return (error);

View File

@ -365,8 +365,7 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf)
int error;
AUDIT_ARG_FD(fd);
error = getvnode(td->td_proc->p_fd, fd,
cap_rights_init(&rights, CAP_FSTATFS), &fp);
error = getvnode(td, fd, cap_rights_init(&rights, CAP_FSTATFS), &fp);
if (error != 0)
return (error);
vp = fp->f_vnode;
@ -737,7 +736,7 @@ sys_fchdir(td, uap)
int error;
AUDIT_ARG_FD(uap->fd);
error = getvnode(fdp, uap->fd, cap_rights_init(&rights, CAP_FCHDIR),
error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_FCHDIR),
&fp);
if (error != 0)
return (error);
@ -2671,8 +2670,8 @@ sys_fchflags(td, uap)
AUDIT_ARG_FD(uap->fd);
AUDIT_ARG_FFLAGS(uap->flags);
error = getvnode(td->td_proc->p_fd, uap->fd,
cap_rights_init(&rights, CAP_FCHFLAGS), &fp);
error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_FCHFLAGS),
&fp);
if (error != 0)
return (error);
#ifdef AUDIT
@ -3239,8 +3238,7 @@ kern_futimes(struct thread *td, int fd, struct timeval *tptr,
error = getutimes(tptr, tptrseg, ts);
if (error != 0)
return (error);
error = getvnode(td->td_proc->p_fd, fd,
cap_rights_init(&rights, CAP_FUTIMES), &fp);
error = getvnode(td, fd, cap_rights_init(&rights, CAP_FUTIMES), &fp);
if (error != 0)
return (error);
#ifdef AUDIT
@ -3275,8 +3273,7 @@ kern_futimens(struct thread *td, int fd, struct timespec *tptr,
return (error);
if (flags & UTIMENS_EXIT)
return (0);
error = getvnode(td->td_proc->p_fd, fd,
cap_rights_init(&rights, CAP_FUTIMES), &fp);
error = getvnode(td, fd, cap_rights_init(&rights, CAP_FUTIMES), &fp);
if (error != 0)
return (error);
#ifdef AUDIT
@ -3470,8 +3467,7 @@ sys_fsync(td, uap)
int error, lock_flags;
AUDIT_ARG_FD(uap->fd);
error = getvnode(td->td_proc->p_fd, uap->fd,
cap_rights_init(&rights, CAP_FSYNC), &fp);
error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_FSYNC), &fp);
if (error != 0)
return (error);
vp = fp->f_vnode;
@ -3894,8 +3890,7 @@ kern_ogetdirentries(struct thread *td, struct ogetdirentries_args *uap,
/* XXX arbitrary sanity limit on `count'. */
if (uap->count > 64 * 1024)
return (EINVAL);
error = getvnode(td->td_proc->p_fd, uap->fd,
cap_rights_init(&rights, CAP_READ), &fp);
error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp);
if (error != 0)
return (error);
if ((fp->f_flag & FREAD) == 0) {
@ -4058,8 +4053,7 @@ kern_getdirentries(struct thread *td, int fd, char *buf, u_int count,
if (count > IOSIZE_MAX)
return (EINVAL);
auio.uio_resid = count;
error = getvnode(td->td_proc->p_fd, fd,
cap_rights_init(&rights, CAP_READ), &fp);
error = getvnode(td, fd, cap_rights_init(&rights, CAP_READ), &fp);
if (error != 0)
return (error);
if ((fp->f_flag & FREAD) == 0) {
@ -4225,12 +4219,12 @@ sys_revoke(td, uap)
* entry is held upon returning.
*/
int
getvnode(struct filedesc *fdp, int fd, cap_rights_t *rightsp, struct file **fpp)
getvnode(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp)
{
struct file *fp;
int error;
error = fget_unlocked(fdp, fd, rightsp, &fp, NULL);
error = fget_unlocked(td->td_proc->p_fd, fd, rightsp, &fp, NULL);
if (error != 0)
return (error);
@ -4247,7 +4241,7 @@ getvnode(struct filedesc *fdp, int fd, cap_rights_t *rightsp, struct file **fpp)
* checking f_ops.
*/
if (fp->f_vnode == NULL || fp->f_ops == &badfileops) {
fdrop(fp, curthread);
fdrop(fp, td);
return (EINVAL);
}
*fpp = fp;

View File

@ -33,6 +33,7 @@
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/refcount.h>
#include <sys/capsicum.h>
#include <sys/proc.h>
#include <linux/fs.h>
@ -46,10 +47,11 @@ extern struct fileops linuxfileops;
static inline struct linux_file *
linux_fget(unsigned int fd)
{
cap_rights_t rights;
struct file *file;
if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, &file,
NULL) != 0) {
if (fget_unlocked(curthread->td_proc->p_fd, fd,
cap_rights_init(&rights), &file, NULL) != 0) {
return (NULL);
}
return (struct linux_file *)file->f_data;
@ -71,10 +73,11 @@ fput(struct linux_file *filp)
static inline void
put_unused_fd(unsigned int fd)
{
cap_rights_t rights;
struct file *file;
if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, &file,
NULL) != 0) {
if (fget_unlocked(curthread->td_proc->p_fd, fd,
cap_rights_init(&rights), &file, NULL) != 0) {
return;
}
/*
@ -91,10 +94,11 @@ put_unused_fd(unsigned int fd)
static inline void
fd_install(unsigned int fd, struct linux_file *filp)
{
cap_rights_t rights;
struct file *file;
if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, &file,
NULL) != 0) {
if (fget_unlocked(curthread->td_proc->p_fd, fd,
cap_rights_init(&rights), &file, NULL) != 0) {
file = NULL;
}
filp->_file = file;

View File

@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/filedesc.h>
#include <sys/capsicum.h>
#include <sys/ipc.h>
#include <sys/mount.h>
#include <sys/proc.h>
@ -894,6 +895,7 @@ audit_arg_fcntl_rights(uint32_t fcntlrights)
void
audit_sysclose(struct thread *td, int fd)
{
cap_rights_t rights;
struct kaudit_record *ar;
struct vnode *vp;
struct file *fp;
@ -906,7 +908,7 @@ audit_sysclose(struct thread *td, int fd)
audit_arg_fd(fd);
if (getvnode(td->td_proc->p_fd, fd, 0, &fp) != 0)
if (getvnode(td, fd, cap_rights_init(&rights), &fp) != 0)
return;
vp = fp->f_vnode;

View File

@ -165,7 +165,7 @@ struct filedesc *fdshare(struct filedesc *fdp);
struct filedesc_to_leader *
filedesc_to_leader_alloc(struct filedesc_to_leader *old,
struct filedesc *fdp, struct proc *leader);
int getvnode(struct filedesc *fdp, int fd, cap_rights_t *rightsp,
int getvnode(struct thread *td, int fd, cap_rights_t *rightsp,
struct file **fpp);
void mountcheckdirs(struct vnode *olddp, struct vnode *newdp);

View File

@ -2766,7 +2766,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS)
return (error);
if (cmd.version != FFS_CMD_VERSION)
return (ERPCMISMATCH);
if ((error = getvnode(td->td_proc->p_fd, cmd.handle,
if ((error = getvnode(td, cmd.handle,
cap_rights_init(&rights, CAP_FSCK), &fp)) != 0)
return (error);
vp = fp->f_data;
@ -3080,7 +3080,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS)
(intmax_t)cmd.value);
}
#endif /* DEBUG */
if ((error = getvnode(td->td_proc->p_fd, cmd.value,
if ((error = getvnode(td, cmd.value,
cap_rights_init(&rights, CAP_FSCK), &vfp)) != 0)
break;
if (vfp->f_vnode->v_type != VCHR) {

View File

@ -7,21 +7,38 @@ DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
.if !defined(MK_CLANG)
.include "${SRCTOP}/share/mk/src.opts.mk"
.endif
DIRDEPS=
.if ${MK_ELFTOOLCHAIN_TOOLS} == "yes"
DIRDEPS+= \
usr.bin/addr2line \
usr.bin/cxxflit \
usr.bin/elfcopy \
usr.bin/nm \
usr.bin/readelf \
usr.bin/size \
usr.bin/strip \
usr.bin/strings \
.else
DIRDEPS+= \
gnu/usr.bin/binutils/addr2line \
gnu/usr.bin/binutils/nm \
gnu/usr.bin/binutils/readelf \
gnu/usr.bin/binutils/size \
gnu/usr.bin/binutils/strip \
gnu/usr.bin/binutils/strings \
.endif
DIRDEPS= \
usr.bin/xinstall \
gnu/usr.bin/binutils/addr2line \
gnu/usr.bin/binutils/ar \
gnu/usr.bin/binutils/as \
gnu/usr.bin/binutils/ld \
gnu/usr.bin/binutils/nm \
gnu/usr.bin/binutils/objcopy \
gnu/usr.bin/binutils/objdump \
gnu/usr.bin/binutils/ranlib \
gnu/usr.bin/binutils/readelf \
gnu/usr.bin/binutils/size \
gnu/usr.bin/binutils/strings \
gnu/usr.bin/binutils/strip \
.if ${MK_CLANG} == "yes"

View File

@ -16,8 +16,7 @@ SRCS= Driver.cpp \
lldb.1:
ln -fs ${LLDB_SRCS}/docs/lldb.1 ${.TARGET}
DPADD= ${LIBEDIT} ${LIBNCURSESW} ${LIBEXECINFO} ${LIBPANEL} ${LIBZ}
LDADD= -ledit -lncursesw -lexecinfo -lpanel -lz
LIBADD= edit panel ncursesw execinfo z
LLDB_LIBS=\
lldb \

View File

@ -0,0 +1,25 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
lib/${CSU_DIR} \
lib/libarchive \
lib/libbz2 \
lib/libc \
lib/libcompiler_rt \
lib/libelf \
lib/libelftc \
lib/libexpat \
lib/liblzma \
lib/libthr \
lib/libz \
secure/lib/libcrypto \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
.endif

View File

@ -8,8 +8,6 @@ FILESDIR= ${LINTLIBDIR}
CLEANFILES+= ${LIBS}
llib-lposix.ln: llib-lposix
${LINT} ${LINTFLAGS} -Cposix ${.ALLSRC}

View File

@ -1110,7 +1110,7 @@ prog_makefile_rules(FILE *outmk, prog_t *p)
fprintf(outmk, " $(%s_LIBS)", p->ident);
fprintf(outmk, "\n");
fprintf(outmk, "\t$(CC) -nostdlib -Wl,-dc -Wl,-r -o %s.lo %s_stub.o $(%s_OBJPATHS)",
fprintf(outmk, "\t$(CC) -nostdlib -Wl,-dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)",
p->name, p->name, p->ident);
if (p->libs)
fprintf(outmk, " $(%s_LIBS)", p->ident);

View File

@ -216,7 +216,15 @@ config_KeepModifiedMetadata () {
# Add to the list of components which should be kept updated.
config_Components () {
for C in $@; do
COMPONENTS="${COMPONENTS} ${C}"
if [ "$C" = "src" ]; then
if [ -e /usr/src/COPYRIGHT ]; then
COMPONENTS="${COMPONENTS} ${C}"
else
echo "src component not installed, skipped"
fi
else
COMPONENTS="${COMPONENTS} ${C}"
fi
done
}
@ -2642,10 +2650,10 @@ install_unschg () {
while read F; do
if ! [ -e ${BASEDIR}/${F} ]; then
continue
else
echo ${BASEDIR}/${F}
fi
chflags noschg ${BASEDIR}/${F} || return 1
done < filelist
done < filelist | xargs chflags noschg || return 1
# Clean up
rm filelist