summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-08-10 13:15:38 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-08-10 13:15:38 +0000
commit07b93de9fda7cfeb6a8a0c8eb55adf6ff6aa2c68 (patch)
tree6eb4ac000b4d17d19d6322d4d3166e46434ae624 /testsuites/libtests
parent2010-08-10 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-07b93de9fda7cfeb6a8a0c8eb55adf6ff6aa2c68.tar.bz2
2010-08-10 Joel Sherrill <joel.sherrill@oarcorp.com>
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.
Diffstat (limited to 'testsuites/libtests')
-rw-r--r--testsuites/libtests/ChangeLog6
-rw-r--r--testsuites/libtests/malloc04/init.c34
2 files changed, 24 insertions, 16 deletions
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 <joel.sherrill@oarcorp.com>
+
+ 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 <bharath.s.jois@gmail.com>
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 <rtems/malloc.h>
#include <errno.h>
+/* 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 <rtems/confdefs.h>
+/* 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 <rtems/confdefs.h>
/* end of file */