summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-01-29 19:08:02 +0000
committerGitHub <noreply@github.com>2019-01-29 19:08:02 +0000
commit9788f625d21ab5a7027f90283cf52cc398834580 (patch)
tree27eddfadf4714ef761ab1bc91c56e83888a81ed0 /bsp
parentc5846a3635ba160d39a620e527d2ec4715b1c59a (diff)
parent15bb22f7ed93038a2e7256726b27bf0e45cb4dfe (diff)
Merge pull request #162 from sifive/heap-improvements
Improvements to dynamic memory allocation
Diffstat (limited to 'bsp')
-rw-r--r--bsp/coreip-e31-arty/mee.lds19
-rw-r--r--bsp/coreip-e31/mee.lds16
-rw-r--r--bsp/coreip-s51-arty/mee.lds19
-rw-r--r--bsp/coreip-s51/mee.lds16
-rw-r--r--bsp/freedom-e310-arty/mee.lds19
-rw-r--r--bsp/sifive-hifive1/mee.lds19
6 files changed, 80 insertions, 28 deletions
diff --git a/bsp/coreip-e31-arty/mee.lds b/bsp/coreip-e31-arty/mee.lds
index c081d9f..7b28478 100644
--- a/bsp/coreip-e31-arty/mee.lds
+++ b/bsp/coreip-e31-arty/mee.lds
@@ -20,7 +20,8 @@ PHDRS
SECTIONS
{
- __stack_size = DEFINED(__stack_size) ? __stack_size : 0x800;
+ __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400;
+ __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400;
.init :
@@ -200,18 +201,26 @@ SECTIONS
PROVIDE( _end = . );
PROVIDE( end = . );
PROVIDE( mee_segment_bss_target_end = . );
- PROVIDE( mee_segment_heap_target_start = . );
- .stack ORIGIN(ram) + LENGTH(ram) - __stack_size :
+ .stack :
{
- PROVIDE( mee_segment_heap_target_end = . );
- PROVIDE( _heap_end = . );
+ PROVIDE(mee_segment_stack_begin = .);
. = __stack_size;
PROVIDE( _sp = . );
PROVIDE(mee_segment_stack_end = .);
} >ram AT>ram :ram
+ .heap :
+ {
+ PROVIDE( mee_segment_heap_target_start = . );
+ . = __heap_size;
+ . = __heap_size == 0 ? 0 : ORIGIN(ram) + LENGTH(ram);
+ PROVIDE( mee_segment_heap_target_end = . );
+ PROVIDE( _heap_end = . );
+ } >ram AT>ram :ram
+
+
}
diff --git a/bsp/coreip-e31/mee.lds b/bsp/coreip-e31/mee.lds
index 538291d..08c0ccf 100644
--- a/bsp/coreip-e31/mee.lds
+++ b/bsp/coreip-e31/mee.lds
@@ -20,6 +20,7 @@ PHDRS
SECTIONS
{
__stack_size = DEFINED(__stack_size) ? __stack_size : 0x400;
+ __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400;
.init :
@@ -199,18 +200,25 @@ SECTIONS
PROVIDE( _end = . );
PROVIDE( end = . );
PROVIDE( mee_segment_bss_target_end = . );
- PROVIDE( mee_segment_heap_target_start = . );
.stack :
{
- . = ALIGN(8);
- . += __stack_size;
+ PROVIDE(mee_segment_stack_begin = .);
+ . = __stack_size;
PROVIDE( _sp = . );
- PROVIDE( _heap_end = . );
PROVIDE(mee_segment_stack_end = .);
} >ram AT>ram :ram
+ .heap :
+ {
+ PROVIDE( mee_segment_heap_target_start = . );
+ . = __heap_size;
+ PROVIDE( mee_segment_heap_target_end = . );
+ PROVIDE( _heap_end = . );
+ } >ram AT>ram :ram
+
+
}
diff --git a/bsp/coreip-s51-arty/mee.lds b/bsp/coreip-s51-arty/mee.lds
index c081d9f..7b28478 100644
--- a/bsp/coreip-s51-arty/mee.lds
+++ b/bsp/coreip-s51-arty/mee.lds
@@ -20,7 +20,8 @@ PHDRS
SECTIONS
{
- __stack_size = DEFINED(__stack_size) ? __stack_size : 0x800;
+ __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400;
+ __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400;
.init :
@@ -200,18 +201,26 @@ SECTIONS
PROVIDE( _end = . );
PROVIDE( end = . );
PROVIDE( mee_segment_bss_target_end = . );
- PROVIDE( mee_segment_heap_target_start = . );
- .stack ORIGIN(ram) + LENGTH(ram) - __stack_size :
+ .stack :
{
- PROVIDE( mee_segment_heap_target_end = . );
- PROVIDE( _heap_end = . );
+ PROVIDE(mee_segment_stack_begin = .);
. = __stack_size;
PROVIDE( _sp = . );
PROVIDE(mee_segment_stack_end = .);
} >ram AT>ram :ram
+ .heap :
+ {
+ PROVIDE( mee_segment_heap_target_start = . );
+ . = __heap_size;
+ . = __heap_size == 0 ? 0 : ORIGIN(ram) + LENGTH(ram);
+ PROVIDE( mee_segment_heap_target_end = . );
+ PROVIDE( _heap_end = . );
+ } >ram AT>ram :ram
+
+
}
diff --git a/bsp/coreip-s51/mee.lds b/bsp/coreip-s51/mee.lds
index 3e454a7..2c2ba1c 100644
--- a/bsp/coreip-s51/mee.lds
+++ b/bsp/coreip-s51/mee.lds
@@ -20,6 +20,7 @@ PHDRS
SECTIONS
{
__stack_size = DEFINED(__stack_size) ? __stack_size : 0x400;
+ __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400;
.init :
@@ -199,18 +200,25 @@ SECTIONS
PROVIDE( _end = . );
PROVIDE( end = . );
PROVIDE( mee_segment_bss_target_end = . );
- PROVIDE( mee_segment_heap_target_start = . );
.stack :
{
- . = ALIGN(8);
- . += __stack_size;
+ PROVIDE(mee_segment_stack_begin = .);
+ . = __stack_size;
PROVIDE( _sp = . );
- PROVIDE( _heap_end = . );
PROVIDE(mee_segment_stack_end = .);
} >ram AT>ram :ram
+ .heap :
+ {
+ PROVIDE( mee_segment_heap_target_start = . );
+ . = __heap_size;
+ PROVIDE( mee_segment_heap_target_end = . );
+ PROVIDE( _heap_end = . );
+ } >ram AT>ram :ram
+
+
}
diff --git a/bsp/freedom-e310-arty/mee.lds b/bsp/freedom-e310-arty/mee.lds
index 8cd1a87..d5f73d5 100644
--- a/bsp/freedom-e310-arty/mee.lds
+++ b/bsp/freedom-e310-arty/mee.lds
@@ -20,7 +20,8 @@ PHDRS
SECTIONS
{
- __stack_size = DEFINED(__stack_size) ? __stack_size : 0x800;
+ __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400;
+ __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400;
.init :
@@ -200,18 +201,26 @@ SECTIONS
PROVIDE( _end = . );
PROVIDE( end = . );
PROVIDE( mee_segment_bss_target_end = . );
- PROVIDE( mee_segment_heap_target_start = . );
- .stack ORIGIN(ram) + LENGTH(ram) - __stack_size :
+ .stack :
{
- PROVIDE( mee_segment_heap_target_end = . );
- PROVIDE( _heap_end = . );
+ PROVIDE(mee_segment_stack_begin = .);
. = __stack_size;
PROVIDE( _sp = . );
PROVIDE(mee_segment_stack_end = .);
} >ram AT>ram :ram
+ .heap :
+ {
+ PROVIDE( mee_segment_heap_target_start = . );
+ . = __heap_size;
+ . = __heap_size == 0 ? 0 : ORIGIN(ram) + LENGTH(ram);
+ PROVIDE( mee_segment_heap_target_end = . );
+ PROVIDE( _heap_end = . );
+ } >ram AT>ram :ram
+
+
}
diff --git a/bsp/sifive-hifive1/mee.lds b/bsp/sifive-hifive1/mee.lds
index 0e0a302..1c894ee 100644
--- a/bsp/sifive-hifive1/mee.lds
+++ b/bsp/sifive-hifive1/mee.lds
@@ -19,7 +19,8 @@ PHDRS
SECTIONS
{
- __stack_size = DEFINED(__stack_size) ? __stack_size : 0x800;
+ __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400;
+ __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400;
.init :
@@ -199,18 +200,26 @@ SECTIONS
PROVIDE( _end = . );
PROVIDE( end = . );
PROVIDE( mee_segment_bss_target_end = . );
- PROVIDE( mee_segment_heap_target_start = . );
- .stack ORIGIN(ram) + LENGTH(ram) - __stack_size :
+ .stack :
{
- PROVIDE( mee_segment_heap_target_end = . );
- PROVIDE( _heap_end = . );
+ PROVIDE(mee_segment_stack_begin = .);
. = __stack_size;
PROVIDE( _sp = . );
PROVIDE(mee_segment_stack_end = .);
} >ram AT>ram :ram
+ .heap :
+ {
+ PROVIDE( mee_segment_heap_target_start = . );
+ . = __heap_size;
+ . = __heap_size == 0 ? 0 : ORIGIN(ram) + LENGTH(ram);
+ PROVIDE( mee_segment_heap_target_end = . );
+ PROVIDE( _heap_end = . );
+ } >ram AT>ram :ram
+
+
}