4 #include "sys/syscall.h"
7 extern int _write (int, char *, int);
12 extern char heap_start
[]; /* Defined by the linker script. */
13 static char * heap_end
= NULL
;
15 char * sp
= (char *) & sp
;
18 heap_end
= heap_start
;
20 prev_heap_end
= heap_end
;
22 if (heap_end
+ incr
> sp
)
24 #define MESSAGE "Heap and stack collision\n"
25 _write (1, MESSAGE
, sizeof MESSAGE
);
31 return (caddr_t
) prev_heap_end
;