2010-07-23 Naveen.H.S <naveenh1@kpitcummins.com>

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.
This commit is contained in:
Jeff Johnston 2010-07-23 17:52:37 +00:00
parent e3d36b30b4
commit c0c762e419
40 changed files with 7755 additions and 1581 deletions

View File

@ -1,3 +1,48 @@
2010-07-23 Naveen.H.S <naveenh1@kpitcummins.com>
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.
2010-07-19 Rafael Campos <methril@gmail.com>
* m68k/cf-crt1.c (hardware_init_hook): Accommodate new family

5
libgloss/configure vendored
View File

@ -725,6 +725,7 @@ mep
moxie
microblaze
mt
v850
xc16x
xstormy16
m32c
@ -2530,6 +2531,10 @@ case "${target}" in
subdirs="$subdirs mt"
;;
v850*-*-*)
subdirs="$subdirs v850"
;;
xc16x-*-*)
subdirs="$subdirs xc16x"

View File

@ -106,6 +106,9 @@ case "${target}" in
mt-*-*)
AC_CONFIG_SUBDIRS([mt])
;;
v850*-*-*)
AC_CONFIG_SUBDIRS([v850])
;;
xc16x-*-*)
AC_CONFIG_SUBDIRS([xc16x])
;;

File diff suppressed because it is too large Load Diff

View File

@ -81,11 +81,7 @@ case "${target}" in
;;
thumb-*-*)
;;
v850-*-*)
;;
v850e-*-*)
;;
v850ea-*-*)
v850*-*-*)
;;
w65-*-*)
;;

151
libgloss/v850/Makefile.in Normal file
View File

@ -0,0 +1,151 @@
# Copyright (c) 2002 Red Hat, Inc
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided
# that existing copyright notices are retained in all copies and that this
# notice is included verbatim in any distributions. No written agreement,
# license, or royalty fee is required for any of the authorized uses.
# Modifications to this software may be copyrighted by their authors
# and need not follow the licensing terms described here, provided that
# the new terms are clearly indicated on the first page of each file where
# they apply.
# Makefile for libgloss/frv. This is the board support
# code for the various frv targets.
DESTDIR =
VPATH = @srcdir@ @srcdir@/..
srcdir = @srcdir@
objdir = .
srcroot = $(srcdir)/../..
objroot = $(objdir)/../..
prefix = @prefix@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
target_alias = @target_alias@
bindir = @bindir@
libdir = @libdir@
tooldir = $(exec_prefix)/$(target_alias)
# Multilib support variables.
# TOP is used instead of MULTI{BUILD,SRC}TOP.
MULTIDIRS =
MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
SHELL = /bin/sh
CC = @CC@
AS = @AS@
AR = @AR@
LD = @LD@
RANLIB = @RANLIB@
AR_FLAGS = rc
OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
then echo ${objroot}/../binutils/objdump ; \
else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
then echo ${objroot}/../binutils/objcopy ; \
else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
CRT0 = crt0.o
SIM_BSP = libsim.a
SIM_OBJS = _exit.o \
access.o \
chmod.o \
chown.o \
close.o \
creat.o \
crt1.o \
execv.o \
execve.o \
fork.o \
fstat.o \
getpid.o \
gettime.o \
isatty.o \
kill.o \
link.o \
lseek.o \
open.o \
pipe.o \
read.o \
sbrk.o \
stat.o \
time.o \
times.o \
trap.o \
unlink.o \
utime.o \
wait.o \
write.o
#### Host specific Makefile fragment comes in here.
@host_makefile_frag@
all: $(CRT0) $(SIM_BSP)
$(SIM_BSP): $(SIM_OBJS)
$(AR) $(ARFLAGS) $@ $?
$(RANLIB) $@
_exit.o: $(srcdir)/_exit.c
access.o: $(srcdir)/access.c
chmod.o: $(srcdir)/chmod.c
chown.o: $(srcdir)/chown.c
close.o: $(srcdir)/close.c
creat.o: $(srcdir)/creat.c
crt1.o: $(srcdir)/crt1.c
execv.o: $(srcdir)/execv.c
execve.o: $(srcdir)/execve.c
fork.o: $(srcdir)/fork.c
fstat.o: $(srcdir)/fstat.c
getpid.o: $(srcdir)/getpid.c
gettime.o: $(srcdir)/gettime.c
isatty.o: $(srcdir)/isatty.c
kill.o: $(srcdir)/kill.c
link.o: $(srcdir)/link.c
lseek.o: $(srcdir)/lseek.c
open.o: $(srcdir)/open.c
pipe.o: $(srcdir)/pipe.c
read.o: $(srcdir)/read.c
sbrk.o: $(srcdir)/sbrk.c
stat.o: $(srcdir)/stat.c
time.o: $(srcdir)/time.c
times.o: $(srcdir)/times.c
trap.o: $(srcdir)/trap.S
unlink.o: $(srcdir)/unlink.c
utime.o: $(srcdir)/utime.c
wait.o: $(srcdir)/wait.c
write.o: $(srcdir)/write.c
install: $($(CPU)_INSTALL)
$(INSTALL_DATA) $(CRT0) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(CRT0)
$(INSTALL_DATA) $(SIM_BSP) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(SIM_BSP)
clean mostlyclean:
rm -f *.o *.a
distclean maintainer-clean realclean: clean
rm -f Makefile config.cache config.log config.status
.PHONY: info dvi doc install-info clean-info
info doc dvi:
install-info:
clean-info:
Makefile: Makefile.in config.status @host_makefile_frag_path@
$(SHELL) config.status
config.status: configure
$(SHELL) config.status --recheck

34
libgloss/v850/_exit.c Normal file
View File

@ -0,0 +1,34 @@
#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))
static void _do_dtors()
{
/* The loop variable is static so that if a destructor calls exit,
and we return here, we simply continue with the next destructor. */
typedef void (*pfunc) ();
extern pfunc __dtors[];
extern pfunc __dtors_end[];
static pfunc *p = __dtors;
while (p < __dtors_end)
(*p++) ();
}
void _exit (n)
{
/* Destructors should be done earlier because they need to be done before the
files are closed, but here is better than nowhere (and this balances the
constructors done in crt1.c. */
_do_dtors();
TRAP0 (SYS_exit, n, 0, 0);
}

33
libgloss/v850/access.c Normal file
View File

@ -0,0 +1,33 @@
/* This is file ACCESS.C */
/*
* Copyright (C) 1993 DJ Delorie
* All rights reserved.
*
* Redistribution and use in source and binary forms is permitted
* provided that the above copyright notice and following paragraph are
* duplicated in all such forms.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
int access(const char *fn, int flags)
{
struct stat s;
if (stat(fn, &s))
return -1;
if (s.st_mode & S_IFDIR)
return 0;
if (flags & W_OK)
{
if (s.st_mode & S_IWRITE)
return 0;
return -1;
}
return 0;
}

404
libgloss/v850/aclocal.m4 vendored Normal file
View File

@ -0,0 +1,404 @@
# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 9
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 10
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], UPC, [depcc="$UPC" am_compiler_list=],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
am__universal=false
m4_case([$1], [CC],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac],
[CXX],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac])
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvisualcpp | msvcmsys)
# This compiler won't grok `-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
shift
for mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from `make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
m4_include([../acinclude.m4])

16
libgloss/v850/chmod.c Normal file
View File

@ -0,0 +1,16 @@
#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))
int
chmod (const char *path, mode_t mode)
{
return TRAP0 (SYS_chmod, path, mode, 0);
}

16
libgloss/v850/chown.c Normal file
View File

@ -0,0 +1,16 @@
#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))
int
chown (const char *path, short owner, short group)
{
return TRAP0 (SYS_chown, path, owner, group);
}

16
libgloss/v850/close.c Normal file
View File

@ -0,0 +1,16 @@
#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))
int
_close (int file)
{
return TRAP0 (SYS_close, file, 0, 0);
}

3975
libgloss/v850/configure vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,55 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(crt0.S)
if test "${enable_shared}" = "yes" ; then
echo "Shared libraries not supported for cross compiling, ignored"
fi
if test "$srcdir" = "." ; then
if test "${with_target_subdir}" != "." ; then
libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
else
libgloss_topdir="${srcdir}/${with_multisrctop}../.."
fi
else
libgloss_topdir="${srcdir}/../.."
fi
AC_CONFIG_AUX_DIR($libgloss_topdir)
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
AC_PROG_INSTALL
LIB_AC_PROG_CC
AS=${AS-as}
AC_SUBST(AS)
AR=${AR-ar}
AC_SUBST(AR)
LD=${LD-ld}
AC_SUBST(LD)
AC_PROG_RANLIB
LIB_AM_PROG_AS
host_makefile_frag=${srcdir}/../config/default.mh
dnl We have to assign the same value to other variables because autoconf
dnl doesn't provide a mechanism to substitute a replacement keyword with
dnl arbitrary data or pathnames.
dnl
host_makefile_frag_path=$host_makefile_frag
AC_SUBST(host_makefile_frag_path)
AC_SUBST_FILE(host_makefile_frag)
AC_CONFIG_FILES(Makefile,
. ${libgloss_topdir}/config-ml.in,
srcdir=${srcdir}
target=${target}
with_multisubdir=${with_multisubdir}
ac_configure_args="${ac_configure_args} --enable-multilib"
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
libgloss_topdir=${libgloss_topdir}
)
AC_OUTPUT

17
libgloss/v850/creat.c Normal file
View File

@ -0,0 +1,17 @@
#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))
int
creat (const char *path,
int mode)
{
return TRAP0 (SYS_creat, path, mode, 0);
}

72
libgloss/v850/crt0.S Normal file
View File

@ -0,0 +1,72 @@
# NEC V850 startup code
.section .text
.global _start
_start:
#if defined(__v850e__) || defined(__v850e2__) || defined(__v850e2v3__)
movea 255, r0, r20
mov 65535, r21
mov hilo(_stack), sp
mov hilo(__ep), ep
mov hilo(__gp), gp
mov hilo(__ctbp), r6
ldsr r6, ctbp
mov hilo(_edata), r6
mov hilo(_end), r7
.L0:
st.w r0, 0[r6]
addi 4, r6, r6
cmp r7, r6
bl .L0
.L1:
jarl ___main, r31
addi -16, sp, sp
mov 0, r6
mov 0, r7
mov 0, r8
jarl _main, r31
mov r10, r6
jarl _exit, r31
# else
movea 255, r0, r20
mov r0, r21
ori 65535, r0, r21
movhi hi(_stack), r0, sp
movea lo(_stack), sp, sp
movhi hi(__ep), r0, ep
movea lo(__ep), ep, ep
movhi hi(__gp), r0, gp
movea lo(__gp), gp, gp
movhi hi(_edata), r0, r6
movea lo(_edata), r6, r6
movhi hi(_end), r0, r7
movea lo(_end), r7, r7
.L0:
st.b r0, 0[r6]
addi 1, r6, r6
cmp r7, r6
bl .L0
.L1:
jarl ___main, r31
addi -16, sp, sp
mov 0, r6
mov 0, r7
mov 0, r8
jarl _main, r31
mov r10, r6
jarl _exit, r31
# endif
.section .stack
_stack: .long 1
.section .data
.global ___dso_handle
.weak ___dso_handle
___dso_handle:
.long 0

16
libgloss/v850/crt1.c Normal file
View File

@ -0,0 +1,16 @@
void __main ()
{
static int initialized;
if (! initialized)
{
typedef void (*pfunc) ();
extern pfunc __ctors[];
extern pfunc __ctors_end[];
pfunc *p;
initialized = 1;
for (p = __ctors_end; p > __ctors; )
(*--p) ();
}
}

16
libgloss/v850/execv.c Normal file
View File

@ -0,0 +1,16 @@
#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))
int
execv (const char *path, char *const argv[])
{
return TRAP0 (SYS_execv, path, argv, 0);
}

16
libgloss/v850/execve.c Normal file
View File

@ -0,0 +1,16 @@
#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))
int
_execve (const char *path, char *const argv[], char *const envp[])
{
return TRAP0 (SYS_execve, path, argv, envp);
}

16
libgloss/v850/fork.c Normal file
View File

@ -0,0 +1,16 @@
#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))
int
_fork ()
{
return TRAP0 (SYS_fork, 0, 0, 0);
}

18
libgloss/v850/fstat.c Normal file
View File

@ -0,0 +1,18 @@
#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))
int
_fstat (int file,
struct stat *st)
{
st->st_mode = S_IFCHR;
return 0;
}

15
libgloss/v850/getpid.c Normal file
View File

@ -0,0 +1,15 @@
#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))
_getpid (n)
{
return 1;
}

17
libgloss/v850/gettime.c Normal file
View File

@ -0,0 +1,17 @@
#include <_ansi.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "sys/syscall.h"
#include "sys/time.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))
int
_gettimeofday (struct timeval *tp, void *tzp)
{
return TRAP0 (SYS_gettimeofday, tp, tzp, 0);
}

16
libgloss/v850/isatty.c Normal file
View File

@ -0,0 +1,16 @@
#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))
_isatty (fd)
int fd;
{
return 1;
}

19
libgloss/v850/kill.c Normal file
View File

@ -0,0 +1,19 @@
#include <_ansi.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "sys/syscall.h"
#include <reent.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))
_kill (pid, sig)
pid_t pid;
int sig;
{
return TRAP0 (SYS_exit, 0xdead0000 | sig, 0, 0);
}

16
libgloss/v850/link.c Normal file
View File

@ -0,0 +1,16 @@
#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))
int
_link ()
{
return -1;
}

18
libgloss/v850/lseek.c Normal file
View File

@ -0,0 +1,18 @@
#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))
int
_lseek (int file,
int ptr,
int dir)
{
return TRAP0 (SYS_lseek, file, ptr, dir);
}

17
libgloss/v850/open.c Normal file
View File

@ -0,0 +1,17 @@
#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))
int
_open (const char *path,
int flags)
{
return TRAP0 (SYS_open, path, flags, 0);
}

16
libgloss/v850/pipe.c Normal file
View File

@ -0,0 +1,16 @@
#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))
int
pipe (int *fd)
{
return TRAP0 (SYS_pipe, fd, 0, 0);
}

17
libgloss/v850/read.c Normal file
View File

@ -0,0 +1,17 @@
#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))
_read (int file,
char *ptr,
int len)
{
return TRAP0 (SYS_read, file, ptr, len);
}

36
libgloss/v850/sbrk.c Normal file
View File

@ -0,0 +1,36 @@
#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;
}

201
libgloss/v850/sim.ld Normal file
View File

@ -0,0 +1,201 @@
/* Default linker script, for normal executables */
OUTPUT_FORMAT("elf32-v850", "elf32-v850",
"elf32-v850")
OUTPUT_ARCH(v850)
ENTRY(_start)
GROUP(-lc -lsim -lgcc)
SEARCH_DIR(.);
EXTERN(__ctbp __ep __gp);
SECTIONS
{
/* This saves a little space in the ELF file, since the zda starts
at a higher location that the ELF headers take up. */
.zdata 0x160 :
{
*(.zdata)
*(.zbss)
*(reszdata)
*(.zcommon)
}
/* This is the read only part of the zero data area.
Having it as a seperate section prevents its
attributes from being inherited by the zdata
section. Specifically it prevents the zdata
section from being marked READONLY. */
.rozdata ALIGN (4) :
{
*(.rozdata)
*(romzdata)
*(romzbss)
}
/* Read-only sections, merged into text segment. */
. = 0x100000;
.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.rel.text : { *(.rel.text) }
.rela.text : { *(.rela.text) }
.rel.data : { *(.rel.data) }
.rela.data : { *(.rela.data) }
.rel.rodata : { *(.rel.rodata) }
.rela.rodata : { *(.rela.rodata) }
.rel.gcc_except_table : { *(.rel.gcc_except_table) }
.rela.gcc_except_table : { *(.rela.gcc_except_table) }
.rel.got : { *(.rel.got) }
.rela.got : { *(.rela.got) }
.rel.ctors : { *(.rel.ctors) }
.rela.ctors : { *(.rela.ctors) }
.rel.dtors : { *(.rel.dtors) }
.rela.dtors : { *(.rela.dtors) }
.rel.init : { *(.rel.init) }
.rela.init : { *(.rela.init) }
.rel.fini : { *(.rel.fini) }
.rela.fini : { *(.rela.fini) }
.rel.bss : { *(.rel.bss) }
.rela.bss : { *(.rela.bss) }
.rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) }
.init : { KEEP (*(.init)) } =0
.plt : { *(.plt) }
.text :
{
*(.text)
*(.text.*)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.gnu.linkonce.t*)
} =0
_etext = .;
PROVIDE (etext = .);
/* This is special code area at the end of the normal text section.
It contains a small lookup table at the start followed by the
code pointed to by entries in the lookup table. */
.call_table_data ALIGN (4) :
{
PROVIDE(__ctbp = .);
*(.call_table_data)
} = 0xff /* Fill gaps with 0xff. */
.call_table_text :
{
*(.call_table_text)
}
.fini : { KEEP (*(.fini)) } =0
.rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) }
.rodata1 : { *(.rodata1) }
.data :
{
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
CONSTRUCTORS
}
.data1 : { *(.data1) }
.ctors :
{
___ctors = .;
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*crtend(.ctors))
___ctors_end = .;
}
.dtors :
{
___dtors = .;
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*crtend.o(.dtors))
___dtors_end = .;
}
.jcr :
{
KEEP (*(.jcr))
}
.gcc_except_table : { *(.gcc_except_table) }
.got : { *(.got.plt) *(.got) }
.dynamic : { *(.dynamic) }
.tdata ALIGN (4) :
{
PROVIDE (__ep = .);
*(.tbyte)
*(.tcommon_byte)
*(.tdata)
*(.tbss)
*(.tcommon)
}
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
.sdata ALIGN (4) :
{
PROVIDE (__gp = . + 0x8000);
*(.sdata)
}
/* See comment about .rozdata. */
.rosdata ALIGN (4) :
{
*(.rosdata)
}
/* We place the .sbss data section AFTER the .rosdata section, so that
it can directly preceed the .bss section. This allows runtime startup
code to initialise all the zero-data sections by simply taking the
value of '_edata' and zeroing until it reaches '_end'. */
.sbss :
{
__sbss_start = .;
*(.sbss)
*(.scommon)
}
_edata = DEFINED (__sbss_start) ? __sbss_start : . ;
PROVIDE (edata = _edata);
.bss :
{
__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;
__real_bss_start = . ;
*(.dynbss)
*(.bss)
*(COMMON)
}
_end = . ;
PROVIDE (end = .);
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions. */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* User stack. */
.stack 0x200000 :
{
__stack = .;
*(.stack)
}
}

17
libgloss/v850/stat.c Normal file
View File

@ -0,0 +1,17 @@
#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))
int
_stat (const char *path, struct stat *st)
{
return TRAP0 (SYS_stat, path, st, 0);
}

16
libgloss/v850/time.c Normal file
View File

@ -0,0 +1,16 @@
#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))
time_t
time (time_t *tloc)
{
return TRAP0 (SYS_time, tloc, 0, 0);
}

17
libgloss/v850/times.c Normal file
View File

@ -0,0 +1,17 @@
#include <_ansi.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "sys/syscall.h"
#include "sys/times.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))
clock_t
_times (struct tms *buffer)
{
return TRAP0 (SYS_times, buffer, 0, 0);
}

10
libgloss/v850/trap.S Normal file
View File

@ -0,0 +1,10 @@
.text
.global ___trap0
___trap0:
trap 31
tst r10,r10
bz .L0
movhi hi(_errno),r0,r6
st.w r10,lo(_errno)[r6]
.L0:
jmp [r31]

16
libgloss/v850/unlink.c Normal file
View File

@ -0,0 +1,16 @@
#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))
int
_unlink ()
{
return -1;
}

18
libgloss/v850/utime.c Normal file
View File

@ -0,0 +1,18 @@
#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))
int
utime (path, times)
const char *path;
char *times;
{
return TRAP0 (SYS_utime, path, times, 0);
}

17
libgloss/v850/wait.c Normal file
View File

@ -0,0 +1,17 @@
#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))
int
_wait (statusp)
int *statusp;
{
return TRAP0 (SYS_wait, 0, 0, 0);
}

18
libgloss/v850/write.c Normal file
View File

@ -0,0 +1,18 @@
#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))
int
_write ( int file,
char *ptr,
int len)
{
return TRAP0 (SYS_write, file, ptr, len);
}