forked from Imagelibrary/rtems
2008-01-28 Jennifer Averett <jennifer.averett@OARcorp.com>
* Makefile.am, configure.ac: Added fatal error tests * spfatal01/Makefile.am, spfatal01/spfatal01.scn, spfatal01/testcase.h, spfatal02/Makefile.am, spfatal02/spfatal02.scn, spfatal02/testcase.h, spfatal03/Makefile.am, spfatal03/spfatal03.scn, spfatal03/testcase.h, spfatal04/Makefile.am, spfatal04/spfatal04.scn, spfatal04/testcase.h, spfatal05/Makefile.am, spfatal05/spfatal05.scn, spfatal05/testcase.h, spfatal06/Makefile.am, spfatal06/spfatal06.scn, spfatal06/testcase.h, spfatal07/Makefile.am, spfatal07/spfatal07.scn, spfatal07/testcase.h, spfatal08/Makefile.am, spfatal08/spfatal08.scn, spfatal08/testcase.h, spfatal09/Makefile.am, spfatal09/spfatal09.scn, spfatal09/testcase.h, spfatal10/Makefile.am, spfatal10/spfatal10.scn, spfatal10/testcase.h, spfatal_support/init.c, spfatal_support/system.h: New files.
This commit is contained in:
@@ -1,3 +1,18 @@
|
||||
2008-01-28 Jennifer Averett <jennifer.averett@OARcorp.com>
|
||||
|
||||
* Makefile.am, configure.ac: Added fatal error tests
|
||||
* spfatal01/Makefile.am, spfatal01/spfatal01.scn, spfatal01/testcase.h,
|
||||
spfatal02/Makefile.am, spfatal02/spfatal02.scn, spfatal02/testcase.h,
|
||||
spfatal03/Makefile.am, spfatal03/spfatal03.scn, spfatal03/testcase.h,
|
||||
spfatal04/Makefile.am, spfatal04/spfatal04.scn, spfatal04/testcase.h,
|
||||
spfatal05/Makefile.am, spfatal05/spfatal05.scn, spfatal05/testcase.h,
|
||||
spfatal06/Makefile.am, spfatal06/spfatal06.scn, spfatal06/testcase.h,
|
||||
spfatal07/Makefile.am, spfatal07/spfatal07.scn, spfatal07/testcase.h,
|
||||
spfatal08/Makefile.am, spfatal08/spfatal08.scn, spfatal08/testcase.h,
|
||||
spfatal09/Makefile.am, spfatal09/spfatal09.scn, spfatal09/testcase.h,
|
||||
spfatal10/Makefile.am, spfatal10/spfatal10.scn, spfatal10/testcase.h,
|
||||
spfatal_support/init.c, spfatal_support/system.h: New files.
|
||||
|
||||
2008-01-24 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* sp28/init.c, sp28/sp28.scn, sp29/init.c, sp29/sp29.scn, sp32/init.c,
|
||||
|
||||
@@ -7,8 +7,12 @@ ACLOCAL_AMFLAGS = -I ../aclocal
|
||||
## spfatal is not included for now
|
||||
SUBDIRS = sp01 sp02 sp03 sp04 sp05 sp06 sp07 sp08 sp09 sp11 sp12 sp13 sp14 \
|
||||
sp15 sp16 sp17 sp19 sp20 sp21 sp22 sp23 sp24 sp25 sp26 sp27 sp28 sp29 \
|
||||
sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 sp40 sp41 sp42 spsize
|
||||
DIST_SUBDIRS = $(SUBDIRS) spfatal
|
||||
sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 sp40 sp41 sp42 spsize \
|
||||
spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \
|
||||
spfatal08 spfatal09 spfatal10
|
||||
|
||||
DIST_SUBDIRS = $(SUBDIRS) spfatal spfatal_support
|
||||
EXTRA_DIST = spfatal_support/init.c spfatal_support/system.h
|
||||
|
||||
include $(top_srcdir)/../automake/subdirs.am
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
|
||||
@@ -69,5 +69,15 @@ sp41/Makefile
|
||||
sp42/Makefile
|
||||
spsize/Makefile
|
||||
spfatal/Makefile
|
||||
spfatal01/Makefile
|
||||
spfatal02/Makefile
|
||||
spfatal03/Makefile
|
||||
spfatal04/Makefile
|
||||
spfatal05/Makefile
|
||||
spfatal06/Makefile
|
||||
spfatal07/Makefile
|
||||
spfatal08/Makefile
|
||||
spfatal09/Makefile
|
||||
spfatal10/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
27
testsuites/sptests/spfatal01/Makefile.am
Normal file
27
testsuites/sptests/spfatal01/Makefile.am
Normal file
@@ -0,0 +1,27 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = spfatal01.exe
|
||||
spfatal01_exe_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h testcase.h
|
||||
|
||||
dist_rtems_tests_DATA = spfatal01.scn
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
spfatal01_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(spfatal01_exe_OBJECTS) $(spfatal01_exe_LDADD)
|
||||
LINK_LIBS = $(spfatal01_exe_LDLIBS)
|
||||
|
||||
spfatal01.exe$(EXEEXT): $(spfatal01_exe_OBJECTS) $(spfatal01_exe_DEPENDENCIES)
|
||||
@rm -f spfatal01.exe$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
1
testsuites/sptests/spfatal01/spfatal01.scn
Normal file
1
testsuites/sptests/spfatal01/spfatal01.scn
Normal file
@@ -0,0 +1 @@
|
||||
Fatal error (Classic API Init task create failure) hit
|
||||
42
testsuites/sptests/spfatal01/testcase.h
Normal file
42
testsuites/sptests/spfatal01/testcase.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Classic API Init task create failure
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Way too much stack space. Should generate a fatal error
|
||||
* on the init task create.
|
||||
*/
|
||||
#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
|
||||
#define CONFIGURE_INIT_TASK_STACK_SIZE 0
|
||||
rtems_initialization_tasks_table Initialization_tasks[] = {
|
||||
{ rtems_build_name('I', 'N', 'I', ' '),
|
||||
64 * 1024 * 1024,
|
||||
1,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
Init,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
0
|
||||
}
|
||||
};
|
||||
#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
|
||||
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
|
||||
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
|
||||
|
||||
#define FATAL_ERROR_DESCRIPTION "Classic API Init task create failure"
|
||||
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
|
||||
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
|
||||
#define FATAL_ERROR_EXPECTED_ERROR RTEMS_UNSATISFIED
|
||||
|
||||
void force_error()
|
||||
{
|
||||
/*
|
||||
* Case 2: Null entry
|
||||
* Case 3: semaphore_create
|
||||
* _Thread_Disable_dispatch
|
||||
* semaphore_obtain
|
||||
*/
|
||||
|
||||
/* we will not run this far */
|
||||
}
|
||||
27
testsuites/sptests/spfatal02/Makefile.am
Normal file
27
testsuites/sptests/spfatal02/Makefile.am
Normal file
@@ -0,0 +1,27 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = spfatal02.exe
|
||||
spfatal02_exe_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h testcase.h
|
||||
|
||||
dist_rtems_tests_DATA = spfatal02.scn
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
spfatal02_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(spfatal02_exe_OBJECTS) $(spfatal02_exe_LDADD)
|
||||
LINK_LIBS = $(spfatal02_exe_LDLIBS)
|
||||
|
||||
spfatal02.exe$(EXEEXT): $(spfatal02_exe_OBJECTS) $(spfatal02_exe_DEPENDENCIES)
|
||||
@rm -f spfatal02.exe$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
1
testsuites/sptests/spfatal02/spfatal02.scn
Normal file
1
testsuites/sptests/spfatal02/spfatal02.scn
Normal file
@@ -0,0 +1 @@
|
||||
Fatal error (Classic API Init task start failure) hit
|
||||
39
testsuites/sptests/spfatal02/testcase.h
Normal file
39
testsuites/sptests/spfatal02/testcase.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Classic API Init task create failure
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Way too much stack space. Should generate a fatal error
|
||||
* on the init task create.
|
||||
*/
|
||||
#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
|
||||
#define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
|
||||
rtems_initialization_tasks_table Initialization_tasks[] = {
|
||||
{ rtems_build_name('I', 'N', 'I', ' '),
|
||||
RTEMS_MINIMUM_STACK_SIZE,
|
||||
1,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
NULL,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
0
|
||||
}
|
||||
};
|
||||
#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
|
||||
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
|
||||
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
|
||||
|
||||
#define FATAL_ERROR_DESCRIPTION "Classic API Init task start failure"
|
||||
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
|
||||
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
|
||||
#define FATAL_ERROR_EXPECTED_ERROR RTEMS_INVALID_ADDRESS
|
||||
|
||||
void force_error()
|
||||
{
|
||||
/*
|
||||
* Case 2: Null entry
|
||||
*/
|
||||
|
||||
/* we will not run this far */
|
||||
}
|
||||
26
testsuites/sptests/spfatal03/Makefile.am
Normal file
26
testsuites/sptests/spfatal03/Makefile.am
Normal file
@@ -0,0 +1,26 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = spfatal03.exe
|
||||
spfatal03_exe_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h testcase.h
|
||||
dist_rtems_tests_DATA = spfatal03.scn
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
spfatal03_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(spfatal03_exe_OBJECTS) $(spfatal03_exe_LDADD)
|
||||
LINK_LIBS = $(spfatal03_exe_LDLIBS)
|
||||
|
||||
spfatal03.exe$(EXEEXT): $(spfatal03_exe_OBJECTS) $(spfatal03_exe_DEPENDENCIES)
|
||||
@rm -f spfatal03.exe$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
2
testsuites/sptests/spfatal03/spfatal03.scn
Normal file
2
testsuites/sptests/spfatal03/spfatal03.scn
Normal file
@@ -0,0 +1,2 @@
|
||||
Create S0
|
||||
Fatal error (Core Mutex obtain in critical section) hit
|
||||
67
testsuites/sptests/spfatal03/testcase.h
Normal file
67
testsuites/sptests/spfatal03/testcase.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Classic API Init task create failure
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Way too much stack space. Should generate a fatal error
|
||||
* on the init task create.
|
||||
*/
|
||||
#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
|
||||
#define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
|
||||
rtems_initialization_tasks_table Initialization_tasks[] = {
|
||||
{ rtems_build_name('I', 'N', 'I', ' '),
|
||||
RTEMS_MINIMUM_STACK_SIZE,
|
||||
1,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
Init,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
0
|
||||
}
|
||||
};
|
||||
#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
|
||||
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
|
||||
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
|
||||
|
||||
#define CONFIGURE_MAXIMUM_SEMAPHORES 10
|
||||
|
||||
#define FATAL_ERROR_DESCRIPTION "Core Mutex obtain in critical section"
|
||||
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
|
||||
#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
|
||||
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE
|
||||
|
||||
rtems_id Mutex_id[1];
|
||||
rtems_name Mutex_name[1];
|
||||
|
||||
void force_error()
|
||||
{
|
||||
ISR_Level level;
|
||||
rtems_status_code status;
|
||||
|
||||
|
||||
Mutex_name[0] = rtems_build_name( 'S','0',' ',' ');
|
||||
status = rtems_semaphore_create(
|
||||
Mutex_name[0],
|
||||
1,
|
||||
RTEMS_LOCAL|
|
||||
RTEMS_SIMPLE_BINARY_SEMAPHORE|
|
||||
RTEMS_PRIORITY_CEILING |
|
||||
RTEMS_PRIORITY,
|
||||
0,
|
||||
&Mutex_id[0]
|
||||
);
|
||||
directive_failed( status, "rtems_semaphore_create of S0");
|
||||
printf("Create S0\n");
|
||||
|
||||
|
||||
_Thread_Disable_dispatch();
|
||||
status = rtems_semaphore_obtain( Mutex_id[0], RTEMS_DEFAULT_OPTIONS, 0 );
|
||||
/* !!! SHOULD NOT RETURN FROM THE ABOVE CALL */
|
||||
|
||||
_Thread_Enable_dispatch();
|
||||
_ISR_Enable( level );
|
||||
directive_failed( status, "rtems_semaphore_obtain" );
|
||||
|
||||
/* we will not run this far */
|
||||
}
|
||||
27
testsuites/sptests/spfatal04/Makefile.am
Normal file
27
testsuites/sptests/spfatal04/Makefile.am
Normal file
@@ -0,0 +1,27 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = spfatal04.exe
|
||||
spfatal04_exe_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h testcase.h
|
||||
|
||||
dist_rtems_tests_DATA = spfatal04.scn
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
spfatal04_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(spfatal04_exe_OBJECTS) $(spfatal04_exe_LDADD)
|
||||
LINK_LIBS = $(spfatal04_exe_LDLIBS)
|
||||
|
||||
spfatal04.exe$(EXEEXT): $(spfatal04_exe_OBJECTS) $(spfatal04_exe_DEPENDENCIES)
|
||||
@rm -f spfatal04.exe$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
1
testsuites/sptests/spfatal04/spfatal04.scn
Normal file
1
testsuites/sptests/spfatal04/spfatal04.scn
Normal file
@@ -0,0 +1 @@
|
||||
Fatal error (Classic API call rtems_fatal_error_occurred) hit
|
||||
36
testsuites/sptests/spfatal04/testcase.h
Normal file
36
testsuites/sptests/spfatal04/testcase.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Classic API Init task create failure
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Way too much stack space. Should generate a fatal error
|
||||
* on the init task create.
|
||||
*/
|
||||
#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
|
||||
#define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
|
||||
rtems_initialization_tasks_table Initialization_tasks[] = {
|
||||
{ rtems_build_name('I', 'N', 'I', ' '),
|
||||
RTEMS_MINIMUM_STACK_SIZE,
|
||||
1,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
Init,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
0
|
||||
}
|
||||
};
|
||||
#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
|
||||
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
|
||||
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
|
||||
|
||||
#define FATAL_ERROR_DESCRIPTION "Classic API call rtems_fatal_error_occurred"
|
||||
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
|
||||
#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
|
||||
#define FATAL_ERROR_EXPECTED_ERROR 0xdead
|
||||
|
||||
void force_error()
|
||||
{
|
||||
rtems_fatal_error_occurred( 0xdead );
|
||||
/* we will not run this far */
|
||||
}
|
||||
27
testsuites/sptests/spfatal05/Makefile.am
Normal file
27
testsuites/sptests/spfatal05/Makefile.am
Normal file
@@ -0,0 +1,27 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = spfatal05.exe
|
||||
spfatal05_exe_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h testcase.h
|
||||
|
||||
dist_rtems_tests_DATA = spfatal05.scn
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
spfatal05_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(spfatal05_exe_OBJECTS) $(spfatal05_exe_LDADD)
|
||||
LINK_LIBS = $(spfatal05_exe_LDLIBS)
|
||||
|
||||
spfatal05.exe$(EXEEXT): $(spfatal05_exe_OBJECTS) $(spfatal05_exe_DEPENDENCIES)
|
||||
@rm -f spfatal05.exe$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
1
testsuites/sptests/spfatal05/spfatal05.scn
Normal file
1
testsuites/sptests/spfatal05/spfatal05.scn
Normal file
@@ -0,0 +1 @@
|
||||
Fatal error (Core fall out of a task) hit
|
||||
62
testsuites/sptests/spfatal05/testcase.h
Normal file
62
testsuites/sptests/spfatal05/testcase.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Classic API Init task create failure
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Way too much stack space. Should generate a fatal error
|
||||
* on the init task create.
|
||||
*/
|
||||
#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
|
||||
#define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
|
||||
rtems_initialization_tasks_table Initialization_tasks[] = {
|
||||
{ rtems_build_name('I', 'N', 'I', ' '),
|
||||
RTEMS_MINIMUM_STACK_SIZE,
|
||||
1,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
Init,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
0
|
||||
}
|
||||
};
|
||||
#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
|
||||
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
|
||||
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
|
||||
|
||||
#define SPFATAL_TEST_CASE_EXTRA_TASKS 1
|
||||
|
||||
#define FATAL_ERROR_DESCRIPTION "Core fall out of a task"
|
||||
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
|
||||
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
|
||||
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_THREAD_EXITTED
|
||||
|
||||
rtems_task EmptyTask(
|
||||
rtems_task_argument unused
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
void force_error()
|
||||
{
|
||||
rtems_id id;
|
||||
rtems_status_code status;
|
||||
|
||||
status = rtems_task_create(
|
||||
rtems_build_name('T','A','0','1' ),
|
||||
4,
|
||||
RTEMS_MINIMUM_STACK_SIZE,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&id
|
||||
);
|
||||
directive_failed( status, "rtems_task_create" );
|
||||
|
||||
status = rtems_task_start( id, EmptyTask, 0 );
|
||||
directive_failed( status, "rtems_task_start" );
|
||||
|
||||
status = rtems_task_wake_after( 10 );
|
||||
directive_failed( status, "rtems_task_wake_after" );
|
||||
|
||||
/* we will not run this far */
|
||||
}
|
||||
27
testsuites/sptests/spfatal06/Makefile.am
Normal file
27
testsuites/sptests/spfatal06/Makefile.am
Normal file
@@ -0,0 +1,27 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = spfatal06.exe
|
||||
spfatal06_exe_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h testcase.h
|
||||
|
||||
dist_rtems_tests_DATA = spfatal06.scn
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
spfatal06_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(spfatal06_exe_OBJECTS) $(spfatal06_exe_LDADD)
|
||||
LINK_LIBS = $(spfatal06_exe_LDLIBS)
|
||||
|
||||
spfatal06.exe$(EXEEXT): $(spfatal06_exe_OBJECTS) $(spfatal06_exe_DEPENDENCIES)
|
||||
@rm -f spfatal06.exe$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
1
testsuites/sptests/spfatal06/spfatal06.scn
Normal file
1
testsuites/sptests/spfatal06/spfatal06.scn
Normal file
@@ -0,0 +1 @@
|
||||
Fatal error (Core initialize with invalid stack hook) hit
|
||||
50
testsuites/sptests/spfatal06/testcase.h
Normal file
50
testsuites/sptests/spfatal06/testcase.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Classic API Init task create failure
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Way too much stack space. Should generate a fatal error
|
||||
* on the init task create.
|
||||
*/
|
||||
#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
|
||||
#define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
|
||||
rtems_initialization_tasks_table Initialization_tasks[] = {
|
||||
{ rtems_build_name('I', 'N', 'I', ' '),
|
||||
RTEMS_MINIMUM_STACK_SIZE,
|
||||
1,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
Init,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
0
|
||||
}
|
||||
};
|
||||
#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
|
||||
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
|
||||
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
|
||||
|
||||
#define FATAL_ERROR_DESCRIPTION "Core initialize with invalid stack hook"
|
||||
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
|
||||
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
|
||||
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_BAD_STACK_HOOK
|
||||
|
||||
void *New_stack_allocate_hook( uint32_t unused)
|
||||
{
|
||||
}
|
||||
|
||||
void force_error()
|
||||
{
|
||||
rtems_configuration_table New_Configuration;
|
||||
|
||||
New_Configuration = *_Configuration_Table;
|
||||
|
||||
if (_Configuration_Table->stack_free_hook != NULL)
|
||||
New_Configuration.stack_allocate_hook = NULL;
|
||||
else
|
||||
New_Configuration.stack_allocate_hook = &New_stack_allocate_hook;
|
||||
|
||||
rtems_initialize_executive_early( &New_Configuration );
|
||||
/* we will not run this far */
|
||||
}
|
||||
|
||||
27
testsuites/sptests/spfatal07/Makefile.am
Normal file
27
testsuites/sptests/spfatal07/Makefile.am
Normal file
@@ -0,0 +1,27 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = spfatal07.exe
|
||||
spfatal07_exe_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h testcase.h
|
||||
|
||||
dist_rtems_tests_DATA = spfatal07.scn
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
spfatal07_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(spfatal07_exe_OBJECTS) $(spfatal07_exe_LDADD)
|
||||
LINK_LIBS = $(spfatal07_exe_LDLIBS)
|
||||
|
||||
spfatal07.exe$(EXEEXT): $(spfatal07_exe_OBJECTS) $(spfatal07_exe_DEPENDENCIES)
|
||||
@rm -f spfatal07.exe$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
1
testsuites/sptests/spfatal07/spfatal07.scn
Normal file
1
testsuites/sptests/spfatal07/spfatal07.scn
Normal file
@@ -0,0 +1 @@
|
||||
Fatal error (Core Configuration Invalid ISR stack size) hit
|
||||
41
testsuites/sptests/spfatal07/testcase.h
Normal file
41
testsuites/sptests/spfatal07/testcase.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Classic API Init task create failure
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Way too much stack space. Should generate a fatal error
|
||||
* on the init task create.
|
||||
*/
|
||||
#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
|
||||
#define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
|
||||
rtems_initialization_tasks_table Initialization_tasks[] = {
|
||||
{ rtems_build_name('I', 'N', 'I', ' '),
|
||||
RTEMS_MINIMUM_STACK_SIZE,
|
||||
1,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
Init,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
0
|
||||
}
|
||||
};
|
||||
#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
|
||||
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
|
||||
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
|
||||
|
||||
#define FATAL_ERROR_DESCRIPTION "Core Configuration Invalid ISR stack size"
|
||||
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
|
||||
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
|
||||
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL
|
||||
|
||||
void force_error()
|
||||
{
|
||||
rtems_configuration_table New_Configuration;
|
||||
New_Configuration = *_Configuration_Table;
|
||||
|
||||
New_Configuration.interrupt_stack_size = (STACK_MINIMUM_SIZE-1);
|
||||
rtems_initialize_executive_early( &New_Configuration );
|
||||
|
||||
/* we will not run this far */
|
||||
}
|
||||
27
testsuites/sptests/spfatal08/Makefile.am
Normal file
27
testsuites/sptests/spfatal08/Makefile.am
Normal file
@@ -0,0 +1,27 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = spfatal08.exe
|
||||
spfatal08_exe_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h testcase.h
|
||||
|
||||
dist_rtems_tests_DATA = spfatal08.scn
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
spfatal08_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(spfatal08_exe_OBJECTS) $(spfatal08_exe_LDADD)
|
||||
LINK_LIBS = $(spfatal08_exe_LDLIBS)
|
||||
|
||||
spfatal08.exe$(EXEEXT): $(spfatal08_exe_OBJECTS) $(spfatal08_exe_DEPENDENCIES)
|
||||
@rm -f spfatal08.exe$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
1
testsuites/sptests/spfatal08/spfatal08.scn
Normal file
1
testsuites/sptests/spfatal08/spfatal08.scn
Normal file
@@ -0,0 +1 @@
|
||||
Fatal error (Core workspace too small) hit
|
||||
44
testsuites/sptests/spfatal08/testcase.h
Normal file
44
testsuites/sptests/spfatal08/testcase.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Classic API Init task create failure
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Way too much stack space. Should generate a fatal error
|
||||
* on the init task create.
|
||||
*/
|
||||
#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
|
||||
#define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
|
||||
rtems_initialization_tasks_table Initialization_tasks[] = {
|
||||
{ rtems_build_name('I', 'N', 'I', ' '),
|
||||
RTEMS_MINIMUM_STACK_SIZE,
|
||||
1,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
Init,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
0
|
||||
}
|
||||
};
|
||||
#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
|
||||
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
|
||||
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
|
||||
|
||||
#define FATAL_ERROR_DESCRIPTION "Core workspace too small"
|
||||
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
|
||||
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
|
||||
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_WORKSPACE_ALLOCATION
|
||||
|
||||
char Workspace[ 64 * 1024 ] CPU_STRUCTURE_ALIGNMENT;
|
||||
|
||||
void force_error()
|
||||
{
|
||||
rtems_configuration_table New_Configuration;
|
||||
New_Configuration = *_Configuration_Table;
|
||||
|
||||
New_Configuration.work_space_start = Workspace;
|
||||
New_Configuration.work_space_size = 256;
|
||||
|
||||
rtems_initialize_executive_early( &New_Configuration );
|
||||
/* we will not run this far */
|
||||
}
|
||||
27
testsuites/sptests/spfatal09/Makefile.am
Normal file
27
testsuites/sptests/spfatal09/Makefile.am
Normal file
@@ -0,0 +1,27 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = spfatal09.exe
|
||||
spfatal09_exe_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h testcase.h
|
||||
|
||||
dist_rtems_tests_DATA = spfatal09.scn
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
spfatal09_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(spfatal09_exe_OBJECTS) $(spfatal09_exe_LDADD)
|
||||
LINK_LIBS = $(spfatal09_exe_LDLIBS)
|
||||
|
||||
spfatal09.exe$(EXEEXT): $(spfatal09_exe_OBJECTS) $(spfatal09_exe_DEPENDENCIES)
|
||||
@rm -f spfatal09.exe$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
1
testsuites/sptests/spfatal09/spfatal09.scn
Normal file
1
testsuites/sptests/spfatal09/spfatal09.scn
Normal file
@@ -0,0 +1 @@
|
||||
Fatal error (Core invalid workspace address) hit
|
||||
41
testsuites/sptests/spfatal09/testcase.h
Normal file
41
testsuites/sptests/spfatal09/testcase.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Classic API Init task create failure
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Way too much stack space. Should generate a fatal error
|
||||
* on the init task create.
|
||||
*/
|
||||
#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
|
||||
#define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
|
||||
rtems_initialization_tasks_table Initialization_tasks[] = {
|
||||
{ rtems_build_name('I', 'N', 'I', ' '),
|
||||
RTEMS_MINIMUM_STACK_SIZE,
|
||||
1,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
Init,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
0
|
||||
}
|
||||
};
|
||||
#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
|
||||
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
|
||||
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
|
||||
|
||||
#define FATAL_ERROR_DESCRIPTION "Core invalid workspace address"
|
||||
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
|
||||
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
|
||||
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS
|
||||
|
||||
void force_error()
|
||||
{
|
||||
rtems_configuration_table New_Configuration;
|
||||
New_Configuration = *_Configuration_Table;
|
||||
|
||||
New_Configuration.work_space_start = NULL;
|
||||
|
||||
rtems_initialize_executive_early( &New_Configuration );
|
||||
/* we will not run this far */
|
||||
}
|
||||
27
testsuites/sptests/spfatal10/Makefile.am
Normal file
27
testsuites/sptests/spfatal10/Makefile.am
Normal file
@@ -0,0 +1,27 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = spfatal10.exe
|
||||
spfatal10_exe_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h testcase.h
|
||||
|
||||
dist_rtems_tests_DATA = spfatal10.scn
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
spfatal10_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(spfatal10_exe_OBJECTS) $(spfatal10_exe_LDADD)
|
||||
LINK_LIBS = $(spfatal10_exe_LDLIBS)
|
||||
|
||||
spfatal10.exe$(EXEEXT): $(spfatal10_exe_OBJECTS) $(spfatal10_exe_DEPENDENCIES)
|
||||
@rm -f spfatal10.exe$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
1
testsuites/sptests/spfatal10/spfatal10.scn
Normal file
1
testsuites/sptests/spfatal10/spfatal10.scn
Normal file
@@ -0,0 +1 @@
|
||||
Fatal error (Core NULL Configuration Table) hit
|
||||
36
testsuites/sptests/spfatal10/testcase.h
Normal file
36
testsuites/sptests/spfatal10/testcase.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Classic API Init task create failure
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Way too much stack space. Should generate a fatal error
|
||||
* on the init task create.
|
||||
*/
|
||||
#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
|
||||
#define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
|
||||
rtems_initialization_tasks_table Initialization_tasks[] = {
|
||||
{ rtems_build_name('I', 'N', 'I', ' '),
|
||||
RTEMS_MINIMUM_STACK_SIZE,
|
||||
1,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
Init,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
0
|
||||
}
|
||||
};
|
||||
#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
|
||||
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
|
||||
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
|
||||
|
||||
#define FATAL_ERROR_DESCRIPTION "Core NULL Configuration Table"
|
||||
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
|
||||
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
|
||||
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_NO_CONFIGURATION_TABLE
|
||||
|
||||
void force_error()
|
||||
{
|
||||
rtems_initialize_executive_early( NULL );
|
||||
/* we will not run this far */
|
||||
}
|
||||
154
testsuites/sptests/spfatal_support/init.c
Normal file
154
testsuites/sptests/spfatal_support/init.c
Normal file
@@ -0,0 +1,154 @@
|
||||
/* Init
|
||||
*
|
||||
* This routine is the initialization task for this test program.
|
||||
* It is a user initialization task and has the responsibility for creating
|
||||
* and starting the tasks that make up the test. If the time of day
|
||||
* clock is required for the test, it should also be set to a known
|
||||
* value by this function.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2008.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define TEST_INIT
|
||||
#include "system.h"
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
)
|
||||
{
|
||||
force_error();
|
||||
printk( "Fatal error (%s) NOT hit\n", FATAL_ERROR_DESCRIPTION );
|
||||
rtems_test_exit(0);
|
||||
}
|
||||
|
||||
char *Sources[] = {
|
||||
"INTERNAL_ERROR_CORE",
|
||||
"INTERNAL_ERROR_RTEMS_API",
|
||||
"INTERNAL_ERROR_POSIX_API",
|
||||
"INTERNAL_ERROR_ITRON_API"
|
||||
};
|
||||
|
||||
|
||||
char *Errors_Rtems[] = {
|
||||
"RTEMS_SUCCESSFUL", /* successful completion */
|
||||
"RTEMS_TASK_EXITTED", /* returned from a task */
|
||||
"RTEMS_MP_NOT_CONFIGURED", /* multiprocessing not configured */
|
||||
"RTEMS_INVALID_NAME", /* invalid object name */
|
||||
"RTEMS_INVALID_ID", /* invalid object id */
|
||||
"RTEMS_TOO_MANY", /* too many */
|
||||
"RTEMS_TIMEOUT", /* timed out waiting */
|
||||
"RTEMS_OBJECT_WAS_DELETED", /* object was deleted while waiting */
|
||||
"RTEMS_INVALID_SIZE", /* specified size was invalid */
|
||||
"RTEMS_INVALID_ADDRESS", /* address specified is invalid */
|
||||
"RTEMS_INVALID_NUMBER", /* number was invalid */
|
||||
"RTEMS_NOT_DEFINED", /* item has not been initialized */
|
||||
"RTEMS_RESOURCE_IN_USE", /* resources still outstanding */
|
||||
"RTEMS_UNSATISFIED", /* request not satisfied */
|
||||
"RTEMS_INCORRECT_STATE", /* task is in wrong state */
|
||||
"RTEMS_ALREADY_SUSPENDED", /* task already in state */
|
||||
"RTEMS_ILLEGAL_ON_SELF", /* illegal operation on calling task */
|
||||
"RTEMS_ILLEGAL_ON_REMOTE_OBJECT", /* illegal operation for remote object */
|
||||
"RTEMS_CALLED_FROM_ISR", /* called from ISR */
|
||||
"RTEMS_INVALID_PRIORITY", /* invalid task priority */
|
||||
"RTEMS_INVALID_CLOCK", /* invalid date/time */
|
||||
"RTEMS_INVALID_NODE", /* invalid node id */
|
||||
"RTEMS_NOT_OWNER_OF_RESOURCE", /* not owner of resource */
|
||||
"RTEMS_NOT_CONFIGURED", /* directive not configured */
|
||||
"RTEMS_NOT_IMPLEMENTED" /* directive not implemented */
|
||||
};
|
||||
|
||||
char *Errors_Core[] = {
|
||||
"INTERNAL_ERROR_NO_CONFIGURATION_TABLE",
|
||||
"INTERNAL_ERROR_NO_CPU_TABLE",
|
||||
"INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS",
|
||||
"INTERNAL_ERROR_TOO_LITTLE_WORKSPACE",
|
||||
"INTERNAL_ERROR_WORKSPACE_ALLOCATION",
|
||||
"INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL",
|
||||
"INTERNAL_ERROR_THREAD_EXITTED",
|
||||
"INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION",
|
||||
"INTERNAL_ERROR_INVALID_NODE",
|
||||
"INTERNAL_ERROR_NO_MPCI",
|
||||
"INTERNAL_ERROR_BAD_PACKET",
|
||||
"INTERNAL_ERROR_OUT_OF_PACKETS",
|
||||
"INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS",
|
||||
"INTERNAL_ERROR_OUT_OF_PROXIES",
|
||||
"INTERNAL_ERROR_INVALID_GLOBAL_ID",
|
||||
"INTERNAL_ERROR_BAD_STACK_HOOK",
|
||||
"INTERNAL_ERROR_BAD_ATTRIBUTES",
|
||||
"INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY",
|
||||
"INTERNAL_ERROR_IMPLEMENTATION_BLOCKING_OPERATION_CANCEL",
|
||||
"INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE"
|
||||
};
|
||||
|
||||
void Put_Error( uint32_t source, uint32_t error )
|
||||
{
|
||||
if ( source == INTERNAL_ERROR_CORE ) {
|
||||
if ( error > INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE )
|
||||
printk("Unknown Internal Core Error (%d)", error);
|
||||
else
|
||||
printk( Errors_Core[ error ] );
|
||||
}
|
||||
else if (source == INTERNAL_ERROR_RTEMS_API ){
|
||||
if (error > RTEMS_NOT_IMPLEMENTED )
|
||||
printk("Unknown Internal Rtems Error (%d)", error);
|
||||
else
|
||||
printk( Errors_Rtems[ error ] );
|
||||
}
|
||||
}
|
||||
|
||||
void Put_Source( uint32_t source )
|
||||
{
|
||||
if ( source > INTERNAL_ERROR_ITRON_API )
|
||||
printk("Unknown Source (%d)", source);
|
||||
else
|
||||
printk( Sources[ source ] );
|
||||
}
|
||||
|
||||
|
||||
rtems_extension Fatal_extension(
|
||||
uint32_t source,
|
||||
boolean is_internal,
|
||||
uint32_t error
|
||||
)
|
||||
{
|
||||
printk( "Fatal error (%s) hit\n", FATAL_ERROR_DESCRIPTION );
|
||||
|
||||
if ( source != FATAL_ERROR_EXPECTED_SOURCE ){
|
||||
printk( "ERROR==> Fatal Extension source Expected (");
|
||||
Put_Source( FATAL_ERROR_EXPECTED_SOURCE );
|
||||
printk( ") received (");
|
||||
Put_Source( source );
|
||||
printk( ")\n" );
|
||||
}
|
||||
|
||||
if ( is_internal != FATAL_ERROR_EXPECTED_IS_INTERNAL )
|
||||
{
|
||||
if ( is_internal == TRUE )
|
||||
printk( "ERROR==> Fatal Extension is internal set to TRUE expected FALSE\n" );
|
||||
else
|
||||
printk( "ERROR==> Fatal Extension is internal set to FALSE expected TRUE\n" );
|
||||
}
|
||||
|
||||
if ( error != FATAL_ERROR_EXPECTED_ERROR ) {
|
||||
printk( "ERROR==> Fatal Error Expected (");
|
||||
Put_Error( source, FATAL_ERROR_EXPECTED_ERROR );
|
||||
printk( ") received (");
|
||||
Put_Error( source, error );
|
||||
printk( ")\n" );
|
||||
}
|
||||
|
||||
/* return and let the CPU halt */
|
||||
}
|
||||
|
||||
72
testsuites/sptests/spfatal_support/system.h
Normal file
72
testsuites/sptests/spfatal_support/system.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Some of the fatal error cases require the ability to peek inside RTEMS
|
||||
*/
|
||||
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
|
||||
#include <rtems.h>
|
||||
#include <tmacros.h>
|
||||
|
||||
/* functions */
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
);
|
||||
|
||||
rtems_extension Fatal_extension(
|
||||
uint32_t source,
|
||||
boolean is_internal,
|
||||
uint32_t error
|
||||
);
|
||||
|
||||
/* need prototypes */
|
||||
|
||||
#include "testcase.h"
|
||||
|
||||
/* configuration information */
|
||||
|
||||
extern rtems_extensions_table initial_extensions;
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS \
|
||||
{ \
|
||||
NULL, /* create */ \
|
||||
NULL, /* start */ \
|
||||
NULL, /* restart */ \
|
||||
NULL, /* delete */ \
|
||||
NULL, /* switch */ \
|
||||
NULL, /* begin */ \
|
||||
NULL, /* exitted */ \
|
||||
Fatal_extension /* fatal */ \
|
||||
}
|
||||
|
||||
/* extra parameters may be in testcase.h */
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
/* always need an Init task, some cases need more tasks */
|
||||
#ifndef SPFATAL_TEST_CASE_EXTRA_TASKS
|
||||
#define SPFATAL_TEST_CASE_EXTRA_TASKS 0
|
||||
#endif
|
||||
#define CONFIGURE_MAXIMUM_TASKS \
|
||||
(SPFATAL_TEST_CASE_EXTRA_TASKS + 1)
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
/* end of include file */
|
||||
Reference in New Issue
Block a user