diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-06-22 01:28:13 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-06-22 01:28:13 +0000 |
commit | 5d8a0bab42122a0d1d60334d7262546dcbbc116c (patch) | |
tree | a4e06d3f9b2f8632be492b3f650baf524b3dfa03 /testsuites/sptests/spfatal_support | |
parent | 2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-5d8a0bab42122a0d1d60334d7262546dcbbc116c.tar.bz2 |
2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, spfatal_support/init.c,
spfatal_support/system.h: Add new tests to generate fatal errors in
open_dev_console().
* spfatal14/.cvsignore, spfatal14/Makefile.am, spfatal14/spfatal14.doc,
spfatal14/spfatal14.scn, spfatal14/testcase.h, spfatal15/.cvsignore,
spfatal15/Makefile.am, spfatal15/spfatal15.doc,
spfatal15/spfatal15.scn, spfatal15/testcase.h,
spfatal_support/consume_sems.c: New files.
Diffstat (limited to 'testsuites/sptests/spfatal_support')
-rw-r--r-- | testsuites/sptests/spfatal_support/consume_sems.c | 54 | ||||
-rw-r--r-- | testsuites/sptests/spfatal_support/init.c | 2 | ||||
-rw-r--r-- | testsuites/sptests/spfatal_support/system.h | 9 |
3 files changed, 64 insertions, 1 deletions
diff --git a/testsuites/sptests/spfatal_support/consume_sems.c b/testsuites/sptests/spfatal_support/consume_sems.c new file mode 100644 index 0000000000..b0fcc420a8 --- /dev/null +++ b/testsuites/sptests/spfatal_support/consume_sems.c @@ -0,0 +1,54 @@ +/* + * COPYRIGHT (c) 1989-2010. + * 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$ + */ + +#include <rtems.h> + +#define MAXIMUM 20 +rtems_id Semaphores[MAXIMUM]; + +rtems_device_driver consume_semaphores_initialize( + rtems_device_major_number major __attribute__((unused)), + rtems_device_minor_number minor __attribute__((unused)), + void *pargp __attribute__((unused)) +) +{ + int sems; + rtems_status_code status; + + for ( sems=0 ; sems<MAXIMUM ; sems++ ) { + status = rtems_semaphore_create( + rtems_build_name( 'S', 'M', '1', ' ' ), + 1, + RTEMS_DEFAULT_MODES, + RTEMS_NO_PRIORITY, + &Semaphores[sems] + ); + if ( status == RTEMS_TOO_MANY ) + break; + } + + #if 0 + printk( "Consumed %d\n", sems ); + printk( "Freeing %d\n", SEMAPHORES_REMAINING ); + #endif + + #if defined(SEMAPHORES_REMAINING) + { + int i; + + for ( i=0 ; i<SEMAPHORES_REMAINING ; i++ ) { + (void) rtems_semaphore_delete( Semaphores[i] ); + } + } + #endif + return RTEMS_SUCCESSFUL; +} + diff --git a/testsuites/sptests/spfatal_support/init.c b/testsuites/sptests/spfatal_support/init.c index a3e87b0aaa..5e2fce1baf 100644 --- a/testsuites/sptests/spfatal_support/init.c +++ b/testsuites/sptests/spfatal_support/init.c @@ -102,7 +102,7 @@ void Put_Error( uint32_t source, uint32_t error ) } else if (source == INTERNAL_ERROR_RTEMS_API ){ if (error > RTEMS_NOT_IMPLEMENTED ) - printk("Unknown Internal Rtems Error (%d)", error); + printk("Unknown Internal Rtems Error (0x%08x)", error); else printk( Errors_Rtems[ error ] ); } diff --git a/testsuites/sptests/spfatal_support/system.h b/testsuites/sptests/spfatal_support/system.h index 4373220c36..07f863e53d 100644 --- a/testsuites/sptests/spfatal_support/system.h +++ b/testsuites/sptests/spfatal_support/system.h @@ -45,6 +45,15 @@ void force_error(void); /* need some prototypes for test cases */ +rtems_device_driver consume_semaphores_initialize( + rtems_device_major_number major __attribute__((unused)), + rtems_device_minor_number minor __attribute__((unused)), + void *pargp __attribute__((unused)) +); + +#define CONSUME_SEMAPHORE_DRIVERS \ + { consume_semaphores_initialize, NULL, NULL, NULL, NULL, NULL } + #include "testcase.h" /* configuration information */ |