* COPYING.LIBGLOSS: Add Controls and Data Services copyright.

* COPYING.NEWLIB: Likewise.
libgloss/
	* configure.in: Add Visium support.
	* configure: Regenerate.
	* visium/: New directory.
newlib/
	* configure.host: Add Visium support.
	* libc/machine/configure.in: Likewise.
	* libc/machine/configure: Regenerate.
	* libc/machine/visium/: New directory.
	* libc/include/machine/setjmp.h (_JBLEN): Define for Visium.
	* libc/include/machine/ieeefp.h (__IEEE_BIG_ENDIAN): Likewise.
	* libc/include/machine/time.h (_CLOCKS_PER_SEC_): Likewise.
This commit is contained in:
Eric Botcazou 2015-01-21 18:27:47 +00:00
parent f485f16276
commit bf8f43ae8a
39 changed files with 12943 additions and 7 deletions

View File

@ -352,3 +352,31 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(18) - Rolls-Royce Controls and Data Services Limited (visium-* targets)
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -951,3 +951,30 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
(42) - Rolls-Royce Controls and Data Services Limited (visium-* targets)
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,3 +1,8 @@
2015-01-21 Eric Botcazou <ebotcazou@adacore.com>
* COPYING.LIBGLOSS: Add Controls and Data Services copyright.
* COPYING.NEWLIB: Likewise.
2014-12-16 Jeff Johnston <jjohnstn@redhat.com>
* config.sub: Merge from binutils.

View File

@ -1,3 +1,9 @@
2015-01-21 Eric Botcazou <ebotcazou@adacore.com>
* configure.in: Add Visium support.
* configure: Regenerate.
* visium/: New directory.
2015-01-15 DJ Delorie <dj@redhat.com>
* rl78/crt0.S: Initialize .saddr. Avoid using SEL.

6
libgloss/configure vendored
View File

@ -695,6 +695,7 @@ moxie
microblaze
mt
v850
visium
xc16x
xstormy16
m32c
@ -2516,6 +2517,11 @@ case "${target}" in
v850*-*-*)
subdirs="$subdirs v850"
;;
visium-*-*)
subdirs="$subdirs visium"
config_testsuite=false
;;
xc16x-*-*)
subdirs="$subdirs xc16x"

View File

@ -126,6 +126,10 @@ case "${target}" in
v850*-*-*)
AC_CONFIG_SUBDIRS([v850])
;;
visium-*-*)
AC_CONFIG_SUBDIRS([visium])
config_testsuite=false
;;
xc16x-*-*)
AC_CONFIG_SUBDIRS([xc16x])
;;

129
libgloss/visium/Makefile.in Normal file
View File

@ -0,0 +1,129 @@
# Copyright (c) 1998 Cygnus Support
#
# 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.
DESTDIR =
VPATH = @srcdir@
srcdir = @srcdir@
objdir = .
srcroot = $(srcdir)/../..
objroot = $(objdir)/../..
prefix = @prefix@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
target_alias = @target_alias@
program_transform_name = @program_transform_name@
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@
OBJDUMP = `t='$(program_transform_name)'; echo objdump | sed -e $$t`
OBJCOPY = `t='$(program_transform_name)'; echo objcopy | sed -e $$t`
# Generic object files common to some targets.
# These are LIBGLOSS stubs and minimal functionality in SBRK, READ and WRITE.
OBJS = close.o fstat.o getpid.o isatty.o kill.o lseek.o open.o \
print.o putnum.o read.o stat.o unlink.o write.o
# Object files specific to particular targets.
SERIALOBJS = ${OBJS} _exit.o gettod.o sbrk.o serial-inbyte.o serial-outbyte.o
# These go with the hosted file I/O libraries with a version of syscalls.
HOSTEDOBJS = getpid.o kill.o io-gdb.o io-stubs.o sbrk.o
SCRIPTS =
BSP = crt0.o libserial.a libsim.a libdebug.a
# Host specific makefile fragment comes in here.
@host_makefile_frag@
all: ${BSP}
#
# here's where we build the board support packages for each target
#
libserial.a: $(SERIALOBJS)
$(AR) $(ARFLAGS) $@ $^
$(RANLIB) $@
libsim.a: ${HOSTEDOBJS} sim-syscalls.o
${AR} ${ARFLAGS} $@ $^
${RANLIB} $@
libdebug.a: ${HOSTEDOBJS} debug-syscalls.o
${AR} ${ARFLAGS} $@ $^
${RANLIB} $@
sim-syscalls.o: syscalls.c syscall.h io.h
${CC} ${CFLAGS_FOR_TARGET} ${CFLAGS} -DTARGET_SIM -c -o $@ $<
debug-syscalls.o: syscalls.c syscall.h io.h
${CC} ${CFLAGS_FOR_TARGET} ${CFLAGS} -c -o $@ $<
$(OBJS): %.o: ../%.c
${CC} ${CFLAGS_FOR_TARGET} ${CFLAGS} -c -o $@ $<
doc:
clean mostlyclean:
rm -f a.out core *.i *~ *.o *-test *.srec *.dis *.map *.x
distclean maintainer-clean realclean: clean
rm -f Makefile config.status a.out
.PHONY: install info install-info clean-info
install:
@for bsp in ${BSP}; do\
$(INSTALL_DATA) $${bsp} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \
done
@for script in ${SCRIPTS}; do\
$(INSTALL_DATA) $(srcdir)/$${script}.ld $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$${script}.ld; \
done
info:
install-info:
clean-info:
# target specific makefile fragment comes in here.
@target_makefile_frag@
Makefile: Makefile.in config.status @host_makefile_frag_path@ @target_makefile_frag_path@
$(SHELL) config.status
config.status: configure
$(SHELL) config.status --recheck

41
libgloss/visium/_exit.c Normal file
View File

@ -0,0 +1,41 @@
/* _exit.c for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
void _exit (int) __attribute__ ((__noreturn__));
void
_exit (int code)
{
asm volatile ("stop 0,%0" : : "r" (code & 0xff));
/* Should never reach this point. Since this function is not supposed to
return, pretend to get stuck in a loop. */
while (1)
;
}

344
libgloss/visium/aclocal.m4 vendored Normal file
View File

@ -0,0 +1,344 @@
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 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.
# 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
# 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 7
# 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])
AC_SUBST([$1_FALSE])
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
# 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 8
# 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], 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
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
case $depmode in
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
;;
none) break ;;
esac
# 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.
if depmode=$depmode \
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} 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])
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 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 3
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[for mf in $CONFIG_FILES; 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.
# So let's grep whole file.
if grep '^#.*generated by automake' $mf > /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 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 3
# 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 done
.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
# We grep out `Entering directory' and `Leaving directory'
# messages which can occur if `w' ends up in MAKEFLAGS.
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
am__include=.include
am__quote="\""
_am_result=BSD
fi
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
m4_include([../acinclude.m4])

3145
libgloss/visium/configure vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,58 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(syscalls.c)
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)
target_makefile_frag_path=$target_makefile_frag
AC_SUBST(target_makefile_frag_path)
AC_SUBST_FILE(target_makefile_frag)
AC_SUBST(part_specific_obj)
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

88
libgloss/visium/crt0.S Normal file
View File

@ -0,0 +1,88 @@
/* crt0.S for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
.weak _get_cmdline
.text
.align 4
.global __start
__start:
/* Initialize the stack pointer. */
moviu r1,%u _estack
movil r1,%l _estack
move.l r23,r1
/* Terminate the frame chain. */
moviq r22,0
/* Zero the .bss segment. */
moviu r1,%u __bss_start
movil r1,%l __bss_start
moviu r2,%u __bss_end
movil r2,%l __bss_end
.L0:
cmp.l r1,r1
brr eq,.L1
nop
write.b (r1),r0
brr tr,.L0
addi r1,1
.L1:
/* Register __fini (destructors) with atexit. */
moviu r1,%u __fini
moviu r2,%u atexit
movil r2,%l atexit
bra tr,r2,r21
movil r1,%l __fini
/* Call __init (constructors). */
moviu r1,%u __init
movil r1,%l __init
bra tr,r1,r21
nop
/* Set up argc and argv. */
moviu r3,%u _get_cmdline
movil r3,%l _get_cmdline
cmp.l r3,r0
moviq r1,0
bra ne,r3,r21
moviq r2,0
/* Call the main program. */
moviu r3,%u main
movil r3,%l main
bra tr,r3,r21
nop
/* Call exit in case the main program didn't. */
moviu r2,%u exit
movil r2,%l exit
bra tr,r2,r21
nop
.end

45
libgloss/visium/gettod.c Normal file
View File

@ -0,0 +1,45 @@
/* stub functions for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
#include <sys/time.h>
#include <time.h>
#include <errno.h>
int gettimeofday (struct timeval *__p, void *__tz)
{
errno = ENOSYS;
return -1;
}
clock_t
clock (void)
{
errno = ENOSYS;
return (clock_t) -1;
}

140
libgloss/visium/io-gdb.c Normal file
View File

@ -0,0 +1,140 @@
/*
* hosted io support for GDB's remote fileio protocol
*
* Copyright (c) 2006 CodeSourcery 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.
*/
#include "io.h"
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
gdb_mode_t
__hosted_to_gdb_mode_t (mode_t m)
{
gdb_mode_t result = 0;
if (m & S_IFREG)
result |= GDB_S_IFREG;
if (m & S_IFDIR)
result |= GDB_S_IFDIR;
if (m & S_IRUSR)
result |= GDB_S_IRUSR;
if (m & S_IWUSR)
result |= GDB_S_IWUSR;
if (m & S_IXUSR)
result |= GDB_S_IXUSR;
if (m & S_IRGRP)
result |= GDB_S_IRGRP;
if (m & S_IWGRP)
result |= GDB_S_IWGRP;
if (m & S_IXGRP)
result |= GDB_S_IXGRP;
if (m & S_IROTH)
result |= GDB_S_IROTH;
if (m & S_IWOTH)
result |= GDB_S_IWOTH;
if (m & S_IXOTH)
result |= GDB_S_IXOTH;
return result;
}
int32_t
__hosted_to_gdb_open_flags (int f)
{
int32_t result = 0;
if (f & O_RDONLY)
result |= GDB_O_RDONLY;
if (f & O_WRONLY)
result |= GDB_O_WRONLY;
if (f & O_RDWR)
result |= GDB_O_RDWR;
if (f & O_APPEND)
result |= GDB_O_APPEND;
if (f & O_CREAT)
result |= GDB_O_CREAT;
if (f & O_TRUNC)
result |= GDB_O_TRUNC;
if (f & O_EXCL)
result |= GDB_O_EXCL;
return result;
}
int32_t
__hosted_to_gdb_lseek_flags (int f)
{
if (f == SEEK_CUR)
return GDB_SEEK_CUR;
else if (f == SEEK_END)
return GDB_SEEK_END;
else
return GDB_SEEK_SET;
}
void
__hosted_from_gdb_stat (const struct gdb_stat *gs,
struct stat *s)
{
s->st_dev = gs->st_dev;
s->st_ino = gs->st_ino;
s->st_mode = gs->st_mode;
s->st_nlink = gs->st_nlink;
s->st_uid = gs->st_uid;
s->st_gid = gs->st_gid;
s->st_rdev = gs->st_rdev;
s->st_size = gs->st_size;
s->st_blksize = gs->st_blksize;
s->st_blocks = gs->st_blocks;
s->st_atime = gs->st_atime;
s->st_mtime = gs->st_mtime;
s->st_ctime = gs->st_ctime;
}
void
__hosted_from_gdb_timeval (const struct gdb_timeval *gt,
struct timeval *t)
{
t->tv_sec = gt->tv_sec;
t->tv_usec = gt->tv_usec;
}
int
__hosted_from_gdb_errno (int32_t err)
{
switch (err)
{
case 0: return 0;
case GDB_EPERM: return EPERM;
case GDB_ENOENT: return ENOENT;
case GDB_EINTR: return EINTR;
case GDB_EBADF: return EBADF;
case GDB_EACCES: return EACCES;
case GDB_EFAULT: return EFAULT;
case GDB_EBUSY: return EBUSY;
case GDB_EEXIST: return EEXIST;
case GDB_ENODEV: return ENODEV;
case GDB_ENOTDIR: return ENOTDIR;
case GDB_EISDIR: return EISDIR;
case GDB_EINVAL: return EINVAL;
case GDB_ENFILE: return ENFILE;
case GDB_EMFILE: return EMFILE;
case GDB_EFBIG: return EFBIG;
case GDB_ENOSPC: return ENOSPC;
case GDB_ESPIPE: return ESPIPE;
case GDB_EROFS: return EROFS;
case GDB_ENAMETOOLONG: return ENAMETOOLONG;
case GDB_EUNKNOWN:
default:
return EIO;
}
}

180
libgloss/visium/io-stubs.c Normal file
View File

@ -0,0 +1,180 @@
/* I/O stub functions for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/times.h>
#include <fcntl.h>
#include <time.h>
#include <unistd.h>
#include <utime.h>
#include <errno.h>
struct DIR;
int
chdir (const char *path)
{
errno = ENOSYS;
return -1;
}
int
chmod (const char *path, mode_t mode)
{
errno = ENOSYS;
return -1;
}
int
closedir (struct DIR *dirp)
{
errno = ENOSYS;
return -1;
}
int
execv (const char *path, char *const argv[])
{
errno = ENOSYS;
return -1;
}
int
fcntl (int fd, int cmd, ...)
{
errno = ENOSYS;
return -1;
}
int
fork (void)
{
errno = EAGAIN;
return -1;
}
char *
getcwd (char *buf, size_t size)
{
buf[0] = 0;
return buf;
}
pid_t
getppid (void)
{
errno = ENOSYS;
return -1;
}
int
link (const char *old, const char *new)
{
errno = EMLINK;
return -1;
}
int
nanosleep (const struct timespec *requested_time,
struct timespec *remaining)
{
remaining->tv_sec = 0;
remaining->tv_nsec = 0;
return 0;
}
struct DIR *
opendir (const char *dirname)
{
errno = ENOSYS;
return NULL;
}
struct dirent *
readdir (struct DIR *dirp)
{
errno = ENOSYS;
return NULL;
}
ssize_t
readlink (const char *__path, char *__buf, size_t __buflen)
{
errno = ENOSYS;
return -1;
}
int
rmdir (const char *path)
{
errno = ENOSYS;
return -1;
}
int
symlink (const char *name1, const char *name2)
{
errno = ENOSYS;
return -1;
}
clock_t
times (struct tms *buf)
{
errno = ENOSYS;
return -1;
}
char *
ttyname (int fildes)
{
return "";
}
int
utime (const char *path, const struct utimbuf *times)
{
errno = ENOSYS;
return -1;
}
int
wait (int *status)
{
errno = ENOSYS;
return -1;
}
pid_t
waitpid (pid_t pid, int *stat_loc, int options)
{
errno = ENOSYS;
return -1;
}

141
libgloss/visium/io.h Normal file
View File

@ -0,0 +1,141 @@
/*
* hosted io support.
*
* Copyright (c) 2006 CodeSourcery 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.
*/
#include <stdint.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#define HOSTED_EXIT 0
#define HOSTED_INIT_SIM 1
#define HOSTED_OPEN 2
#define HOSTED_CLOSE 3
#define HOSTED_READ 4
#define HOSTED_WRITE 5
#define HOSTED_LSEEK 6
#define HOSTED_RENAME 7
#define HOSTED_UNLINK 8
#define HOSTED_STAT 9
#define HOSTED_FSTAT 10
#define HOSTED_GETTIMEOFDAY 11
#define HOSTED_ISATTY 12
#define HOSTED_SYSTEM 13
/* This function is provided by the board's BSP, because the precise
mechanism of informing gdb is board specific. */
extern int __io_hosted (int func, void *args);
/* Protocol specific representation of datatypes, as specified in D.9.11
* of the GDB manual.
* Note that since the m68k is big-endian, we can use native
* representations of integer datatypes in structured datatypes. */
typedef uint32_t gdb_mode_t;
typedef uint32_t gdb_time_t;
struct gdb_stat {
uint32_t st_dev; /* device */
uint32_t st_ino; /* inode */
gdb_mode_t st_mode; /* protection */
uint32_t st_nlink; /* number of hard links */
uint32_t st_uid; /* user ID of owner */
uint32_t st_gid; /* group ID of owner */
uint32_t st_rdev; /* device type (if inode device) */
uint64_t st_size; /* total size, in bytes */
uint64_t st_blksize; /* blocksize for filesystem I/O */
uint64_t st_blocks; /* number of blocks allocated */
gdb_time_t st_atime; /* time of last access */
gdb_time_t st_mtime; /* time of last modification */
gdb_time_t st_ctime; /* time of last change */
};
struct gdb_timeval {
gdb_time_t tv_sec; /* second */
uint64_t tv_usec; /* microsecond */
};
/* Parameters are passed between the library and the debugging stub
* in a fixed-size buffer.
*/
typedef uint32_t gdb_parambuf_t[4];
/* open flags */
#define GDB_O_RDONLY 0x0
#define GDB_O_WRONLY 0x1
#define GDB_O_RDWR 0x2
#define GDB_O_APPEND 0x8
#define GDB_O_CREAT 0x200
#define GDB_O_TRUNC 0x400
#define GDB_O_EXCL 0x800
/* mode_t values */
#define GDB_S_IFREG 0100000
#define GDB_S_IFDIR 040000
#define GDB_S_IRUSR 0400
#define GDB_S_IWUSR 0200
#define GDB_S_IXUSR 0100
#define GDB_S_IRGRP 040
#define GDB_S_IWGRP 020
#define GDB_S_IXGRP 010
#define GDB_S_IROTH 04
#define GDB_S_IWOTH 02
#define GDB_S_IXOTH 01
/* errno values */
#define GDB_EPERM 1
#define GDB_ENOENT 2
#define GDB_EINTR 4
#define GDB_EBADF 9
#define GDB_EACCES 13
#define GDB_EFAULT 14
#define GDB_EBUSY 16
#define GDB_EEXIST 17
#define GDB_ENODEV 19
#define GDB_ENOTDIR 20
#define GDB_EISDIR 21
#define GDB_EINVAL 22
#define GDB_ENFILE 23
#define GDB_EMFILE 24
#define GDB_EFBIG 27
#define GDB_ENOSPC 28
#define GDB_ESPIPE 29
#define GDB_EROFS 30
#define GDB_ENAMETOOLONG 91
#define GDB_EUNKNOWN 9999
/* lseek flags */
#define GDB_SEEK_SET 0
#define GDB_SEEK_CUR 1
#define GDB_SEEK_END 2
/* conversion functions */
extern gdb_mode_t __hosted_to_gdb_mode_t (mode_t m);
extern int32_t __hosted_to_gdb_open_flags (int f);
extern int32_t __hosted_to_gdb_lseek_flags (int f);
extern void __hosted_from_gdb_stat (const struct gdb_stat *gs,
struct stat *s);
extern void __hosted_from_gdb_timeval (const struct gdb_timeval *gt,
struct timeval *t);
extern int __hosted_from_gdb_errno (int32_t err);

56
libgloss/visium/sbrk.c Normal file
View File

@ -0,0 +1,56 @@
/* sbrk.c for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
#include <unistd.h>
#include <errno.h>
#include <string.h>
/* These labels are set in the linker script, to mark the start and end of the
memory reserved for the heap. */
extern unsigned char _sheap [];
extern unsigned char _eheap [];
void *
sbrk (ptrdiff_t nbytes)
{
static unsigned char *heap_ptr = _sheap;
if (0 <= nbytes && heap_ptr + nbytes < _eheap)
{
void *base = (void *)heap_ptr;
heap_ptr += nbytes;
memset (base, 0, nbytes);
return base;
}
errno = ENOMEM;
return (void *)-1;
}

View File

@ -0,0 +1,47 @@
/* Serial Input for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
char
inbyte (void)
{
#ifdef __VISIUM_ARCH_MCM__
volatile int *const rxdata = (int *) 0x20003920;
volatile int *const rxqs = (int *) 0x20003930;
#else
volatile int *const rxdata = (int *) 0x20001a20;
volatile int *const rxqs = (int *) 0x20001a30;
#endif
int bytes_in_fifo = 0;
while (!bytes_in_fifo)
bytes_in_fifo = *rxqs;
/* Read one character. */
return (*rxdata) & 0xff;
}

View File

@ -0,0 +1,39 @@
/* Serial Output for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
void
outbyte (char byte)
{
#ifdef __VISIUM_ARCH_MCM__
volatile int *const txadata = (int *) 0x2000391c;
#else
volatile int *const txadata = (int *) 0x20001a1c;
#endif
*txadata = byte;
}

48
libgloss/visium/syscall.h Normal file
View File

@ -0,0 +1,48 @@
/* syscall.h for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
#ifndef LIBGLOSS_SYSCALL_H
#define LIBGLOSS_SYSCALL_H
#define SYS_null 1
#define SYS_exit 2
#define SYS_open 3
#define SYS_close 4
#define SYS_read 5
#define SYS_write 6
#define SYS_lseek 7
#define SYS_rename 8
#define SYS_unlink 9
#define SYS_fstat 10
#define SYS_stat 11
#define SYS_gettimeofday 12
#define SYS_isatty 13
#define SYS_system 14
#endif

341
libgloss/visium/syscalls.c Normal file
View File

@ -0,0 +1,341 @@
/* system calls for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <stdarg.h>
#include <string.h>
#include "io.h"
#include "syscall.h"
#ifdef TARGET_SIM
struct file_register2
{
unsigned action;
unsigned p1, p2, p3, p4;
unsigned error;
unsigned retval;
};
extern struct file_register2 _sim_fileio_register;
static volatile struct file_register2 *const fileio = &_sim_fileio_register;
static int
do_syscall (unsigned action, unsigned p1, unsigned p2,
unsigned p3, unsigned p4, int *error)
{
fileio->p1 = p1;
fileio->p2 = p2;
fileio->p3 = p3;
fileio->p4 = p4;
fileio->action = action;
*error = (int) fileio->error;
return (int) fileio->retval;
}
#else
static int
do_syscall (unsigned action, unsigned p1, unsigned p2,
unsigned p3, unsigned p4, int *error)
{
int ret;
int err;
/* There is a two instruction delay after the software interrupt is
initiated, to allow it to take effect. */
asm volatile ("\n\
move.l r1,%3\n\
move.l r2,%4\n\
move.l r3,%5\n\
moviu r5,%%u 0x20002208\n\
movil r5,%%l 0x20002208\n\
move.l r4,%6\n\
write.l (r5),%2\n\
nop\n\
nop\n\
move.l %0,r1\n\
move.l %1,r2"
: "=r" (ret), "=r" (err)
: "r" (action), "r" (p1), "r" (p2), "r" (p3), "r" (p4)
: "r1", "r2", "r3", "r4", "r5");
*error = err;
return ret;
}
#endif
int
close (int fildes)
{
int status;
int error;
status = do_syscall (SYS_close, fildes, 0, 0, 0, &error);
if (status < 0)
errno = __hosted_from_gdb_errno (error);
return status;
}
void _exit (int) __attribute ((__noreturn__));
void
_exit (int code)
{
#ifdef TARGET_SIM
asm volatile ("stop 0,%0" : : "r" (code & 0xff));
#else
int error;
do_syscall (SYS_exit, code, 0, 0, 0, &error);
#endif
/* Should never reach this point. Since this function is not supposed to
return, pretend to get stuck in a loop. */
while (1)
;
}
#ifdef TARGET_SIM
extern long long _sim_cmdline_header;
long long
_get_cmdline (void)
{
return _sim_cmdline_header;
}
#endif
int
fstat (int fildes, struct stat *st)
{
struct gdb_stat gst;
int status;
int error;
status = do_syscall (SYS_fstat, fildes, (unsigned) &gst, 0, 0, &error);
if (status < 0)
errno = __hosted_from_gdb_errno (error);
else
__hosted_from_gdb_stat (&gst, st);
return status;
}
int
gettimeofday (struct timeval *__p, void *__tz)
{
struct timeval *tv = __p;
struct timezone *tz = __tz;
struct gdb_timeval gtv;
int status;
int error;
status = do_syscall (SYS_gettimeofday, (unsigned) &gtv, 0, 0, 0, &error);
/* The timezone argument is not really supported so:
Local time is GMT, no daylight saving */
if (tz)
{
tz->tz_minuteswest = 0;
tz->tz_dsttime = 0;
}
if (status < 0)
errno = __hosted_from_gdb_errno (error);
else
__hosted_from_gdb_timeval (&gtv, tv);
return status;
}
int
isatty (int fildes)
{
int status;
int error;
status = do_syscall (SYS_isatty, fildes, 0, 0, 0, &error);
if (status == 0)
errno = __hosted_from_gdb_errno (error);
return status;
}
off_t
lseek (int fildes, off_t offset, int whence)
{
off_t ret;
int error;
ret = do_syscall (SYS_lseek, fildes, offset,
__hosted_to_gdb_lseek_flags (whence), 0, &error);
if (ret == (off_t)-1)
errno = __hosted_from_gdb_errno (error);
return ret;
}
int
open (const char *path, int oflag, ...)
{
mode_t mode = 0;
int status;
int error;
int len = strlen (path) + 1;
if (oflag & O_CREAT)
{
va_list ap;
va_start (ap, oflag);
mode = va_arg (ap, mode_t);
va_end (ap);
}
status = do_syscall (SYS_open, (unsigned) path, len,
__hosted_to_gdb_open_flags (oflag),
__hosted_to_gdb_mode_t (mode), &error);
if (status < 0)
errno = __hosted_from_gdb_errno (error);
return status;
}
int
read (int fildes, void *buf, size_t nbyte)
{
int status;
int error;
status = do_syscall (SYS_read, fildes, (unsigned) buf, nbyte, 0, &error);
if (status < 0)
errno = __hosted_from_gdb_errno (error);
return status;
}
int
rename (const char *old, const char *new)
{
int status;
int error;
int oldlen = strlen (old) + 1;
int newlen = strlen (new) + 1;
status = do_syscall (SYS_rename, (unsigned) old, oldlen, (unsigned) new,
newlen, &error);
if (status < 0)
errno = __hosted_from_gdb_errno (error);
return status;
}
int
stat (const char *path, struct stat *st)
{
struct gdb_stat gst;
int status;
int error;
int len = strlen (path) + 1;
status = do_syscall (SYS_stat, (unsigned) path, len, (unsigned) &gst, 0,
&error);
if (status < 0)
errno = __hosted_from_gdb_errno (error);
else
__hosted_from_gdb_stat (&gst, st);
return status;
}
int
system (const char *string)
{
int status;
int error;
int len = strlen (string) + 1;
status = do_syscall (SYS_system, (unsigned) string, len, 0, 0, &error);
return status;
}
int
unlink (const char *path)
{
int status;
int error;
int len = strlen (path) + 1;
status = do_syscall (SYS_unlink, (unsigned) path, len, 0, 0, &error);
if (status < 0)
errno = __hosted_from_gdb_errno (error);
return status;
}
int
write (int fildes, const void *buf, size_t nbyte)
{
int status;
int error;
status = do_syscall (SYS_write, fildes, (unsigned) buf, nbyte, 0, &error);
if (status < 0)
errno = __hosted_from_gdb_errno (error);
return status;
}
extern clock_t _sim_clock;
clock_t
clock (void)
{
#ifdef TARGET_SIM
return _sim_clock;
#else
return (clock_t) -1;
#endif
}

View File

@ -1,3 +1,13 @@
2015-01-21 Eric Botcazou <ebotcazou@adacore.com>
* configure.host: Add Visium support.
* libc/machine/configure.in: Likewise.
* libc/machine/configure: Regenerate.
* libc/machine/visium/: New directory.
* libc/include/machine/setjmp.h (_JBLEN): Define for Visium.
* libc/include/machine/ieeefp.h (__IEEE_BIG_ENDIAN): Likewise.
* libc/include/machine/time.h (_CLOCKS_PER_SEC_): Likewise.
2015-01-20 Stefan Wallentowitz <stefan.wallentowitz@tum.de>
* libc/sys/configure.in: Add OpenRISC.

View File

@ -286,6 +286,9 @@ case "${host_cpu}" in
machine_dir=v850
newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED "
;;
visium)
machine_dir=visium
;;
w65*)
machine_dir=w65
;;
@ -544,6 +547,9 @@ case "${host}" in
have_crt0="no"
fi
;;
visium-*-*)
sys_dir=
;;
w65-*-*)
sys_dir=w65
;;
@ -802,6 +808,10 @@ case "${host}" in
v850*-*-*)
syscall_dir=syscalls
;;
visium-*-*)
newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DHAVE_SYSTEM -DMISSING_SYSCALL_NAMES"
syscall_dir=
;;
w65-*-*)
syscall_dir=syscalls
newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY"

View File

@ -415,6 +415,10 @@
# endif
#endif
#ifdef __VISIUM__
#define __IEEE_BIG_ENDIAN
#endif
#ifndef __IEEE_BIG_ENDIAN
#ifndef __IEEE_LITTLE_ENDIAN
#error Endianess not declared!!

View File

@ -338,6 +338,11 @@ _BEGIN_STD_C
#define _JBLEN 0x44
#endif
#ifdef __VISIUM__
/* All call-saved GP registers: r11-r19,r21,r22,r23. */
#define _JBLEN 12
#endif
#ifdef _JBLEN
#ifdef _JBTYPE
typedef _JBTYPE jmp_buf[_JBLEN];

View File

@ -3,11 +3,11 @@
#if defined(__rtems__)
#define _CLOCKS_PER_SEC_ sysconf(_SC_CLK_TCK)
#else /* !__rtems__ */
#if defined(__aarch64__) || defined(__arm__) || defined(__thumb__)
#elif defined(__aarch64__) || defined(__arm__) || defined(__thumb__)
#define _CLOCKS_PER_SEC_ 100
#elif defined (__VISIUM__)
#define _CLOCKS_PER_SEC_ 1000000
#endif
#endif /* !__rtems__ */
#ifdef __SPU__
#include <sys/types.h>
@ -15,5 +15,3 @@ int nanosleep (const struct timespec *, struct timespec *);
#endif
#endif /* _MACHTIME_H_ */

View File

@ -830,6 +830,7 @@ tic4x
tic6x
tic80
v850
visium
w65
x86_64
xc16x
@ -11479,7 +11480,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11482 "configure"
#line 11483 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11585,7 +11586,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11588 "configure"
#line 11589 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11919,6 +11920,8 @@ subdirs="$subdirs a29k"
tic80) subdirs="$subdirs tic80"
;;
v850) subdirs="$subdirs v850"
;;
visium) subdirs="$subdirs visium"
;;
w65) subdirs="$subdirs w65"
;;

View File

@ -69,6 +69,7 @@ if test -n "${machine_dir}"; then
tic6x) AC_CONFIG_SUBDIRS(tic6x) ;;
tic80) AC_CONFIG_SUBDIRS(tic80) ;;
v850) AC_CONFIG_SUBDIRS(v850) ;;
visium) AC_CONFIG_SUBDIRS(visium) ;;
w65) AC_CONFIG_SUBDIRS(w65) ;;
x86_64) AC_CONFIG_SUBDIRS(x86_64) ;;
xc16x) AC_CONFIG_SUBDIRS(xc16x) ;;

View File

@ -0,0 +1,16 @@
## Process this file with automake to generate Makefile.in
AUTOMAKE_OPTIONS = cygnus
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
AM_CCASFLAGS = $(INCLUDES)
noinst_LIBRARIES = lib.a
lib_a_SOURCES = memcpy.c memset.c memmove.c setjmp.S
lib_a_CFLAGS = $(AM_CFLAGS)
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
ACLOCAL_AMFLAGS = -I ../../..
CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host

View File

@ -0,0 +1,465 @@
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# This Makefile.in 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.
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/../../../../mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LIBRARIES = $(noinst_LIBRARIES)
ARFLAGS = cru
lib_a_AR = $(AR) $(ARFLAGS)
lib_a_LIBADD =
am_lib_a_OBJECTS = lib_a-memcpy.$(OBJEXT) lib_a-memset.$(OBJEXT) \
lib_a-memmove.$(OBJEXT) lib_a-setjmp.$(OBJEXT)
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp =
am__depfiles_maybe =
CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(lib_a_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
ETAGS = etags
CTAGS = ctags
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
NO_INCLUDE_LIST = @NO_INCLUDE_LIST@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
READELF = @READELF@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
aext = @aext@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
libm_machine_dir = @libm_machine_dir@
localedir = @localedir@
localstatedir = @localstatedir@
lpfx = @lpfx@
machine_dir = @machine_dir@
mandir = @mandir@
mkdir_p = @mkdir_p@
newlib_basedir = @newlib_basedir@
oext = @oext@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sys_dir = @sys_dir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = cygnus
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
AM_CCASFLAGS = $(INCLUDES)
noinst_LIBRARIES = lib.a
lib_a_SOURCES = memcpy.c memset.c memmove.c setjmp.S
lib_a_CFLAGS = $(AM_CFLAGS)
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
ACLOCAL_AMFLAGS = -I ../../..
CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
all: all-am
.SUFFIXES:
.SUFFIXES: .S .c .o .obj
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --cygnus \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --cygnus Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES)
-rm -f lib.a
$(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
$(RANLIB) lib.a
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
.S.o:
$(CPPASCOMPILE) -c -o $@ $<
.S.obj:
$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
lib_a-setjmp.o: setjmp.S
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.o `test -f 'setjmp.S' || echo '$(srcdir)/'`setjmp.S
lib_a-setjmp.obj: setjmp.S
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.obj `if test -f 'setjmp.S'; then $(CYGPATH_W) 'setjmp.S'; else $(CYGPATH_W) '$(srcdir)/setjmp.S'; fi`
.c.o:
$(COMPILE) -c $<
.c.obj:
$(COMPILE) -c `$(CYGPATH_W) '$<'`
lib_a-memcpy.o: memcpy.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcpy.o `test -f 'memcpy.c' || echo '$(srcdir)/'`memcpy.c
lib_a-memcpy.obj: memcpy.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcpy.obj `if test -f 'memcpy.c'; then $(CYGPATH_W) 'memcpy.c'; else $(CYGPATH_W) '$(srcdir)/memcpy.c'; fi`
lib_a-memset.o: memset.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memset.o `test -f 'memset.c' || echo '$(srcdir)/'`memset.c
lib_a-memset.obj: memset.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memset.obj `if test -f 'memset.c'; then $(CYGPATH_W) 'memset.c'; else $(CYGPATH_W) '$(srcdir)/memset.c'; fi`
lib_a-memmove.o: memmove.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memmove.o `test -f 'memmove.c' || echo '$(srcdir)/'`memmove.c
lib_a-memmove.obj: memmove.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memmove.obj `if test -f 'memmove.c'; then $(CYGPATH_W) 'memmove.c'; else $(CYGPATH_W) '$(srcdir)/memmove.c'; fi`
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
check-am:
check: check-am
all-am: Makefile $(LIBRARIES)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-generic clean-noinstLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-tags dvi dvi-am \
html html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

1012
newlib/libc/machine/visium/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

4748
newlib/libc/machine/visium/configure vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
dnl This is the newlib/libc/machine/visium configure.in file.
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([newlib],[NEWLIB_VERSION])
AC_CONFIG_SRCDIR([Makefile.am])
dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
AC_CONFIG_AUX_DIR(../../../..)
NEWLIB_CONFIGURE(../../..)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

View File

@ -0,0 +1,874 @@
/* memcpy for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
/* This file must be kept in sync with libgcc/config/visium/memcpy.c */
#include <stddef.h>
#include "memcpy.h"
#define INST_BARRIER __asm__ __volatile__ ("":::"memory");
#define MOVE_32_OBJECTS(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
m1 = in [1]; \
m2 = in [2]; \
m3 = in [3]; \
out [0] = m0; \
out [1] = m1; \
out [2] = m2; \
out [3] = m3; \
INST_BARRIER \
m0 = in [4]; \
m1 = in [5]; \
m2 = in [6]; \
m3 = in [7]; \
out [4] = m0; \
out [5] = m1; \
out [6] = m2; \
out [7] = m3; \
INST_BARRIER \
m0 = in [8]; \
m1 = in [9]; \
m2 = in [10]; \
m3 = in [11]; \
out [8] = m0; \
out [9] = m1; \
out [10] = m2; \
out [11] = m3; \
INST_BARRIER \
m0 = in [12]; \
m1 = in [13]; \
m2 = in [14]; \
m3 = in [15]; \
out [12] = m0; \
out [13] = m1; \
out [14] = m2; \
out [15] = m3; \
INST_BARRIER \
m0 = in [16]; \
m1 = in [17]; \
m2 = in [18]; \
m3 = in [19]; \
out [16] = m0; \
out [17] = m1; \
out [18] = m2; \
out [19] = m3; \
INST_BARRIER \
m0 = in [20]; \
m1 = in [21]; \
m2 = in [22]; \
m3 = in [23]; \
out [20] = m0; \
out [21] = m1; \
out [22] = m2; \
out [23] = m3; \
INST_BARRIER \
m0 = in [24]; \
m1 = in [25]; \
m2 = in [26]; \
m3 = in [27]; \
out [24] = m0; \
out [25] = m1; \
out [26] = m2; \
out [27] = m3; \
INST_BARRIER \
m0 = in [28]; \
m1 = in [29]; \
m2 = in [30]; \
m3 = in [31]; \
out [28] = m0; \
out [29] = m1; \
out [30] = m2; \
out [31] = m3; \
INST_BARRIER \
in += 32; \
out += 32; \
} while(0)
#define MOVE_16_OBJECTS(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
m1 = in [1]; \
m2 = in [2]; \
m3 = in [3]; \
out [0] = m0; \
out [1] = m1; \
out [2] = m2; \
out [3] = m3; \
INST_BARRIER \
m0 = in [4]; \
m1 = in [5]; \
m2 = in [6]; \
m3 = in [7]; \
out [4] = m0; \
out [5] = m1; \
out [6] = m2; \
out [7] = m3; \
INST_BARRIER \
m0 = in [8]; \
m1 = in [9]; \
m2 = in [10]; \
m3 = in [11]; \
out [8] = m0; \
out [9] = m1; \
out [10] = m2; \
out [11] = m3; \
INST_BARRIER \
m0 = in [12]; \
m1 = in [13]; \
m2 = in [14]; \
m3 = in [15]; \
out [12] = m0; \
out [13] = m1; \
out [14] = m2; \
out [15] = m3; \
INST_BARRIER \
in += 16; \
out += 16; \
} while(0)
#define MOVE_12_OBJECTS(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
m1 = in [1]; \
m2 = in [2]; \
m3 = in [3]; \
out [0] = m0; \
out [1] = m1; \
out [2] = m2; \
out [3] = m3; \
INST_BARRIER \
m0 = in [4]; \
m1 = in [5]; \
m2 = in [6]; \
m3 = in [7]; \
out [4] = m0; \
out [5] = m1; \
out [6] = m2; \
out [7] = m3; \
INST_BARRIER \
m0 = in [8]; \
m1 = in [9]; \
m2 = in [10]; \
m3 = in [11]; \
out [8] = m0; \
out [9] = m1; \
out [10] = m2; \
out [11] = m3; \
INST_BARRIER \
in += 12; \
out += 12; \
} while(0)
#define MOVE_11_OBJECTS(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
m1 = in [1]; \
m2 = in [2]; \
m3 = in [3]; \
out [0] = m0; \
out [1] = m1; \
out [2] = m2; \
out [3] = m3; \
INST_BARRIER \
m0 = in [4]; \
m1 = in [5]; \
m2 = in [6]; \
m3 = in [7]; \
out [4] = m0; \
out [5] = m1; \
out [6] = m2; \
out [7] = m3; \
INST_BARRIER \
m0 = in [8]; \
m1 = in [9]; \
m2 = in [10]; \
out [8] = m0; \
out [9] = m1; \
out [10] = m2; \
INST_BARRIER \
in += 11; \
out += 11; \
} while(0)
#define MOVE_10_OBJECTS(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
m1 = in [1]; \
m2 = in [2]; \
m3 = in [3]; \
out [0] = m0; \
out [1] = m1; \
out [2] = m2; \
out [3] = m3; \
INST_BARRIER \
m0 = in [4]; \
m1 = in [5]; \
m2 = in [6]; \
m3 = in [7]; \
out [4] = m0; \
m0 = in [8]; \
out [5] = m1; \
m1 = in [9]; \
out [6] = m2; \
out [7] = m3; \
out [8] = m0; \
out [9] = m1; \
INST_BARRIER \
in += 10; \
out += 10; \
} while(0)
#define MOVE_9_OBJECTS(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
m1 = in [1]; \
m2 = in [2]; \
m3 = in [3]; \
out [0] = m0; \
out [1] = m1; \
out [2] = m2; \
out [3] = m3; \
INST_BARRIER \
m0 = in [4]; \
m1 = in [5]; \
m2 = in [6]; \
m3 = in [7]; \
out [4] = m0; \
out [5] = m1; \
out [6] = m2; \
out [7] = m3; \
INST_BARRIER \
m0 = in [8]; \
out [8] = m0; \
in += 9; \
out += 9; \
} while(0)
#define MOVE_8_OBJECTS(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
m1 = in [1]; \
m2 = in [2]; \
m3 = in [3]; \
out [0] = m0; \
out [1] = m1; \
out [2] = m2; \
out [3] = m3; \
INST_BARRIER \
m0 = in [4]; \
m1 = in [5]; \
m2 = in [6]; \
m3 = in [7]; \
out [4] = m0; \
out [5] = m1; \
out [6] = m2; \
out [7] = m3; \
INST_BARRIER \
in += 8; \
out += 8; \
} while(0)
#define MOVE_7_OBJECTS(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
m1 = in [1]; \
m2 = in [2]; \
m3 = in [3]; \
out [0] = m0; \
out [1] = m1; \
out [2] = m2; \
out [3] = m3; \
INST_BARRIER \
m0 = in [4]; \
m1 = in [5]; \
m2 = in [6]; \
out [4] = m0; \
out [5] = m1; \
out [6] = m2; \
INST_BARRIER \
in += 7; \
out += 7; \
} while(0)
#define MOVE_6_OBJECTS(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
m1 = in [1]; \
m2 = in [2]; \
m3 = in [3]; \
out [0] = m0; \
INST_BARRIER \
m0 = in [4]; \
out [1] = m1; \
INST_BARRIER \
m1 = in [5]; \
out [2] = m2; \
out [3] = m3; \
out [4] = m0; \
out [5] = m1; \
INST_BARRIER \
in += 6; \
out += 6; \
} while(0)
#define MOVE_5_OBJECTS(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
m1 = in [1]; \
m2 = in [2]; \
m3 = in [3]; \
INST_BARRIER \
out [0] = m0; \
m0 = in [4]; \
INST_BARRIER \
out [1] = m1; \
out [2] = m2; \
out [3] = m3; \
out [4] = m0; \
INST_BARRIER \
in += 5; \
out += 5; \
} while(0)
#define MOVE_4_OBJECTS(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
m1 = in [1]; \
m2 = in [2]; \
m3 = in [3]; \
out [0] = m0; \
out [1] = m1; \
out [2] = m2; \
out [3] = m3; \
INST_BARRIER \
in += 4; \
out += 4; \
} while(0)
#define MOVE_3_OBJECTS(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
m1 = in [1]; \
m2 = in [2]; \
out [0] = m0; \
out [1] = m1; \
out [2] = m2; \
INST_BARRIER \
in += 3; \
out += 3; \
} while(0)
#define MOVE_2_OBJECTS(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
m1 = in [1]; \
out [0] = m0; \
out [1] = m1; \
INST_BARRIER \
in += 2; \
out += 2; \
} while(0)
#define MOVE_1_OBJECT(in,out) \
do { \
INST_BARRIER \
m0 = in [0]; \
out [0] = m0; \
INST_BARRIER \
in += 1; \
out += 1; \
} while(0)
static inline void
__int_memcpy (void *__restrict s1, const void *__restrict s2, size_t n)
{
int value = n;
int loop_var;
const int *in = s2;
int *out = s1;
int count;
int m0,m1,m2,m3;
/* This code currently give a stall for any value with a 1->2 in the low 5
bits, i.e. 1,2, 33,34 ? not acceptable! */
switch (value & 0x1f)
{
case 0:
break;
case 1:
MOVE_1_OBJECT (in, out);
break;
case 2:
MOVE_2_OBJECTS (in, out);
break;
case 3:
MOVE_3_OBJECTS (in, out);
break;
case 4:
MOVE_4_OBJECTS (in, out);
break;
case 5:
MOVE_5_OBJECTS (in, out);
break;
case 6:
MOVE_6_OBJECTS (in, out);
break;
case 7:
MOVE_7_OBJECTS (in, out);
break;
case 8:
MOVE_8_OBJECTS (in, out);
break;
case 9:
MOVE_9_OBJECTS (in, out);
break;
case 10:
MOVE_10_OBJECTS (in, out);
break;
case 11:
MOVE_11_OBJECTS (in, out);
break;
case 12:
MOVE_12_OBJECTS (in, out);
break;
case 13:
MOVE_9_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 14:
MOVE_12_OBJECTS (in, out);
MOVE_2_OBJECTS (in, out);
break;
case 15:
MOVE_11_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 16:
MOVE_16_OBJECTS (in, out);
break;
case 17:
MOVE_11_OBJECTS (in, out);
MOVE_6_OBJECTS (in, out);
break;
case 18:
MOVE_9_OBJECTS (in, out);
MOVE_9_OBJECTS (in, out);
break;
case 19:
MOVE_16_OBJECTS (in, out);
MOVE_3_OBJECTS (in, out);
break;
case 20:
MOVE_16_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 21:
MOVE_16_OBJECTS (in, out);
MOVE_5_OBJECTS (in, out);
break;
case 22:
MOVE_16_OBJECTS (in, out);
MOVE_6_OBJECTS (in, out);
break;
case 23:
MOVE_16_OBJECTS (in, out);
MOVE_7_OBJECTS (in, out);
break;
case 24:
MOVE_16_OBJECTS (in, out);
MOVE_8_OBJECTS (in, out);
break;
case 25:
MOVE_16_OBJECTS (in, out);
MOVE_9_OBJECTS (in, out);
break;
case 26:
MOVE_16_OBJECTS (in, out);
MOVE_10_OBJECTS (in, out);
break;
case 27:
MOVE_16_OBJECTS (in, out);
MOVE_11_OBJECTS (in, out);
break;
case 28:
MOVE_16_OBJECTS (in, out);
MOVE_8_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 29:
MOVE_16_OBJECTS (in, out);
MOVE_9_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 30:
MOVE_16_OBJECTS (in, out);
MOVE_12_OBJECTS (in, out);
MOVE_2_OBJECTS (in, out);
break;
case 31:
MOVE_16_OBJECTS (in, out);
MOVE_11_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
}
/* This loop governs the asmptoptic behaviour of this algorithm, for long
word copies. */
count = value >> 5;
for (loop_var = 0; loop_var < count; loop_var++)
MOVE_32_OBJECTS (in, out);
}
static inline void
__shrt_int_memcpy (void *__restrict s1, const void *__restrict s2, size_t n)
{
int value = n;
int loop_var;
const short int *in = s2;
int short *out = s1;
int count;
int m0,m1,m2,m3;
/* This code currently give a stall for any value with a 1->2 in the low 5
bits, i.e. 1,2, 33,34 ? not acceptable! */
switch (value & 0x1f)
{
case 0:
break;
case 1:
MOVE_1_OBJECT (in, out);
break;
case 2:
MOVE_2_OBJECTS (in, out);
break;
case 3:
MOVE_3_OBJECTS (in, out);
break;
case 4:
MOVE_4_OBJECTS (in, out);
break;
case 5:
MOVE_5_OBJECTS (in, out);
break;
case 6:
MOVE_6_OBJECTS (in, out);
break;
case 7:
MOVE_7_OBJECTS (in, out);
break;
case 8:
MOVE_8_OBJECTS (in, out);
break;
case 9:
MOVE_9_OBJECTS (in, out);
break;
case 10:
MOVE_10_OBJECTS (in, out);
break;
case 11:
MOVE_11_OBJECTS (in, out);
break;
case 12:
MOVE_12_OBJECTS (in, out);
break;
case 13:
MOVE_9_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 14:
MOVE_12_OBJECTS (in, out);
MOVE_2_OBJECTS (in, out);
break;
case 15:
MOVE_11_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 16:
MOVE_16_OBJECTS (in, out);
break;
case 17:
MOVE_11_OBJECTS (in, out);
MOVE_6_OBJECTS (in, out);
break;
case 18:
MOVE_9_OBJECTS (in, out);
MOVE_9_OBJECTS (in, out);
break;
case 19:
MOVE_16_OBJECTS (in, out);
MOVE_3_OBJECTS (in, out);
break;
case 20:
MOVE_16_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 21:
MOVE_16_OBJECTS (in, out);
MOVE_5_OBJECTS (in, out);
break;
case 22:
MOVE_16_OBJECTS (in, out);
MOVE_6_OBJECTS (in, out);
break;
case 23:
MOVE_16_OBJECTS (in, out);
MOVE_7_OBJECTS (in, out);
break;
case 24:
MOVE_16_OBJECTS (in, out);
MOVE_8_OBJECTS (in, out);
break;
case 25:
MOVE_16_OBJECTS (in, out);
MOVE_9_OBJECTS (in, out);
break;
case 26:
MOVE_16_OBJECTS (in, out);
MOVE_10_OBJECTS (in, out);
break;
case 27:
MOVE_16_OBJECTS (in, out);
MOVE_11_OBJECTS (in, out);
break;
case 28:
MOVE_16_OBJECTS (in, out);
MOVE_8_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 29:
MOVE_16_OBJECTS (in, out);
MOVE_9_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 30:
MOVE_16_OBJECTS (in, out);
MOVE_12_OBJECTS (in, out);
MOVE_2_OBJECTS (in, out);
break;
case 31:
MOVE_16_OBJECTS (in, out);
MOVE_11_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
}
/* This loop governs the asmptoptic behaviour of this algorithm, for long
word copies. */
count = value >> 5;
for (loop_var = 0; loop_var < count; loop_var++)
MOVE_32_OBJECTS (in, out);
}
static inline void
__byte_memcpy (void *__restrict s1, const void *__restrict s2, size_t n)
{
int value = n;
int loop_var;
const char *in = s2;
char *out = s1;
int count;
int m0,m1,m2,m3;
/* This code currently give a stall for any value with a 1->2 in the low 5
bits, i.e. 1,2, 33,34 ? not acceptable! */
switch (value & 0x1f)
{
case 0:
break;
case 1:
MOVE_1_OBJECT (in, out);
break;
case 2:
MOVE_2_OBJECTS (in, out);
break;
case 3:
MOVE_3_OBJECTS (in, out);
break;
case 4:
MOVE_4_OBJECTS (in, out);
break;
case 5:
MOVE_5_OBJECTS (in, out);
break;
case 6:
MOVE_6_OBJECTS (in, out);
break;
case 7:
MOVE_7_OBJECTS (in, out);
break;
case 8:
MOVE_8_OBJECTS (in, out);
break;
case 9:
MOVE_9_OBJECTS (in, out);
break;
case 10:
MOVE_10_OBJECTS (in, out);
break;
case 11:
MOVE_11_OBJECTS (in, out);
break;
case 12:
MOVE_12_OBJECTS (in, out);
break;
case 13:
MOVE_9_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 14:
MOVE_12_OBJECTS (in, out);
MOVE_2_OBJECTS (in, out);
break;
case 15:
MOVE_11_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 16:
MOVE_16_OBJECTS (in, out);
break;
case 17:
MOVE_11_OBJECTS (in, out);
MOVE_6_OBJECTS (in, out);
break;
case 18:
MOVE_9_OBJECTS (in, out);
MOVE_9_OBJECTS (in, out);
break;
case 19:
MOVE_16_OBJECTS (in, out);
MOVE_3_OBJECTS (in, out);
break;
case 20:
MOVE_16_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 21:
MOVE_16_OBJECTS (in, out);
MOVE_5_OBJECTS (in, out);
break;
case 22:
MOVE_16_OBJECTS (in, out);
MOVE_6_OBJECTS (in, out);
break;
case 23:
MOVE_16_OBJECTS (in, out);
MOVE_7_OBJECTS (in, out);
break;
case 24:
MOVE_16_OBJECTS (in, out);
MOVE_8_OBJECTS (in, out);
break;
case 25:
MOVE_16_OBJECTS (in, out);
MOVE_9_OBJECTS (in, out);
break;
case 26:
MOVE_16_OBJECTS (in, out);
MOVE_10_OBJECTS (in, out);
break;
case 27:
MOVE_16_OBJECTS (in, out);
MOVE_11_OBJECTS (in, out);
break;
case 28:
MOVE_16_OBJECTS (in, out);
MOVE_8_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 29:
MOVE_16_OBJECTS (in, out);
MOVE_9_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
case 30:
MOVE_16_OBJECTS (in, out);
MOVE_12_OBJECTS (in, out);
MOVE_2_OBJECTS (in, out);
break;
case 31:
MOVE_16_OBJECTS (in, out);
MOVE_11_OBJECTS (in, out);
MOVE_4_OBJECTS (in, out);
break;
}
/* This loop governs the asmptoptic behaviour of this algorithm, for long
word copies. */
count = value >> 5;
for (loop_var = 0; loop_var < count; loop_var++)
MOVE_32_OBJECTS (in, out);
}
/* Exposed interface. */
void *
memcpy (void *__restrict s1, const void *__restrict s2, size_t n)
{
void *result = s1;
/* None of the following handles copying zero bytes. */
if (n != 0)
{
unsigned test = (unsigned) s2 | (unsigned) s1 | (unsigned) n;
if (test & 1)
__byte_memcpy (s1, s2, n);
else if (test & 2)
__shrt_int_memcpy (s1, s2, n >> 1);
else
#ifdef __VISIUM_ARCH_BMI__
__asm__ __volatile__ ("bmd %0,%1,%2"
: "+t" (s1), "+u" (s2), "+v" (n)
:
: "r4", "r5", "r6", "memory");
#else
__int_memcpy (s1, s2, n >> 2);
#endif /* __VISIUM_ARCH_BMI__ */
}
return result;
}

View File

@ -0,0 +1,31 @@
/* memcpy for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
void *
memcpy (void *__restrict s1, const void *__restrict s2, size_t n);

View File

@ -0,0 +1,52 @@
/* memmove for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
#include <string.h>
void *
memmove (void *dst, const void *src, size_t len)
{
char *d = dst;
const char *s = src;
/* The overlap case is allegedly rare - with this implementation
it will have a high penalty on the GR6. */
if (s < d && d < s + len)
{
s += len;
d += len;
while (len--)
*--d = *--s;
return dst;
}
return memcpy (dst, src, len);
}

View File

@ -0,0 +1,677 @@
/* memset for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
/* This file must be kept in sync with libgcc/config/visium/memset.c */
#include <stddef.h>
#include "memset.h"
#define SET_32_OBJECTS(out) \
do { \
out [0] = m0; \
out [1] = m0; \
out [2] = m0; \
out [3] = m0; \
out [4] = m0; \
out [5] = m0; \
out [6] = m0; \
out [7] = m0; \
out [8] = m0; \
out [9] = m0; \
out [10] = m0; \
out [11] = m0; \
out [12] = m0; \
out [13] = m0; \
out [14] = m0; \
out [15] = m0; \
out [16] = m0; \
out [17] = m0; \
out [18] = m0; \
out [19] = m0; \
out [20] = m0; \
out [21] = m0; \
out [22] = m0; \
out [23] = m0; \
out [24] = m0; \
out [25] = m0; \
out [26] = m0; \
out [27] = m0; \
out [28] = m0; \
out [29] = m0; \
out [30] = m0; \
out [31] = m0; \
out += 32; \
} while(0)
#define SET_16_OBJECTS(out) \
do { \
out [0] = m0; \
out [1] = m0; \
out [2] = m0; \
out [3] = m0; \
out [4] = m0; \
out [5] = m0; \
out [6] = m0; \
out [7] = m0; \
out [8] = m0; \
out [9] = m0; \
out [10] = m0; \
out [11] = m0; \
out [12] = m0; \
out [13] = m0; \
out [14] = m0; \
out [15] = m0; \
out += 16; \
} while(0)
#define SET_12_OBJECTS(out) \
do { \
out [0] = m0; \
out [1] = m0; \
out [2] = m0; \
out [3] = m0; \
out [4] = m0; \
out [5] = m0; \
out [6] = m0; \
out [7] = m0; \
out [8] = m0; \
out [9] = m0; \
out [10] = m0; \
out [11] = m0; \
out += 12; \
} while(0)
#define SET_11_OBJECTS(out) \
do { \
out [0] = m0; \
out [1] = m0; \
out [2] = m0; \
out [3] = m0; \
out [4] = m0; \
out [5] = m0; \
out [6] = m0; \
out [7] = m0; \
out [8] = m0; \
out [9] = m0; \
out [10] = m0; \
out += 11; \
} while(0)
#define SET_10_OBJECTS(out) \
do { \
out [0] = m0; \
out [1] = m0; \
out [2] = m0; \
out [3] = m0; \
out [4] = m0; \
out [5] = m0; \
out [6] = m0; \
out [7] = m0; \
out [8] = m0; \
out [9] = m0; \
out += 10; \
} while(0)
#define SET_9_OBJECTS(out) \
do { \
out [0] = m0; \
out [1] = m0; \
out [2] = m0; \
out [3] = m0; \
out [4] = m0; \
out [5] = m0; \
out [6] = m0; \
out [7] = m0; \
out [8] = m0; \
out += 9; \
} while(0)
#define SET_8_OBJECTS(out) \
do { \
out [0] = m0; \
out [1] = m0; \
out [2] = m0; \
out [3] = m0; \
out [4] = m0; \
out [5] = m0; \
out [6] = m0; \
out [7] = m0; \
out += 8; \
} while(0)
#define SET_7_OBJECTS(out) \
do { \
out [0] = m0; \
out [1] = m0; \
out [2] = m0; \
out [3] = m0; \
out [4] = m0; \
out [5] = m0; \
out [6] = m0; \
out += 7; \
} while(0)
#define SET_6_OBJECTS(out) \
do { \
out [0] = m0; \
out [1] = m0; \
out [2] = m0; \
out [3] = m0; \
out [4] = m0; \
out [5] = m0; \
out += 6; \
} while(0)
#define SET_5_OBJECTS(out) \
do { \
out [0] = m0; \
out [1] = m0; \
out [2] = m0; \
out [3] = m0; \
out [4] = m0; \
out += 5; \
} while(0)
#define SET_4_OBJECTS(out) \
do { \
out [0] = m0; \
out [1] = m0; \
out [2] = m0; \
out [3] = m0; \
out += 4; \
} while(0)
#define SET_3_OBJECTS(out) \
do { \
out [0] = m0; \
out [1] = m0; \
out [2] = m0; \
out += 3; \
} while(0)
#define SET_2_OBJECTS(out) \
do { \
out [0] = m0; \
out [1] = m0; \
out += 2; \
} while(0)
#define SET_1_OBJECT(out) \
do { \
out [0] = m0; \
out += 1; \
} while(0)
static inline void
__int_memset (void *__restrict s1, int val, size_t n)
{
int value = n;
int loop_var;
int *out = s1;
int count;
int m0 = val;
/* This code currently give a stall for any value with a 1->2 in the low 5
bits, i.e. 1,2, 33,34 ? not acceptable! */
switch (value & 0x1f)
{
case 0:
break;
case 1:
SET_1_OBJECT (out);
break;
case 2:
SET_2_OBJECTS (out);
break;
case 3:
SET_3_OBJECTS (out);
break;
case 4:
SET_4_OBJECTS (out);
break;
case 5:
SET_5_OBJECTS (out);
break;
case 6:
SET_6_OBJECTS (out);
break;
case 7:
SET_7_OBJECTS (out);
break;
case 8:
SET_8_OBJECTS (out);
break;
case 9:
SET_9_OBJECTS (out);
break;
case 10:
SET_10_OBJECTS (out);
break;
case 11:
SET_11_OBJECTS (out);
break;
case 12:
SET_12_OBJECTS (out);
break;
case 13:
SET_9_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 14:
SET_12_OBJECTS (out);
SET_2_OBJECTS (out);
break;
case 15:
SET_11_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 16:
SET_16_OBJECTS (out);
break;
case 17:
SET_11_OBJECTS (out);
SET_6_OBJECTS (out);
break;
case 18:
SET_9_OBJECTS (out);
SET_9_OBJECTS (out);
break;
case 19:
SET_16_OBJECTS (out);
SET_3_OBJECTS (out);
break;
case 20:
SET_16_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 21:
SET_16_OBJECTS (out);
SET_5_OBJECTS (out);
break;
case 22:
SET_16_OBJECTS (out);
SET_6_OBJECTS (out);
break;
case 23:
SET_16_OBJECTS (out);
SET_7_OBJECTS (out);
break;
case 24:
SET_16_OBJECTS (out);
SET_8_OBJECTS (out);
break;
case 25:
SET_16_OBJECTS (out);
SET_9_OBJECTS (out);
break;
case 26:
SET_16_OBJECTS (out);
SET_10_OBJECTS (out);
break;
case 27:
SET_16_OBJECTS (out);
SET_11_OBJECTS (out);
break;
case 28:
SET_16_OBJECTS (out);
SET_8_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 29:
SET_16_OBJECTS (out);
SET_9_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 30:
SET_16_OBJECTS (out);
SET_12_OBJECTS (out);
SET_2_OBJECTS (out);
break;
case 31:
SET_16_OBJECTS (out);
SET_11_OBJECTS (out);
SET_4_OBJECTS (out);
break;
}
/* This loop governs the asmptoptic behaviour of this algorithm, for long
word copies. */
count = value >> 5;
for (loop_var = 0; loop_var < count; loop_var++)
SET_32_OBJECTS (out);
}
static inline void
__short_int_memset (void *__restrict s1, int val, size_t n)
{
int value = n;
int loop_var;
int short *out = s1;
int count;
int m0 = val;
/* This code currently give a stall for any value with a 1->2 in the low 5
bits, i.e. 1,2, 33,34 ? not acceptable! */
switch (value & 0x1f)
{
case 0:
break;
case 1:
SET_1_OBJECT (out);
break;
case 2:
SET_2_OBJECTS (out);
break;
case 3:
SET_3_OBJECTS (out);
break;
case 4:
SET_4_OBJECTS (out);
break;
case 5:
SET_5_OBJECTS (out);
break;
case 6:
SET_6_OBJECTS (out);
break;
case 7:
SET_7_OBJECTS (out);
break;
case 8:
SET_8_OBJECTS (out);
break;
case 9:
SET_9_OBJECTS (out);
break;
case 10:
SET_10_OBJECTS (out);
break;
case 11:
SET_11_OBJECTS (out);
break;
case 12:
SET_12_OBJECTS (out);
break;
case 13:
SET_9_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 14:
SET_12_OBJECTS (out);
SET_2_OBJECTS (out);
break;
case 15:
SET_11_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 16:
SET_16_OBJECTS (out);
break;
case 17:
SET_11_OBJECTS (out);
SET_6_OBJECTS (out);
break;
case 18:
SET_9_OBJECTS (out);
SET_9_OBJECTS (out);
break;
case 19:
SET_16_OBJECTS (out);
SET_3_OBJECTS (out);
break;
case 20:
SET_16_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 21:
SET_16_OBJECTS (out);
SET_5_OBJECTS (out);
break;
case 22:
SET_16_OBJECTS (out);
SET_6_OBJECTS (out);
break;
case 23:
SET_16_OBJECTS (out);
SET_7_OBJECTS (out);
break;
case 24:
SET_16_OBJECTS (out);
SET_8_OBJECTS (out);
break;
case 25:
SET_16_OBJECTS (out);
SET_9_OBJECTS (out);
break;
case 26:
SET_16_OBJECTS (out);
SET_10_OBJECTS (out);
break;
case 27:
SET_16_OBJECTS (out);
SET_11_OBJECTS (out);
break;
case 28:
SET_16_OBJECTS (out);
SET_8_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 29:
SET_16_OBJECTS (out);
SET_9_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 30:
SET_16_OBJECTS (out);
SET_12_OBJECTS (out);
SET_2_OBJECTS (out);
break;
case 31:
SET_16_OBJECTS (out);
SET_11_OBJECTS (out);
SET_4_OBJECTS (out);
break;
}
/* This loop governs the asmptoptic behaviour of this algorithm, for long
word copies. */
count = value >> 5;
for (loop_var = 0; loop_var < count; loop_var++)
SET_32_OBJECTS (out);
}
static inline void
__byte_memset (void *__restrict s1, int val, size_t n)
{
int value = n;
int loop_var;
char *out = s1;
int count;
int m0 = val;
/* This code currently give a stall for any value with a 1->2 in the low 5
bits, i.e. 1,2, 33,34 ? not acceptable! */
switch (value & 0x1f)
{
case 0:
break;
case 1:
SET_1_OBJECT (out);
break;
case 2:
SET_2_OBJECTS (out);
break;
case 3:
SET_3_OBJECTS (out);
break;
case 4:
SET_4_OBJECTS (out);
break;
case 5:
SET_5_OBJECTS (out);
break;
case 6:
SET_6_OBJECTS (out);
break;
case 7:
SET_7_OBJECTS (out);
break;
case 8:
SET_8_OBJECTS (out);
break;
case 9:
SET_9_OBJECTS (out);
break;
case 10:
SET_10_OBJECTS (out);
break;
case 11:
SET_11_OBJECTS (out);
break;
case 12:
SET_12_OBJECTS (out);
break;
case 13:
SET_9_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 14:
SET_12_OBJECTS (out);
SET_2_OBJECTS (out);
break;
case 15:
SET_11_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 16:
SET_16_OBJECTS (out);
break;
case 17:
SET_11_OBJECTS (out);
SET_6_OBJECTS (out);
break;
case 18:
SET_9_OBJECTS (out);
SET_9_OBJECTS (out);
break;
case 19:
SET_16_OBJECTS (out);
SET_3_OBJECTS (out);
break;
case 20:
SET_16_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 21:
SET_16_OBJECTS (out);
SET_5_OBJECTS (out);
break;
case 22:
SET_16_OBJECTS (out);
SET_6_OBJECTS (out);
break;
case 23:
SET_16_OBJECTS (out);
SET_7_OBJECTS (out);
break;
case 24:
SET_16_OBJECTS (out);
SET_8_OBJECTS (out);
break;
case 25:
SET_16_OBJECTS (out);
SET_9_OBJECTS (out);
break;
case 26:
SET_16_OBJECTS (out);
SET_10_OBJECTS (out);
break;
case 27:
SET_16_OBJECTS (out);
SET_11_OBJECTS (out);
break;
case 28:
SET_16_OBJECTS (out);
SET_8_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 29:
SET_16_OBJECTS (out);
SET_9_OBJECTS (out);
SET_4_OBJECTS (out);
break;
case 30:
SET_16_OBJECTS (out);
SET_12_OBJECTS (out);
SET_2_OBJECTS (out);
break;
case 31:
SET_16_OBJECTS (out);
SET_11_OBJECTS (out);
SET_4_OBJECTS (out);
break;
}
/* This loop governs the asmptoptic behaviour of this algorithm, for long
word copies. */
count = value >> 5;
for (loop_var = 0; loop_var < count; loop_var++)
SET_32_OBJECTS (out);
}
/* Exposed interface. */
void *
memset (void *s, int c, size_t n)
{
void *result = s;
/* None of the following handles setting zero bytes. */
if (n != 0)
{
unsigned test = (unsigned) s | (unsigned) n;
if (test & 1)
__byte_memset (s, c, n);
else if (test & 2)
{
short int sc = (short int) ((c << 8) + (char) c);
__short_int_memset (s, sc, n >> 1);
}
else
{
int ic = (c << 24) + ((char) c << 16) + ((char) c << 8) + (char) c;
__int_memset (s, ic, n >> 2);
}
}
return result;
}

View File

@ -0,0 +1,31 @@
/* memset for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
void *
memset (void *s, int c, size_t n);

View File

@ -0,0 +1,67 @@
/* setjmp/longjmp for the Visium processor.
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. */
.text
.globl setjmp
.type setjmp, @function
setjmp:
write.l 0(r1),r11
write.l 1(r1),r12
write.l 2(r1),r13
write.l 3(r1),r14
write.l 4(r1),r15
write.l 5(r1),r16
write.l 6(r1),r17
write.l 7(r1),r18
write.l 8(r1),r19
write.l 9(r1),r21
write.l 10(r1),r22
write.l 11(r1),r23
bra tr,r21,r0
moviq r1,0
.size setjmp, .-setjmp
.globl longjmp
.type longjmp, @function
longjmp:
read.l r11,0(r1)
read.l r12,1(r1)
read.l r13,2(r1)
read.l r14,3(r1)
read.l r15,4(r1)
read.l r16,5(r1)
read.l r17,6(r1)
read.l r18,7(r1)
read.l r19,8(r1)
read.l r21,9(r1)
read.l r22,10(r1)
read.l r23,11(r1)
bra tr,r21,r0
move.l r1,r2
.size longjmp, .-longjmp