<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2010-07-08)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-07-08 Joel Sherrill <joel.sherrill@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.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/ChangeLog.diff?r1=text&tr1=1.200&r2=text&tr2=1.201&diff_format=h">M</a></td><td width='1%'>1.201</td><td width='100%'>testsuites/libtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/Makefile.am.diff?r1=text&tr1=1.36&r2=text&tr2=1.37&diff_format=h">M</a></td><td width='1%'>1.37</td><td width='100%'>testsuites/libtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/configure.ac.diff?r1=text&tr1=1.43&r2=text&tr2=1.44&diff_format=h">M</a></td><td width='1%'>1.44</td><td width='100%'>testsuites/libtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/malloc04/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/malloc04/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/malloc04/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/malloc04/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/malloc04/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/malloc04/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/malloc04/malloc04.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/malloc04/malloc04.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/malloc04/malloc04.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/malloc04/malloc04.scn</font></td></tr>
</table>
<pre>
<font color='#006600'>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
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2010-07-08    Joel Sherrill <joel.sherrill@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.
+
</font> 2010-07-06        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
        * termios06/init.c, termios06/termios06.scn: Add a couple more PPPDISC

<font color='#006600'>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
</font><font color='#997700'>@@ -6,7 +6,8 @@
</font> 
 SUBDIRS = POSIX
 
<font color='#880000'>-SUBDIRS += bspcmdline01 cpuuse gxx01 malloctest malloc02 malloc03 heapwalk \
</font><font color='#000088'>+SUBDIRS += bspcmdline01 cpuuse gxx01 \
+    malloctest malloc02 malloc03 malloc04 heapwalk \
</font>     putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \
     termios termios01 termios02 termios03 termios04 termios05 termios06 \
     rtems++ tztest block01 block02 block03 block04 block05 block06 block07 \

<font color='#006600'>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
</font><font color='#997700'>@@ -50,6 +50,7 @@
</font> malloctest/Makefile
 malloc02/Makefile
 malloc03/Makefile
<font color='#000088'>+malloc04/Makefile
</font> monitor/Makefile
 monitor02/Makefile
 putenvtest/Makefile

<font color='#006600'>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
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>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
</font><font color='#997700'>@@ -0,0 +1,26 @@
</font><font color='#000088'>+##
+## $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@.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
</font>
<font color='#006600'>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
</font><font color='#997700'>@@ -0,0 +1,121 @@
</font><font color='#000088'>+/*
+ *  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);
+<span style="background-color: #FF0000">  </span>
+  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);
+<span style="background-color: #FF0000">  </span>
+  puts( "Initialize heap with no memory (sbrk aligned)" );
+  offset     = 0;
+  sbrk_count = 0;
+  RTEMS_Malloc_Initialize( NULL, 0, 64 );
+  p1 = malloc(64);
+<span style="background-color: #FF0000">  </span>
+  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 */
</font>
<font color='#006600'>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
</font><font color='#997700'>@@ -0,0 +1,22 @@
</font><font color='#000088'>+#
+#  $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.
</font>
<font color='#006600'>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
</font><font color='#997700'>@@ -0,0 +1,20 @@
</font><font color='#000088'>+*** 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 ***
</font></pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>