summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testsuites/aclocal/canonical-target-name.m425
-rw-r--r--testsuites/aclocal/canonicalize-tools.m420
-rw-r--r--testsuites/aclocal/check-cpuopts.m421
-rw-r--r--testsuites/aclocal/check-custom-bsp.m422
-rw-r--r--testsuites/aclocal/check-cxx.m420
-rw-r--r--testsuites/aclocal/check-tool.m49
-rw-r--r--testsuites/aclocal/enable-cxx.m411
-rw-r--r--testsuites/aclocal/enable-tests.m411
-rw-r--r--testsuites/aclocal/env-rtemsbsp.m427
-rw-r--r--testsuites/aclocal/gcc-specs.m416
-rw-r--r--testsuites/aclocal/prog-cc.m440
-rw-r--r--testsuites/aclocal/prog-cxx.m449
-rw-r--r--testsuites/aclocal/project-root.m47
-rw-r--r--testsuites/aclocal/rtems-bsp-includes.m413
-rw-r--r--testsuites/aclocal/rtems-bsp-linkcmds.m425
-rw-r--r--testsuites/aclocal/rtems-build-top.m412
-rw-r--r--testsuites/aclocal/rtems-includes.m423
-rw-r--r--testsuites/aclocal/rtems-source-top.m48
-rw-r--r--testsuites/aclocal/rtems-test-check.m431
-rw-r--r--testsuites/aclocal/rtems-top.m483
-rw-r--r--testsuites/aclocal/version.m44
-rw-r--r--testsuites/ada/aclocal/prog-gnat.m444
-rw-r--r--testsuites/libtests/POSIX/calloc.c4
-rw-r--r--testsuites/libtests/dl10/init.c33
-rw-r--r--testsuites/libtests/libfdt01/some.c4
-rw-r--r--testsuites/libtests/malloc04/init.c37
-rw-r--r--testsuites/libtests/malloctest/task1.c2
-rw-r--r--testsuites/libtests/ofw01/init.c16
-rw-r--r--testsuites/libtests/ofw01/some.c4
-rw-r--r--testsuites/libtests/stackchk/task1.c2
-rw-r--r--testsuites/libtests/tar01/init.c199
-rw-r--r--testsuites/libtests/tar01/tar01.doc1
-rw-r--r--testsuites/libtests/tar01/tar01.scn54
-rw-r--r--testsuites/libtests/tar01/tar01.tarbin10240 -> 10240 bytes
-rw-r--r--testsuites/mptests/mp01/task1.c2
-rw-r--r--testsuites/mptests/mp03/task1.c2
-rw-r--r--testsuites/mptests/mp04/task1.c2
-rw-r--r--testsuites/psxtests/psxsignal09/init.c73
-rw-r--r--testsuites/psxtests/psxsignal09/psxsignal09.doc7
-rw-r--r--testsuites/psxtests/psxsignal09/psxsignal09.scn3
-rw-r--r--testsuites/psxtests/psxsignal09/system.h55
-rw-r--r--testsuites/samples/base_mp/apptask.c2
-rw-r--r--testsuites/samples/base_sp/apptask.c2
-rw-r--r--testsuites/samples/ticker/tasks.c2
-rw-r--r--testsuites/smptests/smp08/tasks.c2
-rw-r--r--testsuites/smptests/smpaffinity01/init.c2
-rw-r--r--testsuites/smptests/smpscheduler02/init.c2
-rw-r--r--testsuites/sptests/sp19/first.c2
-rw-r--r--testsuites/sptests/sp19/fptask.c2
-rw-r--r--testsuites/sptests/sp19/task1.c2
-rw-r--r--testsuites/sptests/sp24/task1.c2
-rw-r--r--testsuites/sptests/sp30/task1.c2
-rw-r--r--testsuites/sptests/sp42/init.c2
-rw-r--r--testsuites/sptests/sp69/init.c25
-rw-r--r--testsuites/sptests/sp76/init.c2
-rw-r--r--testsuites/sptests/spcbssched01/task1.c2
-rw-r--r--testsuites/sptests/spchain/init.c8
-rw-r--r--testsuites/sptests/spedfsched01/task1.c2
-rw-r--r--testsuites/sptests/spfatal35/init.c89
-rw-r--r--testsuites/sptests/spfatal35/spfatal35.doc7
-rw-r--r--testsuites/sptests/spfatal35/spfatal35.scn2
-rw-r--r--testsuites/sptests/spintrcritical08/init.c13
-rw-r--r--testsuites/sptests/spintrcritical09/init.c2
-rw-r--r--testsuites/sptests/spintrcritical10/init.c9
-rw-r--r--testsuites/sptests/spintrcritical21/init.c16
-rw-r--r--testsuites/sptests/spintrcritical22/init.c2
-rw-r--r--testsuites/sptests/spsimplesched01/init.c2
-rw-r--r--testsuites/sptests/spsimplesched02/init.c2
-rw-r--r--testsuites/sptests/sptask_err04/task1.c4
-rw-r--r--testsuites/sptests/sptimecounter01/init.c12
70 files changed, 611 insertions, 633 deletions
diff --git a/testsuites/aclocal/canonical-target-name.m4 b/testsuites/aclocal/canonical-target-name.m4
deleted file mode 100644
index d3c2531cda..0000000000
--- a/testsuites/aclocal/canonical-target-name.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-dnl canonicalize target cpu
-dnl NOTE: Most rtems targets do not fullfil autoconf's
-dnl target naming conventions "processor-vendor-os"
-dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
-dnl and we have to fix it for rtems ourselves
-
-AC_DEFUN([RTEMS_CANONICAL_TARGET_CPU],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_MSG_CHECKING(rtems target cpu)
-case "${host}" in
-riscv*-*-rtems*)
- RTEMS_CPU=riscv;;
-*-*-rtems*)
- RTEMS_CPU="$host_cpu";;
-*)
- ;;
-esac
-AS_IF([test -n "$RTEMS_CPU"],
-[dnl
-AC_MSG_RESULT($RTEMS_CPU)],
-[dnl
-AC_MSG_RESULT([<none>])
-AC_MSG_ERROR([unsupported host $host])])
-AC_SUBST(RTEMS_CPU)
-])
diff --git a/testsuites/aclocal/canonicalize-tools.m4 b/testsuites/aclocal/canonicalize-tools.m4
deleted file mode 100644
index d4f9241a2b..0000000000
--- a/testsuites/aclocal/canonicalize-tools.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-dnl Set target tools
-dnl
-
-AC_DEFUN([RTEMS_CANONICALIZE_TOOLS],
-[AC_REQUIRE([RTEMS_PROG_CC])dnl
-
-dnl FIXME: What shall be done if these tools are not available?
- RTEMS_CHECK_TOOL(AR,ar,no)
- RTEMS_CHECK_TOOL(AS,as,no)
- RTEMS_CHECK_TOOL(LD,ld,no)
- RTEMS_CHECK_TOOL(NM,nm,no)
-
-dnl special treatment of ranlib
- RTEMS_CHECK_TOOL(RANLIB,ranlib,:)
-
-dnl NOTE: These may not be available if not using gnutools
- RTEMS_CHECK_TOOL(OBJCOPY,objcopy,no)
- RTEMS_CHECK_TOOL(SIZE,size,no)
- RTEMS_CHECK_TOOL(STRIP,strip,:)
-])
diff --git a/testsuites/aclocal/check-cpuopts.m4 b/testsuites/aclocal/check-cpuopts.m4
deleted file mode 100644
index e399f13cb2..0000000000
--- a/testsuites/aclocal/check-cpuopts.m4
+++ /dev/null
@@ -1,21 +0,0 @@
-
-# RTEMS_CHECK_CPUOPTS(define)
-AC_DEFUN([RTEMS_CHECK_CPUOPTS],
-[
-AC_REQUIRE([RTEMS_BUILD_TOP])
-sav_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS -I${RTEMS_BUILD_ROOT}/include"
-AC_CACHE_CHECK(
- [for $1],
- [rtems_cv_$1],
- [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-#include <rtems/score/cpuopts.h>
-#ifndef $1
-choke me
-#endif
- ])],
- [rtems_cv_$1=yes],
- [rtems_cv_$1=no])
- ])
-CPPFLAGS="$sav_CPPFLAGS"
-])
diff --git a/testsuites/aclocal/check-custom-bsp.m4 b/testsuites/aclocal/check-custom-bsp.m4
deleted file mode 100644
index 8857adcc3f..0000000000
--- a/testsuites/aclocal/check-custom-bsp.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-AC_DEFUN([_RTEMS_CHECK_CUSTOM_BSP],[
-AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl sets RTEMS_CPU, target
-AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
- for i in ${rtems_rootdir}make/custom/$1;
- do
- AC_MSG_CHECKING([for $i])
- AS_IF([test -r $i],[
- $2="$i"
- AC_MSG_RESULT([yes])
- break;
- ],[
- AC_MSG_RESULT([no])
- ])
- done
-])
-
-AC_DEFUN([RTEMS_CHECK_CUSTOM_BSP],[
- _RTEMS_CHECK_CUSTOM_BSP([[$]$1.cfg],[BSP_FOUND])
- AS_IF([test -z "$BSP_FOUND"],[
- AC_MSG_ERROR([missing [$]$1.cfg])
- ])
-])
diff --git a/testsuites/aclocal/check-cxx.m4 b/testsuites/aclocal/check-cxx.m4
deleted file mode 100644
index 9fbea4e423..0000000000
--- a/testsuites/aclocal/check-cxx.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-dnl
-AC_DEFUN([RTEMS_CHECK_CXX],
-[dnl
-AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl
-AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET])dnl
-AC_REQUIRE([RTEMS_PROG_CXX_FOR_TARGET])dnl
-AC_CACHE_CHECK([whether to build rtems++],
- rtems_cv_HAS_CPLUSPLUS,
- [ if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
- if test -n "$CXX"; then
- rtems_cv_HAS_CPLUSPLUS="yes"
- else
- rtems_cv_HAS_CPLUSPLUS="no"
- fi
- else
- rtems_cv_HAS_CPLUSPLUS="no"
- fi])
-HAS_CPLUSPLUS="$rtems_cv_HAS_CPLUSPLUS";
-AC_SUBST(HAS_CPLUSPLUS)dnl
-])
diff --git a/testsuites/aclocal/check-tool.m4 b/testsuites/aclocal/check-tool.m4
deleted file mode 100644
index 2bc137cd96..0000000000
--- a/testsuites/aclocal/check-tool.m4
+++ /dev/null
@@ -1,9 +0,0 @@
-## Check for a cross tool, similar to AC_CHECK_TOOL, but do not fall back to
-## the un-prefixed version of PROG-TO-CHECK-FOR.
-dnl RTEMS_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
-AC_DEFUN([RTEMS_CHECK_TOOL],
-[
- AS_IF([test "x$build_alias" != "x$host_alias"],
- [rtems_tool_prefix=${ac_tool_prefix}])
- AC_CHECK_PROG($1, ${rtems_tool_prefix}$2, ${rtems_tool_prefix}$2, $3, $4)
-])
diff --git a/testsuites/aclocal/enable-cxx.m4 b/testsuites/aclocal/enable-cxx.m4
deleted file mode 100644
index 952f0151a8..0000000000
--- a/testsuites/aclocal/enable-cxx.m4
+++ /dev/null
@@ -1,11 +0,0 @@
-AC_DEFUN([RTEMS_ENABLE_CXX],
-[
-AC_ARG_ENABLE(cxx,
-[AS_HELP_STRING([--enable-cxx],
-[enable C++ support])],
-[case "${enable_cxx}" in
- yes) RTEMS_HAS_CPLUSPLUS=yes ;;
- no) RTEMS_HAS_CPLUSPLUS=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;;
-esac], [RTEMS_HAS_CPLUSPLUS=yes])
-])
diff --git a/testsuites/aclocal/enable-tests.m4 b/testsuites/aclocal/enable-tests.m4
deleted file mode 100644
index 9373924013..0000000000
--- a/testsuites/aclocal/enable-tests.m4
+++ /dev/null
@@ -1,11 +0,0 @@
-AC_DEFUN([RTEMS_ENABLE_TESTS],
-[
-AC_ARG_ENABLE(tests,
-[AS_HELP_STRING(--enable-tests,enable tests (default:samples))],
- [case "${enableval}" in
- samples) enable_tests=samples;;
- yes) enable_tests=yes ;;
- no) enable_tests=no ;;
- *) AC_MSG_ERROR([bad value ${enableval} for --enable-tests]) ;;
- esac], [enable_tests=samples])
-])
diff --git a/testsuites/aclocal/env-rtemsbsp.m4 b/testsuites/aclocal/env-rtemsbsp.m4
deleted file mode 100644
index 1cca7d9f83..0000000000
--- a/testsuites/aclocal/env-rtemsbsp.m4
+++ /dev/null
@@ -1,27 +0,0 @@
-dnl Pass a single BSP via an environment variable
-dnl used by per BSP configure scripts
-AC_DEFUN([RTEMS_ENV_RTEMSBSP],
-[dnl
-AC_BEFORE([$0], [RTEMS_ENABLE_RTEMSBSP])dnl
-AC_BEFORE([$0], [RTEMS_PROJECT_ROOT])dnl
-AC_BEFORE([$0], [RTEMS_CHECK_CUSTOM_BSP])dnl
-
-AC_ARG_VAR([RTEMS_BSP_FAMILY],[RTEMS's BSP directory])
-
-AC_ARG_VAR([RTEMS_BSP],[RTEMS_BSP to build])
-AC_MSG_CHECKING([for RTEMS_BSP])
-AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
-[dnl
- test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
-])dnl
-if test -z "$rtems_cv_RTEMS_BSP"; then
- AC_MSG_ERROR([Missing RTEMS_BSP])
-fi
-RTEMS_BSP="$rtems_cv_RTEMS_BSP"
-AC_MSG_RESULT(${RTEMS_BSP})
-AC_SUBST(RTEMS_BSP)
-
-AC_SUBST([PROJECT_INCLUDE],["\$(PROJECT_ROOT)/lib/include"])
-AC_SUBST([PROJECT_LIB],["\$(PROJECT_ROOT)/lib"])
-AC_SUBST([PROJECT_RELEASE],["\$(PROJECT_ROOT)"])
-])
diff --git a/testsuites/aclocal/gcc-specs.m4 b/testsuites/aclocal/gcc-specs.m4
deleted file mode 100644
index ddcc2bfb0c..0000000000
--- a/testsuites/aclocal/gcc-specs.m4
+++ /dev/null
@@ -1,16 +0,0 @@
-dnl Check whether the target compiler accepts -specs
-
-AC_DEFUN([RTEMS_GCC_SPECS],
-[AC_REQUIRE([RTEMS_PROG_CC])
-AC_CACHE_CHECK(whether $CC accepts -specs,rtems_cv_gcc_specs,
-[
-rtems_cv_gcc_specs=no
-if test x"$GCC" = x"yes"; then
- touch confspec
- echo 'void f(){}' >conftest.c
- if test -z "`${CC} -specs confspec -c conftest.c 2>&1`";then
- rtems_cv_gcc_specs=yes
- fi
-fi
-rm -f confspec conftest*
-])])
diff --git a/testsuites/aclocal/prog-cc.m4 b/testsuites/aclocal/prog-cc.m4
deleted file mode 100644
index cf6be7d9d0..0000000000
--- a/testsuites/aclocal/prog-cc.m4
+++ /dev/null
@@ -1,40 +0,0 @@
-dnl
-dnl Check for target gcc
-dnl
-
-AC_DEFUN([RTEMS_PROG_CC],
-[
-AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_BEFORE([$0], [AC_PROG_CC])dnl
-AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
-
-case "$host" in
-*-*-rtems*) ac_cv_exeext=.exe;;
-esac
-
-RTEMS_CHECK_TOOL(CC,gcc)
-test -z "$CC" && \
- AC_MSG_ERROR([no acceptable cc found in \$PATH])
-AC_PROG_CC
-AC_PROG_CPP
-])
-
-AC_DEFUN([RTEMS_PROG_CC_FOR_TARGET],
-[
-dnl check target cc
-RTEMS_PROG_CC
-
-dnl check if the compiler supports -specs
-RTEMS_GCC_SPECS
-
-AS_IF([test x"$GCC" = xyes],[
-GCCSPECS="-B\$(RTEMS_SOURCE_ROOT)/bsps/\$(RTEMS_CPU)/\$(RTEMS_BSP_FAMILY)/start"
-AS_IF([test x"$rtems_cv_gcc_specs" = xyes],[
-GCCSPECS="${GCCSPECS} -specs bsp_specs"])
-GCCSPECS="${GCCSPECS} -qrtems"])
-AC_SUBST(GCCSPECS)
-
-RTEMS_INCLUDES
-RTEMS_BSP_INCLUDES
-RTEMS_BSP_LINKCMDS
-])
diff --git a/testsuites/aclocal/prog-cxx.m4 b/testsuites/aclocal/prog-cxx.m4
deleted file mode 100644
index aac9c37f6c..0000000000
--- a/testsuites/aclocal/prog-cxx.m4
+++ /dev/null
@@ -1,49 +0,0 @@
-dnl
-dnl Check for target g++
-dnl
-
-AC_DEFUN([RTEMS_PROG_CXX_FOR_TARGET],
-[
-AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
-AC_REQUIRE([RTEMS_ENABLE_CXX])
-RTEMS_CHECK_CPUOPTS([RTEMS_SMP])
-
-# If CXXFLAGS is not set, default to CFLAGS
-if test x"$rtems_cv_HAS_SMP" = x"yes" ; then
- CXXFLAGS=${CXXFLAGS-${CFLAGS} -std=gnu++11}
-else
- CXXFLAGS=${CXXFLAGS-${CFLAGS}}
-fi
-
-CXXFLAGS=`echo ${CXXFLAGS} | sed \
- -e s/-Wmissing-prototypes// \
- -e s/-Wimplicit-function-declaration// \
- -e s/-Wstrict-prototypes// \
- -e s/-Wnested-externs//`
-
-RTEMS_CHECK_TOOL(CXX,g++)
-if test "$RTEMS_HAS_CPLUSPLUS" = "yes";
-then
- dnl Only accept g++
- dnl NOTE: This might be too restrictive
- if test -z "$CXX";
- then
- RTEMS_HAS_CPLUSPLUS=no
- HAS_CPLUSPLUS=no
- ## Work-around to a bug in automake
- AM_CONDITIONAL([am__fastdepCXX],[false])
- else
- AC_PROG_CXX
- AC_PROG_CXXCPP
- if test "$ac_cv_prog_cc_cross" != "$ac_cv_prog_cxx_cross"; then
- AC_MSG_ERROR([***]
- [Inconsistency in compiler configuration:]
- [Target C compiler and target C++ compiler]
- [must both either be cross compilers or native compilers])
- fi
- fi
-else
- ## Work-around to a bug in automake
- AM_CONDITIONAL([am__fastdepCXX],[false])
-fi
-])
diff --git a/testsuites/aclocal/project-root.m4 b/testsuites/aclocal/project-root.m4
deleted file mode 100644
index 641baee021..0000000000
--- a/testsuites/aclocal/project-root.m4
+++ /dev/null
@@ -1,7 +0,0 @@
-AC_DEFUN([RTEMS_PROJECT_ROOT],
-[dnl
-AC_REQUIRE([RTEMS_TOP])
-BIN2C=rtems-bin2c
-AC_SUBST(BIN2C)
-])
-
diff --git a/testsuites/aclocal/rtems-bsp-includes.m4 b/testsuites/aclocal/rtems-bsp-includes.m4
deleted file mode 100644
index 2248211192..0000000000
--- a/testsuites/aclocal/rtems-bsp-includes.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-dnl
-dnl RTEMS Include paths.
-dnl
-AC_DEFUN([RTEMS_BSP_INCLUDES],
-[
-AC_REQUIRE([RTEMS_SOURCE_TOP])
-AC_REQUIRE([RTEMS_BUILD_TOP])
-RTEMS_BSP_CPPFLAGS="-I${RTEMS_BUILD_ROOT}/lib/libbsp/\$(RTEMS_CPU)/\$(RTEMS_BSP_FAMILY)/include \
--I${RTEMS_SOURCE_ROOT}/bsps/include \
--I${RTEMS_SOURCE_ROOT}/bsps/\$(RTEMS_CPU)/include \
--I${RTEMS_SOURCE_ROOT}/bsps/\$(RTEMS_CPU)/\$(RTEMS_BSP_FAMILY)/include"
-AC_SUBST([RTEMS_BSP_CPPFLAGS])
-])
diff --git a/testsuites/aclocal/rtems-bsp-linkcmds.m4 b/testsuites/aclocal/rtems-bsp-linkcmds.m4
deleted file mode 100644
index 0ad8867f9d..0000000000
--- a/testsuites/aclocal/rtems-bsp-linkcmds.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-dnl
-dnl RTEMS Include paths.
-dnl
-dnl This is messy because the linkcmds have no clear and defined structure.
-dnl There are BSP named linkcmds files, plain linkcmds file, configure template
-dnl .in files configure changes and shared versions of these. The approach to have
-dnl a single file for a number of BSPs in a family is sound, the lack of rules
-dnl means we have a range of variants and this results in following code.
-dnl
-dnl The preinstall hid a number of questionable things and preinstall has gone.
-dnl
-AC_DEFUN([RTEMS_BSP_LINKCMDS],
-[
-AC_REQUIRE([RTEMS_SOURCE_TOP])
-AC_REQUIRE([RTEMS_BUILD_TOP])
-
-AC_MSG_CHECKING([BSP linkcmds])
-
-RTEMS_BSP_ARCH_PATH="${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}"
-RTEMS_BSP_ARCH_LINKCMDS_PATH="${RTEMS_BSP_ARCH_PATH}/shared/start"
-RTEMS_BSP_LIBBSP_PATH="${RTEMS_BUILD_ROOT}/lib/libbsp/${RTEMS_CPU}/${RTEMS_BSP_FAMILY}"
-
-AC_SUBST(RTEMS_BSP_ARCH_LINKCMDS_PATH)
-AC_SUBST(RTEMS_BSP_LIBBSP_PATH)
-])
diff --git a/testsuites/aclocal/rtems-build-top.m4 b/testsuites/aclocal/rtems-build-top.m4
deleted file mode 100644
index 5708119c14..0000000000
--- a/testsuites/aclocal/rtems-build-top.m4
+++ /dev/null
@@ -1,12 +0,0 @@
-dnl
-dnl RTEMS_BUILD_TOP($1)
-dnl
-AC_DEFUN([RTEMS_BUILD_TOP],
-[dnl
-#
-# This is a copy of the horrible hack in rtems-top.m4 and it is simpler to
-# copy it that attempt to clean this crap up.
-#
-RTEMS_BUILD_ROOT="${with_rtems_build_top}"
-AC_SUBST([RTEMS_BUILD_ROOT])
-])dnl
diff --git a/testsuites/aclocal/rtems-includes.m4 b/testsuites/aclocal/rtems-includes.m4
deleted file mode 100644
index ca4ebed581..0000000000
--- a/testsuites/aclocal/rtems-includes.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-dnl
-dnl RTEMS Include paths.
-dnl
-AC_DEFUN([RTEMS_INCLUDES],
-[
-AC_REQUIRE([RTEMS_SOURCE_TOP])
-AC_REQUIRE([RTEMS_BUILD_TOP])
-
-# Was CFLAGS set?
-rtems_cv_CFLAGS_set="${CFLAGS+set}"
-
-RTEMS_INCLUDE_CPUKIT="-I${RTEMS_SOURCE_ROOT}/cpukit/include"
-RTEMS_INCLUDE_CPUKIT_ARCH="-I${RTEMS_SOURCE_ROOT}/cpukit/score/cpu/\$(RTEMS_CPU)/include"
-
-RTEMS_CPUKIT_INCLUDE="${RTEMS_INCLUDE_CPUKIT} ${RTEMS_INCLUDE_CPUKIT_ARCH}"
-RTEMS_BUILD_INCLUDE="-I\$(top_builddir) -I${RTEMS_BUILD_ROOT}/include"
-
-RTEMS_INCLUDE="${RTEMS_BUILD_INCLUDE} ${RTEMS_CPUKIT_INCLUDE}"
-
-RTEMS_CPPFLAGS="${RTEMS_INCLUDE}"
-
-AC_SUBST([RTEMS_CPPFLAGS])
-])
diff --git a/testsuites/aclocal/rtems-source-top.m4 b/testsuites/aclocal/rtems-source-top.m4
deleted file mode 100644
index d1460ae82d..0000000000
--- a/testsuites/aclocal/rtems-source-top.m4
+++ /dev/null
@@ -1,8 +0,0 @@
-dnl
-dnl RTEMS_SOURCE_TOP
-dnl
-AC_DEFUN([RTEMS_SOURCE_TOP],
-[dnl
-RTEMS_SOURCE_ROOT="${with_rtems_source_top}"
-AC_SUBST([RTEMS_SOURCE_ROOT])
-])dnl
diff --git a/testsuites/aclocal/rtems-test-check.m4 b/testsuites/aclocal/rtems-test-check.m4
deleted file mode 100644
index 99b3e31244..0000000000
--- a/testsuites/aclocal/rtems-test-check.m4
+++ /dev/null
@@ -1,31 +0,0 @@
-dnl
-dnl Check a test getting it's status.
-dnl
-AC_DEFUN([RTEMS_TEST_CHECK],
-[AC_REQUIRE([RTEMS_ENV_RTEMSBSP])
- AC_REQUIRE([RTEMS_SOURCE_TOP])
- AC_MSG_CHECKING([${RTEMS_CPU}/${RTEMS_BSP} $1 test])
- tcheck="${RTEMS_SOURCE_ROOT}/testsuites/rtems-test-check"
- tdata="${RTEMS_BSP}-testsuite.tcfg"
- tincludes="${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}:${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}/${RTEMS_BSP_FAMILY}:${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}/${RTEMS_BSP_FAMILY}/config:${RTEMS_SOURCE_ROOT}/testsuites"
- if test -f $tcheck; then
- check_result=`$tcheck exclude ${RTEMS_BSP} $tdata $tincludes $1`
- else
- check_result=$1
- fi
- if test "$1" = "$check_result"; then
- if test -f $tcheck; then
- test_CFLAGS=`$tcheck cflags ${RTEMS_BSP} $tdata $tincludes $1`
- fi
- if test -z "$test_CFLAGS"; then
- result_msg="PASS"
- else
- result_msg="$test_CFLAGS"
- fi
- else
- result_msg="EXCLUDED"
- fi
- AC_MSG_RESULT([$result_msg])
- AM_CONDITIONAL([TEST_$1], [test "$result_msg" != "EXCLUDED"])
- AC_SUBST([TEST_FLAGS_$1], [$test_CFLAGS])
-])
diff --git a/testsuites/aclocal/rtems-top.m4 b/testsuites/aclocal/rtems-top.m4
deleted file mode 100644
index acb5732a1e..0000000000
--- a/testsuites/aclocal/rtems-top.m4
+++ /dev/null
@@ -1,83 +0,0 @@
-# AC_DISABLE_OPTION_CHECKING is not available before 2.62
-AC_PREREQ(2.62)
-
-dnl
-dnl RTEMS_TOP($1)
-dnl
-dnl $1 .. relative path from this configure.ac to the toplevel configure.ac
-dnl
-AC_DEFUN([RTEMS_TOP],
-[dnl
-AC_REQUIRE([RTEMS_VERSIONING])
-AC_REQUIRE([AM_SET_LEADING_DOT])
-AC_REQUIRE([AC_DISABLE_OPTION_CHECKING])
-AC_CONFIG_AUX_DIR([$1])
-AC_CHECK_PROGS(MAKE, gmake make)
-AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl
-
-AC_PREFIX_DEFAULT([/opt/rtems-][_RTEMS_API])
-
-## HACK to allow gnu-make conditionals in automake-Makefiles.
-ENDIF=endif
-AC_SUBST(ENDIF)
-
-AC_SUBST([RTEMS_TOPdir],["$1"])
-
-rtems_updir=m4_if([$2],[],[],[$2/])
-
-AC_ARG_ENABLE([rtems-root],[
-AS_HELP_STRING(--enable-rtems-root,directory containing make/custom)],
-[case ${enable_rtems_root} in
- [[\\/$]]* | ?:[[\\/]]* ) # absolute directory
- rtems_rootdir=${enable_rtems_root}
- RTEMS_ROOT=${enable_rtems_root}
- ;;
- *) # relative directory
- rtems_rootdir=${rtems_updir}${enable_rtems_root}
- RTEMS_ROOT='$(top_builddir)'/${rtems_updir}${enable_rtems_root}
- ;;
-esac],[
-rtems_rootdir=${rtems_updir}
-RTEMS_ROOT='$(top_builddir)'/${rtems_updir}
-])
-AC_SUBST([RTEMS_ROOT])
-
-AS_IF([test -n "${with_target_subdir}"],
- [project_top="../${with_project_top}"],
- [project_top="${with_project_top}"])
-AC_SUBST([PROJECT_TOPdir],[${project_top}${rtems_updir}'$(top_builddir)'])
-
-AC_ARG_ENABLE([cpukit-root],[
-AS_HELP_STRING(--enable-cpukit-root,directory containing lib/librtemscpu.a)],
-[case ${enable_cpukit_root} in
- [[\\/$]]* | ?:[[\\/]]* ) # absolute directory
- cpukit_rootdir=${enable_cpukit_root}
- CPUKIT_ROOT=${enable_cpukit_root}
- ;;
- *) # relative directory
- cpukit_rootdir=${rtems_updir}${enable_cpukit_root}
- CPUKIT_ROOT='$(top_builddir)'/${rtems_updir}${enable_cpukit_root}
- ;;
-esac],[
-cpukit_rootdir=
-CPUKIT_ROOT=
-])
-AC_SUBST([CPUKIT_ROOT])
-
-AC_ARG_ENABLE([project-root],[
-AS_HELP_STRING(--enable-project-root,directory containing lib/librtemsbsp.a)],
-[case ${enable_project_root} in
- [[\\/$]]* | ?:[[\\/]]* ) # absolute directory
- project_rootdir=${enable_project_root}
- PROJECT_ROOT=${enable_project_root}
- ;;
- *) # relative directory
- project_rootdir=${rtems_updir}${enable_project_root}
- PROJECT_ROOT='$(top_builddir)'/${rtems_updir}${enable_project_root}
- ;;
-esac],[
-project_rootdir=
-PROJECT_ROOT=
-])
-AC_SUBST([PROJECT_ROOT])
-])dnl
diff --git a/testsuites/aclocal/version.m4 b/testsuites/aclocal/version.m4
deleted file mode 100644
index 69e3eea10a..0000000000
--- a/testsuites/aclocal/version.m4
+++ /dev/null
@@ -1,4 +0,0 @@
-AC_DEFUN([RTEMS_VERSIONING],
-m4_define([_RTEMS_VERSION],[6.0.0]))
-
-m4_define([_RTEMS_API],[6])
diff --git a/testsuites/ada/aclocal/prog-gnat.m4 b/testsuites/ada/aclocal/prog-gnat.m4
deleted file mode 100644
index a2b2879c7d..0000000000
--- a/testsuites/ada/aclocal/prog-gnat.m4
+++ /dev/null
@@ -1,44 +0,0 @@
-##
-## Partially borrowed from gcc-3.2
-##
-## WARNING: All the stuff below is pretty immature.
-
-AC_DEFUN([RTEMS_PROG_GNAT],
-[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
-AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET])
-
-AC_CHECK_TOOL([GNATMAKE],[gnatmake],[])
-AC_CACHE_CHECK([for compiler driver that understands Ada],
- [rtems_cv_prog_CCADA],
-[cat >conftest.adb <<EOF
-procedure conftest is begin null; end conftest;
-EOF
-rtems_cv_prog_CCADA=
-# Have to do ac_tool_prefix and user overrides by hand.
-user_ccada=$CCADA
-user_cc=$CC
-for cand in ${ac_tool_prefix}$user_ccada $user_ccada \
- ${ac_tool_prefix}$user_cc $user_cc \
- ${ac_tool_prefix}gcc gcc \
- ${ac_tool_prefix}cc cc \
- ${ac_tool_prefix}gnatgcc gnatgcc \
- ${ac_tool_prefix}gnatcc gnatcc \
- ${ac_tool_prefix}adagcc adagcc \
- ${ac_tool_prefix}adac adac ; do
- # There is a bug in all released versions of GCC which causes the
- # driver to exit successfully when the appropriate language module
- # has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1.
- # Therefore we must check for the error message as well as an
- # unsuccessful exit.
- errors=`($cand -c conftest.adb) 2>&1 || echo failure`
- AS_IF([test -z "$errors"],
- [rtems_cv_prog_CCADA=$cand
- break])
-done
-rm -f conftest.*])
-AC_SUBST([CCADA],[$rtems_cv_prog_CCADA])
-
-AS_IF([test -n "$GNATMAKE" && test -n "$CCADA"],
- [HAVE_GNAT=yes],
- [HAVE_GNAT=no])
-])
diff --git a/testsuites/libtests/POSIX/calloc.c b/testsuites/libtests/POSIX/calloc.c
index bd04faa800..a7537c8cc4 100644
--- a/testsuites/libtests/POSIX/calloc.c
+++ b/testsuites/libtests/POSIX/calloc.c
@@ -16,6 +16,8 @@ int
main (void)
{
void *foo = calloc (42, 43);
+ int rc = (foo != NULL);
+ free(foo);
- return (foo != NULL);
+ return rc;
}
diff --git a/testsuites/libtests/dl10/init.c b/testsuites/libtests/dl10/init.c
index b488a321ab..ac9d378700 100644
--- a/testsuites/libtests/dl10/init.c
+++ b/testsuites/libtests/dl10/init.c
@@ -27,9 +27,6 @@
const char rtems_test_name[] = "libdl (RTL) 10";
-/* forward declarations to avoid warnings */
-static rtems_task Init(rtems_task_argument argument);
-
#include "dl10-tar.h"
#define TARFILE_START dl10_tar
@@ -46,9 +43,18 @@ static int test(void)
return 0;
}
+static void notification(int fd, int seconds_remaining, void *arg)
+{
+ printf(
+ "Press any key to enter shell (%is remaining)\n",
+ seconds_remaining
+ );
+}
+
static void Init(rtems_task_argument arg)
{
int e;
+ rtems_status_code sc;
TEST_BEGIN();
@@ -76,13 +82,20 @@ static void Init(rtems_task_argument arg)
exit (1);
}
- rtems_shell_init ("SHLL",
- RTEMS_MINIMUM_STACK_SIZE * 4,
- 100,
- "/dev/foobar",
- false,
- true,
- NULL);
+
+ sc = rtems_shell_wait_for_input (STDIN_FILENO,
+ 20,
+ notification,
+ NULL);
+ if (sc == RTEMS_SUCCESSFUL) {
+ rtems_shell_init ("SHLL",
+ RTEMS_MINIMUM_STACK_SIZE * 4,
+ 100,
+ "/dev/foobar",
+ false,
+ true,
+ NULL);
+ }
TEST_END();
diff --git a/testsuites/libtests/libfdt01/some.c b/testsuites/libtests/libfdt01/some.c
index 5eed911204..d5d8b7a285 100644
--- a/testsuites/libtests/libfdt01/some.c
+++ b/testsuites/libtests/libfdt01/some.c
@@ -4,9 +4,9 @@
* WARNING: Automatically generated -- do not edit!
*/
-#include <sys/types.h>
+#include <rtems.h>
-const unsigned char some_bin[] = {
+RTEMS_ALIGNED(8) const unsigned char some_bin[] = {
0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, 0x38,
0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48,
diff --git a/testsuites/libtests/malloc04/init.c b/testsuites/libtests/malloc04/init.c
index 51d318850b..8f05c63a79 100644
--- a/testsuites/libtests/malloc04/init.c
+++ b/testsuites/libtests/malloc04/init.c
@@ -78,16 +78,23 @@ rtems_task Init(
)
{
Heap_Control *real_heap;
- Memory_Area area;
- Memory_Information mem = {
- .count = 1,
- .areas = &area
- };
+ const Memory_Information *mem;
+ Memory_Area *area;
+ size_t i;
void *p;
TEST_BEGIN();
+ mem = _Memory_Get();
+
+ for ( i = 0; i < _Memory_Get_count( mem ); ++i ) {
+ area = _Memory_Get_area( mem, i );
+ _Memory_Initialize( area, NULL, NULL );
+ }
+
+ area = _Memory_Get_area( mem, 0 );
+
/* Safe information on real heap */
real_heap = malloc_get_heap_pointer();
malloc_set_heap_pointer( &TempHeap );
@@ -98,8 +105,8 @@ rtems_task Init(
sbrk_count = 0;
offset = 256;
- _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset );
- RTEMS_Malloc_Initialize( &mem, NULL );
+ _Memory_Initialize_by_size( area, &Malloc_Heap[ 0 ], offset );
+ _Malloc_Initialize();
errno = 0;
p = malloc( 256 );
@@ -113,8 +120,8 @@ rtems_task Init(
sbrk_count = 0;
offset = 256;
- _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset );
- RTEMS_Malloc_Initialize( &mem, NULL );
+ _Memory_Initialize_by_size( area, &Malloc_Heap[ 0 ], offset );
+ _Malloc_Initialize();
p = malloc(1);
rtems_test_assert( p != NULL );
@@ -128,8 +135,8 @@ rtems_task Init(
sbrk_count = 0;
offset = 256;
- _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset );
- RTEMS_Malloc_Initialize( &mem, NULL );
+ _Memory_Initialize_by_size( area, &Malloc_Heap[ 0 ], offset );
+ _Malloc_Initialize();
errno = 0;
p = malloc( sizeof( Malloc_Heap ) );
@@ -141,8 +148,8 @@ rtems_task Init(
sbrk_count = 0;
offset = 256;
- _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset );
- RTEMS_Malloc_Initialize( &mem, NULL );
+ _Memory_Initialize_by_size( area, &Malloc_Heap[ 0 ], offset );
+ _Malloc_Initialize();
p = malloc( 128 );
rtems_test_assert( p != NULL );
@@ -156,8 +163,8 @@ rtems_task Init(
sbrk_count = -1;
offset = 256;
- _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset );
- RTEMS_Malloc_Initialize( &mem, NULL );
+ _Memory_Initialize_by_size( area, &Malloc_Heap[ 0 ], offset );
+ _Malloc_Initialize();
errno = 0;
p = malloc( 256 );
diff --git a/testsuites/libtests/malloctest/task1.c b/testsuites/libtests/malloctest/task1.c
index 753a74e77a..4f0309af5a 100644
--- a/testsuites/libtests/malloctest/task1.c
+++ b/testsuites/libtests/malloctest/task1.c
@@ -34,7 +34,7 @@ rtems_task Task_1_through_5(
unsigned char *mem_ptr;
int mem_amt;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident" );
while (TRUE)
diff --git a/testsuites/libtests/ofw01/init.c b/testsuites/libtests/ofw01/init.c
index 6006121cc7..6afed33475 100644
--- a/testsuites/libtests/ofw01/init.c
+++ b/testsuites/libtests/ofw01/init.c
@@ -37,6 +37,7 @@
#include <bsp/fdt.h>
#include <ofw/ofw.h>
#include <ofw/ofw_test.h>
+#include <rtems/score/isr.h>
#include "some.h"
@@ -50,7 +51,20 @@ const void *__real_bsp_fdt_get(void);
const void *__wrap_bsp_fdt_get(void)
{
- if (test_bin != NULL) {
+ uintptr_t sp;
+
+ sp = (uintptr_t) __builtin_frame_address(0);
+ RTEMS_OBFUSCATE_VARIABLE(sp);
+
+ /*
+ * Use the stack pointer to check if we have to return the real device tree
+ * since bsp_fdt_get() may get called before the BSS is cleared to zero.
+ */
+ if (
+ (sp < (uintptr_t) _ISR_Stack_area_begin ||
+ sp >= (uintptr_t) _ISR_Stack_area_end) &&
+ test_bin != NULL
+ ) {
return test_bin;
}
diff --git a/testsuites/libtests/ofw01/some.c b/testsuites/libtests/ofw01/some.c
index 91251e71b0..7ce8760316 100644
--- a/testsuites/libtests/ofw01/some.c
+++ b/testsuites/libtests/ofw01/some.c
@@ -4,9 +4,9 @@
* WARNING: Automatically generated -- do not edit!
*/
-#include <sys/types.h>
+#include <rtems.h>
-const unsigned char some_bin[] = {
+RTEMS_ALIGNED(8) const unsigned char some_bin[] = {
0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x02, 0xcf, 0x00, 0x00, 0x00, 0x38,
0x00, 0x00, 0x02, 0x70, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f,
diff --git a/testsuites/libtests/stackchk/task1.c b/testsuites/libtests/stackchk/task1.c
index 7a9f488ff0..4e08d20819 100644
--- a/testsuites/libtests/stackchk/task1.c
+++ b/testsuites/libtests/stackchk/task1.c
@@ -25,7 +25,7 @@ rtems_task Task_1_through_3(
rtems_time_of_day time;
rtems_status_code status;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident" );
while( FOREVER ) {
diff --git a/testsuites/libtests/tar01/init.c b/testsuites/libtests/tar01/init.c
index 4cad67a6ae..2deff3a482 100644
--- a/testsuites/libtests/tar01/init.c
+++ b/testsuites/libtests/tar01/init.c
@@ -7,6 +7,33 @@
* http://www.rtems.org/license/LICENSE.
*/
+/*
+ * Note on the used tar file: Generate the file on a system that supports
+ * symlinks with the following commands (tested on Linux - you might have to
+ * adapt on other systems):
+ *
+ * export WORK=some_work_directory
+ * rm -r ${WORK}
+ * mkdir -p ${WORK}/home/abc/def
+ * mkdir -p ${WORK}/home/dir
+ * cd ${WORK}
+ * echo "#! joel" > home/abc/def/test_script
+ * echo "ls -las /dev" >> home/abc/def/test_script
+ * chmod 755 home/abc/def/test_script
+ * echo "This is a test of loading an RTEMS filesystem from an" > home/test_file
+ * echo "initial tar image." >> home/test_file
+ * echo "Hello world" >> home/dir/file
+ * ln -s home/test_file symlink
+ * tar cf tar01.tar --format=ustar \
+ * symlink \
+ * home/test_file \
+ * home/abc/def/test_script \
+ * home/dir
+ *
+ * Note that "home/dir" is in the archive as separate directory. "home/abc" is
+ * only in the archive as a parent of the file "test_script".
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -95,6 +122,84 @@ void test_untar_from_memory(void)
}
+static void assert_file_content(
+ const char *name,
+ const char *expected_content,
+ ssize_t expected_size
+)
+{
+ char buf[16];
+ int fd;
+ int rd;
+
+ fd = open(name, O_RDONLY);
+ rtems_test_assert( fd >= 0 );
+ do {
+ rd = read(fd, buf, sizeof(buf));
+ rtems_test_assert( rd >= 0 );
+ if (rd > 0) {
+ rtems_test_assert( expected_size - rd >= 0 );
+ rtems_test_assert( memcmp(buf, expected_content, rd) == 0 );
+ expected_content += rd;
+ expected_size -= rd;
+ }
+ } while(rd > 0);
+ rtems_test_assert( expected_size == 0 );
+ close(fd);
+}
+
+static void assert_content_like_expected(void)
+{
+ const char *directories[] = {
+ "home",
+ "home/abc",
+ "home/abc/def",
+ "home/dir",
+ };
+ const char *symlinks[] = {
+ "symlink",
+ };
+ const struct {
+ const char *name;
+ const char *content;
+ } files[] = {
+ {
+ .name = "home/abc/def/test_script",
+ .content = "#! joel\nls -las /dev\n",
+ }, {
+ .name = "home/test_file",
+ .content = "This is a test of loading an RTEMS filesystem from an\n"
+ "initial tar image.\n",
+ }, {
+ .name = "home/dir/file",
+ .content = "Hello world\n",
+ }
+ };
+ size_t i;
+ struct stat st;
+
+ for(i = 0; i < RTEMS_ARRAY_SIZE(directories); ++i) {
+ lstat(directories[i], &st);
+ rtems_test_assert( S_ISDIR(st.st_mode) );
+ }
+
+ for(i = 0; i < RTEMS_ARRAY_SIZE(symlinks); ++i) {
+ lstat(symlinks[i], &st);
+ rtems_test_assert( S_ISLNK(st.st_mode) );
+ }
+
+ for(i = 0; i < RTEMS_ARRAY_SIZE(files); ++i) {
+ lstat(files[i].name, &st);
+ rtems_test_assert( S_ISREG(st.st_mode) );
+
+ assert_file_content(
+ files[i].name,
+ files[i].content,
+ strlen(files[i].content)
+ );
+ }
+}
+
void test_untar_from_file(void)
{
int fd;
@@ -119,13 +224,105 @@ void test_untar_from_file(void)
rv = chdir( "/dest" );
rtems_test_assert( rv == 0 );
- /* Untar it */
+ /* Case 1: Untar it into empty directory */
rv = Untar_FromFile( "/test.tar" );
printf("Untaring from file - ");
if (rv != UNTAR_SUCCESSFUL) {
printf ("error: untar failed: %i\n", rv);
exit(1);
}
+ assert_content_like_expected();
+ printf ("successful\n");
+
+ /* Case 2: Most files exist */
+ rv = unlink("/dest/home/test_file");
+ rtems_test_assert( rv == 0 );
+
+ rv = Untar_FromFile( "/test.tar" );
+ printf("Untar from file into existing structure with one missing file - ");
+ if (rv != UNTAR_SUCCESSFUL) {
+ printf ("error: untar failed: %i\n", rv);
+ exit(1);
+ }
+ assert_content_like_expected();
+ printf ("successful\n");
+
+ /* Case 3: An empty directory exists where a file should be */
+ rv = unlink("/dest/home/test_file");
+ rtems_test_assert( rv == 0 );
+ rv = mkdir("/dest/home/test_file", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
+ rtems_test_assert( rv == 0 );
+
+ rv = Untar_FromFile( "/test.tar" );
+ printf("Untar from file; overwrite empty directory with file - ");
+ if (rv != UNTAR_SUCCESSFUL) {
+ printf ("error: untar failed: %i\n", rv);
+ exit(1);
+ }
+ assert_content_like_expected();
+ printf ("successful\n");
+
+ /* Case 4: A file exists where a parent directory should be created */
+ rv = unlink("/dest/home/abc/def/test_script");
+ rtems_test_assert( rv == 0 );
+ rv = unlink("/dest/home/abc/def");
+ rtems_test_assert( rv == 0 );
+ rv = unlink("/dest/home/abc");
+ rtems_test_assert( rv == 0 );
+ fd = creat("/dest/home/abc", S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ rtems_test_assert( fd >= 0 );
+ close(fd);
+
+ rv = Untar_FromFile( "/test.tar" );
+ printf("Untar from file; file exists where parent dir should be created - ");
+ if (rv != UNTAR_FAIL) {
+ printf ("error: untar didn't fail like expected: %i\n", rv);
+ exit(1);
+ }
+ printf ("expected fail\n");
+ /* cleanup so that the next one works */
+ rv = unlink("/dest/home/abc");
+ rtems_test_assert( rv == 0 );
+
+ /* Case 5: A non-empty directory exists where a file should be created */
+ rv = unlink("/dest/home/test_file");
+ rtems_test_assert( rv == 0 );
+ rv = mkdir("/dest/home/test_file", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
+ rtems_test_assert( rv == 0 );
+ fd = creat("/dest/home/test_file/file",
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ rtems_test_assert( fd >= 0 );
+ close(fd);
+
+ rv = Untar_FromFile( "/test.tar" );
+ printf("Untar from file; non-empty dir where file should be created - ");
+ if (rv != UNTAR_FAIL) {
+ printf ("error: untar didn't fail like expected: %i\n", rv);
+ exit(1);
+ }
+ printf ("expected fail\n");
+ /* cleanup so that the next one works */
+ rv = unlink("/dest/home/test_file/file");
+ rtems_test_assert( rv == 0 );
+ rv = unlink("/dest/home/test_file");
+ rtems_test_assert( rv == 0 );
+
+ /* Case 6: A file exists where a directory is explicitly in the archive */
+ rv = unlink("/dest/home/dir/file");
+ rtems_test_assert( rv == 0 );
+ rv = unlink("/dest/home/dir");
+ rtems_test_assert( rv == 0 );
+ fd = creat("/dest/home/dir", S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ rtems_test_assert( fd >= 0 );
+ close(fd);
+
+ rv = Untar_FromFile( "/test.tar" );
+ printf("Untar from file; overwrite file with explicit directory - ");
+ if (rv != UNTAR_SUCCESSFUL) {
+ printf ("error: untar failed: %i\n", rv);
+ exit(1);
+ }
+ assert_content_like_expected();
printf ("successful\n");
/******************/
diff --git a/testsuites/libtests/tar01/tar01.doc b/testsuites/libtests/tar01/tar01.doc
index 060f98a813..adffdca291 100644
--- a/testsuites/libtests/tar01/tar01.doc
+++ b/testsuites/libtests/tar01/tar01.doc
@@ -20,3 +20,4 @@ directives:
concepts:
+ exercise these routines
++ check whether existing files are overwritten or not overwritten like expected
diff --git a/testsuites/libtests/tar01/tar01.scn b/testsuites/libtests/tar01/tar01.scn
index 68fa951881..dd72f9517b 100644
--- a/testsuites/libtests/tar01/tar01.scn
+++ b/testsuites/libtests/tar01/tar01.scn
@@ -1,9 +1,24 @@
-*** TAR01 TEST ***
-Untaring from memory - successful
+*** BEGIN OF TEST TAR 1 ***
+*** TEST VERSION: 6.0.0.e1efb4eb8a9d6dd5f6f37dafc9feb0a9e6a888f1
+*** TEST STATE: EXPECTED_PASS
+*** TEST BUILD: RTEMS_POSIX_API
+*** TEST TOOLS: 10.3.1 20210409 (RTEMS 6, RSB ad54d1dd3cf8249d9d39deb1dd28b2f294df062d-modified, Newlib eb03ac1)
+Untaring from memory - untar: memory at 0x11ece8 (10240)
+untar: symlink: home/test_file -> symlink
+untar: file: home/test_file (s:73,m:0644)
+untar: file: home/abc/def/test_script (s:21,m:0755)
+untar: dir: home/dir
+untar: file: home/dir/file (s:12,m:0644)
+successful
========= /home/test_file =========
(0)This is a test of loading an RTEMS filesystem from an
initial tar image.
+========= /home/abc/def/test_script =========
+(0)#! joel
+ls -las /dev
+
+ /home/abc/def/test_script: mode: 0755 want: 0755
========= /symlink =========
(0)This is a test of loading an RTEMS filesystem from an
initial tar image.
@@ -11,35 +26,58 @@ initial tar image.
Copy tar image to test.tar
Untaring from file - successful
+Untar from file into existing structure with one missing file - successful
+Untar from file; overwrite empty directory with file - successful
+Untar from file; file exists where parent dir should be created - expected fail
+Untar from file; non-empty dir where file should be created - expected fail
+Untar from file; overwrite file with explicit directory - successful
========= /dest/home/test_file =========
(0)This is a test of loading an RTEMS filesystem from an
initial tar image.
+========= /dest/home/abc/def/test_script =========
+(0)#! joel
+ls -las /dev
+
+ /dest/home/abc/def/test_script: mode: 0755 want: 0755
========= /dest/symlink =========
(0)This is a test of loading an RTEMS filesystem from an
initial tar image.
-Untaring chunks from memory - untar: dir: home
-untar: file: home/test_file (73)
+Untaring chunks from memory - untar: symlink: home/test_file -> symlink
+untar: file: home/test_file (s:73,m:0644)
+untar: file: home/abc/def/test_script (s:21,m:0755)
+untar: dir: home/dir
+untar: file: home/dir/file (s:12,m:0644)
successful
========= /dest2/home/test_file =========
(0)This is a test of loading an RTEMS filesystem from an
initial tar image.
+========= /dest2/home/abc/def/test_script =========
+(0)#! joel
+ls -las /dev
+
+ /dest2/home/abc/def/test_script: mode: 0755 want: 0755
========= /dest2/symlink =========
(0)This is a test of loading an RTEMS filesystem from an
initial tar image.
-Untaring chunks from tgz- untar: dir: home
-untar: file: home/test_file (73)
-successful
+Untaring chunks from tgz - successful
========= /dest3/home/test_file =========
(0)This is a test of loading an RTEMS filesystem from an
initial tar image.
+========= /dest3/home/abc/def/test_script =========
+(0)#! joel
+ls -las /dev
+
+ /dest3/home/abc/def/test_script: mode: 0755 want: 0755
========= /dest3/symlink =========
(0)This is a test of loading an RTEMS filesystem from an
initial tar image.
-*** END OF TAR01 TEST ***
+
+
+*** END OF TEST TAR 1 ***
diff --git a/testsuites/libtests/tar01/tar01.tar b/testsuites/libtests/tar01/tar01.tar
index 6c6952ef18..9874f426d1 100644
--- a/testsuites/libtests/tar01/tar01.tar
+++ b/testsuites/libtests/tar01/tar01.tar
Binary files differ
diff --git a/testsuites/mptests/mp01/task1.c b/testsuites/mptests/mp01/task1.c
index 50821e1b49..18682130aa 100644
--- a/testsuites/mptests/mp01/task1.c
+++ b/testsuites/mptests/mp01/task1.c
@@ -35,7 +35,7 @@ rtems_task Test_task(
rtems_id tid;
rtems_time_of_day time;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident" );
status = rtems_clock_get_tod( &time );
diff --git a/testsuites/mptests/mp03/task1.c b/testsuites/mptests/mp03/task1.c
index 48682e032c..9b0c1b2459 100644
--- a/testsuites/mptests/mp03/task1.c
+++ b/testsuites/mptests/mp03/task1.c
@@ -94,7 +94,7 @@ rtems_task Test_task(
rtems_id tid;
rtems_status_code status;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident" );
puts( "Getting TID of remote task" );
diff --git a/testsuites/mptests/mp04/task1.c b/testsuites/mptests/mp04/task1.c
index 878effd237..6e350d8527 100644
--- a/testsuites/mptests/mp04/task1.c
+++ b/testsuites/mptests/mp04/task1.c
@@ -33,7 +33,7 @@ rtems_task Test_task(
rtems_task_priority previous_priority;
rtems_task_priority previous_priority_1;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident" );
puts( "Getting TID of remote task" );
diff --git a/testsuites/psxtests/psxsignal09/init.c b/testsuites/psxtests/psxsignal09/init.c
new file mode 100644
index 0000000000..12883cc28c
--- /dev/null
+++ b/testsuites/psxtests/psxsignal09/init.c
@@ -0,0 +1,73 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup psxtests
+ */
+
+/*
+ * Copyright (C) 2021 On-Line Applications Research Corporation (OAR)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define CONFIGURE_INIT
+#include "system.h"
+#include <signal.h>
+#include <errno.h>
+#include <reent.h>
+
+const char rtems_test_name[] = "PSXSIGNAL 9";
+
+static void Handler_1( int signo )
+{
+ TEST_END();
+ rtems_test_exit(0);
+}
+
+void *POSIX_Init( void *argument )
+{
+ int status;
+ struct sigaction act;
+
+ TEST_BEGIN();
+
+ /* Hook signals that can be generated from machine exceptions */
+ act.sa_handler = Handler_1;
+ act.sa_flags = 0;
+ status = sigaction( SIGFPE, &act, NULL );
+ rtems_test_assert( !status );
+ status = sigaction( SIGILL, &act, NULL );
+ rtems_test_assert( !status );
+ status = sigaction( SIGSEGV, &act, NULL );
+ rtems_test_assert( !status );
+
+ /* Generate machine exception */
+ _CPU_Instruction_illegal();
+
+ return NULL;
+}
diff --git a/testsuites/psxtests/psxsignal09/psxsignal09.doc b/testsuites/psxtests/psxsignal09/psxsignal09.doc
new file mode 100644
index 0000000000..5375ee6c20
--- /dev/null
+++ b/testsuites/psxtests/psxsignal09/psxsignal09.doc
@@ -0,0 +1,7 @@
+# COPYRIGHT (c) 2021.
+# On-Line Applications Research Corporation (OAR).
+#
+# SPDX-License-Identifier: BSD-2-Clause
+
+This test ensures that machine exceptions are mapped to POSIX signals when
+required by the application.
diff --git a/testsuites/psxtests/psxsignal09/psxsignal09.scn b/testsuites/psxtests/psxsignal09/psxsignal09.scn
new file mode 100644
index 0000000000..b0d092a60c
--- /dev/null
+++ b/testsuites/psxtests/psxsignal09/psxsignal09.scn
@@ -0,0 +1,3 @@
+*** BEGIN OF TEST PSXSIGNAL 9 ***
+
+*** END OF TEST PSXSIGNAL 9 ***
diff --git a/testsuites/psxtests/psxsignal09/system.h b/testsuites/psxtests/psxsignal09/system.h
new file mode 100644
index 0000000000..9f83634b6d
--- /dev/null
+++ b/testsuites/psxtests/psxsignal09/system.h
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup psxtests
+ */
+
+/*
+ * Copyright (C) 2021 On-Line Applications Research Corporation (OAR)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <pmacros.h>
+
+void *POSIX_Init( void *argument );
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+#define CONFIGURE_EXCEPTION_TO_SIGNAL_MAPPING
+
+#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
+#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 1
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
+ (RTEMS_MINIMUM_STACK_SIZE * 4)
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/samples/base_mp/apptask.c b/testsuites/samples/base_mp/apptask.c
index e54e08afe8..063328ed42 100644
--- a/testsuites/samples/base_mp/apptask.c
+++ b/testsuites/samples/base_mp/apptask.c
@@ -32,7 +32,7 @@ rtems_task Application_task(
rtems_id tid;
rtems_status_code status;
- rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
(void) status;
printf( "This task was invoked with the node argument (%" PRIdrtems_task_argument ")\n", node );
printf( "This task has the id of 0x%" PRIxrtems_id "\n", tid );
diff --git a/testsuites/samples/base_sp/apptask.c b/testsuites/samples/base_sp/apptask.c
index f450f71467..02df777bea 100644
--- a/testsuites/samples/base_sp/apptask.c
+++ b/testsuites/samples/base_sp/apptask.c
@@ -34,7 +34,7 @@ rtems_task Application_task(
rtems_status_code status;
unsigned int a = (unsigned int) argument;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "ident" );
printf(
diff --git a/testsuites/samples/ticker/tasks.c b/testsuites/samples/ticker/tasks.c
index 12e806884d..7ff6eb7319 100644
--- a/testsuites/samples/ticker/tasks.c
+++ b/testsuites/samples/ticker/tasks.c
@@ -30,7 +30,7 @@ rtems_task Test_task(
uint32_t task_index;
rtems_status_code status;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "task ident" );
task_index = task_number( tid );
diff --git a/testsuites/smptests/smp08/tasks.c b/testsuites/smptests/smp08/tasks.c
index 40a097d034..28271253b8 100644
--- a/testsuites/smptests/smp08/tasks.c
+++ b/testsuites/smptests/smp08/tasks.c
@@ -28,7 +28,7 @@ rtems_task Test_task(
p = rtems_object_get_name( RTEMS_SELF, 5, name );
rtems_test_assert( p != NULL );
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
rtems_test_assert( status == RTEMS_SUCCESSFUL );
task_index = task_number( tid );
for ( ; ; ) {
diff --git a/testsuites/smptests/smpaffinity01/init.c b/testsuites/smptests/smpaffinity01/init.c
index 9ec687d816..e0065bfcb0 100644
--- a/testsuites/smptests/smpaffinity01/init.c
+++ b/testsuites/smptests/smpaffinity01/init.c
@@ -213,7 +213,7 @@ static void Init(rtems_task_argument arg)
TEST_BEGIN();
/* Initialize thread id */
- sc = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &Init_id );
+ sc = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &Init_id );
directive_failed( sc, "Identify Init Task" );
Validate_setaffinity_errors();
diff --git a/testsuites/smptests/smpscheduler02/init.c b/testsuites/smptests/smpscheduler02/init.c
index b337fc667e..3cc16ec68c 100644
--- a/testsuites/smptests/smpscheduler02/init.c
+++ b/testsuites/smptests/smpscheduler02/init.c
@@ -282,7 +282,7 @@ static void test(void)
prio = 1;
sc = rtems_semaphore_set_priority(cmtx_id, scheduler_b_id, prio, &prio);
rtems_test_assert(sc == RTEMS_NOT_DEFINED);
- rtems_test_assert(prio == 2);
+ rtems_test_assert(prio == 1);
}
CPU_ZERO(&cpuset);
diff --git a/testsuites/sptests/sp19/first.c b/testsuites/sptests/sp19/first.c
index 69ff29762f..00da9edd6e 100644
--- a/testsuites/sptests/sp19/first.c
+++ b/testsuites/sptests/sp19/first.c
@@ -26,7 +26,7 @@ rtems_task First_FP_task(
INTEGER_DECLARE;
FP_DECLARE;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident" );
task_index = task_number( tid );
diff --git a/testsuites/sptests/sp19/fptask.c b/testsuites/sptests/sp19/fptask.c
index 5ffff37f7e..c91a163f47 100644
--- a/testsuites/sptests/sp19/fptask.c
+++ b/testsuites/sptests/sp19/fptask.c
@@ -27,7 +27,7 @@ rtems_task FP_task(
INTEGER_DECLARE;
FP_DECLARE;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident of self" );
task_index = task_number( tid );
diff --git a/testsuites/sptests/sp19/task1.c b/testsuites/sptests/sp19/task1.c
index 912ed26ac6..b5cbdcd181 100644
--- a/testsuites/sptests/sp19/task1.c
+++ b/testsuites/sptests/sp19/task1.c
@@ -24,7 +24,7 @@ rtems_task Task_1(
uint32_t task_index;
INTEGER_DECLARE;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident" );
task_index = task_number( tid );
diff --git a/testsuites/sptests/sp24/task1.c b/testsuites/sptests/sp24/task1.c
index 9a2de67f40..d6f51f6333 100644
--- a/testsuites/sptests/sp24/task1.c
+++ b/testsuites/sptests/sp24/task1.c
@@ -30,7 +30,7 @@ rtems_task Task_1_through_3(
rtems_time_of_day time;
rtems_status_code status;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident of self" );
while ( FOREVER ) {
diff --git a/testsuites/sptests/sp30/task1.c b/testsuites/sptests/sp30/task1.c
index da4b0d20e7..56aa6aa4ab 100644
--- a/testsuites/sptests/sp30/task1.c
+++ b/testsuites/sptests/sp30/task1.c
@@ -30,7 +30,7 @@ rtems_task Task_1_through_3(
rtems_time_of_day time;
rtems_status_code status;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident of self" );
while ( FOREVER ) {
diff --git a/testsuites/sptests/sp42/init.c b/testsuites/sptests/sp42/init.c
index 10e49275e5..0004694741 100644
--- a/testsuites/sptests/sp42/init.c
+++ b/testsuites/sptests/sp42/init.c
@@ -74,7 +74,7 @@ static rtems_task Locker_task(
rtems_status_code status;
rtems_task_argument my_obtain_counter;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident" );
rtems_test_assert( task_index == task_number( tid ) - 1 );
diff --git a/testsuites/sptests/sp69/init.c b/testsuites/sptests/sp69/init.c
index 38c40ccdf8..e78d922481 100644
--- a/testsuites/sptests/sp69/init.c
+++ b/testsuites/sptests/sp69/init.c
@@ -60,31 +60,6 @@ rtems_task Init(
rtems_test_assert( period_status.executed_since_last_period.tv_sec == 0 );
rtems_test_assert( period_status.executed_since_last_period.tv_nsec == 0 );
- /*
- * Check get_status error cases.
- */
- puts( "rtems_rate_monotonic_get_status - check RTEMS_NOT_DEFINED" );
-
- /* Do some work to get a non-zero cpu usage */
- rtems_test_spin_for_ticks( 10 );
-
- status = rtems_rate_monotonic_period( period_id, 100 );
- directive_failed( status, "rate_monotonic_period" );
-
- /* Do some more work */
- rtems_test_spin_for_ticks( 10 );
-
- /* Reset the cpu usage statistics. */
- rtems_cpu_usage_reset();
-
- /* Status should be undefined. */
- status = rtems_rate_monotonic_get_status( period_id, &period_status );
- fatal_directive_status(
- status,
- RTEMS_NOT_DEFINED,
- "rtems_rate_monotonic_get_status after cpu usage reset"
- );
-
/* Clean up. */
status = rtems_rate_monotonic_cancel( period_id );
directive_failed( status, "rate_monotonic_cancel" );
diff --git a/testsuites/sptests/sp76/init.c b/testsuites/sptests/sp76/init.c
index c7e451c32a..6315850b51 100644
--- a/testsuites/sptests/sp76/init.c
+++ b/testsuites/sptests/sp76/init.c
@@ -49,7 +49,7 @@ static rtems_task Init(
TEST_BEGIN();
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &id );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &id );
directive_failed( status, "task ident" );
/* to make sure it is equal to TA2 */
diff --git a/testsuites/sptests/spcbssched01/task1.c b/testsuites/sptests/spcbssched01/task1.c
index f5d180831f..1e51b80966 100644
--- a/testsuites/sptests/spcbssched01/task1.c
+++ b/testsuites/sptests/spcbssched01/task1.c
@@ -31,7 +31,7 @@ rtems_task Task_1_through_3(
rtems_status_code status;
rtems_interval ticks;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident" );
ticks = RTEMS_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 );
diff --git a/testsuites/sptests/spchain/init.c b/testsuites/sptests/spchain/init.c
index 51278d52f3..ceb4f07b72 100644
--- a/testsuites/sptests/spchain/init.c
+++ b/testsuites/sptests/spchain/init.c
@@ -426,8 +426,14 @@ static void test_chain_node_count(void)
}
}
-static bool test_order( const void *left, const Chain_Node *right )
+static bool test_order(
+ const void *key,
+ const Chain_Node *left,
+ const Chain_Node *right
+)
{
+ rtems_test_assert( key == left );
+
return (uintptr_t) left < (uintptr_t) right;
}
diff --git a/testsuites/sptests/spedfsched01/task1.c b/testsuites/sptests/spedfsched01/task1.c
index f5d180831f..1e51b80966 100644
--- a/testsuites/sptests/spedfsched01/task1.c
+++ b/testsuites/sptests/spedfsched01/task1.c
@@ -31,7 +31,7 @@ rtems_task Task_1_through_3(
rtems_status_code status;
rtems_interval ticks;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident" );
ticks = RTEMS_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 );
diff --git a/testsuites/sptests/spfatal35/init.c b/testsuites/sptests/spfatal35/init.c
new file mode 100644
index 0000000000..11690fa0bf
--- /dev/null
+++ b/testsuites/sptests/spfatal35/init.c
@@ -0,0 +1,89 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup sptests
+ */
+
+/*
+ * Copyright (C) 2021 On-Line Applications Research Corporation (OAR)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems.h>
+#include <rtems/score/cpu.h>
+#include <rtems/score/cpuimpl.h>
+
+#include <tmacros.h>
+
+const char rtems_test_name[] = "SPFATAL 35";
+
+static void Init( rtems_task_argument arg )
+{
+ TEST_BEGIN();
+ _CPU_Instruction_illegal();
+ TEST_END();
+ rtems_test_exit(0);
+}
+
+static void fatal_extension(
+ rtems_fatal_source source,
+ bool always_set_to_false,
+ rtems_fatal_code code
+)
+{
+ CPU_Exception_frame *ef;
+
+ rtems_test_assert( !always_set_to_false );
+
+ if ( source != RTEMS_FATAL_SOURCE_EXCEPTION ) {
+ return;
+ }
+
+ ef = (rtems_exception_frame *) code;
+
+ _CPU_Exception_frame_make_resume_next_instruction( ef );
+
+ _CPU_Exception_resume( ef );
+}
+
+#define CONFIGURE_INITIAL_EXTENSIONS \
+ { .fatal = fatal_extension }, \
+ RTEMS_TEST_INITIAL_EXTENSION
+
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
diff --git a/testsuites/sptests/spfatal35/spfatal35.doc b/testsuites/sptests/spfatal35/spfatal35.doc
new file mode 100644
index 0000000000..e041f21391
--- /dev/null
+++ b/testsuites/sptests/spfatal35/spfatal35.doc
@@ -0,0 +1,7 @@
+This file describes the concepts tested by this test set.
+
+test set name: spfatal35
+
+concepts:
+
+ - Ensure that a RTEMS_FATAL_SOURCE_EXCEPTION can be recovered from.
diff --git a/testsuites/sptests/spfatal35/spfatal35.scn b/testsuites/sptests/spfatal35/spfatal35.scn
new file mode 100644
index 0000000000..0890b04556
--- /dev/null
+++ b/testsuites/sptests/spfatal35/spfatal35.scn
@@ -0,0 +1,2 @@
+*** TEST SPFATAL 35 ***
+*** END OF TEST SPFATAL 35 ***
diff --git a/testsuites/sptests/spintrcritical08/init.c b/testsuites/sptests/spintrcritical08/init.c
index 7b55a2e328..39855dfa29 100644
--- a/testsuites/sptests/spintrcritical08/init.c
+++ b/testsuites/sptests/spintrcritical08/init.c
@@ -78,7 +78,7 @@ static T_interrupt_test_state interrupt( void *arg )
T_quiet_eq_int( previous_period_state, RATE_MONOTONIC_ACTIVE );
T_quiet_eq_int( getState( ctx ), RATE_MONOTONIC_ACTIVE );
state = T_INTERRUPT_TEST_DONE;
- } else if ( flags == THREAD_WAIT_FLAGS_INITIAL ) {
+ } else if ( flags == THREAD_WAIT_STATE_READY ) {
T_quiet_true(
previous_period_state == RATE_MONOTONIC_ACTIVE
|| previous_period_state == RATE_MONOTONIC_EXPIRED
@@ -100,8 +100,6 @@ static void prepare( void *arg )
{
test_context *ctx;
rtems_status_code sc;
- ISR_Level level;
- bool success;
ctx = arg;
@@ -119,15 +117,6 @@ static void prepare( void *arg )
*/
sc = rtems_rate_monotonic_period( ctx->period, 1 );
} while ( sc != RTEMS_SUCCESSFUL );
-
- _ISR_Local_disable( level );
- success = _Thread_Wait_flags_try_change_release(
- ctx->thread,
- RATE_MONOTONIC_READY_AGAIN,
- THREAD_WAIT_FLAGS_INITIAL
- );
- _ISR_Local_enable( level );
- T_quiet_true( success );
}
static void action( void *arg )
diff --git a/testsuites/sptests/spintrcritical09/init.c b/testsuites/sptests/spintrcritical09/init.c
index 3d82febd6f..2dec20ef7e 100644
--- a/testsuites/sptests/spintrcritical09/init.c
+++ b/testsuites/sptests/spintrcritical09/init.c
@@ -32,7 +32,7 @@ static bool is_interrupt_timeout( test_context *ctx )
{
Thread_Wait_flags flags = _Thread_Wait_flags_get( ctx->thread );
- return flags == ( THREAD_WAIT_CLASS_OBJECT | THREAD_WAIT_STATE_READY_AGAIN );
+ return flags == THREAD_WAIT_STATE_READY;
}
static T_interrupt_test_state interrupt( void *arg )
diff --git a/testsuites/sptests/spintrcritical10/init.c b/testsuites/sptests/spintrcritical10/init.c
index 8210853588..36f50628fb 100644
--- a/testsuites/sptests/spintrcritical10/init.c
+++ b/testsuites/sptests/spintrcritical10/init.c
@@ -92,8 +92,7 @@ static T_interrupt_test_state any_satisfy_before_timeout_interrupt(void *arg)
if (state == T_INTERRUPT_TEST_DONE) {
rtems_test_assert(
- _Thread_Wait_flags_get(thread)
- == (THREAD_WAIT_CLASS_EVENT | THREAD_WAIT_STATE_READY_AGAIN)
+ _Thread_Wait_flags_get(thread) == THREAD_WAIT_STATE_READY
);
}
@@ -184,8 +183,7 @@ static T_interrupt_test_state all_satisfy_before_timeout_interrupt(void *arg)
if (state == T_INTERRUPT_TEST_DONE) {
rtems_test_assert(
- _Thread_Wait_flags_get(thread)
- == (THREAD_WAIT_CLASS_EVENT | THREAD_WAIT_STATE_READY_AGAIN)
+ _Thread_Wait_flags_get(thread) == THREAD_WAIT_STATE_READY
);
}
@@ -261,8 +259,7 @@ static T_interrupt_test_state timeout_before_satisfied_interrupt(void *arg)
if (state == T_INTERRUPT_TEST_DONE) {
rtems_test_assert(
- _Thread_Wait_flags_get(thread)
- == (THREAD_WAIT_CLASS_EVENT | THREAD_WAIT_STATE_READY_AGAIN)
+ _Thread_Wait_flags_get(thread) == THREAD_WAIT_STATE_READY
);
}
diff --git a/testsuites/sptests/spintrcritical21/init.c b/testsuites/sptests/spintrcritical21/init.c
index 032ee89eac..5b1ecb2862 100644
--- a/testsuites/sptests/spintrcritical21/init.c
+++ b/testsuites/sptests/spintrcritical21/init.c
@@ -31,6 +31,18 @@ typedef struct {
rtems_id other_task;
} test_context;
+static void clear_pending_events( void )
+{
+ rtems_event_set out;
+
+ (void) rtems_event_receive(
+ RTEMS_ALL_EVENTS,
+ RTEMS_NO_WAIT | RTEMS_EVENT_ANY,
+ 0,
+ &out
+ );
+}
+
static bool is_blocked( Thread_Wait_flags flags )
{
return flags == ( THREAD_WAIT_CLASS_EVENT | THREAD_WAIT_STATE_BLOCKED );
@@ -123,6 +135,8 @@ T_TEST_CASE(EventFromISR)
status = rtems_task_delete( ctx.other_task );
T_rsc_success( status );
+
+ clear_pending_events();
}
static T_interrupt_test_state event_with_timeout_from_isr_interrupt(
@@ -183,6 +197,8 @@ T_TEST_CASE( EventWithTimeoutFromISR )
state = T_interrupt_test( &event_with_timeout_from_isr_config, &ctx );
T_eq_int( state, T_INTERRUPT_TEST_DONE );
+
+ clear_pending_events();
}
static rtems_task Init( rtems_task_argument argument )
diff --git a/testsuites/sptests/spintrcritical22/init.c b/testsuites/sptests/spintrcritical22/init.c
index 192a5a98b3..f950307fdc 100644
--- a/testsuites/sptests/spintrcritical22/init.c
+++ b/testsuites/sptests/spintrcritical22/init.c
@@ -56,7 +56,7 @@ static T_interrupt_test_state release_semaphore(void *arg)
rtems_test_assert(
_Thread_Wait_flags_get(ctx->main_task_control)
- == (THREAD_WAIT_CLASS_OBJECT | THREAD_WAIT_STATE_READY_AGAIN)
+ == THREAD_WAIT_STATE_READY
);
sem = &ctx->semaphore_control->Core_control.Semaphore;
rtems_test_assert(sem->count == 0);
diff --git a/testsuites/sptests/spsimplesched01/init.c b/testsuites/sptests/spsimplesched01/init.c
index f2a06732d8..0bb05bf137 100644
--- a/testsuites/sptests/spsimplesched01/init.c
+++ b/testsuites/sptests/spsimplesched01/init.c
@@ -34,7 +34,7 @@ rtems_task Test_task(
uint32_t task_index;
rtems_status_code status;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "task ident" );
task_index = task_number( tid );
diff --git a/testsuites/sptests/spsimplesched02/init.c b/testsuites/sptests/spsimplesched02/init.c
index d19d3553d9..1366c93d7b 100644
--- a/testsuites/sptests/spsimplesched02/init.c
+++ b/testsuites/sptests/spsimplesched02/init.c
@@ -38,7 +38,7 @@ rtems_task Test_task(
rtems_id tid;
rtems_status_code status;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "wake after" );
for ( ; ; ) {
diff --git a/testsuites/sptests/sptask_err04/task1.c b/testsuites/sptests/sptask_err04/task1.c
index c1f59d81fb..ba93d67da7 100644
--- a/testsuites/sptests/sptask_err04/task1.c
+++ b/testsuites/sptests/sptask_err04/task1.c
@@ -50,7 +50,7 @@ rtems_task Task_1(
puts( "TA1 - rtems_task_delete - RTEMS_INVALID_ID" );
/* NULL param */
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, NULL );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, NULL );
fatal_directive_status(
status,
RTEMS_INVALID_ADDRESS,
@@ -59,7 +59,7 @@ rtems_task Task_1(
puts( "TA1 - rtems_task_ident - RTEMS_INVALID_ADDRESS" );
/* OK */
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &self_id );
+ status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &self_id );
directive_failed( status, "rtems_task_ident of self" );
if ( self_id != Task_id[ 1 ] ) {
puts( "ERROR - rtems_task_ident - incorrect ID returned!" );
diff --git a/testsuites/sptests/sptimecounter01/init.c b/testsuites/sptests/sptimecounter01/init.c
index dc601d7acb..bfeb2166f3 100644
--- a/testsuites/sptests/sptimecounter01/init.c
+++ b/testsuites/sptests/sptimecounter01/init.c
@@ -23,6 +23,7 @@
#include <bsp/bootcard.h>
#include <rtems/score/timecounterimpl.h>
+#include <rtems/score/percpu.h>
#include <rtems/score/todimpl.h>
#include <rtems/timecounter.h>
#include <rtems/bsd.h>
@@ -42,6 +43,8 @@ typedef struct {
static test_context test_instance;
+static Thread_Control executing;
+
static uint32_t test_get_timecount(struct timecounter *tc)
{
test_context *ctx;
@@ -106,12 +109,17 @@ void boot_card(const char *cmdline)
struct bintime bt;
struct timeval tv;
struct timespec ts;
+ Per_CPU_Control *cpu_self;
ctx = &test_instance;
tc = &ctx->tc;
TEST_BEGIN();
+ cpu_self = _Per_CPU_Get();
+ cpu_self->executing = &executing;
+ cpu_self->heir = &executing;
+
assert(time(NULL) == TOD_SECONDS_1970_THROUGH_1988);
rtems_bsd_bintime(&bt);
@@ -196,11 +204,11 @@ void boot_card(const char *cmdline)
assert(bt.sec == 1);
assert(bt.frac == 18446744073708);
- /* Ensure that the fraction overflows and the second remains constant */
+ /* Check that a large delta yields a correct time */
ctx->counter = (0xf0000000 | 1) + TEST_FREQ;
rtems_bsd_binuptime(&bt);
assert(ctx->counter == (0xf0000000 | 2) + TEST_FREQ);
- assert(bt.sec == 1);
+ assert(bt.sec == 2);
assert(bt.frac == 18446742522092);
test_install(ctx);