diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-10-04 22:02:18 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-10-04 22:02:18 +0000 |
commit | d05ec0f77313dc15ff4f4253441d56a4ce101530 (patch) | |
tree | dcf8b20ddea9a527102741ad299e821fe79f58a0 /testsuites/sptests/sp62 | |
parent | add missing file (diff) | |
download | rtems-d05ec0f77313dc15ff4f4253441d56a4ce101530.tar.bz2 |
2009-10-04 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp07/init.c, sp07/sp07.scn, sp09/init.c, sp09/screen01.c,
sp09/sp09.scn, sp28/init.c, sp62/init.c, sp62/sp62.scn, sp64/init.c,
sp64/sp64.scn: Add more test cases highlighted on SPARC at -O2, x86
at -Os and m68k at -Os. Fix typos.
Diffstat (limited to 'testsuites/sptests/sp62')
-rw-r--r-- | testsuites/sptests/sp62/init.c | 31 | ||||
-rw-r--r-- | testsuites/sptests/sp62/sp62.scn | 1 |
2 files changed, 29 insertions, 3 deletions
diff --git a/testsuites/sptests/sp62/init.c b/testsuites/sptests/sp62/init.c index e352de8464..0863b1d521 100644 --- a/testsuites/sptests/sp62/init.c +++ b/testsuites/sptests/sp62/init.c @@ -50,6 +50,7 @@ rtems_task Init( rtems_status_code sc; void *segment_address_1; intptr_t old_size; + size_t size; puts( "\n\n*** TEST 62 ***" ); @@ -104,10 +105,34 @@ rtems_task Init( if ( case_hit ) { puts( "Init - successfully resized and unblocked a task" ); - puts( "*** END OF TEST 62 ***" ); - } else + } else { puts( "Init - failed to resize and unblock a task" ); - + rtems_test_exit(0); + } + + /* + * Now resize and take all of memory so there is no need to + * process any blocked tasks waiting for memory. + */ + + size = sizeof(Region_Memory); + while (1) { + sc = rtems_region_resize_segment( + Region, segment_address_1, size, &old_size); + if ( sc == RTEMS_UNSATISFIED ) { + size --; + if ( size ) + continue; + } + directive_failed( sc, "rtems_region_resize_segment" ); + if ( sc == RTEMS_SUCCESSFUL ) + break; + + } + if ( sc == RTEMS_SUCCESSFUL && size != 0 ) + puts( "Init - resized to all of available memory" ); + + puts( "*** END OF TEST 62 ***" ); rtems_test_exit(0); } diff --git a/testsuites/sptests/sp62/sp62.scn b/testsuites/sptests/sp62/sp62.scn index a7dc9ee740..36a266bbaf 100644 --- a/testsuites/sptests/sp62/sp62.scn +++ b/testsuites/sptests/sp62/sp62.scn @@ -8,4 +8,5 @@ Blocker - rtems_region_get_segment - OK Init - sleep 1 second for Blocker to run again - OK Blocker - Got memory after resize Init - successfully resized and unblocked a task +Init - resized to all of available memory *** END OF TEST 62 *** |