<!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-08-03)</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-08-03 Joel Sherrill <joel.sherrilL@OARcorp.com>

        * shared/startup/sbrk.c: Make bsp's sbrk a weak reference so that the
        test of having sbrk() support in malloc can link.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/powerpc/ChangeLog.diff?r1=text&tr1=1.235&r2=text&tr2=1.236&diff_format=h">M</a></td><td width='1%'>1.236</td><td width='100%'>c/src/lib/libbsp/powerpc/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c.diff?r1=text&tr1=1.9&r2=text&tr2=1.10&diff_format=h">M</a></td><td width='1%'>1.10</td><td width='100%'>c/src/lib/libbsp/powerpc/shared/startup/sbrk.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/powerpc/ChangeLog:1.235 rtems/c/src/lib/libbsp/powerpc/ChangeLog:1.236
--- rtems/c/src/lib/libbsp/powerpc/ChangeLog:1.235      Wed Jul  7 09:08:04 2010
+++ rtems/c/src/lib/libbsp/powerpc/ChangeLog    Tue Aug  3 17:02:30 2010
</font><font color='#997700'>@@ -1,3 +1,8 @@
</font><font color='#000088'>+2010-08-03    Joel Sherrill <joel.sherrilL@OARcorp.com>
+
+       * shared/startup/sbrk.c: Make bsp's sbrk a weak reference so that the
+       test of having sbrk() support in malloc can link.
+
</font> 2010-07-07        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        PR 1606/cpukit

<font color='#006600'>diff -u rtems/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c:1.9 rtems/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c:1.10
--- rtems/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c:1.9    Sun Nov 29 22:29:47 2009
+++ rtems/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c        Tue Aug  3 17:02:30 2010
</font><font color='#997700'>@@ -7,13 +7,13 @@
</font>  * ----------
  * This software was created by
  *     Till Straumann <strauman@slac.stanford.edu>, 2002,
<font color='#880000'>- *<span style="background-color: #FF0000"> </span>      Stanford Linear Accelerator Center, Stanford University.
</font><font color='#000088'>+ *        Stanford Linear Accelerator Center, Stanford University.
</font>  *
  * Acknowledgement of sponsorship
  * ------------------------------
  * This software was produced by
  *     the Stanford Linear Accelerator Center, Stanford University,
<font color='#880000'>- *<span style="background-color: #FF0000"> </span>      under Contract DE-AC03-76SFO0515 with the Department of Energy.
</font><font color='#000088'>+ *        under Contract DE-AC03-76SFO0515 with the Department of Energy.
</font>  *
  * Government disclaimer of liability
  * ----------------------------------
<font color='#997700'>@@ -100,40 +100,45 @@
</font>     /* clip at LIMIT_32M */
     rval = remaining_start + remaining_size - LIMIT_32M;
     *heap_size_p = LIMIT_32M - remaining_start;
<font color='#880000'>-   remaining_start = LIMIT_32M;
-       remaining_size  = rval;
</font><font color='#000088'>+    remaining_start = LIMIT_32M;
+    remaining_size  = rval;
</font>   }
 
   if ( 0 != &BSP_sbrk_policy ) {
<font color='#880000'>-<span style="background-color: #FF0000">  </span>    switch ( BSP_sbrk_policy ) {
-               case (uint32_t)(-1):
-                       *heap_size_p    += rval;
-                       remaining_start  = heap_start + *heap_size_p;
-                       remaining_size   = 0;
-                       /* return a nonzero sbrk_amount because the libsupport code
-                        * at some point divides by this number prior to trying an
-                        * sbrk() which will fail.
-                        */
-                       rval = 1;
-               break;
-
-               case 0:
-                       remaining_size = 0;
-                       /* see above for why we return 1 */
-                       rval = 1;
-               break;
-
-               default:
-                       if ( rval > BSP_sbrk_policy )
-                               rval = BSP_sbrk_policy;
-               break;
-       }
</font><font color='#000088'>+    switch ( BSP_sbrk_policy ) {
+      case (uint32_t)(-1):
+       *heap_size_p    += rval;
+       remaining_start  = heap_start + *heap_size_p;
+       remaining_size   = 0;
+       /* return a nonzero sbrk_amount because the libsupport code
+        * at some point divides by this number prior to trying an
+        * sbrk() which will fail.
+        */
+       rval = 1;
+       break;
+
+      case 0:
+       remaining_size = 0;
+       /* see above for why we return 1 */
+       rval = 1;
+       break;
+
+      default:
+       if ( rval > BSP_sbrk_policy )
+           rval = BSP_sbrk_policy;
+       break;
+    }
</font>   }
 
   return rval;
 }
 
<font color='#880000'>-void * sbrk(ptrdiff_t incr)
</font><font color='#000088'>+/*
+ * This is just so the sbrk test can force its magic. All normal applications
+ * should just use the default implementation in this file.
+ */
+void *sbrk(ptrdiff_t incr) __attribute__ (( weak, alias("bsp_sbrk") ));
+void *bsp_sbrk(ptrdiff_t incr)
</font> {
   void *rval=(void*)-1;
 
<font color='#997700'>@@ -145,8 +150,8 @@
</font>   } else {
     errno = ENOMEM;
   }
<font color='#880000'>-#ifdef DEBUG
-  printk("************* SBRK 0x%08x (ret 0x%08x) **********\n", incr, rval);
-#endif
</font><font color='#000088'>+  #ifdef DEBUG
+    printk("************* SBRK 0x%08x (ret 0x%08x) **********\n", incr, rval);
+  #endif
</font>   return rval;
 }
</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>