mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/lpc2387: hook up extra memory sections as heap
This enables the USB, Ethernet and Backup memory regions to be used as heap memory.
This commit is contained in:
parent
2ed0dd7405
commit
24ed1bbb70
@ -83,6 +83,12 @@ extern unsigned __stack_irq_size;
|
||||
#define ISR_STACKSIZE ((unsigned) &__stack_irq_size)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief The CPU has 4 blocks of SRAM at different addresses.
|
||||
* (primary RAM, USB RAM, Ethernet RAM & Backup RAM)
|
||||
*/
|
||||
#define NUM_HEAPS (4)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -175,10 +175,10 @@ SECTIONS
|
||||
_sram = ORIGIN(ram);
|
||||
_eram = ORIGIN(ram) + LENGTH(ram);
|
||||
|
||||
__heap2_size = LENGTH(ram_ethernet);
|
||||
.heap2 (NOLOAD) :
|
||||
.heap1 ALIGN(4) (NOLOAD) :
|
||||
{
|
||||
PROVIDE(__heap2_start = . );
|
||||
_sheap1 = ORIGIN(ram_ethernet);
|
||||
_eheap1 = ORIGIN(ram_ethernet) + LENGTH(ram_ethernet);
|
||||
} > ram_ethernet
|
||||
|
||||
. = ORIGIN(ram_usb);
|
||||
@ -187,12 +187,11 @@ SECTIONS
|
||||
*(.usbdata)
|
||||
} > ram_usb
|
||||
|
||||
.heap3 ALIGN(0x1000) (NOLOAD) :
|
||||
.heap2 ALIGN(4) (NOLOAD) :
|
||||
{
|
||||
__heap3_size = ORIGIN(ram_usb) + LENGTH(ram_usb) - ABSOLUTE(.);
|
||||
PROVIDE(__heap3_start = . );
|
||||
_sheap2 = . ;
|
||||
_eheap2 = ORIGIN(ram_usb) + LENGTH(ram_usb);
|
||||
} > ram_usb
|
||||
__heap_size = SIZEOF(.heap3);
|
||||
|
||||
_sbackup_data_load = LOADADDR(.backup.data);
|
||||
.backup.data : ALIGN(4) {
|
||||
@ -210,4 +209,9 @@ SECTIONS
|
||||
/* Round size so that we can use 4 byte copy in init */
|
||||
. = ALIGN(4);
|
||||
} > ram_battery
|
||||
|
||||
.heap3 (NOLOAD) : ALIGN(4) {
|
||||
_sheap3 = . ;
|
||||
_eheap3 = ORIGIN(ram_battery) + LENGTH(ram_battery);
|
||||
} > ram_battery
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user