* arm/crt0.S: Initialise __heap_limit when ARM_RDI_MONITOR is defined.
* arm/syscalls.c: define __heap_limit global symbol. * arm/syscalls.c (_sbrk): Honour __heap_limit.
This commit is contained in:
parent
72ba8b107a
commit
8d98f956cc
|
@ -1,3 +1,9 @@
|
||||||
|
2015-02-17 Renlin Li <renlin.li@arm.com>
|
||||||
|
|
||||||
|
* arm/crt0.S: Initialise __heap_limit when ARM_RDI_MONITOR is defined.
|
||||||
|
* arm/syscalls.c: define __heap_limit global symbol.
|
||||||
|
* arm/syscalls.c (_sbrk): Honour __heap_limit.
|
||||||
|
|
||||||
2015-02-11 Stefan Wallentowitz <stefan.wallentowitz@tum.de>
|
2015-02-11 Stefan Wallentowitz <stefan.wallentowitz@tum.de>
|
||||||
|
|
||||||
* or1k/or1k_uart.c: Write bugfix and cleanup/documentation.
|
* or1k/or1k_uart.c: Write bugfix and cleanup/documentation.
|
||||||
|
|
|
@ -123,6 +123,11 @@
|
||||||
#endif
|
#endif
|
||||||
ldr r0, .LC0 /* point at values read */
|
ldr r0, .LC0 /* point at values read */
|
||||||
|
|
||||||
|
/* Set __heap_limit. */
|
||||||
|
ldr r1, [r0, #4]
|
||||||
|
ldr r2, =__heap_limit
|
||||||
|
str r1, [r2]
|
||||||
|
|
||||||
ldr r1, [r0, #0]
|
ldr r1, [r0, #0]
|
||||||
cmp r1, #0
|
cmp r1, #0
|
||||||
bne .LC32
|
bne .LC32
|
||||||
|
|
|
@ -587,6 +587,9 @@ _getpid (int n __attribute__ ((unused)))
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Heap limit returned from SYS_HEAPINFO Angel semihost call. */
|
||||||
|
uint __heap_limit = 0xcafedead;
|
||||||
|
|
||||||
caddr_t __attribute__((weak))
|
caddr_t __attribute__((weak))
|
||||||
_sbrk (int incr)
|
_sbrk (int incr)
|
||||||
{
|
{
|
||||||
|
@ -599,7 +602,9 @@ _sbrk (int incr)
|
||||||
|
|
||||||
prev_heap_end = heap_end;
|
prev_heap_end = heap_end;
|
||||||
|
|
||||||
if (heap_end + incr > stack_ptr)
|
if ((heap_end + incr > stack_ptr)
|
||||||
|
/* Honour heap limit if it's valid. */
|
||||||
|
|| (__heap_limit != 0xcafedead && heap_end + incr > __heap_limit))
|
||||||
{
|
{
|
||||||
/* Some of the libstdc++-v3 tests rely upon detecting
|
/* Some of the libstdc++-v3 tests rely upon detecting
|
||||||
out of memory errors, so do not abort here. */
|
out of memory errors, so do not abort here. */
|
||||||
|
|
Loading…
Reference in New Issue