diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2015-05-26 15:28:31 -0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-05-27 13:30:20 +0200 |
commit | 58efeedd1670555d4eadf23309122fd6aa64c9b2 (patch) | |
tree | 4c9c18d4368c6f2a904acc00a5ebce9b5163c1f5 /libgloss | |
parent | aa26b784620268135cab52d77ffb39129cd1fb1f (diff) | |
download | newlib-58efeedd1670555d4eadf23309122fd6aa64c9b2.zip newlib-58efeedd1670555d4eadf23309122fd6aa64c9b2.tar.gz newlib-58efeedd1670555d4eadf23309122fd6aa64c9b2.tar.bz2 |
or1k: Make heap start configurable
- 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
Diffstat (limited to 'libgloss')
-rw-r--r-- | libgloss/ChangeLog | 4 | ||||
-rw-r--r-- | libgloss/or1k/sbrk.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 6b3fe3c..c05f12d 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,5 +1,9 @@ 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 2015-05-26 Stefan Wallentowitz <stefan.wallentowitz@tum.de> diff --git a/libgloss/or1k/sbrk.c b/libgloss/or1k/sbrk.c index de80663..5bd7044 100644 --- a/libgloss/or1k/sbrk.c +++ b/libgloss/or1k/sbrk.c @@ -19,12 +19,13 @@ #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 |