forked from Imagelibrary/rtems
INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
Add new fatal error INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT. Update #3077.
This commit is contained in:
@@ -133,6 +133,10 @@ static rtems_isr bsp_spurious_handler(
|
|||||||
.isf = isf
|
.isf = isf
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if ( SPARC_REAL_TRAP_NUMBER( trap ) == 4 ) {
|
||||||
|
_Internal_error( INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT );
|
||||||
|
}
|
||||||
|
|
||||||
rtems_fatal(
|
rtems_fatal(
|
||||||
RTEMS_FATAL_SOURCE_EXCEPTION,
|
RTEMS_FATAL_SOURCE_EXCEPTION,
|
||||||
(rtems_fatal_code) &frame
|
(rtems_fatal_code) &frame
|
||||||
|
|||||||
@@ -120,6 +120,10 @@ static rtems_isr bsp_spurious_handler(
|
|||||||
.isf = isf
|
.isf = isf
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if ( SPARC_REAL_TRAP_NUMBER( trap ) == 4 ) {
|
||||||
|
_Internal_error( INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT );
|
||||||
|
}
|
||||||
|
|
||||||
rtems_fatal(
|
rtems_fatal(
|
||||||
RTEMS_FATAL_SOURCE_EXCEPTION,
|
RTEMS_FATAL_SOURCE_EXCEPTION,
|
||||||
(rtems_fatal_code) &frame
|
(rtems_fatal_code) &frame
|
||||||
|
|||||||
@@ -119,6 +119,10 @@ static rtems_isr bsp_spurious_handler(
|
|||||||
.isf = isf
|
.isf = isf
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if ( SPARC_REAL_TRAP_NUMBER( trap ) == 4 ) {
|
||||||
|
_Internal_error( INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT );
|
||||||
|
}
|
||||||
|
|
||||||
rtems_fatal(
|
rtems_fatal(
|
||||||
RTEMS_FATAL_SOURCE_EXCEPTION,
|
RTEMS_FATAL_SOURCE_EXCEPTION,
|
||||||
(rtems_fatal_code) &frame
|
(rtems_fatal_code) &frame
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012, 2016 embedded brains GmbH. All rights reserved.
|
* Copyright (c) 2012, 2017 embedded brains GmbH. All rights reserved.
|
||||||
*
|
*
|
||||||
* embedded brains GmbH
|
* embedded brains GmbH
|
||||||
* Dornierstr. 4
|
* Dornierstr. 4
|
||||||
@@ -64,7 +64,8 @@ static const char *const internal_error_text[] = {
|
|||||||
"INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED",
|
"INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED",
|
||||||
"INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED",
|
"INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED",
|
||||||
"INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED",
|
"INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED",
|
||||||
"INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED"
|
"INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED",
|
||||||
|
"INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT"
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *rtems_internal_error_text( rtems_fatal_code error )
|
const char *rtems_internal_error_text( rtems_fatal_code error )
|
||||||
|
|||||||
@@ -177,7 +177,8 @@ typedef enum {
|
|||||||
INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED = 34,
|
INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED = 34,
|
||||||
INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED = 35,
|
INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED = 35,
|
||||||
INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED = 36,
|
INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED = 36,
|
||||||
INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED = 37
|
INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED = 37,
|
||||||
|
INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT = 38
|
||||||
} Internal_errors_Core_list;
|
} Internal_errors_Core_list;
|
||||||
|
|
||||||
typedef CPU_Uint32ptr Internal_errors_t;
|
typedef CPU_Uint32ptr Internal_errors_t;
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ _SUBDIRS = \
|
|||||||
spsem_err02 sptask_err01 spevent_err03 sptask_err03 sptask_err02 \
|
spsem_err02 sptask_err01 spevent_err03 sptask_err03 sptask_err02 \
|
||||||
sptask_err04 spclock_err01
|
sptask_err04 spclock_err01
|
||||||
_SUBDIRS += spfatal29
|
_SUBDIRS += spfatal29
|
||||||
|
_SUBDIRS += spfatal30
|
||||||
|
_SUBDIRS += spfatal31
|
||||||
_SUBDIRS += spmutex01
|
_SUBDIRS += spmutex01
|
||||||
_SUBDIRS += spextensions01
|
_SUBDIRS += spextensions01
|
||||||
_SUBDIRS += spsysinit01
|
_SUBDIRS += spsysinit01
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ AM_CONDITIONAL(HAS_SMP,test "$rtems_cv_RTEMS_SMP" = "yes")
|
|||||||
|
|
||||||
# Explicitly list all Makefiles here
|
# Explicitly list all Makefiles here
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
|
spfatal31/Makefile
|
||||||
|
spfatal30/Makefile
|
||||||
spmutex01/Makefile
|
spmutex01/Makefile
|
||||||
spextensions01/Makefile
|
spextensions01/Makefile
|
||||||
sptimerserver01/Makefile
|
sptimerserver01/Makefile
|
||||||
|
|||||||
19
testsuites/sptests/spfatal30/Makefile.am
Normal file
19
testsuites/sptests/spfatal30/Makefile.am
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
rtems_tests_PROGRAMS = spfatal30
|
||||||
|
spfatal30_SOURCES = init.c
|
||||||
|
|
||||||
|
dist_rtems_tests_DATA = spfatal30.scn spfatal30.doc
|
||||||
|
|
||||||
|
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||||
|
include $(top_srcdir)/../automake/compile.am
|
||||||
|
include $(top_srcdir)/../automake/leaf.am
|
||||||
|
|
||||||
|
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||||
|
|
||||||
|
LINK_OBJS = $(spfatal30_OBJECTS)
|
||||||
|
LINK_LIBS = $(spfatal30_LDLIBS)
|
||||||
|
|
||||||
|
spfatal30$(EXEEXT): $(spfatal30_OBJECTS) $(spfatal30_DEPENDENCIES)
|
||||||
|
@rm -f spfatal30$(EXEEXT)
|
||||||
|
$(make-exe)
|
||||||
|
|
||||||
|
include $(top_srcdir)/../automake/local.am
|
||||||
80
testsuites/sptests/spfatal30/init.c
Normal file
80
testsuites/sptests/spfatal30/init.c
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 embedded brains GmbH. All rights reserved.
|
||||||
|
*
|
||||||
|
* embedded brains GmbH
|
||||||
|
* Dornierstr. 4
|
||||||
|
* 82178 Puchheim
|
||||||
|
* Germany
|
||||||
|
* <rtems@embedded-brains.de>
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.rtems.org/license/LICENSE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define TESTS_USE_PRINTK
|
||||||
|
#include "tmacros.h"
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
|
||||||
|
const char rtems_test_name[] = "SPFATAL 30";
|
||||||
|
|
||||||
|
#if CPU_HARDWARE_FP == TRUE && CPU_ALL_TASKS_ARE_FP == FALSE
|
||||||
|
#define EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static volatile double f = 1.0;
|
||||||
|
|
||||||
|
static void Init(rtems_task_argument arg)
|
||||||
|
{
|
||||||
|
TEST_BEGIN();
|
||||||
|
|
||||||
|
f *= 123.456;
|
||||||
|
|
||||||
|
#ifdef EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
|
||||||
|
rtems_test_assert(0);
|
||||||
|
#else
|
||||||
|
TEST_END();
|
||||||
|
rtems_test_exit(0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
|
||||||
|
static void fatal_extension(
|
||||||
|
rtems_fatal_source source,
|
||||||
|
bool always_set_to_false,
|
||||||
|
rtems_fatal_code code
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
source == INTERNAL_ERROR_CORE
|
||||||
|
&& !always_set_to_false
|
||||||
|
&& code == INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
|
||||||
|
) {
|
||||||
|
TEST_END();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CONFIGURE_INITIAL_EXTENSIONS \
|
||||||
|
{ .fatal = fatal_extension }, \
|
||||||
|
RTEMS_TEST_INITIAL_EXTENSION
|
||||||
|
|
||||||
|
#else /* EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT */
|
||||||
|
|
||||||
|
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||||
|
|
||||||
|
#endif /* EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT */
|
||||||
|
|
||||||
|
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
|
||||||
|
|
||||||
|
#define CONFIGURE_MAXIMUM_TASKS 1
|
||||||
|
|
||||||
|
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||||
|
|
||||||
|
#define CONFIGURE_INIT
|
||||||
|
|
||||||
|
#include <rtems/confdefs.h>
|
||||||
12
testsuites/sptests/spfatal30/spfatal30.doc
Normal file
12
testsuites/sptests/spfatal30/spfatal30.doc
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
This file describes the directives and concepts tested by this test set.
|
||||||
|
|
||||||
|
test set name: spfatal30
|
||||||
|
|
||||||
|
directives:
|
||||||
|
|
||||||
|
- _Internal_error()
|
||||||
|
|
||||||
|
concepts:
|
||||||
|
|
||||||
|
- Provoke an illegal use of the floating point unit in thread context and
|
||||||
|
ensure that the right internal error occurs.
|
||||||
2
testsuites/sptests/spfatal30/spfatal30.scn
Normal file
2
testsuites/sptests/spfatal30/spfatal30.scn
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
*** BEGIN OF TEST SPFATAL 30 ***
|
||||||
|
*** END OF TEST SPFATAL 30 ***
|
||||||
19
testsuites/sptests/spfatal31/Makefile.am
Normal file
19
testsuites/sptests/spfatal31/Makefile.am
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
rtems_tests_PROGRAMS = spfatal31
|
||||||
|
spfatal31_SOURCES = init.c
|
||||||
|
|
||||||
|
dist_rtems_tests_DATA = spfatal31.scn spfatal31.doc
|
||||||
|
|
||||||
|
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||||
|
include $(top_srcdir)/../automake/compile.am
|
||||||
|
include $(top_srcdir)/../automake/leaf.am
|
||||||
|
|
||||||
|
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||||
|
|
||||||
|
LINK_OBJS = $(spfatal31_OBJECTS)
|
||||||
|
LINK_LIBS = $(spfatal31_LDLIBS)
|
||||||
|
|
||||||
|
spfatal31$(EXEEXT): $(spfatal31_OBJECTS) $(spfatal31_DEPENDENCIES)
|
||||||
|
@rm -f spfatal31$(EXEEXT)
|
||||||
|
$(make-exe)
|
||||||
|
|
||||||
|
include $(top_srcdir)/../automake/local.am
|
||||||
96
testsuites/sptests/spfatal31/init.c
Normal file
96
testsuites/sptests/spfatal31/init.c
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 embedded brains GmbH. All rights reserved.
|
||||||
|
*
|
||||||
|
* embedded brains GmbH
|
||||||
|
* Dornierstr. 4
|
||||||
|
* 82178 Puchheim
|
||||||
|
* Germany
|
||||||
|
* <rtems@embedded-brains.de>
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.rtems.org/license/LICENSE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define TESTS_USE_PRINTK
|
||||||
|
#include "tmacros.h"
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
|
||||||
|
const char rtems_test_name[] = "SPFATAL 31";
|
||||||
|
|
||||||
|
#if CPU_HARDWARE_FP == TRUE && defined(__sparc__)
|
||||||
|
#define EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static volatile double f = 1.0;
|
||||||
|
|
||||||
|
static void timer(rtems_id id, void *arg)
|
||||||
|
{
|
||||||
|
f *= 123.456;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Init(rtems_task_argument arg)
|
||||||
|
{
|
||||||
|
rtems_status_code sc;
|
||||||
|
rtems_id id;
|
||||||
|
|
||||||
|
TEST_BEGIN();
|
||||||
|
|
||||||
|
sc = rtems_timer_create(rtems_build_name('T', 'I', 'M', 'E'), &id);
|
||||||
|
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
|
||||||
|
|
||||||
|
sc = rtems_timer_fire_after(id, 1, timer, NULL);
|
||||||
|
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
|
||||||
|
|
||||||
|
sc = rtems_task_wake_after(2);
|
||||||
|
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
|
||||||
|
|
||||||
|
#ifdef EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
|
||||||
|
rtems_test_assert(0);
|
||||||
|
#else
|
||||||
|
TEST_END();
|
||||||
|
rtems_test_exit(0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
|
||||||
|
static void fatal_extension(
|
||||||
|
rtems_fatal_source source,
|
||||||
|
bool always_set_to_false,
|
||||||
|
rtems_fatal_code code
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
source == INTERNAL_ERROR_CORE
|
||||||
|
&& !always_set_to_false
|
||||||
|
&& code == INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
|
||||||
|
) {
|
||||||
|
TEST_END();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CONFIGURE_INITIAL_EXTENSIONS \
|
||||||
|
{ .fatal = fatal_extension }, \
|
||||||
|
RTEMS_TEST_INITIAL_EXTENSION
|
||||||
|
|
||||||
|
#else /* EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT */
|
||||||
|
|
||||||
|
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||||
|
|
||||||
|
#endif /* EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT */
|
||||||
|
|
||||||
|
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||||
|
|
||||||
|
#define CONFIGURE_MAXIMUM_TASKS 1
|
||||||
|
#define CONFIGURE_MAXIMUM_TIMERS 1
|
||||||
|
|
||||||
|
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||||
|
|
||||||
|
#define CONFIGURE_INIT
|
||||||
|
|
||||||
|
#include <rtems/confdefs.h>
|
||||||
12
testsuites/sptests/spfatal31/spfatal31.doc
Normal file
12
testsuites/sptests/spfatal31/spfatal31.doc
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
This file describes the directives and concepts tested by this test set.
|
||||||
|
|
||||||
|
test set name: spfatal31
|
||||||
|
|
||||||
|
directives:
|
||||||
|
|
||||||
|
- _Internal_error()
|
||||||
|
|
||||||
|
concepts:
|
||||||
|
|
||||||
|
- Provoke an illegal use of the floating point unit in interrupt context and
|
||||||
|
ensure that the right internal error occurs.
|
||||||
2
testsuites/sptests/spfatal31/spfatal31.scn
Normal file
2
testsuites/sptests/spfatal31/spfatal31.scn
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
*** BEGIN OF TEST SPFATAL 31 ***
|
||||||
|
*** END OF TEST SPFATAL 31 ***
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012, 2016 embedded brains GmbH. All rights reserved.
|
* Copyright (c) 2012, 2017 embedded brains GmbH. All rights reserved.
|
||||||
*
|
*
|
||||||
* embedded brains GmbH
|
* embedded brains GmbH
|
||||||
* Donierstr. 4
|
* Donierstr. 4
|
||||||
@@ -36,7 +36,7 @@ static void test_internal_error_text(void)
|
|||||||
} while ( text != text_last );
|
} while ( text != text_last );
|
||||||
|
|
||||||
rtems_test_assert(
|
rtems_test_assert(
|
||||||
error - 3 == INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED
|
error - 3 == INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user