From 07b93de9fda7cfeb6a8a0c8eb55adf6ff6aa2c68 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 10 Aug 2010 13:15:38 +0000 Subject: 2010-08-10 Joel Sherrill PR 1661/testing * malloc04/init.c: Add public methods to get/set malloc heap pointer so the tests do not have to peer behind the API. --- testsuites/libtests/ChangeLog | 6 ++++++ testsuites/libtests/malloc04/init.c | 34 ++++++++++++++++++---------------- 2 files changed, 24 insertions(+), 16 deletions(-) (limited to 'testsuites/libtests') diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog index 64f6ed19cb..2027bad6f8 100644 --- a/testsuites/libtests/ChangeLog +++ b/testsuites/libtests/ChangeLog @@ -1,3 +1,9 @@ +2010-08-10 Joel Sherrill + + PR 1661/testing + * malloc04/init.c: Add public methods to get/set malloc heap pointer so + the tests do not have to peer behind the API. + 2010-08-09 Bharath Suri PR 1661/testing diff --git a/testsuites/libtests/malloc04/init.c b/testsuites/libtests/malloc04/init.c index afb6eae0a9..ecef918b28 100644 --- a/testsuites/libtests/malloc04/init.c +++ b/testsuites/libtests/malloc04/init.c @@ -15,15 +15,26 @@ #include #include +/* configuration information */ +/* At top of file to have access to configuration variables */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT +#include +/* end of configuration */ + char Malloc_Heap[ 128 ] CPU_STRUCTURE_ALIGNMENT; int sbrk_count; Heap_Control Heap_Holder; +Heap_Control TempHeap; /* Heap variables we need to peek and poke at */ -extern Heap_Control *RTEMS_Malloc_Heap; extern size_t RTEMS_Malloc_Sbrk_amount; -extern rtems_malloc_sbrk_functions_t *rtems_malloc_sbrk_helpers; -extern rtems_malloc_sbrk_functions_t rtems_malloc_sbrk_helpers_table; size_t offset; @@ -52,6 +63,7 @@ rtems_task Init( ) { void *p1, *p2, *p3, *p4; + Heap_Control *TempHeap; sbrk_count = 0; offset = 0; @@ -59,7 +71,8 @@ rtems_task Init( puts( "\n\n*** TEST MALLOC 04 ***" ); /* Safe information on real heap */ - Heap_Holder = *RTEMS_Malloc_Heap; + TempHeap = malloc_get_heap_pointer(); + Heap_Holder = *TempHeap; rtems_malloc_sbrk_helpers = &rtems_malloc_sbrk_helpers_table; puts( "Initialize heap with some memory" ); @@ -112,7 +125,7 @@ rtems_task Init( p4 = malloc(48); /* Restore information on real heap */ - *RTEMS_Malloc_Heap = Heap_Holder; + malloc_set_heap_pointer( TempHeap ); rtems_malloc_sbrk_helpers = NULL; puts( "*** END OF TEST MALLOC 04 ***" ); @@ -120,15 +133,4 @@ rtems_task Init( rtems_test_exit(0); } -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 1 -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT - -#include /* end of file */ -- cgit v1.2.3