c0c762e419
Gina Verlekar <gina.verlekar@kpitcummins.com> Moving files from libc/sys/sysnecv850 to libgloss/v850 * libgloss/libnosys/configure: Regenerated. * libgloss/libnosys/configure.in: Compact v850 support to v850*-*-*. * libgloss/libnosys/configure: Regenerated. * libgloss/configure.in: Add libgloss support for v850. * libgloss/configure: Regenerated. * libgloss/v850/access.c: New file. * libgloss/v850/aclocal.m4: New. * libgloss/v850/chmod.c: New. * libgloss/v850/chown.c: New. * libgloss/v850/close.c: New. * libgloss/v850/configure: New. * libgloss/v850/configure.in: New. * libgloss/v850/crt0.S: New. * libgloss/v850/crt1.c: New. * libgloss/v850/execv.c: New. * libgloss/v850/execve.c: New. * libgloss/v850/_exit.c: New. * libgloss/v850/fork.c: New. * libgloss/v850/fstat.c: New. * libgloss/v850/getpid.c: New. * libgloss/v850/gettime.c: New. * libgloss/v850/isatty.c: New. * libgloss/v850/kill.c: New. * libgloss/v850/link.c: New. * libgloss/v850/lseek.c: New. * libgloss/v850/Makefile.in: New. * libgloss/v850/open.c: New. * libgloss/v850/pipe.c: New. * libgloss/v850/read.c: New. * libgloss/v850/sbrk.c: New. * libgloss/v850/sim.ld: New. * libgloss/v850/stat.c: New. * libgloss/v850/time.c: New. * libgloss/v850/times.c: New. * libgloss/v850/trap.S: New. * libgloss/v850/unlink.c: New. * libgloss/v850/utime.c: New. * libgloss/v850/wait.c: New. * libgloss/v850/write.c: New.
37 lines
678 B
C
37 lines
678 B
C
#include <_ansi.h>
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include "sys/syscall.h"
|
|
|
|
int errno;
|
|
|
|
int __trap0 (int function, int p1, int p2, int p3);
|
|
|
|
#define TRAP0(f, p1, p2, p3) __trap0(f, (int)(p1), (int)(p2), (int)(p3))
|
|
|
|
caddr_t
|
|
_sbrk (int incr)
|
|
{
|
|
extern char end; /* Defined by the linker */
|
|
static char *heap_end;
|
|
char *prev_heap_end;
|
|
#if 0
|
|
char *sp = (char *)stack_ptr;
|
|
#else
|
|
char *sp = (char *)&sp;
|
|
#endif
|
|
|
|
if (heap_end == 0)
|
|
{
|
|
heap_end = &end;
|
|
}
|
|
prev_heap_end = heap_end;
|
|
if (heap_end + incr > sp)
|
|
{
|
|
_write (1, "Heap and stack collision\n", 25);
|
|
abort ();
|
|
}
|
|
heap_end += incr;
|
|
return (caddr_t) prev_heap_end;
|
|
}
|