mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[liba] Overridable pointer for heap start/end
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
include ion/src/device/boot/Makefile
|
||||
objs += $(addprefix ion/src/device/, init.o)
|
||||
objs += $(addprefix ion/src/device/, init.o heap.o)
|
||||
objs += $(addprefix ion/src/device/display/, display.o dma.o framebuffer.o gpio.o spi.o st7586.o)
|
||||
objs += $(addprefix ion/src/device/keyboard/, keyboard.o)
|
||||
|
||||
@@ -149,10 +149,10 @@ SECTIONS {
|
||||
} >SRAM
|
||||
|
||||
.heap : {
|
||||
_liba_heap_start = .;
|
||||
_heap_start = .;
|
||||
/* Note: We don't increment "." here, we set it. */
|
||||
. = (ORIGIN(SRAM) + LENGTH(SRAM) - FRAMEBUFFER_SIZE - STACK_SIZE);
|
||||
_liba_heap_end = .;
|
||||
_heap_end = .;
|
||||
} >SRAM
|
||||
|
||||
.framebuffer : {
|
||||
|
||||
5
ion/src/device/heap.c
Normal file
5
ion/src/device/heap.c
Normal file
@@ -0,0 +1,5 @@
|
||||
extern char _heap_start;
|
||||
extern char _heap_end;
|
||||
|
||||
char * _liba_heap_start = &_heap_start;
|
||||
char * _liba_heap_end = &_heap_end;
|
||||
@@ -2,8 +2,8 @@
|
||||
#include <string.h>
|
||||
#include <private/memconfig.h>
|
||||
|
||||
extern char _liba_heap_start;
|
||||
extern char _liba_heap_end;
|
||||
extern char * _liba_heap_start;
|
||||
extern char * _liba_heap_end;
|
||||
|
||||
heap_config_t HeapConfig = {
|
||||
.nHeap = 0
|
||||
@@ -17,8 +17,8 @@ void * memsys5Realloc(void *pPrior, int nBytes);
|
||||
int memsys5Roundup(int n);
|
||||
|
||||
static void configure_heap() {
|
||||
HeapConfig.nHeap = (&_liba_heap_end - &_liba_heap_start);
|
||||
HeapConfig.pHeap = &_liba_heap_start;
|
||||
HeapConfig.nHeap = (_liba_heap_end - _liba_heap_start);
|
||||
HeapConfig.pHeap = _liba_heap_start;
|
||||
HeapConfig.mnReq = 1;
|
||||
HeapConfig.bMemstat = 0;
|
||||
HeapConfig.xLog = 0;
|
||||
|
||||
Reference in New Issue
Block a user