13 #include <sys/times.h> 23 #define MAX_STACK_SIZE 0x200 25 extern int __io_putchar(
int ch) __attribute__((weak));
26 extern int __io_getchar(
void) __attribute__((weak));
29 register char * stack_ptr
asm(
"sp");
35 caddr_t _sbrk(
int incr)
38 static char *heap_end;
39 char *prev_heap_end,*min_stack_ptr;
44 prev_heap_end = heap_end;
48 min_stack_ptr = (
char*)(*(
unsigned int *)*(
unsigned int *)0xE000ED08);
50 min_stack_ptr -= MAX_STACK_SIZE;
52 if (heap_end + incr > min_stack_ptr)
54 if (heap_end + incr > stack_ptr)
65 return (caddr_t) prev_heap_end;
71 int _gettimeofday (
struct timeval * tp,
struct timezone * tzp)
76 tzp->tz_minuteswest = 0;
82 void initialise_monitor_handles()
91 int _kill(
int pid,
int sig)
97 void _exit (
int status)
103 int _write(
int file,
char *ptr,
int len)
107 for (DataIdx = 0; DataIdx < len; DataIdx++)
109 __io_putchar( *ptr++ );
119 int _fstat(
int file,
struct stat *st)
121 st->st_mode = S_IFCHR;
125 int _isatty(
int file)
130 int _lseek(
int file,
int ptr,
int dir)
135 int _read(
int file,
char *ptr,
int len)
138 *ptr = __io_getchar();
142 int _open(
char *path,
int flags, ...)
148 int _wait(
int *status)
154 int _unlink(
char *name)
160 int _times(
struct tms *buf)
165 int _stat(
char *file,
struct stat *st)
167 st->st_mode = S_IFCHR;
171 int _link(
char *old,
char *
new)
183 int _execve(
char *name,
char **argv,
char **env)