[an error occurred while processing this directive]
|
Вот реализация sbrk :
#define HEAP_LIMIT 0x40008000
caddr_t sbrk (int incr) {
extern char end asm ("end"); /* Defined by the linker */
static char * heap_end;
char * prev_heap_end;
if (heap_end == NULL) heap_end = &end;
prev_heap_end = heap_end;
if (heap_end + incr >= (char *)HEAP_LIMIT) {
abort (); /* Out of Memory */
}
heap_end += incr;
return (caddr_t) prev_heap_end;
}
Стек располагается:
.equ Top_Stack, 0x40004000
.equ UND_Stack_Size, 0x00000004
.equ SVC_Stack_Size, 0x00000004
.equ ABT_Stack_Size, 0x00000004
.equ FIQ_Stack_Size, 0x00000004
.equ IRQ_Stack_Size, 0x00000080
.equ USR_Stack_Size, 0x00000400
Расскажите, пожалуйста подробнее про символ 'end'. Как его проверить, посмотреть где он определен?
E-mail: info@telesys.ru