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. # 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 # targets/Makefile plays the role of top-level
.include "targets/Makefile" .include "targets/Makefile"
.else .else
@ -436,9 +439,13 @@ universe_epilogue: universe_${target}
universe_${target}: universe_${target}_prologue universe_${target}: universe_${target}_prologue
universe_${target}_prologue: universe_prologue universe_${target}_prologue: universe_prologue
@echo ">> ${target} started on `LC_ALL=C date`" @echo ">> ${target} started on `LC_ALL=C date`"
universe_${target}_worlds:
.if !defined(MAKE_JUST_KERNELS) .if !defined(MAKE_JUST_KERNELS)
.for target_arch in ${TARGET_ARCHES_${target}} .for target_arch in ${TARGET_ARCHES_${target}}
universe_${target}: universe_${target}_${target_arch} 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 universe_${target}_${target_arch}: universe_${target}_prologue .MAKE
@echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`" @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`"
@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
@ -451,15 +458,12 @@ universe_${target}_${target_arch}: universe_${target}_prologue .MAKE
${MAKEFAIL})) ${MAKEFAIL}))
@echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`" @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`"
.endfor .endfor
.endif .endif # !MAKE_JUST_KERNELS
.if !defined(MAKE_JUST_WORLDS) .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}: universe_${target}_kernels
universe_${target}_done: universe_${target}_kernels
universe_${target}_kernels: universe_${target}_worlds
universe_${target}_kernels: universe_${target}_prologue .MAKE universe_${target}_kernels: universe_${target}_prologue .MAKE
.if exists(${KERNSRCDIR}/${target}/conf/NOTES) .if exists(${KERNSRCDIR}/${target}/conf/NOTES)
@(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \
@ -469,7 +473,11 @@ universe_${target}_kernels: universe_${target}_prologue .MAKE
.endif .endif
@cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ @cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \
universe_kernels 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`" @echo ">> ${target} completed on `LC_ALL=C date`"
.endfor .endfor
universe_kernels: universe_kernconfs universe_kernels: universe_kernconfs
@ -522,6 +530,7 @@ universe_epilogue:
buildLINT: buildLINT:
${MAKE} -C ${.CURDIR}/sys/${_TARGET}/conf LINT ${MAKE} -C ${.CURDIR}/sys/${_TARGET}/conf LINT
.if defined(.PARSEDIR)
# This makefile does not run in meta mode # This makefile does not run in meta mode
.MAKE.MODE= normal .MAKE.MODE= normal
# Normally the things we run from here don't either. # Normally the things we run from here don't either.
@ -539,5 +548,6 @@ UPDATE_DEPENDFILE= NO
MAKE_JOB_ERROR_TOKEN= no MAKE_JOB_ERROR_TOKEN= no
.export MAKE_JOB_ERROR_TOKEN .export MAKE_JOB_ERROR_TOKEN
.endif .endif
.endif # bmake
.endif # META_MODE .endif # META_MODE

View File

@ -466,6 +466,8 @@ LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${LIB32_OBJTREE} \
LIB32WMAKEFLAGS+= CC="${XCC} ${LIB32FLAGS}" \ LIB32WMAKEFLAGS+= CC="${XCC} ${LIB32FLAGS}" \
CXX="${XCXX} ${LIB32FLAGS}" \ CXX="${XCXX} ${LIB32FLAGS}" \
DESTDIR=${LIB32TMP} \ DESTDIR=${LIB32TMP} \
SHLIBDIR=/usr/lib32 \
LIBDIR=/usr/lib32 \
-DCOMPAT_32BIT \ -DCOMPAT_32BIT \
-DLIBRARIES_ONLY \ -DLIBRARIES_ONLY \
-DNO_CPU_CFLAGS \ -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 disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".) "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: 20150614:
ALLOW_DEPRECATED_ATF_TOOLS/ATFFILE support has been removed from ALLOW_DEPRECATED_ATF_TOOLS/ATFFILE support has been removed from
atf.test.mk (included from bsd.test.mk). Please upgrade devel/atf 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_comutil.c \
zfs_deleg.c \ zfs_deleg.c \
zfs_fletcher.c \ zfs_fletcher.c \
zfs_ioctl_compat.c \
zfs_namecheck.c \ zfs_namecheck.c \
zfs_prop.c \ zfs_prop.c \
zpool_prop.c \ zpool_prop.c \

View File

@ -11,7 +11,8 @@ DPADD= ${LIBNVPAIR}
LDADD= -lnvpair LDADD= -lnvpair
SRCS= libzfs_core.c \ SRCS= libzfs_core.c \
libzfs_core_compat.c libzfs_core_compat.c \
zfs_ioctl_compat.c
SRCS+= libzfs_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 ** 1024 generate 1024 bit parameters
** 2048 generate 2048 bit parameters ** 2048 generate 2048 bit parameters
** /file/name read parameters from /file/name ** /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)) if (bitset(TLS_I_TRY_DH, req))
@ -676,8 +676,8 @@ inittls(ctx, req, options, srv, certfile, keyfile, cacertpath, cacertfile, dhpar
} }
if (dhparam == NULL) if (dhparam == NULL)
{ {
dhparam = srv ? "1" : "5"; dhparam = "1";
req |= (srv ? TLS_I_DH1024 : TLS_I_DH512); req |= TLS_I_DH1024;
} }
else if (*dhparam == '/') else if (*dhparam == '/')
{ {

View File

@ -27,13 +27,5 @@ SRCS+= aeabi_memcmp.S \
aeabi_memmove.S \ aeabi_memmove.S \
aeabi_memset.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 SYM_MAPS+=${LIBC_SRCTOP}/arm/aeabi/Symbol.map

View File

@ -52,4 +52,21 @@ FBSDprivate_1.0 {
__aeabi_i2d; __aeabi_i2d;
__aeabi_i2f; __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. * Exceptional values are noted in the comments within the source code.
* These values and the return value were taken from n1124.pdf. * 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> #include <sys/cdefs.h>
@ -63,7 +65,7 @@ ccosh(double complex z)
if (ix < 0x7ff00000 && iy < 0x7ff00000) { if (ix < 0x7ff00000 && iy < 0x7ff00000) {
if ((iy | ly) == 0) if ((iy | ly) == 0)
return (CMPLX(cosh(x), x * y)); 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))); return (CMPLX(cosh(x) * cos(y), sinh(x) * sin(y)));
/* |x| >= 22, so cosh(x) ~= exp(|x|) */ /* |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. * cosh(+-0 +- I Inf) = dNaN + I (+-)(+-)0.
* The sign of 0 in the result is unspecified. Choice = normally * The sign of 0 in the result is unspecified. Choice = product
* the same as dNaN. Raise the invalid floating-point exception. * of the signs of the argument. Raise the invalid floating-point
* exception.
* *
* cosh(+-0 +- I NaN) = d(NaN) + I sign(d(+-0, NaN))0. * cosh(+-0 +- I NaN) = d(NaN) + I (+-)(+-)0.
* The sign of 0 in the result is unspecified. Choice = normally * The sign of 0 in the result is unspecified. Choice = product
* the same as d(NaN). * of the signs of the argument.
*/ */
if ((ix | lx) == 0 && iy >= 0x7ff00000) if ((ix | lx) == 0) /* && iy >= 0x7ff00000 */
return (CMPLX(y - y, copysign(0, x * (y - y)))); return (CMPLX(y - y, x * copysign(0, y)));
/* /*
* cosh(+-Inf +- I 0) = +Inf + I (+-)(+-)0. * cosh(+-Inf +- I 0) = +Inf + I (+-)(+-)0.
* *
* cosh(NaN +- I 0) = d(NaN) + I sign(d(NaN, +-0))0. * cosh(NaN +- I 0) = d(NaN) + I (+-)(+-)0.
* The sign of 0 in the result is unspecified. * The sign of 0 in the result is unspecified. Choice = product
* of the signs of the argument.
*/ */
if ((iy | ly) == 0 && ix >= 0x7ff00000) { 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) * y));
return (CMPLX(x * x, copysign(0, (x + x) * y)));
}
/* /*
* cosh(x +- I Inf) = dNaN + I dNaN. * cosh(x +- I Inf) = dNaN + I dNaN.
@ -114,7 +115,7 @@ ccosh(double complex z)
* Optionally raises the invalid floating-point exception for finite * Optionally raises the invalid floating-point exception for finite
* nonzero x. Choice = don't raise (except for signaling NaNs). * 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))); 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) * 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) if (iy >= 0x7ff00000)
return (CMPLX(x * x, x * (y - y))); return (CMPLX(INFINITY, x * (y - y)));
return (CMPLX((x * x) * cos(y), x * sin(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> #include <sys/cdefs.h>
@ -56,13 +56,13 @@ ccoshf(float complex z)
if (ix < 0x7f800000 && iy < 0x7f800000) { if (ix < 0x7f800000 && iy < 0x7f800000) {
if (iy == 0) if (iy == 0)
return (CMPLXF(coshf(x), x * y)); 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))); return (CMPLXF(coshf(x) * cosf(y), sinhf(x) * sinf(y)));
/* |x| >= 9, so cosh(x) ~= exp(|x|) */ /* |x| >= 9, so cosh(x) ~= exp(|x|) */
if (ix < 0x42b17218) { if (ix < 0x42b17218) {
/* x < 88.7: expf(|x|) won't overflow */ /* 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))); return (CMPLXF(h * cosf(y), copysignf(h, x) * sinf(y)));
} else if (ix < 0x4340b1e7) { } else if (ix < 0x4340b1e7) {
/* x < 192.7: scale to avoid overflow */ /* x < 192.7: scale to avoid overflow */
@ -75,22 +75,19 @@ ccoshf(float complex z)
} }
} }
if (ix == 0 && iy >= 0x7f800000) if (ix == 0) /* && iy >= 0x7f800000 */
return (CMPLXF(y - y, copysignf(0, x * (y - y)))); return (CMPLXF(y - y, x * copysignf(0, y)));
if (iy == 0 && ix >= 0x7f800000) { if (iy == 0) /* && ix >= 0x7f800000 */
if ((hx & 0x7fffff) == 0) return (CMPLXF(x * x, copysignf(0, x) * y));
return (CMPLXF(x * x, copysignf(0, x) * y));
return (CMPLXF(x * x, copysignf(0, (x + x) * y)));
}
if (ix < 0x7f800000 && iy >= 0x7f800000) if (ix < 0x7f800000) /* && iy >= 0x7f800000 */
return (CMPLXF(y - y, x * (y - y))); return (CMPLXF(y - y, x * (y - y)));
if (ix >= 0x7f800000 && (hx & 0x7fffff) == 0) { if (ix == 0x7f800000) {
if (iy >= 0x7f800000) if (iy >= 0x7f800000)
return (CMPLXF(x * x, x * (y - y))); return (CMPLXF(INFINITY, x * (y - y)));
return (CMPLXF((x * x) * cosf(y), x * sinf(y))); return (CMPLXF(INFINITY * cosf(y), x * sinf(y)));
} }
return (CMPLXF((x * x) * (y - y), (x + x) * (y - 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. * Exceptional values are noted in the comments within the source code.
* These values and the return value were taken from n1124.pdf. * 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> #include <sys/cdefs.h>
@ -63,7 +65,7 @@ csinh(double complex z)
if (ix < 0x7ff00000 && iy < 0x7ff00000) { if (ix < 0x7ff00000 && iy < 0x7ff00000) {
if ((iy | ly) == 0) if ((iy | ly) == 0)
return (CMPLX(sinh(x), y)); 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))); return (CMPLX(sinh(x) * cos(y), cosh(x) * sin(y)));
/* |x| >= 22, so cosh(x) ~= exp(|x|) */ /* |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. * sinh(+-0 +- I Inf) = +-0 + I dNaN.
* The sign of 0 in the result is unspecified. Choice = normally * The sign of 0 in the result is unspecified. Choice = same sign
* the same as dNaN. Raise the invalid floating-point exception. * as the argument. Raise the invalid floating-point exception.
* *
* sinh(+-0 +- I NaN) = sign(d(+-0, NaN))0 + I d(NaN). * sinh(+-0 +- I NaN) = +-0 + I d(NaN).
* The sign of 0 in the result is unspecified. Choice = normally * The sign of 0 in the result is unspecified. Choice = same sign
* the same as d(NaN). * as the argument.
*/ */
if ((ix | lx) == 0 && iy >= 0x7ff00000) if ((ix | lx) == 0) /* && iy >= 0x7ff00000 */
return (CMPLX(copysign(0, x * (y - y)), y - y)); return (CMPLX(x, y - y));
/* /*
* sinh(+-Inf +- I 0) = +-Inf + I +-0. * sinh(+-Inf +- I 0) = +-Inf + I +-0.
* *
* sinh(NaN +- I 0) = d(NaN) + I +-0. * sinh(NaN +- I 0) = d(NaN) + I +-0.
*/ */
if ((iy | ly) == 0 && ix >= 0x7ff00000) { if ((iy | ly) == 0) /* && ix >= 0x7ff00000 */
if (((hx & 0xfffff) | lx) == 0) return (CMPLX(x + x, y));
return (CMPLX(x, y));
return (CMPLX(x, copysign(0, y)));
}
/* /*
* sinh(x +- I Inf) = dNaN + I dNaN. * sinh(x +- I Inf) = dNaN + I dNaN.
@ -113,45 +112,45 @@ csinh(double complex z)
* Optionally raises the invalid floating-point exception for finite * Optionally raises the invalid floating-point exception for finite
* nonzero x. Choice = don't raise (except for signaling NaNs). * 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))); return (CMPLX(y - y, y - y));
/* /*
* sinh(+-Inf + I NaN) = +-Inf + I d(NaN). * sinh(+-Inf + I NaN) = +-Inf + I d(NaN).
* The sign of Inf in the result is unspecified. Choice = normally * The sign of Inf in the result is unspecified. Choice = same sign
* the same as d(NaN). * as the argument.
* *
* sinh(+-Inf +- I Inf) = +Inf + I dNaN. * sinh(+-Inf +- I Inf) = +-Inf + I dNaN.
* The sign of Inf in the result is unspecified. Choice = always +. * The sign of Inf in the result is unspecified. Choice = same sign
* Raise the invalid floating-point exception. * as the argument. Raise the invalid floating-point exception.
* *
* sinh(+-Inf + I y) = +-Inf cos(y) + I Inf sin(y) * 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) if (iy >= 0x7ff00000)
return (CMPLX(x * x, x * (y - y))); return (CMPLX(x, y - y));
return (CMPLX(x * cos(y), INFINITY * sin(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. * Optionally raises the invalid floating-point exception.
* Choice = raise. * 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 * Optionally raises the invalid floating-point exception for finite
* nonzero y. Choice = don't raise (except for signaling NaNs). * 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 double complex
csin(double complex z) csin(double complex z)
{ {
/* csin(z) = -I * csinh(I * z) */ /* csin(z) = -I * csinh(I * z) = I * conj(csinh(I * conj(z))). */
z = csinh(CMPLX(-cimag(z), creal(z))); z = csinh(CMPLX(cimag(z), creal(z)));
return (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> #include <sys/cdefs.h>
@ -56,13 +56,13 @@ csinhf(float complex z)
if (ix < 0x7f800000 && iy < 0x7f800000) { if (ix < 0x7f800000 && iy < 0x7f800000) {
if (iy == 0) if (iy == 0)
return (CMPLXF(sinhf(x), y)); 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))); return (CMPLXF(sinhf(x) * cosf(y), coshf(x) * sinf(y)));
/* |x| >= 9, so cosh(x) ~= exp(|x|) */ /* |x| >= 9, so cosh(x) ~= exp(|x|) */
if (ix < 0x42b17218) { if (ix < 0x42b17218) {
/* x < 88.7: expf(|x|) won't overflow */ /* 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))); return (CMPLXF(copysignf(h, x) * cosf(y), h * sinf(y)));
} else if (ix < 0x4340b1e7) { } else if (ix < 0x4340b1e7) {
/* x < 192.7: scale to avoid overflow */ /* x < 192.7: scale to avoid overflow */
@ -75,31 +75,28 @@ csinhf(float complex z)
} }
} }
if (ix == 0 && iy >= 0x7f800000) if (ix == 0) /* && iy >= 0x7f800000 */
return (CMPLXF(copysignf(0, x * (y - y)), y - y)); return (CMPLXF(x, y - y));
if (iy == 0 && ix >= 0x7f800000) { if (iy == 0) /* && ix >= 0x7f800000 */
if ((hx & 0x7fffff) == 0) return (CMPLXF(x + x, y));
return (CMPLXF(x, y));
return (CMPLXF(x, copysignf(0, y)));
}
if (ix < 0x7f800000 && iy >= 0x7f800000) if (ix < 0x7f800000) /* && iy >= 0x7f800000 */
return (CMPLXF(y - y, x * (y - y))); return (CMPLXF(y - y, y - y));
if (ix >= 0x7f800000 && (hx & 0x7fffff) == 0) { if (ix == 0x7f800000) {
if (iy >= 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 * 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 float complex
csinf(float complex z) csinf(float complex z)
{ {
z = csinhf(CMPLXF(-cimagf(z), crealf(z))); z = csinhf(CMPLXF(cimagf(z), crealf(z)));
return (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: * The algorithm is from:
* *
@ -44,15 +44,15 @@
* *
* tanh(z) = sinh(z) / cosh(z) * 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) * 1 + sinh^2(x) / cos^2(y)
* *
* beta rho s + i t * beta rho s + I t
* = ---------------- * = ----------------
* 1 + beta s^2 * 1 + beta s^2
* *
@ -85,16 +85,16 @@ ctanh(double complex z)
ix = hx & 0x7fffffff; 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 * The imaginary part has the sign of x*sin(2*y), but there's no
* special effort to get this right. * 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 * The imaginary part of the sign is unspecified. This special
* case is only needed to avoid a spurious invalid exception when * case is only needed to avoid a spurious invalid exception when
@ -102,24 +102,25 @@ ctanh(double complex z)
*/ */
if (ix >= 0x7ff00000) { if (ix >= 0x7ff00000) {
if ((ix & 0xfffff) | lx) /* x is NaN */ 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) */ SET_HIGH_WORD(x, hx - 0x40000000); /* x = copysign(1, x) */
return (CMPLX(x, copysign(0, isinf(y) ? y : sin(y) * cos(y)))); return (CMPLX(x, copysign(0, isinf(y) ? y : sin(y) * cos(y))));
} }
/* /*
* ctanh(x + i NAN) = NaN + i NaN * ctanh(x + I NaN) = d(NaN) + I d(NaN)
* ctanh(x +- i Inf) = NaN + i NaN * ctanh(x +- I Inf) = dNaN + I dNaN
*/ */
if (!isfinite(y)) if (!isfinite(y))
return (CMPLX(y - y, y - 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. * approximation sinh^2(huge) ~= exp(2*huge) / 4.
* We use a modified formula to avoid spurious overflow. * 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)); double exp_mx = exp(-fabs(x));
return (CMPLX(copysign(1, x), return (CMPLX(copysign(1, x),
4 * sin(y) * cos(y) * exp_mx * exp_mx)); 4 * sin(y) * cos(y) * exp_mx * exp_mx));
@ -138,7 +139,7 @@ double complex
ctan(double complex z) ctan(double complex z)
{ {
/* ctan(z) = -I * ctanh(I * z) */ /* ctan(z) = -I * ctanh(I * z) = I * conj(ctanh(I * conj(z))) */
z = ctanh(CMPLX(-cimag(z), creal(z))); z = ctanh(CMPLX(cimag(z), creal(z)));
return (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 >= 0x7f800000) {
if (ix & 0x7fffff) 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); SET_FLOAT_WORD(x, hx - 0x40000000);
return (CMPLXF(x, return (CMPLXF(x,
copysignf(0, isinf(y) ? y : sinf(y) * cosf(y)))); copysignf(0, isinf(y) ? y : sinf(y) * cosf(y))));
@ -60,7 +61,7 @@ ctanhf(float complex z)
if (!isfinite(y)) if (!isfinite(y))
return (CMPLXF(y - y, y - y)); return (CMPLXF(y - y, y - y));
if (ix >= 0x41300000) { /* x >= 11 */ if (ix >= 0x41300000) { /* |x| >= 11 */
float exp_mx = expf(-fabsf(x)); float exp_mx = expf(-fabsf(x));
return (CMPLXF(copysignf(1, x), return (CMPLXF(copysignf(1, x),
4 * sinf(y) * cosf(y) * exp_mx * exp_mx)); 4 * sinf(y) * cosf(y) * exp_mx * exp_mx));
@ -78,7 +79,7 @@ float complex
ctanf(float complex z) ctanf(float complex z)
{ {
z = ctanhf(CMPLXF(-cimagf(z), crealf(z))); z = ctanhf(CMPLXF(cimagf(z), crealf(z)));
return (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 (A pointer to
this address structure is saved in the this address structure is saved in the
.Vt ifnet .Vt ifnet
structure and shall be accessed by the structure and is accessed by the
.Fn ifaddr_byindex .Fn ifaddr_byindex
function.) function.)
The The

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -206,6 +206,9 @@ enum {
INTR_OFLD_RXQ = (1 << 5), /* All TOE rxq's take interrupts */ INTR_OFLD_RXQ = (1 << 5), /* All TOE rxq's take interrupts */
INTR_NM_RXQ = (1 << 6), /* All netmap 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), 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) #define IS_DOOMED(pi) ((pi)->flags & DOOMED)
@ -762,6 +765,7 @@ struct adapter {
int active_ulds; /* ULDs activated on this adapter */ int active_ulds; /* ULDs activated on this adapter */
#endif #endif
int flags; int flags;
int debug_flags;
char ifp_lockname[16]; char ifp_lockname[16];
struct mtx ifp_lock; 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_OWNED(txq) EQ_LOCK_ASSERT_OWNED(&(txq)->eq)
#define TXQ_LOCK_ASSERT_NOTOWNED(txq) EQ_LOCK_ASSERT_NOTOWNED(&(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) \ #define for_each_txq(pi, iter, q) \
for (q = &pi->adapter->sge.txq[pi->first_txq], iter = 0; \ for (q = &pi->adapter->sge.txq[pi->first_txq], iter = 0; \
iter < pi->ntxq; ++iter, ++q) 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++) for (i = 0; i < size; i += 8, p++)
t4_write_reg64(adap, data_reg + i, be64_to_cpu(*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_write_reg(adap, ctl_reg, F_MBMSGVALID | V_MBOWNER(X_MBOWNER_FW));
t4_read_reg(adap, ctl_reg); /* flush write */ 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; continue;
} }
CH_DUMP_MBOX(adap, mbox, data_reg);
res = t4_read_reg64(adap, data_reg); res = t4_read_reg64(adap, data_reg);
if (G_FW_CMD_OP(res >> 32) == FW_DEBUG_CMD) { if (G_FW_CMD_OP(res >> 32) == FW_DEBUG_CMD) {
fw_asrt(adap, data_reg); fw_asrt(adap, data_reg);

View File

@ -585,6 +585,9 @@ t4_attach(device_t dev)
sc = device_get_softc(dev); sc = device_get_softc(dev);
sc->dev = dev; sc->dev = dev;
#ifdef INVARIANTS
sc->debug_flags = DF_DUMP_MBOX;
#endif
pci_enable_busmaster(dev); pci_enable_busmaster(dev);
if (pci_find_cap(dev, PCIY_EXPRESS, &i) == 0) { 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, SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW,
&sc->lro_timeout, 0, "lro inactive-flush timeout (in us)"); &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 #ifdef SBUF_DRAIN
/* /*
* dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. * 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); 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) 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. * 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 *caching_array;
vm_page_t p; vm_page_t p;
int r = 0; int r = 0;
unsigned i, cpages, aflags; unsigned i, cpages;
unsigned max_cpages = min(count, unsigned max_cpages = min(count,
(unsigned)(PAGE_SIZE/sizeof(vm_page_t))); (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 */ /* allocate array for page caching change */
caching_array = malloc(max_cpages * sizeof(vm_page_t), M_TEMP, caching_array = malloc(max_cpages * sizeof(vm_page_t), M_TEMP,
M_WAITOK | M_ZERO); M_WAITOK | M_ZERO);
for (i = 0, cpages = 0; i < count; ++i) { for (i = 0, cpages = 0; i < count; ++i) {
tries = 0; p = ttm_vm_page_alloc(ttm_alloc_flags, cstate);
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));
if (!p) { 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); printf("[TTM] Unable to get page %u\n", i);
/* store already allocated pages in the pool after /* 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; r = -ENOMEM;
goto out; goto out;
} }
p->oflags &= ~VPO_UNMANAGED;
p->flags |= PG_FICTITIOUS;
#ifdef CONFIG_HIGHMEM /* KIB: nop */ #ifdef CONFIG_HIGHMEM /* KIB: nop */
/* gfp flags of highmem page should never be dma32 so we /* 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 ttm_page_pool *pool = ttm_get_pool(flags, cstate);
struct pglist plist; struct pglist plist;
vm_page_t p = NULL; vm_page_t p = NULL;
int gfp_flags, aflags; int gfp_flags;
unsigned count; unsigned count;
int r; 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 */ /* No pool for cached pages */
if (pool == NULL) { if (pool == NULL) {
for (r = 0; r < npages; ++r) { for (r = 0; r < npages; ++r) {
tries = 0; p = ttm_vm_page_alloc(flags, cstate);
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));
if (!p) { 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"); printf("[TTM] Unable to allocate page\n");
return -ENOMEM; return -ENOMEM;
} }
p->oflags &= ~VPO_UNMANAGED;
p->flags |= PG_FICTITIOUS;
pages[r] = p; pages[r] = p;
} }
return 0; 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. * Copyright (c) 1997 Manuel Bouyer. All rights reserved.
@ -87,7 +87,7 @@
/* /*
* Note that the EXTSTAT bit indicates that there is extended status * 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 * 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| \ #define BMSR_MEDIAMASK (BMSR_100T4|BMSR_100TXFDX|BMSR_100TXHDX| \
@ -111,6 +111,7 @@
#define ANAR_NP 0x8000 /* Next page (ro) */ #define ANAR_NP 0x8000 /* Next page (ro) */
#define ANAR_ACK 0x4000 /* link partner abilities acknowledged (ro) */ #define ANAR_ACK 0x4000 /* link partner abilities acknowledged (ro) */
#define ANAR_RF 0x2000 /* remote fault (ro) */ #define ANAR_RF 0x2000 /* remote fault (ro) */
/* Annex 28B.2 */
#define ANAR_FC 0x0400 /* local device supports PAUSE */ #define ANAR_FC 0x0400 /* local device supports PAUSE */
#define ANAR_T4 0x0200 /* local device supports 100bT4 */ #define ANAR_T4 0x0200 /* local device supports 100bT4 */
#define ANAR_TX_FD 0x0100 /* local device supports 100bTx FD */ #define ANAR_TX_FD 0x0100 /* local device supports 100bTx FD */
@ -123,6 +124,7 @@
#define ANAR_PAUSE_ASYM (2 << 10) #define ANAR_PAUSE_ASYM (2 << 10)
#define ANAR_PAUSE_TOWARDS (3 << 10) #define ANAR_PAUSE_TOWARDS (3 << 10)
/* Annex 28D */
#define ANAR_X_FD 0x0020 /* local device supports 1000BASE-X FD */ #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_HD 0x0040 /* local device supports 1000BASE-X HD */
#define ANAR_X_PAUSE_NONE (0 << 7) #define ANAR_X_PAUSE_NONE (0 << 7)
@ -184,12 +186,47 @@
#define GTSR_MAN_MS_FLT 0x8000 /* master/slave config fault */ #define GTSR_MAN_MS_FLT 0x8000 /* master/slave config fault */
#define GTSR_MS_RES 0x4000 /* result: 1 = master, 0 = slave */ #define GTSR_MS_RES 0x4000 /* result: 1 = master, 0 = slave */
#define GTSR_LRS 0x2000 /* local rx status, 1 = ok */ #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_1000TFDX 0x0800 /* link partner 1000baseT FDX capable */
#define GTSR_LP_1000THDX 0x0400 /* link partner 1000baseT HDX 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_LP_ASM_DIR 0x0200 /* link partner asym. pause dir. capable */
#define GTSR_IDLE_ERR 0x00ff /* IDLE error count */ #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 MII_EXTSR 0x0f /* Extended status register */
#define EXTSR_1000XFDX 0x8000 /* 1000X full-duplex capable */ #define EXTSR_1000XFDX 0x8000 /* 1000X full-duplex capable */
#define EXTSR_1000XHDX 0x4000 /* 1000X half-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. * 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); cap_rights_init(&rights, CAP_EXTATTR_SET), &fp);
if (error) { if (error) {
/* /*

View File

@ -342,8 +342,7 @@ ibcs2_getdents(td, uap)
#define BSD_DIRENT(cp) ((struct dirent *)(cp)) #define BSD_DIRENT(cp) ((struct dirent *)(cp))
#define IBCS2_RECLEN(reclen) (reclen + sizeof(u_short)) #define IBCS2_RECLEN(reclen) (reclen + sizeof(u_short))
error = getvnode(td->td_proc->p_fd, uap->fd, error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp);
cap_rights_init(&rights, CAP_READ), &fp);
if (error != 0) if (error != 0)
return (error); return (error);
if ((fp->f_flag & FREAD) == 0) { if ((fp->f_flag & FREAD) == 0) {
@ -498,8 +497,7 @@ ibcs2_read(td, uap)
u_long *cookies = NULL, *cookiep; u_long *cookies = NULL, *cookiep;
int ncookies; int ncookies;
error = getvnode(td->td_proc->p_fd, uap->fd, error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp);
cap_rights_init(&rights, CAP_READ), &fp);
if (error != 0) { if (error != 0) {
if (error == EINVAL) if (error == EINVAL)
return sys_read(td, (struct read_args *)uap); 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; arg = arg ? 128 * 1024: 0;
/* FALLTHROUGH */ /* FALLTHROUGH */
case F_READAHEAD: 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) if (error != 0)
break; break;
if (fp->f_type != DTYPE_VNODE) { if (fp->f_type != DTYPE_VNODE) {
@ -2368,11 +2369,9 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp,
if (fp == NULL) if (fp == NULL)
return (EBADF); return (EBADF);
#ifdef CAPABILITIES #ifdef CAPABILITIES
if (needrightsp != NULL) { error = cap_check(&haverights, needrightsp);
error = cap_check(&haverights, needrightsp); if (error != 0)
if (error != 0) return (error);
return (error);
}
#endif #endif
retry: retry:
count = fp->f_count; count = fp->f_count;
@ -2433,11 +2432,9 @@ _fget(struct thread *td, int fd, struct file **fpp, int flags,
*fpp = NULL; *fpp = NULL;
fdp = td->td_proc->p_fd; fdp = td->td_proc->p_fd;
if (needrightsp != NULL) if (needrightsp == NULL)
needrights = *needrightsp; needrightsp = cap_rights_init(&needrights);
else error = fget_unlocked(fdp, fd, needrightsp, &fp, seqp);
cap_rights_init(&needrights);
error = fget_unlocked(fdp, fd, &needrights, &fp, seqp);
if (error != 0) if (error != 0)
return (error); return (error);
if (fp->f_ops == &badfileops) { 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; cap_rights_t rights;
int error; int error;
error = getvnode(td->td_proc->p_fd, uap->filedes, error = getvnode(td, uap->filedes,
cap_rights_init(&rights, CAP_ACL_GET), &fp); cap_rights_init(&rights, CAP_ACL_GET), &fp);
if (error == 0) { if (error == 0) {
error = vacl_get_acl(td, fp->f_vnode, uap->type, uap->aclp); 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; cap_rights_t rights;
int error; int error;
error = getvnode(td->td_proc->p_fd, uap->filedes, error = getvnode(td, uap->filedes,
cap_rights_init(&rights, CAP_ACL_SET), &fp); cap_rights_init(&rights, CAP_ACL_SET), &fp);
if (error == 0) { if (error == 0) {
error = vacl_set_acl(td, fp->f_vnode, uap->type, uap->aclp); 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; cap_rights_t rights;
int error; int error;
error = getvnode(td->td_proc->p_fd, uap->filedes, error = getvnode(td, uap->filedes,
cap_rights_init(&rights, CAP_ACL_DELETE), &fp); cap_rights_init(&rights, CAP_ACL_DELETE), &fp);
if (error == 0) { if (error == 0) {
error = vacl_delete(td, fp->f_vnode, uap->type); 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; cap_rights_t rights;
int error; int error;
error = getvnode(td->td_proc->p_fd, uap->filedes, error = getvnode(td, uap->filedes,
cap_rights_init(&rights, CAP_ACL_CHECK), &fp); cap_rights_init(&rights, CAP_ACL_CHECK), &fp);
if (error == 0) { if (error == 0) {
error = vacl_aclcheck(td, fp->f_vnode, uap->type, uap->aclp); 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); return (error);
AUDIT_ARG_TEXT(attrname); 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); cap_rights_init(&rights, CAP_EXTATTR_SET), &fp);
if (error) if (error)
return (error); return (error);
@ -401,7 +401,7 @@ sys_extattr_get_fd(td, uap)
return (error); return (error);
AUDIT_ARG_TEXT(attrname); 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); cap_rights_init(&rights, CAP_EXTATTR_GET), &fp);
if (error) if (error)
return (error); return (error);
@ -545,7 +545,7 @@ sys_extattr_delete_fd(td, uap)
return (error); return (error);
AUDIT_ARG_TEXT(attrname); 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); cap_rights_init(&rights, CAP_EXTATTR_DELETE), &fp);
if (error) if (error)
return (error); return (error);
@ -697,7 +697,7 @@ sys_extattr_list_fd(td, uap)
AUDIT_ARG_FD(uap->fd); AUDIT_ARG_FD(uap->fd);
AUDIT_ARG_VALUE(uap->attrnamespace); 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); cap_rights_init(&rights, CAP_EXTATTR_LIST), &fp);
if (error) if (error)
return (error); return (error);

View File

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

View File

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

View File

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

View File

@ -165,7 +165,7 @@ struct filedesc *fdshare(struct filedesc *fdp);
struct filedesc_to_leader * struct filedesc_to_leader *
filedesc_to_leader_alloc(struct filedesc_to_leader *old, filedesc_to_leader_alloc(struct filedesc_to_leader *old,
struct filedesc *fdp, struct proc *leader); 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); struct file **fpp);
void mountcheckdirs(struct vnode *olddp, struct vnode *newdp); void mountcheckdirs(struct vnode *olddp, struct vnode *newdp);

View File

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

View File

@ -7,21 +7,38 @@ DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
.if !defined(MK_CLANG) .if !defined(MK_CLANG)
.include "${SRCTOP}/share/mk/src.opts.mk" .include "${SRCTOP}/share/mk/src.opts.mk"
.endif .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= \ DIRDEPS= \
usr.bin/xinstall \ usr.bin/xinstall \
gnu/usr.bin/binutils/addr2line \
gnu/usr.bin/binutils/ar \ gnu/usr.bin/binutils/ar \
gnu/usr.bin/binutils/as \ gnu/usr.bin/binutils/as \
gnu/usr.bin/binutils/ld \ gnu/usr.bin/binutils/ld \
gnu/usr.bin/binutils/nm \
gnu/usr.bin/binutils/objcopy \ gnu/usr.bin/binutils/objcopy \
gnu/usr.bin/binutils/objdump \ gnu/usr.bin/binutils/objdump \
gnu/usr.bin/binutils/ranlib \ 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" .if ${MK_CLANG} == "yes"

View File

@ -16,8 +16,7 @@ SRCS= Driver.cpp \
lldb.1: lldb.1:
ln -fs ${LLDB_SRCS}/docs/lldb.1 ${.TARGET} ln -fs ${LLDB_SRCS}/docs/lldb.1 ${.TARGET}
DPADD= ${LIBEDIT} ${LIBNCURSESW} ${LIBEXECINFO} ${LIBPANEL} ${LIBZ} LIBADD= edit panel ncursesw execinfo z
LDADD= -ledit -lncursesw -lexecinfo -lpanel -lz
LLDB_LIBS=\ LLDB_LIBS=\
lldb \ 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} CLEANFILES+= ${LIBS}
llib-lposix.ln: llib-lposix llib-lposix.ln: llib-lposix
${LINT} ${LINTFLAGS} -Cposix ${.ALLSRC} ${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, " $(%s_LIBS)", p->ident);
fprintf(outmk, "\n"); 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); p->name, p->name, p->ident);
if (p->libs) if (p->libs)
fprintf(outmk, " $(%s_LIBS)", p->ident); 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. # Add to the list of components which should be kept updated.
config_Components () { config_Components () {
for C in $@; do 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 done
} }
@ -2642,10 +2650,10 @@ install_unschg () {
while read F; do while read F; do
if ! [ -e ${BASEDIR}/${F} ]; then if ! [ -e ${BASEDIR}/${F} ]; then
continue continue
else
echo ${BASEDIR}/${F}
fi fi
done < filelist | xargs chflags noschg || return 1
chflags noschg ${BASEDIR}/${F} || return 1
done < filelist
# Clean up # Clean up
rm filelist rm filelist