sync
This commit is contained in:
parent
777fb69d26
commit
905ea23f06
42 changed files with 776 additions and 381 deletions
186
gnu/lib/libstdc++/libstdc++/aclocal.m4
vendored
186
gnu/lib/libstdc++/libstdc++/aclocal.m4
vendored
|
@ -221,8 +221,8 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl Check to see if g++ can compile this library, and if so, if any version-
|
dnl Check to see if g++ can compile this library, and if so, if any version-
|
||||||
dnl specific precautions need to be taken.
|
dnl specific precautions need to be taken.
|
||||||
dnl
|
dnl
|
||||||
dnl GLIBCPP_CHECK_COMPILER_VERSION
|
dnl GLIBCPP_CHECK_COMPILER_VERSION
|
||||||
AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
|
AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
|
||||||
if test ! -f stamp-sanity-compiler; then
|
if test ! -f stamp-sanity-compiler; then
|
||||||
|
@ -347,14 +347,14 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
|
||||||
|
|
||||||
# Check for -Wl,--gc-sections
|
# Check for -Wl,--gc-sections
|
||||||
# XXX This test is broken at the moment, as symbols required for
|
# XXX This test is broken at the moment, as symbols required for
|
||||||
# linking are now in libsupc++ (not built yet.....). In addition,
|
# linking are now in libsupc++ (not built yet.....). In addition,
|
||||||
# this test has cored on solaris in the past. In addition,
|
# this test has cored on solaris in the past. In addition,
|
||||||
# --gc-sections doesn't really work at the moment (keeps on discarding
|
# --gc-sections doesn't really work at the moment (keeps on discarding
|
||||||
# used sections, first .eh_frame and now some of the glibc sections for
|
# used sections, first .eh_frame and now some of the glibc sections for
|
||||||
# iconv). Bzzzzt. Thanks for playing, maybe next time.
|
# iconv). Bzzzzt. Thanks for playing, maybe next time.
|
||||||
AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
|
AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
|
||||||
AC_TRY_RUN([
|
AC_TRY_RUN([
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
try { throw 1; }
|
try { throw 1; }
|
||||||
catch (...) { };
|
catch (...) { };
|
||||||
|
@ -424,11 +424,11 @@ dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
|
||||||
AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
|
AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
|
||||||
GLIBCPP_CHECK_MATH_DECL_1($1)
|
GLIBCPP_CHECK_MATH_DECL_1($1)
|
||||||
if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
||||||
AC_CHECK_FUNCS($1)
|
AC_CHECK_FUNCS($1)
|
||||||
else
|
else
|
||||||
GLIBCPP_CHECK_MATH_DECL_1(_$1)
|
GLIBCPP_CHECK_MATH_DECL_1(_$1)
|
||||||
if test x$glibcpp_cv_func__$1_use = x"yes"; then
|
if test x$glibcpp_cv_func__$1_use = x"yes"; then
|
||||||
AC_CHECK_FUNCS(_$1)
|
AC_CHECK_FUNCS(_$1)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
@ -436,7 +436,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
|
dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
|
||||||
dnl of functions at once. It's an all-or-nothing check -- either
|
dnl of functions at once. It's an all-or-nothing check -- either
|
||||||
dnl HAVE_XYZ is defined for each of the functions, or for none of them.
|
dnl HAVE_XYZ is defined for each of the functions, or for none of them.
|
||||||
dnl Doing it this way saves significant configure time.
|
dnl Doing it this way saves significant configure time.
|
||||||
AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
|
AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
|
||||||
|
@ -467,8 +467,8 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_2, [
|
||||||
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CPLUSPLUS
|
||||||
AC_TRY_COMPILE([#include <math.h>],
|
AC_TRY_COMPILE([#include <math.h>],
|
||||||
[ $1(0, 0);],
|
[ $1(0, 0);],
|
||||||
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
||||||
AC_LANG_RESTORE
|
AC_LANG_RESTORE
|
||||||
])
|
])
|
||||||
|
@ -491,11 +491,11 @@ dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
|
||||||
AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
|
AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
|
||||||
GLIBCPP_CHECK_MATH_DECL_2($1)
|
GLIBCPP_CHECK_MATH_DECL_2($1)
|
||||||
if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
||||||
AC_CHECK_FUNCS($1)
|
AC_CHECK_FUNCS($1)
|
||||||
else
|
else
|
||||||
GLIBCPP_CHECK_MATH_DECL_2(_$1)
|
GLIBCPP_CHECK_MATH_DECL_2(_$1)
|
||||||
if test x$glibcpp_cv_func__$1_use = x"yes"; then
|
if test x$glibcpp_cv_func__$1_use = x"yes"; then
|
||||||
AC_CHECK_FUNCS(_$1)
|
AC_CHECK_FUNCS(_$1)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
@ -513,8 +513,8 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_3, [
|
||||||
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CPLUSPLUS
|
||||||
AC_TRY_COMPILE([#include <math.h>],
|
AC_TRY_COMPILE([#include <math.h>],
|
||||||
[ $1(0, 0, 0);],
|
[ $1(0, 0, 0);],
|
||||||
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
||||||
AC_LANG_RESTORE
|
AC_LANG_RESTORE
|
||||||
])
|
])
|
||||||
|
@ -537,11 +537,11 @@ dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
|
||||||
AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
|
AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
|
||||||
GLIBCPP_CHECK_MATH_DECL_3($1)
|
GLIBCPP_CHECK_MATH_DECL_3($1)
|
||||||
if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
||||||
AC_CHECK_FUNCS($1)
|
AC_CHECK_FUNCS($1)
|
||||||
else
|
else
|
||||||
GLIBCPP_CHECK_MATH_DECL_3(_$1)
|
GLIBCPP_CHECK_MATH_DECL_3(_$1)
|
||||||
if test x$glibcpp_cv_func__$1_use = x"yes"; then
|
if test x$glibcpp_cv_func__$1_use = x"yes"; then
|
||||||
AC_CHECK_FUNCS(_$1)
|
AC_CHECK_FUNCS(_$1)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
@ -563,15 +563,15 @@ AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
|
||||||
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CPLUSPLUS
|
||||||
AC_TRY_COMPILE([#include <stdlib.h>],
|
AC_TRY_COMPILE([#include <stdlib.h>],
|
||||||
[ $1(0, 0);],
|
[ $1(0, 0);],
|
||||||
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
||||||
AC_LANG_RESTORE
|
AC_LANG_RESTORE
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($glibcpp_cv_func_$1_use)
|
AC_MSG_RESULT($glibcpp_cv_func_$1_use)
|
||||||
if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
||||||
AC_CHECK_FUNCS($1)
|
AC_CHECK_FUNCS($1)
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -592,15 +592,15 @@ AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3, [
|
||||||
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CPLUSPLUS
|
||||||
AC_TRY_COMPILE([#include <stdlib.h>],
|
AC_TRY_COMPILE([#include <stdlib.h>],
|
||||||
[ $1(0, 0, 0);],
|
[ $1(0, 0, 0);],
|
||||||
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
||||||
AC_LANG_RESTORE
|
AC_LANG_RESTORE
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($glibcpp_cv_func_$1_use)
|
AC_MSG_RESULT($glibcpp_cv_func_$1_use)
|
||||||
if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
||||||
AC_CHECK_FUNCS($1)
|
AC_CHECK_FUNCS($1)
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -620,20 +620,20 @@ AC_DEFUN(GLIBCPP_CHECK_UNISTD_DECL_AND_LINKAGE_1, [
|
||||||
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CPLUSPLUS
|
||||||
AC_TRY_COMPILE([#include <unistd.h>],
|
AC_TRY_COMPILE([#include <unistd.h>],
|
||||||
[ $1(0);],
|
[ $1(0);],
|
||||||
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
||||||
AC_LANG_RESTORE
|
AC_LANG_RESTORE
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($glibcpp_cv_func_$1_use)
|
AC_MSG_RESULT($glibcpp_cv_func_$1_use)
|
||||||
if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
||||||
AC_CHECK_FUNCS($1)
|
AC_CHECK_FUNCS($1)
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl Because the builtins are picky picky picky about the arguments they take,
|
dnl Because the builtins are picky picky picky about the arguments they take,
|
||||||
dnl do an explict linkage tests here.
|
dnl do an explict linkage tests here.
|
||||||
dnl Check to see if the (math function) argument passed is
|
dnl Check to see if the (math function) argument passed is
|
||||||
dnl 1) declared when using the c++ compiler
|
dnl 1) declared when using the c++ compiler
|
||||||
|
@ -652,7 +652,7 @@ AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
|
||||||
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CPLUSPLUS
|
||||||
AC_TRY_COMPILE([#include <math.h>],
|
AC_TRY_COMPILE([#include <math.h>],
|
||||||
[ $1(0);],
|
[ $1(0);],
|
||||||
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
||||||
AC_LANG_RESTORE
|
AC_LANG_RESTORE
|
||||||
|
@ -663,8 +663,8 @@ AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
|
||||||
AC_MSG_CHECKING([for $1 linkage])
|
AC_MSG_CHECKING([for $1 linkage])
|
||||||
if test x${glibcpp_cv_func_$1_link+set} != xset; then
|
if test x${glibcpp_cv_func_$1_link+set} != xset; then
|
||||||
AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
|
AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
|
||||||
AC_TRY_LINK([#include <math.h>],
|
AC_TRY_LINK([#include <math.h>],
|
||||||
[ $1(0);],
|
[ $1(0);],
|
||||||
[glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
|
[glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
|
@ -698,7 +698,7 @@ dnl
|
||||||
dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
|
dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
|
||||||
AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
|
AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
|
||||||
dnl Test for builtin math functions.
|
dnl Test for builtin math functions.
|
||||||
dnl These are made in gcc/c-common.c
|
dnl These are made in gcc/c-common.c
|
||||||
GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
|
GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
|
||||||
GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
|
GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
|
||||||
GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
|
GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
|
||||||
|
@ -744,7 +744,7 @@ AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl Check to see what the underlying c library is like
|
dnl Check to see what the underlying c library is like
|
||||||
dnl These checks need to do two things:
|
dnl These checks need to do two things:
|
||||||
dnl 1) make sure the name is declared when using the c++ compiler
|
dnl 1) make sure the name is declared when using the c++ compiler
|
||||||
dnl 2) make sure the name has "C" linkage
|
dnl 2) make sure the name has "C" linkage
|
||||||
dnl This might seem like overkill but experience has shown that it's not...
|
dnl This might seem like overkill but experience has shown that it's not...
|
||||||
|
@ -768,7 +768,7 @@ AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl Check to see what the underlying c library is like
|
dnl Check to see what the underlying c library is like
|
||||||
dnl These checks need to do two things:
|
dnl These checks need to do two things:
|
||||||
dnl 1) make sure the name is declared when using the c++ compiler
|
dnl 1) make sure the name is declared when using the c++ compiler
|
||||||
dnl 2) make sure the name has "C" linkage
|
dnl 2) make sure the name has "C" linkage
|
||||||
dnl This might seem like overkill but experience has shown that it's not...
|
dnl This might seem like overkill but experience has shown that it's not...
|
||||||
|
@ -782,13 +782,13 @@ AC_DEFUN(GLIBCPP_CHECK_UNISTD_SUPPORT, [
|
||||||
CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
|
CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
|
||||||
|
|
||||||
GLIBCPP_CHECK_UNISTD_DECL_AND_LINKAGE_1(isatty)
|
GLIBCPP_CHECK_UNISTD_DECL_AND_LINKAGE_1(isatty)
|
||||||
|
|
||||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl Check to see what the underlying c library or math library is like.
|
dnl Check to see what the underlying c library or math library is like.
|
||||||
dnl These checks need to do two things:
|
dnl These checks need to do two things:
|
||||||
dnl 1) make sure the name is declared when using the c++ compiler
|
dnl 1) make sure the name is declared when using the c++ compiler
|
||||||
dnl 2) make sure the name has "C" linkage
|
dnl 2) make sure the name has "C" linkage
|
||||||
dnl This might seem like overkill but experience has shown that it's not...
|
dnl This might seem like overkill but experience has shown that it's not...
|
||||||
|
@ -900,7 +900,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
|
||||||
|
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl Check to see if there is native support for complex
|
dnl Check to see if there is native support for complex
|
||||||
dnl
|
dnl
|
||||||
dnl Don't compile bits in math/* if native support exits.
|
dnl Don't compile bits in math/* if native support exits.
|
||||||
dnl
|
dnl
|
||||||
|
@ -916,7 +916,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
|
||||||
AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"])
|
AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"])
|
||||||
AC_CHECK_FUNCS([__signbitf], , [LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"])
|
AC_CHECK_FUNCS([__signbitf], , [LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"])
|
||||||
|
|
||||||
dnl Compile the long double complex functions only if the function
|
dnl Compile the long double complex functions only if the function
|
||||||
dnl provides the non-complex long double functions that are needed.
|
dnl provides the non-complex long double functions that are needed.
|
||||||
dnl Currently this includes copysignl, which should be
|
dnl Currently this includes copysignl, which should be
|
||||||
dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
|
dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
|
||||||
|
@ -935,7 +935,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
|
||||||
dnl Check to see what architecture and operating system we are compiling
|
dnl Check to see what architecture and operating system we are compiling
|
||||||
dnl for. Also, if architecture- or OS-specific flags are required for
|
dnl for. Also, if architecture- or OS-specific flags are required for
|
||||||
dnl compilation, pick them up here.
|
dnl compilation, pick them up here.
|
||||||
dnl
|
dnl
|
||||||
dnl GLIBCPP_CHECK_TARGET
|
dnl GLIBCPP_CHECK_TARGET
|
||||||
AC_DEFUN(GLIBCPP_CHECK_TARGET, [
|
AC_DEFUN(GLIBCPP_CHECK_TARGET, [
|
||||||
. [$]{glibcpp_basedir}/configure.target
|
. [$]{glibcpp_basedir}/configure.target
|
||||||
|
@ -949,7 +949,7 @@ dnl Check to see if this target can enable the wchar_t parts of libstdc++.
|
||||||
dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
|
dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
|
||||||
dnl must have been previously checked.)
|
dnl must have been previously checked.)
|
||||||
dnl
|
dnl
|
||||||
dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
|
dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
|
||||||
dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
|
dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
|
||||||
dnl
|
dnl
|
||||||
dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
|
dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
|
||||||
|
@ -961,7 +961,7 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
|
||||||
dnl others even if wchar_t support is not on.
|
dnl others even if wchar_t support is not on.
|
||||||
AC_MSG_CHECKING([for mbstate_t])
|
AC_MSG_CHECKING([for mbstate_t])
|
||||||
AC_TRY_COMPILE([#include <wchar.h>],
|
AC_TRY_COMPILE([#include <wchar.h>],
|
||||||
[mbstate_t teststate;],
|
[mbstate_t teststate;],
|
||||||
have_mbstate_t=yes, have_mbstate_t=no)
|
have_mbstate_t=yes, have_mbstate_t=no)
|
||||||
AC_MSG_RESULT($have_mbstate_t)
|
AC_MSG_RESULT($have_mbstate_t)
|
||||||
if test x"$have_mbstate_t" = xyes; then
|
if test x"$have_mbstate_t" = xyes; then
|
||||||
|
@ -971,20 +971,20 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
|
||||||
dnl Sanity check for existence of ISO C99 headers for extended encoding.
|
dnl Sanity check for existence of ISO C99 headers for extended encoding.
|
||||||
AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
|
AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
|
||||||
AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
|
AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
|
||||||
|
|
||||||
dnl Only continue checking if the ISO C99 headers exist and support is on.
|
dnl Only continue checking if the ISO C99 headers exist and support is on.
|
||||||
if test x"$ac_has_wchar_h" = xyes &&
|
if test x"$ac_has_wchar_h" = xyes &&
|
||||||
test x"$ac_has_wctype_h" = xyes &&
|
test x"$ac_has_wctype_h" = xyes &&
|
||||||
test x"$enable_c_mbchar" != xno; then
|
test x"$enable_c_mbchar" != xno; then
|
||||||
|
|
||||||
dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
|
dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
|
||||||
dnl numeric_limits can instantiate type_traits<wchar_t>
|
dnl numeric_limits can instantiate type_traits<wchar_t>
|
||||||
AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
|
AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
|
||||||
AC_TRY_COMPILE([#include <wchar.h>],
|
AC_TRY_COMPILE([#include <wchar.h>],
|
||||||
[int i = WCHAR_MIN; int j = WCHAR_MAX;],
|
[int i = WCHAR_MIN; int j = WCHAR_MAX;],
|
||||||
has_wchar_minmax=yes, has_wchar_minmax=no)
|
has_wchar_minmax=yes, has_wchar_minmax=no)
|
||||||
AC_MSG_RESULT($has_wchar_minmax)
|
AC_MSG_RESULT($has_wchar_minmax)
|
||||||
|
|
||||||
dnl Test wchar.h for WEOF, which is what we use to determine whether
|
dnl Test wchar.h for WEOF, which is what we use to determine whether
|
||||||
dnl to specialize for char_traits<wchar_t> or not.
|
dnl to specialize for char_traits<wchar_t> or not.
|
||||||
AC_MSG_CHECKING([for WEOF])
|
AC_MSG_CHECKING([for WEOF])
|
||||||
|
@ -994,12 +994,12 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
|
||||||
[wint_t i = WEOF;],
|
[wint_t i = WEOF;],
|
||||||
has_weof=yes, has_weof=no)
|
has_weof=yes, has_weof=no)
|
||||||
AC_MSG_RESULT($has_weof)
|
AC_MSG_RESULT($has_weof)
|
||||||
|
|
||||||
dnl Tests for wide character functions used in char_traits<wchar_t>.
|
dnl Tests for wide character functions used in char_traits<wchar_t>.
|
||||||
ac_wfuncs=yes
|
ac_wfuncs=yes
|
||||||
AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
|
AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
|
||||||
ac_wfuncs=no)
|
ac_wfuncs=no)
|
||||||
|
|
||||||
dnl Checks for names injected into std:: by the c_std headers.
|
dnl Checks for names injected into std:: by the c_std headers.
|
||||||
AC_CHECK_FUNCS(btowc wctob fgetwc fgetws fputwc fputws fwide \
|
AC_CHECK_FUNCS(btowc wctob fgetwc fgetws fputwc fputws fwide \
|
||||||
fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
|
fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
|
||||||
|
@ -1018,8 +1018,8 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
|
||||||
ac_isoC99_wchar_t=no
|
ac_isoC99_wchar_t=no
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($ac_isoC99_wchar_t)
|
AC_MSG_RESULT($ac_isoC99_wchar_t)
|
||||||
|
|
||||||
dnl Use iconv for wchar_t to char conversions. As such, check for
|
dnl Use iconv for wchar_t to char conversions. As such, check for
|
||||||
dnl X/Open Portability Guide, version 2 features (XPG2).
|
dnl X/Open Portability Guide, version 2 features (XPG2).
|
||||||
AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
|
AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
|
||||||
AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
|
AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
|
||||||
|
@ -1031,7 +1031,7 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
|
||||||
|
|
||||||
AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
|
AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
|
||||||
ac_XPG2funcs=yes, ac_XPG2funcs=no)
|
ac_XPG2funcs=yes, ac_XPG2funcs=no)
|
||||||
|
|
||||||
LIBS="$ac_save_LIBS"
|
LIBS="$ac_save_LIBS"
|
||||||
|
|
||||||
AC_MSG_CHECKING([for XPG2 wchar_t support])
|
AC_MSG_CHECKING([for XPG2 wchar_t support])
|
||||||
|
@ -1043,18 +1043,18 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
|
||||||
ac_XPG2_wchar_t=no
|
ac_XPG2_wchar_t=no
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($ac_XPG2_wchar_t)
|
AC_MSG_RESULT($ac_XPG2_wchar_t)
|
||||||
|
|
||||||
dnl At the moment, only enable wchar_t specializations if all the
|
dnl At the moment, only enable wchar_t specializations if all the
|
||||||
dnl above support is present.
|
dnl above support is present.
|
||||||
if test x"$ac_isoC99_wchar_t" = xyes &&
|
if test x"$ac_isoC99_wchar_t" = xyes &&
|
||||||
test x"$ac_XPG2_wchar_t" = xyes; then
|
test x"$ac_XPG2_wchar_t" = xyes; then
|
||||||
AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
|
AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
|
||||||
enable_wchar_t=yes
|
enable_wchar_t=yes
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
AC_MSG_CHECKING([for enabled wchar_t specializations])
|
AC_MSG_CHECKING([for enabled wchar_t specializations])
|
||||||
AC_MSG_RESULT($enable_wchar_t)
|
AC_MSG_RESULT($enable_wchar_t)
|
||||||
AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)
|
AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
@ -1198,15 +1198,15 @@ dnl
|
||||||
dnl GLIBCPP_ENABLE_CLOCALE
|
dnl GLIBCPP_ENABLE_CLOCALE
|
||||||
dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
|
dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
|
||||||
dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
|
dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
|
||||||
dnl
|
dnl
|
||||||
dnl default is generic
|
dnl default is generic
|
||||||
dnl
|
dnl
|
||||||
AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
|
AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
|
||||||
AC_MSG_CHECKING([for clocale to use])
|
AC_MSG_CHECKING([for clocale to use])
|
||||||
AC_ARG_ENABLE(clocale,
|
AC_ARG_ENABLE(clocale,
|
||||||
[ --enable-clocale enable model for target locale package.
|
[ --enable-clocale enable model for target locale package.
|
||||||
--enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
|
--enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
|
||||||
],
|
],
|
||||||
if test x$enable_clocale = xno; then
|
if test x$enable_clocale = xno; then
|
||||||
enable_clocale=no
|
enable_clocale=no
|
||||||
fi,
|
fi,
|
||||||
|
@ -1221,7 +1221,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
|
||||||
xlinux* | xgnu*)
|
xlinux* | xgnu*)
|
||||||
AC_EGREP_CPP([_GLIBCPP_ok], [
|
AC_EGREP_CPP([_GLIBCPP_ok], [
|
||||||
#include <features.h>
|
#include <features.h>
|
||||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
|
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
|
||||||
_GLIBCPP_ok
|
_GLIBCPP_ok
|
||||||
#endif
|
#endif
|
||||||
], enable_clocale_flag=gnu, enable_clocale_flag=generic)
|
], enable_clocale_flag=gnu, enable_clocale_flag=generic)
|
||||||
|
@ -1251,7 +1251,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
|
||||||
j = __strcoll_l(__one, __two, loc_dup);
|
j = __strcoll_l(__one, __two, loc_dup);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[enable_clocale_flag=gnu],[enable_clocale_flag=generic],
|
[enable_clocale_flag=gnu],[enable_clocale_flag=generic],
|
||||||
[enable_clocale_flag=generic])
|
[enable_clocale_flag=generic])
|
||||||
fi
|
fi
|
||||||
|
@ -1374,15 +1374,15 @@ dnl Check for which I/O library to use: libio, or something specific.
|
||||||
dnl
|
dnl
|
||||||
dnl GLIBCPP_ENABLE_CSTDIO
|
dnl GLIBCPP_ENABLE_CSTDIO
|
||||||
dnl --enable-cstdio=libio sets config/io/c_io_libio.h and friends
|
dnl --enable-cstdio=libio sets config/io/c_io_libio.h and friends
|
||||||
dnl
|
dnl
|
||||||
dnl default is stdio
|
dnl default is stdio
|
||||||
dnl
|
dnl
|
||||||
AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
|
AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
|
||||||
AC_MSG_CHECKING([for cstdio to use])
|
AC_MSG_CHECKING([for cstdio to use])
|
||||||
AC_ARG_ENABLE(cstdio,
|
AC_ARG_ENABLE(cstdio,
|
||||||
[ --enable-cstdio enable stdio for target io package.
|
[ --enable-cstdio enable stdio for target io package.
|
||||||
--enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
|
--enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
|
||||||
],
|
],
|
||||||
if test x$enable_cstdio = xno; then
|
if test x$enable_cstdio = xno; then
|
||||||
enable_cstdio=stdio
|
enable_cstdio=stdio
|
||||||
fi,
|
fi,
|
||||||
|
@ -1402,7 +1402,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
|
||||||
AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
|
AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
|
||||||
|
|
||||||
# Need to check and see what version of glibc is being used. If
|
# Need to check and see what version of glibc is being used. If
|
||||||
# it's not glibc-2.2 or higher, then we'll need to go ahead and
|
# it's not glibc-2.2 or higher, then we'll need to go ahead and
|
||||||
# compile most of libio for linux systems.
|
# compile most of libio for linux systems.
|
||||||
if test x$has_libio = x"yes"; then
|
if test x$has_libio = x"yes"; then
|
||||||
case "$target" in
|
case "$target" in
|
||||||
|
@ -1410,7 +1410,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
|
||||||
AC_MSG_CHECKING([for glibc version >= 2.2])
|
AC_MSG_CHECKING([for glibc version >= 2.2])
|
||||||
AC_EGREP_CPP([ok], [
|
AC_EGREP_CPP([ok], [
|
||||||
#include <features.h>
|
#include <features.h>
|
||||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
|
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
|
||||||
ok
|
ok
|
||||||
#endif
|
#endif
|
||||||
], glibc_satisfactory=yes, glibc_satisfactory=no)
|
], glibc_satisfactory=yes, glibc_satisfactory=no)
|
||||||
|
@ -1420,11 +1420,11 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
|
||||||
|
|
||||||
# XXX at the moment, admit defeat and force the recompilation
|
# XXX at the moment, admit defeat and force the recompilation
|
||||||
# XXX of glibc even on glibc-2.2 systems, because libio is not synched.
|
# XXX of glibc even on glibc-2.2 systems, because libio is not synched.
|
||||||
glibc_satisfactory=no
|
glibc_satisfactory=no
|
||||||
|
|
||||||
if test x$glibc_satisfactory = x"yes"; then
|
if test x$glibc_satisfactory = x"yes"; then
|
||||||
need_libio=no
|
need_libio=no
|
||||||
need_wlibio=no
|
need_wlibio=no
|
||||||
else
|
else
|
||||||
need_libio=yes
|
need_libio=yes
|
||||||
# bkoz XXX need to add checks to enable this
|
# bkoz XXX need to add checks to enable this
|
||||||
|
@ -1548,7 +1548,7 @@ void foo()
|
||||||
bar();
|
bar();
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
old_CXXFLAGS="$CXXFLAGS"
|
old_CXXFLAGS="$CXXFLAGS"
|
||||||
CXXFLAGS=-S
|
CXXFLAGS=-S
|
||||||
if AC_TRY_EVAL(ac_compile); then
|
if AC_TRY_EVAL(ac_compile); then
|
||||||
if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
|
if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
|
||||||
|
@ -1627,7 +1627,7 @@ AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
|
||||||
*) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
|
*) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
|
||||||
esac],
|
esac],
|
||||||
enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
|
enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
|
||||||
|
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CPLUSPLUS
|
||||||
|
|
||||||
|
@ -1686,8 +1686,8 @@ AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
|
||||||
ac_c99_stdlib=yes;
|
ac_c99_stdlib=yes;
|
||||||
AC_MSG_CHECKING([for lldiv_t declaration])
|
AC_MSG_CHECKING([for lldiv_t declaration])
|
||||||
AC_CACHE_VAL(ac_c99_lldiv_t, [
|
AC_CACHE_VAL(ac_c99_lldiv_t, [
|
||||||
AC_TRY_COMPILE([#include <stdlib.h>],
|
AC_TRY_COMPILE([#include <stdlib.h>],
|
||||||
[ lldiv_t mydivt;],
|
[ lldiv_t mydivt;],
|
||||||
[ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
|
[ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
|
||||||
])
|
])
|
||||||
AC_MSG_RESULT($ac_c99_lldiv_t)
|
AC_MSG_RESULT($ac_c99_lldiv_t)
|
||||||
|
@ -1702,19 +1702,19 @@ AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
|
||||||
AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
|
AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
|
||||||
AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
|
AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
|
||||||
if test x"$ac_c99_lldiv_t" = x"no"; then
|
if test x"$ac_c99_lldiv_t" = x"no"; then
|
||||||
ac_c99_stdlib=no;
|
ac_c99_stdlib=no;
|
||||||
fi;
|
fi;
|
||||||
AC_MSG_RESULT($ac_c99_stdlib)
|
AC_MSG_RESULT($ac_c99_stdlib)
|
||||||
|
|
||||||
# Check for the existence of <wchar.h> functions used if C99 is enabled.
|
# Check for the existence of <wchar.h> functions used if C99 is enabled.
|
||||||
# XXX the wchar.h checks should be rolled into the general C99 bits.
|
# XXX the wchar.h checks should be rolled into the general C99 bits.
|
||||||
ac_c99_wchar=yes;
|
ac_c99_wchar=yes;
|
||||||
AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
|
AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
|
||||||
AC_TRY_COMPILE([#include <wchar.h>],
|
AC_TRY_COMPILE([#include <wchar.h>],
|
||||||
[wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
|
[wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
|
||||||
AC_TRY_COMPILE([#include <wchar.h>],
|
AC_TRY_COMPILE([#include <wchar.h>],
|
||||||
[wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
|
[wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
|
||||||
AC_TRY_COMPILE([#include <wchar.h>],
|
AC_TRY_COMPILE([#include <wchar.h>],
|
||||||
[wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
|
[wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
|
||||||
AC_MSG_RESULT($ac_c99_wchar)
|
AC_MSG_RESULT($ac_c99_wchar)
|
||||||
|
|
||||||
|
@ -1723,8 +1723,8 @@ AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
|
||||||
test x"$ac_c99_stdio" = x"no" ||
|
test x"$ac_c99_stdio" = x"no" ||
|
||||||
test x"$ac_c99_stdlib" = x"no" ||
|
test x"$ac_c99_stdlib" = x"no" ||
|
||||||
test x"$ac_c99_wchar" = x"no"; then
|
test x"$ac_c99_wchar" = x"no"; then
|
||||||
enable_c99=no;
|
enable_c99=no;
|
||||||
fi;
|
fi;
|
||||||
AC_MSG_RESULT($enable_c99)
|
AC_MSG_RESULT($enable_c99)
|
||||||
|
|
||||||
# Option parsed, now set things appropriately
|
# Option parsed, now set things appropriately
|
||||||
|
@ -1801,13 +1801,13 @@ changequote(<<, >>)dnl
|
||||||
<< --enable-cheaders=MODEL construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
|
<< --enable-cheaders=MODEL construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
|
||||||
changequote([, ])
|
changequote([, ])
|
||||||
[case "$enableval" in
|
[case "$enableval" in
|
||||||
c)
|
c)
|
||||||
enable_cheaders=c
|
enable_cheaders=c
|
||||||
;;
|
;;
|
||||||
c_std)
|
c_std)
|
||||||
enable_cheaders=c_std
|
enable_cheaders=c_std
|
||||||
;;
|
;;
|
||||||
*) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
|
*) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
|
||||||
;;
|
;;
|
||||||
esac],
|
esac],
|
||||||
enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
|
enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
|
||||||
|
@ -1815,10 +1815,10 @@ changequote([, ])
|
||||||
|
|
||||||
dnl Option parsed, now set things appropriately
|
dnl Option parsed, now set things appropriately
|
||||||
case "$enable_cheaders" in
|
case "$enable_cheaders" in
|
||||||
c_std)
|
c_std)
|
||||||
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
|
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
|
||||||
;;
|
;;
|
||||||
c)
|
c)
|
||||||
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
|
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -1896,8 +1896,8 @@ dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
|
||||||
dnl
|
dnl
|
||||||
AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
|
AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
|
||||||
# Optimization flags that are probably a good idea for thrill-seekers. Just
|
# Optimization flags that are probably a good idea for thrill-seekers. Just
|
||||||
# uncomment the lines below and make, everything else is ready to go...
|
# uncomment the lines below and make, everything else is ready to go...
|
||||||
# OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
|
# OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
|
||||||
OPTIMIZE_CXXFLAGS=
|
OPTIMIZE_CXXFLAGS=
|
||||||
AC_SUBST(OPTIMIZE_CXXFLAGS)
|
AC_SUBST(OPTIMIZE_CXXFLAGS)
|
||||||
|
|
||||||
|
@ -1973,7 +1973,7 @@ fi
|
||||||
|
|
||||||
# Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
|
# Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
|
||||||
# Install a library built with a cross compiler in tooldir, not libdir.
|
# Install a library built with a cross compiler in tooldir, not libdir.
|
||||||
if test x"$glibcpp_toolexecdir" = x"no"; then
|
if test x"$glibcpp_toolexecdir" = x"no"; then
|
||||||
if test -n "$with_cross_host" &&
|
if test -n "$with_cross_host" &&
|
||||||
test x"$with_cross_host" != x"no"; then
|
test x"$with_cross_host" != x"no"; then
|
||||||
glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
|
glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
|
||||||
|
@ -2110,8 +2110,8 @@ AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
|
||||||
AC_TRY_COMPILE([#include <unistd.h>
|
AC_TRY_COMPILE([#include <unistd.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
],
|
],
|
||||||
[ struct rlimit r; setrlimit(0, &r);],
|
[ struct rlimit r; setrlimit(0, &r);],
|
||||||
[ac_setrlimit=yes], [ac_setrlimit=no])
|
[ac_setrlimit=yes], [ac_setrlimit=no])
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
|
@ -2152,9 +2152,9 @@ AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
|
||||||
enable_abi_check=no
|
enable_abi_check=no
|
||||||
else
|
else
|
||||||
case "$host" in
|
case "$host" in
|
||||||
*-*-cygwin*)
|
*-*-cygwin*)
|
||||||
enable_abi_check=no ;;
|
enable_abi_check=no ;;
|
||||||
*)
|
*)
|
||||||
enable_abi_check=yes ;;
|
enable_abi_check=yes ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
@ -2292,9 +2292,9 @@ changequote([, ])dnl
|
||||||
enable_symvers=GLIBCPP_ENABLE_SYMVERS_DEFAULT)dnl
|
enable_symvers=GLIBCPP_ENABLE_SYMVERS_DEFAULT)dnl
|
||||||
|
|
||||||
# If we never went through the GLIBCPP_CHECK_LINKER_FEATURES macro, then we
|
# If we never went through the GLIBCPP_CHECK_LINKER_FEATURES macro, then we
|
||||||
# don't know enough about $LD to do tricks...
|
# don't know enough about $LD to do tricks...
|
||||||
if test x$enable_shared = xno ||
|
if test x$enable_shared = xno ||
|
||||||
test "x$LD" = x ||
|
test "x$LD" = x ||
|
||||||
test x$glibcpp_gnu_ld_version = x; then
|
test x$glibcpp_gnu_ld_version = x; then
|
||||||
enable_symvers=no
|
enable_symvers=no
|
||||||
fi
|
fi
|
||||||
|
@ -2314,7 +2314,7 @@ fi
|
||||||
glibcpp_min_gnu_ld_version=21200
|
glibcpp_min_gnu_ld_version=21200
|
||||||
|
|
||||||
# Check to see if unspecified "yes" value can win, given results
|
# Check to see if unspecified "yes" value can win, given results
|
||||||
# above.
|
# above.
|
||||||
if test $enable_symvers = yes ; then
|
if test $enable_symvers = yes ; then
|
||||||
if test $with_gnu_ld = yes &&
|
if test $with_gnu_ld = yes &&
|
||||||
test $glibcpp_shared_libgcc = yes ;
|
test $glibcpp_shared_libgcc = yes ;
|
||||||
|
@ -2351,7 +2351,7 @@ case $enable_symvers in
|
||||||
;;
|
;;
|
||||||
gnu)
|
gnu)
|
||||||
SYMVER_MAP=config/linker-map.gnu
|
SYMVER_MAP=config/linker-map.gnu
|
||||||
AC_DEFINE(_GLIBCPP_SYMVER)
|
AC_DEFINE(_GLIBCPP_SYMVER)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -185,7 +185,7 @@ if test -n "$with_cross_host" || test x"$build" != x"$host"; then
|
||||||
machine/endian.h machine/param.h sys/machine.h sys/types.h \
|
machine/endian.h machine/param.h sys/machine.h sys/types.h \
|
||||||
fp.h locale.h float.h inttypes.h])
|
fp.h locale.h float.h inttypes.h])
|
||||||
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
||||||
AC_SUBST(SECTION_FLAGS)
|
AC_SUBST(SECTION_FLAGS)
|
||||||
GLIBCPP_CHECK_LINKER_FEATURES
|
GLIBCPP_CHECK_LINKER_FEATURES
|
||||||
GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
|
GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
|
||||||
GLIBCPP_CHECK_WCHAR_T_SUPPORT
|
GLIBCPP_CHECK_WCHAR_T_SUPPORT
|
||||||
|
@ -213,7 +213,7 @@ if test -n "$with_cross_host" || test x"$build" != x"$host"; then
|
||||||
fp.h locale.h float.h inttypes.h sys/resource.h sys/stat.h \
|
fp.h locale.h float.h inttypes.h sys/resource.h sys/stat.h \
|
||||||
sys/time.h unistd.h])
|
sys/time.h unistd.h])
|
||||||
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
||||||
AC_SUBST(SECTION_FLAGS)
|
AC_SUBST(SECTION_FLAGS)
|
||||||
GLIBCPP_CHECK_LINKER_FEATURES
|
GLIBCPP_CHECK_LINKER_FEATURES
|
||||||
GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
|
GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
|
||||||
GLIBCPP_CHECK_WCHAR_T_SUPPORT
|
GLIBCPP_CHECK_WCHAR_T_SUPPORT
|
||||||
|
@ -253,7 +253,7 @@ changequote(,)dnl
|
||||||
*-qnx6.[12]*)
|
*-qnx6.[12]*)
|
||||||
changequote([,])dnl
|
changequote([,])dnl
|
||||||
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
||||||
AC_SUBST(SECTION_FLAGS)
|
AC_SUBST(SECTION_FLAGS)
|
||||||
GLIBCPP_CHECK_LINKER_FEATURES
|
GLIBCPP_CHECK_LINKER_FEATURES
|
||||||
GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
|
GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
|
||||||
GLIBCPP_CHECK_WCHAR_T_SUPPORT
|
GLIBCPP_CHECK_WCHAR_T_SUPPORT
|
||||||
|
@ -340,8 +340,8 @@ fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# GLIBCPP_CHECK_STDLIB_SUPPORT
|
# GLIBCPP_CHECK_STDLIB_SUPPORT
|
||||||
AC_DEFINE(HAVE_STRTOF)
|
AC_DEFINE(HAVE_STRTOF)
|
||||||
AC_DEFINE(HAVE_STRTOLD)
|
AC_DEFINE(HAVE_STRTOLD)
|
||||||
# AC_FUNC_MMAP
|
# AC_FUNC_MMAP
|
||||||
AC_DEFINE(HAVE_MMAP)
|
AC_DEFINE(HAVE_MMAP)
|
||||||
|
|
||||||
|
@ -447,7 +447,7 @@ GLIBCPP_ENABLE_SYMVERS([yes])
|
||||||
GLIBCPP_CONFIGURE_TESTSUITE
|
GLIBCPP_CONFIGURE_TESTSUITE
|
||||||
|
|
||||||
# Propagate the target-specific source directories through the build chain.
|
# Propagate the target-specific source directories through the build chain.
|
||||||
# (Nothing currently uses cpu_include_dir directly; only ATOMICITYH
|
# (Nothing currently uses cpu_include_dir directly; only ATOMICITYH
|
||||||
# uses it, and it only gets used in this file.)
|
# uses it, and it only gets used in this file.)
|
||||||
OS_INC_SRCDIR=config/${os_include_dir}
|
OS_INC_SRCDIR=config/${os_include_dir}
|
||||||
ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}
|
ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}
|
||||||
|
@ -457,7 +457,7 @@ AC_SUBST(ATOMICITY_INC_SRCDIR)
|
||||||
# Set up cross-compile flags
|
# Set up cross-compile flags
|
||||||
AC_SUBST(GLIBCPP_IS_CROSS_COMPILING) dnl Unused so far.
|
AC_SUBST(GLIBCPP_IS_CROSS_COMPILING) dnl Unused so far.
|
||||||
AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
|
AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
|
||||||
|
|
||||||
AC_CACHE_SAVE
|
AC_CACHE_SAVE
|
||||||
|
|
||||||
if test "${multilib}" = "yes"; then
|
if test "${multilib}" = "yes"; then
|
||||||
|
@ -484,7 +484,7 @@ AC_SUBST(LIBSUPCXX_PICFLAGS)
|
||||||
# Generate the various Makefiles, include files, and scripts.
|
# Generate the various Makefiles, include files, and scripts.
|
||||||
# NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
|
# NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
|
||||||
# libsupc++/Makefile.am and testsuite/Makefile.am so that multilib installs
|
# libsupc++/Makefile.am and testsuite/Makefile.am so that multilib installs
|
||||||
# will end up installed in the correct place. To work around this not being
|
# will end up installed in the correct place. To work around this not being
|
||||||
# passed down from config-ml.in -> top_srcdir/Makefile.am ->
|
# passed down from config-ml.in -> top_srcdir/Makefile.am ->
|
||||||
# top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
|
# top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
|
||||||
AC_OUTPUT(Makefile \
|
AC_OUTPUT(Makefile \
|
||||||
|
|
|
@ -94,7 +94,7 @@ esac
|
||||||
|
|
||||||
# Now look for the file(s) usually tied to a CPU model, and make
|
# Now look for the file(s) usually tied to a CPU model, and make
|
||||||
# default choices for those if they haven't been explicitly set
|
# default choices for those if they haven't been explicitly set
|
||||||
# already.
|
# already.
|
||||||
cpu_include_dir="cpu/${try_cpu}"
|
cpu_include_dir="cpu/${try_cpu}"
|
||||||
ATOMICITYH=$cpu_include_dir
|
ATOMICITYH=$cpu_include_dir
|
||||||
abi_baseline_pair=${try_cpu}-${host_os}
|
abi_baseline_pair=${try_cpu}-${host_os}
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
# and speed. In addition, it tests static and shared linkage, iff each
|
# and speed. In addition, it tests static and shared linkage, iff each
|
||||||
# has been enabled.
|
# has been enabled.
|
||||||
|
|
||||||
# Invocation
|
# Invocation
|
||||||
# mkcheck [01]
|
# mkcheck [01]
|
||||||
|
|
||||||
# 1: variables
|
# 1: variables
|
||||||
#
|
#
|
||||||
|
@ -66,7 +66,7 @@ ST_FLAG="-static"
|
||||||
TEST_DIR="$BUILD_DIR/testsuite"
|
TEST_DIR="$BUILD_DIR/testsuite"
|
||||||
# help libtool keep quiet
|
# help libtool keep quiet
|
||||||
if [ ! -d ${TEST_DIR}/.libs ]; then
|
if [ ! -d ${TEST_DIR}/.libs ]; then
|
||||||
mkdir $TEST_DIR/.libs
|
mkdir $TEST_DIR/.libs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# the name of the file that will collect and hold all this useful data:
|
# the name of the file that will collect and hold all this useful data:
|
||||||
|
@ -290,7 +290,7 @@ test_for_output()
|
||||||
RESULT="+"
|
RESULT="+"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# 3: compile, link, execute, time
|
# 3: compile, link, execute, time
|
||||||
|
@ -339,7 +339,7 @@ test_file()
|
||||||
TIMEFORMAT='timemark %R'
|
TIMEFORMAT='timemark %R'
|
||||||
E_TIME_TEXT="$(exec 2>&1; time $LTEXE $EXENAME)"
|
E_TIME_TEXT="$(exec 2>&1; time $LTEXE $EXENAME)"
|
||||||
E_ABNORMAL_TERMINATION=$?
|
E_ABNORMAL_TERMINATION=$?
|
||||||
|
|
||||||
if [ "$E_ABNORMAL_TERMINATION" -ne 0 ]; then
|
if [ "$E_ABNORMAL_TERMINATION" -ne 0 ]; then
|
||||||
RESULT='-r'
|
RESULT='-r'
|
||||||
E_TIME="0"
|
E_TIME="0"
|
||||||
|
@ -363,7 +363,7 @@ test_file()
|
||||||
else
|
else
|
||||||
# the file did not compile/link.
|
# the file did not compile/link.
|
||||||
printf "\n" >> $LOG_FILE
|
printf "\n" >> $LOG_FILE
|
||||||
`cat compile.out >> $LOG_FILE`
|
`cat compile.out >> $LOG_FILE`
|
||||||
rm compile.out
|
rm compile.out
|
||||||
RESULT="-b"
|
RESULT="-b"
|
||||||
TEXT="0"
|
TEXT="0"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#
|
#
|
||||||
# This script computes the various flags needed to run GNU C++ testsuites
|
# This script computes the various flags needed to run GNU C++ testsuites
|
||||||
# (compiler specific as well as library specific).
|
# (compiler specific as well as library specific).
|
||||||
#
|
#
|
||||||
# Written by Benjamin Kosnik <bkoz@redhat.com>
|
# Written by Benjamin Kosnik <bkoz@redhat.com>
|
||||||
# Gabriel Dos Reis <gdr@codesourcery.com>
|
# Gabriel Dos Reis <gdr@codesourcery.com>
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
# Print a message saying how this script is intended to be invoked
|
# Print a message saying how this script is intended to be invoked
|
||||||
print_usage() {
|
print_usage() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Usage:
|
Usage:
|
||||||
testsuite_flags --install-includes
|
testsuite_flags --install-includes
|
||||||
--build-includes
|
--build-includes
|
||||||
--build-cxx
|
--build-cxx
|
||||||
|
@ -33,8 +33,8 @@ case ${query} in
|
||||||
;;
|
;;
|
||||||
--build-includes)
|
--build-includes)
|
||||||
INCLUDES="-nostdinc++ @GLIBCPP_INCLUDES@
|
INCLUDES="-nostdinc++ @GLIBCPP_INCLUDES@
|
||||||
-I${SRC_DIR}/libsupc++ -I${SRC_DIR}/libio
|
-I${SRC_DIR}/libsupc++ -I${SRC_DIR}/libio
|
||||||
-I${SRC_DIR}/include/backward
|
-I${SRC_DIR}/include/backward
|
||||||
-I${SRC_DIR}/testsuite"
|
-I${SRC_DIR}/testsuite"
|
||||||
echo ${INCLUDES}
|
echo ${INCLUDES}
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: editor.c,v 1.411 2023/06/21 12:50:09 krw Exp $ */
|
/* $OpenBSD: editor.c,v 1.412 2023/06/28 12:12:48 krw Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997-2000 Todd C. Miller <millert@openbsd.org>
|
* Copyright (c) 1997-2000 Todd C. Miller <millert@openbsd.org>
|
||||||
|
@ -175,6 +175,11 @@ int parse_sizespec(const char *, double *, char **);
|
||||||
int parse_sizerange(char *, u_int64_t *, u_int64_t *);
|
int parse_sizerange(char *, u_int64_t *, u_int64_t *);
|
||||||
int parse_pct(char *, int *);
|
int parse_pct(char *, int *);
|
||||||
int alignpartition(struct disklabel *, int, u_int64_t, u_int64_t, int);
|
int alignpartition(struct disklabel *, int, u_int64_t, u_int64_t, int);
|
||||||
|
int allocate_space(struct disklabel *, const struct alloc_table *);
|
||||||
|
void allocate_physmemincr(struct space_allocation *);
|
||||||
|
int allocate_partition(struct disklabel *, struct space_allocation *);
|
||||||
|
const struct diskchunk *allocate_diskchunk(const struct disklabel *,
|
||||||
|
const struct space_allocation *);
|
||||||
|
|
||||||
static u_int64_t starting_sector;
|
static u_int64_t starting_sector;
|
||||||
static u_int64_t ending_sector;
|
static u_int64_t ending_sector;
|
||||||
|
@ -514,170 +519,175 @@ done:
|
||||||
int
|
int
|
||||||
editor_allocspace(struct disklabel *lp_org)
|
editor_allocspace(struct disklabel *lp_org)
|
||||||
{
|
{
|
||||||
struct disklabel *lp, label;
|
struct disklabel label;
|
||||||
struct space_allocation *alloc;
|
u_int64_t pstart, pend;
|
||||||
struct space_allocation *ap;
|
int i;
|
||||||
struct partition *pp;
|
|
||||||
const struct diskchunk *chunk;
|
|
||||||
u_int64_t chunkstart, chunksize, start, stop;
|
|
||||||
u_int64_t secs, xtrasecs;
|
|
||||||
u_int64_t pstart, pend, psz;
|
|
||||||
char **partmp;
|
|
||||||
int i, lastalloc, index, partno, freeparts;
|
|
||||||
extern int64_t physmem;
|
|
||||||
|
|
||||||
/* How big is the OpenBSD portion of the disk? */
|
/* How big is the OpenBSD portion of the disk? */
|
||||||
find_bounds(lp_org);
|
find_bounds(lp_org);
|
||||||
|
|
||||||
resizeok = 1;
|
resizeok = 1;
|
||||||
freeparts = 0;
|
|
||||||
for (i = 0; i < MAXPARTITIONS; i++) {
|
for (i = 0; i < MAXPARTITIONS; i++) {
|
||||||
if (i == RAW_PART)
|
if (i == RAW_PART)
|
||||||
continue;
|
continue;
|
||||||
pp = &lp_org->d_partitions[i];
|
pstart = DL_GETPOFFSET(&lp_org->d_partitions[i]);
|
||||||
psz = DL_GETPSIZE(pp);
|
pend = pstart + DL_GETPSIZE(&lp_org->d_partitions[i]);
|
||||||
if (psz == 0 || pp->p_fstype == FS_UNUSED) {
|
|
||||||
freeparts++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
pstart = DL_GETPOFFSET(pp);
|
|
||||||
pend = pstart + psz;
|
|
||||||
if (((pstart >= starting_sector && pstart < ending_sector) ||
|
if (((pstart >= starting_sector && pstart < ending_sector) ||
|
||||||
(pend > starting_sector && pend <= ending_sector)))
|
(pend > starting_sector && pend <= ending_sector)))
|
||||||
resizeok = 0; /* Part of OBSD area is in use! */
|
resizeok = 0; /* Part of OBSD area is in use! */
|
||||||
}
|
}
|
||||||
|
|
||||||
alloc = NULL;
|
for (i = 0; i < alloc_table_nitems; i++) {
|
||||||
index = -1;
|
memcpy(&label, lp_org, sizeof(label));
|
||||||
again:
|
if (allocate_space(&label, &alloc_table[i]) == 0) {
|
||||||
free(alloc);
|
memcpy(lp_org, &label, sizeof(struct disklabel));
|
||||||
alloc = NULL;
|
return 0;
|
||||||
index++;
|
|
||||||
if (index >= alloc_table_nitems)
|
|
||||||
return 1;
|
|
||||||
lp = &label;
|
|
||||||
mpfree(mountpoints, KEEP);
|
|
||||||
memcpy(lp, lp_org, sizeof(struct disklabel));
|
|
||||||
lp->d_npartitions = MAXPARTITIONS;
|
|
||||||
lastalloc = alloc_table[index].sz;
|
|
||||||
if (lastalloc > freeparts)
|
|
||||||
goto again;
|
|
||||||
alloc = reallocarray(NULL, lastalloc, sizeof(struct space_allocation));
|
|
||||||
if (alloc == NULL)
|
|
||||||
err(1, NULL);
|
|
||||||
memcpy(alloc, alloc_table[index].table,
|
|
||||||
lastalloc * sizeof(struct space_allocation));
|
|
||||||
|
|
||||||
/* bump max swap based on phys mem, little physmem gets 2x swap */
|
|
||||||
if (index == 0 && alloc_table == alloc_table_default) {
|
|
||||||
if (physmem && physmem / DEV_BSIZE < MEG(256))
|
|
||||||
alloc[1].minsz = alloc[1].maxsz = 2 * (physmem /
|
|
||||||
DEV_BSIZE);
|
|
||||||
else
|
|
||||||
alloc[1].maxsz += (physmem / DEV_BSIZE);
|
|
||||||
/* bump max /var to make room for 2 crash dumps */
|
|
||||||
alloc[3].maxsz += 2 * (physmem / DEV_BSIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
xtrasecs = editor_countfree(lp);
|
|
||||||
|
|
||||||
for (i = 0; i < lastalloc; i++) {
|
|
||||||
alloc[i].minsz = DL_BLKTOSEC(lp, alloc[i].minsz);
|
|
||||||
alloc[i].maxsz = DL_BLKTOSEC(lp, alloc[i].maxsz);
|
|
||||||
if (xtrasecs >= alloc[i].minsz)
|
|
||||||
xtrasecs -= alloc[i].minsz;
|
|
||||||
else {
|
|
||||||
/* It did not work out, try next strategy */
|
|
||||||
goto again;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < lastalloc; i++) {
|
return 1;
|
||||||
/* Find next available partition. */
|
}
|
||||||
for (partno = 0; partno < MAXPARTITIONS; partno++)
|
|
||||||
if (DL_GETPSIZE(&lp->d_partitions[partno]) == 0)
|
const struct diskchunk *
|
||||||
break;
|
allocate_diskchunk(const struct disklabel *lp,
|
||||||
if (partno == MAXPARTITIONS) {
|
const struct space_allocation *sa)
|
||||||
/* It did not work out, try next strategy */
|
{
|
||||||
goto again;
|
const struct diskchunk *chunk;
|
||||||
}
|
static struct diskchunk largest;
|
||||||
|
uint64_t maxstop;
|
||||||
|
|
||||||
|
largest.start = largest.stop = 0;
|
||||||
|
|
||||||
|
chunk = free_chunks(lp, -1);
|
||||||
|
for (; chunk->start != 0 || chunk->stop != 0; chunk++) {
|
||||||
|
if (CHUNKSZ(chunk) > CHUNKSZ(&largest))
|
||||||
|
largest = *chunk;
|
||||||
|
}
|
||||||
|
maxstop = largest.start + DL_BLKTOSEC(lp, sa->maxsz);
|
||||||
|
if (maxstop > largest.stop)
|
||||||
|
maxstop = largest.stop;
|
||||||
|
#ifdef SUN_CYLCHECK
|
||||||
|
if (lp->d_flags & D_VENDOR) {
|
||||||
|
largest.start = ROUNDUP(largest.start, lp->d_secpercyl);
|
||||||
|
maxstop = ROUNDUP(maxstop, lp->d_secpercyl);
|
||||||
|
if (maxstop > largest.stop)
|
||||||
|
maxstop -= lp->d_secpercyl;
|
||||||
|
if (largest.start >= maxstop)
|
||||||
|
largest.start = largest.stop = maxstop = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (maxstop < largest.stop)
|
||||||
|
largest.stop = maxstop;
|
||||||
|
if (CHUNKSZ(&largest) < DL_BLKTOSEC(lp, sa->minsz))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return &largest;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
allocate_partition(struct disklabel *lp, struct space_allocation *sa)
|
||||||
|
{
|
||||||
|
const struct diskchunk *chunk;
|
||||||
|
struct partition *pp;
|
||||||
|
unsigned int partno;
|
||||||
|
|
||||||
|
for (partno = 0; partno < nitems(lp->d_partitions); partno++) {
|
||||||
|
if (partno == RAW_PART)
|
||||||
|
continue;
|
||||||
pp = &lp->d_partitions[partno];
|
pp = &lp->d_partitions[partno];
|
||||||
partmp = &mountpoints[partno];
|
if (DL_GETPSIZE(pp) == 0 || pp->p_fstype == FS_UNUSED)
|
||||||
ap = &alloc[i];
|
break;
|
||||||
|
}
|
||||||
|
if (partno >= nitems(lp->d_partitions))
|
||||||
|
return 1; /* No free partition. */
|
||||||
|
|
||||||
/* Find largest chunk of free space. */
|
/* Find appropriate chunk of free space. */
|
||||||
chunk = free_chunks(lp, -1);
|
chunk = allocate_diskchunk(lp, sa);
|
||||||
chunkstart = chunksize = 0;
|
if (chunk == NULL)
|
||||||
for (; chunk->start != 0 || chunk->stop != 0; chunk++) {
|
return 1;
|
||||||
start = chunk->start;
|
|
||||||
stop = chunk->stop;
|
|
||||||
#ifdef SUN_CYLCHECK
|
|
||||||
if (lp->d_flags & D_VENDOR) {
|
|
||||||
/* Align to cylinder boundaries. */
|
|
||||||
start = ROUNDUP(start, lp_org->d_secpercyl);
|
|
||||||
stop = ROUNDDOWN(stop, lp_org->d_secpercyl);
|
|
||||||
if (start > stop)
|
|
||||||
start = stop;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (stop - start > chunksize) {
|
|
||||||
chunkstart = start;
|
|
||||||
chunksize = stop - start;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Figure out the size of the partition. */
|
if (strcasecmp(sa->mp, "raid") == 0)
|
||||||
if (i == lastalloc - 1) {
|
pp->p_fstype = FS_RAID;
|
||||||
if (chunksize > ap->maxsz)
|
else if (strcasecmp(sa->mp, "swap") == 0)
|
||||||
secs = ap->maxsz;
|
pp->p_fstype = FS_SWAP;
|
||||||
else
|
else if (sa->mp[0] == '/')
|
||||||
secs = chunksize;
|
pp->p_fstype = FS_BSDFFS;
|
||||||
} else {
|
else
|
||||||
secs = ap->minsz;
|
return 1;
|
||||||
if (xtrasecs > 0)
|
|
||||||
secs += (xtrasecs / 100) * ap->rate;
|
|
||||||
if (secs > ap->maxsz)
|
|
||||||
secs = ap->maxsz;
|
|
||||||
}
|
|
||||||
#ifdef SUN_CYLCHECK
|
|
||||||
if (lp->d_flags & D_VENDOR) {
|
|
||||||
secs = ROUNDUP(secs, lp_org->d_secpercyl);
|
|
||||||
while (secs > chunksize)
|
|
||||||
secs -= lp_org->d_secpercyl;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* See if partition can fit into chunk. */
|
DL_SETPSIZE(pp, chunk->stop - chunk->start);
|
||||||
if (secs > chunksize)
|
DL_SETPOFFSET(pp, chunk->start);
|
||||||
secs = chunksize;
|
|
||||||
if (secs < ap->minsz) {
|
|
||||||
/* It did not work out, try next strategy */
|
|
||||||
goto again;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Everything seems ok so configure the partition. */
|
if (pp->p_fstype == FS_BSDFFS && DL_GETPSIZE(pp) > 0) {
|
||||||
DL_SETPSIZE(pp, secs);
|
mountpoints[partno] = strdup(sa->mp);
|
||||||
DL_SETPOFFSET(pp, chunkstart);
|
if (mountpoints[partno] == NULL)
|
||||||
if (ap->mp[0] != '/') {
|
err(1, NULL);
|
||||||
if (strcasecmp(ap->mp, "raid") == 0)
|
if (set_fragblock(lp, partno))
|
||||||
pp->p_fstype = FS_RAID;
|
return 1;
|
||||||
else
|
}
|
||||||
pp->p_fstype = FS_SWAP;
|
|
||||||
} else {
|
return 0;
|
||||||
pp->p_fstype = FS_BSDFFS;
|
}
|
||||||
pp->p_fragblock = 0;
|
|
||||||
if (set_fragblock(lp, partno) == 1) {
|
void
|
||||||
free(alloc);
|
allocate_physmemincr(struct space_allocation *sa)
|
||||||
return 1;
|
{
|
||||||
}
|
u_int64_t memblks;
|
||||||
free(*partmp);
|
extern int64_t physmem;
|
||||||
if ((*partmp = strdup(ap->mp)) == NULL)
|
|
||||||
err(1, NULL);
|
if (physmem == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
memblks = physmem / DEV_BSIZE;
|
||||||
|
if (strcasecmp(sa->mp, "swap") == 0) {
|
||||||
|
if (memblks < MEG(256))
|
||||||
|
sa->minsz = sa->maxsz = 2 * memblks;
|
||||||
|
else
|
||||||
|
sa->maxsz += memblks;
|
||||||
|
} else if (strcasecmp(sa->mp, "/var") == 0) {
|
||||||
|
sa->maxsz += 2 * memblks;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
allocate_space(struct disklabel *lp, const struct alloc_table *alloc_table)
|
||||||
|
{
|
||||||
|
struct space_allocation sa[MAXPARTITIONS];
|
||||||
|
u_int64_t maxsz, xtrablks;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
xtrablks = DL_SECTOBLK(lp, editor_countfree(lp));
|
||||||
|
memset(sa, 0, sizeof(sa));
|
||||||
|
for (i = 0; i < alloc_table->sz; i++) {
|
||||||
|
sa[i] = alloc_table->table[i];
|
||||||
|
if (alloc_table->table == alloc_big)
|
||||||
|
allocate_physmemincr(&sa[i]);
|
||||||
|
if (xtrablks < sa[i].minsz)
|
||||||
|
return 1; /* Too few free blocks. */
|
||||||
|
xtrablks -= sa[i].minsz;
|
||||||
|
}
|
||||||
|
sa[alloc_table->sz - 1].rate = 100; /* Last allocation is greedy. */
|
||||||
|
|
||||||
|
for (i = lp->d_npartitions; i < MAXPARTITIONS; i++) {
|
||||||
|
if (i == RAW_PART)
|
||||||
|
continue;
|
||||||
|
memset(&lp->d_partitions[i], 0, sizeof(lp->d_partitions[i]));
|
||||||
|
}
|
||||||
|
lp->d_npartitions = MAXPARTITIONS;
|
||||||
|
|
||||||
|
mpfree(mountpoints, KEEP);
|
||||||
|
for (i = 0; i < alloc_table->sz; i++) {
|
||||||
|
if (sa[i].rate < 100) {
|
||||||
|
maxsz = sa[i].minsz + (xtrablks / 100) * sa[i].rate;
|
||||||
|
if (maxsz < sa[i].maxsz)
|
||||||
|
sa[i].maxsz = maxsz;
|
||||||
|
}
|
||||||
|
if (allocate_partition(lp, &sa[i])) {
|
||||||
|
mpfree(mountpoints, KEEP);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(alloc);
|
|
||||||
memcpy(lp_org, lp, sizeof(struct disklabel));
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
149
sbin/iked/ca.c
149
sbin/iked/ca.c
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: ca.c,v 1.94 2023/06/25 08:07:04 op Exp $ */
|
/* $OpenBSD: ca.c,v 1.95 2023/06/28 14:10:24 tobhe Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
|
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
|
||||||
|
@ -62,7 +62,7 @@ int ca_x509_subject_cmp(X509 *, struct iked_static_id *);
|
||||||
int ca_validate_pubkey(struct iked *, struct iked_static_id *,
|
int ca_validate_pubkey(struct iked *, struct iked_static_id *,
|
||||||
void *, size_t, struct iked_id *);
|
void *, size_t, struct iked_id *);
|
||||||
int ca_validate_cert(struct iked *, struct iked_static_id *,
|
int ca_validate_cert(struct iked *, struct iked_static_id *,
|
||||||
void *, size_t, X509 **);
|
void *, size_t, STACK_OF(X509) *, X509 **);
|
||||||
EVP_PKEY *
|
EVP_PKEY *
|
||||||
ca_bytes_to_pkey(uint8_t *, size_t);
|
ca_bytes_to_pkey(uint8_t *, size_t);
|
||||||
int ca_privkey_to_method(struct iked_id *);
|
int ca_privkey_to_method(struct iked_id *);
|
||||||
|
@ -203,6 +203,130 @@ ca_reset(struct privsep *ps)
|
||||||
fatal("ca_reset: reload");
|
fatal("ca_reset: reload");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ca_certbundle_add(struct ibuf *buf, struct iked_id *id)
|
||||||
|
{
|
||||||
|
uint8_t type = id->id_type;
|
||||||
|
size_t len = ibuf_length(id->id_buf);
|
||||||
|
void *val = ibuf_data(id->id_buf);
|
||||||
|
|
||||||
|
if (id == NULL ||
|
||||||
|
buf == NULL ||
|
||||||
|
ibuf_add(buf, &type, sizeof(type)) != 0 ||
|
||||||
|
ibuf_add(buf, &len, sizeof(len)) != 0 ||
|
||||||
|
ibuf_add(buf, val, len) != 0)
|
||||||
|
return -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* decode cert bundle to cert and untrusted intermediate CAs.
|
||||||
|
* datap/lenp point to bundle on input and to decoded cert output
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
ca_decode_cert_bundle(struct iked *env, struct iked_sahdr *sh,
|
||||||
|
uint8_t **datap, size_t *lenp, STACK_OF(X509) **untrustedp)
|
||||||
|
{
|
||||||
|
STACK_OF(X509) *untrusted = NULL;
|
||||||
|
X509 *cert;
|
||||||
|
BIO *rawcert = NULL;
|
||||||
|
uint8_t *certdata = NULL;
|
||||||
|
size_t certlen = 0;
|
||||||
|
uint8_t datatype;
|
||||||
|
size_t datalen = 0;
|
||||||
|
uint8_t *ptr;
|
||||||
|
size_t len;
|
||||||
|
int ret = -1;
|
||||||
|
|
||||||
|
log_debug("%s: decoding cert bundle", SPI_SH(sh, __func__));
|
||||||
|
|
||||||
|
ptr = *datap;
|
||||||
|
len = *lenp;
|
||||||
|
*untrustedp = NULL;
|
||||||
|
|
||||||
|
/* allocate stack for intermediate CAs */
|
||||||
|
if ((untrusted = sk_X509_new_null()) == NULL)
|
||||||
|
goto done;
|
||||||
|
|
||||||
|
/* parse TLV, see ca_certbundle_add() */
|
||||||
|
while (len > 0) {
|
||||||
|
/* Type */
|
||||||
|
if (len < sizeof(datatype)) {
|
||||||
|
log_debug("%s: short data (type)",
|
||||||
|
SPI_SH(sh, __func__));
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
memcpy(&datatype, ptr, sizeof(datatype));
|
||||||
|
ptr += sizeof(datatype);
|
||||||
|
len -= sizeof(datatype);
|
||||||
|
|
||||||
|
/* Only X509 certs/CAs are supported */
|
||||||
|
if (datatype != IKEV2_CERT_X509_CERT) {
|
||||||
|
log_info("%s: unsupported data type: %s",
|
||||||
|
SPI_SH(sh, __func__),
|
||||||
|
print_map(datatype, ikev2_cert_map));
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Length */
|
||||||
|
if (len < sizeof(datalen)) {
|
||||||
|
log_info("%s: short data (len)",
|
||||||
|
SPI_SH(sh, __func__));
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
memcpy(&datalen, ptr, sizeof(datalen));
|
||||||
|
ptr += sizeof(datalen);
|
||||||
|
len -= sizeof(datalen);
|
||||||
|
|
||||||
|
/* Value */
|
||||||
|
if (len < datalen) {
|
||||||
|
log_info("%s: short len %zu < datalen %zu",
|
||||||
|
SPI_SH(sh, __func__), len, datalen);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (certdata == NULL) {
|
||||||
|
/* First entry is cert */
|
||||||
|
certdata = ptr;
|
||||||
|
certlen = datalen;
|
||||||
|
} else {
|
||||||
|
/* All other entries are intermediate CAs */
|
||||||
|
rawcert = BIO_new_mem_buf(ptr, datalen);
|
||||||
|
if (rawcert == NULL)
|
||||||
|
goto done;
|
||||||
|
cert = d2i_X509_bio(rawcert, NULL);
|
||||||
|
BIO_free(rawcert);
|
||||||
|
if (cert == NULL) {
|
||||||
|
log_warnx("%s: cannot parse CA",
|
||||||
|
SPI_SH(sh, __func__));
|
||||||
|
ca_sslerror(__func__);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
if (!sk_X509_push(untrusted, cert)) {
|
||||||
|
log_warnx("%s: cannot store CA",
|
||||||
|
SPI_SH(sh, __func__));
|
||||||
|
X509_free(cert);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ptr += datalen;
|
||||||
|
len -= datalen;
|
||||||
|
}
|
||||||
|
log_debug("%s: decoded cert bundle", SPI_SH(sh, __func__));
|
||||||
|
*datap = certdata;
|
||||||
|
*lenp = certlen;
|
||||||
|
*untrustedp = untrusted;
|
||||||
|
untrusted = NULL;
|
||||||
|
ret = 0;
|
||||||
|
|
||||||
|
done:
|
||||||
|
if (ret != 0)
|
||||||
|
log_info("%s: failed to decode cert bundle",
|
||||||
|
SPI_SH(sh, __func__));
|
||||||
|
sk_X509_free(untrusted);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ca_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
|
ca_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
|
||||||
{
|
{
|
||||||
|
@ -470,6 +594,7 @@ ca_getcert(struct iked *env, struct imsg *imsg)
|
||||||
{
|
{
|
||||||
struct ca_store *store = env->sc_priv;
|
struct ca_store *store = env->sc_priv;
|
||||||
X509 *issuer = NULL, *cert;
|
X509 *issuer = NULL, *cert;
|
||||||
|
STACK_OF(X509) *untrusted = NULL;
|
||||||
EVP_PKEY *certkey;
|
EVP_PKEY *certkey;
|
||||||
struct iked_sahdr sh;
|
struct iked_sahdr sh;
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
|
@ -498,6 +623,10 @@ ca_getcert(struct iked *env, struct imsg *imsg)
|
||||||
|
|
||||||
bzero(&key, sizeof(key));
|
bzero(&key, sizeof(key));
|
||||||
|
|
||||||
|
if (type == IKEV2_CERT_BUNDLE &&
|
||||||
|
ca_decode_cert_bundle(env, &sh, &ptr, &len, &untrusted) == 0)
|
||||||
|
type = IKEV2_CERT_X509_CERT;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case IKEV2_CERT_X509_CERT:
|
case IKEV2_CERT_X509_CERT:
|
||||||
/* Look in local cert storage first */
|
/* Look in local cert storage first */
|
||||||
|
@ -515,15 +644,17 @@ ca_getcert(struct iked *env, struct imsg *imsg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (env->sc_ocsp_url == NULL)
|
if (env->sc_ocsp_url == NULL)
|
||||||
ret = ca_validate_cert(env, &id, ptr, len, NULL);
|
ret = ca_validate_cert(env, &id, ptr, len, untrusted, NULL);
|
||||||
else {
|
else {
|
||||||
ret = ca_validate_cert(env, &id, ptr, len, &issuer);
|
ret = ca_validate_cert(env, &id, ptr, len, untrusted, &issuer);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = ocsp_validate_cert(env, ptr, len, sh,
|
ret = ocsp_validate_cert(env, ptr, len, sh,
|
||||||
type, issuer);
|
type, issuer);
|
||||||
X509_free(issuer);
|
X509_free(issuer);
|
||||||
if (ret == 0)
|
if (ret == 0) {
|
||||||
|
sk_X509_free(untrusted);
|
||||||
return (0);
|
return (0);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
X509_free(issuer);
|
X509_free(issuer);
|
||||||
}
|
}
|
||||||
|
@ -561,6 +692,8 @@ ca_getcert(struct iked *env, struct imsg *imsg)
|
||||||
|
|
||||||
ret = proc_composev(&env->sc_ps, PROC_IKEV2, cmd, iov, iovcnt);
|
ret = proc_composev(&env->sc_ps, PROC_IKEV2, cmd, iov, iovcnt);
|
||||||
ibuf_free(key.id_buf);
|
ibuf_free(key.id_buf);
|
||||||
|
sk_X509_free(untrusted);
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -979,7 +1112,7 @@ ca_reload(struct iked *env)
|
||||||
|
|
||||||
x509 = X509_OBJECT_get0_X509(xo);
|
x509 = X509_OBJECT_get0_X509(xo);
|
||||||
|
|
||||||
(void)ca_validate_cert(env, NULL, x509, 0, NULL);
|
(void)ca_validate_cert(env, NULL, x509, 0, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!env->sc_certreqtype)
|
if (!env->sc_certreqtype)
|
||||||
|
@ -1690,7 +1823,7 @@ ca_validate_pubkey(struct iked *env, struct iked_static_id *id,
|
||||||
|
|
||||||
int
|
int
|
||||||
ca_validate_cert(struct iked *env, struct iked_static_id *id,
|
ca_validate_cert(struct iked *env, struct iked_static_id *id,
|
||||||
void *data, size_t len, X509 **issuerp)
|
void *data, size_t len, STACK_OF(X509) *untrusted, X509 **issuerp)
|
||||||
{
|
{
|
||||||
struct ca_store *store = env->sc_priv;
|
struct ca_store *store = env->sc_priv;
|
||||||
X509_STORE_CTX *csc = NULL;
|
X509_STORE_CTX *csc = NULL;
|
||||||
|
@ -1754,7 +1887,7 @@ ca_validate_cert(struct iked *env, struct iked_static_id *id,
|
||||||
errstr = "failed to alloc csc";
|
errstr = "failed to alloc csc";
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
X509_STORE_CTX_init(csc, store->ca_cas, cert, NULL);
|
X509_STORE_CTX_init(csc, store->ca_cas, cert, untrusted);
|
||||||
param = X509_STORE_get0_param(store->ca_cas);
|
param = X509_STORE_get0_param(store->ca_cas);
|
||||||
if (X509_VERIFY_PARAM_get_flags(param) & X509_V_FLAG_CRL_CHECK) {
|
if (X509_VERIFY_PARAM_get_flags(param) & X509_V_FLAG_CRL_CHECK) {
|
||||||
X509_STORE_CTX_set_flags(csc, X509_V_FLAG_CRL_CHECK);
|
X509_STORE_CTX_set_flags(csc, X509_V_FLAG_CRL_CHECK);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: iked.c,v 1.65 2023/06/25 08:07:04 op Exp $ */
|
/* $OpenBSD: iked.c,v 1.66 2023/06/28 12:31:19 gerhard Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
|
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
|
||||||
|
@ -203,8 +203,6 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
setproctitle("parent");
|
setproctitle("parent");
|
||||||
log_procinit("parent");
|
log_procinit("parent");
|
||||||
if (!debug && daemon(0, 0) == -1)
|
|
||||||
err(1, "failed to daemonize");
|
|
||||||
|
|
||||||
event_init();
|
event_init();
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: iked.h,v 1.219 2023/06/25 08:07:04 op Exp $ */
|
/* $OpenBSD: iked.h,v 1.220 2023/06/28 14:10:24 tobhe Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
|
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
|
||||||
|
@ -642,6 +642,7 @@ struct iked_message {
|
||||||
struct iked_id msg_peerid;
|
struct iked_id msg_peerid;
|
||||||
struct iked_id msg_localid;
|
struct iked_id msg_localid;
|
||||||
struct iked_id msg_cert;
|
struct iked_id msg_cert;
|
||||||
|
struct iked_id msg_scert[IKED_SCERT_MAX]; /* supplemental certs */
|
||||||
struct ibuf *msg_cookie;
|
struct ibuf *msg_cookie;
|
||||||
uint16_t msg_group;
|
uint16_t msg_group;
|
||||||
uint16_t msg_cpi;
|
uint16_t msg_cpi;
|
||||||
|
@ -1176,6 +1177,7 @@ int ca_setcert(struct iked *, struct iked_sahdr *, struct iked_id *,
|
||||||
int ca_setauth(struct iked *, struct iked_sa *,
|
int ca_setauth(struct iked *, struct iked_sa *,
|
||||||
struct ibuf *, enum privsep_procid);
|
struct ibuf *, enum privsep_procid);
|
||||||
void ca_getkey(struct privsep *, struct iked_id *, enum imsg_type);
|
void ca_getkey(struct privsep *, struct iked_id *, enum imsg_type);
|
||||||
|
int ca_certbundle_add(struct ibuf *, struct iked_id *);
|
||||||
int ca_privkey_serialize(EVP_PKEY *, struct iked_id *);
|
int ca_privkey_serialize(EVP_PKEY *, struct iked_id *);
|
||||||
int ca_pubkey_serialize(EVP_PKEY *, struct iked_id *);
|
int ca_pubkey_serialize(EVP_PKEY *, struct iked_id *);
|
||||||
void ca_sslerror(const char *);
|
void ca_sslerror(const char *);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: ikev2.c,v 1.371 2023/06/14 14:09:29 claudio Exp $ */
|
/* $OpenBSD: ikev2.c,v 1.372 2023/06/28 14:10:24 tobhe Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
|
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
|
||||||
|
@ -940,11 +940,12 @@ ikev2_ike_auth_recv(struct iked *env, struct iked_sa *sa,
|
||||||
struct iked_message *msg)
|
struct iked_message *msg)
|
||||||
{
|
{
|
||||||
struct iked_id *id;
|
struct iked_id *id;
|
||||||
struct ibuf *authmsg;
|
struct ibuf *authmsg, *buf;
|
||||||
struct iked_policy *old;
|
struct iked_policy *old;
|
||||||
uint8_t *cert = NULL;
|
uint8_t *cert = NULL;
|
||||||
size_t certlen = 0;
|
size_t certlen = 0;
|
||||||
int certtype = IKEV2_CERT_NONE;
|
int certtype = IKEV2_CERT_NONE;
|
||||||
|
int i;
|
||||||
|
|
||||||
/* The AUTH payload indicates if the responder wants EAP or not */
|
/* The AUTH payload indicates if the responder wants EAP or not */
|
||||||
if (msg->msg_auth.id_type != IKEV2_AUTH_NONE &&
|
if (msg->msg_auth.id_type != IKEV2_AUTH_NONE &&
|
||||||
|
@ -1047,6 +1048,30 @@ ikev2_ike_auth_recv(struct iked *env, struct iked_sa *sa,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Encode all received certs as single blob */
|
||||||
|
if (msg->msg_cert.id_type != IKEV2_CERT_BUNDLE &&
|
||||||
|
msg->msg_scert[0].id_type != IKEV2_CERT_NONE) {
|
||||||
|
if ((buf = ibuf_new(NULL, 0)) == NULL)
|
||||||
|
return (-1);
|
||||||
|
/* begin with certificate */
|
||||||
|
if (ca_certbundle_add(buf, &msg->msg_cert) != 0) {
|
||||||
|
ibuf_free(buf);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
/* add intermediate CAs */
|
||||||
|
for (i = 0; i < IKED_SCERT_MAX; i++) {
|
||||||
|
if (msg->msg_scert[i].id_type == IKEV2_CERT_NONE)
|
||||||
|
break;
|
||||||
|
if (ca_certbundle_add(buf, &msg->msg_scert[i]) != 0) {
|
||||||
|
ibuf_free(buf);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ibuf_free(msg->msg_cert.id_buf);
|
||||||
|
msg->msg_cert.id_buf = buf;
|
||||||
|
msg->msg_cert.id_type = IKEV2_CERT_BUNDLE;
|
||||||
|
}
|
||||||
|
|
||||||
if (!TAILQ_EMPTY(&msg->msg_proposals)) {
|
if (!TAILQ_EMPTY(&msg->msg_proposals)) {
|
||||||
if (proposals_negotiate(&sa->sa_proposals,
|
if (proposals_negotiate(&sa->sa_proposals,
|
||||||
&sa->sa_policy->pol_proposals, &msg->msg_proposals,
|
&sa->sa_policy->pol_proposals, &msg->msg_proposals,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: ikev2.h,v 1.34 2021/05/28 18:01:39 tobhe Exp $ */
|
/* $OpenBSD: ikev2.h,v 1.35 2023/06/28 14:10:24 tobhe Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
|
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
|
||||||
|
@ -433,6 +433,7 @@ struct ikev2_cert {
|
||||||
* use range (201-255, same RFC) for ECDSA.
|
* use range (201-255, same RFC) for ECDSA.
|
||||||
*/
|
*/
|
||||||
#define IKEV2_CERT_ECDSA 201 /* Private */
|
#define IKEV2_CERT_ECDSA 201 /* Private */
|
||||||
|
#define IKEV2_CERT_BUNDLE 254 /* Private */
|
||||||
|
|
||||||
extern struct iked_constmap ikev2_cert_map[];
|
extern struct iked_constmap ikev2_cert_map[];
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: ikev2_msg.c,v 1.95 2023/06/13 12:34:12 tb Exp $ */
|
/* $OpenBSD: ikev2_msg.c,v 1.96 2023/06/28 14:10:24 tobhe Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
|
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
|
||||||
|
@ -189,6 +189,7 @@ void
|
||||||
ikev2_msg_cleanup(struct iked *env, struct iked_message *msg)
|
ikev2_msg_cleanup(struct iked *env, struct iked_message *msg)
|
||||||
{
|
{
|
||||||
struct iked_certreq *cr;
|
struct iked_certreq *cr;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (msg == msg->msg_parent) {
|
if (msg == msg->msg_parent) {
|
||||||
ibuf_free(msg->msg_nonce);
|
ibuf_free(msg->msg_nonce);
|
||||||
|
@ -197,6 +198,8 @@ ikev2_msg_cleanup(struct iked *env, struct iked_message *msg)
|
||||||
ibuf_free(msg->msg_peerid.id_buf);
|
ibuf_free(msg->msg_peerid.id_buf);
|
||||||
ibuf_free(msg->msg_localid.id_buf);
|
ibuf_free(msg->msg_localid.id_buf);
|
||||||
ibuf_free(msg->msg_cert.id_buf);
|
ibuf_free(msg->msg_cert.id_buf);
|
||||||
|
for (i = 0; i < IKED_SCERT_MAX; i++)
|
||||||
|
ibuf_free(msg->msg_scert[i].id_buf);
|
||||||
ibuf_free(msg->msg_cookie);
|
ibuf_free(msg->msg_cookie);
|
||||||
ibuf_free(msg->msg_cookie2);
|
ibuf_free(msg->msg_cookie2);
|
||||||
ibuf_free(msg->msg_del_buf);
|
ibuf_free(msg->msg_del_buf);
|
||||||
|
@ -211,6 +214,8 @@ ikev2_msg_cleanup(struct iked *env, struct iked_message *msg)
|
||||||
msg->msg_peerid.id_buf = NULL;
|
msg->msg_peerid.id_buf = NULL;
|
||||||
msg->msg_localid.id_buf = NULL;
|
msg->msg_localid.id_buf = NULL;
|
||||||
msg->msg_cert.id_buf = NULL;
|
msg->msg_cert.id_buf = NULL;
|
||||||
|
for (i = 0; i < IKED_SCERT_MAX; i++)
|
||||||
|
msg->msg_scert[i].id_buf = NULL;
|
||||||
msg->msg_cookie = NULL;
|
msg->msg_cookie = NULL;
|
||||||
msg->msg_cookie2 = NULL;
|
msg->msg_cookie2 = NULL;
|
||||||
msg->msg_del_buf = NULL;
|
msg->msg_del_buf = NULL;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: ikev2_pld.c,v 1.130 2023/06/14 14:09:29 claudio Exp $ */
|
/* $OpenBSD: ikev2_pld.c,v 1.131 2023/06/28 14:10:24 tobhe Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
|
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
|
||||||
|
@ -810,6 +810,7 @@ ikev2_pld_cert(struct iked *env, struct ikev2_payload *pld,
|
||||||
struct iked_id *certid;
|
struct iked_id *certid;
|
||||||
uint8_t *msgbuf = ibuf_data(msg->msg_data);
|
uint8_t *msgbuf = ibuf_data(msg->msg_data);
|
||||||
const struct iked_sa *sa = msg->msg_sa;
|
const struct iked_sa *sa = msg->msg_sa;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (ikev2_validate_cert(msg, offset, left, &cert))
|
if (ikev2_validate_cert(msg, offset, left, &cert))
|
||||||
return (-1);
|
return (-1);
|
||||||
|
@ -826,13 +827,28 @@ ikev2_pld_cert(struct iked *env, struct ikev2_payload *pld,
|
||||||
if (!ikev2_msg_frompeer(msg))
|
if (!ikev2_msg_frompeer(msg))
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
certid = &msg->msg_parent->msg_cert;
|
/* do not accept internal encoding in the wire */
|
||||||
if (certid->id_type) {
|
if (cert.cert_type == IKEV2_CERT_BUNDLE) {
|
||||||
log_debug("%s: multiple cert payloads, ignoring",
|
log_debug("%s: ignoring IKEV2_CERT_BUNDLE",
|
||||||
SPI_SA(sa, __func__));
|
SPI_SA(sa, __func__));
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
certid = &msg->msg_parent->msg_cert;
|
||||||
|
if (certid->id_type) {
|
||||||
|
/* try to set supplemental certs */
|
||||||
|
for (i = 0; i < IKED_SCERT_MAX; i++) {
|
||||||
|
certid = &msg->msg_parent->msg_scert[i];
|
||||||
|
if (!certid->id_type)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (certid->id_type) {
|
||||||
|
log_debug("%s: too many cert payloads, ignoring",
|
||||||
|
SPI_SA(sa, __func__));
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((certid->id_buf = ibuf_new(buf, len)) == NULL) {
|
if ((certid->id_buf = ibuf_new(buf, len)) == NULL) {
|
||||||
log_debug("%s: failed to save cert", __func__);
|
log_debug("%s: failed to save cert", __func__);
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: proc.c,v 1.38 2023/03/05 22:17:22 tobhe Exp $ */
|
/* $OpenBSD: proc.c,v 1.39 2023/06/28 12:31:19 gerhard Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
|
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
|
||||||
|
@ -205,6 +205,8 @@ proc_init(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc,
|
||||||
|
|
||||||
if (proc_id == PROC_PARENT) {
|
if (proc_id == PROC_PARENT) {
|
||||||
privsep_process = PROC_PARENT;
|
privsep_process = PROC_PARENT;
|
||||||
|
if (!debug && daemon(0, 0) == -1)
|
||||||
|
fatal("failed to daemonize");
|
||||||
proc_setup(ps, procs, nproc);
|
proc_setup(ps, procs, nproc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $OpenBSD: GENERIC,v 1.273 2023/06/10 18:31:38 patrick Exp $
|
# $OpenBSD: GENERIC,v 1.274 2023/06/27 22:38:46 patrick Exp $
|
||||||
#
|
#
|
||||||
# GENERIC machine description file
|
# GENERIC machine description file
|
||||||
#
|
#
|
||||||
|
@ -338,6 +338,7 @@ qcscm* at fdt?
|
||||||
qcsmem* at fdt?
|
qcsmem* at fdt?
|
||||||
qcsmptp* at fdt?
|
qcsmptp* at fdt?
|
||||||
qcspmi* at fdt?
|
qcspmi* at fdt?
|
||||||
|
qctsens* at fdt?
|
||||||
qcpmic* at qcspmi?
|
qcpmic* at qcspmi?
|
||||||
qcpmicgpio* at qcpmic?
|
qcpmicgpio* at qcpmic?
|
||||||
qcpon* at qcpmic?
|
qcpon* at qcpmic?
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $OpenBSD: RAMDISK,v 1.206 2023/06/10 18:31:38 patrick Exp $
|
# $OpenBSD: RAMDISK,v 1.207 2023/06/27 22:38:46 patrick Exp $
|
||||||
|
|
||||||
machine arm64
|
machine arm64
|
||||||
maxusers 4
|
maxusers 4
|
||||||
|
@ -262,6 +262,7 @@ qcscm* at fdt?
|
||||||
qcsmem* at fdt?
|
qcsmem* at fdt?
|
||||||
qcsmptp* at fdt?
|
qcsmptp* at fdt?
|
||||||
qcspmi* at fdt?
|
qcspmi* at fdt?
|
||||||
|
qctsens* at fdt?
|
||||||
qcpmic* at qcspmi?
|
qcpmic* at qcspmi?
|
||||||
qcpmicgpio* at qcpmic?
|
qcpmicgpio* at qcpmic?
|
||||||
qcpon* at qcpmic?
|
qcpon* at qcpmic?
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: dt_dev.c,v 1.26 2023/04/26 16:53:59 claudio Exp $ */
|
/* $OpenBSD: dt_dev.c,v 1.27 2023/06/28 08:23:25 claudio Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
|
* Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
|
||||||
|
@ -240,8 +240,8 @@ dtread(dev_t dev, struct uio *uio, int flags)
|
||||||
return (EMSGSIZE);
|
return (EMSGSIZE);
|
||||||
|
|
||||||
while (!sc->ds_evtcnt) {
|
while (!sc->ds_evtcnt) {
|
||||||
sleep_setup(&sls, sc, PWAIT | PCATCH, "dtread", 0);
|
sleep_setup(&sls, sc, PWAIT | PCATCH, "dtread");
|
||||||
error = sleep_finish(&sls, !sc->ds_evtcnt);
|
error = sleep_finish(&sls, PWAIT | PCATCH, 0, !sc->ds_evtcnt);
|
||||||
if (error == EINTR || error == ERESTART)
|
if (error == EINTR || error == ERESTART)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: dt_prov_static.c,v 1.18 2023/04/28 20:03:13 mvs Exp $ */
|
/* $OpenBSD: dt_prov_static.c,v 1.19 2023/06/28 11:49:49 kn Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
|
* Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
|
||||||
|
@ -93,6 +93,7 @@ DT_STATIC_PROBE2(smr, thread, "uint64_t", "uint64_t");
|
||||||
*/
|
*/
|
||||||
DT_STATIC_PROBE0(refcnt, none);
|
DT_STATIC_PROBE0(refcnt, none);
|
||||||
DT_STATIC_PROBE3(refcnt, ifaddr, "void *", "int", "int");
|
DT_STATIC_PROBE3(refcnt, ifaddr, "void *", "int", "int");
|
||||||
|
DT_STATIC_PROBE3(refcnt, ifmaddr, "void *", "int", "int");
|
||||||
DT_STATIC_PROBE3(refcnt, inpcb, "void *", "int", "int");
|
DT_STATIC_PROBE3(refcnt, inpcb, "void *", "int", "int");
|
||||||
DT_STATIC_PROBE3(refcnt, rtentry, "void *", "int", "int");
|
DT_STATIC_PROBE3(refcnt, rtentry, "void *", "int", "int");
|
||||||
DT_STATIC_PROBE3(refcnt, tdb, "void *", "int", "int");
|
DT_STATIC_PROBE3(refcnt, tdb, "void *", "int", "int");
|
||||||
|
@ -140,6 +141,7 @@ struct dt_probe *const dtps_static[] = {
|
||||||
/* refcnt */
|
/* refcnt */
|
||||||
&_DT_STATIC_P(refcnt, none),
|
&_DT_STATIC_P(refcnt, none),
|
||||||
&_DT_STATIC_P(refcnt, ifaddr),
|
&_DT_STATIC_P(refcnt, ifaddr),
|
||||||
|
&_DT_STATIC_P(refcnt, ifmaddr),
|
||||||
&_DT_STATIC_P(refcnt, inpcb),
|
&_DT_STATIC_P(refcnt, inpcb),
|
||||||
&_DT_STATIC_P(refcnt, rtentry),
|
&_DT_STATIC_P(refcnt, rtentry),
|
||||||
&_DT_STATIC_P(refcnt, tdb),
|
&_DT_STATIC_P(refcnt, tdb),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $OpenBSD: files.fdt,v 1.193 2023/06/10 18:31:38 patrick Exp $
|
# $OpenBSD: files.fdt,v 1.194 2023/06/27 22:38:46 patrick Exp $
|
||||||
#
|
#
|
||||||
# Config file and device description for machine-independent FDT code.
|
# Config file and device description for machine-independent FDT code.
|
||||||
# Included by ports that need it.
|
# Included by ports that need it.
|
||||||
|
@ -721,6 +721,11 @@ device qcpdc
|
||||||
attach qcpdc at fdt
|
attach qcpdc at fdt
|
||||||
file dev/fdt/qcpdc.c qcpdc
|
file dev/fdt/qcpdc.c qcpdc
|
||||||
|
|
||||||
|
# Qualcomm Temperature Sensor
|
||||||
|
device qctsens
|
||||||
|
attach qctsens at fdt
|
||||||
|
file dev/fdt/qctsens.c qctsens
|
||||||
|
|
||||||
# Qualcomm PMIC
|
# Qualcomm PMIC
|
||||||
device qcpmic: spmi
|
device qcpmic: spmi
|
||||||
attach qcpmic at spmi
|
attach qcpmic at spmi
|
||||||
|
|
206
sys/dev/fdt/qctsens.c
Normal file
206
sys/dev/fdt/qctsens.c
Normal file
|
@ -0,0 +1,206 @@
|
||||||
|
/* $OpenBSD: qctsens.c,v 1.1 2023/06/27 22:38:46 patrick Exp $ */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2023 Patrick Wildt <patrick@blueri.se>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/systm.h>
|
||||||
|
#include <sys/malloc.h>
|
||||||
|
#include <sys/device.h>
|
||||||
|
#include <sys/sensors.h>
|
||||||
|
|
||||||
|
#include <machine/intr.h>
|
||||||
|
#include <machine/bus.h>
|
||||||
|
#include <machine/fdt.h>
|
||||||
|
|
||||||
|
#include <dev/ofw/openfirm.h>
|
||||||
|
#include <dev/ofw/ofw_clock.h>
|
||||||
|
#include <dev/ofw/ofw_misc.h>
|
||||||
|
#include <dev/ofw/ofw_thermal.h>
|
||||||
|
#include <dev/ofw/fdt.h>
|
||||||
|
|
||||||
|
/* Registers (sensor block) */
|
||||||
|
#define TSENS_Sn_STATUS(n) (0xa0 + (4 * (n)))
|
||||||
|
#define TSENS_Sn_VALID (1 << 21)
|
||||||
|
#define TSENS_Sn_TEMP(x) ((x) & 0xfff)
|
||||||
|
|
||||||
|
/* Registers (config block) */
|
||||||
|
#define TSENS_HW_VER 0x00
|
||||||
|
#define TSENS_CTRL 0x04
|
||||||
|
#define TSENS_CTRL_EN (1 << 0)
|
||||||
|
#define TSENS_CTRL_Sn_EN(x) (1 << ((x) + 3))
|
||||||
|
|
||||||
|
#define TSENS_NUM_SENSORS 16
|
||||||
|
|
||||||
|
struct qctsens_softc {
|
||||||
|
struct device sc_dev;
|
||||||
|
bus_space_tag_t sc_iot;
|
||||||
|
bus_space_handle_t sc_ioh;
|
||||||
|
bus_space_handle_t sc_ioh_conf;
|
||||||
|
|
||||||
|
int sc_node;
|
||||||
|
|
||||||
|
struct ksensordev sc_sensordev;
|
||||||
|
struct ksensor sc_sensor[TSENS_NUM_SENSORS];
|
||||||
|
|
||||||
|
struct thermal_sensor sc_ts;
|
||||||
|
};
|
||||||
|
|
||||||
|
int qctsens_match(struct device *, void *, void *);
|
||||||
|
void qctsens_attach(struct device *, struct device *, void *);
|
||||||
|
|
||||||
|
const struct cfattach qctsens_ca = {
|
||||||
|
sizeof (struct qctsens_softc), qctsens_match, qctsens_attach
|
||||||
|
};
|
||||||
|
|
||||||
|
struct cfdriver qctsens_cd = {
|
||||||
|
NULL, "qctsens", DV_DULL
|
||||||
|
};
|
||||||
|
|
||||||
|
void qctsens_refresh_sensors(void *);
|
||||||
|
int32_t qctsens_get_temperature(void *, uint32_t *);
|
||||||
|
void qctsens_attach_sensors(struct qctsens_softc *);
|
||||||
|
|
||||||
|
int
|
||||||
|
qctsens_match(struct device *parent, void *match, void *aux)
|
||||||
|
{
|
||||||
|
struct fdt_attach_args *faa = aux;
|
||||||
|
|
||||||
|
return OF_is_compatible(faa->fa_node, "qcom,tsens-v2");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
qctsens_attach(struct device *parent, struct device *self, void *aux)
|
||||||
|
{
|
||||||
|
struct qctsens_softc *sc = (struct qctsens_softc *)self;
|
||||||
|
struct fdt_attach_args *faa = aux;
|
||||||
|
uint32_t reg;
|
||||||
|
|
||||||
|
if (faa->fa_nreg < 1) {
|
||||||
|
printf(": no registers\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sc->sc_node = faa->fa_node;
|
||||||
|
sc->sc_iot = faa->fa_iot;
|
||||||
|
if (bus_space_map(sc->sc_iot, faa->fa_reg[0].addr,
|
||||||
|
faa->fa_reg[0].size, 0, &sc->sc_ioh)) {
|
||||||
|
printf(": can't map registers (sensors)\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (bus_space_map(sc->sc_iot, faa->fa_reg[1].addr,
|
||||||
|
faa->fa_reg[1].size, 0, &sc->sc_ioh_conf)) {
|
||||||
|
printf(": can't map registers (config)\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
|
reg = bus_space_read_4(sc->sc_iot, sc->sc_ioh_conf, TSENS_CTRL);
|
||||||
|
if ((reg & TSENS_CTRL_EN) == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
qctsens_attach_sensors(sc);
|
||||||
|
|
||||||
|
sc->sc_ts.ts_node = sc->sc_node;
|
||||||
|
sc->sc_ts.ts_cookie = sc;
|
||||||
|
sc->sc_ts.ts_get_temperature = qctsens_get_temperature;
|
||||||
|
thermal_sensor_register(&sc->sc_ts);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
qctsens_attach_sensors(struct qctsens_softc *sc)
|
||||||
|
{
|
||||||
|
char nodename[32];
|
||||||
|
uint32_t propdata[4];
|
||||||
|
uint32_t phandle, reg;
|
||||||
|
int node, len, sidx;
|
||||||
|
|
||||||
|
phandle = OF_getpropint(sc->sc_node, "phandle", 0);
|
||||||
|
if (phandle == 0) {
|
||||||
|
printf("%s: missing phandle on node\n", sc->sc_dev.dv_xname);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
reg = bus_space_read_4(sc->sc_iot, sc->sc_ioh_conf, TSENS_CTRL);
|
||||||
|
node = OF_getnodebyname(0, "thermal-zones");
|
||||||
|
for (node = OF_child(node); node != 0; node = OF_peer(node)) {
|
||||||
|
len = OF_getpropintarray(node, "thermal-sensors", propdata,
|
||||||
|
sizeof(propdata));
|
||||||
|
|
||||||
|
if (len != 8 || propdata[0] != phandle || propdata[1] >= 16)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
len = OF_getprop(node, "name", nodename, sizeof(nodename));
|
||||||
|
len = strlen(nodename);
|
||||||
|
if (strcmp("-thermal", &nodename[len - 8]) != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
nodename[len - 8] = '\0';
|
||||||
|
sidx = propdata[1];
|
||||||
|
|
||||||
|
if ((reg & TSENS_CTRL_Sn_EN(sidx)) == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
strlcpy(sc->sc_sensor[sidx].desc, nodename,
|
||||||
|
sizeof(sc->sc_sensor[sidx].desc));
|
||||||
|
sc->sc_sensor[sidx].type = SENSOR_TEMP;
|
||||||
|
sc->sc_sensor[sidx].flags = SENSOR_FINVALID;
|
||||||
|
sensor_attach(&sc->sc_sensordev, &sc->sc_sensor[sidx]);
|
||||||
|
}
|
||||||
|
|
||||||
|
strlcpy(sc->sc_sensordev.xname, sc->sc_dev.dv_xname,
|
||||||
|
sizeof(sc->sc_sensordev.xname));
|
||||||
|
sensordev_install(&sc->sc_sensordev);
|
||||||
|
sensor_task_register(sc, qctsens_refresh_sensors, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
qctsens_refresh_sensors(void *arg)
|
||||||
|
{
|
||||||
|
struct qctsens_softc *sc = arg;
|
||||||
|
int32_t reg, temp;
|
||||||
|
int id;
|
||||||
|
|
||||||
|
for (id = 0; id < TSENS_NUM_SENSORS; id++) {
|
||||||
|
if (sc->sc_sensor[id].type != SENSOR_TEMP)
|
||||||
|
continue;
|
||||||
|
reg = bus_space_read_4(sc->sc_iot, sc->sc_ioh,
|
||||||
|
TSENS_Sn_STATUS(id));
|
||||||
|
temp = TSENS_Sn_TEMP(reg);
|
||||||
|
if (reg & TSENS_Sn_VALID) {
|
||||||
|
sc->sc_sensor[id].value = 273150000 + 100000 * temp;
|
||||||
|
sc->sc_sensor[id].flags &= ~SENSOR_FINVALID;
|
||||||
|
} else {
|
||||||
|
sc->sc_sensor[id].flags = SENSOR_FINVALID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t
|
||||||
|
qctsens_get_temperature(void *cookie, uint32_t *cells)
|
||||||
|
{
|
||||||
|
struct qctsens_softc *sc = cookie;
|
||||||
|
uint32_t id = cells[0];
|
||||||
|
int32_t reg, temp;
|
||||||
|
|
||||||
|
reg = bus_space_read_4(sc->sc_iot, sc->sc_ioh, TSENS_Sn_STATUS(id));
|
||||||
|
temp = 273150000 + 100000 * TSENS_Sn_TEMP(reg);
|
||||||
|
|
||||||
|
if (reg & TSENS_Sn_VALID)
|
||||||
|
return temp;
|
||||||
|
|
||||||
|
return THERMAL_SENSOR_MAX;
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: drm_linux.c,v 1.98 2023/06/01 10:21:26 claudio Exp $ */
|
/* $OpenBSD: drm_linux.c,v 1.99 2023/06/28 08:23:25 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org>
|
* Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org>
|
||||||
* Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org>
|
* Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org>
|
||||||
|
@ -135,14 +135,15 @@ schedule_timeout(long timeout)
|
||||||
{
|
{
|
||||||
struct sleep_state sls;
|
struct sleep_state sls;
|
||||||
unsigned long deadline;
|
unsigned long deadline;
|
||||||
int wait, spl, timo = 0;
|
int wait, spl, prio, timo = 0;
|
||||||
|
|
||||||
MUTEX_ASSERT_LOCKED(&sch_mtx);
|
MUTEX_ASSERT_LOCKED(&sch_mtx);
|
||||||
KASSERT(!cold);
|
KASSERT(!cold);
|
||||||
|
|
||||||
if (timeout != MAX_SCHEDULE_TIMEOUT)
|
if (timeout != MAX_SCHEDULE_TIMEOUT)
|
||||||
timo = timeout;
|
timo = timeout;
|
||||||
sleep_setup(&sls, sch_ident, sch_priority, "schto", timo);
|
prio = sch_priority;
|
||||||
|
sleep_setup(&sls, sch_ident, prio, "schto");
|
||||||
|
|
||||||
wait = (sch_proc == curproc && timeout > 0);
|
wait = (sch_proc == curproc && timeout > 0);
|
||||||
|
|
||||||
|
@ -152,7 +153,7 @@ schedule_timeout(long timeout)
|
||||||
|
|
||||||
if (timeout != MAX_SCHEDULE_TIMEOUT)
|
if (timeout != MAX_SCHEDULE_TIMEOUT)
|
||||||
deadline = jiffies + timeout;
|
deadline = jiffies + timeout;
|
||||||
sleep_finish(&sls, wait);
|
sleep_finish(&sls, prio, timo, wait);
|
||||||
if (timeout != MAX_SCHEDULE_TIMEOUT)
|
if (timeout != MAX_SCHEDULE_TIMEOUT)
|
||||||
timeout = deadline - jiffies;
|
timeout = deadline - jiffies;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: if_myx.c,v 1.116 2022/03/11 18:00:48 mpi Exp $ */
|
/* $OpenBSD: if_myx.c,v 1.117 2023/06/28 08:23:25 claudio Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org>
|
* Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org>
|
||||||
|
@ -1397,9 +1397,9 @@ myx_down(struct myx_softc *sc)
|
||||||
(void)myx_cmd(sc, MYXCMD_SET_IFDOWN, &mc, NULL);
|
(void)myx_cmd(sc, MYXCMD_SET_IFDOWN, &mc, NULL);
|
||||||
|
|
||||||
while (sc->sc_state != MYX_S_OFF) {
|
while (sc->sc_state != MYX_S_OFF) {
|
||||||
sleep_setup(&sls, sts, PWAIT, "myxdown", 0);
|
sleep_setup(&sls, sts, PWAIT, "myxdown");
|
||||||
membar_consumer();
|
membar_consumer();
|
||||||
sleep_finish(&sls, sc->sc_state != MYX_S_OFF);
|
sleep_finish(&sls, PWAIT, 0, sc->sc_state != MYX_S_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: kern_rwlock.c,v 1.48 2022/05/10 16:56:16 bluhm Exp $ */
|
/* $OpenBSD: kern_rwlock.c,v 1.49 2023/06/28 08:23:25 claudio Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2003 Artur Grabowski <art@openbsd.org>
|
* Copyright (c) 2002, 2003 Artur Grabowski <art@openbsd.org>
|
||||||
|
@ -279,11 +279,11 @@ retry:
|
||||||
prio = op->wait_prio;
|
prio = op->wait_prio;
|
||||||
if (flags & RW_INTR)
|
if (flags & RW_INTR)
|
||||||
prio |= PCATCH;
|
prio |= PCATCH;
|
||||||
sleep_setup(&sls, rwl, prio, rwl->rwl_name, 0);
|
sleep_setup(&sls, rwl, prio, rwl->rwl_name);
|
||||||
|
|
||||||
do_sleep = !rw_cas(&rwl->rwl_owner, o, set);
|
do_sleep = !rw_cas(&rwl->rwl_owner, o, set);
|
||||||
|
|
||||||
error = sleep_finish(&sls, do_sleep);
|
error = sleep_finish(&sls, prio, 0, do_sleep);
|
||||||
if ((flags & RW_INTR) &&
|
if ((flags & RW_INTR) &&
|
||||||
(error != 0))
|
(error != 0))
|
||||||
return (error);
|
return (error);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: kern_sched.c,v 1.76 2022/12/05 23:18:37 deraadt Exp $ */
|
/* $OpenBSD: kern_sched.c,v 1.77 2023/06/28 08:23:25 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org>
|
* Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org>
|
||||||
*
|
*
|
||||||
|
@ -673,8 +673,8 @@ sched_stop_secondary_cpus(void)
|
||||||
if (CPU_IS_PRIMARY(ci) || !CPU_IS_RUNNING(ci))
|
if (CPU_IS_PRIMARY(ci) || !CPU_IS_RUNNING(ci))
|
||||||
continue;
|
continue;
|
||||||
while ((spc->spc_schedflags & SPCF_HALTED) == 0) {
|
while ((spc->spc_schedflags & SPCF_HALTED) == 0) {
|
||||||
sleep_setup(&sls, spc, PZERO, "schedstate", 0);
|
sleep_setup(&sls, spc, PZERO, "schedstate");
|
||||||
sleep_finish(&sls,
|
sleep_finish(&sls, PZERO, 0,
|
||||||
(spc->spc_schedflags & SPCF_HALTED) == 0);
|
(spc->spc_schedflags & SPCF_HALTED) == 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: kern_sig.c,v 1.306 2023/04/03 11:57:50 claudio Exp $ */
|
/* $OpenBSD: kern_sig.c,v 1.307 2023/06/28 08:23:25 claudio Exp $ */
|
||||||
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
|
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2170,9 +2170,9 @@ single_thread_wait(struct process *pr, int recheck)
|
||||||
/* wait until they're all suspended */
|
/* wait until they're all suspended */
|
||||||
wait = pr->ps_singlecount > 0;
|
wait = pr->ps_singlecount > 0;
|
||||||
while (wait) {
|
while (wait) {
|
||||||
sleep_setup(&sls, &pr->ps_singlecount, PWAIT, "suspend", 0);
|
sleep_setup(&sls, &pr->ps_singlecount, PWAIT, "suspend");
|
||||||
wait = pr->ps_singlecount > 0;
|
wait = pr->ps_singlecount > 0;
|
||||||
sleep_finish(&sls, wait);
|
sleep_finish(&sls, PWAIT, 0, wait);
|
||||||
if (!recheck)
|
if (!recheck)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: kern_synch.c,v 1.192 2023/06/01 10:21:26 claudio Exp $ */
|
/* $OpenBSD: kern_synch.c,v 1.193 2023/06/28 08:23:25 claudio Exp $ */
|
||||||
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
|
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -151,8 +151,8 @@ tsleep(const volatile void *ident, int priority, const char *wmesg, int timo)
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep_setup(&sls, ident, priority, wmesg, timo);
|
sleep_setup(&sls, ident, priority, wmesg);
|
||||||
return sleep_finish(&sls, 1);
|
return sleep_finish(&sls, priority, timo, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -244,7 +244,7 @@ msleep(const volatile void *ident, struct mutex *mtx, int priority,
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep_setup(&sls, ident, priority, wmesg, timo);
|
sleep_setup(&sls, ident, priority, wmesg);
|
||||||
|
|
||||||
/* XXX - We need to make sure that the mutex doesn't
|
/* XXX - We need to make sure that the mutex doesn't
|
||||||
* unblock splsched. This can be made a bit more
|
* unblock splsched. This can be made a bit more
|
||||||
|
@ -254,7 +254,7 @@ msleep(const volatile void *ident, struct mutex *mtx, int priority,
|
||||||
MUTEX_OLDIPL(mtx) = splsched();
|
MUTEX_OLDIPL(mtx) = splsched();
|
||||||
mtx_leave(mtx);
|
mtx_leave(mtx);
|
||||||
/* signal may stop the process, release mutex before that */
|
/* signal may stop the process, release mutex before that */
|
||||||
error = sleep_finish(&sls, 1);
|
error = sleep_finish(&sls, priority, timo, 1);
|
||||||
|
|
||||||
if ((priority & PNORELOCK) == 0) {
|
if ((priority & PNORELOCK) == 0) {
|
||||||
mtx_enter(mtx);
|
mtx_enter(mtx);
|
||||||
|
@ -304,11 +304,11 @@ rwsleep(const volatile void *ident, struct rwlock *rwl, int priority,
|
||||||
rw_assert_anylock(rwl);
|
rw_assert_anylock(rwl);
|
||||||
status = rw_status(rwl);
|
status = rw_status(rwl);
|
||||||
|
|
||||||
sleep_setup(&sls, ident, priority, wmesg, timo);
|
sleep_setup(&sls, ident, priority, wmesg);
|
||||||
|
|
||||||
rw_exit(rwl);
|
rw_exit(rwl);
|
||||||
/* signal may stop the process, release rwlock before that */
|
/* signal may stop the process, release rwlock before that */
|
||||||
error = sleep_finish(&sls, 1);
|
error = sleep_finish(&sls, priority, timo, 1);
|
||||||
|
|
||||||
if ((priority & PNORELOCK) == 0)
|
if ((priority & PNORELOCK) == 0)
|
||||||
rw_enter(rwl, status);
|
rw_enter(rwl, status);
|
||||||
|
@ -341,7 +341,7 @@ rwsleep_nsec(const volatile void *ident, struct rwlock *rwl, int priority,
|
||||||
|
|
||||||
void
|
void
|
||||||
sleep_setup(struct sleep_state *sls, const volatile void *ident, int prio,
|
sleep_setup(struct sleep_state *sls, const volatile void *ident, int prio,
|
||||||
const char *wmesg, int timo)
|
const char *wmesg)
|
||||||
{
|
{
|
||||||
struct proc *p = curproc;
|
struct proc *p = curproc;
|
||||||
|
|
||||||
|
@ -354,9 +354,6 @@ sleep_setup(struct sleep_state *sls, const volatile void *ident, int prio,
|
||||||
panic("tsleep: not SONPROC");
|
panic("tsleep: not SONPROC");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sls->sls_catch = prio & PCATCH;
|
|
||||||
sls->sls_timeout = 0;
|
|
||||||
|
|
||||||
SCHED_LOCK(sls->sls_s);
|
SCHED_LOCK(sls->sls_s);
|
||||||
|
|
||||||
TRACEPOINT(sched, sleep, NULL);
|
TRACEPOINT(sched, sleep, NULL);
|
||||||
|
@ -367,20 +364,22 @@ sleep_setup(struct sleep_state *sls, const volatile void *ident, int prio,
|
||||||
p->p_slppri = prio & PRIMASK;
|
p->p_slppri = prio & PRIMASK;
|
||||||
TAILQ_INSERT_TAIL(&slpque[LOOKUP(ident)], p, p_runq);
|
TAILQ_INSERT_TAIL(&slpque[LOOKUP(ident)], p, p_runq);
|
||||||
|
|
||||||
if (timo) {
|
|
||||||
KASSERT((p->p_flag & P_TIMEOUT) == 0);
|
|
||||||
sls->sls_timeout = 1;
|
|
||||||
timeout_add(&p->p_sleep_to, timo);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
sleep_finish(struct sleep_state *sls, int do_sleep)
|
sleep_finish(struct sleep_state *sls, int prio, int timo, int do_sleep)
|
||||||
{
|
{
|
||||||
struct proc *p = curproc;
|
struct proc *p = curproc;
|
||||||
int error = 0, error1 = 0;
|
int catch, error = 0, error1 = 0;
|
||||||
|
|
||||||
if (sls->sls_catch != 0) {
|
catch = prio & PCATCH;
|
||||||
|
|
||||||
|
if (timo != 0) {
|
||||||
|
KASSERT((p->p_flag & P_TIMEOUT) == 0);
|
||||||
|
timeout_add(&p->p_sleep_to, timo);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (catch != 0) {
|
||||||
/*
|
/*
|
||||||
* We put ourselves on the sleep queue and start our
|
* We put ourselves on the sleep queue and start our
|
||||||
* timeout before calling sleep_signal_check(), as we could
|
* timeout before calling sleep_signal_check(), as we could
|
||||||
|
@ -396,10 +395,10 @@ sleep_finish(struct sleep_state *sls, int do_sleep)
|
||||||
atomic_setbits_int(&p->p_flag, P_SINTR);
|
atomic_setbits_int(&p->p_flag, P_SINTR);
|
||||||
if ((error = sleep_signal_check()) != 0) {
|
if ((error = sleep_signal_check()) != 0) {
|
||||||
p->p_stat = SONPROC;
|
p->p_stat = SONPROC;
|
||||||
sls->sls_catch = 0;
|
catch = 0;
|
||||||
do_sleep = 0;
|
do_sleep = 0;
|
||||||
} else if (p->p_wchan == NULL) {
|
} else if (p->p_wchan == NULL) {
|
||||||
sls->sls_catch = 0;
|
catch = 0;
|
||||||
do_sleep = 0;
|
do_sleep = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -427,7 +426,7 @@ sleep_finish(struct sleep_state *sls, int do_sleep)
|
||||||
*/
|
*/
|
||||||
atomic_clearbits_int(&p->p_flag, P_SINTR);
|
atomic_clearbits_int(&p->p_flag, P_SINTR);
|
||||||
|
|
||||||
if (sls->sls_timeout) {
|
if (timo != 0) {
|
||||||
if (p->p_flag & P_TIMEOUT) {
|
if (p->p_flag & P_TIMEOUT) {
|
||||||
error1 = EWOULDBLOCK;
|
error1 = EWOULDBLOCK;
|
||||||
} else {
|
} else {
|
||||||
|
@ -438,7 +437,7 @@ sleep_finish(struct sleep_state *sls, int do_sleep)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if thread was woken up because of a unwind or signal */
|
/* Check if thread was woken up because of a unwind or signal */
|
||||||
if (sls->sls_catch != 0)
|
if (catch != 0)
|
||||||
error = sleep_signal_check();
|
error = sleep_signal_check();
|
||||||
|
|
||||||
/* Signal errors are higher priority than timeouts. */
|
/* Signal errors are higher priority than timeouts. */
|
||||||
|
@ -837,9 +836,9 @@ refcnt_finalize(struct refcnt *r, const char *wmesg)
|
||||||
KASSERT(refs != ~0);
|
KASSERT(refs != ~0);
|
||||||
TRACEINDEX(refcnt, r->r_traceidx, r, refs + 1, -1);
|
TRACEINDEX(refcnt, r->r_traceidx, r, refs + 1, -1);
|
||||||
while (refs) {
|
while (refs) {
|
||||||
sleep_setup(&sls, r, PWAIT, wmesg, 0);
|
sleep_setup(&sls, r, PWAIT, wmesg);
|
||||||
refs = atomic_load_int(&r->r_refs);
|
refs = atomic_load_int(&r->r_refs);
|
||||||
sleep_finish(&sls, refs);
|
sleep_finish(&sls, PWAIT, 0, refs);
|
||||||
}
|
}
|
||||||
TRACEINDEX(refcnt, r->r_traceidx, r, refs, 0);
|
TRACEINDEX(refcnt, r->r_traceidx, r, refs, 0);
|
||||||
/* Order subsequent loads and stores after refs == 0 load. */
|
/* Order subsequent loads and stores after refs == 0 load. */
|
||||||
|
@ -888,8 +887,8 @@ cond_wait(struct cond *c, const char *wmesg)
|
||||||
|
|
||||||
wait = atomic_load_int(&c->c_wait);
|
wait = atomic_load_int(&c->c_wait);
|
||||||
while (wait) {
|
while (wait) {
|
||||||
sleep_setup(&sls, c, PWAIT, wmesg, 0);
|
sleep_setup(&sls, c, PWAIT, wmesg);
|
||||||
wait = atomic_load_int(&c->c_wait);
|
wait = atomic_load_int(&c->c_wait);
|
||||||
sleep_finish(&sls, wait);
|
sleep_finish(&sls, PWAIT, 0, wait);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: kern_timeout.c,v 1.91 2023/06/26 16:26:20 cheloha Exp $ */
|
/* $OpenBSD: kern_timeout.c,v 1.92 2023/06/28 08:23:25 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Thomas Nordin <nordin@openbsd.org>
|
* Copyright (c) 2001 Thomas Nordin <nordin@openbsd.org>
|
||||||
* Copyright (c) 2000-2001 Artur Grabowski <art@openbsd.org>
|
* Copyright (c) 2000-2001 Artur Grabowski <art@openbsd.org>
|
||||||
|
@ -752,8 +752,8 @@ softclock_thread(void *arg)
|
||||||
|
|
||||||
s = splsoftclock();
|
s = splsoftclock();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
sleep_setup(&sls, &timeout_proc, PSWP, "bored", 0);
|
sleep_setup(&sls, &timeout_proc, PSWP, "bored");
|
||||||
sleep_finish(&sls, CIRCQ_EMPTY(&timeout_proc));
|
sleep_finish(&sls, PSWP, 0, CIRCQ_EMPTY(&timeout_proc));
|
||||||
|
|
||||||
mtx_enter(&timeout_mutex);
|
mtx_enter(&timeout_mutex);
|
||||||
while (!CIRCQ_EMPTY(&timeout_proc)) {
|
while (!CIRCQ_EMPTY(&timeout_proc)) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: subr_log.c,v 1.75 2022/07/02 08:50:42 visa Exp $ */
|
/* $OpenBSD: subr_log.c,v 1.76 2023/06/28 08:23:25 claudio Exp $ */
|
||||||
/* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */
|
/* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -250,8 +250,9 @@ logread(dev_t dev, struct uio *uio, int flag)
|
||||||
* Set up and enter sleep manually instead of using msleep()
|
* Set up and enter sleep manually instead of using msleep()
|
||||||
* to keep log_mtx as a leaf lock.
|
* to keep log_mtx as a leaf lock.
|
||||||
*/
|
*/
|
||||||
sleep_setup(&sls, mbp, LOG_RDPRI | PCATCH, "klog", 0);
|
sleep_setup(&sls, mbp, LOG_RDPRI | PCATCH, "klog");
|
||||||
error = sleep_finish(&sls, logsoftc.sc_state & LOG_RDWAIT);
|
error = sleep_finish(&sls, LOG_RDPRI | PCATCH, 0,
|
||||||
|
logsoftc.sc_state & LOG_RDWAIT);
|
||||||
mtx_enter(&log_mtx);
|
mtx_enter(&log_mtx);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: if_var.h,v 1.127 2023/05/30 08:30:01 jsg Exp $ */
|
/* $OpenBSD: if_var.h,v 1.128 2023/06/28 11:49:49 kn Exp $ */
|
||||||
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
|
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -255,7 +255,7 @@ struct ifaddr {
|
||||||
struct ifmaddr {
|
struct ifmaddr {
|
||||||
struct sockaddr *ifma_addr; /* Protocol address */
|
struct sockaddr *ifma_addr; /* Protocol address */
|
||||||
unsigned int ifma_ifidx; /* Index of the interface */
|
unsigned int ifma_ifidx; /* Index of the interface */
|
||||||
unsigned int ifma_refcnt; /* Count of references */
|
struct refcnt ifma_refcnt; /* Count of references */
|
||||||
TAILQ_ENTRY(ifmaddr) ifma_list; /* Per-interface list */
|
TAILQ_ENTRY(ifmaddr) ifma_list; /* Per-interface list */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: pf_ioctl.c,v 1.408 2023/06/27 17:36:56 kn Exp $ */
|
/* $OpenBSD: pf_ioctl.c,v 1.409 2023/06/28 15:36:08 kn Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Daniel Hartmeier
|
* Copyright (c) 2001 Daniel Hartmeier
|
||||||
|
@ -118,7 +118,6 @@ int pf_states_clr(struct pfioc_state_kill *);
|
||||||
int pf_states_get(struct pfioc_states *);
|
int pf_states_get(struct pfioc_states *);
|
||||||
|
|
||||||
struct pf_trans *pf_open_trans(uint32_t);
|
struct pf_trans *pf_open_trans(uint32_t);
|
||||||
void pf_close_all_trans(uint32_t);
|
|
||||||
struct pf_trans *pf_find_trans(uint32_t, uint64_t);
|
struct pf_trans *pf_find_trans(uint32_t, uint64_t);
|
||||||
void pf_free_trans(struct pf_trans *);
|
void pf_free_trans(struct pf_trans *);
|
||||||
void pf_rollback_trans(struct pf_trans *);
|
void pf_rollback_trans(struct pf_trans *);
|
||||||
|
@ -1492,7 +1491,6 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
|
||||||
PF_UNLOCK();
|
PF_UNLOCK();
|
||||||
NET_UNLOCK();
|
NET_UNLOCK();
|
||||||
|
|
||||||
pf_close_all_trans(minor(dev));
|
|
||||||
t = pf_open_trans(minor(dev));
|
t = pf_open_trans(minor(dev));
|
||||||
pf_init_tgetrule(t, ruleset->anchor, ruleset_version, rule);
|
pf_init_tgetrule(t, ruleset->anchor, ruleset_version, rule);
|
||||||
pr->ticket = t->pft_ticket;
|
pr->ticket = t->pft_ticket;
|
||||||
|
@ -3271,19 +3269,6 @@ pf_open_trans(uint32_t unit)
|
||||||
return (t);
|
return (t);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
pf_close_all_trans(uint32_t unit)
|
|
||||||
{
|
|
||||||
struct pf_trans *t, *nt;
|
|
||||||
|
|
||||||
rw_assert_wrlock(&pfioctl_rw);
|
|
||||||
|
|
||||||
LIST_FOREACH_SAFE(t, &pf_ioctl_trans, pft_entry, nt) {
|
|
||||||
if (t->pft_unit == unit)
|
|
||||||
pf_rollback_trans(t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct pf_trans *
|
struct pf_trans *
|
||||||
pf_find_trans(uint32_t unit, uint64_t ticket)
|
pf_find_trans(uint32_t unit, uint64_t ticket)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: in.c,v 1.184 2023/04/24 12:11:56 kn Exp $ */
|
/* $OpenBSD: in.c,v 1.185 2023/06/28 11:49:49 kn Exp $ */
|
||||||
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
|
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -839,7 +839,7 @@ in_addmulti(struct in_addr *ap, struct ifnet *ifp)
|
||||||
/*
|
/*
|
||||||
* Found it; just increment the reference count.
|
* Found it; just increment the reference count.
|
||||||
*/
|
*/
|
||||||
++inm->inm_refcnt;
|
refcnt_take(&inm->inm_refcnt);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* New address; allocate a new multicast record
|
* New address; allocate a new multicast record
|
||||||
|
@ -849,7 +849,7 @@ in_addmulti(struct in_addr *ap, struct ifnet *ifp)
|
||||||
inm->inm_sin.sin_len = sizeof(struct sockaddr_in);
|
inm->inm_sin.sin_len = sizeof(struct sockaddr_in);
|
||||||
inm->inm_sin.sin_family = AF_INET;
|
inm->inm_sin.sin_family = AF_INET;
|
||||||
inm->inm_sin.sin_addr = *ap;
|
inm->inm_sin.sin_addr = *ap;
|
||||||
inm->inm_refcnt = 1;
|
refcnt_init_trace(&inm->inm_refcnt, DT_REFCNT_IDX_IFMADDR);
|
||||||
inm->inm_ifidx = ifp->if_index;
|
inm->inm_ifidx = ifp->if_index;
|
||||||
inm->inm_ifma.ifma_addr = sintosa(&inm->inm_sin);
|
inm->inm_ifma.ifma_addr = sintosa(&inm->inm_sin);
|
||||||
|
|
||||||
|
@ -890,7 +890,7 @@ in_delmulti(struct in_multi *inm)
|
||||||
|
|
||||||
NET_ASSERT_LOCKED();
|
NET_ASSERT_LOCKED();
|
||||||
|
|
||||||
if (--inm->inm_refcnt != 0)
|
if (refcnt_rele(&inm->inm_refcnt) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ifp = if_get(inm->inm_ifidx);
|
ifp = if_get(inm->inm_ifidx);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: in6.c,v 1.261 2023/04/21 00:41:13 kn Exp $ */
|
/* $OpenBSD: in6.c,v 1.262 2023/06/28 11:49:49 kn Exp $ */
|
||||||
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
|
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1032,7 +1032,7 @@ in6_addmulti(struct in6_addr *maddr6, struct ifnet *ifp, int *errorp)
|
||||||
/*
|
/*
|
||||||
* Found it; just increment the reference count.
|
* Found it; just increment the reference count.
|
||||||
*/
|
*/
|
||||||
in6m->in6m_refcnt++;
|
refcnt_take(&in6m->in6m_refcnt);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* New address; allocate a new multicast record
|
* New address; allocate a new multicast record
|
||||||
|
@ -1047,7 +1047,7 @@ in6_addmulti(struct in6_addr *maddr6, struct ifnet *ifp, int *errorp)
|
||||||
in6m->in6m_sin.sin6_len = sizeof(struct sockaddr_in6);
|
in6m->in6m_sin.sin6_len = sizeof(struct sockaddr_in6);
|
||||||
in6m->in6m_sin.sin6_family = AF_INET6;
|
in6m->in6m_sin.sin6_family = AF_INET6;
|
||||||
in6m->in6m_sin.sin6_addr = *maddr6;
|
in6m->in6m_sin.sin6_addr = *maddr6;
|
||||||
in6m->in6m_refcnt = 1;
|
refcnt_init_trace(&in6m->in6m_refcnt, DT_REFCNT_IDX_IFMADDR);
|
||||||
in6m->in6m_ifidx = ifp->if_index;
|
in6m->in6m_ifidx = ifp->if_index;
|
||||||
in6m->in6m_ifma.ifma_addr = sin6tosa(&in6m->in6m_sin);
|
in6m->in6m_ifma.ifma_addr = sin6tosa(&in6m->in6m_sin);
|
||||||
|
|
||||||
|
@ -1088,7 +1088,7 @@ in6_delmulti(struct in6_multi *in6m)
|
||||||
|
|
||||||
NET_ASSERT_LOCKED();
|
NET_ASSERT_LOCKED();
|
||||||
|
|
||||||
if (--in6m->in6m_refcnt == 0) {
|
if (refcnt_rele(&in6m->in6m_refcnt) != 0) {
|
||||||
/*
|
/*
|
||||||
* No remaining claims to this record; let MLD6 know
|
* No remaining claims to this record; let MLD6 know
|
||||||
* that we are leaving the multicast group.
|
* that we are leaving the multicast group.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: proc.h,v 1.341 2023/06/01 10:21:26 claudio Exp $ */
|
/* $OpenBSD: proc.h,v 1.342 2023/06/28 08:23:25 claudio Exp $ */
|
||||||
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
|
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
|
@ -587,8 +587,6 @@ int proc_cansugid(struct proc *);
|
||||||
|
|
||||||
struct sleep_state {
|
struct sleep_state {
|
||||||
int sls_s;
|
int sls_s;
|
||||||
int sls_catch;
|
|
||||||
int sls_timeout;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cond {
|
struct cond {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: refcnt.h,v 1.9 2023/04/28 20:03:14 mvs Exp $ */
|
/* $OpenBSD: refcnt.h,v 1.10 2023/06/28 11:49:49 kn Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
|
* Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
|
||||||
|
@ -45,9 +45,10 @@ unsigned int refcnt_read(struct refcnt *);
|
||||||
|
|
||||||
/* sorted alphabetically, keep in sync with dev/dt/dt_prov_static.c */
|
/* sorted alphabetically, keep in sync with dev/dt/dt_prov_static.c */
|
||||||
#define DT_REFCNT_IDX_IFADDR 1
|
#define DT_REFCNT_IDX_IFADDR 1
|
||||||
#define DT_REFCNT_IDX_INPCB 2
|
#define DT_REFCNT_IDX_IFMADDR 2
|
||||||
#define DT_REFCNT_IDX_RTENTRY 3
|
#define DT_REFCNT_IDX_INPCB 3
|
||||||
#define DT_REFCNT_IDX_TDB 4
|
#define DT_REFCNT_IDX_RTENTRY 4
|
||||||
|
#define DT_REFCNT_IDX_TDB 5
|
||||||
|
|
||||||
#endif /* _KERNEL */
|
#endif /* _KERNEL */
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: systm.h,v 1.161 2023/01/31 15:18:56 deraadt Exp $ */
|
/* $OpenBSD: systm.h,v 1.162 2023/06/28 08:23:25 claudio Exp $ */
|
||||||
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
|
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
|
@ -251,8 +251,8 @@ void stop_periodic_resettodr(void);
|
||||||
|
|
||||||
struct sleep_state;
|
struct sleep_state;
|
||||||
void sleep_setup(struct sleep_state *, const volatile void *, int,
|
void sleep_setup(struct sleep_state *, const volatile void *, int,
|
||||||
const char *, int);
|
const char *);
|
||||||
int sleep_finish(struct sleep_state *, int);
|
int sleep_finish(struct sleep_state *, int, int, int);
|
||||||
void sleep_queue_init(void);
|
void sleep_queue_init(void);
|
||||||
|
|
||||||
struct cond;
|
struct cond;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: fetch.c,v 1.214 2023/03/08 04:43:11 guenther Exp $ */
|
/* $OpenBSD: fetch.c,v 1.215 2023/06/28 11:07:28 op Exp $ */
|
||||||
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
|
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
|
@ -984,6 +984,7 @@ noslash:
|
||||||
} else if (strncasecmp(cp, LAST_MODIFIED,
|
} else if (strncasecmp(cp, LAST_MODIFIED,
|
||||||
sizeof(LAST_MODIFIED) - 1) == 0) {
|
sizeof(LAST_MODIFIED) - 1) == 0) {
|
||||||
cp += sizeof(LAST_MODIFIED) - 1;
|
cp += sizeof(LAST_MODIFIED) - 1;
|
||||||
|
cp += strspn(cp, " \t");
|
||||||
cp[strcspn(cp, "\t")] = '\0';
|
cp[strcspn(cp, "\t")] = '\0';
|
||||||
if (strptime(cp, "%a, %d %h %Y %T %Z", &lmt) == NULL)
|
if (strptime(cp, "%a, %d %h %Y %T %Z", &lmt) == NULL)
|
||||||
server_timestamps = 0;
|
server_timestamps = 0;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
.\" $OpenBSD: mg.1,v 1.134 2023/04/28 10:02:03 op Exp $
|
.\" $OpenBSD: mg.1,v 1.135 2023/06/28 08:37:52 op Exp $
|
||||||
.\" This file is in the public domain.
|
.\" This file is in the public domain.
|
||||||
.\"
|
.\"
|
||||||
.Dd $Mdocdate: April 28 2023 $
|
.Dd $Mdocdate: June 28 2023 $
|
||||||
.Dt MG 1
|
.Dt MG 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
|
@ -770,6 +770,8 @@ lines.
|
||||||
.It Ic no-tab-mode
|
.It Ic no-tab-mode
|
||||||
Toggle notab mode.
|
Toggle notab mode.
|
||||||
In this mode, spaces are inserted rather than tabs.
|
In this mode, spaces are inserted rather than tabs.
|
||||||
|
Can be set globally with
|
||||||
|
.Ic set-default-mode .
|
||||||
.It Ic not-modified
|
.It Ic not-modified
|
||||||
Turn off the modified flag in the current buffer.
|
Turn off the modified flag in the current buffer.
|
||||||
.It Ic open-line
|
.It Ic open-line
|
||||||
|
@ -920,7 +922,7 @@ This is the default.
|
||||||
.It Ic set-default-mode
|
.It Ic set-default-mode
|
||||||
Append the supplied mode to the list of default modes
|
Append the supplied mode to the list of default modes
|
||||||
used by subsequent buffer creation.
|
used by subsequent buffer creation.
|
||||||
Built in modes include: fill, indent and overwrite.
|
Built in modes include: fill, indent, notab and overwrite.
|
||||||
.It Ic set-fill-column
|
.It Ic set-fill-column
|
||||||
Prompt the user for a fill column.
|
Prompt the user for a fill column.
|
||||||
Used by
|
Used by
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: patterns.c,v 1.8 2023/02/16 03:09:33 jsg Exp $ */
|
/* $OpenBSD: patterns.c,v 1.9 2023/06/27 22:31:27 patrick Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1995, 1996 Christopher G. Demetriou. All rights reserved.
|
* Copyright (c) 1995, 1996 Christopher G. Demetriou. All rights reserved.
|
||||||
|
@ -111,6 +111,7 @@ main(void)
|
||||||
printf("%s\n", "ogx");
|
printf("%s\n", "ogx");
|
||||||
printf("%s\n", "otus");
|
printf("%s\n", "otus");
|
||||||
printf("%s\n", "pgt");
|
printf("%s\n", "pgt");
|
||||||
|
printf("%s\n", "qcpas");
|
||||||
printf("%s\n", "radeondrm");
|
printf("%s\n", "radeondrm");
|
||||||
print_devices("radeondrm", radeon_devices, nitems(radeon_devices));
|
print_devices("radeondrm", radeon_devices, nitems(radeon_devices));
|
||||||
printf("%s\n", "rsu");
|
printf("%s\n", "rsu");
|
||||||
|
|
|
@ -26,9 +26,9 @@ use OpenBSD::Paths;
|
||||||
|
|
||||||
sub new($class, $repository, $name)
|
sub new($class, $repository, $name)
|
||||||
{
|
{
|
||||||
return bless {
|
return bless {
|
||||||
repository => $repository,
|
repository => $repository,
|
||||||
name => $repository->canonicalize($name)
|
name => $repository->canonicalize($name)
|
||||||
}, $class;
|
}, $class;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ sub has_fragment($self, $state, $def, $frag, $location)
|
||||||
my $v = $self->value($def);
|
my $v = $self->value($def);
|
||||||
|
|
||||||
if (!defined $v) {
|
if (!defined $v) {
|
||||||
$state->fatal("Unknown fragment #1 in #2",
|
$state->fatal("Unknown fragment #1 in #2",
|
||||||
$frag, $location);
|
$frag, $location);
|
||||||
} elsif ($v == 1) {
|
} elsif ($v == 1) {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -230,10 +230,10 @@ sub run($class, $state, @args)
|
||||||
}
|
}
|
||||||
if (!close($cmd)) {
|
if (!close($cmd)) {
|
||||||
if ($!) {
|
if ($!) {
|
||||||
$state->errsay("Error running #1: #2", $!,
|
$state->errsay("Error running #1: #2", $!,
|
||||||
join(' ', @args));
|
join(' ', @args));
|
||||||
} else {
|
} else {
|
||||||
$state->errsay("Exit status #1 from #2", $?,
|
$state->errsay("Exit status #1 from #2", $?,
|
||||||
join(' ', @args));
|
join(' ', @args));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -259,7 +259,7 @@ sub ask_df($class, $fname, $state)
|
||||||
my $blocksize = 512;
|
my $blocksize = 512;
|
||||||
|
|
||||||
$class->ask_mount($state) if !defined $devinfo;
|
$class->ask_mount($state) if !defined $devinfo;
|
||||||
$class->run($state, OpenBSD::Paths->df, "--", $fname,
|
$class->run($state, OpenBSD::Paths->df, "--", $fname,
|
||||||
sub($l) {
|
sub($l) {
|
||||||
chomp $l;
|
chomp $l;
|
||||||
if ($l =~ m/^Filesystem\s+(\d+)\-blocks/o) {
|
if ($l =~ m/^Filesystem\s+(\d+)\-blocks/o) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: aspa.c,v 1.19 2023/06/26 18:39:53 job Exp $ */
|
/* $OpenBSD: aspa.c,v 1.20 2023/06/28 17:24:20 tb Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022 Job Snijders <job@fastly.com>
|
* Copyright (c) 2022 Job Snijders <job@fastly.com>
|
||||||
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
|
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
|
||||||
|
@ -133,8 +133,7 @@ aspa_parse_econtent(const unsigned char *d, size_t dsz, struct parse *p)
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
if ((aspa = d2i_ASProviderAttestation(NULL, &d, dsz)) == NULL) {
|
if ((aspa = d2i_ASProviderAttestation(NULL, &d, dsz)) == NULL) {
|
||||||
cryptowarnx("%s: ASPA: failed to parse ASProviderAttestation",
|
warnx("%s: ASPA: failed to parse ASProviderAttestation", p->fn);
|
||||||
p->fn);
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue