change log for rtems (2010-07-08)

rtems-vc at rtems.org rtems-vc at rtems.org
Thu Jul 8 21:18:43 UTC 2010


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

	* Makefile.am, configure.ac: Add test for exercising sbrk() extension
	to Malloc Family.
	* malloc04/.cvsignore, malloc04/Makefile.am, malloc04/init.c,
	malloc04/malloc04.doc, malloc04/malloc04.scn: New files.

M  1.201  testsuites/libtests/ChangeLog
M   1.37  testsuites/libtests/Makefile.am
M   1.44  testsuites/libtests/configure.ac
A    1.1  testsuites/libtests/malloc04/.cvsignore
A    1.1  testsuites/libtests/malloc04/Makefile.am
A    1.1  testsuites/libtests/malloc04/init.c
A    1.1  testsuites/libtests/malloc04/malloc04.doc
A    1.1  testsuites/libtests/malloc04/malloc04.scn

diff -u rtems/testsuites/libtests/ChangeLog:1.200 rtems/testsuites/libtests/ChangeLog:1.201
--- rtems/testsuites/libtests/ChangeLog:1.200	Tue Jul  6 14:54:00 2010
+++ rtems/testsuites/libtests/ChangeLog	Thu Jul  8 15:11:47 2010
@@ -1,3 +1,10 @@
+2010-07-08	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* Makefile.am, configure.ac: Add test for exercising sbrk() extension
+	to Malloc Family.
+	* malloc04/.cvsignore, malloc04/Makefile.am, malloc04/init.c,
+	malloc04/malloc04.doc, malloc04/malloc04.scn: New files.
+
 2010-07-06	Joel Sherrill <joel.sherrilL at OARcorp.com>
 
 	* termios06/init.c, termios06/termios06.scn: Add a couple more PPPDISC

diff -u rtems/testsuites/libtests/Makefile.am:1.36 rtems/testsuites/libtests/Makefile.am:1.37
--- rtems/testsuites/libtests/Makefile.am:1.36	Mon Jul  5 19:32:33 2010
+++ rtems/testsuites/libtests/Makefile.am	Thu Jul  8 15:11:48 2010
@@ -6,7 +6,8 @@
 
 SUBDIRS = POSIX
 
-SUBDIRS += bspcmdline01 cpuuse gxx01 malloctest malloc02 malloc03 heapwalk \
+SUBDIRS += bspcmdline01 cpuuse gxx01 \
+    malloctest malloc02 malloc03 malloc04 heapwalk \
     putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \
     termios termios01 termios02 termios03 termios04 termios05 termios06 \
     rtems++ tztest block01 block02 block03 block04 block05 block06 block07 \

diff -u rtems/testsuites/libtests/configure.ac:1.43 rtems/testsuites/libtests/configure.ac:1.44
--- rtems/testsuites/libtests/configure.ac:1.43	Mon Jul  5 19:32:33 2010
+++ rtems/testsuites/libtests/configure.ac	Thu Jul  8 15:11:48 2010
@@ -50,6 +50,7 @@
 malloctest/Makefile
 malloc02/Makefile
 malloc03/Makefile
+malloc04/Makefile
 monitor/Makefile
 monitor02/Makefile
 putenvtest/Makefile

diff -u /dev/null rtems/testsuites/libtests/malloc04/.cvsignore:1.1
--- /dev/null	Thu Jul  8 16:18:42 2010
+++ rtems/testsuites/libtests/malloc04/.cvsignore	Thu Jul  8 15:11:48 2010
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in

diff -u /dev/null rtems/testsuites/libtests/malloc04/Makefile.am:1.1
--- /dev/null	Thu Jul  8 16:18:43 2010
+++ rtems/testsuites/libtests/malloc04/Makefile.am	Thu Jul  8 15:11:48 2010
@@ -0,0 +1,26 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = malloc04
+malloc04_SOURCES = init.c
+
+dist_rtems_tests_DATA = malloc04.scn
+dist_rtems_tests_DATA += malloc04.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(malloc04_OBJECTS) $(malloc04_LDADD)
+LINK_LIBS = $(malloc04_LDLIBS)
+
+malloc04$(EXEEXT): $(malloc04_OBJECTS) $(malloc04_DEPENDENCIES)
+	@rm -f malloc04$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am

diff -u /dev/null rtems/testsuites/libtests/malloc04/init.c:1.1
--- /dev/null	Thu Jul  8 16:18:43 2010
+++ rtems/testsuites/libtests/malloc04/init.c	Thu Jul  8 15:11:48 2010
@@ -0,0 +1,121 @@
+/*
+ *  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$
+ */
+
+#include <tmacros.h>
+#include "test_support.h"
+#include <rtems/libcsupport.h>
+#include <rtems/malloc.h>
+
+char Malloc_Heap[ 128 ] CPU_STRUCTURE_ALIGNMENT;
+int sbrk_count;
+Heap_Control Heap_Holder;
+
+/* 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;
+void * sbrk(ptrdiff_t incr)
+{
+  void *p = (void *) -1;
+
+  printf( "sbrk(%td)\n", incr );
+  if ( offset + incr < sizeof(Malloc_Heap) ) {
+     p = &Malloc_Heap[ offset ];
+     offset += incr;
+  } else {
+    if ( sbrk_count == 0 )
+      p = (void *) rtems_task_create;
+    sbrk_count++;
+  }
+
+  sbrk_count++;
+  return p;
+}
+
+rtems_task Init(
+  rtems_task_argument argument
+)
+{
+  void *p1, *p2, *p3, *p4;
+
+  sbrk_count = 0;
+  offset     = 0;
+
+  puts( "\n\n*** TEST MALLOC 04 ***" );
+
+  /* Safe information on real heap */
+  Heap_Holder = *RTEMS_Malloc_Heap;
+  rtems_malloc_sbrk_helpers = &rtems_malloc_sbrk_helpers_table;
+
+  puts( "Initialize heap with some memory" );
+  offset     = 64;
+  sbrk_count = 0;
+  RTEMS_Malloc_Initialize( Malloc_Heap, 64, 64 );
+  p1 = malloc(64);
+  p2 = malloc(64);
+  p3 = malloc(48);
+  p4 = malloc(48);
+  
+  puts( "Initialize heap with some unaligned memory" );
+  offset     = 65;
+  sbrk_count = 0;
+  RTEMS_Malloc_Initialize( &Malloc_Heap[1], 64, 64 );
+  p1 = malloc(64);
+  p2 = malloc(64);
+  p3 = malloc(48);
+
+  puts( "Initialize heap with no memory (sbrk aligned)" );
+  offset     = 7;
+  sbrk_count = 0;
+  RTEMS_Malloc_Initialize( NULL, 0, 64 );
+  p1 = malloc(64);
+  p2 = malloc(64);
+  p3 = malloc(48);
+  p4 = malloc(48);
+  
+  puts( "Initialize heap with no memory (sbrk aligned)" );
+  offset     = 0;
+  sbrk_count = 0;
+  RTEMS_Malloc_Initialize( NULL, 0, 64 );
+  p1 = malloc(64);
+  
+  puts( "Set sbrk amount in heap to 0" );
+  offset     = 0;
+  sbrk_count = 0;
+  RTEMS_Malloc_Initialize( NULL, 0, 64 );
+  RTEMS_Malloc_Sbrk_amount = 0;
+  p4 = malloc(48);
+
+  /* Restore information on real heap */
+  *RTEMS_Malloc_Heap = Heap_Holder;
+  rtems_malloc_sbrk_helpers = NULL;
+
+
+  puts( "*** END OF TEST MALLOC 04 ***" );
+
+  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 */

diff -u /dev/null rtems/testsuites/libtests/malloc04/malloc04.doc:1.1
--- /dev/null	Thu Jul  8 16:18:43 2010
+++ rtems/testsuites/libtests/malloc04/malloc04.doc	Thu Jul  8 15:11:48 2010
@@ -0,0 +1,22 @@
+#
+#  $Id$
+#
+#  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.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name:  malloc04
+
+directives:
+
+  Malloc family sbrk extension capability
+
+concepts:
+
++ Exercise all non-fatal paths in the sbrk() support in the malloc family.

diff -u /dev/null rtems/testsuites/libtests/malloc04/malloc04.scn:1.1
--- /dev/null	Thu Jul  8 16:18:43 2010
+++ rtems/testsuites/libtests/malloc04/malloc04.scn	Thu Jul  8 15:11:48 2010
@@ -0,0 +1,20 @@
+*** TEST MALLOC 04 ***
+Initialize heap with some memory
+sbrk(128)
+sbrk(128)
+sbrk(64)
+Initialize heap with some unaligned memory
+sbrk(128)
+sbrk(128)
+sbrk(64)
+Initialize heap with no memory (sbrk aligned)
+sbrk(64)
+sbrk(128)
+sbrk(128)
+sbrk(64)
+Initialize heap with no memory (sbrk aligned)
+sbrk(64)
+sbrk(128)
+Set sbrk amount in heap to 0
+sbrk(64)
+*** END OF TEST MALLOC 04 ***



--

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/20100708/c8495df6/attachment-0001.html>


More information about the vc mailing list