From 8d9c8247e5ec975cd6f0b1abeddf2a08496989ff Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 9 Aug 2010 14:29:36 +0000 Subject: 2010-08-09 Joel Sherrill PR 1661/testing * spfifo02/init.c, spmountmgr01/init.c, spprivenv01/init.c: Eliminate most references to RTEMS_Malloc_Heap. --- testsuites/sptests/ChangeLog | 6 ++++++ testsuites/sptests/spfifo02/init.c | 8 ++------ testsuites/sptests/spmountmgr01/init.c | 8 ++------ testsuites/sptests/spprivenv01/init.c | 11 ++++------- 4 files changed, 14 insertions(+), 19 deletions(-) (limited to 'testsuites/sptests') diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index 38a7cdff80..31d6f3e01a 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,3 +1,9 @@ +2010-08-09 Joel Sherrill + + PR 1661/testing + * spfifo02/init.c, spmountmgr01/init.c, spprivenv01/init.c: Eliminate + most references to RTEMS_Malloc_Heap. + 2010-08-09 Sebastian Huber * sp09/screen12.c: Update for rtems_region_create() changes. diff --git a/testsuites/sptests/spfifo02/init.c b/testsuites/sptests/spfifo02/init.c index d564e13138..dab28a05fa 100644 --- a/testsuites/sptests/spfifo02/init.c +++ b/testsuites/sptests/spfifo02/init.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #define MAXIMUM 10 #define NUM_OPEN_REQ 26 @@ -28,8 +28,6 @@ int BarrierCount; rtems_id Semaphores[MAXIMUM]; int SemaphoreCount; -extern Heap_Control *RTEMS_Malloc_Heap; - void create_all_barriers(void) { rtems_status_code status; @@ -132,7 +130,6 @@ rtems_task Init( void *alloc_ptr = (void *)0; int num_opens = 0; int index = 0; - Heap_Information_block Info; puts( "\n\n*** TEST FIFO 08 ***" ); @@ -154,8 +151,7 @@ rtems_task Init( delete_semaphore(); - _Heap_Get_information(RTEMS_Malloc_Heap, &Info); - alloc_ptr = malloc(Info.Free.largest-4); + alloc_ptr = malloc( malloc_free_space() - 4 ); puts("Opening FIFO.. expect ENOMEM since no memory is available"); open_fifo(ENOMEM, O_RDWR); diff --git a/testsuites/sptests/spmountmgr01/init.c b/testsuites/sptests/spmountmgr01/init.c index 69b36a2f2e..890fa4a137 100644 --- a/testsuites/sptests/spmountmgr01/init.c +++ b/testsuites/sptests/spmountmgr01/init.c @@ -11,11 +11,9 @@ #include #include "test_support.h" -#include #include #include - -extern Heap_Control *RTEMS_Malloc_Heap; +#include int fs_mount( rtems_filesystem_mount_table_entry_t *mt_entry, const void *data ) @@ -29,13 +27,11 @@ rtems_task Init( { int status = 0; void *alloc_ptr = (void *)0; - Heap_Information_block Info; puts( "\n\n*** TEST MOUNT MANAGER ROUTINE - 01 ***" ); puts( "Init - allocating most of heap -- OK" ); - _Heap_Get_information(RTEMS_Malloc_Heap, &Info); - alloc_ptr = malloc( Info.Free.largest - 4 ); + alloc_ptr = malloc( malloc_free_space() - 4 ); rtems_test_assert( alloc_ptr != NULL ); puts( "Init - attempt to register filesystem fs - expect ENOMEM" ); diff --git a/testsuites/sptests/spprivenv01/init.c b/testsuites/sptests/spprivenv01/init.c index 3752088bd8..af92bef271 100644 --- a/testsuites/sptests/spprivenv01/init.c +++ b/testsuites/sptests/spprivenv01/init.c @@ -11,10 +11,8 @@ #include #include "test_support.h" -#include #include - -extern Heap_Control *RTEMS_Malloc_Heap; +#include rtems_task task_routine( rtems_task_argument not_used ) { @@ -35,16 +33,15 @@ rtems_task Init( int sc = 0; bool status = 0; void *alloc_ptr = (void *)0; - Heap_Information_block Info; rtems_id current_task_id; rtems_id task_id; rtems_name another_task_name; - + Heap_Information_block Info; + puts( "\n\n*** TEST USER ENVIRONMENT ROUTINE - 01 ***" ); puts( "Init - allocating most of heap -- OK" ); - _Heap_Get_information(RTEMS_Malloc_Heap, &Info); - alloc_ptr = malloc( Info.Free.largest - 4 ); + alloc_ptr = malloc( malloc_free_space() - 4 ); rtems_test_assert( alloc_ptr != NULL ); puts( "Init - attempt to reset env - expect RTEMS_NO_MEMORY" ); -- cgit v1.2.3