change log for rtems (2010-08-10)

rtems-vc at rtems.org rtems-vc at rtems.org
Tue Aug 10 14:11:35 UTC 2010


 *joel*:
2010-08-10	Joel Sherrill <joel.sherrill at oarcorp.com>

	PR 1661/testing
	* libcsupport/Makefile.am, libcsupport/include/rtems/libcsupport.h: Add
	public methods to get/set malloc heap pointer so the tests do not
	have to peer behind the API.
	* libcsupport/src/mallocgetheapptr.c,
	libcsupport/src/mallocsetheapptr.c: New files.

M 1.2557  cpukit/ChangeLog
M  1.131  cpukit/libcsupport/Makefile.am
M   1.26  cpukit/libcsupport/include/rtems/libcsupport.h
A    1.1  cpukit/libcsupport/src/mallocgetheapptr.c
A    1.1  cpukit/libcsupport/src/mallocsetheapptr.c

diff -u rtems/cpukit/ChangeLog:1.2556 rtems/cpukit/ChangeLog:1.2557
--- rtems/cpukit/ChangeLog:1.2556	Mon Aug  9 04:16:08 2010
+++ rtems/cpukit/ChangeLog	Tue Aug 10 08:15:30 2010
@@ -1,3 +1,12 @@
+2010-08-10	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	PR 1661/testing
+	* libcsupport/Makefile.am, libcsupport/include/rtems/libcsupport.h: Add
+	public methods to get/set malloc heap pointer so the tests do not
+	have to peer behind the API.
+	* libcsupport/src/mallocgetheapptr.c,
+	libcsupport/src/mallocsetheapptr.c: New files.
+
 2010-08-09	Sebastian Huber <sebastian.huber at embedded-brains.de>
 
 	* score/inline/rtems/score/object.inl: Use attribute unused in

diff -u rtems/cpukit/libcsupport/Makefile.am:1.130 rtems/cpukit/libcsupport/Makefile.am:1.131
--- rtems/cpukit/libcsupport/Makefile.am:1.130	Tue Aug  3 10:46:51 2010
+++ rtems/cpukit/libcsupport/Makefile.am	Tue Aug 10 08:15:30 2010
@@ -92,6 +92,7 @@
     src/realloc.c src/_calloc_r.c src/_malloc_r.c \
     src/free.c src/freenode.c src/_free_r.c \
     src/_realloc_r.c src/mallocfreespace.c \
+   src/mallocgetheapptr.c src/mallocsetheapptr.c \
     src/mallocinfo.c src/malloc_walk.c src/malloc_get_statistics.c \
     src/malloc_report_statistics.c src/malloc_report_statistics_plugin.c \
     src/malloc_statistics_helpers.c src/posix_memalign.c \

diff -u rtems/cpukit/libcsupport/include/rtems/libcsupport.h:1.25 rtems/cpukit/libcsupport/include/rtems/libcsupport.h:1.26
--- rtems/cpukit/libcsupport/include/rtems/libcsupport.h:1.25	Wed Oct 14 11:13:05 2009
+++ rtems/cpukit/libcsupport/include/rtems/libcsupport.h	Tue Aug 10 08:15:30 2010
@@ -35,6 +35,8 @@
 
 extern void malloc_dump(void);
 extern void malloc_walk(size_t source, size_t printf_enabled);
+void malloc_set_heap_pointer(Heap_Control *new_heap);
+Heap_Control *malloc_get_heap_pointer( void );
 extern void libc_init(void);
 extern int  host_errno(void);
 extern void fix_syscall_errno(void);

diff -u /dev/null rtems/cpukit/libcsupport/src/mallocgetheapptr.c:1.1
--- /dev/null	Tue Aug 10 09:11:34 2010
+++ rtems/cpukit/libcsupport/src/mallocgetheapptr.c	Tue Aug 10 08:15:30 2010
@@ -0,0 +1,26 @@
+/*
+ *  RTEMS Malloc Get Heap Pointer -- Primarily for Debug
+ *
+ *  COPYRIGHT (c) 1989-2010.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
+#include <rtems.h>
+#include <rtems/libcsupport.h>
+#include "malloc_p.h"
+
+Heap_Control *malloc_get_heap_pointer( void )
+{
+  return RTEMS_Malloc_Heap;
+}

diff -u /dev/null rtems/cpukit/libcsupport/src/mallocsetheapptr.c:1.1
--- /dev/null	Tue Aug 10 09:11:34 2010
+++ rtems/cpukit/libcsupport/src/mallocsetheapptr.c	Tue Aug 10 08:15:30 2010
@@ -0,0 +1,28 @@
+/*
+ *  RTEMS Malloc Set Heap Pointer -- Primarily for Debug
+ *
+ *  COPYRIGHT (c) 1989-2010.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
+#include <rtems.h>
+#include <rtems/libcsupport.h>
+#include "malloc_p.h"
+
+void malloc_set_heap_pointer(
+  Heap_Control *new_heap
+)
+{
+  RTEMS_Malloc_Heap = new_heap;
+}


 *joel*:
2010-08-10	Joel Sherrill <joel.sherrill at 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.

M  1.234  testsuites/libtests/ChangeLog
M    1.3  testsuites/libtests/malloc04/init.c

diff -u rtems/testsuites/libtests/ChangeLog:1.233 rtems/testsuites/libtests/ChangeLog:1.234
--- rtems/testsuites/libtests/ChangeLog:1.233	Mon Aug  9 09:36:47 2010
+++ rtems/testsuites/libtests/ChangeLog	Tue Aug 10 08:15:38 2010
@@ -1,3 +1,9 @@
+2010-08-10	Joel Sherrill <joel.sherrill at 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 at gmail.com>
 
 	PR 1661/testing

diff -u rtems/testsuites/libtests/malloc04/init.c:1.2 rtems/testsuites/libtests/malloc04/init.c:1.3
--- rtems/testsuites/libtests/malloc04/init.c:1.2	Wed Jul 14 18:23:12 2010
+++ rtems/testsuites/libtests/malloc04/init.c	Tue Aug 10 08:15:38 2010
@@ -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 @@
 )
 {
   void *p1, *p2, *p3, *p4;
+  Heap_Control *TempHeap;
 
   sbrk_count = 0;
   offset     = 0;
@@ -59,7 +71,8 @@
   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 @@
   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_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 */



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100810/9adf0a35/attachment.html>


More information about the vc mailing list