diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog index ec5588e6d9..fe595a5925 100644 --- a/testsuites/psxtests/ChangeLog +++ b/testsuites/psxtests/ChangeLog @@ -1,3 +1,9 @@ +2010-08-09 Joel Sherrill + + PR 1661/testing + * psxchroot01/test.c, psximfs01/init.c, psximfs02/init.c, + psxpipe01/init.c: Eliminate most references to RTEMS_Malloc_Heap. + 2010-08-09 Ralf Corsépius * psxpasswd02/init.c: Remove unused variable. diff --git a/testsuites/psxtests/psxchroot01/test.c b/testsuites/psxtests/psxchroot01/test.c index 25105567fa..ff872bb1e3 100644 --- a/testsuites/psxtests/psxchroot01/test.c +++ b/testsuites/psxtests/psxchroot01/test.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include void touch( char *file ) { @@ -64,8 +64,6 @@ int fileexists( char *file ) } #if defined(__rtems__) -extern Heap_Control *RTEMS_Malloc_Heap; - int test_main(void) #else int main( @@ -76,7 +74,6 @@ int main( { int status; void *alloc_ptr = (void *)0; - Heap_Information_block Info; /* * This test is the C equivalent of this sequence. #mkdir /one @@ -108,8 +105,7 @@ int main( touch( "/one/two/two.test" ); puts( "allocate most of memory - attempt to fail chroot - expect ENOTSUP" ); - _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 ); status = chroot( "/one" ); diff --git a/testsuites/psxtests/psximfs01/init.c b/testsuites/psxtests/psximfs01/init.c index 8ca65bb0c7..cafac02701 100644 --- a/testsuites/psxtests/psximfs01/init.c +++ b/testsuites/psxtests/psximfs01/init.c @@ -17,6 +17,7 @@ #include #include #include +#include int TestFd; uint8_t Buffer[256]; @@ -207,15 +208,12 @@ void unlink_it(void) rtems_test_assert( rc == 0 ); } -extern Heap_Control *RTEMS_Malloc_Heap; - rtems_task Init( rtems_task_argument argument ) { int i; void *alloc_ptr = (void *)0; - Heap_Information_block Info; int position = 0; int status = 0; @@ -240,8 +238,7 @@ rtems_task Init( /* * Allocate the heap, so that extend cannot be successful */ - _Heap_Get_information( RTEMS_Malloc_Heap, &Info ); - alloc_ptr = malloc( Info.Free.largest-4 ); + alloc_ptr = malloc( malloc_free_space() - 4 ); extend_helper(); diff --git a/testsuites/psxtests/psximfs02/init.c b/testsuites/psxtests/psximfs02/init.c index 7482fbc528..cafe232e17 100644 --- a/testsuites/psxtests/psximfs02/init.c +++ b/testsuites/psxtests/psximfs02/init.c @@ -18,8 +18,8 @@ #include #include #include +#include -extern Heap_Control *RTEMS_Malloc_Heap; void IMFS_dump( void ); rtems_task Init( rtems_task_argument argument @@ -85,8 +85,7 @@ rtems_task Init( rtems_test_assert( errno == EACCES ); puts( "Allocate most of heap" ); - _Heap_Get_information( RTEMS_Malloc_Heap, &Info ); - alloc_ptr = malloc( Info.Free.largest - 150 ); + alloc_ptr = malloc( malloc_free_space() - 150 ); puts( "Attempt to mount a fs at /dir01 -- expect ENOMEM" ); status = mount( NULL, @@ -101,8 +100,7 @@ rtems_task Init( free( alloc_ptr ); puts( "Allocate most of heap" ); - _Heap_Get_information( RTEMS_Malloc_Heap, &Info ); - alloc_ptr = malloc( Info.Free.largest - 4 ); + alloc_ptr = malloc( malloc_free_space() - 4 ); puts( "Changing directory to /" ); status = chdir( "/" ); diff --git a/testsuites/psxtests/psxpipe01/init.c b/testsuites/psxtests/psxpipe01/init.c index 49d2e00fc2..7ef2e31e32 100644 --- a/testsuites/psxtests/psxpipe01/init.c +++ b/testsuites/psxtests/psxpipe01/init.c @@ -16,10 +16,7 @@ #include #include #include - -#include - -extern Heap_Control *RTEMS_Malloc_Heap; +#include rtems_task Init( rtems_task_argument not_used @@ -29,7 +26,6 @@ rtems_task Init( int dummy_fd[2] = {0,0}; int status = 0; void *alloc_ptr = (void *)0; - Heap_Information_block Info; puts( "*** TEST POSIX PIPE CREATION - 01 ***" ); @@ -54,8 +50,7 @@ rtems_task Init( status |= close( fd[1] ); rtems_test_assert( status == 0 ); - _Heap_Get_information(RTEMS_Malloc_Heap, &Info); - alloc_ptr = malloc(Info.Free.largest-4); + alloc_ptr = malloc( malloc_free_space() - 4 ); /* case where mkfifo fails */ puts( "Init - attempt to create pipe -- expect ENOMEM" );