From 4db0527c16502103e04c4091dbd803c55538b52f Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sun, 4 Sep 2022 18:08:36 +0200 Subject: read/write doeas not block when uart is disabled --- fw/fe310/bsp/gloss/sys_sbrk.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fw/fe310/bsp/gloss/sys_sbrk.c') diff --git a/fw/fe310/bsp/gloss/sys_sbrk.c b/fw/fe310/bsp/gloss/sys_sbrk.c index ce10c90..e789ec1 100644 --- a/fw/fe310/bsp/gloss/sys_sbrk.c +++ b/fw/fe310/bsp/gloss/sys_sbrk.c @@ -6,9 +6,9 @@ * about it. Note that there is no error checking anywhere in this file, users * will simply get the relevant error when actually trying to use the memory * that's been allocated. */ -extern char metal_segment_heap_target_start; -extern char metal_segment_heap_target_end; -static char *brk = &metal_segment_heap_target_start; +extern char __heap_start; +extern char __heap_end; +static char *brk = &__heap_start; int _brk(void *addr) @@ -23,12 +23,12 @@ _sbrk(ptrdiff_t incr) char *old = brk; /* If __heap_size == 0, we can't allocate memory on the heap */ - if(&metal_segment_heap_target_start == &metal_segment_heap_target_end) { + if(&__heap_start == &__heap_end) { return (void *)-1; } /* Don't move the break past the end of the heap */ - if ((brk + incr) <= &metal_segment_heap_target_end) { + if ((brk + incr) <= &__heap_end) { brk += incr; } else { return (void *)-1; -- cgit v1.2.3