mirror of https://github.com/ARMmbed/mbed-os.git
LPC2368 [GCC_ARM]: Fixed: Compilation and link errors in case "SD" example.
parent
b9d52bda50
commit
43acaa4166
|
@ -439,13 +439,20 @@ extern "C" int __end__;
|
||||||
#undef errno
|
#undef errno
|
||||||
extern "C" int errno;
|
extern "C" int errno;
|
||||||
|
|
||||||
|
// For ARM7 only
|
||||||
|
register unsigned char * stack_ptr __asm ("sp");
|
||||||
|
|
||||||
// Dynamic memory allocation related syscall.
|
// Dynamic memory allocation related syscall.
|
||||||
extern "C" caddr_t _sbrk(int incr) {
|
extern "C" caddr_t _sbrk(int incr) {
|
||||||
static unsigned char* heap = (unsigned char*)&__end__;
|
static unsigned char* heap = (unsigned char*)&__end__;
|
||||||
unsigned char* prev_heap = heap;
|
unsigned char* prev_heap = heap;
|
||||||
unsigned char* new_heap = heap + incr;
|
unsigned char* new_heap = heap + incr;
|
||||||
|
|
||||||
|
#ifdef __get_MSP
|
||||||
if (new_heap >= (unsigned char*)__get_MSP()) {
|
if (new_heap >= (unsigned char*)__get_MSP()) {
|
||||||
|
#else
|
||||||
|
if (new_heap >= stack_ptr) {
|
||||||
|
#endif
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
return (caddr_t)-1;
|
return (caddr_t)-1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,6 +143,7 @@ SECTIONS
|
||||||
. = ALIGN( 8 ) ;
|
. = ALIGN( 8 ) ;
|
||||||
__heap_start__ = . ;
|
__heap_start__ = . ;
|
||||||
end = . ;
|
end = . ;
|
||||||
|
__end__ = . ;
|
||||||
|
|
||||||
.stab 0 (NOLOAD) : { *(.stab) }
|
.stab 0 (NOLOAD) : { *(.stab) }
|
||||||
.stabstr 0 (NOLOAD) : { *(.stabstr) }
|
.stabstr 0 (NOLOAD) : { *(.stabstr) }
|
||||||
|
|
Loading…
Reference in New Issue