summaryrefslogtreecommitdiffstats
path: root/tools/cpu/generic
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cpu/generic')
-rw-r--r--tools/cpu/generic/.cvsignore15
-rw-r--r--tools/cpu/generic/ChangeLog78
-rw-r--r--tools/cpu/generic/Makefile.am9
-rw-r--r--tools/cpu/generic/configure.ac23
-rw-r--r--tools/cpu/generic/size_rtems.in284
5 files changed, 409 insertions, 0 deletions
diff --git a/tools/cpu/generic/.cvsignore b/tools/cpu/generic/.cvsignore
new file mode 100644
index 0000000000..2b8cbd9acc
--- /dev/null
+++ b/tools/cpu/generic/.cvsignore
@@ -0,0 +1,15 @@
+aclocal.m4
+autom4te*.cache
+config.cache
+config.guess
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+Makefile
+Makefile.in
+missing
+mkinstalldirs
+size_rtems
diff --git a/tools/cpu/generic/ChangeLog b/tools/cpu/generic/ChangeLog
new file mode 100644
index 0000000000..1651f3e3d5
--- /dev/null
+++ b/tools/cpu/generic/ChangeLog
@@ -0,0 +1,78 @@
+2011-02-02 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * configure.ac: Require autoconf-2.68, automake-1.11.1.
+
+2006-12-02 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * configure.ac: New BUG-REPORT address.
+
+2006-10-17 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * configure.ac: Require autoconf-2.60. Require automake-1.10.
+
+2004-09-24 Ralf Corsepius <ralf_corsepius@rtems.org>
+
+ * configure.ac: Require automake > 1.9.
+
+2003-12-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * configure.ac: Require automake >= 1.8, autoconf >= 2.59.
+
+2003-12-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * Makefile.am: Cosmetics.
+
+2003-09-04 Joel Sherrill <joel@OARcorp.com>
+
+ * size_rtems.in: URL for license changed.
+
+2003-08-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * configure.ac: Use rtems-bugs@rtems.com as bug report email address.
+
+2003-03-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * configure.ac: Remove AC_CONFIG_AUX_DIR.
+
+2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * configure.ac: AM_INIT_AUTOMAKE([1.7.2]).
+
+2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * configure.ac: AC_PREREQ(2.57).
+
+2002-10-21 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * .cvsignore: Reformat.
+ Add autom4te*cache.
+ Remove autom4te.cache.
+
+2002-03-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * configure.ac:
+ AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS).
+ AM_INIT_AUTOMAKE([no-define foreign 1.6]).
+ * Makefile.am: Remove AUTOMAKE_OPTIONS.
+
+2001-10-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * .cvsignore: Add autom4te.cache for autoconf > 2.52.
+ * configure.in: Remove.
+ * configure.ac: New file, generated from configure.in by autoupdate.
+
+2000-11-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS.
+
+2000-11-02 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal.
+
+2000-10-30 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * Makefile.am: Switch to GNU-canonicalized autoconf macros.
+
+2000-08-10 Joel Sherrill <joel@OARcorp.com>
+
+ * ChangeLog: New file.
diff --git a/tools/cpu/generic/Makefile.am b/tools/cpu/generic/Makefile.am
new file mode 100644
index 0000000000..8f4d18658f
--- /dev/null
+++ b/tools/cpu/generic/Makefile.am
@@ -0,0 +1,9 @@
+##
+## $Id$
+##
+
+ACLOCAL_AMFLAGS = -I ../../../aclocal
+
+noinst_SCRIPTS = size_rtems
+
+include $(top_srcdir)/../../../automake/host.am
diff --git a/tools/cpu/generic/configure.ac b/tools/cpu/generic/configure.ac
new file mode 100644
index 0000000000..0ac6687587
--- /dev/null
+++ b/tools/cpu/generic/configure.ac
@@ -0,0 +1,23 @@
+## Process this file with autoconf to produce a configure script.
+##
+## $Id$
+
+AC_PREREQ([2.68])
+AC_INIT([rtems-tools-cpu-generic],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
+AC_CONFIG_SRCDIR([size_rtems.in])
+RTEMS_TOP(../../..)
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE([no-define foreign 1.11.1])
+AM_MAINTAINER_MODE
+
+RTEMS_PATH_KSH
+
+RTEMS_TOOLPATHS
+AC_SUBST(program_prefix)
+
+# Explicitly list all Makefiles here
+AC_CONFIG_FILES([Makefile
+size_rtems])
+AC_OUTPUT
diff --git a/tools/cpu/generic/size_rtems.in b/tools/cpu/generic/size_rtems.in
new file mode 100644
index 0000000000..93fa1d59c6
--- /dev/null
+++ b/tools/cpu/generic/size_rtems.in
@@ -0,0 +1,284 @@
+#!@KSH@ -p
+#
+# size_rtems
+#
+# This script gathers information related to the size of RTEMS
+# using the GNU "size" command.
+#
+# This script operates by summing up the sizes of the various
+# object files which constitute a particular configuration of
+# RTEMS. This size information is gathered for placement in the
+# brochure flyers and supplement manuals.
+#
+# NOTE: The concept of the minimum executive size is buried in this script.
+#
+# COPYRIGHT (c) 1989-1999.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+# $Id$
+#
+
+target=@target@
+program_prefix=@program_prefix@
+
+gnusize=${program_prefix}size
+
+# check usage
+if [ $# -ne 2 ] ; then
+ echo usage ${0}: bsp object_directory
+ exit 1
+fi
+
+bsp=$1
+board=$1
+ARCH=$2
+
+cpu=`echo $target | sed -e 's/-.*//'`
+
+case $target in
+ sparc-sun-solaris*)
+ rtems_cpu=unix
+ bsp=solaris2
+ echo Not supported on unix port.
+ exit 0
+ ;;
+ i[34567]86-pc-linux-gnu)
+ echo linux
+ rtems_cpu=unix
+ bsp=linux1
+ echo Not supported on unix port.
+ exit 0
+ ;;
+ i[34567]86-unknown-freebsd2.[12]*)
+ echo freebsd
+ rtems_cpu=unix
+ bsp=freebsd2
+ echo Not supported on unix port.
+ exit 0
+ ;;
+ *-rtems*)
+ cpu=`echo $target | sed -e 's/-.*//'`
+ rtems_cpu=$cpu
+ ;;
+ *)
+ echo unknown target $target
+ exit 1
+ ;;
+esac
+
+case $ARCH in
+ *debug*) VARIANT=debug ;;
+ *profile*) VARIANT=profile ;;
+ *) VARIANT=optimized;;
+esac
+
+echo
+echo Size Information for the Following Configuration:
+echo CPU: ${cpu}
+echo BSP: ${board}
+echo VARIANT: ${VARIANT}
+echo
+
+
+#
+# KLUDGE to figure out at runtime how to echo a line without a
+# newline.
+#
+count=`echo "\\c" | wc -c`
+if [ ${count} -ne 0 ] ; then
+ EARG="-n"
+ EOL=""
+else
+ EARG=""
+ EOL="\\c"
+fi
+
+if [ ! -d ../${board} ] ; then
+ echo "${board} does not exist ... is the current directory the build directory?"
+ exit 1
+fi
+
+#DIRLIST -- so greps for DIRLIST will find this file
+CPUOBJ=exec/score/cpu/${rtems_cpu}/wrap/${ARCH}
+COREOBJ=exec/score/src/${ARCH}
+RTEMSOBJ=exec/rtems/src/${ARCH}
+SAPIOBJ=exec/sapi/src/${ARCH}
+OPTOBJ=exec/rtems/optman/${ARCH}
+
+# XXX These have been split up
+MANLIST=" \
+${RTEMSOBJ}/clockget.o \
+${RTEMSOBJ}/clockset.o \
+${RTEMSOBJ}/clocktick.o \
+${RTEMSOBJ}/dpmem.o \
+${RTEMSOBJ}/event.o \
+${RTEMSOBJ}/intr.o \
+${RTEMSOBJ}/msg.o \
+${RTEMSOBJ}/part.o \
+${RTEMSOBJ}/ratemon.o \
+${RTEMSOBJ}/region.o \
+${RTEMSOBJ}/sem.o \
+${RTEMSOBJ}/signal.o \
+${RTEMSOBJ}/tasks.o \
+${RTEMSOBJ}/timer.o \
+${SAPIOBJ}/debug.o \
+${SAPIOBJ}/extension.o \
+${SAPIOBJ}/fatal.o \
+${SAPIOBJ}/exinit.o \
+${SAPIOBJ}/io.o \
+${SAPIOBJ}/rtemsapi.o \
+"
+
+if [ -r ${RTEMSOBJ}/mp.o ] ; then
+ MPLIST="\
+ ${RTEMSOBJ}/mp.o ${RTEMSOBJ}/eventmp.o \
+ ${COREOBJ}/mpci.o ${RTEMSOBJ}/msgmp.o ${COREOBJ}/objectmp.o \
+ ${RTEMSOBJ}/partmp.o ${RTEMSOBJ}/regionmp.o ${RTEMSOBJ}/semmp.o \
+ ${RTEMSOBJ}/signalmp.o ${RTEMSOBJ}/taskmp.o ${COREOBJ}/threadmp.o \
+ "
+
+ MPOBJLIST=${OPTOBJ}/no-mp.rel
+fi
+
+OPTMANLIST="\
+${OPTOBJ}/no-dpmem.rel \
+${OPTOBJ}/no-event.rel \
+${MPOBJLIST} \
+${OPTOBJ}/no-msg.rel \
+${OPTOBJ}/no-part.rel \
+${OPTOBJ}/no-region.rel \
+${OPTOBJ}/no-rtmon.rel \
+${OPTOBJ}/no-sem.rel \
+${OPTOBJ}/no-signal.rel \
+${OPTOBJ}/no-timer.rel \
+"
+REQMANLIST="\
+${SAPIOBJ}/exinit.o \
+${RTEMSOBJ}/tasks.o \
+${RTEMSOBJ}/intr.o \
+${SAPIOBJ}/fatal.o \
+"
+# XXX parts of these have been split up
+CORELIST=" \
+${COREOBJ}/apiext.o ${COREOBJ}/chain.o \
+${COREOBJ}/coremsg.o ${COREOBJ}/coremutex.o ${COREOBJ}/coresem.o \
+${COREOBJ}/heap.o ${COREOBJ}/interr.o \
+${COREOBJ}/isr.o \
+${COREOBJ}/object.o \
+${SAPIOBJ}/rtemsapi.o \
+${COREOBJ}/thread.o ${COREOBJ}/threadq.o ${COREOBJ}/tod.o \
+${COREOBJ}/userext.o \
+${COREOBJ}/watchdog.o ${COREOBJ}/wkspace.o \
+"
+
+CPULIST="\
+${CPUOBJ}/rtems-cpu.rel \
+"
+
+# check directories
+for i in ${EXECOBJ} ${CPUOBJ} ${OPTOBJ}
+do
+ if [ ! -d ${i} ] ; then
+ echo "${i} does not exist ... is RTEMS compiled and installed?"
+ exit 1
+ fi
+done
+
+for i in ${MANLIST} ${MPLIST} ${OPTMANLIST} ${REQMANLIST} ${CORELIST} ${CPULIST}
+do
+ if [ ! -r ${i} ] ; then
+ echo ${i} does not exist ... is RTEMS compiled and installed?
+ exit 1
+ fi
+done
+
+# "rips" a line of gsize's output and prints size, data, bss
+parse_size()
+{
+ echo $1 $2 $3
+}
+
+# prepares a list of code, data, bss sizes for a directory
+sizedir()
+{
+ ${gnusize} $* | sed -e '1,1d' |
+ while read line
+ do
+ parse_size ${line}
+ done
+}
+
+# adds the numbers passed on the command line
+addit()
+{
+ sumx=0
+ for x in $*
+ do
+ sumx=`expr $sumx + $x`
+ done
+ echo $sumx
+}
+
+# adds a column from the output of sizedir
+addsizes()
+{
+ # dc version is not portable enough -- It can be left out during
+ # installing linux and may not be available on non-UNIX hosts.
+ #cut -d' ' -f${2} ${1} | sed -e '2,$s/$/ + /' -e '$,$s/$/ p/' | dc
+
+ # This may not be as fast but it is probably more portable.
+ addit `cut -d' ' -f${2} ${1}`
+}
+
+# calculates total size of a directory and prints report line
+size_files()
+{
+ trap "rm -f /tmp/size.$$ ; exit 1" 2 3
+
+ for file in $*
+ do
+ parse_size `${gnusize} $file | sed -e '/text/d'`
+ done >/tmp/size.$$
+
+ code=`cat /tmp/size.$$ | addsizes 1`
+ data=`cat /tmp/size.$$ | addsizes 2`
+ bss=` cat /tmp/size.$$ | addsizes 3`
+ echo "${code} ${data} ${bss}"
+ rm /tmp/size.$$
+}
+
+echo
+echo " RTEMS SIZE REPORT"
+echo
+echo " CODE DATA BSS"
+echo " =================="
+echo ${EARG} "MANAGERS: " ${EOL} ; size_files $MANLIST $MPLIST
+echo ${EARG} "CORE : " ${EOL} ; size_files $CORELIST $CPULIST
+echo ${EARG} "CPU : " ${EOL} ; size_files $CPULIST
+echo ${EARG} "OVERALL : " ${EOL} ; size_files $CPULIST $CORELIST $MANLIST \
+ $MPLIST
+echo ${EARG} "MINIMUM : " ${EOL} ; size_files $CPULIST $CORELIST \
+ $OPTMANLIST $REQMANLIST
+echo
+
+for file in $MANLIST
+do
+ base=`basename ${file}`
+ echo ${EARG} ""${base} : " ${EOL} " ; size_files ${file}
+done
+
+echo ${EARG} "MP : " ${EOL} ; size_files $MPLIST
+
+echo
+for file in $OPTMANLIST
+do
+ base=`basename ${file}`
+ echo ${EARG} "${base} : " ${EOL} ; size_files ${file}
+done
+
+echo
+exit 0