]> sourceware.org Git - newlib-cygwin.git/commitdiff
or1k: Make heap start configurable
authorJeff Johnston <jjohnstn@redhat.com>
Tue, 26 May 2015 19:28:31 +0000 (15:28 -0400)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 27 May 2015 11:30:20 +0000 (13:30 +0200)
- Previously the heap started right after the bss section. This can now
  be configured by changing the _or1k_heap_start symbol that defaults to
  the old value (&end). In board_init_early, we can now set this to
  another value.

    * or1k/sbrk.c: Allow for different heap start

libgloss/ChangeLog
libgloss/or1k/sbrk.c

index 6b3fe3c4e00ed95ce9481ea5f6dd10dd5a42c5f5..c05f12d06515eabae368fccab32277eaa44c1f17 100644 (file)
@@ -1,3 +1,7 @@
+2015-05-26  Stefan Wallentowitz  <stefan.wallentowitz@tum.de>
+
+       * or1k/sbrk.c: Allow for different heap start
+
 2015-05-26  Stefan Wallentowitz  <stefan.wallentowitz@tum.de>
 
        * or1k/or1k_uart.c: Fix interrupts
index de80663eef8f0b9313fd750b941a42b4c7d049bf..5bd7044f70b35b9be4986097a38f023ab3cb5ed1 100644 (file)
 
 #include "include/or1k-support.h"
 
+extern uint32_t        end; /* Set by linker.  */
+uint32_t _or1k_heap_start = &end;
 static uint32_t _or1k_heap_end;
 
 void *
 _sbrk_r (struct _reent * reent, ptrdiff_t incr)
 {
-       extern uint32_t end; /* Set by linker.  */
        uint32_t        prev_heap_end;
 
        // This needs to be atomic
@@ -34,7 +35,7 @@ _sbrk_r (struct _reent * reent, ptrdiff_t incr)
        uint32_t sr_tee = or1k_timer_disable();
 
        // Initialize heap end to end if not initialized before
-       or1k_sync_cas((void*) &_or1k_heap_end, 0, (uint32_t) &end);
+       or1k_sync_cas((void*) &_or1k_heap_end, 0, (uint32_t) _or1k_heap_start);
 
        do {
                // Read previous heap end
This page took 0.038726 seconds and 5 git commands to generate.