Mercurial > ecos-v3_0-branch
changeset 126:518f42066aba ecos-sw-2000-09-19
Merge from eCos master repository on 2000-09-19-06:25:26-BST
line wrap: on
line diff
--- a/host/ChangeLog +++ b/host/ChangeLog @@ -1,3 +1,14 @@ +2000-09-15 Jesper Skov <jskov@redhat.com> + + * Makefile.in: Added ser_filter rules. + * configure: Ditto. + * configure.in: Ditto. + +2000-09-12 Bart Veer <bartv@redhat.com> + + * README + Clarify which configure script should be used. + 2000-08-18 Bart Veer <bartv@redhat.com> * configure.in:
--- a/host/Makefile.in +++ b/host/Makefile.in @@ -91,7 +91,7 @@ install-sh ltconfig ltmain.sh missing mk DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES:
--- a/host/README +++ b/host/README @@ -100,9 +100,14 @@ well. $ mkdir build $ cd build -The next step is to run the toplevel configure script. It might be -possible to configure and build individual directories within the -host-side hierarchy, but again this has not been tested. +The next step is to run the toplevel configure script, in other words +the configure script in the same directory as this README file. This +will automatically recurse into the various subdirectories for the +infrastructure, libcdl, and so on. Note that all of the host-side +software needs to be configured and built: it is not possible to +invoke just the configure script for the ecosconfig tool and build +just that tool, because there are dependencies on other parts of the +host-side code. $ <path>/configure <args>
--- a/host/configure +++ b/host/configure @@ -1673,6 +1673,11 @@ ECOS_DIRS="infra libcdl" +if test -f ${srcdir}/tools/Utils/common/configure; then + ECOS_DIRS="${ECOS_DIRS} tools/Utils/common" + +fi + if test -f ${srcdir}/tools/ecostest/common/configure; then ECOS_DIRS="${ECOS_DIRS} tools/ecostest/common" @@ -1968,9 +1973,15 @@ cat >> $CONFIG_STATUS <<EOF + EOF cat >> $CONFIG_STATUS <<\EOF + test -d tools || mkdir tools + test -d tools/Utils || mkdir tools/Utils + test -d tools/Utils/common || mkdir tools/Utils/common + + test -d tools || mkdir tools test -d tools/ecostest || mkdir tools/ecostest test -d tools/ecostest/common || mkdir tools/ecostest/common
--- a/host/configure.in +++ b/host/configure.in @@ -132,6 +132,15 @@ dnl ]) dnl -------------------------------------------------------------------- dnl Add any other directories that are autoconfiscated and present +if test -f ${srcdir}/tools/Utils/common/configure; then + ECOS_DIRS="${ECOS_DIRS} tools/Utils/common" + AC_OUTPUT_COMMANDS([ + test -d tools || mkdir tools + test -d tools/Utils || mkdir tools/Utils + test -d tools/Utils/common || mkdir tools/Utils/common + ]) +fi + if test -f ${srcdir}/tools/ecostest/common/configure; then ECOS_DIRS="${ECOS_DIRS} tools/ecostest/common" AC_OUTPUT_COMMANDS([
--- a/host/infra/ChangeLog +++ b/host/infra/ChangeLog @@ -1,3 +1,8 @@ +2000-09-15 Jesper Skov <jskov@redhat.com> + + * assert.cxx: Include unistd.h on unix. + Oops. Forgot the C wrapper. + 2000-08-18 Bart Veer <bartv@redhat.com> * acinclude.m4, configure.in:
--- a/host/infra/assert.cxx +++ b/host/infra/assert.cxx @@ -61,6 +61,12 @@ #include <cstdio> #include <cstdlib> +#ifdef __unix__ +extern "C" { +#include <unistd.h> // Needed for _exit() +} +#endif + // These are needed for the table of callbacks. #include <utility> #include <iterator>
--- a/host/tools/Utils/ChangeLog +++ b/host/tools/Utils/ChangeLog @@ -1,3 +1,20 @@ +2000-09-15 Jesper Skov <jskov@redhat.com> + + * common/Makefile.in: Regenerated. + * common/configure: Ditto. + + * common/eCosSocket.h: Made SSReadResult enum public. + + * common/Makefile.am: Added autoconf/make support. + * common/Makefile.in: Ditto. + * common/configure: Ditto. + * common/configure.in: Ditto. + * common/acinclude.m4: Ditto. + * common/aclocal.m4: Ditto. + + * common/wcharunix.h (_tperror): Make putenv convert String to + char*. + 2000-08-01 Jonathan Larmour <jlarmour@redhat.co.uk> * common/eCosSerial.h:
new file mode 100644 --- /dev/null +++ b/host/tools/Utils/common/Makefile.am @@ -0,0 +1,53 @@ +## Process this file with automake to produce Makefile.in +## ===================================================================== +## +## Makefile.am +## +## utils +## +## ===================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Red Hat eCos Public License +# Version 1.1 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.redhat.com/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Configurable Operating System, +# released September 30, 1998. +# +# The Initial Developer of the Original Code is Red Hat. +# Portions created by Red Hat are +# Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +# All Rights Reserved. +# ------------------------------------------- +# +######COPYRIGHTEND#### +## ===================================================================== +#######DESCRIPTIONBEGIN#### +## +## Author(s): jskov +## Contact(s): jskov +## Date: 2000/09/15 +## Version: 0.01 +## +######DESCRIPTIONEND#### +## ===================================================================== + +AUTOMAKE_OPTIONS = 1.3 cygnus +SUBDIRS = + +## Pick up an appropriate header file search path from configure + +noinst_LIBRARIES = libutils.a + +libutils_a_SOURCES = Collections.cpp Subprocess.cpp eCosSocket.cpp \ + eCosThreadUtils.cpp Properties.cpp eCosSerial.cpp \ + eCosStd.cpp eCosTrace.cpp +
new file mode 100644 --- /dev/null +++ b/host/tools/Utils/common/Makefile.in @@ -0,0 +1,433 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 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. + +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Red Hat eCos Public License +# Version 1.1 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.redhat.com/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Configurable Operating System, +# released September 30, 1998. +# +# The Initial Developer of the Original Code is Red Hat. +# Portions created by Red Hat are +# Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +# All Rights Reserved. +# ------------------------------------------- +# +######COPYRIGHTEND#### +#######DESCRIPTIONBEGIN#### +######DESCRIPTIONEND#### + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +CC = @CC@ +CXX = @CXX@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +cyg_ac_tcl_incdir = @cyg_ac_tcl_incdir@ +cyg_ac_tcl_libdir = @cyg_ac_tcl_libdir@ +cyg_ac_tcl_libs = @cyg_ac_tcl_libs@ +cyg_ac_tcl_version = @cyg_ac_tcl_version@ +cyg_ac_tk_libs = @cyg_ac_tk_libs@ + +AUTOMAKE_OPTIONS = 1.3 cygnus +SUBDIRS = + +noinst_LIBRARIES = libutils.a + +libutils_a_SOURCES = Collections.cpp Subprocess.cpp eCosSocket.cpp \ + eCosThreadUtils.cpp Properties.cpp eCosSerial.cpp \ + eCosStd.cpp eCosTrace.cpp + +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +libutils_a_LIBADD = +libutils_a_OBJECTS = Collections.$(OBJEXT) Subprocess.$(OBJEXT) \ +eCosSocket.$(OBJEXT) eCosThreadUtils.$(OBJEXT) Properties.$(OBJEXT) \ +eCosSerial.$(OBJEXT) eCosStd.$(OBJEXT) eCosTrace.$(OBJEXT) +AR = ar +CXXFLAGS = @CXXFLAGS@ +CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in acinclude.m4 aclocal.m4 configure \ +configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +SOURCES = $(libutils_a_SOURCES) +OBJECTS = $(libutils_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .cpp .o .obj .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 + cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +libutils.a: $(libutils_a_OBJECTS) $(libutils_a_DEPENDENCIES) + -rm -f libutils.a + $(AR) cru libutils.a $(libutils_a_OBJECTS) $(libutils_a_LIBADD) + $(RANLIB) libutils.a +.cpp.o: + $(CXXCOMPILE) -c $< +.cpp.obj: + $(CXXCOMPILE) -c `cygpath -w $<` + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive install-info-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-info-am: +install-info: install-info-recursive +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: +uninstall: uninstall-recursive +all-am: Makefile $(LIBRARIES) +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-recursive + -rm -f config.status + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile install-data-recursive \ +uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-info-am \ +install-info install-exec-am install-exec install-data-am install-data \ +install-am install uninstall-am uninstall all-redirect all-am all \ +installdirs-am installdirs mostlyclean-generic distclean-generic \ +clean-generic maintainer-clean-generic clean mostlyclean distclean \ +maintainer-clean + + +# 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:
new file mode 100644 --- /dev/null +++ b/host/tools/Utils/common/acinclude.m4 @@ -0,0 +1,45 @@ +dnl Process this file with aclocal to get an aclocal.m4 file. Then +dnl process that with autoconf. +dnl ==================================================================== +dnl +dnl acinclude.m4 +dnl +dnl ==================================================================== +dnl###COPYRIGHTBEGIN#### +dnl +dnl ------------------------------------------- +dnl The contents of this file are subject to the Red Hat eCos Public License +dnl Version 1.1 (the "License"); you may not use this file except in +dnl compliance with the License. You may obtain a copy of the License at +dnl http://www.redhat.com/ +dnl +dnl Software distributed under the License is distributed on an "AS IS" +dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +dnl License for the specific language governing rights and limitations under +dnl the License. +dnl +dnl The Original Code is eCos - Embedded Configurable Operating System, +dnl released September 30, 1998. +dnl +dnl The Initial Developer of the Original Code is Red Hat. +dnl Portions created by Red Hat are +dnl Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +dnl All Rights Reserved. +dnl ------------------------------------------- +dnl +dnl####COPYRIGHTEND#### +dnl ==================================================================== +dnl#####DESCRIPTIONBEGIN#### +dnl +dnl Author(s): bartv +dnl Contact(s): bartv +dnl Date: 1999/08/11 +dnl Version: 0.01 +dnl +dnl####DESCRIPTIONEND#### +dnl ==================================================================== + +dnl Access shared macros. +dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not +dnl incorporate the macro into aclocal.m4 +sinclude(../../../acinclude.m4)
new file mode 100644 --- /dev/null +++ b/host/tools/Utils/common/aclocal.m4 @@ -0,0 +1,183 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl Process this file with aclocal to get an aclocal.m4 file. Then +dnl process that with autoconf. +dnl ==================================================================== +dnl +dnl acinclude.m4 +dnl +dnl ==================================================================== +dnl###COPYRIGHTBEGIN#### +dnl +dnl ------------------------------------------- +dnl The contents of this file are subject to the Red Hat eCos Public License +dnl Version 1.1 (the "License"); you may not use this file except in +dnl compliance with the License. You may obtain a copy of the License at +dnl http://www.redhat.com/ +dnl +dnl Software distributed under the License is distributed on an "AS IS" +dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +dnl License for the specific language governing rights and limitations under +dnl the License. +dnl +dnl The Original Code is eCos - Embedded Configurable Operating System, +dnl released September 30, 1998. +dnl +dnl The Initial Developer of the Original Code is Red Hat. +dnl Portions created by Red Hat are +dnl Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +dnl All Rights Reserved. +dnl ------------------------------------------- +dnl +dnl####COPYRIGHTEND#### +dnl ==================================================================== +dnl#####DESCRIPTIONBEGIN#### +dnl +dnl Author(s): bartv +dnl Contact(s): bartv +dnl Date: 1999/08/11 +dnl Version: 0.01 +dnl +dnl####DESCRIPTIONEND#### +dnl ==================================================================== + +dnl Access shared macros. +dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not +dnl incorporate the macro into aclocal.m4 +sinclude(../../../acinclude.m4) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) +
new file mode 100644 --- /dev/null +++ b/host/tools/Utils/common/configure @@ -0,0 +1,1746 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" +ac_help="$ac_help + --enable-debug do a debug rather than a release build" +ac_help="$ac_help + --enable-ansi Do an ANSI rather than a unicode build" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=eCosStd.cpp + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../.. $srcdir/../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../.. $srcdir/../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:571: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:604: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:657: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:714: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=libutils + +VERSION=0.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <<EOF +#define PACKAGE "$PACKAGE" +EOF + +cat >> confdefs.h <<EOF +#define VERSION "$VERSION" +EOF + + + +missing_dir=`cd $ac_aux_dir && pwd` +echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 +echo "configure:760: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:773: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:786: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:799: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:812: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:826: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:850: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:879: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:909: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:960: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:992: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 1003 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:1008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1034: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1039: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1048: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1067: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1103: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CXX="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CXX="$ac_cv_prog_CXX" +if test -n "$CXX"; then + echo "$ac_t""$CXX" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CXX" && break +done +test -n "$CXX" || CXX="gcc" + + +echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:1135: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 + +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + +cat > conftest.$ac_ext << EOF + +#line 1146 "configure" +#include "confdefs.h" + +int main(){return(0);} +EOF +if { (eval echo configure:1151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cxx_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cxx_cross=no + else + ac_cv_prog_cxx_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cxx_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 +if test $ac_cv_prog_cxx_works = no; then + { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1177: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 +cross_compiling=$ac_cv_prog_cxx_cross + +echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 +echo "configure:1182: checking whether we are using GNU C++" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.C <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gxx=yes +else + ac_cv_prog_gxx=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gxx" 1>&6 + +if test $ac_cv_prog_gxx = yes; then + GXX=yes +else + GXX= +fi + +ac_test_CXXFLAGS="${CXXFLAGS+set}" +ac_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS= +echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 +echo "configure:1210: checking whether ${CXX-g++} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.cc +if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then + ac_cv_prog_cxx_g=yes +else + ac_cv_prog_cxx_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS="$ac_save_CXXFLAGS" +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1244: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking for object suffix""... $ac_c" 1>&6 +echo "configure:1272: checking for object suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftest* +echo 'int i = 1;' > conftest.$ac_ext +if { (eval echo configure:1278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; + *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; + esac + done +else + { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_objext" 1>&6 +OBJEXT=$ac_cv_objext +ac_objext=$ac_cv_objext + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:1296: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1301 "configure" +#include "confdefs.h" + +int main() { + +#ifndef __CYGWIN__ +#define __CYGWIN__ __CYGWIN32__ +#endif +return __CYGWIN__; +; return 0; } +EOF +if { (eval echo configure:1312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:1329: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1334 "configure" +#include "confdefs.h" + +int main() { +return __MINGW32__; +; return 0; } +EOF +if { (eval echo configure:1341: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1360: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + + + + + + echo $ac_n "checking "for Visual C++"""... $ac_c" 1>&6 +echo "configure:1395: checking "for Visual C++"" >&5 + MSVC="no"; + if test "${CC}" = "cl" ; then + MSVC="yes" + fi + if test "${CXX}" = "cl" ; then + MSVC="yes" + fi + + +if test "${MSVC}" = "yes"; then + MSVC_TRUE= + MSVC_FALSE='#' +else + MSVC_TRUE='#' + MSVC_FALSE= +fi + echo "$ac_t""${MSVC}" 1>&6 + + + + + + + echo $ac_n "checking "the default compiler flags"""... $ac_c" 1>&6 +echo "configure:1420: checking "the default compiler flags"" >&5 + + cygflags_enable_debug="no" + # Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + case "${enableval}" in + yes) cygflags_enable_debug="yes" ;; + *) cygflags_enable_debug="no" ;; + esac +fi + + + cygflags_enable_ansi="no" + if test "${MSVC}" = "yes" ; then + # Check whether --enable-ansi or --disable-ansi was given. +if test "${enable_ansi+set}" = set; then + enableval="$enable_ansi" + case "${enableval}" in + yes) cygflags_enable_ansi="yes" ;; + *) cygflags_enable_ansi="no" ;; + esac +fi + + fi + + if test "${GCC}" = "yes" ; then + CC="$CC -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs" + CXX="$CXX -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual" + elif test "${MSVC}" = "yes" ; then + CC="$CC -nologo -W3" + CXX="$CXX -nologo -W3 -GR -GX" + if test "${cygflags_enable_debug}" = "yes" ; then + CC="$CC -MDd -Zi" + CXX="$CXX -MDd -Zi" + else + CC="$CC -MD -O2" + CXX="$CXX -MD -O2" + fi + else + { echo "configure: error: "default flags for ${CC} are not known"" 1>&2; exit 1; } + fi + echo "$ac_t""done" 1>&6 + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@CC@%$CC%g +s%@CXX@%$CXX%g +s%@RANLIB@%$RANLIB%g +s%@OBJEXT@%$OBJEXT%g +s%@EXEEXT@%$EXEEXT%g +s%@MSVC_TRUE@%$MSVC_TRUE%g +s%@MSVC_FALSE@%$MSVC_FALSE%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile"} +EOF +cat >> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <<EOF + +EOF +cat >> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +
new file mode 100644 --- /dev/null +++ b/host/tools/Utils/common/configure.in @@ -0,0 +1,64 @@ +dnl Process this file with autoconf to produce a configure script. +dnl ==================================================================== +dnl +dnl configure.in +dnl +dnl Utils +dnl +dnl ==================================================================== +dnl###COPYRIGHTBEGIN#### +dnl +dnl ------------------------------------------- +dnl The contents of this file are subject to the Red Hat eCos Public License +dnl Version 1.1 (the "License"); you may not use this file except in +dnl compliance with the License. You may obtain a copy of the License at +dnl http://www.redhat.com/ +dnl +dnl Software distributed under the License is distributed on an "AS IS" +dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +dnl License for the specific language governing rights and limitations under +dnl the License. +dnl +dnl The Original Code is eCos - Embedded Configurable Operating System, +dnl released September 30, 1998. +dnl +dnl The Initial Developer of the Original Code is Red Hat. +dnl Portions created by Red Hat are +dnl Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +dnl All Rights Reserved. +dnl ------------------------------------------- +dnl +dnl####COPYRIGHTEND#### +dnl ==================================================================== +dnl#####DESCRIPTIONBEGIN#### +dnl +dnl Author(s): bartv,jskov +dnl Contact(s): jskov +dnl Date: 2000/09/15 +dnl Version: 0.01 +dnl +dnl####DESCRIPTIONEND#### +dnl ==================================================================== + +AC_INIT(eCosStd.cpp) + +dnl Pick up the support files from the top-level of the source tree +AC_CONFIG_AUX_DIR(../../..) + +dnl Other standard options. +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(libutils, 0.1) +AM_MAINTAINER_MODE + +dnl Other standard options. +AC_PROG_MAKE_SET +AC_PROG_CC +AC_PROG_CXX +AC_PROG_RANLIB +AC_OBJEXT +AC_EXEEXT +CYG_AC_PROG_MSVC +CYG_AC_PROG_STANDARD_COMPILER_FLAGS + +AC_OUTPUT(Makefile)
--- a/host/tools/Utils/common/eCosSocket.h +++ b/host/tools/Utils/common/eCosSocket.h @@ -164,6 +164,8 @@ public: // Set up a connection between two sockets. Traffic is simply passed between them. bool ConnectSocketToSocket (CeCosSocket &o,FilterFunc *pSocketToSocketFilterFunc1,FilterFunc *pSocketToSocketFilterFunc2,void *pParam,bool *pbStop); + enum SSReadResult {SS_SOCKET_ERROR=-1,SS_SOCKET_READ=1,SS_SERIAL_ERROR=-2,SS_SERIAL_READ=2,SS_STOPPED=0}; + protected: // Blocking read on one or other of the data sources: @@ -172,7 +174,6 @@ protected: // -2 - serial error occurred // 2 - data read from serial - enum SSReadResult {SS_SOCKET_ERROR=-1,SS_SOCKET_READ=1,SS_SERIAL_ERROR=-2,SS_SERIAL_READ=2,SS_STOPPED=0}; static SSReadResult SSRead (CeCosSerial &serial,CeCosSocket &socket,void *pBuf,unsigned int nSize,unsigned int &nRead,bool *pbStop); Duration m_nDefaultTimeout;
--- a/host/tools/Utils/common/wcharunix.h +++ b/host/tools/Utils/common/wcharunix.h @@ -148,7 +148,8 @@ #define _tfullpath fullpath #define _tgetenv getenv #define _tmakepath makepath -#define _tputenv putenv +// Yuck - /usr/include/stdlib.h defines it as char*, not const char* +#define _tputenv(s) putenv((char*)(s.c_str())) #define _tsearchenv searchenv #define _tsplitpath splitpath
--- a/host/tools/ecostest/ChangeLog +++ b/host/tools/ecostest/ChangeLog @@ -1,3 +1,13 @@ +2000-09-15 Jesper Skov <jskov@redhat.com> + + * common/ser_filter.cpp (main): Don't require ResourceServer. + + * common/Makefile.am: Added ser_filter handling. + * common/Makefile.in: Ditto. + * common/configure: Ditto. + * common/configure.in: Ditto. + * common/eCosTest.cpp: Fix typo. + 2000-08-16 Jonathan Larmour <jlarmour@redhat.co.uk> * common/ser_filter.cpp (main): Clean up warning
--- a/host/tools/ecostest/common/eCosTest.cpp +++ b/host/tools/ecostest/common/eCosTest.cpp @@ -256,7 +256,7 @@ bool CeCosTest::RunLocal() TRACE(_T("LocalThreadFunc - target=%s\n"),(LPCTSTR)m_ep.PlatformName()); // Acquire a port (our caller may have done this for us) - VTRACE(_T("LocalThreadFunc():Tring to acquire a port\n")); + VTRACE(_T("LocalThreadFunc():Trying to acquire a port\n")); if(0==m_pResource){ for(;;){ m_pResource=CTestResource::GetResource(m_ep);
--- a/host/tools/ecostest/common/ser_filter.cpp +++ b/host/tools/ecostest/common/ser_filter.cpp @@ -127,7 +127,7 @@ main(int argc, char** argv) bool opt_no_gdb = false; char* ser_port; int i=1; - if(!CeCosTestUtils::CommandLine(argc,argv)){ + if(!CeCosTestUtils::CommandLine(argc, argv, false)){ goto Usage; }
--- a/packages/ChangeLog +++ b/packages/ChangeLog @@ -1,3 +1,11 @@ +2000-09-15 Jesper Skov <jskov@redhat.com> + + * ecos.db: Made PID use generic 16x5x driver. + +2000-09-14 Jesper Skov <jskov@redhat.com> + + * ecos.db: Added generic 16x5x driver package. + 2000-09-06 Jesper Skov <jskov@redhat.com> * ecos.db: SH serial driver reorg changes.
--- a/packages/compat/uitron/current/ChangeLog +++ b/packages/compat/uitron/current/ChangeLog @@ -1,3 +1,8 @@ +2000-09-13 Jonathan Larmour <jlarmour@redhat.com> + + * include/uit_objs.hxx (CYG_UITRON_OBJS_INIT_PRIORITY): Define + with correct priority now. + 2000-08-03 Jonathan Larmour <jlarmour@redhat.co.uk> * include/uit_func.inl (ref_mpf): Compute used blocks from
--- a/packages/compat/uitron/current/include/uit_objs.hxx +++ b/packages/compat/uitron/current/include/uit_objs.hxx @@ -75,11 +75,7 @@ // Macro to declare static uitron static objects; uses the appropriate // config define for the number of them to have. -#if 0 #define CYG_UITRON_OBJS_INIT_PRIORITY CYG_INIT_PRIORITY( COMPAT ) -#else -#define CYG_UITRON_OBJS_INIT_PRIORITY // nothing -#endif #define CYG_UITRON_DECL( _which_ ) \ CYG_UITRON_OBJS( _which_ ) [ CYG_UITRON_NUM( _which_ ) ] \
--- a/packages/devs/eth/arm/ebsa285/current/ChangeLog +++ b/packages/devs/eth/arm/ebsa285/current/ChangeLog @@ -1,3 +1,9 @@ +2000-09-11 Hugo Tyson <hmt@cygnus.co.uk> + + * src/if_ebsa285.c (i82559_poll): Only diddle the interface we + were asked to. This is more correct in terms of the intent of the + API, though it shouldn't really be necessary. + 2000-09-06 Hugo Tyson <hmt@cygnus.co.uk> * src/if_ebsa285.c (pci_init_find_82559s): Add asserts and an
--- a/packages/devs/eth/arm/ebsa285/current/src/if_ebsa285.c +++ b/packages/devs/eth/arm/ebsa285/current/src/if_ebsa285.c @@ -1790,6 +1790,7 @@ void i82559_deliver(struct eth_drv_sc *s // ------------------------------------------------------------------------ // Device table entry to operate the chip in a polled mode. +// Only diddle the interface we were asked to! void i82559_poll(struct eth_drv_sc *sc) { @@ -1804,9 +1805,9 @@ void i82559_poll(struct eth_drv_sc *sc) } // As it happens, this driver always requests the DSR to be called: - (void)eth_mux_isr( CYGNUM_HAL_INTERRUPT_PCI_IRQ, (cyg_addrword_t)p_i82559 ); - - i82559_deliver( NULL /* arg is not used */ ); + (void)eth_isr( CYGNUM_HAL_INTERRUPT_PCI_IRQ, (cyg_addrword_t)p_i82559 ); + + uni_deliver( p_i82559 ); } // ------------------------------------------------------------------------
--- a/packages/devs/eth/arm/edb7xxx/current/ChangeLog +++ b/packages/devs/eth/arm/edb7xxx/current/ChangeLog @@ -1,3 +1,9 @@ +2000-09-17 Gary Thomas <gthomas@redhat.com> + + * src/if_edb7xxx.c (cs8900_can_send): Add simple timeout on Tx. + Since this chip has to way to test "can send" and it seems to + sometimes loose Tx interrupts, this is necessary. + 2000-09-01 Hugo Tyson <hmt@cygnus.co.uk> * src/if_edb7xxx.c (edb7xxx_cs8900_init): Work with new fast net
--- a/packages/devs/eth/arm/edb7xxx/current/src/if_edb7xxx.c +++ b/packages/devs/eth/arm/edb7xxx/current/src/if_edb7xxx.c @@ -59,6 +59,7 @@ #include <pkgconf/devs_eth_arm_edb7xxx.h> #ifdef CYGPKG_NET #include <pkgconf/net.h> +#include <cyg/kernel/kapi.h> #endif #include <cyg/infra/cyg_type.h> #include <cyg/hal/hal_arch.h> @@ -103,6 +104,9 @@ extern int net_debug; // FIXME struct cs8900_priv_data { int txbusy; // A packet has been sent unsigned long txkey; // Used to ack when packet sent +#ifdef CYGPKG_NET + cyg_tick_count_t txstart; +#endif } _cs8900_priv_data; ETH_DRV_SC(edb7xxx_sc, @@ -295,6 +299,19 @@ cs8900_can_send(struct eth_drv_sc *sc) if ((stat & PP_LineStat_LinkOK) == 0) { return false; // Link not connected } +#ifdef CYGPKG_NET + // Horrible hack! + if (cpd->txbusy > 0) { + cyg_tick_count_t now = cyg_current_time(); + if ((now - cpd->txstart) > 25) { + // 250ms is more than enough to transmit one frame + diag_printf("CS8900: Tx interrupt lost\n"); + cpd->txbusy = 0; + // Free up the buffer (with error indication) + (sc->funs->eth_drv->tx_done)(sc, cpd->txkey, 1); + } + } +#endif return (cpd->txbusy == 0); } @@ -315,10 +332,13 @@ cs8900_send(struct eth_drv_sc *sc, struc // Mark xmitter busy cpd->txbusy = 1; cpd->txkey = key; +#ifdef CYGPKG_NET + cpd->txstart = cyg_current_time(); +#endif // Start the xmit sequence // Note: this can go back once the 'dump' is removed -// CS8900_TxCMD = PP_TxCmd_TxStart_5; // Start more-or-less immediately - CS8900_TxCMD = PP_TxCmd_TxStart_Full; // Start only when all data sent to chip + CS8900_TxCMD = PP_TxCmd_TxStart_5; // Start more-or-less immediately +// CS8900_TxCMD = PP_TxCmd_TxStart_Full; // Start only when all data sent to chip CS8900_TxLEN = total_len; stat = get_reg(PP_BusStat); // This actually starts the xmit
--- a/packages/devs/eth/cf/current/ChangeLog +++ b/packages/devs/eth/cf/current/ChangeLog @@ -1,3 +1,24 @@ +2000-09-15 Gary Thomas <gthomas@redhat.com> + + * src/if_sc_lpe.c: Suppress noisy message which seems to sometimes + happen if the card is re-initialized from warm. + +2000-09-14 Gary Thomas <gthomas@redhat.com> + + * src/if_sc_lpe.c: Better recovery for bad devices [stand-alone]. + +2000-09-13 Gary Thomas <gthomas@redhat.com> + + * src/if_sc_lpe.c: Fix handling of receive buffer overflow, + i.e. missed data. [quietly ignored] + + * src/dp8390.h: Update layout of Tx/Rx buffers. + +2000-09-12 Gary Thomas <gthomas@redhat.com> + + * src/if_sc_lpe.c (sc_lpe_card_handler): Handle case when card + is warm (powered up from boot ROM). + 2000-09-01 Hugo Tyson <hmt@cygnus.co.uk> * src/if_sc_lpe.c (sc_lpe_init): Work with new fast net
--- a/packages/devs/eth/cf/current/src/dp8390.h +++ b/packages/devs/eth/cf/current/src/dp8390.h @@ -231,27 +231,10 @@ typedef volatile union { #define DP8390_TSR_OWC 0x80 // Collision outside normal window // Page (buffer) allocation -#if 0 -#define DP8390_RX_START 1 -#define DP8390_RX_STOP 255-12 -#define DP8390_TX_BUF1 (DP8390_RX_STOP+1) -#define DP8390_TX_BUF2 (DP8390_TX_BUF1+6) -#define DP8390_TX_STOP 255 -#else -#if 0 -#define DP8390_RX_START 1 -#define DP8390_RX_STOP 127-12 -#define DP8390_TX_BUF1 (DP8390_RX_STOP+1) -#define DP8390_TX_BUF2 (DP8390_TX_BUF1+6) -#define DP8390_TX_STOP 127 -#else -#define DP8390_RX_START 0x60 +#define DP8390_TX_BUF1 0x40 +#define DP8390_TX_BUF2 0x48 +#define DP8390_RX_START 0x50 #define DP8390_RX_STOP 0x80 -#define DP8390_TX_BUF1 0x40 -#define DP8390_TX_BUF2 0x50 -#define DP8390_TX_STOP 127 -#endif -#endif #define IEEE_8023_MAX_FRAME 1518 // Largest possible ethernet frame #define IEEE_8023_MIN_FRAME 64 // Smallest possible ethernet frame
--- a/packages/devs/eth/cf/current/src/if_sc_lpe.c +++ b/packages/devs/eth/cf/current/src/if_sc_lpe.c @@ -148,19 +148,26 @@ sc_lpe_card_handler(cyg_addrword_t param #ifndef CYGPKG_NET int tries = 0; #endif + bool first = true; slot = dp->slot; cyg_drv_dsr_lock(); while (true) { cyg_drv_dsr_unlock(); // Give DSRs a chance to run (card insertion) cyg_drv_dsr_lock(); - if (slot->state == CF_SLOT_STATE_Inserted) { + if ((slot->state == CF_SLOT_STATE_Inserted) || + ((slot->state == CF_SLOT_STATE_Ready) && first)) { + first = false; if (slot->state != CF_SLOT_STATE_Ready) { cf_change_state(slot, CF_SLOT_STATE_Ready); } if (slot->state != CF_SLOT_STATE_Ready) { diag_printf("CF card won't go ready!\n"); +#ifndef CYGPKG_NET + return false; +#else continue; +#endif } len = sizeof(buf); ptr = 0; @@ -193,7 +200,7 @@ sc_lpe_card_handler(cyg_addrword_t param } } if (!cor) { - diag_printf("Couldn't find COR pointer!\n"); +// diag_printf("Couldn't find COR pointer!\n"); continue; } // Fetch hardware address from card - terrible, but not well defined @@ -560,13 +567,12 @@ sc_lpe_TxEvent(struct eth_drv_sc *sc, in static void sc_lpe_BufEvent(struct eth_drv_sc *sc, int stat) { - diag_printf("%s\n", __FUNCTION__); -#if 0 - if (stat & PP_BufCFG_RxMiss) { + // What to do if the receive buffers overflow? + if (stat & DP8390_ISR_OFLW) { + // Note: [so far] it seems safe to just ignore this condition + // The Linux driver goes through extraordinary pains to handle + // it, including totally shutting down the chip and restarting. } - if (stat & PP_BufCFG_TxUE) { - } -#endif } static void
--- a/packages/devs/pcmcia/arm/assabet/current/ChangeLog +++ b/packages/devs/pcmcia/arm/assabet/current/ChangeLog @@ -1,3 +1,12 @@ +2000-09-17 Gary Thomas <gthomas@redhat.com> + + * src/assabet_pcmcia.c: Change interrupt functions to have same + calling convention as DSR. + +2000-09-12 Gary Thomas <gthomas@redhat.com> + + * src/assabet_pcmcia.c: Fix build problem when built for eCos. + 2000-08-28 Gary Thomas <gthomas@redhat.com> * src/assabet_pcmcia.c (cf_irq_dsr): Support [shared] network
--- a/packages/devs/pcmcia/arm/assabet/current/src/assabet_pcmcia.c +++ b/packages/devs/pcmcia/arm/assabet/current/src/assabet_pcmcia.c @@ -51,9 +51,8 @@ #ifdef CYGPKG_KERNEL #include <pkgconf/kernel.h> // Configuration header #include <cyg/kernel/kapi.h> -#else +#endif #include <cyg/hal/hal_if.h> -#endif #include <cyg/io/pcmcia.h> #include <cyg/infra/diag.h> @@ -114,7 +113,7 @@ cf_irq_dsr(cyg_vector_t vector, cyg_ucou if (!was_ctrlc_int) // Fall through and run normal code #endif // Process interrupt - (slot->irq_handler.handler)(slot->irq_handler.param); + (slot->irq_handler.handler)(vector, count, slot->irq_handler.param); // Allow interrupts to happen again cyg_drv_interrupt_unmask(SA1110_CF_IRQ); }
--- a/packages/devs/serial/arm/pid/current/ChangeLog +++ b/packages/devs/serial/arm/pid/current/ChangeLog @@ -1,3 +1,14 @@ +2000-09-18 Jesper Skov <jskov@redhat.com> + + * src/pid_serial.h: [removed] + * src/pid_serial_with_ints.c: [removed] Moved driver to generic + 16x5x package. + * include/arm_arm7_pid_ser.inl: [added] Make use of generic + driver. + * cdl/ser_arm_pid.cdl: Matching changes. + + * ChangeLog: Cleaned out non-pid entries. + 2000-08-24 Jonathan Larmour <jlarmour@redhat.co.uk> * src/pid_serial_with_ints.c (pid_serial_DSR): Remove accidental @@ -80,154 +91,9 @@ 2000-04-07 Hugo Tyson <hmt@cygnus.co.u * templates/*/current.ect: these have had CYGPKG_IO_SERIAL added rather than it being in (almost) all target definitions. -2000-04-05 Jonathan Larmour <jlarmour@redhat.co.uk> - - * src/common/tty.c (tty_read): CRLF conversion should use \r\n not \n\r - (tty_write): Similarly - - * include/ttyio.h: Update CYG_TTY_IN_FLAGS_CRLF and - CYG_TTY_IN_FLAGS_CRLF to match - -2000-03-31 Jesper Skov <jskov@redhat.com> - - * cdl/ser_sh_edk7708.cdl: Limit legal baud rate range. - * src/sh/sh_sci_serial.c: Use baud rate macro instead of hardwired - constants. - -2000-03-28 John Dallaway <jld@cygnus.co.uk> - - * cdl/io_serial.cdl, - cdl/ser_arm_aeb.cdl, - cdl/ser_arm_cma230.cdl, - cdl/ser_arm_edb7xxx.cdl, - cdl/ser_arm_pid.cdl, - cdl/ser_i386_pc.cdl, - cdl/ser_mips_jmr3904.cdl, - cdl/ser_mips_vrc4373.cdl, - cdl/ser_mn10300.cdl, - cdl/ser_powerpc_cogent.cdl, - cdl/ser_quicc_smc.cdl, - cdl/ser_sh_edk7708.cdl, - cdl/ser_sparclite_sleb.cdl, - cdl/tty.cdl: - - Adjust documentation URLs. - -2000-03-07 Jesper Skov <jskov@redhat.com> - - * cdl/ser_mips_jmr3904.cdl: Rename devices to match CDL naming. - -2000-02-29 Jonathan Larmour <jlarmour@redhat.co.uk> - - * include/serialio.h: Correct baud rate typo: 230400 rather than - 234000. Thanks to Grant Edwards for the report. - -2000-02-28 Gary Thomas <gthomas@cygnus.co.uk> - - * src/powerpc/quicc_smc_serial.c: Use standard 'diag_dump_buf()'. - -2000-02-28 Jesper Skov <jskov@redhat.com> - - * tests/ser_test_protocol.inl: Allow 115200 baud on Cogent - again. Fixed interrupt problem. - -2000-02-22 Jesper Skov <jskov@redhat.com> - - * tests/ser_test_protocol.inl: Don't use 115200 baud on - Cogent. Our slower boards can't keep up. - -2000-02-17 Gary Thomas <gthomas@cygnus.co.uk> - - * cdl/ser_powerpc_cogent.cdl: Fix incorrect dependency. - -2000-02-16 Nick Garnett <nickg@cygnus.co.uk> - - * include/pkgconf/io_serial.h: - Added configury for PC serial device drivers. - - * cdl/ser_i386_pc.cdl: - * src/i386/pc_serial.c: - * src/i386/pc_serial.h: - Added these files to implement PC serial line drivers. - - * cdl/io_serial.cdl: - Added CYGPKG_IO_SERIAL_I386_PC. - - * tests/ser_test_protocol.inl: - Added support for PC serial line testing. - -2000-02-11 Jesper Skov <jskov@redhat.com> - - * src/sh/sh_sci_7708.inl (DEVTAB_ENTRY): - * src/sparclite/sleb_sdtr.c: - serial_devio => cyg_io_serial_devio - -2000-02-10 Jonathan Larmour <jlarmour@redhat.co.uk> - - * src/mn10300/mn10300_serial.c: Ensure all CYG_HAL_MN10300_* - preprocessor conditionals use the correct CYGPKG_HAL_MN10300_AM3* form - now. - -2000-02-03 Jesper Skov <jskov@redhat.com> - - * src/powerpc/quicc_smc_serial.c: CYG_HAL_POWERPC_x->CYGPKG_... - -2000-02-02 Jonathan Larmour <jlarmour@redhat.co.uk> - - * src/arm/aeb_serial.h: Rename lower case register macros to REG_ upper - case macros - - * src/arm/aeb_serial.c: Update to reflect above - -2000-01-31 Simon FitzMaurice <sdf@cygnus.co.uk> - * cdl/*.cdl: - - Adjust help URLs in line with new doc layout. - -2000-01-28 Simon FitzMaurice <sdf@cygnus.co.uk> - * cdl/*.cdl: - - Adjust help URLs in line with new doc layout. - -2000-01-28 Gary Thomas <gthomas@cygnus.co.uk> - - * src/common/tty.c (tty_read): Fix problem with backspace at start - of line (size must be 'signed' for compare to work). - -2000-01-19 Hugo Tyson <hmt@cygnus.co.uk> - - * cdl/*.cdl: Add descriptions to a number of options &c which were - lacking same, also tidied up other typos as noticed en passant. - -2000-01-17 Gary Thomas <gthomas@cygnus.co.uk> - - * src/common/tty.c (tty_read): Avoid echoing "backspace/erase" at - start of line. - -2000-01-05 Gary Thomas <gthomas@cygnus.co.uk> - - * src/common/serial.c (serial_write): Avoid potential deadlock if - transmit start actually sends enough characters to signal cond wait. - 2000-01-03 Gary Thomas <gthomas@cygnus.co.uk> - * include/serial.h: Fix namespace pollution - - serial_devio => cyg_io_serial_devio - serial_callbacks => cyg_io_serial_callbacks - - * src/mips/tx3904_serial.c: - * src/mips/vrc4373_serial.c: - * src/mn10300/mn10300_serial.c: - * src/powerpc/quicc_smc_serial.c: - * src/powerpc/cogent_serial_with_ints.c: - * src/sparclite/sleb_sdtr.c: - * src/arm/aeb_serial.c: - * src/arm/pid_serial_with_ints.c: - * src/arm/edb7xxx_serial.c: - * src/arm/cma230_serial.c: - * src/arm/ebsa285_serial.c: - * src/common/haldiag.c: - * src/common/serial.c: Fix namespace pollution - + * src/arm/pid_serial_with_ints.c: Fix namespace pollution - serial_devio => cyg_io_serial_devio 1999-12-06 Gary Thomas <gthomas@cygnus.co.uk> @@ -235,928 +101,74 @@ 1999-12-06 Gary Thomas <gthomas@cygnus * src/arm/pid_serial_with_ints.c (pid_serial_DSR): Add loop to handle case where an interrupt represents multiple events. -1999-11-19 Gary Thomas <gthomas@cygnus.co.uk> - - * src/powerpc/quicc_smc_serial.c: Channel select for SMC2 was wrong. - -1999-11-18 Gary Thomas <gthomas@cygnus.co.uk> - - * include/pkgconf/io_serial.h: Remove mention of 7209/7212. - -1999-11-03 John Dallaway <jld@cygnus.co.uk> - - * cdl/io_serial.cdl: Define build options. - 1999-10-26 Jesper Skov <jskov@cygnus.co.uk> - * tests/serial5.c (serial_test): Reduce speed in thumb mode. * src/arm/pid_serial.h: Added BE support. - * src/PKGconf.mak: Use CYGPKG_<> instead of CYG_<> to control what - needs to be compiled. - 1999-10-25 Gary Thomas <gthomas@cygnus.co.uk> * src/arm/pid_serial.h (ISR_RxTO): Define - character received but not handled "promptly". - * src/arm/pid_serial_with_ints.c (pid_serial_DSR): Handle rcv interrupts - properly (can't ignore them even with TO bit set). - - * src/arm/cl7211_serial.c (cl7211_serial_rx_DSR): Need to handle all - input (empty input FIFO) otherwise characters get dropped. - -1999-10-15 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Removed AEB rev C change. Was bogus. - -1999-10-11 Nick Garnett <nickg@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Added configury for VR4300 testing. - - * src/mips/vrc4373_serial.c: Added Bi-endian support. - - * include/pkgconf/io_serial.h: Adjusted default baud rates to - 38400. - -1999-10-06 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Run tests on AEB rev C as well. - -1999-09-28 Hugo Tyson <hmt@cygnus.co.uk> - - * src/powerpc/quicc_smc_serial.c (quicc_smc_serial_init): Correct - value supplied for interrupt priority - it may be unused, but it - is asserted for range. Initialize the diagnostic channel if on an - MBX and if NOT using SMC1 ourselves, to ensure that diag output - and built-in stubs work correctly; otherwise reset the quicc and - ignore SMC1 as before. Fix various warnings, mostly about - casting/arg-passing/assigning away volatile. - -1999-08-31 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Define dummy crash ID. - -1999-08-30 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Added crash information which - should help track down repeating errors. - -1999-08-20 Jesper Skov <jskov@cygnus.co.uk> - - * tests/README: Added. - -1999-08-18 Jesper Skov <jskov@cygnus.co.uk> - - * tests/tty1.c: - * tests/tty2.c: - * tests/serial1.c: - * tests/serial2.c: - * tests/serial3.c: - * tests/serial4.c: - * tests/serial5.c: - * tests/PKGconf.mak: - Require kernel and kernel C API. - -1999-08-17 Nick Garnett <nickg@cygnus.co.uk> - - * src/mn10300/mn10300_serial.c: Added a simple implementation of a - receive FIFO to try and reduce the overhead of receiving bytes. - -1999-08-16 Jonathan Larmour <jlarmour@cygnus.co.uk> - - * src/PKGconf.mak: - * src/mn10300/mn10300_serial.c: - * tests/ser_test_protocol.inl: - Rename all am32 -> am31 - -1999-08-12 Nick Garnett <nickg@cygnus.co.uk> - - Imported following changes from development branch: - - 1999-08-11 Nick Garnett <nickg@cygnus.co.uk> - - * tests/serial5.c: Modified config test for boards that need a lower - speed for this test. - - * tests/ser_test_protocol.inl: Removed 14400 baud tests for all - MN10300 variants. The MN10300 cannot currently do this speed. - - * src/mn10300/mn10300_serial.c: Tidied up the transmit interrupt - enable/disable code to be variant specific. - - * include/pkgconf/io_serial.h: Undid Jonathan's change, since the - same options are used for all MN10300 variants. - - 1999-08-10 Jonathan Larmour <jlarmour@cygnus.co.uk> - - * include/pkgconf/io_serial.h: - Reparent CYGPKG_IO_SERIAL_MN10300 from under CYGPKG_HAL_MN10300 to - CYGPKG_HAL_MN10300_AM32_STDEVAL1 since it's stdeval1 specific - - 1999-08-04 Nick Garnett <nickg@cygnus.co.uk> - - * tests/ser_test_protocol.inl: - Changed names of MN10300 defines tested. Added AM33 definitions. - - * src/mn10300/mn10300_serial.c: - Modified driver to work on am33 too. This simply requires some - alternate definitions of things like register addresses and some - bits in them plus some extra parameterization of some register - values. - - * src/PKGconf.mak: - Added am33 to list of architectures supporting serial lines. - -1999-07-28 Gary Thomas <gthomas@cygnus.co.uk> - - * include/pkgconf/io_serial.h: Update descriptions to be more - generic (CL7x11 instead of CL7211). - -1999-07-28 Jonathan Larmour <jlarmour@cygnus.co.uk> - - * include/pkgconf/io_serial.h: Correct typos in CDL description - for serial port 2 driver - -1999-07-26 Hugo Tyson <hmt@cygnus.co.uk> - - * src/arm/ebsa285_serial.c: New file: device driver for the serial - device of the Intel StrongARM EBSA-285 evaluation board. - - * include/pkgconf/io_serial.h (CYGPKG_IO_SERIAL_ARM_EBSA285): - Config for it. - - * src/PKGconf.mak (EXTRAS_COMPILE): Compile it. - - * tests/ser_test_protocol.inl (TEST_SER_DEV): Enable testing of it. - -1999-07-08 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl (change_config): Changed implementation. - -1999-06-27 Gary Thomas <gthomas@cygnus.co.uk> - - * src/powerpc/quicc_smc_serial.c (quicc_smc_serial_init): More robust - initialization, with data cache disabled. This seems to fix the - random failures described below. - - * tests/ser_test_protocol.inl: Add configuration for QUICC/MBX860. - Added some delays in the configuration change code to make QUICC - happy [didn't help much although the manual says they are required]. - - * src/powerpc/quicc_smc_serial.h (UART_BITRATE): Rewrote macro to - match what the Linux driver uses - still doesn't work well, though. - - * src/powerpc/quicc_smc_serial.c: Lots of changes trying to get the - serial driver working and robust. At this point it works quite well, - using the default buffer sizes. Changing from the defaults seem to - easily break it though, certainly on input. Also, changing the baud - rate seems to not work reliably. - - * src/common/serial.c: Add some tracing/debug info to try and debug - problems with QUICC serial driver. These are hard disabled with - "XX_" prepended to "CYGDBG_DIAG_BUF". Enabling them gives information - about how/when data are delivered from the serial driver. - - * include/pkgconf/io_serial.h: Adjust limits and defaults on number and - size of buffers with values that seem to work. - -1999-06-21 Jesper Skov <jskov@cygnus.co.uk> - - * src/sh/sh_sci_serial.c: Rearranged inclusion of .inl file a bit - to avoid compiler warnings. - -1999-06-21 Gary Thomas <gthomas@cygnus.co.uk> - - * include/pkgconf/io_serial.h: Fix CDL for number of buffers. - - * src/powerpc/quicc_smc_serial.c: Force number of buffers = 1. + * src/arm/pid_serial_with_ints.c (pid_serial_DSR): Handle rcv + interrupts properly (can't ignore them even with TO bit set). 1999-06-20 Gary Thomas <gthomas@cygnus.co.uk> - * include/pkgconf/io_serial.h: Some clean up (removed commented - obsolete CDL parenting structure). - Add support for Motorola PowerPC QUICC/SMC. - - * src/arm/cma230_serial.c: - * src/arm/cl7211_serial.c: - * src/arm/aeb_serial.c: * src/arm/pid_serial_with_ints.c: Use #include to get 'diag_printf()' prototypes. -1999-06-17 Gary Thomas <gthomas@cygnus.co.uk> - - * src/arm/cl7211_serial.c (cl7211_serial_start_xmit): Fix race which - cause xmitter to get stuck. - -1999-06-16 Jesper Skov <jskov@cygnus.co.uk> - - * src/sh/sh_serial.c: [removed] - * src/sh/sh_sci_serial.c: [added] - * src/sh/sh_sci_7708.inl: [added] - * include/pkgconf/io_serial.h: - * src/PKGconf.mak (EXTRAS_COMPILE): - * tests/ser_test_protocol.inl: - Renamed CDL options and restructered driver. - Fixed CDL typo. - -1999-06-04 Jesper Skov <jskov@cygnus.co.uk> - - * include/pkgconf/io_serial.h: Fixed CDL string for BAUD rate option. - -1999-06-04 Gary Thomas <gthomas@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Disable testing at 115200 - for Cogent CMA230 (ARM). - - * src/arm/cma230_serial.c: Fix interrupt for port B. - -1999-05-31 Jesper Skov <jskov@cygnus.co.uk> - - * src/sh/sh_serial.c: Fixed receive interrupts and added handler for - error interrupts. - -1999-05-28 Jesper Skov <jskov@cygnus.co.uk> - - * io/serial/current/src/PKGconf.mak: - * io/serial/current/tests/ser_test_protocol.inl: - * include/pkgconf/io_serial.h: - Renamed SH platform package to edk7708. - -1999-05-27 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Added ability to change options in - host software. - -1999-05-27 Jonathan Larmour <jlarmour@cygnus.co.uk> - - * src/mn10300/mn10300_serial.c (mn10300_serial_config_port): - Wait for the serial device to become acquiescent before disabling - it. This prevents cygmon's outgoing characters getting corrupted - due to transmission being disabled. - Fix for PR 20047 - -1999-05-26 Gary Thomas <gthomas@cygnus.co.uk> - - * include/pkgconf/io_serial.h: - * tests/ser_test_protocol.inl: Add Cogent CMA230 setup. - - * src/arm/cma230_serial.c: Make names compatible with Cogent - PowerPC board. - -1999-05-26 Gary Thomas <gthomas@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Add Cirrus Logic CL7211 setup. -1999-05-26 Jesper Skov <jskov@cygnus.co.uk> - - * src/sh/sh_serial.c: Added more baud rate values. Disabled - interrupt driven receive. Fixed config_port to enable proper - interrupt flags. - -1999-05-25 Jonathan Larmour <jlarmour@cygnus.co.uk> - - * tests/ser_test_protocol.inl: - Change all mentions of CYGPKG_HAL_TX39_JMR3904 to - CYGPKG_HAL_MIPS_TX39_JMR3904 - -1999-05-25 Jonathan Larmour <jlarmour@cygnus.co.uk> - - * src/PKGconf.mak (EXTRAS_COMPILE): Change CYG_HAL_TX39 to - CYG_HAL_MIPS_TX39 -1999-05-25 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Added sh entry. - -1999-05-24 Jesper Skov <jskov@cygnus.co.uk> - - * src/PKGconf.mak: - * include/pkgconf/io_serial.h: - * src/sh/sh_serial.c: - Added sh driver. - -1999-05-18 Jesper Skov <jskov@cygnus.co.uk> - PR 19926 - * src/sparclite/sleb_sdtr.c (sleb_sdtr_rx_DSR): Only read chan if - there is one. - -1999-05-18 Jesper Skov <jskov@cygnus.co.uk> - PR 19926 - * src/arm/cl7211_serial.c (cl7211_serial_rx_DSR): Only read char - if there is one. - -1999-05-16 Gary Thomas <gthomas@cygnus.co.uk> - - * src/arm/cl7211_serial.c: Clean up, first working version. - 1999-05-14 Jesper Skov <jskov@cygnus.co.uk> - * tests/ser_test_protocol.inl: Removed workaround for spurious - Cogent reads. - - * src/arm/aeb_serial.c: - * src/arm/aeb_serial.h: * src/arm/pid_serial_with_ints.c: * src/arm/pid_serial.h: - * src/powerpc/cogent_serial.h: - * src/powerpc/cogent_serial_with_ints.c: Check for receive interrupt before reading. -1999-05-13 Nick Garnett <nickg@cygnus.co.uk> - - The follow changes were made in a branch an have now been merged: - - 1999-04-21 Gary Thomas <gthomas@cygnus.co.uk> - - * src/mips/vrc4373_serial.c: Small changes to get working with - interrupts. - - 1999-04-20 John Dallaway <jld@cygnus.co.uk> - - * include/pkgconf/io_serial.h: Fix CYGPKG_IO_SERIAL_TX39_JMR3904 - parent attribute. - -1999-05-11 Gary Thomas <gthomas@cygnus.co.uk> - - * src/arm/cl7211_serial.c: Fix compile problems from merged code. - -1999-05-05 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Tidied up a bit and added - description of protocol. - -1999-05-05 Jesper Skov <jskov@cygnus.co.uk> - - * src/common/serial.c (serial_write, serial_read): Clear abort - flag at entry. - -1999-05-05 Jesper Skov <jskov@cygnus.co.uk> - - * tests/serial4.c (serial_test): Handle config fails correctly. - - * tests/ser_test_protocol.inl: Better change_config - handling. Simple recovery and negotiation isn't timing - dependant. - -1999-05-05 Jesper Skov <jskov@cygnus.co.uk> - - * tests/timeout.inl: Updated with the below changes. - -1999-05-05 Gary Thomas <gthomas@cygnus.co.uk> - - * misc/timeout.inl (timeout): Timeouts are relative, but alarms - need absolute time values. - -1999-05-04 Jesper Skov <jskov@cygnus.co.uk> - PR 20018 - * tests/serial1.c (serial_test): Always PASS, regardless of - configuration. - -1999-05-04 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Reverse order of configurations - - run tests with slow baud rate first. - Only check CYG_KERNEL_DIAG_GDB_SERIAL_DIRECT for SLEB on RAM startup. - -1999-05-04 Jesper Skov <jskov@cygnus.co.uk> - * src/mn10300/mn10300_serial.c: - Use interrupt enable/disable feature of serial port2 to allow - coexistence with CygMon/hal_diag. - - * tests/ser_test_protocol.inl: Use port2 for MN10300. - -1999-04-28 Bart Veer <bartv@cygnus.co.uk> - - * src/PKGconf.mak (EXTRAS_COMPILE): - Use the new rules for generating libextras.a - -1999-04-26 Gary Thomas <gthomas@cygnus.co.uk> - - * include/pkgconf/io_serial.h: Add support for Cirrus Logic CL7211. - - 1999-04-20 Gary Thomas <gthomas@cygnus.co.uk> - * src/arm/aeb_serial.c: * src/arm/pid_serial_with_ints.c: Fix default baud rate if unbuffered. -1999-04-20 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Added some comments. Disabled 38400 - for SLEB. Only run test on SLEB if CygMon isn't used for diag - output. - -1999-04-15 Jesper Skov <jskov@cygnus.co.uk> - PR 19752 - * tests/serial3.c: - * tests/serial5.c: - Run these tests at a lower baud rate on ARM AEB. - -1999-04-14 Jesper Skov <jskov@cygnus.co.uk> - PR 19839 - * src/mn10300/mn10300_serial.c: - Fix compiler warnings. - -1999-04-14 Bart Veer <bartv@cygnus.co.uk> - - * include/pkgconf/io_serial.h: - Reparent the board-specific serial devices below the actual boards. - -1999-04-13 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: - NA when run from simulator. - -1999-04-12 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: - Disabled 115200 for MN10300. - Reclaim interrupt vectors from CygMon when testing on SLEB. - -1999-04-09 Gary Thomas <gthomas@cygnus.co.uk> - - * include/serial.h: Change SERIAL_CHANNEL setup so all channels - have serial callbacks, regardless of buffering. - -1999-04-09 Jesper Skov <jskov@cygnus.co.uk> - - * src/common/tty.c: - * include/pkgconf/io_serial.h: - Added new ttydiag device layered on top of haldiag, so that tty0 - can be layered on top of ser0. - -1999-04-08 Jesper Skov <jskov@cygnus.co.uk> - - * tests/tty1.c: [added] - * tests/tty2.c: [added] - * tests/PKGconf.mak: - * tests/ser_test_protocol.inl: - Added two simple TTY tests. - -1999-04-07 Hugo Tyson <hmt@cygnus.co.uk> - - * src/sparclite/sleb_sdtr.h: Include cyg/hal/hal_io.h for I/O - macros instead of hal_diag.h where they had evolved before. - -1999-04-06 Jesper Skov <jskov@cygnus.co.uk> - - * tests/serial4.c (serial_test): - * tests/serial3.c (serial_test): - Reduce packet sizes. - -1999-03-31 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Added remaining targets to the - test. - -1999-03-31 Gary Thomas <gthomas@cygnus.co.uk> - - * src/sparclite/sleb_sdtr.c (sleb_sdtr_start_xmit): Fix timing race - when enabling xmit interrupts. - -1999-03-26 Gary Thomas <gthomas@cygnus.co.uk> - - * src/sparclite/sleb_sdtr.c: Change how the port is set up. The transmitter - is now always enabled, just the interrupts are masked/unmasked to control it. - This lets the serial driver cooperate with Cygmon on the port used for GDB. - Note that currently serial input does not work for CON1 since Cygmon is - taking all of the receive interrupts for itself. - (sleb_sdtr_tx_DSR): Need to keep track whether xmit interrupt should be - enabled - otherwise it can get enabled incorrectly and we get interrupted - to death! - -1999-03-26 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Send a DONE message after a no-echo - binary packet. - -1999-03-26 Hugo Tyson <hmt@cygnus.co.uk> - - * tests/serial5.c: - * tests/serial4.c: - * tests/serial3.c: - * tests/serial2.c: - * tests/serial1.c: - Make these build when no kernel present; include of testcase - was the wrong side of the ifdef. - -1999-03-26 Jesper Skov <jskov@cygnus.co.uk> - - * tests/serial5.c: - * tests/serial4.c: - * tests/serial3.c: - * tests/serial2.c: - * tests/serial1.c: - Moved NOP check to ser_test_protocol open call. - - * tests/ser_test_protocol.inl: Make sure the proper device is - selected for testing. Do NOP check in open call. 1999-03-25 Gary Thomas <gthomas@cygnus.co.uk> - * include/pkgconf/io_serial.h: - * misc/console.c: - * src/arm/aeb_serial.c: * src/arm/pid_serial_with_ints.c: - * src/common/tty.c: - * src/mips/tx3904_serial.c: - * src/mn10300/mn10300_serial.c: - * src/powerpc/cogent_serial_with_ints.c: - * src/sparclite/sleb_sdtr.c: Update CDL to follow naming conventions. - - * src/mips/tx3904_serial.c (tx3904_serial_config_port): - Make sure port is enabled (CDL) before using it. - - * src/mn10300/mn10300_serial.c (mn10300_serial_config_port): - * src/powerpc/cogent_serial_with_ints.c (cogent_serial_config_port): - * src/arm/aeb_serial.c (aeb_serial_config_port): - * src/arm/pid_serial_with_ints.c (pid_serial_config_port): Change so that - the physical port is not modified unless the provided configuration is valid. + Update CDL to follow naming conventions. - * src/sparclite/sleb_sdtr.c (sleb_sdtr_config_port): - Using wrong config data. - - * include/serialio.h: Add macros to support baud rate from CDL. + * src/arm/pid_serial_with_ints.c (pid_serial_config_port): Change + so that the physical port is not modified unless the provided + configuration is valid. - * include/pkgconf/io_serial.h: - * src/mn10300/mn10300_serial.c: - * src/mips/tx3904_serial.c (tx3904_serial_ISR): - * src/sparclite/sleb_sdtr.c: - * src/powerpc/cogent_serial_with_ints.c: * src/arm/pid_serial_with_ints.c: - * src/arm/aeb_serial.c: Add configury for baud rate and buffer size. - -1999-03-24 Nick Garnett <nickg@cygnus.co.uk> - - * src/mips/tx3904_serial.c: - Now uses CYGHWR_HAL_MIPS_CPU_FREQ_ACTUAL to get CPU - frequency. This is a little more accurate than using - CYGHWR_HAL_MIPS_CPU_FREQ. + Add configury for baud rate and buffer size. 1999-03-24 Gary Thomas <gthomas@cygnus.co.uk> - * include/serialio.h (CYGNUM_SERIAL_BAUD_MIN/MAX): Add for completeness. - - * src/arm/aeb_serial.c (aeb_serial_stop_xmit): - * src/arm/pid_serial_with_ints.c (pid_serial_stop_xmit): Fix typo in comment. - -1999-03-24 Jesper Skov <jskov@cygnus.co.uk> - - * tests/ser_test_protocol.inl: Weeded out configs TX39 doesn't - like. - - * src/powerpc/cogent_serial.h: - Added copyright header. - - * tests/ser_test_protocol.inl: - * tests/serial1.c: - * tests/serial2.c: - * tests/serial3.c: - * tests/serial4.c: - * tests/serial5.c: - Don't try to run tests when no IO device has been specified. - -1999-03-23 Jesper Skov <jskov@cygnus.co.uk> - - * misc/serial1.c, misc/serial2.c, misc/serial3.c, misc/serial4.c, - * misc/serial5.c, misc/ser_test_protocol.inl - Deleted. - -1999-03-23 Jesper Skov <jskov@cygnus.co.uk> - - * misc/PKGconf.mak: - * tests/timeout.inl: - * tests/PKGconf.mak: - * tests/serial1.c: - * tests/serial2.c: - * tests/serial3.c: - * tests/serial4.c: - * tests/serial5.c: - * tests/ser_test_protocol.inl: - Moved the serial tests from the misc directory to the tests - directory. - -1999-03-23 Nick Garnett <nickg@cygnus.co.uk> - - * src/mn10300/mn10300_serial.c: Now initially mask TX interrupts - at initialization and unmask/remask in start/stop xmit - routines. This has no real effect on the hardware, but the - simulator does not implement the LCR_TXE bit properly, resulting - in spurious TX interrupts during diagnostic output. - This was the cause of the slow output reported in PR 19559. - -1999-03-23 Gary Thomas <gthomas@cygnus.co.uk> - - * include/pkgconf/io_serial.h: Fix "display" strings to have appropriate - case - mostly lower case. - -1999-03-22 Hugo Tyson <hmt@cygnus.co.uk> - - * misc/console.c: - * misc/serial.c: - * misc/serial1.c: - * misc/serial2.c: - * misc/serial3.c: - * misc/serial4.c: - * misc/serial5.c: - Use CYGNUM_HAL_STACK_SIZE_TYPICAL for the stack size instead of - CYGNUM_HAL_MINIMUM_STACK_SIZE. + * src/arm/pid_serial_with_ints.c (pid_serial_stop_xmit): Fix typo + in comment. 1999-03-22 Gary Thomas <gthomas@cygnus.co.uk> - * src/mn10300/mn10300_serial.c: - * src/mips/tx3904_serial.c: Add CDL configury. - - * include/pkgconf/io_serial.h: Update CDL to add device name - configurability for all devices. - - * src/sparclite/sleb_sdtr.c: - * src/powerpc/cogent_serial_with_ints.c: - * src/arm/aeb_serial.c: * src/arm/pid_serial_with_ints.c: Use CDL configured device names. -1999-03-22 Jesper Skov <jskov@lassi.cygnus.co.uk> - - * misc/serial1.c: - * misc/serial2.c: - * misc/serial3.c: - * misc/serial4.c: - * misc/serial5.c: - Requires kernel as well. - -1999-03-22 Jesper Skov <jskov@cygnus.co.uk> - - * src/sparclite/sleb_sdtr.c: - Moved include statement to avoid warnings. - -1999-03-19 Jesper Skov <jskov@cygnus.co.uk> - - * misc/ser_test_protocol.inl: - * misc/serial5.c: - * misc/PKGconf.mak: - Replace complex and not very stable duplex test with a simpler - test that works better. - Added serial5 using that test. - -1999-03-19 Jesper Skov <jskov@cygnus.co.uk> - - * misc/PKGconf.mak: - * misc/serial1.c: - * misc/serial2.c: - Added API test and made serial2 do simple string output. - -1999-03-19 Jesper Skov <jskov@cygnus.co.uk> - - * src/powerpc/cogent_serial_with_ints.c: Changed ToDo comment. - 1999-03-19 Jesper Skov <jskov@lassi.cygnus.co.uk> - * src/powerpc/cogent_serial_with_ints.c: - * src/arm/aeb_serial.c: * src/arm/pid_serial_with_ints.c: Moved include statement to avoid warnings. -1999-03-19 Gary Thomas <gthomas@cygnus.co.uk> - - * include/pkgconf/io_serial.h: More CDL problems. - 1999-03-18 Gary Thomas <gthomas@cygnus.co.uk> - * include/pkgconf/io_serial.h: Add CDL for SPARClite SLEB. - - * src/powerpc/cogent_serial_with_ints.c: * src/arm/pid_serial_with_ints.c: - * src/arm/aeb_serial.c: Update device names to match CDL. - - * include/pkgconf/io_serial.h: Change names for serial ports to - be CYGPKG_IO_SERIAL_<arch>_<platform>_<port>. - -1999-03-18 Jesper Skov <jskov@cygnus.co.uk> - - * misc/ser_test_protocol.inl: - * misc/serial2.c: - First stab at the duplex binary test. Still much fun to be had... - -1999-03-18 Jesper Skov <jskov@cygnus.co.uk> - - * misc/ser_test_protocol.inl: Added timeout for PING. - -1999-03-18 Gary Thomas <gthomas@cygnus.co.uk> - - * src/common/serial.c: Change ABORT functionality to be DSR safe. - (serial_get_config): Fix typo! - - * include/pkgconf/io_serial.h: Small change in CDL to make serial - devices tied to the platform and not the serial I/O package. This - means that only the devices appropriate to a given platform can be - enabled. - - * misc/serial.c: Better use of alarms - only trigger at the time of - the next timeout. Moved timeout functions to new file "timeout.inl". - - * src/common/serial.c (serial_get_config): Add support for - CYG_IO_GET_CONFIG_SERIAL_INPUT_FLUSH and CYG_IO_GET_CONFIG_SERIAL_ABORT. - - * misc/serial.c: Add simple timeout mechanisms. + Update device names to match CDL. 1999-03-17 Gary Thomas <gthomas@cygnus.co.uk> - * src/powerpc/cogent_serial_with_ints.c: - * src/arm/aeb_serial.c: * src/arm/pid_serial_with_ints.c: Conditionalize based on CDL. - * include/pkgconf/io_serial.h: Add some CDL configury - not perfect - because of current ~CDL limitations. - -1999-03-17 Jesper Skov <jskov@cygnus.co.uk> - - * misc/serial2.c: Cleaned up a bit. Used for hacking new tests. - -1999-03-17 Jesper Skov <jskov@cygnus.co.uk> - - * misc/PKGconf.mak: - * misc/ser_test_protocol.inl: - * misc/serial2.c: - * misc/serial3.c: - * misc/serial4.c: - Put testing protocol implementation in a separate file. Split the - tests in serial2 into separate files. - -1999-03-16 Nick Garnett <nickg@cygnus.co.uk> - - * src/mn10300/mn10300_serial.c: Fixed some compiler warnings. - 1999-03-15 Gary Thomas <gthomas@cygnus.co.uk> - * include/pkgconf/io_serial.h: Change default configurations. - No serial drivers enabled for PID port A or AEB. - - * src/sparclite/sleb_sdtr.c: - * src/powerpc/cogent_serial_with_ints.c: - * src/arm/aeb_serial.c: - * src/arm/pid_serial_with_ints.c: - * src/common/haldiag.c: - * src/common/tty.c: - * src/common/serial.c: Add 'CYGDBG_IO_INIT' for control of init - messages. - - * src/powerpc/cogent_serial_with_ints.c: - * src/sparclite/sleb_sdtr.c: - * src/arm/aeb_serial.c: - * src/arm/pid_serial_with_ints.c: Don't include <cyg/kernel/kapi.h> - -1999-03-15 Jesper Skov <jskov@cygnus.co.uk> - - * misc/serial2.c (serial_test): Fix use of strlen. Fix DONE part - of binary protocol. - -1999-03-12 Jesper Skov <jskov@cygnus.co.uk> - - * misc/serial2.c: Play a bit with timing. Think I broke it :( - Added DONE to BINARY packet. - Proper call to DRAIN. - -1999-03-12 Nick Garnett <nickg@cygnus.co.uk> - - * src/mips/tx3904_serial.c: Tidied away some debugging code. - -1999-03-12 Jesper Skov <jskov@cygnus.co.uk> - - * misc/serial2.c: Removed bogus config changes. - -1999-03-12 Jesper Skov <jskov@cygnus.co.uk> - - * misc/serial2.c (serial_test): Check for ser_filter on host (PING - packet). - -1999-03-11 Jesper Skov <jskov@cygnus.co.uk> - - * src/powerpc/cogent_serial_with_ints.c: Added note. - - * misc/serial2.c: - Added (almost) proper configuration handling. - Run tests on varying configurations. - -1999-03-11 Nick Garnett <nickg@cygnus.co.uk> - - * src/mips/tx3904_serial.c: - Many changes to get working. - - * misc/console.c (console_test): Fixed compiler warning. - - * misc/serial2.c: - Added device name for TX39 testing. - Fixed some bugs in Tcyg_io_write() macro. - -1999-03-10 Jesper Skov <jskov@cygnus.co.uk> - - * misc/serial2.c: Added target specific test device name. - -1999-03-10 John Dallaway <jld@cygnus.co.uk> - - * include/pkgconf/io_serial.h: Correct CDL description spelling. - -1999-03-10 Jesper Skov <jskov@cygnus.co.uk> - - * src/powerpc/cogent_serial_with_ints.c: - * misc/console.c: - Fixed compiler warnings. - -1999-03-10 Gary Thomas <gthomas@cygnus.co.uk> - - * include/pkgconf/io_serial.h: Improve CDL descriptions. - -1999-03-10 Jesper Skov <jskov@cygnus.co.uk> - - * misc/serial2.c (serial_test): Do some more tests with changed - baud rates. - -1999-03-09 Jesper Skov <jskov@cygnus.co.uk> + * src/arm/pid_serial_with_ints.c: Add 'CYGDBG_IO_INIT' for control + of init messages. - * misc/serial2.c (serial_test): Added workaround for spurious byte - problem. Added a few more tests to run. - - * src/powerpc/cogent_serial_with_ints.c - (cogent_serial_config_port): Remove interrupt enabling. - -1999-03-09 Nick Garnett <nickg@cygnus.co.uk> - - * src/PKGconf.mak: - * src/mips/tx3904_serial.c: - Added initial version of TX39 device driver. Currently untested - but eliminates PR19445. - -1999-03-09 Jesper Skov <jskov@cygnus.co.uk> - - * misc/serial2.c: DRAIN function works now. - -1999-03-09 Jesper Skov <jskov@cygnus.co.uk> - - * include/pkgconf/io_serial.h: Only enable one serial driver per - default. - -1999-03-08 Jesper Skov <jskov@cygnus.co.uk> - - * misc/serial2.c (serial_test): Be a bit more aggressive. - - * src/powerpc/cogent_serial_with_ints.c: Check that configuration - is sensible. - -1999-03-08 Jesper Skov <jskov@cygnus.co.uk> - - * src/powerpc/cogent_serial_with_ints.c: - Added support for both ports. - - * include/pkgconf/io_serial.h: Added simple defines for cogent - serial ports. No CDL yet. - -1999-03-08 Jesper Skov <jskov@cygnus.co.uk> - - * misc/serial.c: Removed PID references. Fixed compiler warnings. - -1999-03-08 Jesper Skov <jskov@cygnus.co.uk> - - * src/powerpc/cogent_serial_with_ints.c: Cleaned up a - bit. Actually works now. - -1999-03-08 Gary Thomas <gthomas@cygnus.co.uk> - - * src/common/serial.c: Change in cyg_drv_cond_wait() behaviour - means DSR lock should be left alone. - -1999-03-08 Jesper Skov <jskov@cygnus.co.uk> - PR 19400 - * src/powerpc/cogent_serial_with_ints.c (cogent_serial_init): Set - valid interrupt priority. - -1999-03-05 Nick Garnett <nickg@cygnus.co.uk> - - * src/mn10300/mn10300_serial.c (mn10300_serial_init): - Added extra test to avoid initializing serial 2 when CYGMON is - present. - Include hal_intr.h explicitly for use in non-kernel - configurations. - - * src/common/serial.c: - Added extra test before calls to cyg_drv_cond_wait() to avoid race - condition. This is not, however, a complete solution to this - problem. A better solution will be forthcoming. - - * include/serial.h: - Changed include files used to permit non-kernel configurations to - be built. - -1999-03-05 Jesper Skov <jskov@cygnus.co.uk> - - * src/common/haldiag.c: Removed diag_printf declaration. - -1999-03-05 Jonathan Larmour <jlarmour@cygnus.co.uk> - - * src/mn10300/mn10300_serial.c: - Change CYG_VECTOR_* to CYGNUM_HAL_INTERRUPT_* to get it to compile! - -1999-03-05 Gary Thomas <gthomas@cygnus.co.uk> - - * src/powerpc/cogent_serial_with_ints.c (cogent_serial_config_port): - Fix renaming of interrupt vectors. + * src/arm/pid_serial_with_ints.c: Don't include <cyg/kernel/kapi.h> 1999-03-05 Gary Thomas <gthomas@cygnus.co.uk>
--- a/packages/devs/serial/arm/pid/current/cdl/ser_arm_pid.cdl +++ b/packages/devs/serial/arm/pid/current/cdl/ser_arm_pid.cdl @@ -50,133 +50,137 @@ cdl_package CYGPKG_IO_SERIAL_ARM_PID { requires CYGPKG_ERROR include_dir cyg/io - include_files ; # none _exported_ whatsoever + description " This option enables the serial device drivers for the ARM PID." doc redirect/ecos-device-drivers.html - compile -library=libextras.a pid_serial_with_ints.c + # FIXME: This really belongs in the GENERIC_16X5X package + cdl_interface CYGINT_IO_SERIAL_GENERIC_16X5X_REQUIRED { + display "Generic 16x5x serial driver required" + } + define_proc { + puts $::cdl_header "#define CYGPRI_IO_SERIAL_GENERIC_16X5X_STEP 4" + } + define_proc { puts $::cdl_system_header "/***** serial driver proc output start *****/" - puts $::cdl_system_header "#define CYGDAT_IO_SERIAL_DEVICE_HEADER <pkgconf/io_serial_arm_pid.h>" + puts $::cdl_system_header "#define CYGDAT_IO_SERIAL_GENERIC_16X5X_INL <cyg/io/arm_arm7_pid_ser.inl>" + puts $::cdl_system_header "#define CYGDAT_IO_SERIAL_GENERIC_16X5X_CFG <pkgconf/io_serial_arm_pid.h>" puts $::cdl_system_header "/***** serial driver proc output end *****/" } -cdl_component CYGPKG_IO_SERIAL_ARM_PID_SERIAL0 { - display "ARM PID serial port 0 driver" - flavor bool - default_value 1 - implements CYGINT_IO_SERIAL_FLOW_CONTROL_HW - implements CYGINT_IO_SERIAL_LINE_STATUS_HW - description " - This option includes the serial device driver for the ARM PID - port 0." + cdl_component CYGPKG_IO_SERIAL_ARM_PID_SERIAL0 { + display "ARM PID serial port 0 driver" + flavor bool + default_value 1 - cdl_option CYGDAT_IO_SERIAL_ARM_PID_SERIAL0_NAME { - display "Device name for ARM PID serial port 0 driver" - flavor data - default_value {"\"/dev/ser0\""} + implements CYGINT_IO_SERIAL_GENERIC_16X5X_REQUIRED + implements CYGINT_IO_SERIAL_FLOW_CONTROL_HW + implements CYGINT_IO_SERIAL_LINE_STATUS_HW + description " - This option specifies the name of the serial device for the - ARM PID port 0." - } + This option includes the serial device driver for the ARM + PID port 0." + + cdl_option CYGDAT_IO_SERIAL_ARM_PID_SERIAL0_NAME { + display "Device name for ARM PID serial port 0 driver" + flavor data + default_value {"\"/dev/ser0\""} + description " + This option specifies the name of the serial device + for the ARM PID port 0." + } - cdl_option CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BAUD { - display "Baud rate for the ARM PID serial port 0 driver" - flavor data - legal_values { 50 75 110 "134_5" 150 200 300 600 1200 1800 2400 3600 - 4800 7200 9600 14400 19200 38400 57600 115200 234000 + cdl_option CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BAUD { + display "Baud rate for the ARM PID serial port 0 driver" + flavor data + legal_values { 50 75 110 "134_5" 150 200 300 600 1200 1800 2400 + 3600 4800 7200 9600 14400 19200 38400 + 57600 115200 234000 } + default_value 38400 + description " + This option specifies the default baud rate (speed) + for the ARM PID port 0." } - default_value 38400 - description " - This option specifies the default baud rate (speed) for the - ARM PID port 0." + + cdl_option CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BUFSIZE { + display "Buffer size for the ARM PID serial port 0 driver" + flavor data + legal_values 0 to 8192 + default_value 128 + description " + This option specifies the size of the internal buffers + used for the ARM PID port 0." + } } - cdl_option CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BUFSIZE { - display "Buffer size for the ARM PID serial port 0 driver" - flavor data - legal_values 0 to 8192 - default_value 128 + cdl_component CYGPKG_IO_SERIAL_ARM_PID_SERIAL1 { + display "ARM PID serial port 1 driver" + flavor bool + default_value 1 + + implements CYGINT_IO_SERIAL_GENERIC_16X5X_REQUIRED + implements CYGINT_IO_SERIAL_FLOW_CONTROL_HW + implements CYGINT_IO_SERIAL_LINE_STATUS_HW + description " - This option specifies the size of the internal buffers used - for the ARM PID port 0." - } -} + This option includes the serial device driver for the ARM + PID port 1." + + cdl_option CYGDAT_IO_SERIAL_ARM_PID_SERIAL1_NAME { + display "Device name for ARM PID serial port 1 driver" + flavor data + default_value {"\"/dev/ser1\""} + description " + This option specifies the name of the serial device + for the ARM PID port 1." + } -cdl_component CYGPKG_IO_SERIAL_ARM_PID_SERIAL1 { - display "ARM PID serial port 1 driver" - flavor bool - default_value 1 - implements CYGINT_IO_SERIAL_FLOW_CONTROL_HW - implements CYGINT_IO_SERIAL_LINE_STATUS_HW - description " - This option includes the serial device driver for the ARM PID - port 1." + cdl_option CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BAUD { + display "Baud rate for the ARM PID serial port 1 driver" + flavor data + legal_values { 50 75 110 "134_5" 150 200 300 600 1200 1800 2400 + 3600 4800 7200 9600 14400 19200 38400 + 57600 115200 234000 } + default_value 38400 + description " + This option specifies the default baud rate (speed) + for the ARM PID port 1." + } - cdl_option CYGDAT_IO_SERIAL_ARM_PID_SERIAL1_NAME { - display "Device name for ARM PID serial port 1 driver" - flavor data - default_value {"\"/dev/ser1\""} - description " - This option specifies the name of the serial device for the - ARM PID port 1." + cdl_option CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BUFSIZE { + display "Buffer size for the ARM PID serial port 1 driver" + flavor data + legal_values 0 to 8192 + default_value 128 + description " + This option specifies the size of the internal + buffers used for the ARM PID port 1." + } } - cdl_option CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BAUD { - display "Baud rate for the ARM PID serial port 1 driver" - flavor data - legal_values { 50 75 110 "134_5" 150 200 300 600 1200 1800 2400 3600 - 4800 7200 9600 14400 19200 38400 57600 115200 234000 - } - default_value 38400 - description " - This option specifies the default baud rate (speed) for the - ARM PID port 1." - } + cdl_component CYGPKG_IO_SERIAL_ARM_PID_TESTING { + display "Testing parameters" + flavor bool + calculated 1 + active_if CYGPKG_IO_SERIAL_ARM_PID_SERIAL0 - cdl_option CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BUFSIZE { - display "Buffer size for the ARM PID serial port 1 driver" - flavor data - legal_values 0 to 8192 - default_value 128 - description " - This option specifies the size of the internal buffers used - for the ARM PID port 1." - } -} - - cdl_component CYGPKG_IO_SERIAL_ARM_PID_OPTIONS { - display "Serial device driver build options" - flavor none - description " - Package specific build options including control over - compiler flags used only in building this package, - and details of which tests are built." - - - cdl_option CYGPKG_IO_SERIAL_ARM_PID_CFLAGS_ADD { - display "Additional compiler flags" - flavor data - no_define - default_value { "" } - description " - This option modifies the set of compiler flags for - building these serial device drivers. These flags are used in addition - to the set of global flags." + implements CYGINT_IO_SERIAL_TEST_SKIP_9600 + implements CYGINT_IO_SERIAL_TEST_SKIP_115200 + implements CYGINT_IO_SERIAL_TEST_SKIP_PARITY_EVEN + + cdl_option CYGPRI_SER_TEST_SER_DEV { + display "Serial device used for testing" + flavor data + default_value { CYGDAT_IO_SERIAL_ARM_PID_SERIAL0_NAME } } - cdl_option CYGPKG_IO_SERIAL_ARM_PID_CFLAGS_REMOVE { - display "Suppressed compiler flags" - flavor data - no_define - default_value { "" } - description " - This option modifies the set of compiler flags for - building these serial device drivers. These flags are removed from - the set of global flags if present." + define_proc { + puts $::cdl_header "#define CYGPRI_SER_TEST_CRASH_ID \"armpid\"" + puts $::cdl_header "#define CYGPRI_SER_TEST_TTY_DEV \"/dev/tty0\"" } } }
new file mode 100644 --- /dev/null +++ b/packages/devs/serial/arm/pid/current/include/arm_arm7_pid_ser.inl @@ -0,0 +1,154 @@ +//========================================================================== +// +// io/serial/arm/arm_arm7_pid_ser.inl +// +// ARM PID Serial I/O definitions +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas, jlarmour +// Date: 1999-02-04 +// Purpose: PID Serial I/O module (interrupt driven version) +// Description: +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include <cyg/hal/hal_intr.h> + +//----------------------------------------------------------------------------- +// Baud rate specification + +static unsigned short select_baud[] = { + 0, // Unused + 0, // 50 + 0, // 75 + 1047, // 110 + 0, // 134.5 + 768, // 150 + 0, // 200 + 384, // 300 + 192, // 600 + 96, // 1200 + 24, // 1800 + 48, // 2400 + 0, // 3600 + 24, // 4800 + 16, // 7200 + 12, // 9600 + 8, // 14400 + 6, // 19200 + 3, // 38400 + 2, // 57600 + 1, // 115200 + 0, // 230400 +}; + +#ifdef CYGPKG_IO_SERIAL_ARM_PID_SERIAL0 +static pc_serial_info pid_serial_info0 = {0x0D800000, + CYGNUM_HAL_INTERRUPT_SERIALA}; +#if CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BUFSIZE > 0 +static unsigned char pid_serial_out_buf0[CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BUFSIZE]; +static unsigned char pid_serial_in_buf0[CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BUFSIZE]; + +static SERIAL_CHANNEL_USING_INTERRUPTS(pid_serial_channel0, + pc_serial_funs, + pid_serial_info0, + CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BAUD), + CYG_SERIAL_STOP_DEFAULT, + CYG_SERIAL_PARITY_DEFAULT, + CYG_SERIAL_WORD_LENGTH_DEFAULT, + CYG_SERIAL_FLAGS_DEFAULT, + &pid_serial_out_buf0[0], sizeof(pid_serial_out_buf0), + &pid_serial_in_buf0[0], sizeof(pid_serial_in_buf0) + ); +#else +static SERIAL_CHANNEL(pid_serial_channel0, + pc_serial_funs, + pid_serial_info0, + CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BAUD), + CYG_SERIAL_STOP_DEFAULT, + CYG_SERIAL_PARITY_DEFAULT, + CYG_SERIAL_WORD_LENGTH_DEFAULT, + CYG_SERIAL_FLAGS_DEFAULT + ); +#endif + +DEVTAB_ENTRY(pid_serial_io0, + CYGDAT_IO_SERIAL_ARM_PID_SERIAL0_NAME, + 0, // Does not depend on a lower level interface + &cyg_io_serial_devio, + pc_serial_init, + pc_serial_lookup, // Serial driver may need initializing + &pid_serial_channel0 + ); +#endif // CYGPKG_IO_SERIAL_ARM_PID_SERIAL0 + +#ifdef CYGPKG_IO_SERIAL_ARM_PID_SERIAL1 +static pc_serial_info pid_serial_info1 = {0x0D800020, + CYGNUM_HAL_INTERRUPT_SERIALB}; +#if CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BUFSIZE > 0 +static unsigned char pid_serial_out_buf1[CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BUFSIZE]; +static unsigned char pid_serial_in_buf1[CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BUFSIZE]; + +static SERIAL_CHANNEL_USING_INTERRUPTS(pid_serial_channel1, + pc_serial_funs, + pid_serial_info1, + CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BAUD), + CYG_SERIAL_STOP_DEFAULT, + CYG_SERIAL_PARITY_DEFAULT, + CYG_SERIAL_WORD_LENGTH_DEFAULT, + CYG_SERIAL_FLAGS_DEFAULT, + &pid_serial_out_buf1[0], sizeof(pid_serial_out_buf1), + &pid_serial_in_buf1[0], sizeof(pid_serial_in_buf1) + ); +#else +static SERIAL_CHANNEL(pid_serial_channel1, + pc_serial_funs, + pid_serial_info1, + CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BAUD), + CYG_SERIAL_STOP_DEFAULT, + CYG_SERIAL_PARITY_DEFAULT, + CYG_SERIAL_WORD_LENGTH_DEFAULT, + CYG_SERIAL_FLAGS_DEFAULT + ); +#endif + +DEVTAB_ENTRY(pid_serial_io1, + CYGDAT_IO_SERIAL_ARM_PID_SERIAL1_NAME, + 0, // Does not depend on a lower level interface + &cyg_io_serial_devio, + pc_serial_init, + pc_serial_lookup, // Serial driver may need initializing + &pid_serial_channel1 + ); +#endif // CYGPKG_IO_SERIAL_ARM_PID_SERIAL1 + +// EOF arm_arm7_pid_ser.inl
deleted file mode 100644 --- a/packages/devs/serial/arm/pid/current/src/pid_serial.h +++ /dev/null @@ -1,181 +0,0 @@ -#ifndef CYGONCE_ARM_PID_SERIAL_H -#define CYGONCE_ARM_PID_SERIAL_H - -// ==================================================================== -// -// pid_serial.h -// -// Device I/O - Description of ARM PID7T serial hardware -// -// ==================================================================== -//####COPYRIGHTBEGIN#### -// -// ------------------------------------------- -// The contents of this file are subject to the Red Hat eCos Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.redhat.com/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations under -// the License. -// -// The Original Code is eCos - Embedded Configurable Operating System, -// released September 30, 1998. -// -// The Initial Developer of the Original Code is Red Hat. -// Portions created by Red Hat are -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// All Rights Reserved. -// ------------------------------------------- -// -//####COPYRIGHTEND#### -// ==================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): gthomas -// Contributors: gthomas -// Date: 1999-02-04 -// Purpose: Internal interfaces for serial I/O drivers -// Description: -// -//####DESCRIPTIONEND#### -// -// ==================================================================== - -// Description of serial ports on ARM PID7T - -struct serial_port { - volatile unsigned char _byte[32]; -}; - -// Little-endian version -#if (CYG_BYTEORDER == CYG_LSBFIRST) - -#define REG(n) _byte[n*4] - -#else // Big-endian version - -#define REG(n) _byte[(n*4)^3] - -#endif - -// Receive control Registers -#define REG_rhr REG(0) // Receive holding register -#define REG_isr REG(2) // Interrupt status register -#define REG_lsr REG(5) // Line status register -#define REG_msr REG(6) // Modem status register -#define REG_scr REG(7) // Scratch register - -// Transmit control Registers -#define REG_thr REG(0) // Transmit holding register -#define REG_ier REG(1) // Interrupt enable register -#define REG_fcr REG(2) // FIFO control register -#define REG_lcr REG(3) // Line control register -#define REG_mcr REG(4) // Modem control register -#define REG_ldl REG(0) // LSB of baud rate -#define REG_mdl REG(1) // MSB of baud rate - -// Interrupt Enable Register -#define IER_RCV 0x01 -#define IER_XMT 0x02 -#define IER_LS 0x04 -#define IER_MS 0x08 - -// Line Control Register -#define LCR_WL5 0x00 // Word length -#define LCR_WL6 0x01 -#define LCR_WL7 0x02 -#define LCR_WL8 0x03 -#define LCR_SB1 0x00 // Number of stop bits -#define LCR_SB1_5 0x04 // 1.5 -> only valid with 5 bit words -#define LCR_SB2 0x04 -#define LCR_PN 0x00 // Parity mode - none -#define LCR_PE 0x0C // Parity mode - even -#define LCR_PO 0x08 // Parity mode - odd -#define LCR_PM 0x28 // Forced "mark" parity -#define LCR_PS 0x38 // Forced "space" parity -#define LCR_DL 0x80 // Enable baud rate latch - -// Line Status Register -#define LSR_RSR 0x01 -#define LSR_OE 0x02 -#define LSR_PE 0x04 -#define LSR_FE 0x08 -#define LSR_BI 0x10 -#define LSR_THE 0x20 -#define LSR_TEMT 0x40 -#define LSR_FIE 0x80 - -// Modem Control Register -#define MCR_DTR 0x01 -#define MCR_RTS 0x02 -#define MCR_INT 0x08 // Enable interrupts - -// Interrupt status Register -#define ISR_MS 0x00 -#define ISR_nIP 0x01 -#define ISR_Tx 0x02 -#define ISR_LS 0x03 -#define ISR_Rx 0x04 -#define ISR_RxTO 0x0C - -// Modem Status Register -#define MSR_DCTS 0x01 -#define MSR_DDSR 0x02 -#define MSR_TERI 0x04 -#define MSR_DDCD 0x08 -#define MSR_CTS 0x10 -#define MSR_DSR 0x20 -#define MSR_RI 0x40 -#define MSR_CD 0x80 - -static unsigned char select_word_length[] = { - LCR_WL5, // 5 bits / word (char) - LCR_WL6, - LCR_WL7, - LCR_WL8 -}; - -static unsigned char select_stop_bits[] = { - 0, - LCR_SB1, // 1 stop bit - LCR_SB1_5, // 1.5 stop bit - LCR_SB2 // 2 stop bits -}; - -static unsigned char select_parity[] = { - LCR_PN, // No parity - LCR_PE, // Even parity - LCR_PO, // Odd parity - LCR_PM, // Mark parity - LCR_PS, // Space parity -}; - -static unsigned short select_baud[] = { - 0, // Unused - 0, // 50 - 0, // 75 - 1047, // 110 - 0, // 134.5 - 768, // 150 - 0, // 200 - 384, // 300 - 192, // 600 - 96, // 1200 - 24, // 1800 - 48, // 2400 - 0, // 3600 - 24, // 4800 - 16, // 7200 - 12, // 9600 - 8, // 14400 - 6, // 19200 - 3, // 38400 - 2, // 57600 - 1, // 115200 - 0, // 230400 -}; - -#endif // CYGONCE_ARM_PID_SERIAL_H
deleted file mode 100644 --- a/packages/devs/serial/arm/pid/current/src/pid_serial_with_ints.c +++ /dev/null @@ -1,436 +0,0 @@ -//========================================================================== -// -// io/serial/arm/pid_serial_with_ints.c -// -// ARM PID Serial I/O Interface Module (interrupt driven) -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ------------------------------------------- -// The contents of this file are subject to the Red Hat eCos Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.redhat.com/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations under -// the License. -// -// The Original Code is eCos - Embedded Configurable Operating System, -// released September 30, 1998. -// -// The Initial Developer of the Original Code is Red Hat. -// Portions created by Red Hat are -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// All Rights Reserved. -// ------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): gthomas -// Contributors: gthomas, jlarmour -// Date: 1999-02-04 -// Purpose: PID Serial I/O module (interrupt driven version) -// Description: -// -//####DESCRIPTIONEND#### -// -//========================================================================== - -#include <pkgconf/system.h> -#include <pkgconf/io_serial.h> -#include <pkgconf/io.h> -#include <cyg/io/io.h> -#include <cyg/hal/hal_intr.h> -#include <cyg/io/devtab.h> -#include <cyg/io/serial.h> -#include <cyg/infra/diag.h> - -#ifdef CYGPKG_IO_SERIAL_ARM_PID -#include "pid_serial.h" - -typedef struct pid_serial_info { - CYG_ADDRWORD base; - CYG_WORD int_num; - cyg_interrupt serial_interrupt; - cyg_handle_t serial_interrupt_handle; -} pid_serial_info; - -static bool pid_serial_init(struct cyg_devtab_entry *tab); -static bool pid_serial_putc(serial_channel *chan, unsigned char c); -static Cyg_ErrNo pid_serial_lookup(struct cyg_devtab_entry **tab, - struct cyg_devtab_entry *sub_tab, - const char *name); -static unsigned char pid_serial_getc(serial_channel *chan); -static Cyg_ErrNo pid_serial_set_config(serial_channel *chan, cyg_uint32 key, - const void *xbuf, cyg_uint32 *len); -static void pid_serial_start_xmit(serial_channel *chan); -static void pid_serial_stop_xmit(serial_channel *chan); - -static cyg_uint32 pid_serial_ISR(cyg_vector_t vector, cyg_addrword_t data); -static void pid_serial_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data); - -static SERIAL_FUNS(pid_serial_funs, - pid_serial_putc, - pid_serial_getc, - pid_serial_set_config, - pid_serial_start_xmit, - pid_serial_stop_xmit - ); - -#ifdef CYGPKG_IO_SERIAL_ARM_PID_SERIAL0 -static pid_serial_info pid_serial_info0 = {0x0D800000, CYGNUM_HAL_INTERRUPT_SERIALA}; -#if CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BUFSIZE > 0 -static unsigned char pid_serial_out_buf0[CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BUFSIZE]; -static unsigned char pid_serial_in_buf0[CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BUFSIZE]; - -static SERIAL_CHANNEL_USING_INTERRUPTS(pid_serial_channel0, - pid_serial_funs, - pid_serial_info0, - CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BAUD), - CYG_SERIAL_STOP_DEFAULT, - CYG_SERIAL_PARITY_DEFAULT, - CYG_SERIAL_WORD_LENGTH_DEFAULT, - CYG_SERIAL_FLAGS_DEFAULT, - &pid_serial_out_buf0[0], sizeof(pid_serial_out_buf0), - &pid_serial_in_buf0[0], sizeof(pid_serial_in_buf0) - ); -#else -static SERIAL_CHANNEL(pid_serial_channel0, - pid_serial_funs, - pid_serial_info0, - CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BAUD), - CYG_SERIAL_STOP_DEFAULT, - CYG_SERIAL_PARITY_DEFAULT, - CYG_SERIAL_WORD_LENGTH_DEFAULT, - CYG_SERIAL_FLAGS_DEFAULT - ); -#endif - -DEVTAB_ENTRY(pid_serial_io0, - CYGDAT_IO_SERIAL_ARM_PID_SERIAL0_NAME, - 0, // Does not depend on a lower level interface - &cyg_io_serial_devio, - pid_serial_init, - pid_serial_lookup, // Serial driver may need initializing - &pid_serial_channel0 - ); -#endif // CYGPKG_IO_SERIAL_ARM_PID_SERIAL0 - -#ifdef CYGPKG_IO_SERIAL_ARM_PID_SERIAL1 -static pid_serial_info pid_serial_info1 = {0x0D800020, CYGNUM_HAL_INTERRUPT_SERIALB}; -#if CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BUFSIZE > 0 -static unsigned char pid_serial_out_buf1[CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BUFSIZE]; -static unsigned char pid_serial_in_buf1[CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BUFSIZE]; - -static SERIAL_CHANNEL_USING_INTERRUPTS(pid_serial_channel1, - pid_serial_funs, - pid_serial_info1, - CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BAUD), - CYG_SERIAL_STOP_DEFAULT, - CYG_SERIAL_PARITY_DEFAULT, - CYG_SERIAL_WORD_LENGTH_DEFAULT, - CYG_SERIAL_FLAGS_DEFAULT, - &pid_serial_out_buf1[0], sizeof(pid_serial_out_buf1), - &pid_serial_in_buf1[0], sizeof(pid_serial_in_buf1) - ); -#else -static SERIAL_CHANNEL(pid_serial_channel1, - pid_serial_funs, - pid_serial_info1, - CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BAUD), - CYG_SERIAL_STOP_DEFAULT, - CYG_SERIAL_PARITY_DEFAULT, - CYG_SERIAL_WORD_LENGTH_DEFAULT, - CYG_SERIAL_FLAGS_DEFAULT - ); -#endif - -DEVTAB_ENTRY(pid_serial_io1, - CYGDAT_IO_SERIAL_ARM_PID_SERIAL1_NAME, - 0, // Does not depend on a lower level interface - &cyg_io_serial_devio, - pid_serial_init, - pid_serial_lookup, // Serial driver may need initializing - &pid_serial_channel1 - ); -#endif // CYGPKG_IO_SERIAL_ARM_PID_SERIAL1 - -// Internal function to actually configure the hardware to desired baud rate, etc. -static bool -pid_serial_config_port(serial_channel *chan, cyg_serial_info_t *new_config, bool init) -{ - pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; - volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base; - unsigned short baud_divisor = select_baud[new_config->baud]; - unsigned char _lcr, _ier; - if (baud_divisor == 0) return false; // Invalid configuration - _ier = port->REG_ier; - port->REG_ier = 0; // Disable port interrupts while changing hardware - _lcr = select_word_length[new_config->word_length - CYGNUM_SERIAL_WORD_LENGTH_5] | - select_stop_bits[new_config->stop] | - select_parity[new_config->parity]; - port->REG_lcr = _lcr; - port->REG_lcr |= LCR_DL; - port->REG_mdl = baud_divisor >> 8; - port->REG_ldl = baud_divisor & 0xFF; - port->REG_lcr &= ~LCR_DL; - if (init) { - port->REG_fcr = 0x07; // Enable and clear FIFO - if (chan->out_cbuf.len != 0) { - _ier = IER_RCV; - } else { - _ier = 0; - } - port->REG_mcr = MCR_INT|MCR_DTR|MCR_RTS; // Master interrupt enable - } -#ifdef CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS - _ier |= (IER_LS|IER_MS); -#endif - port->REG_ier = _ier; - if (new_config != &chan->config) { - chan->config = *new_config; - } - return true; -} - -// Function to initialize the device. Called at bootstrap time. -static bool -pid_serial_init(struct cyg_devtab_entry *tab) -{ - serial_channel *chan = (serial_channel *)tab->priv; - pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; -#ifdef CYGDBG_IO_INIT - diag_printf("PID SERIAL init - dev: %x.%d\n", pid_chan->base, pid_chan->int_num); -#endif - (chan->callbacks->serial_init)(chan); // Really only required for interrupt driven devices - if (chan->out_cbuf.len != 0) { - cyg_drv_interrupt_create(pid_chan->int_num, - 99, // Priority - what goes here? - (cyg_addrword_t)chan, // Data item passed to interrupt handler - pid_serial_ISR, - pid_serial_DSR, - &pid_chan->serial_interrupt_handle, - &pid_chan->serial_interrupt); - cyg_drv_interrupt_attach(pid_chan->serial_interrupt_handle); - cyg_drv_interrupt_unmask(pid_chan->int_num); - } - pid_serial_config_port(chan, &chan->config, true); - return true; -} - -// This routine is called when the device is "looked" up (i.e. attached) -static Cyg_ErrNo -pid_serial_lookup(struct cyg_devtab_entry **tab, - struct cyg_devtab_entry *sub_tab, - const char *name) -{ - serial_channel *chan = (serial_channel *)(*tab)->priv; - (chan->callbacks->serial_init)(chan); // Really only required for interrupt driven devices - return ENOERR; -} - -// Send a character to the device output buffer. -// Return 'true' if character is sent to device -static bool -pid_serial_putc(serial_channel *chan, unsigned char c) -{ - pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; - volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base; - if (port->REG_lsr & LSR_THE) { -// Transmit buffer is empty - port->REG_thr = c; - return true; - } else { -// No space - return false; - } -} - -// Fetch a character from the device input buffer, waiting if necessary -static unsigned char -pid_serial_getc(serial_channel *chan) -{ - unsigned char c; - pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; - volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base; - while ((port->REG_lsr & LSR_RSR) == 0) ; // Wait for char - c = port->REG_rhr; - return c; -} - -// Set up the device characteristics; baud rate, etc. -static Cyg_ErrNo -pid_serial_set_config(serial_channel *chan, cyg_uint32 key, const void *xbuf, - cyg_uint32 *len) -{ - pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; - - switch (key) { - case CYG_IO_SET_CONFIG_SERIAL_INFO: - { - cyg_serial_info_t *config = (cyg_serial_info_t *)xbuf; - if ( *len < sizeof(cyg_serial_info_t) ) { - return -EINVAL; - } - *len = sizeof(cyg_serial_info_t); - if ( true != pid_serial_config_port(chan, config, false) ) - return -EINVAL; - } - break; -#ifdef CYGOPT_IO_SERIAL_FLOW_CONTROL_HW - case CYG_IO_SET_CONFIG_SERIAL_HW_RX_FLOW_THROTTLE: - { - volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base; - cyg_uint8 *f = (cyg_uint8 *)xbuf; - unsigned char mask=0; - if ( *len < *f ) - return -EINVAL; - - if ( chan->config.flags & CYGNUM_SERIAL_FLOW_RTSCTS_RX ) - mask = MCR_RTS; - if ( chan->config.flags & CYGNUM_SERIAL_FLOW_DSRDTR_RX ) - mask |= MCR_DTR; - if (*f) // we should throttle - port->REG_mcr &= ~mask; - else // we should no longer throttle - port->REG_mcr |= mask; - } - break; - case CYG_IO_SET_CONFIG_SERIAL_HW_FLOW_CONFIG: - // Nothing to do because we do support both RTSCTS and DSRDTR flow - // control. - // Other targets would clear any unsupported flags here. - // We just return ENOERR. - break; -#endif - default: - return -EINVAL; - } - return ENOERR; -} - -// Enable the transmitter on the device -static void -pid_serial_start_xmit(serial_channel *chan) -{ - pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; - volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base; - port->REG_ier |= IER_XMT; // Enable xmit interrupt -} - -// Disable the transmitter on the device -static void -pid_serial_stop_xmit(serial_channel *chan) -{ - pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; - volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base; - port->REG_ier &= ~IER_XMT; // Disable xmit interrupt -} - -// Serial I/O - low level interrupt handler (ISR) -static cyg_uint32 -pid_serial_ISR(cyg_vector_t vector, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; - cyg_drv_interrupt_mask(pid_chan->int_num); - cyg_drv_interrupt_acknowledge(pid_chan->int_num); - return CYG_ISR_CALL_DSR; // Cause DSR to be run -} - -// Serial I/O - high level interrupt handler (DSR) -static void -pid_serial_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; - volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base; - unsigned char isr; - - // Check if we have an interrupt pending - note that the interrupt - // is pending of the low bit of the isr is *0*, not 1. - while (((isr = port->REG_isr) & ISR_nIP) == 0) { - switch (isr&0x6) { - case ISR_Rx: - while(port->REG_lsr & LSR_RSR) - (chan->callbacks->rcv_char)(chan, port->REG_rhr); - break; - case ISR_Tx: - (chan->callbacks->xmt_char)(chan); - break; - -#ifdef CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS - case ISR_LS: - { - cyg_serial_line_status_t stat; - unsigned char lsr=port->REG_lsr; - // this might look expensive, but it is rarely the case that - // more than one of these is set - stat.value = 1; - if ( lsr & LSR_OE ) { - stat.which = CYGNUM_SERIAL_STATUS_OVERRUNERR; - (chan->callbacks->indicate_status)(chan, &stat ); - } - if ( lsr & LSR_PE ) { - stat.which = CYGNUM_SERIAL_STATUS_PARITYERR; - (chan->callbacks->indicate_status)(chan, &stat ); - } - if ( lsr & LSR_FE ) { - stat.which = CYGNUM_SERIAL_STATUS_FRAMEERR; - (chan->callbacks->indicate_status)(chan, &stat ); - } - if ( lsr & LSR_BI ) { - stat.which = CYGNUM_SERIAL_STATUS_BREAK; - (chan->callbacks->indicate_status)(chan, &stat ); - } - } - break; - - case ISR_MS: - { - cyg_serial_line_status_t stat; - unsigned char msr=port->REG_msr; -#ifdef CYGOPT_IO_SERIAL_FLOW_CONTROL_HW - if ( msr & MSR_DDSR ) - if ( chan->config.flags & CYGNUM_SERIAL_FLOW_DSRDTR_TX ) { - stat.which = CYGNUM_SERIAL_STATUS_FLOW; - stat.value = (0 != (msr & MSR_DSR)); - (chan->callbacks->indicate_status)(chan, &stat ); - } - if ( msr & MSR_DCTS ) - if ( chan->config.flags & CYGNUM_SERIAL_FLOW_RTSCTS_TX ) { - stat.which = CYGNUM_SERIAL_STATUS_FLOW; - stat.value = (0 != (msr & MSR_CTS)); - (chan->callbacks->indicate_status)(chan, &stat ); - } -#endif - if ( msr & MSR_DDCD ) { - stat.which = CYGNUM_SERIAL_STATUS_CARRIERDETECT; - stat.value = (0 != (msr & MSR_CD)); - (chan->callbacks->indicate_status)(chan, &stat ); - } - if ( msr & MSR_RI ) { - stat.which = CYGNUM_SERIAL_STATUS_RINGINDICATOR; - stat.value = 1; - (chan->callbacks->indicate_status)(chan, &stat ); - } - if ( msr & MSR_TERI ) { - stat.which = CYGNUM_SERIAL_STATUS_RINGINDICATOR; - stat.value = 0; - (chan->callbacks->indicate_status)(chan, &stat ); - } - } - break; -#endif - } - } - cyg_drv_interrupt_unmask(pid_chan->int_num); -} -#endif - -// EOF pid_serial_with_ints.c
new file mode 100644 --- /dev/null +++ b/packages/devs/serial/generic/16x5x/current/ChangeLog @@ -0,0 +1,211 @@ +2000-09-18 Jesper Skov <jskov@redhat.com> + + * src/ser_16x5x.c: Allow clients to specify register + stepping. Rename a type. Fix compile error. + +2000-09-14 Jesper Skov <jskov@redhat.com> + + * src/ser_16x5x.c: Moved ARM/PID driver to provide generic 16x5x + driver. Rewritten to use HAL IO macros. Still needs some polish + and configury to properly support all the various target + controllers that may only have a partial set of the features. + * cdl/ser_generic_16x5x.cdl: Same. + + * Removed non-PID related ChangeLog entries. + +---------------------------------------------------------------------------- +2000-08-24 Jonathan Larmour <jlarmour@redhat.co.uk> + + * src/pid_serial_with_ints.c (pid_serial_DSR): Remove accidental + OVERRUNERR check duplication + +2000-08-01 Jonathan Larmour <jlarmour@redhat.co.uk> + + * src/pid_serial_with_ints.c: Throughout, add support for line status + and modem status callbacks, hardware RTS/CTS and DSR/DTR flow control + (pid_serial_set_config): Now use keys to make + more flexible. + + * src/pid_serial.h: Add more line status, interrupt status and modem + status register definitions + + * cdl/ser_arm_pid.cdl: Implements flow control and line status + interfaces + +2000-06-22 Hugo Tyson <hmt@cygnus.co.uk> + + * cdl/<yournamehere>.cdl: Remove the comment on the empty + include_files directive; the tools now support this correctly. + This keeps internal include files internal. + +2000-06-09 Jesper Skov <jskov@redhat.com> + + * src/pid_serial_with_ints.c: + * src/pid_serial.h: + Cleaned up defines and made DSR handle all received characters. + (Dave Airlie (airlied at parthus dot com)) + +2000-04-11 Hugo Tyson <hmt@cygnus.co.uk> + + * cdl/ser_arm_pid.cdl: Change the parent from CYGPKG_IO_SERIAL + (which is enabled most of the time) to CYGPKG_IO_SERIAL_DEVICES + (which is not...) thus allowing convenient control independent of + platform. Also enable all individual devices by default, now, so + that they can be enabled simply by enabling the above new parent. + +2000-04-07 Hugo Tyson <hmt@cygnus.co.uk> + + * ecos.db: Re-organize device packages. This is a massive change + involving deleting all the sources for serial and ethernet drivers + from where they used to live in + packages/io/serial/current/src/ARCH/PLATFORM.[ch] + packages/net/drivers/eth/PLATFORM/current/src/... + and reinstating them in + packages/devs/serial/ARCH/PLATFORM/current/src/... + packages/devs/eth/ARCH/PLATFORM/current/src/... + + All these new packages are properly defined in ecos.db, and are + all of type "hardware" so that a "target" can grab them. + + This directory layout is descriptive of the devices we have right + now, arch and platform are separate levels just to make it easier + to navigate in the filesystem and similar to the HAL structure in + the filesystem. + + It is *not* prescriptive of future work; for example, the mythical + common highly-portable 16550 serial driver which works on many + targets would be called "devs/serial/s16550/current", or a serial + device for a particular board (cogent springs to mind) that can + work with different CPUs fitted is "devs/serial/cogent/current". + + Changelogs have been preserved and replicated over all the new + packages, so that no history is lost. + + The contents of individual source files are unchanged; they build + in just the same emvironment except for a very few cases where the + config file name changed in this movement. + + Targets in ecos.db have been redefined to bring in all relevant + hardware packages including net and serial drivers (but the newly + included packages are only active if their desired parent is + available.) + + The names of CDL options (and their #defines of course) stay the + same for the serial drivers, for backward compatibility. + + * templates/*/current.ect: these have had CYGPKG_IO_SERIAL added + rather than it being in (almost) all target definitions. + +2000-01-03 Gary Thomas <gthomas@cygnus.co.uk> + + * src/arm/pid_serial_with_ints.c: Fix namespace pollution - + serial_devio => cyg_io_serial_devio + +1999-12-06 Gary Thomas <gthomas@cygnus.co.uk> + + * src/arm/pid_serial_with_ints.c (pid_serial_DSR): Add loop to handle + case where an interrupt represents multiple events. + +1999-10-26 Jesper Skov <jskov@cygnus.co.uk> + + * src/arm/pid_serial.h: Added BE support. + +1999-10-25 Gary Thomas <gthomas@cygnus.co.uk> + + * src/arm/pid_serial.h (ISR_RxTO): Define - character received but + not handled "promptly". + + * src/arm/pid_serial_with_ints.c (pid_serial_DSR): Handle rcv + interrupts properly (can't ignore them even with TO bit set). + +1999-06-20 Gary Thomas <gthomas@cygnus.co.uk> + + * src/arm/pid_serial_with_ints.c: Use #include to get 'diag_printf()' + prototypes. + +1999-05-14 Jesper Skov <jskov@cygnus.co.uk> + + * src/arm/pid_serial_with_ints.c: + * src/arm/pid_serial.h: + Check for receive interrupt before reading. + +1999-04-20 Gary Thomas <gthomas@cygnus.co.uk> + + * src/arm/pid_serial_with_ints.c: Fix default baud rate if unbuffered. + +1999-03-25 Gary Thomas <gthomas@cygnus.co.uk> + + * src/arm/pid_serial_with_ints.c: + Update CDL to follow naming conventions. + + * src/arm/pid_serial_with_ints.c (pid_serial_config_port): Change + so that the physical port is not modified unless the provided + configuration is valid. + + * src/arm/pid_serial_with_ints.c: + Add configury for baud rate and buffer size. + +1999-03-24 Gary Thomas <gthomas@cygnus.co.uk> + + * src/arm/pid_serial_with_ints.c (pid_serial_stop_xmit): Fix typo + in comment. + +1999-03-22 Gary Thomas <gthomas@cygnus.co.uk> + + * src/arm/pid_serial_with_ints.c: Use CDL configured device names. + +1999-03-19 Jesper Skov <jskov@lassi.cygnus.co.uk> + + * src/arm/pid_serial_with_ints.c: + Moved include statement to avoid warnings. + +1999-03-18 Gary Thomas <gthomas@cygnus.co.uk> + + * src/arm/pid_serial_with_ints.c: + Update device names to match CDL. + +1999-03-17 Gary Thomas <gthomas@cygnus.co.uk> + + * src/arm/pid_serial_with_ints.c: Conditionalize based on CDL. + +1999-03-15 Gary Thomas <gthomas@cygnus.co.uk> + + * src/arm/pid_serial_with_ints.c: Add 'CYGDBG_IO_INIT' for control + of init messages. + + * src/arm/pid_serial_with_ints.c: Don't include <cyg/kernel/kapi.h> + +1999-03-05 Gary Thomas <gthomas@cygnus.co.uk> + + * src/arm/pid_serial_with_ints.c: Fix interrupt vectors. + +1999-03-03 Gary Thomas <gthomas@cygnus.co.uk> + + * serial/current/src/arm/pid_serial_with_ints.c: + New [somewhat] configurable drivers for PID. + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//===========================================================================
new file mode 100644 --- /dev/null +++ b/packages/devs/serial/generic/16x5x/current/cdl/ser_generic_16x5x.cdl @@ -0,0 +1,103 @@ +# ==================================================================== +# +# ser_generic_16x5x.cdl +# +# eCos serial 16x5x configuration data +# +# ==================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Red Hat eCos Public License +# Version 1.1 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.redhat.com/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Configurable Operating System, +# released September 30, 1998. +# +# The Initial Developer of the Original Code is Red Hat. +# Portions created by Red Hat are +# Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +# All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +# ==================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): jskov +# Original data: gthomas +# Contributors: +# Date: 1999-07-07 +# +#####DESCRIPTIONEND#### +# +# ==================================================================== + + +cdl_package CYGPKG_IO_SERIAL_GENERIC_16X5X { + display "16x5x generic serial device drivers" + + parent CYGPKG_IO_SERIAL_DEVICES + active_if CYGPKG_IO_SERIAL + + active_if CYGINT_IO_SERIAL_GENERIC_16X5X_REQUIRED + + requires CYGPKG_ERROR + include_dir cyg/io + include_files ; # none _exported_ whatsoever + description " + This option enables the serial device drivers for the + 16x5x compatiple controllers." + doc redirect/ecos-device-drivers.html + + compile -library=libextras.a ser_16x5x.c + + define_proc { + puts $::cdl_system_header "/***** serial driver proc output start *****/" + puts $::cdl_system_header "#define CYGDAT_IO_SERIAL_DEVICE_HEADER <pkgconf/io_serial_generic_16x5x.h>" + puts $::cdl_system_header "/***** serial driver proc output end *****/" + puts $::cdl_header "#include <pkgconf/system.h>"; + puts $::cdl_header "#include CYGDAT_IO_SERIAL_GENERIC_16X5X_CFG"; + } + + cdl_component CYGPKG_IO_SERIAL_GENERIC_16X5X_OPTIONS { + display "Serial device driver build options" + flavor none + description " + Package specific build options including control over + compiler flags used only in building this package, + and details of which tests are built." + + + cdl_option CYGPKG_IO_SERIAL_GENERIC_16X5X_CFLAGS_ADD { + display "Additional compiler flags" + flavor data + no_define + default_value { "" } + description " + This option modifies the set of compiler flags for + building these serial device drivers. These flags are + used in addition to the set of global flags." + } + + cdl_option CYGPKG_IO_SERIAL_GENERIC_16X5X_CFLAGS_REMOVE { + display "Suppressed compiler flags" + flavor data + no_define + default_value { "" } + description " + This option modifies the set of compiler flags for + building these serial device drivers. These flags are + removed from the set of global flags if present." + } + } +} + +# EOF ser_generic_16x5x.cdl
new file mode 100644 --- /dev/null +++ b/packages/devs/serial/generic/16x5x/current/src/ser_16x5x.c @@ -0,0 +1,510 @@ +//========================================================================== +// +// io/serial/generic/16x5x/ser_16x5x.c +// +// Generic 16x5x serial driver +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas, jlarmour, jskov +// Date: 1999-02-04 +// Purpose: 16x5x generic serial driver +// Description: +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include <pkgconf/system.h> +#include <pkgconf/io_serial.h> +#include <pkgconf/io.h> + +#include <cyg/io/io.h> +#include <cyg/hal/hal_intr.h> +#include <cyg/io/devtab.h> +#include <cyg/io/serial.h> +#include <cyg/infra/diag.h> + +#include <cyg/hal/hal_io.h> + +// Only compile driver if an inline file with driver details was selected. +#ifdef CYGDAT_IO_SERIAL_GENERIC_16X5X_INL + +#ifndef CYGPRI_IO_SERIAL_GENERIC_16X5X_STEP +#define CYGPRI_IO_SERIAL_GENERIC_16X5X_STEP 1 +#endif + +#define SER_REG(_x_) ((_x_)*CYGPRI_IO_SERIAL_GENERIC_16X5X_STEP) + +// Receive control Registers +#define REG_rhr SER_REG(0) // Receive holding register +#define REG_isr SER_REG(2) // Interrupt status register +#define REG_lsr SER_REG(5) // Line status register +#define REG_msr SER_REG(6) // Modem status register +#define REG_scr SER_REG(7) // Scratch register + +// Transmit control Registers +#define REG_thr SER_REG(0) // Transmit holding register +#define REG_ier SER_REG(1) // Interrupt enable register +#define REG_fcr SER_REG(2) // FIFO control register +#define REG_lcr SER_REG(3) // Line control register +#define REG_mcr SER_REG(4) // Modem control register +#define REG_ldl SER_REG(0) // LSB of baud rate +#define REG_mdl SER_REG(1) // MSB of baud rate + +// Interrupt Enable Register +#define IER_RCV 0x01 +#define IER_XMT 0x02 +#define IER_LS 0x04 +#define IER_MS 0x08 + +// Line Control Register +#define LCR_WL5 0x00 // Word length +#define LCR_WL6 0x01 +#define LCR_WL7 0x02 +#define LCR_WL8 0x03 +#define LCR_SB1 0x00 // Number of stop bits +#define LCR_SB1_5 0x04 // 1.5 -> only valid with 5 bit words +#define LCR_SB2 0x04 +#define LCR_PN 0x00 // Parity mode - none +#define LCR_PE 0x0C // Parity mode - even +#define LCR_PO 0x08 // Parity mode - odd +#define LCR_PM 0x28 // Forced "mark" parity +#define LCR_PS 0x38 // Forced "space" parity +#define LCR_DL 0x80 // Enable baud rate latch + +// Line Status Register +#define LSR_RSR 0x01 +#define LSR_OE 0x02 +#define LSR_PE 0x04 +#define LSR_FE 0x08 +#define LSR_BI 0x10 +#define LSR_THE 0x20 +#define LSR_TEMT 0x40 +#define LSR_FIE 0x80 + +// Modem Control Register +#define MCR_DTR 0x01 +#define MCR_RTS 0x02 +#define MCR_INT 0x08 // Enable interrupts + +// Interrupt status Register +#define ISR_MS 0x00 +#define ISR_nIP 0x01 +#define ISR_Tx 0x02 +#define ISR_LS 0x03 +#define ISR_Rx 0x04 +#define ISR_RxTO 0x0C + +// Modem Status Register +#define MSR_DCTS 0x01 +#define MSR_DDSR 0x02 +#define MSR_TERI 0x04 +#define MSR_DDCD 0x08 +#define MSR_CTS 0x10 +#define MSR_DSR 0x20 +#define MSR_RI 0x40 +#define MSR_CD 0x80 + +static unsigned char select_word_length[] = { + LCR_WL5, // 5 bits / word (char) + LCR_WL6, + LCR_WL7, + LCR_WL8 +}; + +static unsigned char select_stop_bits[] = { + 0, + LCR_SB1, // 1 stop bit + LCR_SB1_5, // 1.5 stop bit + LCR_SB2 // 2 stop bits +}; + +static unsigned char select_parity[] = { + LCR_PN, // No parity + LCR_PE, // Even parity + LCR_PO, // Odd parity + LCR_PM, // Mark parity + LCR_PS, // Space parity +}; + +// selec_baud[] must be define by the client + +typedef struct pc_serial_info { + cyg_addrword_t base; + int int_num; + cyg_interrupt serial_interrupt; + cyg_handle_t serial_interrupt_handle; +} pc_serial_info; + +static bool pc_serial_init(struct cyg_devtab_entry *tab); +static bool pc_serial_putc(serial_channel *chan, unsigned char c); +static Cyg_ErrNo pc_serial_lookup(struct cyg_devtab_entry **tab, + struct cyg_devtab_entry *sub_tab, + const char *name); +static unsigned char pc_serial_getc(serial_channel *chan); +static Cyg_ErrNo pc_serial_set_config(serial_channel *chan, cyg_uint32 key, + const void *xbuf, cyg_uint32 *len); +static void pc_serial_start_xmit(serial_channel *chan); +static void pc_serial_stop_xmit(serial_channel *chan); + +static cyg_uint32 pc_serial_ISR(cyg_vector_t vector, cyg_addrword_t data); +static void pc_serial_DSR(cyg_vector_t vector, cyg_ucount32 count, + cyg_addrword_t data); + +static SERIAL_FUNS(pc_serial_funs, + pc_serial_putc, + pc_serial_getc, + pc_serial_set_config, + pc_serial_start_xmit, + pc_serial_stop_xmit + ); + +#include CYGDAT_IO_SERIAL_GENERIC_16X5X_INL + +// Internal function to actually configure the hardware to desired +// baud rate, etc. +static bool +serial_config_port(serial_channel *chan, + cyg_serial_info_t *new_config, bool init) +{ + pc_serial_info *ser_chan = (pc_serial_info *)chan->dev_priv; + cyg_addrword_t base = ser_chan->base; + unsigned short baud_divisor = select_baud[new_config->baud]; + unsigned char _lcr, _ier; + if (baud_divisor == 0) return false; // Invalid configuration + + // Disable port interrupts while changing hardware + HAL_READ_UINT8(base+REG_ier, _ier); + HAL_WRITE_UINT8(base+REG_ier, 0); + + _lcr = select_word_length[new_config->word_length - CYGNUM_SERIAL_WORD_LENGTH_5] | + select_stop_bits[new_config->stop] | + select_parity[new_config->parity]; + HAL_WRITE_UINT8(base+REG_lcr, _lcr | LCR_DL); + HAL_WRITE_UINT8(base+REG_mdl, baud_divisor >> 8); + HAL_WRITE_UINT8(base+REG_ldl, baud_divisor & 0xFF); + HAL_WRITE_UINT8(base+REG_lcr, _lcr); + if (init) { + HAL_WRITE_UINT8(base+REG_fcr, 0x07); // Enable and clear FIFO + if (chan->out_cbuf.len != 0) { + _ier = IER_RCV; + } else { + _ier = 0; + } + // Master interrupt enable + HAL_WRITE_UINT8(base+REG_mcr, MCR_INT|MCR_DTR|MCR_RTS); + } +#ifdef CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS + _ier |= (IER_LS|IER_MS); +#endif + HAL_WRITE_UINT8(base+REG_ier, _ier); + + if (new_config != &chan->config) { + chan->config = *new_config; + } + return true; +} + +// Function to initialize the device. Called at bootstrap time. +static bool +pc_serial_init(struct cyg_devtab_entry *tab) +{ + serial_channel *chan = (serial_channel *)tab->priv; + pc_serial_info *ser_chan = (pc_serial_info *)chan->dev_priv; +#ifdef CYGDBG_IO_INIT + diag_printf("16x5x SERIAL init - dev: %x.%d\n", + ser_chan->base, ser_chan->int_num); +#endif + // Really only required for interrupt driven devices + (chan->callbacks->serial_init)(chan); + + if (chan->out_cbuf.len != 0) { + cyg_drv_interrupt_create(ser_chan->int_num, + 99, + (cyg_addrword_t)chan, + pc_serial_ISR, + pc_serial_DSR, + &ser_chan->serial_interrupt_handle, + &ser_chan->serial_interrupt); + cyg_drv_interrupt_attach(ser_chan->serial_interrupt_handle); + cyg_drv_interrupt_unmask(ser_chan->int_num); + } + serial_config_port(chan, &chan->config, true); + return true; +} + +// This routine is called when the device is "looked" up (i.e. attached) +static Cyg_ErrNo +pc_serial_lookup(struct cyg_devtab_entry **tab, + struct cyg_devtab_entry *sub_tab, + const char *name) +{ + serial_channel *chan = (serial_channel *)(*tab)->priv; + + // Really only required for interrupt driven devices + (chan->callbacks->serial_init)(chan); + return ENOERR; +} + +// Send a character to the device output buffer. +// Return 'true' if character is sent to device +static bool +pc_serial_putc(serial_channel *chan, unsigned char c) +{ + cyg_uint8 _lsr; + pc_serial_info *ser_chan = (pc_serial_info *)chan->dev_priv; + cyg_addrword_t base = ser_chan->base; + + HAL_READ_UINT8(base+REG_lsr, _lsr); + if (_lsr & LSR_THE) { +// Transmit buffer is empty + HAL_WRITE_UINT8(base+REG_thr, c); + return true; + } else { +// No space + return false; + } +} + +// Fetch a character from the device input buffer, waiting if necessary +static unsigned char +pc_serial_getc(serial_channel *chan) +{ + unsigned char c; + cyg_uint8 _lsr; + pc_serial_info *ser_chan = (pc_serial_info *)chan->dev_priv; + cyg_addrword_t base = ser_chan->base; + + // Wait for char + do { + HAL_READ_UINT8(base+REG_lsr, _lsr); + } while ((_lsr & LSR_RSR) == 0); + + HAL_READ_UINT8(base+REG_rhr, c); + return c; +} + +// Set up the device characteristics; baud rate, etc. +static Cyg_ErrNo +pc_serial_set_config(serial_channel *chan, cyg_uint32 key, const void *xbuf, + cyg_uint32 *len) +{ + switch (key) { + case CYG_IO_SET_CONFIG_SERIAL_INFO: + { + cyg_serial_info_t *config = (cyg_serial_info_t *)xbuf; + if ( *len < sizeof(cyg_serial_info_t) ) { + return -EINVAL; + } + *len = sizeof(cyg_serial_info_t); + if ( true != serial_config_port(chan, config, false) ) + return -EINVAL; + } + break; +#ifdef CYGOPT_IO_SERIAL_FLOW_CONTROL_HW + case CYG_IO_SET_CONFIG_SERIAL_HW_RX_FLOW_THROTTLE: + { + cyg_uint8 _mcr; + pc_serial_info *ser_chan = (pc_serial_info *)chan->dev_priv; + cyg_addrword_t base = ser_chan->base; + cyg_uint8 *f = (cyg_uint8 *)xbuf; + unsigned char mask=0; + if ( *len < *f ) + return -EINVAL; + + if ( chan->config.flags & CYGNUM_SERIAL_FLOW_RTSCTS_RX ) + mask = MCR_RTS; + if ( chan->config.flags & CYGNUM_SERIAL_FLOW_DSRDTR_RX ) + mask |= MCR_DTR; + HAL_READ_UINT8(base+REG_mcr, _mcr); + if (*f) // we should throttle + _mcr &= ~mask; + else // we should no longer throttle + _mcr |= mask; + HAL_WRITE_UINT8(base+REG_mcr, _mcr); + } + break; + case CYG_IO_SET_CONFIG_SERIAL_HW_FLOW_CONFIG: + // Nothing to do because we do support both RTSCTS and DSRDTR flow + // control. + // Other targets would clear any unsupported flags here. + // We just return ENOERR. + break; +#endif + default: + return -EINVAL; + } + return ENOERR; +} + +// Enable the transmitter on the device +static void +pc_serial_start_xmit(serial_channel *chan) +{ + pc_serial_info *ser_chan = (pc_serial_info *)chan->dev_priv; + cyg_addrword_t base = ser_chan->base; + cyg_uint8 _ier; + + HAL_READ_UINT8(base+REG_ier, _ier); + _ier |= IER_XMT; // Enable xmit interrupt + HAL_WRITE_UINT8(base+REG_ier, _ier); +} + +// Disable the transmitter on the device +static void +pc_serial_stop_xmit(serial_channel *chan) +{ + pc_serial_info *ser_chan = (pc_serial_info *)chan->dev_priv; + cyg_addrword_t base = ser_chan->base; + cyg_uint8 _ier; + + HAL_READ_UINT8(base+REG_ier, _ier); + _ier &= ~IER_XMT; // Disable xmit interrupt + HAL_WRITE_UINT8(base+REG_ier, _ier); +} + +// Serial I/O - low level interrupt handler (ISR) +static cyg_uint32 +pc_serial_ISR(cyg_vector_t vector, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + pc_serial_info *ser_chan = (pc_serial_info *)chan->dev_priv; + cyg_drv_interrupt_mask(ser_chan->int_num); + cyg_drv_interrupt_acknowledge(ser_chan->int_num); + return CYG_ISR_CALL_DSR; // Cause DSR to be run +} + +// Serial I/O - high level interrupt handler (DSR) +static void +pc_serial_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + pc_serial_info *ser_chan = (pc_serial_info *)chan->dev_priv; + cyg_addrword_t base = ser_chan->base; + cyg_uint8 _isr; + + // Check if we have an interrupt pending - note that the interrupt + // is pending of the low bit of the isr is *0*, not 1. + HAL_READ_UINT8(base+REG_isr, _isr); + while ((_isr & ISR_nIP) == 0) { + switch (_isr&0x6) { + case ISR_Rx: + { + cyg_uint8 _lsr; + unsigned char c; + HAL_READ_UINT8(base+REG_lsr, _lsr); + while(_lsr & LSR_RSR) { + HAL_READ_UINT8(base+REG_rhr, c); + (chan->callbacks->rcv_char)(chan, c); + HAL_READ_UINT8(base+REG_lsr, _lsr); + } + break; + } + case ISR_Tx: + (chan->callbacks->xmt_char)(chan); + break; + +#ifdef CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS + case ISR_LS: + { + cyg_serial_line_status_t stat; + cyg_uint8 _lsr; + HAL_READ_UINT8(base+REG_lsr, _lsr); + + // this might look expensive, but it is rarely the case that + // more than one of these is set + stat.value = 1; + if ( _lsr & LSR_OE ) { + stat.which = CYGNUM_SERIAL_STATUS_OVERRUNERR; + (chan->callbacks->indicate_status)(chan, &stat ); + } + if ( _lsr & LSR_PE ) { + stat.which = CYGNUM_SERIAL_STATUS_PARITYERR; + (chan->callbacks->indicate_status)(chan, &stat ); + } + if ( _lsr & LSR_FE ) { + stat.which = CYGNUM_SERIAL_STATUS_FRAMEERR; + (chan->callbacks->indicate_status)(chan, &stat ); + } + if ( _lsr & LSR_BI ) { + stat.which = CYGNUM_SERIAL_STATUS_BREAK; + (chan->callbacks->indicate_status)(chan, &stat ); + } + } + break; + + case ISR_MS: + { + cyg_serial_line_status_t stat; + cyg_uint8 _msr; + + HAL_READ_UINT8(base+REG_msr, _msr); +#ifdef CYGOPT_IO_SERIAL_FLOW_CONTROL_HW + if ( _msr & MSR_DDSR ) + if ( chan->config.flags & CYGNUM_SERIAL_FLOW_DSRDTR_TX ) { + stat.which = CYGNUM_SERIAL_STATUS_FLOW; + stat.value = (0 != (_msr & MSR_DSR)); + (chan->callbacks->indicate_status)(chan, &stat ); + } + if ( _msr & MSR_DCTS ) + if ( chan->config.flags & CYGNUM_SERIAL_FLOW_RTSCTS_TX ) { + stat.which = CYGNUM_SERIAL_STATUS_FLOW; + stat.value = (0 != (_msr & MSR_CTS)); + (chan->callbacks->indicate_status)(chan, &stat ); + } +#endif + if ( _msr & MSR_DDCD ) { + stat.which = CYGNUM_SERIAL_STATUS_CARRIERDETECT; + stat.value = (0 != (_msr & MSR_CD)); + (chan->callbacks->indicate_status)(chan, &stat ); + } + if ( _msr & MSR_RI ) { + stat.which = CYGNUM_SERIAL_STATUS_RINGINDICATOR; + stat.value = 1; + (chan->callbacks->indicate_status)(chan, &stat ); + } + if ( _msr & MSR_TERI ) { + stat.which = CYGNUM_SERIAL_STATUS_RINGINDICATOR; + stat.value = 0; + (chan->callbacks->indicate_status)(chan, &stat ); + } + } + break; +#endif + } + + HAL_READ_UINT8(base+REG_isr, _isr); + } // while + + cyg_drv_interrupt_unmask(ser_chan->int_num); +} +#endif + +// EOF ser_16x5x.c
--- a/packages/ecos.db +++ b/packages/ecos.db @@ -266,6 +266,15 @@ package CYGPKG_IO_SERIAL_I386_PC { description "PC serial device drivers" } +package CYGPKG_IO_SERIAL_GENERIC_16X5X { + alias { "16x5x compatible serial device drivers" + devs_serial_generic_16x5x 16x5x_serial_driver } + hardware + directory devs/serial/generic/16x5x + script ser_generic_16x5x.cdl + description "16x5x compatible serial device drivers" +} + package CYGPKG_IO_SERIAL_SH_SCI { alias { "SH SCI serial device drivers" devs_serial_sh_sci sci_serial_driver } @@ -341,7 +350,7 @@ package CYGPKG_FS_RAM { } package CYGPKG_IO_ETH_DRIVERS { - alias { "Common ethernet support" net_drivers } + alias { "Common ethernet support" net_drivers eth_drivers } directory io/eth script eth_drivers.cdl description "Platform independent ethernet support." @@ -1150,6 +1159,7 @@ target pid { alias { "ARM development board (PID)" PID } packages { CYGPKG_HAL_ARM CYGPKG_HAL_ARM_PID + CYGPKG_IO_SERIAL_GENERIC_16X5X CYGPKG_IO_SERIAL_ARM_PID } description "
--- a/packages/hal/arm/arch/current/include/basetype.h +++ b/packages/hal/arm/arch/current/include/basetype.h @@ -60,8 +60,8 @@ //#define CYG_LABEL_NAME(_name_) _name_ //----------------------------------------------------------------------------- -// Override the alignment definitions from cyg_type.h. ARM only alows 4 -// bytes alignment where as the default is 8 byte. +// Override the alignment definitions from cyg_type.h. ARM only allows 4 +// byte alignment whereas the default is 8 byte. #define CYGARC_ALIGNMENT 4 #define CYGARC_P2ALIGNMENT 2
--- a/packages/hal/arm/ebsa285/current/ChangeLog +++ b/packages/hal/arm/ebsa285/current/ChangeLog @@ -1,3 +1,7 @@ +2000-09-17 Gary Thomas <gthomas@redhat.com> + + * cdl/hal_arm_ebsa285.cdl: Add platform/cpu identification strings. + 2000-09-06 Hugo Tyson <hmt@cygnus.co.uk> * cdl/hal_arm_ebsa285.cdl (CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_BASE
--- a/packages/hal/arm/ebsa285/current/cdl/hal_arm_ebsa285.cdl +++ b/packages/hal/arm/ebsa285/current/cdl/hal_arm_ebsa285.cdl @@ -59,6 +59,9 @@ cdl_package CYGPKG_HAL_ARM_EBSA285 { define_proc { puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H <pkgconf/hal_arm.h>" puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_ebsa285.h>" + puts $::cdl_header "#define HAL_PLATFORM_CPU \"StrongARM 110\"" + puts $::cdl_header "#define HAL_PLATFORM_BOARD \"EBSA-285\"" + puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\"" } cdl_component CYG_HAL_STARTUP {
--- a/packages/hal/arm/edb7xxx/current/ChangeLog +++ b/packages/hal/arm/edb7xxx/current/ChangeLog @@ -1,3 +1,7 @@ +2000-09-17 Gary Thomas <gthomas@redhat.com> + + * cdl/hal_arm_edb7xxx.cdl: Update platform/cpu identification strings. + 2000-08-18 Gary Thomas <gthomas@redhat.com> * src/hal_diag.c (cyg_hal_plf_serial_getc): Only call dram refresh
--- a/packages/hal/arm/edb7xxx/current/cdl/hal_arm_edb7xxx.cdl +++ b/packages/hal/arm/edb7xxx/current/cdl/hal_arm_edb7xxx.cdl @@ -74,25 +74,25 @@ cdl_package CYGPKG_HAL_ARM_EDB7XXX { puts $::cdl_header "" puts $::cdl_header "#ifdef CYGHWR_HAL_ARM_EDB7XXX_VARIANT_CL_PS7111" puts $::cdl_header "#define HAL_PLATFORM_CPU \"ARM 710C\"" - puts $::cdl_header "#define HAL_PLATFORM_BOARD \"CL-PS7111\"" + puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Cirrus Logic CL-PS7111\"" puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\"" puts $::cdl_header "#endif //CYGHWR_HAL_ARM_EDB7XXX_VARIANT_CL_PS7111" puts $::cdl_header "" puts $::cdl_header "#ifdef CYGHWR_HAL_ARM_EDB7XXX_VARIANT_EP7209" puts $::cdl_header "#define HAL_PLATFORM_CPU \"ARM 720T\"" - puts $::cdl_header "#define HAL_PLATFORM_BOARD \"EDB7209\"" + puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Cirrus Logic EDB7209\"" puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\"" puts $::cdl_header "#endif //CYGHWR_HAL_ARM_EDB7XXX_VARIANT_EP7209" puts $::cdl_header "" puts $::cdl_header "#ifdef CYGHWR_HAL_ARM_EDB7XXX_VARIANT_EP7211" puts $::cdl_header "#define HAL_PLATFORM_CPU \"ARM 720T\"" - puts $::cdl_header "#define HAL_PLATFORM_BOARD \"EDB7211\"" + puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Cirrus Logic EDB7211\"" puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\"" puts $::cdl_header "#endif //CYGHWR_HAL_ARM_EDB7XXX_VARIANT_EP7211" puts $::cdl_header "" puts $::cdl_header "#ifdef CYGHWR_HAL_ARM_EDB7XXX_VARIANT_EP7212" puts $::cdl_header "#define HAL_PLATFORM_CPU \"ARM 720T\"" - puts $::cdl_header "#define HAL_PLATFORM_BOARD \"EDB7212\"" + puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Cirrus Logic EDB7212\"" puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\"" puts $::cdl_header "#endif //CYGHWR_HAL_ARM_EDB7XXX_VARIANT_EP7212" puts $::cdl_header ""
--- a/packages/hal/arm/sa11x0/assabet/current/ChangeLog +++ b/packages/hal/arm/sa11x0/assabet/current/ChangeLog @@ -1,3 +1,23 @@ +2000-09-17 Gary Thomas <gthomas@redhat.com> + + * misc/lcd_test.c: Add simple "glass tty" driver for LCD. + + * cdl/hal_arm_sa11x0_assabet.cdl: Add platform/cpu identification strings. + +2000-09-14 Gary Thomas <gthomas@redhat.com> + + * src/assabet_misc.c: Set up for LCD - configure [pin] signals. + + * misc/lcd_test.c: Adding more glitz, turn on light, etc. + + * include/assabet.h: LCD pixel size was wrong in docs(?) + +2000-09-13 Gary Thomas <gthomas@redhat.com> + + * misc/redboot.xpm: New file. + + * misc/lcd_test.c: Update LCD demo - add RedBoot splash. + 2000-09-10 Gary Thomas <gthomas@redhat.com> * misc/redhat.xpm:
--- a/packages/hal/arm/sa11x0/assabet/current/cdl/hal_arm_sa11x0_assabet.cdl +++ b/packages/hal/arm/sa11x0/assabet/current/cdl/hal_arm_sa11x0_assabet.cdl @@ -61,6 +61,9 @@ cdl_package CYGPKG_HAL_ARM_SA11X0_ASSABE puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H <pkgconf/hal_arm.h>" puts $::cdl_system_header "#define CYGBLD_HAL_VARIANT_H <pkgconf/hal_arm_sa11x0.h>" puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_sa11x0_assabet.h>" + puts $::cdl_header "#define HAL_PLATFORM_CPU \"StrongARM 1110\"" + puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Assabet development system\"" + puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\"" } cdl_component CYG_HAL_STARTUP {
--- a/packages/hal/arm/sa11x0/assabet/current/include/assabet.h +++ b/packages/hal/arm/sa11x0/assabet/current/include/assabet.h @@ -93,9 +93,9 @@ extern unsigned long _assabet_CFG; #define SA1110_BCR_CF_BUS_OFF SA1110_LOGIC_ONE(SA1110_BCR_CF_BUS) #define SA1110_BCR_AUDIO_ON 0x00000100 // 1 = UDA1341, MIC, DAA power on #define SA1110_BCR_BACKLIGHT 0x00000200 // 1 = LCD backlight on -#define SA1110_BCR_LCD_BPP 0x00000400 // 0 = 16 RGB, 1 = 12 RGB -#define SA1110_BCR_LCD_16BPP SA1110_LOGIC_ZERO(SA1110_BCR_LCD_BPP) -#define SA1110_BCR_LCD_12BPP SA1110_LOGIC_ONE(SA1110_BCR_LCD_BPP) +#define SA1110_BCR_LCD_BPP 0x00000400 // 1 = 16 RGB, 0 = 12 RGB +#define SA1110_BCR_LCD_16BPP SA1110_LOGIC_ONE(SA1110_BCR_LCD_BPP) +#define SA1110_BCR_LCD_12BPP SA1110_LOGIC_ZERO(SA1110_BCR_LCD_BPP) #define SA1110_BCR_LCD 0x00000800 // 1 = LCD panel and controller on #define SA1110_BCR_LCD_ON SA1110_LOGIC_ONE(SA1110_BCR_LCD) #define SA1110_BCR_LCD_OFF SA1110_LOGIC_ZERO(SA1110_BCR_LCD)
--- a/packages/hal/arm/sa11x0/assabet/current/misc/escw.xpm +++ b/packages/hal/arm/sa11x0/assabet/current/misc/escw.xpm @@ -2,7 +2,7 @@ static char * escw_xpm[] = { "320 240 21 1", " c None", -". c #28CAFF", +". c #28CAE0", "+ c #6F8695", "@ c #3FB3C7", "# c #579DAE",
--- a/packages/hal/arm/sa11x0/assabet/current/misc/lcd_test.c +++ b/packages/hal/arm/sa11x0/assabet/current/misc/lcd_test.c @@ -51,6 +51,7 @@ #include "eCos.xpm" #include "redhat.xpm" +#include "redboot.xpm" #include "escw.xpm" #ifndef FALSE @@ -140,36 +141,161 @@ show_xpm(char *xpm[]) for (i = 0; i < nclrs; i++) { cp = xpm[i+1]; colors[(unsigned int)*cp] = parse_color(&cp[4]); +// printf("Color[%c] = %x\n", *cp, colors[(unsigned int)*cp]); } for (row = 0; row < nrows; row++) { cp = xpm[nclrs+1+row]; for (col = 0; col < ncols; col++) { -#if 0 - if (*cp++ != '.') { - fp->pixels[row][col] = 0x0000; - } else { - fp->pixels[row][col] = 0xFFFF; - } -#else fp->pixels[row][col] = colors[(unsigned int)*cp++]; -#endif } } cyg_thread_delay(100); } -static void -lcd_test(cyg_addrword_t p) + +// 8x8 Font - from Helios + +#define FIRST_CHAR 0x20 +#define LAST_CHAR 0x7E +#define FONT_HEIGHT 8 +#define FONT_WIDTH 8 +#define CURSOR_ON 0x5F +#define CURSOR_OFF 0x20 +static char font_table[LAST_CHAR-FIRST_CHAR+1][8] = { - int i, pix, row, col; + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* */ + { 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x00 }, /* ! */ + { 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* " */ + { 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00 }, /* # */ + { 0x30, 0xFC, 0x16, 0x7C, 0xD0, 0x7E, 0x18, 0x00 }, /* $ */ + { 0x06, 0x66, 0x30, 0x18, 0x0C, 0x66, 0x60, 0x00 }, /* % */ + { 0x1C, 0x36, 0x36, 0x1C, 0xB6, 0x66, 0xDC, 0x00 }, /* & */ + { 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* ' */ + { 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00 }, /* ( */ + { 0x0C, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0C, 0x00 }, /* ) */ + { 0x00, 0x18, 0x7E, 0x3C, 0x7E, 0x18, 0x00, 0x00 }, /* * */ + { 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00 }, /* + */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x0C }, /* , */ + { 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00 }, /* - */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00 }, /* . */ + { 0x00, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x00, 0x00 }, /* / */ + { 0x3C, 0x66, 0x76, 0x7E, 0x6E, 0x66, 0x3C, 0x00 }, /* 0 */ + { 0x18, 0x1C, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00 }, /* 1 */ + { 0x3C, 0x66, 0x60, 0x30, 0x18, 0x0C, 0x7E, 0x00 }, /* 2 */ + { 0x3C, 0x66, 0x60, 0x38, 0x60, 0x66, 0x3C, 0x00 }, /* 3 */ + { 0x30, 0x38, 0x3C, 0x36, 0x7E, 0x30, 0x30, 0x00 }, /* 4 */ + { 0x7E, 0x06, 0x3E, 0x60, 0x60, 0x66, 0x3C, 0x00 }, /* 5 */ + { 0x38, 0x0C, 0x06, 0x3E, 0x66, 0x66, 0x3C, 0x00 }, /* 6 */ + { 0x7E, 0x60, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x00 }, /* 7 */ + { 0x3C, 0x66, 0x66, 0x3C, 0x66, 0x66, 0x3C, 0x00 }, /* 8 */ + { 0x3C, 0x66, 0x66, 0x7C, 0x60, 0x30, 0x1C, 0x00 }, /* 9 */ + { 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00 }, /* : */ + { 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x0C }, /* ; */ + { 0x30, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x00 }, /* < */ + { 0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00 }, /* = */ + { 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x00 }, /* > */ + { 0x3C, 0x66, 0x30, 0x18, 0x18, 0x00, 0x18, 0x00 }, /* ? */ + { 0x3C, 0x66, 0x76, 0x56, 0x76, 0x06, 0x3C, 0x00 }, /* @ */ + { 0x3C, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66, 0x00 }, /* A */ + { 0x3E, 0x66, 0x66, 0x3E, 0x66, 0x66, 0x3E, 0x00 }, /* B */ + { 0x3C, 0x66, 0x06, 0x06, 0x06, 0x66, 0x3C, 0x00 }, /* C */ + { 0x1E, 0x36, 0x66, 0x66, 0x66, 0x36, 0x1E, 0x00 }, /* D */ + { 0x7E, 0x06, 0x06, 0x3E, 0x06, 0x06, 0x7E, 0x00 }, /* E */ + { 0x7E, 0x06, 0x06, 0x3E, 0x06, 0x06, 0x06, 0x00 }, /* F */ + { 0x3C, 0x66, 0x06, 0x76, 0x66, 0x66, 0x3C, 0x00 }, /* G */ + { 0x66, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66, 0x00 }, /* H */ + { 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00 }, /* I */ + { 0x7C, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1C, 0x00 }, /* J */ + { 0x66, 0x36, 0x1E, 0x0E, 0x1E, 0x36, 0x66, 0x00 }, /* K */ + { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x7E, 0x00 }, /* L */ + { 0xC6, 0xEE, 0xFE, 0xD6, 0xD6, 0xC6, 0xC6, 0x00 }, /* M */ + { 0x66, 0x66, 0x6E, 0x7E, 0x76, 0x66, 0x66, 0x00 }, /* N */ + { 0x3C, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00 }, /* O */ + { 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x06, 0x06, 0x00 }, /* P */ + { 0x3C, 0x66, 0x66, 0x66, 0x56, 0x36, 0x6C, 0x00 }, /* Q */ + { 0x3E, 0x66, 0x66, 0x3E, 0x36, 0x66, 0x66, 0x00 }, /* R */ + { 0x3C, 0x66, 0x06, 0x3C, 0x60, 0x66, 0x3C, 0x00 }, /* S */ + { 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00 }, /* T */ + { 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00 }, /* U */ + { 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00 }, /* V */ + { 0xC6, 0xC6, 0xD6, 0xD6, 0xFE, 0xEE, 0xC6, 0x00 }, /* W */ + { 0x66, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x66, 0x00 }, /* X */ + { 0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x18, 0x00 }, /* Y */ + { 0x7E, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x7E, 0x00 }, /* Z */ + { 0x3E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x3E, 0x00 }, /* [ */ + { 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x00 }, /* \ */ + { 0x7C, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7C, 0x00 }, /* ] */ + { 0x3C, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* ^ */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF }, /* _ */ + { 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* ` */ + { 0x00, 0x00, 0x3C, 0x60, 0x7C, 0x66, 0x7C, 0x00 }, /* a */ + { 0x06, 0x06, 0x3E, 0x66, 0x66, 0x66, 0x3E, 0x00 }, /* b */ + { 0x00, 0x00, 0x3C, 0x66, 0x06, 0x66, 0x3C, 0x00 }, /* c */ + { 0x60, 0x60, 0x7C, 0x66, 0x66, 0x66, 0x7C, 0x00 }, /* d */ + { 0x00, 0x00, 0x3C, 0x66, 0x7E, 0x06, 0x3C, 0x00 }, /* e */ + { 0x38, 0x0C, 0x0C, 0x3E, 0x0C, 0x0C, 0x0C, 0x00 }, /* f */ + { 0x00, 0x00, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x3C }, /* g */ + { 0x06, 0x06, 0x3E, 0x66, 0x66, 0x66, 0x66, 0x00 }, /* h */ + { 0x18, 0x00, 0x1C, 0x18, 0x18, 0x18, 0x3C, 0x00 }, /* i */ + { 0x18, 0x00, 0x1C, 0x18, 0x18, 0x18, 0x18, 0x0E }, /* j */ + { 0x06, 0x06, 0x66, 0x36, 0x1E, 0x36, 0x66, 0x00 }, /* k */ + { 0x1C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00 }, /* l */ + { 0x00, 0x00, 0x6C, 0xFE, 0xD6, 0xD6, 0xC6, 0x00 }, /* m */ + { 0x00, 0x00, 0x3E, 0x66, 0x66, 0x66, 0x66, 0x00 }, /* n */ + { 0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00 }, /* o */ + { 0x00, 0x00, 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x06 }, /* p */ + { 0x00, 0x00, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0xE0 }, /* q */ + { 0x00, 0x00, 0x36, 0x6E, 0x06, 0x06, 0x06, 0x00 }, /* r */ + { 0x00, 0x00, 0x7C, 0x06, 0x3C, 0x60, 0x3E, 0x00 }, /* s */ + { 0x0C, 0x0C, 0x3E, 0x0C, 0x0C, 0x0C, 0x38, 0x00 }, /* t */ + { 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x00 }, /* u */ + { 0x00, 0x00, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00 }, /* v */ + { 0x00, 0x00, 0xC6, 0xD6, 0xD6, 0xFE, 0x6C, 0x00 }, /* w */ + { 0x00, 0x00, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x00 }, /* x */ + { 0x00, 0x00, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x3C }, /* y */ + { 0x00, 0x00, 0x7E, 0x30, 0x18, 0x0C, 0x7E, 0x00 }, /* z */ + { 0x30, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x30, 0x00 }, /* { */ + { 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00 }, /* | */ + { 0x0C, 0x18, 0x18, 0x70, 0x18, 0x18, 0x0C, 0x00 }, /* } */ + { 0x8C, 0xD6, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00 } /* ~ */ +}; + +#define LCD_WIDTH 320 +#define LCD_HEIGHT 240 +#define LCD_DEPTH 16 + +// This can be 1 or 2 +#define SCREEN_SCALE 2 +#define NIBBLES_PER_PIXEL (1*SCREEN_SCALE) +#define PIXELS_PER_BYTE (2/NIBBLES_PER_PIXEL) +#define PIXEL_MASK ((1<<PIXELS_PER_BYTE)-1) + +// Physical screen info +static int lcd_depth = LCD_DEPTH; // Should be 1, 2, or 4 +static int lcd_width = LCD_WIDTH; +static int lcd_height = LCD_HEIGHT; + +// Virtual screen info +static int curX = 0; // Last used position +static int curY = 0; +static int width = LCD_WIDTH / (FONT_WIDTH*NIBBLES_PER_PIXEL); +static int height = LCD_HEIGHT / (FONT_HEIGHT*SCREEN_SCALE); +static int fg = RGB_RED(0) | RGB_GREEN(0) | RGB_BLUE(0); +static int bg = RGB_RED(31) | RGB_GREEN(63) | RGB_BLUE(31); +#define SCREEN_WIDTH (LCD_WIDTH/FONT_WIDTH) +#define SCREEN_HEIGHT (LCD_HEIGHT/FONT_HEIGHT) +static char screen[SCREEN_HEIGHT][SCREEN_WIDTH]; + +// Functions +static void lcd_drawc(cyg_int8 c, int x, int y); + +void +lcd_init(int depth) +{ + // Currently only color/16bpp supported + unsigned long _fp; - int on; - - diag_printf("LCD test here\n"); - -// HAL_DCACHE_SYNC(); -// HAL_DCACHE_DISABLE(); // Frame buffer must be aligned on a 16 byte boundary _fp = (((unsigned long)&lcd_frame_buffer) + 15) & ~15; @@ -180,11 +306,309 @@ lcd_test(cyg_addrword_t p) *SA1110_LCCR2 = 0xEF; *SA1110_LCCR3 = 0x0c; fp->palette[0] = 0x2000; // Tell controller 16 bits - *SA1110_LCCR0 = 0xBB; // B&W +// *SA1110_LCCR0 = 0xBB; // B&W *SA1110_LCCR0 = 0xB9; // Color - assabet_BCR(SA1110_BCR_LCD_BPP, SA1110_BCR_LCD_12BPP); +// assabet_BCR(SA1110_BCR_LCD_BPP, SA1110_BCR_LCD_12BPP); assabet_BCR(SA1110_BCR_LCD_BPP, SA1110_BCR_LCD_16BPP); assabet_BCR(SA1110_BCR_LCD, SA1110_BCR_LCD_ON); + assabet_BCR(SA1110_BCR_BACKLIGHT, SA1110_BCR_BACKLIGHT); +} + +// Clear screen +void +lcd_clear(void) +{ + int row, col; + for (row = 0; row < lcd_height; row++) { + for (col = 0; col < lcd_width; col++) { + fp->pixels[row][col] = bg; + } + } + for (row = 0; row < SCREEN_HEIGHT; row++) { + for (col = 0; col < SCREEN_WIDTH; col++) { + screen[row][col] = ' '; + } + } + // Note: Row 0 seems to wrap incorrectly + curX = 0; curY = 1; + lcd_drawc(CURSOR_ON, curX, curY); +} + +// Position cursor +void +lcd_moveto(int X, int Y) +{ + lcd_drawc(CURSOR_OFF, curX, curY); + if (X < 0) X = 0; + if (X >= SCREEN_WIDTH) X = SCREEN_WIDTH-1; + curX = X; +// if (Y < 0) Y = 0; + if (Y < 1) Y = 1; + if (Y >= SCREEN_HEIGHT) Y = SCREEN_HEIGHT-1; + curY = Y; + lcd_drawc(CURSOR_ON, curX, curY); +} + +// Render a character at position (X,Y) with current background/foreground +static void +lcd_drawc(cyg_int8 c, int x, int y) +{ + // Currently hard-coded for 16bpp + cyg_uint8 bits; + cyg_uint16 *pixels; + int l, p, w; + + screen[curY][curX] = c; + for (l = 0; l < FONT_HEIGHT; l++) { + bits = font_table[c-FIRST_CHAR][l]; + pixels = &fp->pixels[curY*FONT_HEIGHT+l][curX*FONT_WIDTH]; + for (p = 0; p < 8; p++) { + if (bits & 0x01) { + *pixels++ = fg; + } else { + *pixels++ = bg; + } + bits >>= 1; + } + } +} + +static void +lcd_scroll(void) +{ + int row, col; + cyg_uint8 *c1, *c2; + cyg_uint16 *p1, *p2; + + // First scroll up the virtual screen + for (row = 1; row < SCREEN_HEIGHT; row++) { + c1 = &screen[row-1][0]; + c2 = &screen[row][0]; + for (col = 0; col < SCREEN_WIDTH; col++) { + *c1++ = *c2++; + } + } + c1 = &screen[SCREEN_HEIGHT-1][0]; + for (col = 0; col < SCREEN_WIDTH; col++) { + *c1++ = 0x20; + } + // Now the physical screen + for (row = FONT_HEIGHT*2; row < LCD_HEIGHT; row++) { + p1 = &fp->pixels[row-FONT_HEIGHT][0]; + p2 = &fp->pixels[row][0]; + for (col = 0; col < LCD_WIDTH; col++) { + *p1++ = *p2++; + } + } + for (row = LCD_HEIGHT-FONT_HEIGHT; row < LCD_HEIGHT; row++) { + p1 = &fp->pixels[row][0]; + for (col = 0; col < LCD_WIDTH; col++) { + *p1++ = bg; + } + } +} + +// Draw one character at the current position +void +lcd_putc(cyg_int8 c) +{ + lcd_drawc(CURSOR_OFF, curX, curY); + switch (c) { + case '\r': + curX = 0; + break; + case '\n': + curY++; + if (curY == SCREEN_HEIGHT) { + lcd_scroll(); + curY--; + } + break; + case '\b': + curX--; + if (curX < 0) { + curY--; + if (curY < 0) curY = 0; + curX = SCREEN_WIDTH-1; + } + break; + default: + lcd_drawc(c, curX, curY); + curX++; + if (curX == SCREEN_WIDTH) { + curY++; + curX = 0; + } + } + lcd_drawc(CURSOR_ON, curX, curY); +} + +// Basic LCD 'printf()' support + +#ifndef FALSE +#define FALSE 0 +#define TRUE 1 +#endif + +#include <stdarg.h> + +#define is_digit(c) ((c >= '0') && (c <= '9')) + +static int +_cvt(unsigned long val, char *buf, long radix, char *digits) +{ + char temp[80]; + char *cp = temp; + int length = 0; + if (val == 0) { + /* Special case */ + *cp++ = '0'; + } else { + while (val) { + *cp++ = digits[val % radix]; + val /= radix; + } + } + while (cp != temp) { + *buf++ = *--cp; + length++; + } + *buf = '\0'; + return (length); +} + +int +lcd_vprintf(void (*putc)(cyg_int8), const char *fmt0, va_list ap) +{ + char c, sign, *cp; + int left_prec, right_prec, zero_fill, length, pad, pad_on_right; + char buf[32]; + long val; + while ((c = *fmt0++)) { + cp = buf; + length = 0; + if (c == '%') { + c = *fmt0++; + left_prec = right_prec = pad_on_right = 0; + if (c == '-') { + c = *fmt0++; + pad_on_right++; + } + if (c == '0') { + zero_fill = TRUE; + c = *fmt0++; + } else { + zero_fill = FALSE; + } + while (is_digit(c)) { + left_prec = (left_prec * 10) + (c - '0'); + c = *fmt0++; + } + if (c == '.') { + c = *fmt0++; + zero_fill++; + while (is_digit(c)) { + right_prec = (right_prec * 10) + (c - '0'); + c = *fmt0++; + } + } else { + right_prec = left_prec; + } + sign = '\0'; + switch (c) { + case 'd': + case 'x': + case 'X': + val = va_arg(ap, long); + switch (c) { + case 'd': + if (val < 0) { + sign = '-'; + val = -val; + } + length = _cvt(val, buf, 10, "0123456789"); + break; + case 'x': + length = _cvt(val, buf, 16, "0123456789abcdef"); + break; + case 'X': + length = _cvt(val, buf, 16, "0123456789ABCDEF"); + break; + } + break; + case 's': + cp = va_arg(ap, char *); + length = strlen(cp); + break; + case 'c': + c = va_arg(ap, long /*char*/); + (*putc)(c); + continue; + default: + (*putc)('?'); + } + pad = left_prec - length; + if (sign != '\0') { + pad--; + } + if (zero_fill) { + c = '0'; + if (sign != '\0') { + (*putc)(sign); + sign = '\0'; + } + } else { + c = ' '; + } + if (!pad_on_right) { + while (pad-- > 0) { + (*putc)(c); + } + } + if (sign != '\0') { + (*putc)(sign); + } + while (length-- > 0) { + (*putc)(c = *cp++); + if (c == '\n') { + (*putc)('\r'); + } + } + if (pad_on_right) { + while (pad-- > 0) { + (*putc)(' '); + } + } + } else { + (*putc)(c); + if (c == '\n') { + (*putc)('\r'); + } + } + } +} + +int +lcd_printf(char const *fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = lcd_vprintf(lcd_putc, fmt, ap); + va_end(ap); + return (ret); +} + +static void +lcd_test(cyg_addrword_t p) +{ + int i, pix, row, col; + int on; + + diag_printf("LCD test here\n"); + + lcd_init(16); #if 0 for (i = 0; i < 16; i++) { on = true; @@ -297,7 +721,7 @@ lcd_test(cyg_addrword_t p) #endif } #endif -#if 1 +#if 0 for (row = 0; row < 240; row++) { for (col = 0; col < 320; col++) { if (col == 59) { @@ -309,16 +733,82 @@ lcd_test(cyg_addrword_t p) } cyg_thread_delay(100); #endif +#if 0 + for (i = 0; i < 16; i++) { + diag_printf("Value 0x%04x\n", (1<<i)); + for (row = 0; row < 240; row++) { + for (col = 0; col < 320; col++) { + fp->pixels[row][col] = (1<<i); + } + } + cyg_thread_delay(500); + } +#endif +#if 0 + for (i = 0; i < 32; i++) { + diag_printf("Red at %d\n", i); + for (row = 0; row < 240; row++) { + for (col = 0; col < 320; col++) { + fp->pixels[row][col] = RGB_RED(i); + } + } + cyg_thread_delay(100); + } +#endif +#if 0 + for (i = 0; i < 64; i++) { + diag_printf("Green at %d\n", i); + for (row = 0; row < 240; row++) { + for (col = 0; col < 320; col++) { + fp->pixels[row][col] = RGB_GREEN(i); + } + } + cyg_thread_delay(100); + } +#endif +#if 0 + for (i = 0; i < 32; i++) { + diag_printf("BLUE at %d\n", i); + for (row = 0; row < 240; row++) { + for (col = 0; col < 320; col++) { + fp->pixels[row][col] = RGB_BLUE(i); + } + } + cyg_thread_delay(100); + } +#endif - for (i = 0; i < 5; i++) { - show_xpm(eCos_xpm); - show_xpm(redhat_xpm); - show_xpm(escw_xpm); + for (i = 0; i < 1; i++) { + show_xpm(eCos_xpm); + show_xpm(redhat_xpm); + show_xpm(redboot_xpm); + show_xpm(escw_xpm); } +#if 0 + // This doesn't seem to do anything on my unit assabet_BCR(SA1110_BCR_MOTOR, SA1110_BCR_MOTOR_ON); cyg_thread_delay(2*100); assabet_BCR(SA1110_BCR_MOTOR, SA1110_BCR_MOTOR_OFF); +#endif + + lcd_clear(); + lcd_printf("\n\n**** Hello world!\n"); + cyg_thread_delay(200); + for (i = 0; i < 132; i++) { + lcd_printf("... testing line #%d\n", i); + } + cyg_thread_delay(200); + bg = RGB_RED(0) | RGB_GREEN(0) | RGB_BLUE(0); + fg = RGB_RED(31) | RGB_GREEN(63) | RGB_BLUE(0); + for (i = 0; i < 132; i++) { + lcd_printf("... testing line #%d\n", i); + } + cyg_thread_delay(200); + lcd_clear(); + lcd_printf("*****"); + cyg_thread_delay(200); + cyg_test_exit(); }
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/sa11x0/assabet/current/misc/redboot.xpm @@ -0,0 +1,254 @@ +/* XPM */ +static char * redboot_xpm[] = { +"320 240 11 1", +" c None", +". c #FFFF00", +"+ c #FFAA00", +"@ c #FFE300", +"# c #FFC700", +"$ c #FF0000", +"% c #FF1D00", +"& c #FF7200", +"* c #FF5500", +"= c #FF3900", +"- c #FF8E00", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +".......................................................................+++++++++++++++++++++++++@......................................................................#+++++++#........@++++++++++++++++++++++.................................................................................................................", +".......................................................................$$$$$$$$$$$$$$$$$$$$$$$$$$%&@...................................................................$$$$$$$$&........*$$$$$$$$$$$$$$$$$$$$$$$%*#.............................................................................................................", +"......................................................................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.................................................................@$$$$$$$$+........%$$$$$$$$$$$$$$$$$$$$$$$$$$=@...........................................................................................................", +"......................................................................&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+................................................................+$$$$$$$$.........$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+..........................................................................................................", +"......................................................................*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...............................................................&$$$$$$$%........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@.....................................................................................*$$$$$$$%...........", +"......................................................................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%...............................................................*$$$$$$$*........-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=.....................................................................................$$$$$$$$*...........", +".....................................................................@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-..............................................................$$$$$$$$-........*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#....................................................................................$$$$$$$$-...........", +".....................................................................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*.............................................................#$$$$$$$$#........%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*...................................................................................+$$$$$$$$+...........", +".....................................................................*$$$$$$$$+............+&$$$$$$$$$$$.............................................................+$$$$$$$$........@$$$$$$$$=............+=$$$$$$$$$%...................................................................................-$$$$$$$$............", +".....................................................................=$$$$$$$$#..............@%$$$$$$$$$.............................................................*$$$$$$$=........+$$$$$$$$*..............-$$$$$$$$$...................................................................................*$$$$$$$=............", +".....................................................................$$$$$$$$$................#$$$$$$$$$.............................................................=$$$$$$$*........&$$$$$$$$+...............%$$$$$$$$...................................................................................%$$$$$$$*............", +"....................................................................#$$$$$$$$*.................=$$$$$$$%...............#++**-+#.........................@++**++......$$$$$$$$+........*$$$$$$$$#...............*$$$$$$$$..................@++&**++@............................#++**&++....................$$$$$$$$+............", +"....................................................................-$$$$$$$$&.................*$$$$$$$*............+*$$$$$$$$$$*#....................-=$$$$$$$$&@..+$$$$$$$$@........$$$$$$$$$................*$$$$$$$*...............+*$$$$$$$$$$%&@.....................@-=$$$$$$$$$$=-............@+++&$$$$$$$$&+++#........", +"....................................................................*$$$$$$$$+.................=$$$$$$$-.........@&$$$$$$$$$$$$$$$*@................-%$$$$$$$$$$$%@.-$$$$$$$$........#$$$$$$$$=................$$$$$$$$-.............-%$$$$$$$$$$$$$$$&..................@&$$$$$$$$$$$$$$$%+..........*$$$$$$$$$$$$$$$$*........", +"....................................................................%$$$$$$$$@................@$$$$$$$$@........+%$$$$$$$$$$$$$$$$$%@.............@=$$$$$$$$$$$$$$%@*$$$$$$$*........+$$$$$$$$&...............-$$$$$$$$@...........#%$$$$$$$$$$$$$$$$$$%@...............-$$$$$$$$$$$$$$$$$$$*.........%$$$$$$$$$$$$$$$$-........", +"....................................................................$$$$$$$$$.................&$$$$$$$*........*$$$$$$$$$$$$$$$$$$$$%@...........#%$$$$$$$$$$$$$$$$&%$$$$$$$&........*$$$$$$$$+..............@$$$$$$$$&...........-$$$$$$$$$$$$$$$$$$$$$%@............@*$$$$$$$$$$$$$$$$$$$$$*........$$$$$$$$$$$$$$$$$+........", +"...................................................................+$$$$$$$$*................#$$$$$$$$#.......*$$$$$$$$$$$$$$$$$$$$$$=..........+$$$$$$$$$$$$$$$$$$$$$$$$$$$+........=$$$$$$$$@.............@%$$$$$$$%@..........*$$$$$$$$$$$$$$$$$$$$$$$=...........@%$$$$$$$$$$$$$$$$$$$$$$$-......+$$$$$$$$$$$$$$$$$.........", +"...................................................................-$$$$$$$$&...............@%$$$$$$$&.......-$$$$$$$$$$$$$$$$$$$$$$$$+........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$@........$$$$$$$$$............#&$$$$$$$$$#..........&$$$$$$$$$$$$$$$$$$$$$$$$$-..........%$$$$$$$$$$$$$$$$$$$$$$$$$@.....-$$$$$$$$$$$$$$$$=.........", +"...................................................................*$$$$$$$$+..............-%$$$$$$$=.......#$$$$$$$$$%&+@@+*$$$$$$$$$=........%$$$$$$$$$%-#.+&$$$$$$$$$$$$%........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+..........+$$$$$$$$$$&+@@+&$$$$$$$$$$=.........*$$$$$$$$$%-+.#+=$$$$$$$$$$-.....#+++=$$$$$$$$++++#.........", +"...................................................................$$$$$$$$$-++++++++++++*%$$$$$$$$%@.......%$$$$$$$$&.......+$$$$$$$$$#......&$$$$$$$$$&......@%$$$$$$$$$$*........-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%+..........@$$$$$$$$$=@......@%$$$$$$$$$@.......-$$$$$$$$$&.......+$$$$$$$$$=.........%$$$$$$$*..............", +"..................................................................@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*@.......&$$$$$$$$+.........&$$$$$$$$-.....@$$$$$$$$$+........+$$$$$$$$$$-........*$$$$$$$$$$$$$$$$$$$$$$$$$$$$=@...........=$$$$$$$$*.........#$$$$$$$$$+......@$$$$$$$$$+.........&$$$$$$$$$.........$$$$$$$$-..............", +"..................................................................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-........@$$$$$$$$*..........@$$$$$$$$*.....=$$$$$$$$-..........=$$$$$$$$$+........%$$$$$$$$$$$$$$$$$$$$$$$$$$$$*...........#$$$$$$$$*...........*$$$$$$$$*......&$$$$$$$$+...........$$$$$$$$$+.......+$$$$$$$$+..............", +"..................................................................&$$$$$$$$$$$$$$$$$$$$$$$$$$$$&@.........&$$$$$$$%............%$$$$$$$*....#$$$$$$$$=...........&$$$$$$$$$........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*..........=$$$$$$$%@...........+$$$$$$$$*.....@$$$$$$$$*............*$$$$$$$$+.......&$$$$$$$$...............", +"..................................................................=$$$$$$$$$$$$$$$$$$$$$$$$$$$&@..........%$$$$$$$&............*$$$$$$$*....&$$$$$$$$@...........+$$$$$$$$=........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&........#$$$$$$$$-.............$$$$$$$$*.....&$$$$$$$$@............+$$$$$$$$+.......*$$$$$$$%...............", +"..................................................................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&........+$$$$$$$$@............*$$$$$$$*....$$$$$$$$*............+$$$$$$$$*........&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#.......&$$$$$$$%..............$$$$$$$$*.....%$$$$$$$&.............+$$$$$$$$+.......$$$$$$$$*...............", +".................................................................#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*.......*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*...+$$$$$$$$#............+$$$$$$$$+........*$$$$$$$$&++++++++++++*$$$$$$$$$$=.......$$$$$$$$-..............$$$$$$$$*....+$$$$$$$$@.............+$$$$$$$$+......@$$$$$$$$-...............", +".................................................................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+......$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*...*$$$$$$$%.............+$$$$$$$$#........$$$$$$$$$..............@*$$$$$$$$$......+$$$$$$$$@..............$$$$$$$$+....*$$$$$$$=..............+$$$$$$$$.......+$$$$$$$$#...............", +".................................................................*$$$$$$$$+............+=$$$$$$$$$*.....+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...$$$$$$$$&.............+$$$$$$$$........@$$$$$$$$=................%$$$$$$$$+.....&$$$$$$$%..............@$$$$$$$$+....%$$$$$$$&..............-$$$$$$$$.......&$$$$$$$$................", +".................................................................%$$$$$$$$@..............*$$$$$$$$*.....-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#..#$$$$$$$$+.............*$$$$$$$*........+$$$$$$$$*................-$$$$$$$$+.....=$$$$$$$*..............+$$$$$$$$@...@$$$$$$$$+..............*$$$$$$$=.......*$$$$$$$=................", +".................................................................$$$$$$$$$...............@$$$$$$$$*.....*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$...+$$$$$$$$#.............=$$$$$$$&........*$$$$$$$$+................+$$$$$$$$+.....$$$$$$$$&..............&$$$$$$$%....+$$$$$$$$#..............%$$$$$$$&.......$$$$$$$$*................", +"................................................................+$$$$$$$$*................$$$$$$$$&.....=$$$$$$$$*********************&...-$$$$$$$$.............@$$$$$$$$+........=$$$$$$$$#................+$$$$$$$$+.....$$$$$$$$+..............=$$$$$$$*....+$$$$$$$$..............@$$$$$$$$+......@$$$$$$$$+................", +"................................................................-$$$$$$$$&...............#$$$$$$$$+.....$$$$$$$$%.........................*$$$$$$$$.............-$$$$$$$$@........$$$$$$$$$.................*$$$$$$$$.....+$$$$$$$$+.............@$$$$$$$$+....*$$$$$$$$..............-$$$$$$$$.......+$$$$$$$$@................", +"................................................................*$$$$$$$$+...............-$$$$$$$$+.....$$$$$$$$*.........................*$$$$$$$$.............=$$$$$$$%........#$$$$$$$$=................@$$$$$$$$=.....+$$$$$$$$+.............&$$$$$$$$.....*$$$$$$$$..............%$$$$$$$*.......&$$$$$$$$.................", +"................................................................$$$$$$$$$................*$$$$$$$$......$$$$$$$$*.........................*$$$$$$$$............#$$$$$$$$*........-$$$$$$$$*................&$$$$$$$$-.....+$$$$$$$$+............@%$$$$$$$&.....*$$$$$$$$.............+$$$$$$$$#.......*$$$$$$$*.................", +"...............................................................@$$$$$$$$%................$$$$$$$$$......$$$$$$$$*.........................*$$$$$$$$+...........%$$$$$$$$-........*$$$$$$$$+...............+$$$$$$$$$@.....+$$$$$$$$*............&$$$$$$$$@.....*$$$$$$$$+............%$$$$$$$=........$$$$$$$$&.................", +"...............................................................+$$$$$$$$*...............#$$$$$$$$*......%$$$$$$$$...........@********@....&$$$$$$$$&..........*$$$$$$$$$+........%$$$$$$$$#..............+$$$$$$$$$&......+$$$$$$$$%...........+$$$$$$$$*......*$$$$$$$$&...........*$$$$$$$$+.......#$$$$$$$$+.................", +"...............................................................&$$$$$$$$-...............&$$$$$$$$&......*$$$$$$$$-..........*$$$$$$$=.....+$$$$$$$$%@........+$$$$$$$$$$.........$$$$$$$$$............@+=$$$$$$$$$%@.......$$$$$$$$$-.........+$$$$$$$$$@......+$$$$$$$$$@.........*$$$$$$$$=........+$$$$$$$$..................", +"...............................................................=$$$$$$$$+...............*$$$$$$$$+......+$$$$$$$$$+.......@*$$$$$$$$@.....#$$$$$$$$$*.......*$$$$$$$$$$=........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+........%$$$$$$$$$+.......-$$$$$$$$$-.......#$$$$$$$$$%@......@*$$$$$$$$$@........*$$$$$$$=..................", +"...............................................................$$$$$$$$$................$$$$$$$$$#.......$$$$$$$$$$&#...#&$$$$$$$$$-.......%$$$$$$$$$=#..@-%$$$$$$$$$$$*........&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&.........&$$$$$$$$$$&#...+=$$$$$$$$$=.........%$$$$$$$$$%-@..@-%$$$$$$$$$-.........=$$$$$$$%@.................", +"..............................................................#$$$$$$$$=...............@$$$$$$$$$........&$$$$$$$$$$$$$$$$$$$$$$$$*........&$$$$$$$$$$$$$$$$$$$$$$$$$$$+........*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*..........@$$$$$$$$$$$$$$$$$$$$$$$$$%@.........-$$$$$$$$$$$$$$$$$$$$$$$$$*..........$$$$$$$$$$***..............", +"..............................................................+$$$$$$$$*...............+$$$$$$$$$.........%$$$$$$$$$$$$$$$$$$$$$$*.........@$$$$$$$$$$$$$$$$$$$$$$$$$$$#........$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-............&$$$$$$$$$$$$$$$$$$$$$$$%@...........%$$$$$$$$$$$$$$$$$$$$$$$*...........$$$$$$$$$$$$%..............", +"..............................................................*$$$$$$$$+...............+$$$$$$$$$@........@$$$$$$$$$$$$$$$$$$$$$*...........-$$$$$$$$$$$$$$$$$*$$$$$$$$........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%#..............*$$$$$$$$$$$$$$$$$$$$$=@............@%$$$$$$$$$$$$$$$$$$$$$&............$$$$$$$$$$$$*..............", +"..............................................................%$$$$$$$$#...............+$$$$$$$$$*.........#%$$$$$$$$$$$$$$$$$$+.............*$$$$$$$$$$$$$$$+*$$$$$$$*........+$$$$$$$$$$$$$$$$$$$$$$$$$$$%-................@=$$$$$$$$$$$$$$$$$$$&...............+%$$$$$$$$$$$$$$$$$$%+.............*$$$$$$$$$$$-..............", +"..............................................................$$$$$$$$$................@$$$$$$$$$=..........@=$$$$$$$$$$$$$$$&@...............*$$$$$$$$$$$$%@.%$$$$$$$&........&$$$$$$$$$$$$$$$$$$$$$$$$=&#....................&$$$$$$$$$$$$$$$$=#.................@=$$$$$$$$$$$$$$$$&@..............#$$$$$$$$$$$+..............", +".............................................................@+++++++++.................+++++++++#............#=$$$$$$$$$$%&@..................+%$$$$$$$$%-...++++++++@........#++++++++++++++++++++++@.........................@&%$$$$$$$$$$%&#.....................#*$$$$$$$$$$$=-@.................+%$$$$$$$$$...............", +"................................................................................................................@+&****&+@.......................#-****-#..........................................................................#+******+#...........................+-*****&+@......................+&*****+#...............", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................+++++++++++++++++++++++++@......................................................................#+++++++#........@++++++++++++++++++++++........................................................................................................................................................................", +"................$$$$$$$$$$$$$$$$$$$$$$$$$$%&@...................................................................$$$$$$$$&........*$$$$$$$$$$$$$$$$$$$$$$$%*#....................................................................................................................................................................", +"...............+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.................................................................@$$$$$$$$+........%$$$$$$$$$$$$$$$$$$$$$$$$$$=@..................................................................................................................................................................", +"...............&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+................................................................+$$$$$$$$.........$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.................................................................................................................................................................", +"...............*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...............................................................&$$$$$$$%........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@.....................................................................................*$$$$$$$%..................................................................", +"...............$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%...............................................................*$$$$$$$*........-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=.....................................................................................$$$$$$$$*..................................................................", +"..............@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-..............................................................$$$$$$$$-........*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#....................................................................................$$$$$$$$-..................................................................", +"..............+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*.............................................................#$$$$$$$$#........%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*...................................................................................+$$$$$$$$+..................................................................", +"..............*$$$$$$$$+............+&$$$$$$$$$$$.............................................................+$$$$$$$$........@$$$$$$$$=............+=$$$$$$$$$%...................................................................................-$$$$$$$$...................................................................", +"..............=$$$$$$$$#..............@%$$$$$$$$$.............................................................*$$$$$$$=........+$$$$$$$$*..............-$$$$$$$$$...................................................................................*$$$$$$$=...................................................................", +"..............$$$$$$$$$................#$$$$$$$$$.............................................................=$$$$$$$*........&$$$$$$$$+...............%$$$$$$$$...................................................................................%$$$$$$$*...................................................................", +".............#$$$$$$$$*.................=$$$$$$$%...............#++**-+#.........................@++**++......$$$$$$$$+........*$$$$$$$$#...............*$$$$$$$$..................@++&**++@............................#++**&++....................$$$$$$$$+...................................................................", +".............-$$$$$$$$&.................*$$$$$$$*............+*$$$$$$$$$$*#....................-=$$$$$$$$&@..+$$$$$$$$@........$$$$$$$$$................*$$$$$$$*...............+*$$$$$$$$$$%&@.....................@-=$$$$$$$$$$=-............@+++&$$$$$$$$&+++#...............................................................", +".............*$$$$$$$$+.................=$$$$$$$-.........@&$$$$$$$$$$$$$$$*@................-%$$$$$$$$$$$%@.-$$$$$$$$........#$$$$$$$$=................$$$$$$$$-.............-%$$$$$$$$$$$$$$$&..................@&$$$$$$$$$$$$$$$%+..........*$$$$$$$$$$$$$$$$*...............................................................", +".............%$$$$$$$$@................@$$$$$$$$@........+%$$$$$$$$$$$$$$$$$%@.............@=$$$$$$$$$$$$$$%@*$$$$$$$*........+$$$$$$$$&...............-$$$$$$$$@...........#%$$$$$$$$$$$$$$$$$$%@...............-$$$$$$$$$$$$$$$$$$$*.........%$$$$$$$$$$$$$$$$-...............................................................", +".............$$$$$$$$$.................&$$$$$$$*........*$$$$$$$$$$$$$$$$$$$$%@...........#%$$$$$$$$$$$$$$$$&%$$$$$$$&........*$$$$$$$$+..............@$$$$$$$$&...........-$$$$$$$$$$$$$$$$$$$$$%@............@*$$$$$$$$$$$$$$$$$$$$$*........$$$$$$$$$$$$$$$$$+...............................................................", +"............+$$$$$$$$*................#$$$$$$$$#.......*$$$$$$$$$$$$$$$$$$$$$$=..........+$$$$$$$$$$$$$$$$$$$$$$$$$$$+........=$$$$$$$$@.............@%$$$$$$$%@..........*$$$$$$$$$$$$$$$$$$$$$$$=...........@%$$$$$$$$$$$$$$$$$$$$$$$-......+$$$$$$$$$$$$$$$$$................................................................", +"............-$$$$$$$$&...............@%$$$$$$$&.......-$$$$$$$$$$$$$$$$$$$$$$$$+........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$@........$$$$$$$$$............#&$$$$$$$$$#..........&$$$$$$$$$$$$$$$$$$$$$$$$$-..........%$$$$$$$$$$$$$$$$$$$$$$$$$@.....-$$$$$$$$$$$$$$$$=................................................................", +"............*$$$$$$$$+..............-%$$$$$$$=.......#$$$$$$$$$%&+@@+*$$$$$$$$$=........%$$$$$$$$$%-#.+&$$$$$$$$$$$$%........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+..........+$$$$$$$$$$&+@@+&$$$$$$$$$$=.........*$$$$$$$$$%-+.#+=$$$$$$$$$$-.....#+++=$$$$$$$$++++#................................................................", +"............$$$$$$$$$-++++++++++++*%$$$$$$$$%@.......%$$$$$$$$&.......+$$$$$$$$$#......&$$$$$$$$$&......@%$$$$$$$$$$*........-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%+..........@$$$$$$$$$=@......@%$$$$$$$$$@.......-$$$$$$$$$&.......+$$$$$$$$$=.........%$$$$$$$*.....................................................................", +"...........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*@.......&$$$$$$$$+.........&$$$$$$$$-.....@$$$$$$$$$+........+$$$$$$$$$$-........*$$$$$$$$$$$$$$$$$$$$$$$$$$$$=@...........=$$$$$$$$*.........#$$$$$$$$$+......@$$$$$$$$$+.........&$$$$$$$$$.........$$$$$$$$-.....................................................................", +"...........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-........@$$$$$$$$*..........@$$$$$$$$*.....=$$$$$$$$-..........=$$$$$$$$$+........%$$$$$$$$$$$$$$$$$$$$$$$$$$$$*...........#$$$$$$$$*...........*$$$$$$$$*......&$$$$$$$$+...........$$$$$$$$$+.......+$$$$$$$$+.....................................................................", +"...........&$$$$$$$$$$$$$$$$$$$$$$$$$$$$&@.........&$$$$$$$%............%$$$$$$$*....#$$$$$$$$=...........&$$$$$$$$$........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*..........=$$$$$$$%@...........+$$$$$$$$*.....@$$$$$$$$*............*$$$$$$$$+.......&$$$$$$$$......................................................................", +"...........=$$$$$$$$$$$$$$$$$$$$$$$$$$$&@..........%$$$$$$$&............*$$$$$$$*....&$$$$$$$$@...........+$$$$$$$$=........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&........#$$$$$$$$-.............$$$$$$$$*.....&$$$$$$$$@............+$$$$$$$$+.......*$$$$$$$%......................................................................", +"...........$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&........+$$$$$$$$@............*$$$$$$$*....$$$$$$$$*............+$$$$$$$$*........&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#.......&$$$$$$$%..............$$$$$$$$*.....%$$$$$$$&.............+$$$$$$$$+.......$$$$$$$$*......................................................................", +"..........#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*.......*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*...+$$$$$$$$#............+$$$$$$$$+........*$$$$$$$$&++++++++++++*$$$$$$$$$$=.......$$$$$$$$-..............$$$$$$$$*....+$$$$$$$$@.............+$$$$$$$$+......@$$$$$$$$-......................................................................", +"..........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+......$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*...*$$$$$$$%.............+$$$$$$$$#........$$$$$$$$$..............@*$$$$$$$$$......+$$$$$$$$@..............$$$$$$$$+....*$$$$$$$=..............+$$$$$$$$.......+$$$$$$$$#......................................................................", +"..........*$$$$$$$$+............+=$$$$$$$$$*.....+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...$$$$$$$$&.............+$$$$$$$$........@$$$$$$$$=................%$$$$$$$$+.....&$$$$$$$%..............@$$$$$$$$+....%$$$$$$$&..............-$$$$$$$$.......&$$$$$$$$.......................................................................", +"..........%$$$$$$$$@..............*$$$$$$$$*.....-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#..#$$$$$$$$+.............*$$$$$$$*........+$$$$$$$$*................-$$$$$$$$+.....=$$$$$$$*..............+$$$$$$$$@...@$$$$$$$$+..............*$$$$$$$=.......*$$$$$$$=.......................................................................", +"..........$$$$$$$$$...............@$$$$$$$$*.....*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$...+$$$$$$$$#.............=$$$$$$$&........*$$$$$$$$+................+$$$$$$$$+.....$$$$$$$$&..............&$$$$$$$%....+$$$$$$$$#..............%$$$$$$$&.......$$$$$$$$*.......................................................................", +".........+$$$$$$$$*................$$$$$$$$&.....=$$$$$$$$*********************&...-$$$$$$$$.............@$$$$$$$$+........=$$$$$$$$#................+$$$$$$$$+.....$$$$$$$$+..............=$$$$$$$*....+$$$$$$$$..............@$$$$$$$$+......@$$$$$$$$+.......................................................................", +".........-$$$$$$$$&...............#$$$$$$$$+.....$$$$$$$$%.........................*$$$$$$$$.............-$$$$$$$$@........$$$$$$$$$.................*$$$$$$$$.....+$$$$$$$$+.............@$$$$$$$$+....*$$$$$$$$..............-$$$$$$$$.......+$$$$$$$$@.......................................................................", +".........*$$$$$$$$+...............-$$$$$$$$+.....$$$$$$$$*.........................*$$$$$$$$.............=$$$$$$$%........#$$$$$$$$=................@$$$$$$$$=.....+$$$$$$$$+.............&$$$$$$$$.....*$$$$$$$$..............%$$$$$$$*.......&$$$$$$$$........................................................................", +".........$$$$$$$$$................*$$$$$$$$......$$$$$$$$*.........................*$$$$$$$$............#$$$$$$$$*........-$$$$$$$$*................&$$$$$$$$-.....+$$$$$$$$+............@%$$$$$$$&.....*$$$$$$$$.............+$$$$$$$$#.......*$$$$$$$*........................................................................", +"........@$$$$$$$$%................$$$$$$$$$......$$$$$$$$*.........................*$$$$$$$$+...........%$$$$$$$$-........*$$$$$$$$+...............+$$$$$$$$$@.....+$$$$$$$$*............&$$$$$$$$@.....*$$$$$$$$+............%$$$$$$$=........$$$$$$$$&........................................................................", +"........+$$$$$$$$*...............#$$$$$$$$*......%$$$$$$$$...........@********@....&$$$$$$$$&..........*$$$$$$$$$+........%$$$$$$$$#..............+$$$$$$$$$&......+$$$$$$$$%...........+$$$$$$$$*......*$$$$$$$$&...........*$$$$$$$$+.......#$$$$$$$$+........................................................................", +"........&$$$$$$$$-...............&$$$$$$$$&......*$$$$$$$$-..........*$$$$$$$=.....+$$$$$$$$%@........+$$$$$$$$$$.........$$$$$$$$$............@+=$$$$$$$$$%@.......$$$$$$$$$-.........+$$$$$$$$$@......+$$$$$$$$$@.........*$$$$$$$$=........+$$$$$$$$.........................................................................", +"........=$$$$$$$$+...............*$$$$$$$$+......+$$$$$$$$$+.......@*$$$$$$$$@.....#$$$$$$$$$*.......*$$$$$$$$$$=........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+........%$$$$$$$$$+.......-$$$$$$$$$-.......#$$$$$$$$$%@......@*$$$$$$$$$@........*$$$$$$$=.........................................................................", +"........$$$$$$$$$................$$$$$$$$$#.......$$$$$$$$$$&#...#&$$$$$$$$$-.......%$$$$$$$$$=#..@-%$$$$$$$$$$$*........&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&.........&$$$$$$$$$$&#...+=$$$$$$$$$=.........%$$$$$$$$$%-@..@-%$$$$$$$$$-.........=$$$$$$$%@........................................................................", +".......#$$$$$$$$=...............@$$$$$$$$$........&$$$$$$$$$$$$$$$$$$$$$$$$*........&$$$$$$$$$$$$$$$$$$$$$$$$$$$+........*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*..........@$$$$$$$$$$$$$$$$$$$$$$$$$%@.........-$$$$$$$$$$$$$$$$$$$$$$$$$*..........$$$$$$$$$$***.....................................................................", +".......+$$$$$$$$*...............+$$$$$$$$$.........%$$$$$$$$$$$$$$$$$$$$$$*.........@$$$$$$$$$$$$$$$$$$$$$$$$$$$#........$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-............&$$$$$$$$$$$$$$$$$$$$$$$%@...........%$$$$$$$$$$$$$$$$$$$$$$$*...........$$$$$$$$$$$$%.....................................................................", +".......*$$$$$$$$+...............+$$$$$$$$$@........@$$$$$$$$$$$$$$$$$$$$$*...........-$$$$$$$$$$$$$$$$$*$$$$$$$$........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%#..............*$$$$$$$$$$$$$$$$$$$$$=@............@%$$$$$$$$$$$$$$$$$$$$$&............$$$$$$$$$$$$*.....................................................................", +".......%$$$$$$$$#...............+$$$$$$$$$*.........#%$$$$$$$$$$$$$$$$$$+.............*$$$$$$$$$$$$$$$+*$$$$$$$*........+$$$$$$$$$$$$$$$$$$$$$$$$$$$%-................@=$$$$$$$$$$$$$$$$$$$&...............+%$$$$$$$$$$$$$$$$$$%+.............*$$$$$$$$$$$-.....................................................................", +".......$$$$$$$$$................@$$$$$$$$$=..........@=$$$$$$$$$$$$$$$&@...............*$$$$$$$$$$$$%@.%$$$$$$$&........&$$$$$$$$$$$$$$$$$$$$$$$$=&#....................&$$$$$$$$$$$$$$$$=#.................@=$$$$$$$$$$$$$$$$&@..............#$$$$$$$$$$$+.....................................................................", +"......@+++++++++.................+++++++++#............#=$$$$$$$$$$%&@..................+%$$$$$$$$%-...++++++++@........#++++++++++++++++++++++@.........................@&%$$$$$$$$$$%&#.....................#*$$$$$$$$$$$=-@.................+%$$$$$$$$$......................................................................", +".........................................................@+&****&+@.......................#-****-#..........................................................................#+******+#...........................+-*****&+@......................+&*****+#......................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +".................................................................+++++++++++++++++++++++++@......................................................................#+++++++#........@++++++++++++++++++++++.......................................................................................................................", +".................................................................$$$$$$$$$$$$$$$$$$$$$$$$$$%&@...................................................................$$$$$$$$&........*$$$$$$$$$$$$$$$$$$$$$$$%*#...................................................................................................................", +"................................................................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.................................................................@$$$$$$$$+........%$$$$$$$$$$$$$$$$$$$$$$$$$$=@.................................................................................................................", +"................................................................&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+................................................................+$$$$$$$$.........$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+................................................................................................................", +"................................................................*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...............................................................&$$$$$$$%........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@.....................................................................................*$$$$$$$%.................", +"................................................................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%...............................................................*$$$$$$$*........-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=.....................................................................................$$$$$$$$*.................", +"...............................................................@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-..............................................................$$$$$$$$-........*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#....................................................................................$$$$$$$$-.................", +"...............................................................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*.............................................................#$$$$$$$$#........%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*...................................................................................+$$$$$$$$+.................", +"...............................................................*$$$$$$$$+............+&$$$$$$$$$$$.............................................................+$$$$$$$$........@$$$$$$$$=............+=$$$$$$$$$%...................................................................................-$$$$$$$$..................", +"...............................................................=$$$$$$$$#..............@%$$$$$$$$$.............................................................*$$$$$$$=........+$$$$$$$$*..............-$$$$$$$$$...................................................................................*$$$$$$$=..................", +"...............................................................$$$$$$$$$................#$$$$$$$$$.............................................................=$$$$$$$*........&$$$$$$$$+...............%$$$$$$$$...................................................................................%$$$$$$$*..................", +"..............................................................#$$$$$$$$*.................=$$$$$$$%...............#++**-+#.........................@++**++......$$$$$$$$+........*$$$$$$$$#...............*$$$$$$$$..................@++&**++@............................#++**&++....................$$$$$$$$+..................", +"..............................................................-$$$$$$$$&.................*$$$$$$$*............+*$$$$$$$$$$*#....................-=$$$$$$$$&@..+$$$$$$$$@........$$$$$$$$$................*$$$$$$$*...............+*$$$$$$$$$$%&@.....................@-=$$$$$$$$$$=-............@+++&$$$$$$$$&+++#..............", +"..............................................................*$$$$$$$$+.................=$$$$$$$-.........@&$$$$$$$$$$$$$$$*@................-%$$$$$$$$$$$%@.-$$$$$$$$........#$$$$$$$$=................$$$$$$$$-.............-%$$$$$$$$$$$$$$$&..................@&$$$$$$$$$$$$$$$%+..........*$$$$$$$$$$$$$$$$*..............", +"..............................................................%$$$$$$$$@................@$$$$$$$$@........+%$$$$$$$$$$$$$$$$$%@.............@=$$$$$$$$$$$$$$%@*$$$$$$$*........+$$$$$$$$&...............-$$$$$$$$@...........#%$$$$$$$$$$$$$$$$$$%@...............-$$$$$$$$$$$$$$$$$$$*.........%$$$$$$$$$$$$$$$$-..............", +"..............................................................$$$$$$$$$.................&$$$$$$$*........*$$$$$$$$$$$$$$$$$$$$%@...........#%$$$$$$$$$$$$$$$$&%$$$$$$$&........*$$$$$$$$+..............@$$$$$$$$&...........-$$$$$$$$$$$$$$$$$$$$$%@............@*$$$$$$$$$$$$$$$$$$$$$*........$$$$$$$$$$$$$$$$$+..............", +".............................................................+$$$$$$$$*................#$$$$$$$$#.......*$$$$$$$$$$$$$$$$$$$$$$=..........+$$$$$$$$$$$$$$$$$$$$$$$$$$$+........=$$$$$$$$@.............@%$$$$$$$%@..........*$$$$$$$$$$$$$$$$$$$$$$$=...........@%$$$$$$$$$$$$$$$$$$$$$$$-......+$$$$$$$$$$$$$$$$$...............", +".............................................................-$$$$$$$$&...............@%$$$$$$$&.......-$$$$$$$$$$$$$$$$$$$$$$$$+........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$@........$$$$$$$$$............#&$$$$$$$$$#..........&$$$$$$$$$$$$$$$$$$$$$$$$$-..........%$$$$$$$$$$$$$$$$$$$$$$$$$@.....-$$$$$$$$$$$$$$$$=...............", +".............................................................*$$$$$$$$+..............-%$$$$$$$=.......#$$$$$$$$$%&+@@+*$$$$$$$$$=........%$$$$$$$$$%-#.+&$$$$$$$$$$$$%........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+..........+$$$$$$$$$$&+@@+&$$$$$$$$$$=.........*$$$$$$$$$%-+.#+=$$$$$$$$$$-.....#+++=$$$$$$$$++++#...............", +".............................................................$$$$$$$$$-++++++++++++*%$$$$$$$$%@.......%$$$$$$$$&.......+$$$$$$$$$#......&$$$$$$$$$&......@%$$$$$$$$$$*........-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%+..........@$$$$$$$$$=@......@%$$$$$$$$$@.......-$$$$$$$$$&.......+$$$$$$$$$=.........%$$$$$$$*....................", +"............................................................@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*@.......&$$$$$$$$+.........&$$$$$$$$-.....@$$$$$$$$$+........+$$$$$$$$$$-........*$$$$$$$$$$$$$$$$$$$$$$$$$$$$=@...........=$$$$$$$$*.........#$$$$$$$$$+......@$$$$$$$$$+.........&$$$$$$$$$.........$$$$$$$$-....................", +"............................................................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-........@$$$$$$$$*..........@$$$$$$$$*.....=$$$$$$$$-..........=$$$$$$$$$+........%$$$$$$$$$$$$$$$$$$$$$$$$$$$$*...........#$$$$$$$$*...........*$$$$$$$$*......&$$$$$$$$+...........$$$$$$$$$+.......+$$$$$$$$+....................", +"............................................................&$$$$$$$$$$$$$$$$$$$$$$$$$$$$&@.........&$$$$$$$%............%$$$$$$$*....#$$$$$$$$=...........&$$$$$$$$$........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*..........=$$$$$$$%@...........+$$$$$$$$*.....@$$$$$$$$*............*$$$$$$$$+.......&$$$$$$$$.....................", +"............................................................=$$$$$$$$$$$$$$$$$$$$$$$$$$$&@..........%$$$$$$$&............*$$$$$$$*....&$$$$$$$$@...........+$$$$$$$$=........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&........#$$$$$$$$-.............$$$$$$$$*.....&$$$$$$$$@............+$$$$$$$$+.......*$$$$$$$%.....................", +"............................................................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&........+$$$$$$$$@............*$$$$$$$*....$$$$$$$$*............+$$$$$$$$*........&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#.......&$$$$$$$%..............$$$$$$$$*.....%$$$$$$$&.............+$$$$$$$$+.......$$$$$$$$*.....................", +"...........................................................#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*.......*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*...+$$$$$$$$#............+$$$$$$$$+........*$$$$$$$$&++++++++++++*$$$$$$$$$$=.......$$$$$$$$-..............$$$$$$$$*....+$$$$$$$$@.............+$$$$$$$$+......@$$$$$$$$-.....................", +"...........................................................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+......$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*...*$$$$$$$%.............+$$$$$$$$#........$$$$$$$$$..............@*$$$$$$$$$......+$$$$$$$$@..............$$$$$$$$+....*$$$$$$$=..............+$$$$$$$$.......+$$$$$$$$#.....................", +"...........................................................*$$$$$$$$+............+=$$$$$$$$$*.....+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...$$$$$$$$&.............+$$$$$$$$........@$$$$$$$$=................%$$$$$$$$+.....&$$$$$$$%..............@$$$$$$$$+....%$$$$$$$&..............-$$$$$$$$.......&$$$$$$$$......................", +"...........................................................%$$$$$$$$@..............*$$$$$$$$*.....-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#..#$$$$$$$$+.............*$$$$$$$*........+$$$$$$$$*................-$$$$$$$$+.....=$$$$$$$*..............+$$$$$$$$@...@$$$$$$$$+..............*$$$$$$$=.......*$$$$$$$=......................", +"...........................................................$$$$$$$$$...............@$$$$$$$$*.....*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$...+$$$$$$$$#.............=$$$$$$$&........*$$$$$$$$+................+$$$$$$$$+.....$$$$$$$$&..............&$$$$$$$%....+$$$$$$$$#..............%$$$$$$$&.......$$$$$$$$*......................", +"..........................................................+$$$$$$$$*................$$$$$$$$&.....=$$$$$$$$*********************&...-$$$$$$$$.............@$$$$$$$$+........=$$$$$$$$#................+$$$$$$$$+.....$$$$$$$$+..............=$$$$$$$*....+$$$$$$$$..............@$$$$$$$$+......@$$$$$$$$+......................", +"..........................................................-$$$$$$$$&...............#$$$$$$$$+.....$$$$$$$$%.........................*$$$$$$$$.............-$$$$$$$$@........$$$$$$$$$.................*$$$$$$$$.....+$$$$$$$$+.............@$$$$$$$$+....*$$$$$$$$..............-$$$$$$$$.......+$$$$$$$$@......................", +"..........................................................*$$$$$$$$+...............-$$$$$$$$+.....$$$$$$$$*.........................*$$$$$$$$.............=$$$$$$$%........#$$$$$$$$=................@$$$$$$$$=.....+$$$$$$$$+.............&$$$$$$$$.....*$$$$$$$$..............%$$$$$$$*.......&$$$$$$$$.......................", +"..........................................................$$$$$$$$$................*$$$$$$$$......$$$$$$$$*.........................*$$$$$$$$............#$$$$$$$$*........-$$$$$$$$*................&$$$$$$$$-.....+$$$$$$$$+............@%$$$$$$$&.....*$$$$$$$$.............+$$$$$$$$#.......*$$$$$$$*.......................", +".........................................................@$$$$$$$$%................$$$$$$$$$......$$$$$$$$*.........................*$$$$$$$$+...........%$$$$$$$$-........*$$$$$$$$+...............+$$$$$$$$$@.....+$$$$$$$$*............&$$$$$$$$@.....*$$$$$$$$+............%$$$$$$$=........$$$$$$$$&.......................", +".........................................................+$$$$$$$$*...............#$$$$$$$$*......%$$$$$$$$...........@********@....&$$$$$$$$&..........*$$$$$$$$$+........%$$$$$$$$#..............+$$$$$$$$$&......+$$$$$$$$%...........+$$$$$$$$*......*$$$$$$$$&...........*$$$$$$$$+.......#$$$$$$$$+.......................", +".........................................................&$$$$$$$$-...............&$$$$$$$$&......*$$$$$$$$-..........*$$$$$$$=.....+$$$$$$$$%@........+$$$$$$$$$$.........$$$$$$$$$............@+=$$$$$$$$$%@.......$$$$$$$$$-.........+$$$$$$$$$@......+$$$$$$$$$@.........*$$$$$$$$=........+$$$$$$$$........................", +".........................................................=$$$$$$$$+...............*$$$$$$$$+......+$$$$$$$$$+.......@*$$$$$$$$@.....#$$$$$$$$$*.......*$$$$$$$$$$=........+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+........%$$$$$$$$$+.......-$$$$$$$$$-.......#$$$$$$$$$%@......@*$$$$$$$$$@........*$$$$$$$=........................", +".........................................................$$$$$$$$$................$$$$$$$$$#.......$$$$$$$$$$&#...#&$$$$$$$$$-.......%$$$$$$$$$=#..@-%$$$$$$$$$$$*........&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&.........&$$$$$$$$$$&#...+=$$$$$$$$$=.........%$$$$$$$$$%-@..@-%$$$$$$$$$-.........=$$$$$$$%@.......................", +"........................................................#$$$$$$$$=...............@$$$$$$$$$........&$$$$$$$$$$$$$$$$$$$$$$$$*........&$$$$$$$$$$$$$$$$$$$$$$$$$$$+........*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*..........@$$$$$$$$$$$$$$$$$$$$$$$$$%@.........-$$$$$$$$$$$$$$$$$$$$$$$$$*..........$$$$$$$$$$***....................", +"........................................................+$$$$$$$$*...............+$$$$$$$$$.........%$$$$$$$$$$$$$$$$$$$$$$*.........@$$$$$$$$$$$$$$$$$$$$$$$$$$$#........$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-............&$$$$$$$$$$$$$$$$$$$$$$$%@...........%$$$$$$$$$$$$$$$$$$$$$$$*...........$$$$$$$$$$$$%....................", +"........................................................*$$$$$$$$+...............+$$$$$$$$$@........@$$$$$$$$$$$$$$$$$$$$$*...........-$$$$$$$$$$$$$$$$$*$$$$$$$$........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%#..............*$$$$$$$$$$$$$$$$$$$$$=@............@%$$$$$$$$$$$$$$$$$$$$$&............$$$$$$$$$$$$*....................", +"........................................................%$$$$$$$$#...............+$$$$$$$$$*.........#%$$$$$$$$$$$$$$$$$$+.............*$$$$$$$$$$$$$$$+*$$$$$$$*........+$$$$$$$$$$$$$$$$$$$$$$$$$$$%-................@=$$$$$$$$$$$$$$$$$$$&...............+%$$$$$$$$$$$$$$$$$$%+.............*$$$$$$$$$$$-....................", +"........................................................$$$$$$$$$................@$$$$$$$$$=..........@=$$$$$$$$$$$$$$$&@...............*$$$$$$$$$$$$%@.%$$$$$$$&........&$$$$$$$$$$$$$$$$$$$$$$$$=&#....................&$$$$$$$$$$$$$$$$=#.................@=$$$$$$$$$$$$$$$$&@..............#$$$$$$$$$$$+....................", +".......................................................@+++++++++.................+++++++++#............#=$$$$$$$$$$%&@..................+%$$$$$$$$%-...++++++++@........#++++++++++++++++++++++@.........................@&%$$$$$$$$$$%&#.....................#*$$$$$$$$$$$=-@.................+%$$$$$$$$$.....................", +"..........................................................................................................@+&****&+@.......................#-****-#..........................................................................#+******+#...........................+-*****&+@......................+&*****+#.....................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................"};
--- a/packages/hal/arm/sa11x0/assabet/current/src/assabet_misc.c +++ b/packages/hal/arm/sa11x0/assabet/current/src/assabet_misc.c @@ -242,5 +242,7 @@ void plf_hardware_init(void) { // Force "alternate" use of GPIO pins used for LCD screen -// *SA11X0_GPIO_ALTERNATE_FUNCTION |= 0x000003FC; // Bits 2..9 + *SA11X0_GPIO_ALTERNATE_FUNCTION |= 0x000003FC; // Bits 2..9 + *SA11X0_GPIO_PIN_DIRECTION |= 0x000003FC; // Bits 2..9 + *SA11X0_GPIO_PIN_OUTPUT_CLEAR = 0x000003FC; // Bits 2..9 }
--- a/packages/hal/arm/sa11x0/brutus/current/ChangeLog +++ b/packages/hal/arm/sa11x0/brutus/current/ChangeLog @@ -1,3 +1,7 @@ +2000-09-17 Gary Thomas <gthomas@redhat.com> + + * cdl/hal_arm_sa11x0_brutus.cdl: Add platform/cpu identification strings. + 2000-07-05 Jesper Skov <jskov@redhat.com> * cdl/hal_arm_sa11x0_brutus.cdl: Cleanup channel options.
--- a/packages/hal/arm/sa11x0/brutus/current/cdl/hal_arm_sa11x0_brutus.cdl +++ b/packages/hal/arm/sa11x0/brutus/current/cdl/hal_arm_sa11x0_brutus.cdl @@ -61,6 +61,9 @@ cdl_package CYGPKG_HAL_ARM_SA11X0_BRUTUS puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H <pkgconf/hal_arm.h>" puts $::cdl_system_header "#define CYGBLD_HAL_VARIANT_H <pkgconf/hal_arm_sa11x0.h>" puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_sa11x0_brutus.h>" + puts $::cdl_header "#define HAL_PLATFORM_CPU \"StrongARM 1100\"" + puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Brutus development system\"" + puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\"" } cdl_component CYG_HAL_STARTUP {
--- a/packages/hal/mips/arch/current/ChangeLog +++ b/packages/hal/mips/arch/current/ChangeLog @@ -1,3 +1,31 @@ +2000-09-15 Jesper Skov <jskov@redhat.com> + + * include/hal_intr.h (HAL_DEFAULT_ISR): Fix warning. + (HAL_DEFAULT_ISR): Undo that change. + +2000-09-14 Jesper Skov <jskov@redhat.com> + + * include/hal_intr.h: Only define _FPE when there's a FPU. + +2000-09-13 Jesper Skov <jskov@redhat.com> + + * include/hal_intr.h (HAL_VSR_SET_TO_ECOS_HANDLER): Fix compiler + warning. + + * src/vectors.S: Fully decode TLB related exceptions. + * src/hal_misc.c (cyg_hal_exception_handler): Undid below change. + + * src/hal_misc.c (cyg_hal_exception_handler): Base vector + calculation on cause register, not the provided vector value. + +2000-09-12 Jesper Skov <jskov@redhat.com> + + * include/hal_intr.h: Added definition for decoded FPU + exceptions. + + * src/hal_misc.c (cyg_hal_exception_handler): Decode FPU + exceptions. + 2000-09-07 Jesper Skov <jskov@redhat.com> * include/basetype.h: Removed change from yesterday.
--- a/packages/hal/mips/arch/current/include/hal_intr.h +++ b/packages/hal/mips/arch/current/include/hal_intr.h @@ -127,14 +127,26 @@ #define CYGNUM_HAL_EXCEPTION_COPROCESSOR CYGNUM_HAL_VECTOR_COPROCESSOR #define CYGNUM_HAL_EXCEPTION_OVERFLOW CYGNUM_HAL_VECTOR_OVERFLOW #define CYGNUM_HAL_EXCEPTION_DIV_BY_ZERO CYGNUM_HAL_VECTOR_DIV_BY_ZERO +#ifdef CYGHWR_HAL_MIPS_FPU #define CYGNUM_HAL_EXCEPTION_FPU CYGNUM_HAL_VECTOR_FPE +#endif #define CYGNUM_HAL_EXCEPTION_INTERRUPT CYGNUM_HAL_VECTOR_BREAKPOINT +// decoded exception vectors +#define CYGNUM_HAL_EXCEPTION_FPU_INEXACT (-1) +#define CYGNUM_HAL_EXCEPTION_FPU_DIV_BY_ZERO (-2) +#define CYGNUM_HAL_EXCEPTION_FPU_OVERFLOW (-3) +#define CYGNUM_HAL_EXCEPTION_FPU_UNDERFLOW (-4) +#define CYGNUM_HAL_EXCEPTION_FPU_INVALID (-5) + + // Min/Max exception numbers and how many there are -#define CYGNUM_HAL_EXCEPTION_MIN 1 +#define CYGNUM_HAL_EXCEPTION_MIN CYGNUM_HAL_EXCEPTION_FPU_INVALID #define CYGNUM_HAL_EXCEPTION_MAX CYGNUM_HAL_VSR_MAX -#define CYGNUM_HAL_EXCEPTION_COUNT CYGNUM_HAL_VSR_MAX + +#define CYGNUM_HAL_EXCEPTION_COUNT \ + ( CYGNUM_HAL_EXCEPTION_MAX - CYGNUM_HAL_EXCEPTION_MIN + 1 ) #ifndef CYGHWR_HAL_INTERRUPT_VECTORS_DEFINED @@ -332,7 +344,7 @@ externC void hal_interrupt_stack_call_pe #define HAL_VSR_SET( _vector_, _vsr_, _poldvsr_ ) CYG_MACRO_START \ - if( _poldvsr_ != NULL) \ + if( (void*)_poldvsr_ != NULL) \ *(CYG_ADDRESS *)_poldvsr_ = (CYG_ADDRESS)hal_vsr_table[_vector_]; \ hal_vsr_table[_vector_] = (CYG_ADDRESS)_vsr_; \ CYG_MACRO_END
--- a/packages/hal/mips/arch/current/src/hal_misc.c +++ b/packages/hal/mips/arch/current/src/hal_misc.c @@ -48,12 +48,15 @@ #include <cyg/infra/cyg_trac.h> // tracing macros #include <cyg/infra/cyg_ass.h> // assertion macros +#define CYGARC_HAL_COMMON_EXPORT_CPU_MACROS #include <cyg/hal/hal_arch.h> // architectural definitions #include <cyg/hal/hal_intr.h> // Interrupt handling #include <cyg/hal/hal_cache.h> // Cache handling +#include <cyg/hal/mips-regs.h> // FPU cause register definitions + /*------------------------------------------------------------------------*/ /* If required, define a variable to store the clock period. */ @@ -76,20 +79,58 @@ externC cyg_uint8 cyg_hal_mips_process_f externC cyg_uint32 cyg_hal_exception_handler(HAL_SavedRegisters *regs) { -#if defined(CYGHWR_HAL_MIPS_FPU) && \ - defined(CYGSEM_HAL_MIPS_EMULATE_UNIMPLEMENTED_FPU_OPS) - // We may be required to emulate certain unimplemented Floating Point - // operations + int vec = regs->vector>>2; - if ((regs->vector>>2) == CYGNUM_HAL_VECTOR_FPE) { +#if defined(CYGHWR_HAL_MIPS_FPU) + // Special handling of FPU exceptions + if (CYGNUM_HAL_VECTOR_FPE == vec) { + +#if defined(CYGSEM_HAL_MIPS_EMULATE_UNIMPLEMENTED_FPU_OPS) + // We may be required to emulate certain unimplemented Floating Point + // operations // cyg_hal_mips_process_fpe() returns non-zero if it could handle // the exception successfully. If so, we just return if ( cyg_hal_mips_process_fpe(regs) ) return 0; +#endif + + // Find the cause of the FPU exception, clear the flag and use + // the decoded vector number. + { + cyg_uint32 cause = regs->fcr31; + + if (cause & FCR31_CAUSE_I) { + vec = CYGNUM_HAL_EXCEPTION_FPU_INEXACT; + cause &= ~(FCR31_FLAGS_I | FCR31_CAUSE_I); + } else if (cause & FCR31_CAUSE_U) { + vec = CYGNUM_HAL_EXCEPTION_FPU_UNDERFLOW; + cause &= ~(FCR31_FLAGS_U | FCR31_CAUSE_U); + } else if (cause & FCR31_CAUSE_O) { + vec = CYGNUM_HAL_EXCEPTION_FPU_OVERFLOW; + cause &= ~(FCR31_FLAGS_O | FCR31_CAUSE_O); + } else if (cause & FCR31_CAUSE_Z) { + vec = CYGNUM_HAL_EXCEPTION_FPU_DIV_BY_ZERO; + cause &= ~(FCR31_FLAGS_Z | FCR31_CAUSE_Z); + } else if (cause & FCR31_CAUSE_V) { + vec = CYGNUM_HAL_EXCEPTION_FPU_INVALID; + cause &= ~(FCR31_FLAGS_V | FCR31_CAUSE_V); + } + regs->fcr31 = cause; + +#if 1 + // Update the FPU status register with the new + // setting. This is a workaround for the signal2 test + // which does a longjump in the exception handler and thus + // never gets around to executing the register restore + // code. + asm ("ctc1 %0,$31" : : "r" (cause)); +#endif + } } -#endif +#endif // CYGHWR_HAL_MIPS_FPU + #if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) @@ -113,7 +154,7 @@ externC cyg_uint32 cyg_hal_exception_han // pointer to the saved registers. We should also divert // breakpoint and other debug vectors into the debug stubs. - cyg_hal_deliver_exception( regs->vector>>2, (CYG_ADDRWORD)regs ); + cyg_hal_deliver_exception( vec, (CYG_ADDRWORD)regs ); #else
--- a/packages/hal/mips/arch/current/src/vectors.S +++ b/packages/hal/mips/arch/current/src/vectors.S @@ -116,7 +116,7 @@ FUNC_END(reset_vector) # Debug vector at 0xBFC00200 FUNC_START(debug_vector) - la k0,32 + la k0,32*4 la k1,hal_vsr_table # Get VSR table lw k1,32*4(k1) # load debug vector jr k1 # go there @@ -136,15 +136,17 @@ FUNC_START(other_vector) lw k1,0(k1) # k1 = pointer to VSR jr k1 # go there nop # (delay slot) - FUNC_END(other_vector) .section ".utlb_vector","ax" FUNC_START(utlb_vector) - la k0,33 - la k1,hal_vsr_table # Get VSR table - lw k1,33*4(k1) # load utlb vector + mfc0 k0,cause # K0 = exception cause + nop + andi k0,k0,0x7F # isolate exception code + la k1,hal_vsr_table # address of VSR table + add k1,k1,k0 # offset of VSR entry + lw k1,0(k1) # k1 = pointer to VSR jr k1 # go there nop # (delay slot) FUNC_END(utlb_vector)
--- a/packages/hal/mips/jmr3904/current/ChangeLog +++ b/packages/hal/mips/jmr3904/current/ChangeLog @@ -1,3 +1,7 @@ +2000-09-11 Jesper Skov <jskov@redhat.com> + + * cdl/hal_mips_tx39_jmr3904.cdl: Fix startup type description. + 2000-05-22 Jesper Skov <jskov@redhat.com> * src/plf_misc.c: Let arch call ctrlc_init.
--- a/packages/hal/mips/jmr3904/current/cdl/hal_mips_tx39_jmr3904.cdl +++ b/packages/hal/mips/jmr3904/current/cdl/hal_mips_tx39_jmr3904.cdl @@ -78,9 +78,7 @@ cdl_package CYGPKG_HAL_MIPS_TX39_JMR3904 equivalent software that allows GDB to download the eCos application on to the board. The ROM bootstrap typically requires that the eCos application be blown into EPROMs or - equivalent technology. STUB bootstrap is for configurations - of eCos used only as GDB stub ROMs; the use of memory is - limited to the top 8kB." + equivalent technology." } cdl_option CYGHWR_HAL_MIPS_TX39_JMR3904_DRAM_CONFIG {
--- a/packages/hal/mips/vrc4373/current/ChangeLog +++ b/packages/hal/mips/vrc4373/current/ChangeLog @@ -1,3 +1,12 @@ +2000-09-15 Nick Garnett <nickg@cygnus.co.uk> + + * include/platform.inc: Added some extra ifdefs and code to try + and get ROM startup working. + + * cdl/hal_mips_vr4300_vrc4373.cdl: + Building GDB stubs was requiring ROM startup when it should have + ROMRAM startup. + 2000-08-31 Jonathan Larmour <jlarmour@redhat.com> * src/platform.S (hal_pci_config_read): Prevent assembler reordering,
--- a/packages/hal/mips/vrc4373/current/cdl/hal_mips_vr4300_vrc4373.cdl +++ b/packages/hal/mips/vrc4373/current/cdl/hal_mips_vr4300_vrc4373.cdl @@ -191,7 +191,7 @@ cdl_package CYGPKG_HAL_MIPS_VR4300_VRC43 cdl_option CYGBLD_BUILD_GDB_STUBS { display "Build GDB stub ROM image" default_value 0 - requires { CYG_HAL_STARTUP == "ROM" } + requires { CYG_HAL_STARTUP == "ROMRAM" } requires CYGSEM_HAL_ROM_MONITOR requires CYGBLD_BUILD_COMMON_GDB_STUBS requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS @@ -271,7 +271,7 @@ cdl_package CYGPKG_HAL_MIPS_VR4300_VRC43 flavor bool default_value 0 parent CYGPKG_HAL_ROM_MONITOR - requires { CYG_HAL_STARTUP == "ROM" } + requires { CYG_HAL_STARTUP == "ROMRAM" } description " Enable this option if this program is to be used as a ROM monitor, i.e. applications will be loaded into RAM on the board, and this
--- a/packages/hal/mips/vrc4373/current/include/platform.inc +++ b/packages/hal/mips/vrc4373/current/include/platform.inc @@ -182,6 +182,7 @@ hal_mmu_setup_return: jalr k0 nop +#if defined(CYG_HAL_STARTUP_ROMRAM) # Having got the RAM working, we must now relocate the Entire # ROM into it and then continue execution from RAM. @@ -202,6 +203,8 @@ 1: 2: # We are now executing out of RAM! +#endif + .endm #define CYGPKG_HAL_MIPS_MEMC_DEFINED @@ -342,6 +345,17 @@ 1: addiu a0,a0,4 bne a0,a1,1b addiu t0,t0,4 +#if defined(CYG_HAL_STARTUP_ROM) + la a0,other_vector + la a1,other_vector_end + la t0,0xa0000180 +1: + lw v0,0(a0) + sw v0,0(t0) + addiu a0,a0,4 + bne a0,a1,1b + addiu t0,t0,4 +#endif .endm #else .macro hal_mon_copy_trampoline
--- a/packages/hal/powerpc/mbx/current/ChangeLog +++ b/packages/hal/powerpc/mbx/current/ChangeLog @@ -1,3 +1,7 @@ +2000-09-17 Gary Thomas <gthomas@redhat.com> + + * cdl/hal_powerpc_mbx.cdl: Add platform/cpu identification strings. + 2000-08-28 Gary Thomas <gthomas@redhat.com> * cdl/hal_powerpc_mbx.cdl: Fix startup type description - was
--- a/packages/hal/powerpc/mbx/current/cdl/hal_powerpc_mbx.cdl +++ b/packages/hal/powerpc/mbx/current/cdl/hal_powerpc_mbx.cdl @@ -59,6 +59,10 @@ cdl_package CYGPKG_HAL_POWERPC_MBX { define_proc { puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H <pkgconf/hal_powerpc_mpc8xx.h>" puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_powerpc_mbx.h>" + + puts $::cdl_header "#define HAL_PLATFORM_CPU \"PowerPC 860\"" + puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Motorola MBX\"" + puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\"" } cdl_component CYG_HAL_STARTUP {
--- a/packages/hal/sh/arch/current/ChangeLog +++ b/packages/hal/sh/arch/current/ChangeLog @@ -16,6 +16,10 @@ 2000-08-31 Jesper Skov <jskov@redhat.c * src/sh_stub.c: If core supports UBC, use it for single-stepping. +2000-08-29 Jesper Skov <jskov@redhat.com> + + * include/mod_7729.h: Added. + 2000-07-20 Jesper Skov <jskov@redhat.com> * src/sh_stub.c (__single_step): Skip trap instructions.
--- a/packages/hal/sh/arch/current/include/hal_intr.h +++ b/packages/hal/sh/arch/current/include/hal_intr.h @@ -416,328 +416,28 @@ externC void cyg_hal_default_exception_v //-------------------------------------------------------------------------- -// Interrupt controller access +// Interrupt controller(s) access // -// Note: These macros work only on a unit basis ; if one source in a -// unit (such as SCI) is unmasked, all sources of that unit get -// unmasked. Finer control must be done in the driver/apps. -#ifdef CYGSEM_HAL_COMMON_INTERRUPTS_ALLOW_NESTING -externC cyg_uint8 cyg_hal_ILVL_table[]; -#define HAL_UPDATE_ILVL_TABLE(_vector_, _level_) \ - /* Update the ILVL table, so it is easy for the interrupt entry */ \ - /* code to find out the level of a given interrupt source. */ \ - cyg_hal_ILVL_table[(_vector_)] = (_level_) -#else -#define HAL_UPDATE_ILVL_TABLE(_vector_, _level_) -#endif +externC void hal_interrupt_set_level(int, int); +#define HAL_INTERRUPT_SET_LEVEL( _vector_, _level_ ) \ + hal_interrupt_set_level(_vector_, _level_); + +externC void hal_interrupt_mask(int); +#define HAL_INTERRUPT_MASK( _vector_ ) \ + hal_interrupt_mask(_vector_); -#define HAL_INTERRUPT_SET_LEVEL( _vector_, _level_ ) \ - CYG_MACRO_START \ - cyg_uint16 iprX; \ - \ - CYG_ASSERT((0 <= (_level_) && 15 >= (_level_)), "Illegal level"); \ - CYG_ASSERT((CYGNUM_HAL_ISR_MIN <= (_vector_) \ - && CYGNUM_HAL_ISR_MAX >= (_vector_)), "Illegal vector"); \ - \ - HAL_UPDATE_ILVL_TABLE(_vector_, _level_); \ - \ - switch( (_vector_) ) { \ - case CYGNUM_HAL_INTERRUPT_NMI: \ - /* fall through */ \ - case CYGNUM_HAL_INTERRUPT_LVL0...CYGNUM_HAL_INTERRUPT_LVL14: \ - /* Cannot change levels */ \ - break; \ - \ - /* IPRA */ \ - case CYGNUM_HAL_INTERRUPT_TMU0_TUNI0: \ - HAL_READ_UINT16(CYGARC_REG_IPRA, iprX); \ - iprX &= ~CYGARC_REG_IPRA_TMU0_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRA_TMU0_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRA, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_TMU1_TUNI1: \ - HAL_READ_UINT16(CYGARC_REG_IPRA, iprX); \ - iprX &= ~CYGARC_REG_IPRA_TMU1_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRA_TMU1_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRA, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_TMU2_TUNI2: \ - case CYGNUM_HAL_INTERRUPT_TMU2_TICPI2: \ - HAL_READ_UINT16(CYGARC_REG_IPRA, iprX); \ - iprX &= ~CYGARC_REG_IPRA_TMU2_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRA_TMU2_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRA, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_RTC_ATI: \ - case CYGNUM_HAL_INTERRUPT_RTC_PRI: \ - case CYGNUM_HAL_INTERRUPT_RTC_CUI: \ - HAL_READ_UINT16(CYGARC_REG_IPRA, iprX); \ - iprX &= ~CYGARC_REG_IPRA_RTC_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRA_RTC_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRA, iprX); \ - break; \ - \ - /* IPRB */ \ - case CYGNUM_HAL_INTERRUPT_SCI_ERI: \ - case CYGNUM_HAL_INTERRUPT_SCI_RXI: \ - case CYGNUM_HAL_INTERRUPT_SCI_TXI: \ - case CYGNUM_HAL_INTERRUPT_SCI_TEI: \ - HAL_READ_UINT16(CYGARC_REG_IPRB, iprX); \ - iprX &= ~CYGARC_REG_IPRB_SCI_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRB_SCI_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRB, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_WDT_ITI: \ - HAL_READ_UINT16(CYGARC_REG_IPRB, iprX); \ - iprX &= ~CYGARC_REG_IPRB_WDT_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRB_WDT_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRB, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_REF_RCMI: \ - case CYGNUM_HAL_INTERRUPT_REF_ROVI: \ - HAL_READ_UINT16(CYGARC_REG_IPRB, iprX); \ - iprX &= ~CYGARC_REG_IPRB_REF_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRB_REF_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRB, iprX); \ - break; \ - \ - /* IPRC */ \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ0: \ - HAL_READ_UINT16(CYGARC_REG_IPRC, iprX); \ - iprX &= ~CYGARC_REG_IPRC_IRQ0_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRC_IRQ0_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRC, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ1: \ - HAL_READ_UINT16(CYGARC_REG_IPRC, iprX); \ - iprX &= ~CYGARC_REG_IPRC_IRQ1_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRC_IRQ1_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRC, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ2: \ - HAL_READ_UINT16(CYGARC_REG_IPRC, iprX); \ - iprX &= ~CYGARC_REG_IPRC_IRQ2_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRC_IRQ2_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRC, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ3: \ - HAL_READ_UINT16(CYGARC_REG_IPRC, iprX); \ - iprX &= ~CYGARC_REG_IPRC_IRQ3_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRC_IRQ3_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRC, iprX); \ - break; \ - \ - /* IPRD */ \ - case CYGNUM_HAL_INTERRUPT_PINT_PINT07: \ - HAL_READ_UINT16(CYGARC_REG_IPRD, iprX); \ - iprX &= ~CYGARC_REG_IPRD_PINT07_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRD_PINT07_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRD, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_PINT_PINT8F: \ - HAL_READ_UINT16(CYGARC_REG_IPRD, iprX); \ - iprX &= ~CYGARC_REG_IPRD_PINT8F_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRD_PINT8F_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRD, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ5: \ - HAL_READ_UINT16(CYGARC_REG_IPRD, iprX); \ - iprX &= ~CYGARC_REG_IPRD_IRQ5_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRD_IRQ5_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRD, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ4: \ - HAL_READ_UINT16(CYGARC_REG_IPRD, iprX); \ - iprX &= ~CYGARC_REG_IPRD_IRQ4_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRD_IRQ4_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRD, iprX); \ - break; \ - \ - /* IPRE */ \ - case CYGNUM_HAL_INTERRUPT_DMAC_DEI0: \ - case CYGNUM_HAL_INTERRUPT_DMAC_DEI1: \ - case CYGNUM_HAL_INTERRUPT_DMAC_DEI2: \ - case CYGNUM_HAL_INTERRUPT_DMAC_DEI3: \ - HAL_READ_UINT16(CYGARC_REG_IPRE, iprX); \ - iprX &= ~CYGARC_REG_IPRE_DMAC_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRE_DMAC_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRE, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRDA_ERI1: \ - case CYGNUM_HAL_INTERRUPT_IRDA_RXI1: \ - case CYGNUM_HAL_INTERRUPT_IRDA_BRI1: \ - case CYGNUM_HAL_INTERRUPT_IRDA_TXI1: \ - HAL_READ_UINT16(CYGARC_REG_IPRE, iprX); \ - iprX &= ~CYGARC_REG_IPRE_IRDA_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRE_IRDA_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRE, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_SCIF_ERI2: \ - case CYGNUM_HAL_INTERRUPT_SCIF_RXI2: \ - case CYGNUM_HAL_INTERRUPT_SCIF_BRI2: \ - case CYGNUM_HAL_INTERRUPT_SCIF_TXI2: \ - HAL_READ_UINT16(CYGARC_REG_IPRE, iprX); \ - iprX &= ~CYGARC_REG_IPRE_SCIF_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRE_SCIF_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRE, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_ADC_ADI: \ - HAL_READ_UINT16(CYGARC_REG_IPRE, iprX); \ - iprX &= ~CYGARC_REG_IPRE_ADC_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRE_ADC_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRE, iprX); \ - break; \ - \ - /* IPRF */ \ - case CYGNUM_HAL_INTERRUPT_LCDC_LCDI: \ - HAL_READ_UINT16(CYGARC_REG_IPRF, iprX); \ - iprX &= ~CYGARC_REG_IPRF_LCDI_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRF_LCDI_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRF, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_PCC_PCC0: \ - HAL_READ_UINT16(CYGARC_REG_IPRF, iprX); \ - iprX &= ~CYGARC_REG_IPRF_PCC0_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRF_PCC0_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRF, iprX); \ - break; \ - case CYGNUM_HAL_INTERRUPT_PCC_PCC1: \ - HAL_READ_UINT16(CYGARC_REG_IPRF, iprX); \ - iprX &= ~CYGARC_REG_IPRF_PCC1_MASK; \ - iprX |= (_level_)*CYGARC_REG_IPRF_PCC1_PRI1; \ - HAL_WRITE_UINT16(CYGARC_REG_IPRF, iprX); \ - break; \ - \ - case CYGNUM_HAL_INTERRUPT_RESERVED_1E0: \ - case CYGNUM_HAL_INTERRUPT_RESERVED_3E0: \ - /* Do nothing for these reserved vectors. */ \ - break; \ - } \ - CYG_MACRO_END +externC void hal_interrupt_unmask(int); +#define HAL_INTERRUPT_UNMASK( _vector_ ) \ + hal_interrupt_unmask(_vector_); -#define HAL_INTERRUPT_MASK( _vector_ ) \ - CYG_MACRO_START \ - switch( (_vector_) ) { \ - case CYGNUM_HAL_INTERRUPT_NMI: \ - /* fall through */ \ - case CYGNUM_HAL_INTERRUPT_LVL0...CYGNUM_HAL_INTERRUPT_LVL14: \ - /* Can only be masked by fiddling Imask in SR. */ \ - break; \ - case CYGNUM_HAL_INTERRUPT_TMU0_TUNI0...CYGNUM_HAL_ISR_MAX: \ - HAL_INTERRUPT_SET_LEVEL((_vector_), 0); \ - break; \ - case CYGNUM_HAL_INTERRUPT_RESERVED_1E0: \ - case CYGNUM_HAL_INTERRUPT_RESERVED_3E0: \ - /* Do nothing for these reserved vectors. */ \ - break; \ - default: \ - CYG_FAIL("Unknown interrupt vector"); \ - break; \ - } \ - CYG_MACRO_END - -#define HAL_INTERRUPT_UNMASK( _vector_ ) \ - CYG_MACRO_START \ - switch( (_vector_) ) { \ - case CYGNUM_HAL_INTERRUPT_NMI: \ - /* fall through */ \ - case CYGNUM_HAL_INTERRUPT_LVL0...CYGNUM_HAL_INTERRUPT_LVL14: \ - /* Can only be unmasked by fiddling Imask in SR. */ \ - break; \ - case CYGNUM_HAL_INTERRUPT_TMU0_TUNI0...CYGNUM_HAL_ISR_MAX: \ - HAL_INTERRUPT_SET_LEVEL((_vector_), 1); \ - break; \ - case CYGNUM_HAL_INTERRUPT_RESERVED_1E0: \ - case CYGNUM_HAL_INTERRUPT_RESERVED_3E0: \ - /* Do nothing for these reserved vectors. */ \ - break; \ - default: \ - CYG_FAIL("Unknown interrupt vector"); \ - break; \ - } \ - CYG_MACRO_END +externC void hal_interrupt_acknowledge(int); +#define HAL_INTERRUPT_ACKNOWLEDGE( _vector_ ) \ + hal_interrupt_acknowledge(_vector_); -#define HAL_INTERRUPT_ACKNOWLEDGE( _vector_ ) \ - CYG_MACRO_START \ - if ( (_vector_) >= CYGNUM_HAL_INTERRUPT_IRQ_IRQ0 \ - && (_vector_) <= CYGNUM_HAL_INTERRUPT_IRQ_IRQ5) { \ - \ - cyg_uint8 irr0; \ - \ - HAL_READ_UINT8(CYGARC_REG_IRR0, irr0); \ - switch ( _vector_ ) { \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ0: \ - irr0 &= ~CYGARC_REG_IRR0_IRQ0; \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ1: \ - irr0 &= ~CYGARC_REG_IRR0_IRQ1; \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ2: \ - irr0 &= ~CYGARC_REG_IRR0_IRQ2; \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ3: \ - irr0 &= ~CYGARC_REG_IRR0_IRQ3; \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ4: \ - irr0 &= ~CYGARC_REG_IRR0_IRQ4; \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ5: \ - irr0 &= ~CYGARC_REG_IRR0_IRQ5; \ - break; \ - } \ - HAL_WRITE_UINT8(CYGARC_REG_IRR0, irr0); \ - } \ - CYG_MACRO_END - -// Note: The PINTs can be masked and configured individually, even -// though there are only two vectors. Maybe add some fake vectors just -// for masking/configuring? -#define HAL_INTERRUPT_CONFIGURE( _vector_, _level_, _up_ ) \ - CYG_MACRO_START \ - if ( (_vector_) >= CYGNUM_HAL_INTERRUPT_IRQ_IRQ0 \ - && (_vector_) <= CYGNUM_HAL_INTERRUPT_IRQ_IRQ5) { \ - \ - cyg_uint16 icr1, ss, mask; \ - ss = 0; \ - mask = CYGARC_REG_ICR1_SENSE_UP|CYGARC_REG_ICR1_SENSE_LEVEL; \ - if (_up_) ss |= CYGARC_REG_ICR1_SENSE_UP; \ - if (_level_) ss |= CYGARC_REG_ICR1_SENSE_LEVEL; \ - CYG_ASSERT(!(_up_ && _level_), "Cannot trigger on high level!"); \ - \ - switch( (_vector_) ) { \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ5: \ - ss <<= CYGARC_REG_ICR1_SENSE_IRQ5_shift; \ - mask <<= CYGARC_REG_ICR1_SENSE_IRQ5_shift; \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ4: \ - ss <<= CYGARC_REG_ICR1_SENSE_IRQ4_shift; \ - mask <<= CYGARC_REG_ICR1_SENSE_IRQ4_shift; \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ3: \ - ss <<= CYGARC_REG_ICR1_SENSE_IRQ3_shift; \ - mask <<= CYGARC_REG_ICR1_SENSE_IRQ3_shift; \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ2: \ - ss <<= CYGARC_REG_ICR1_SENSE_IRQ2_shift; \ - mask <<= CYGARC_REG_ICR1_SENSE_IRQ2_shift; \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ1: \ - ss <<= CYGARC_REG_ICR1_SENSE_IRQ1_shift; \ - mask <<= CYGARC_REG_ICR1_SENSE_IRQ1_shift; \ - break; \ - case CYGNUM_HAL_INTERRUPT_IRQ_IRQ0: \ - ss <<= CYGARC_REG_ICR1_SENSE_IRQ0_shift; \ - mask <<= CYGARC_REG_ICR1_SENSE_IRQ0_shift; \ - break; \ - } \ - \ - HAL_READ_UINT16(CYGARC_REG_ICR1, icr1); \ - icr1 &= ~mask; \ - icr1 |= ss; \ - HAL_WRITE_UINT16(CYGARC_REG_ICR1, icr1); \ - } \ - CYG_MACRO_END +externC void hal_interrupt_configure(int, int, int); +#define HAL_INTERRUPT_CONFIGURE( _vector_, _level_, _up_ ) \ + hal_interrupt_configure(_vector_, _level_, _up_); //-------------------------------------------------------------------------- // Clock control
--- a/packages/hal/sh/arch/current/src/hal_misc.c +++ b/packages/hal/sh/arch/current/src/hal_misc.c @@ -247,4 +247,329 @@ hal_delay_us(int usecs) } //--------------------------------------------------------------------------- +// Interrupt function support + +#ifdef CYGSEM_HAL_COMMON_INTERRUPTS_ALLOW_NESTING +externC cyg_uint8 cyg_hal_ILVL_table[]; +#define HAL_UPDATE_ILVL_TABLE(_vector_, _level_) \ + /* Update the ILVL table, so it is easy for the interrupt entry */ \ + /* code to find out the level of a given interrupt source. */ \ + cyg_hal_ILVL_table[(_vector_)] = (_level_) +#else +#define HAL_UPDATE_ILVL_TABLE(_vector_, _level_) +#endif + +void +hal_interrupt_set_level(int vector, int level) +{ + cyg_uint16 iprX; + + CYG_ASSERT((0 <= (level) && 15 >= (level)), "Illegal level"); + CYG_ASSERT((CYGNUM_HAL_ISR_MIN <= (vector) + && CYGNUM_HAL_ISR_MAX >= (vector)), "Illegal vector"); + + HAL_UPDATE_ILVL_TABLE(vector, level); + + switch( (vector) ) { + case CYGNUM_HAL_INTERRUPT_NMI: + /* fall through */ + case CYGNUM_HAL_INTERRUPT_LVL0...CYGNUM_HAL_INTERRUPT_LVL14: + /* Cannot change levels */ + break; + + /* IPRA */ + case CYGNUM_HAL_INTERRUPT_TMU0_TUNI0: + HAL_READ_UINT16(CYGARC_REG_IPRA, iprX); + iprX &= ~CYGARC_REG_IPRA_TMU0_MASK; + iprX |= (level)*CYGARC_REG_IPRA_TMU0_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRA, iprX); + break; + case CYGNUM_HAL_INTERRUPT_TMU1_TUNI1: + HAL_READ_UINT16(CYGARC_REG_IPRA, iprX); + iprX &= ~CYGARC_REG_IPRA_TMU1_MASK; + iprX |= (level)*CYGARC_REG_IPRA_TMU1_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRA, iprX); + break; + case CYGNUM_HAL_INTERRUPT_TMU2_TUNI2: + case CYGNUM_HAL_INTERRUPT_TMU2_TICPI2: + HAL_READ_UINT16(CYGARC_REG_IPRA, iprX); + iprX &= ~CYGARC_REG_IPRA_TMU2_MASK; + iprX |= (level)*CYGARC_REG_IPRA_TMU2_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRA, iprX); + break; + case CYGNUM_HAL_INTERRUPT_RTC_ATI: + case CYGNUM_HAL_INTERRUPT_RTC_PRI: + case CYGNUM_HAL_INTERRUPT_RTC_CUI: + HAL_READ_UINT16(CYGARC_REG_IPRA, iprX); + iprX &= ~CYGARC_REG_IPRA_RTC_MASK; + iprX |= (level)*CYGARC_REG_IPRA_RTC_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRA, iprX); + break; + + /* IPRB */ + case CYGNUM_HAL_INTERRUPT_SCI_ERI: + case CYGNUM_HAL_INTERRUPT_SCI_RXI: + case CYGNUM_HAL_INTERRUPT_SCI_TXI: + case CYGNUM_HAL_INTERRUPT_SCI_TEI: + HAL_READ_UINT16(CYGARC_REG_IPRB, iprX); + iprX &= ~CYGARC_REG_IPRB_SCI_MASK; + iprX |= (level)*CYGARC_REG_IPRB_SCI_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRB, iprX); + break; + case CYGNUM_HAL_INTERRUPT_WDT_ITI: + HAL_READ_UINT16(CYGARC_REG_IPRB, iprX); + iprX &= ~CYGARC_REG_IPRB_WDT_MASK; + iprX |= (level)*CYGARC_REG_IPRB_WDT_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRB, iprX); + break; + case CYGNUM_HAL_INTERRUPT_REF_RCMI: + case CYGNUM_HAL_INTERRUPT_REF_ROVI: + HAL_READ_UINT16(CYGARC_REG_IPRB, iprX); + iprX &= ~CYGARC_REG_IPRB_REF_MASK; + iprX |= (level)*CYGARC_REG_IPRB_REF_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRB, iprX); + break; + + /* IPRC */ + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ0: + HAL_READ_UINT16(CYGARC_REG_IPRC, iprX); + iprX &= ~CYGARC_REG_IPRC_IRQ0_MASK; + iprX |= (level)*CYGARC_REG_IPRC_IRQ0_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRC, iprX); + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ1: + HAL_READ_UINT16(CYGARC_REG_IPRC, iprX); + iprX &= ~CYGARC_REG_IPRC_IRQ1_MASK; + iprX |= (level)*CYGARC_REG_IPRC_IRQ1_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRC, iprX); + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ2: + HAL_READ_UINT16(CYGARC_REG_IPRC, iprX); + iprX &= ~CYGARC_REG_IPRC_IRQ2_MASK; + iprX |= (level)*CYGARC_REG_IPRC_IRQ2_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRC, iprX); + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ3: + HAL_READ_UINT16(CYGARC_REG_IPRC, iprX); + iprX &= ~CYGARC_REG_IPRC_IRQ3_MASK; + iprX |= (level)*CYGARC_REG_IPRC_IRQ3_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRC, iprX); + break; + + /* IPRD */ + case CYGNUM_HAL_INTERRUPT_PINT_PINT07: + HAL_READ_UINT16(CYGARC_REG_IPRD, iprX); + iprX &= ~CYGARC_REG_IPRD_PINT07_MASK; + iprX |= (level)*CYGARC_REG_IPRD_PINT07_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRD, iprX); + break; + case CYGNUM_HAL_INTERRUPT_PINT_PINT8F: + HAL_READ_UINT16(CYGARC_REG_IPRD, iprX); + iprX &= ~CYGARC_REG_IPRD_PINT8F_MASK; + iprX |= (level)*CYGARC_REG_IPRD_PINT8F_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRD, iprX); + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ5: + HAL_READ_UINT16(CYGARC_REG_IPRD, iprX); + iprX &= ~CYGARC_REG_IPRD_IRQ5_MASK; + iprX |= (level)*CYGARC_REG_IPRD_IRQ5_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRD, iprX); + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ4: + HAL_READ_UINT16(CYGARC_REG_IPRD, iprX); + iprX &= ~CYGARC_REG_IPRD_IRQ4_MASK; + iprX |= (level)*CYGARC_REG_IPRD_IRQ4_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRD, iprX); + break; + + /* IPRE */ + case CYGNUM_HAL_INTERRUPT_DMAC_DEI0: + case CYGNUM_HAL_INTERRUPT_DMAC_DEI1: + case CYGNUM_HAL_INTERRUPT_DMAC_DEI2: + case CYGNUM_HAL_INTERRUPT_DMAC_DEI3: + HAL_READ_UINT16(CYGARC_REG_IPRE, iprX); + iprX &= ~CYGARC_REG_IPRE_DMAC_MASK; + iprX |= (level)*CYGARC_REG_IPRE_DMAC_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRE, iprX); + break; + case CYGNUM_HAL_INTERRUPT_IRDA_ERI1: + case CYGNUM_HAL_INTERRUPT_IRDA_RXI1: + case CYGNUM_HAL_INTERRUPT_IRDA_BRI1: + case CYGNUM_HAL_INTERRUPT_IRDA_TXI1: + HAL_READ_UINT16(CYGARC_REG_IPRE, iprX); + iprX &= ~CYGARC_REG_IPRE_IRDA_MASK; + iprX |= (level)*CYGARC_REG_IPRE_IRDA_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRE, iprX); + break; + case CYGNUM_HAL_INTERRUPT_SCIF_ERI2: + case CYGNUM_HAL_INTERRUPT_SCIF_RXI2: + case CYGNUM_HAL_INTERRUPT_SCIF_BRI2: + case CYGNUM_HAL_INTERRUPT_SCIF_TXI2: + HAL_READ_UINT16(CYGARC_REG_IPRE, iprX); + iprX &= ~CYGARC_REG_IPRE_SCIF_MASK; + iprX |= (level)*CYGARC_REG_IPRE_SCIF_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRE, iprX); + break; + case CYGNUM_HAL_INTERRUPT_ADC_ADI: + HAL_READ_UINT16(CYGARC_REG_IPRE, iprX); + iprX &= ~CYGARC_REG_IPRE_ADC_MASK; + iprX |= (level)*CYGARC_REG_IPRE_ADC_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRE, iprX); + break; + + /* IPRF */ + case CYGNUM_HAL_INTERRUPT_LCDC_LCDI: + HAL_READ_UINT16(CYGARC_REG_IPRF, iprX); + iprX &= ~CYGARC_REG_IPRF_LCDI_MASK; + iprX |= (level)*CYGARC_REG_IPRF_LCDI_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRF, iprX); + break; + case CYGNUM_HAL_INTERRUPT_PCC_PCC0: + HAL_READ_UINT16(CYGARC_REG_IPRF, iprX); + iprX &= ~CYGARC_REG_IPRF_PCC0_MASK; + iprX |= (level)*CYGARC_REG_IPRF_PCC0_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRF, iprX); + break; + case CYGNUM_HAL_INTERRUPT_PCC_PCC1: + HAL_READ_UINT16(CYGARC_REG_IPRF, iprX); + iprX &= ~CYGARC_REG_IPRF_PCC1_MASK; + iprX |= (level)*CYGARC_REG_IPRF_PCC1_PRI1; + HAL_WRITE_UINT16(CYGARC_REG_IPRF, iprX); + break; + + case CYGNUM_HAL_INTERRUPT_RESERVED_1E0: + case CYGNUM_HAL_INTERRUPT_RESERVED_3E0: + /* Do nothing for these reserved vectors. */ + break; + } +} + +void +hal_interrupt_mask(int vector) +{ + switch( (vector) ) { + case CYGNUM_HAL_INTERRUPT_NMI: + /* fall through */ + case CYGNUM_HAL_INTERRUPT_LVL0...CYGNUM_HAL_INTERRUPT_LVL14: + /* Can only be masked by fiddling Imask in SR. */ + break; + case CYGNUM_HAL_INTERRUPT_TMU0_TUNI0...CYGNUM_HAL_ISR_MAX: + HAL_INTERRUPT_SET_LEVEL((vector), 0); + break; + case CYGNUM_HAL_INTERRUPT_RESERVED_1E0: + case CYGNUM_HAL_INTERRUPT_RESERVED_3E0: + /* Do nothing for these reserved vectors. */ + break; + default: + CYG_FAIL("Unknown interrupt vector"); + break; + } +} + +void +hal_interrupt_unmask(int vector) +{ + switch( (vector) ) { + case CYGNUM_HAL_INTERRUPT_NMI: + /* fall through */ + case CYGNUM_HAL_INTERRUPT_LVL0...CYGNUM_HAL_INTERRUPT_LVL14: + /* Can only be unmasked by fiddling Imask in SR. */ + break; + case CYGNUM_HAL_INTERRUPT_TMU0_TUNI0...CYGNUM_HAL_ISR_MAX: + HAL_INTERRUPT_SET_LEVEL((vector), 1); + break; + case CYGNUM_HAL_INTERRUPT_RESERVED_1E0: + case CYGNUM_HAL_INTERRUPT_RESERVED_3E0: + /* Do nothing for these reserved vectors. */ + break; + default: + CYG_FAIL("Unknown interrupt vector"); + break; + } +} + +void +hal_interrupt_acknowledge(int vector) +{ + if ( (vector) >= CYGNUM_HAL_INTERRUPT_IRQ_IRQ0 + && (vector) <= CYGNUM_HAL_INTERRUPT_IRQ_IRQ5) { + + cyg_uint8 irr0; + + HAL_READ_UINT8(CYGARC_REG_IRR0, irr0); + switch ( vector ) { + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ0: + irr0 &= ~CYGARC_REG_IRR0_IRQ0; + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ1: + irr0 &= ~CYGARC_REG_IRR0_IRQ1; + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ2: + irr0 &= ~CYGARC_REG_IRR0_IRQ2; + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ3: + irr0 &= ~CYGARC_REG_IRR0_IRQ3; + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ4: + irr0 &= ~CYGARC_REG_IRR0_IRQ4; + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ5: + irr0 &= ~CYGARC_REG_IRR0_IRQ5; + break; + } + HAL_WRITE_UINT8(CYGARC_REG_IRR0, irr0); + } +} + +// Note: The PINTs can be masked and configured individually, even +// though there are only two vectors. Maybe add some fake vectors just +// for masking/configuring? +void +hal_interrupt_configure(int vector, int level, int up) +{ + if ( (vector) >= CYGNUM_HAL_INTERRUPT_IRQ_IRQ0 + && (vector) <= CYGNUM_HAL_INTERRUPT_IRQ_IRQ5) { + + cyg_uint16 icr1, ss, mask; + ss = 0; + mask = CYGARC_REG_ICR1_SENSE_UP|CYGARC_REG_ICR1_SENSE_LEVEL; + if (up) ss |= CYGARC_REG_ICR1_SENSE_UP; + if (level) ss |= CYGARC_REG_ICR1_SENSE_LEVEL; + CYG_ASSERT(!(up && level), "Cannot trigger on high level!"); + + switch( (vector) ) { + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ5: + ss <<= CYGARC_REG_ICR1_SENSE_IRQ5_shift; + mask <<= CYGARC_REG_ICR1_SENSE_IRQ5_shift; + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ4: + ss <<= CYGARC_REG_ICR1_SENSE_IRQ4_shift; + mask <<= CYGARC_REG_ICR1_SENSE_IRQ4_shift; + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ3: + ss <<= CYGARC_REG_ICR1_SENSE_IRQ3_shift; + mask <<= CYGARC_REG_ICR1_SENSE_IRQ3_shift; + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ2: + ss <<= CYGARC_REG_ICR1_SENSE_IRQ2_shift; + mask <<= CYGARC_REG_ICR1_SENSE_IRQ2_shift; + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ1: + ss <<= CYGARC_REG_ICR1_SENSE_IRQ1_shift; + mask <<= CYGARC_REG_ICR1_SENSE_IRQ1_shift; + break; + case CYGNUM_HAL_INTERRUPT_IRQ_IRQ0: + ss <<= CYGARC_REG_ICR1_SENSE_IRQ0_shift; + mask <<= CYGARC_REG_ICR1_SENSE_IRQ0_shift; + break; + } + + HAL_READ_UINT16(CYGARC_REG_ICR1, icr1); + icr1 &= ~mask; + icr1 |= ss; + HAL_WRITE_UINT16(CYGARC_REG_ICR1, icr1); + } +} + +//--------------------------------------------------------------------------- // End of hal_misc.c
--- a/packages/hal/sh/arch/current/src/vectors.S +++ b/packages/hal/sh/arch/current/src/vectors.S @@ -425,6 +425,7 @@ 1: mov #-5,r0 ! divide cause by 0x20 shld r0,r4 add #-14,r4 ! adjust so NMI becomes 0 + mov #CYGARC_SHREG_EVENT,r0 mov.l r4,@(r0,r8) ! store decoded vector number back ! to saved state.
--- a/packages/hal/v85x/arch/current/ChangeLog +++ b/packages/hal/v85x/arch/current/ChangeLog @@ -1,3 +1,9 @@ +2000-09-13 Jonathan Larmour <jlarmour@redhat.com> + + * src/vectors.S: When calling C functions, ensure there is 16 bytes + space for the parameter flushback area (as per the calling convention) + on the stack + 2000-09-07 Jonathan Larmour <jlarmour@redhat.com> * include/basetype.h: Don't need special alignment after all - it was
--- a/packages/hal/v85x/arch/current/src/vectors.S +++ b/packages/hal/v85x/arch/current/src/vectors.S @@ -116,7 +116,7 @@ 1: ld.w 0[r6],r1 bne 1b #endif // Initialize stack - lea __startup_stack,r1 + lea __startup_stack-16,r1 mov r1,sp // Clear BSS @@ -260,11 +260,18 @@ 20: st.w r6,CYGARC_REG_PC[ep] #endif do_exception: + // leave space for the parameter flush back area (as per calling + // conventions) + addi -16,sp,sp + mov sp,r6 jarl _exception_handler,r31 return_from_exception_or_interrupt: - mov sp,ep + // save sp, but remove space for the parameter flush back area + // (as per calling conventions) at the same time + addi 16,sp,ep + ld.w CYGARC_REG_PSW[ep],r7 sld.w CYGARC_REG_R1[ep],r1 ld.w CYGARC_REG_PC[ep],r6 @@ -321,6 +328,9 @@ 30: sld.w CYGARC_REG_R4[ep],r4 // Handle interrupt - these are typically vectored into user code do_interrupt: mov sp,ep // save pointer to regs frame + // leave space for the parameter flush back area (as per calling + // conventions) + addi -16,sp,sp #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK // Switch to interrupt stack @@ -331,9 +341,9 @@ do_interrupt: cmp 0,r7 // if was zero, switch stacks bne 10f mov sp,r1 // save old stack pointer - lea __interrupt_stack-4,r2 + lea __interrupt_stack-20,r2 mov r2,sp - st.w r1,0[sp] + st.w r1,16[sp] 10: #endif // CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK @@ -401,7 +411,9 @@ 10: st.w r8,0[r6] cmp 0,r8 bne 10f - ld.w 0[sp],sp // Restore non-interrupt stack at last interrupt + ld.w 16[sp],sp // Restore non-interrupt stack at last interrupt + // this is offset 16 because of parameter + // flush back area 10: #endif // CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
--- a/packages/io/eth/current/ChangeLog +++ b/packages/io/eth/current/ChangeLog @@ -1,3 +1,23 @@ +2000-09-14 Hugo Tyson <hmt@redhat.com> + + * cdl/eth_drivers.cdl: Add configury to control new features. All + is controlled globally by CYGPKG_IO_ETH_DRIVERS_SIMULATED_FAILURES + which is by default off, natch. + + * src/net/eth_drv.c (simulate_fail): Implement simulated failures + in ethernet packet delivery - independent tx and rx dropping and + rx packet corruption. Also a "line break" drop-all feature. + +2000-09-13 Gary Thomas <gthomas@redhat.com> + + * src/stand_alone/eth_drv.c: Take out noisy dump when out of buffers. + +2000-09-11 Hugo Tyson <hmt@cygnus.co.uk> + + * src/stand_alone/eth_drv.c (eth_drv_write): If we timeout waiting + for the write to complete, do reset the vectors to point to the + application, rather just a bald "return". + 2000-09-08 Hugo Tyson <hmt@cygnus.co.uk> * include/netdev.h (NETDEVTAB_ENTRY): Work around feature of new
--- a/packages/io/eth/current/cdl/eth_drivers.cdl +++ b/packages/io/eth/current/cdl/eth_drivers.cdl @@ -53,6 +53,51 @@ cdl_package CYGPKG_IO_ETH_DRIVERS { no_define default_value 1 compile net/eth_drv.c + + cdl_component CYGPKG_IO_ETH_DRIVERS_SIMULATED_FAILURES { + display "Simulate network failures for testing" + flavor bool + default_value 0 + description " + This package contains a suite of simulated failure modes + for the ethernet device layer, including dropping and/or + corrupting received packets, dropping packets queued for + transmission, and simulating a complete network break. + It requires the kernel as a source of time information." + + cdl_option CYGPKG_IO_ETH_DRIVERS_SIMULATE_DROP_RX { + display "Drop incoming packets (percentage)" + flavor booldata + legal_values 10 50 80 + default_value 10 + } + + cdl_option CYGPKG_IO_ETH_DRIVERS_SIMULATE_CORRUPT_RX { + display "Corrupt incoming packets (percentage)" + flavor booldata + legal_values 10 50 80 + default_value 10 + } + + cdl_option CYGPKG_IO_ETH_DRIVERS_SIMULATE_DROP_TX { + display "Drop outgoing packets (percentage)" + flavor booldata + legal_values 10 50 80 + default_value 10 + } + + cdl_option CYGPKG_IO_ETH_DRIVERS_SIMULATE_LINE_CUT { + display "Simulate a line cut from time to time" + flavor bool + default_value 0 + description " + This option causes the system to drop all packets for a + short random period (10s of seconds), and then act + normally for up to 4 times that long. This simulates your + sysadmin fiddling with plugs in the network switch + cupboard." + } + } } cdl_component CYGPKG_IO_ETH_DRIVERS_STAND_ALONE {
--- a/packages/io/eth/current/src/net/eth_drv.c +++ b/packages/io/eth/current/src/net/eth_drv.c @@ -82,9 +82,196 @@ #include <cyg/hal/drv_api.h> #include <pkgconf/hal.h> #include <cyg/hal/hal_if.h> +#include <pkgconf/io_eth_drivers.h> // module configury; SIMULATED_FAILURES + #include <eth_drv.h> #include <netdev.h> + + +// ------------------------------------------------------------------------ +#ifdef CYGPKG_IO_ETH_DRIVERS_SIMULATED_FAILURES + +#define noLOG_RANDOM 32 // so you can tell this is really being random +#ifdef LOG_RANDOM +static struct { + unsigned int *which; + unsigned int random; + unsigned int r100; +} random_log[LOG_RANDOM]; + +static int random_index = 0; +#endif + +static unsigned int +randomize( unsigned int *p ) +{ + unsigned int r100; + HAL_CLOCK_READ( &r100 ); + r100 ^= *p; + *p = (r100 * 1103515245) + 12345; + r100 &= 127; + if ( r100 >= 100 ) // spread the overflow around evenly + r100 = 4 * (r100 - 100); + if ( r100 >= 100 ) // and again - (125,126,127=>100,104,108) + r100 = 12 * (r100 - 100); // =>(0,48,96) +#ifdef LOG_RANDOM + random_log[random_index].which = p; + random_log[random_index].random = *p; + random_log[random_index].r100 = r100; + random_index++; + random_index &= (LOG_RANDOM-1); +#endif + return r100; +} + +#define SIMULATE_FAIL_SEND 1 +#define SIMULATE_FAIL_RECV 2 +#define SIMULATE_FAIL_CORRUPT 3 + +static struct simulated_failure_state { + struct eth_drv_sc *sc; + unsigned int r_tx_fail; + unsigned int r_rx_fail; + unsigned int r_rx_corrupt; + cyg_tick_count_t droptime; + cyg_tick_count_t passtime; +} simulated_failure_states[2] = {{0},{0}}; + +static int +simulate_fail( struct eth_drv_sc *sc, int which ) +{ + struct simulated_failure_state *s; + + for ( s = &simulated_failure_states[0]; s < &simulated_failure_states[2]; + s++ ) { + if ( 0 == s->sc ) { + s->sc = sc; + s->r_tx_fail = (unsigned int)sc; + s->r_rx_fail = (unsigned int)sc ^ 0x01234567; + s->r_rx_corrupt = (unsigned int)sc ^ 0xdeadbeef; + s->droptime = 0; + s->passtime = 0; + } + if ( sc == s->sc ) + break; + } + if ( &simulated_failure_states[2] == s ) { + CYG_FAIL( "No free slot in simulated_failure_states[]" ); + return 1; // always fail + } + +#ifdef CYGPKG_IO_ETH_DRIVERS_SIMULATE_LINE_CUT + // Regardless of the question, we say "yes" during the period of + // unpluggedness... + { + cyg_tick_count_t now = cyg_current_time(); + if ( now > s->droptime && 0 == s->passtime ) { // [initial condition] + s->droptime = 0; // go into a passing phase + (void)randomize( &s->r_tx_fail ); + (void)randomize( &s->r_rx_fail ); + (void)randomize( &s->r_rx_corrupt ); + s->passtime = s->r_tx_fail + s->r_rx_fail + s->r_rx_corrupt; + s->passtime &= 0x3fff; // 16k cS is up to 160S, about 2.5 minutes + s->passtime += now; + } + else if ( now > s->passtime && 0 == s->droptime ) { + s->passtime = 0; // go into a dropping phase + (void)randomize( &s->r_tx_fail ); + (void)randomize( &s->r_rx_fail ); + (void)randomize( &s->r_rx_corrupt ); + s->droptime = s->r_tx_fail + s->r_rx_fail + s->r_rx_corrupt; + s->droptime &= 0x0fff; // 4k cS is up to 40S, about 1/2 a minute + s->droptime += now; + } + + if ( now < s->droptime ) + return 1; // Say "no" + } +#endif + + switch ( which ) { +#ifdef CYGPKG_IO_ETH_DRIVERS_SIMULATE_DROP_TX + case SIMULATE_FAIL_SEND: { + unsigned int z = randomize( &s->r_tx_fail ); + return z < CYGPKG_IO_ETH_DRIVERS_SIMULATE_DROP_TX; + } +#endif +#ifdef CYGPKG_IO_ETH_DRIVERS_SIMULATE_DROP_RX + case SIMULATE_FAIL_RECV: { + unsigned int z = randomize( &s->r_rx_fail ); + return z < CYGPKG_IO_ETH_DRIVERS_SIMULATE_DROP_RX; + } +#endif +#ifdef CYGPKG_IO_ETH_DRIVERS_SIMULATE_CORRUPT_RX + case SIMULATE_FAIL_CORRUPT: { + unsigned int z = randomize( &s->r_rx_corrupt ); + return z < CYGPKG_IO_ETH_DRIVERS_SIMULATE_CORRUPT_RX; + } +#endif + default: + // do nothing - for when options above are not enabled. + } + return 0; +} + +#define noLOG_CORRUPTION 32 // so you can tell this is really being random +#ifdef LOG_CORRUPTION +static struct { + int len; + int thislen; + int off; + unsigned char xor; + unsigned char idx; +} corruption_log[LOG_CORRUPTION]; + +static int corruption_index = 0; +#endif + +static void +simulate_fail_corrupt_sglist( struct eth_drv_sg *sg_list, int sg_len ) +{ + unsigned int z, len, i, off; + HAL_CLOCK_READ( &z ); + z += simulated_failure_states[0].r_rx_corrupt; + z += simulated_failure_states[1].r_rx_corrupt; + + CYG_ASSERT( MAX_ETH_DRV_SG >= sg_len, "sg_len overflow in corrupt" ); + + for ( i = 0, len = 0; i < sg_len && sg_list[i].buf && sg_list[i].len; i++ ) + len =+ sg_list[i].len; + + CYG_ASSERT( 1500 >= len, "sg...len > ether MTU" ); + if ( 14 >= len ) // normal ether header + return; + + off = z & 2047; // next (2^N-1) > MTU + while ( off > len ) + off -= len; + + for ( i = 0; i < sg_len && sg_list[i].buf && sg_list[i].len; i++ ) { + if ( off < sg_list[i].len ) { // corrupt this one + unsigned char *p = (unsigned char *)sg_list[i].buf; + p[off] ^= (0xff & (z >> 11)); +#ifdef LOG_CORRUPTION + corruption_log[corruption_index].len = len; + corruption_log[corruption_index].thislen = sg_list[i].len; + corruption_log[corruption_index].off = off; + corruption_log[corruption_index].xor = (0xff & (z >> 11)); + corruption_log[corruption_index].idx = i; + corruption_index++; + corruption_index &= (LOG_CORRUPTION-1); +#endif + return; + } + off -= sg_list[i].len; + } + CYG_FAIL( "Didn't corrupt anything" ); +} + +#endif // CYGPKG_IO_ETH_DRIVERS_SIMULATED_FAILURES +// ------------------------------------------------------------------------ + static int eth_drv_ioctl(struct ifnet *, u_long, caddr_t); static void eth_drv_send(struct ifnet *); @@ -309,6 +496,14 @@ eth_drv_send(struct ifnet *ifp) break; } +#ifdef CYGPKG_IO_ETH_DRIVERS_SIMULATED_FAILURES + if ( simulate_fail( sc, SIMULATE_FAIL_SEND ) ) { + // must free the mbufs + m_freem(m0); + continue; // next packet to send + } +#endif + if (net_debug) diag_printf("Sending %d bytes\n", m0->m_pkthdr.len); @@ -398,6 +593,15 @@ eth_drv_recv(struct eth_drv_sc *sc, int // Our arithmetic below would go wrong return; +#ifdef CYGPKG_IO_ETH_DRIVERS_SIMULATED_FAILURES + if ( simulate_fail( sc, SIMULATE_FAIL_RECV ) ) { + // there is nothing we need to do; simply do not + // unload the packet + ifp->if_ierrors++; + return; + } +#endif + /* Pull packet off interface. */ MGETHDR(m, M_DONTWAIT, MT_DATA); if (m == 0) { @@ -462,6 +666,13 @@ eth_drv_recv(struct eth_drv_sc *sc, int // Ask hardware to unload buffers (sc->funs->recv)(sc, sg_list, sg_len); +#ifdef CYGPKG_IO_ETH_DRIVERS_SIMULATED_FAILURES + if ( simulate_fail( sc, SIMULATE_FAIL_CORRUPT ) ) { + // Corrupt the data + simulate_fail_corrupt_sglist( sg_list, sg_len ); + } +#endif + if (net_debug) { for (i = 0; i < sg_len; i++) { if (sg_list[i].buf) {
--- a/packages/io/eth/current/src/stand_alone/eth_drv.c +++ b/packages/io/eth/current/src/stand_alone/eth_drv.c @@ -239,7 +239,8 @@ eth_drv_write(char *eth_hdr, char *buf, // Give driver a chance to service hardware (sc->funs->poll)(sc); CYGACC_CALL_IF_DELAY_US(2*100000); - if (--wait_time <= 0) return; // Give up on sending packet + if (--wait_time <= 0) + goto reset_and_out; // Give up on sending packet } sg_list[0].buf = (CYG_ADDRESS)eth_hdr; @@ -260,7 +261,7 @@ eth_drv_write(char *eth_hdr, char *buf, while (!packet_sent) { (sc->funs->poll)(sc); } - + reset_and_out: if (dbg) { // if (!old_state & ETH_DRV_STATE_ACTIVE) { // // This interface was not fully initialized, shut it back down @@ -419,8 +420,10 @@ eth_drv_recv(struct eth_drv_sc *sc, int if (msg) { msg->len = total_len; eth_drv_msg_put(ð_msg_full, msg); +#ifdef CYGSEM_IO_ETH_DRIVERS_WARN } else { dump_buf(sg_list[0].buf, sg_list[0].len); +#endif } }
--- a/packages/io/fileio/current/ChangeLog +++ b/packages/io/fileio/current/ChangeLog @@ -1,3 +1,9 @@ +2000-09-18 Jonathan Larmour <jlarmour@redhat.com> + + * src/select.cxx: Apply constructor prioritization to mutexes and + condition variables + * src/fd.cxx: Ditto + 2000-09-11 Jonathan Larmour <jlarmour@redhat.com> * tests/select.c: NA if no POSIX package
--- a/packages/io/fileio/current/src/fd.cxx +++ b/packages/io/fileio/current/src/fd.cxx @@ -60,13 +60,14 @@ // File data structures // Mutex for controlling access to file desriptor arrays -Cyg_Mutex fdlock; +Cyg_Mutex fdlock CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_IO); // Array of open file objects static cyg_file file[CYGNUM_FILEIO_NFILE]; // Array of per-file mutexes -static Cyg_Mutex file_lock[CYGNUM_FILEIO_NFILE]; +static Cyg_Mutex file_lock[CYGNUM_FILEIO_NFILE] \ + CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_IO); // Descriptor array static cyg_file *desc[CYGNUM_FILEIO_NFD];
--- a/packages/io/fileio/current/src/select.cxx +++ b/packages/io/fileio/current/src/select.cxx @@ -78,14 +78,14 @@ // Mutex for serializing select processing. This essntially controls // access to the contents of the selinfo structures embedded in the // client system data structures. -static Cyg_Mutex select_mutex; +static Cyg_Mutex select_mutex CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_IO); // Condition variable where any thread that is waiting for a select to // fire is suspended. Note that select is not intended to be a real time // operation. Whenever any selectable event occurs, all selecting threads // will be resumed. They must then rescan their selectees and resuspend if // necessary. -static Cyg_Condition_Variable selwait( select_mutex ); +static Cyg_Condition_Variable selwait( select_mutex ) CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_IO); static volatile cyg_uint32 selwake_count = 0;
--- a/packages/io/pcmcia/current/ChangeLog +++ b/packages/io/pcmcia/current/ChangeLog @@ -1,3 +1,9 @@ +2000-09-17 Gary Thomas <gthomas@redhat.com> + + * include/pcmcia.h: + * src/pcmcia.c (cf_register_handler): Interrupt handler must look + just like a DSR and will be called using the same calling conventions. + 2000-08-23 Gary Thomas <gthomas@redhat.com> * src/pcmcia.c:
--- a/packages/io/pcmcia/current/include/pcmcia.h +++ b/packages/io/pcmcia/current/include/pcmcia.h @@ -52,7 +52,7 @@ #include <cyg/hal/drv_api.h> struct cf_irq_handler { - void (*handler)(void *); + void (*handler)(int, int, void *); void *param; }; @@ -115,7 +115,7 @@ bool cf_parse_cftable(unsigned char *buf bool cf_parse_config(unsigned char *buf, int len, struct cf_config *config); struct cf_slot *cf_get_slot(int indx); void cf_change_state(struct cf_slot *slot, int desired_state); -void cf_register_handler(struct cf_slot *, void (*handler)(void *), void *); +void cf_register_handler(struct cf_slot *, void (*handler)(int, int, void *), void *); void cf_clear_interrupt(struct cf_slot *); void cf_init(void);
--- a/packages/io/pcmcia/current/src/pcmcia.c +++ b/packages/io/pcmcia/current/src/pcmcia.c @@ -277,7 +277,7 @@ cf_change_state(struct cf_slot *slot, in // void cf_register_handler(struct cf_slot *slot, - void (*handler)(void *), + void (*handler)(int, int, void *), void *param) { slot->irq_handler.handler = handler;
--- a/packages/io/serial/current/ChangeLog +++ b/packages/io/serial/current/ChangeLog @@ -1,3 +1,18 @@ +2000-09-18 Jesper Skov <jskov@redhat.com> + + * cdl/io_serial.cdl: Added interfaces to allow test tweaking. + * tests/ser_test_protocol.inl: Use interfaces. Moved PID details + to PID serial package. + +2000-09-15 Jesper Skov <jskov@redhat.com> + + * tests/ser_test_protocol.inl: Allow drivers to define testing + parameters via CDL. + +2000-09-13 Jesper Skov <jskov@redhat.com> + + * include/serial.h (SERIAL_CALLBACKS): Fix typo. + 2000-09-06 Jesper Skov <jskov@redhat.com> * tests/ser_test_protocol.inl: Renamed some option names due to SH
--- a/packages/io/serial/current/cdl/io_serial.cdl +++ b/packages/io/serial/current/cdl/io_serial.cdl @@ -304,6 +304,49 @@ cdl_package CYGPKG_IO_SERIAL { serial devices." } + + cdl_component CYGPKG_IO_SERIAL_TEST_SPECS { + display "Serial testing specification" + flavor bool + calculated 1 + no_define + + cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_9600 { + display "Skip 9600 baud testing" + } + + cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_14400 { + display "Skip 14400 baud testing" + } + + cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_19200 { + display "Skip 19200 baud testing" + } + + cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_38400 { + display "Skip 38400 baud testing" + } + + cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_57600 { + display "Skip 57600 baud testing" + } + + cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_115200 { + display "Skip 115200 baud testing" + } + + cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_PARITY_EVEN { + display "Skip even-parity testing" + } + + cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_PARITY_ODD { + display "Skip odd-parity testing" + } + + cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_STOP_2 { + display "Skip 2-stop bit testing" + } + } } # EOF io_serial.cdl
--- a/packages/io/serial/current/include/serial.h +++ b/packages/io/serial/current/include/serial.h @@ -95,7 +95,7 @@ serial_callbacks_t _l = { _data_rcv_req, \ _data_rcv_done, \ _data_xmt_req, \ - _data_xmt_done \ + _data_xmt_done, \ _indicate_status \ }; # else
--- a/packages/io/serial/current/tests/ser_test_protocol.inl +++ b/packages/io/serial/current/tests/ser_test_protocol.inl @@ -67,6 +67,15 @@ #define NA_MSG "No test device specified" +// Cleaned up drivers will export the testing parameters via CDL. +// When all drivers are changed, replace the TEST_ macros throughout +// with the CYGPRI_ equivalents. +#ifdef CYGPRI_SER_TEST_CRASH_ID +# define TEST_CRASH_ID CYGPRI_SER_TEST_CRASH_ID +# define TEST_SER_DEV CYGPRI_SER_TEST_SER_DEV +# define TEST_TTY_DEV CYGPRI_SER_TEST_TTY_DEV +#endif + #if defined(CYGPKG_HAL_POWERPC_COGENT) \ && defined(CYGPKG_IO_SERIAL_POWERPC_COGENT) \ && defined(CYGPKG_IO_SERIAL_POWERPC_COGENT_SERIAL_B) @@ -86,15 +95,6 @@ # define TEST_TTY_DEV CYGDAT_IO_SERIAL_TTY_TTY1_DEV # endif #endif -#if defined(CYGPKG_HAL_ARM_PID) \ - && defined(CYGPKG_IO_SERIAL_ARM_PID) \ - && defined(CYGPKG_IO_SERIAL_ARM_PID_SERIAL0) -# define TEST_CRASH_ID "armpid" -# define TEST_SER_DEV CYGDAT_IO_SERIAL_ARM_PID_SERIAL0_NAME -# if defined(CYGPKG_IO_SERIAL_TTY_TTY0) -# define TEST_TTY_DEV CYGDAT_IO_SERIAL_TTY_TTY0_DEV -# endif -#endif #if defined(CYGPKG_HAL_ARM_AEB) \ && defined(CYGPKG_IO_SERIAL_ARM_AEB) \ && defined(CYGPKG_IO_SERIAL_ARM_AEB_SERIAL1) @@ -385,30 +385,37 @@ typedef enum { // A few predefined configurations. These must all be valid for any // given target until change_config is behaving correctly. cyg_ser_cfg_t test_configs[] = { -#if !defined(CYGPKG_HAL_MIPS_TX39_JMR3904) && !defined(CYGPKG_HAL_ARM_PID) +#if (0 == CYGINT_IO_SERIAL_TEST_SKIP_9600) +#if !defined(CYGPKG_HAL_MIPS_TX39_JMR3904) { CYGNUM_SERIAL_BAUD_9600, CYGNUM_SERIAL_WORD_LENGTH_8, CYGNUM_SERIAL_STOP_1, CYGNUM_SERIAL_PARITY_NONE, CYGNUM_SERIAL_FLOW_NONE }, #endif +#endif +#if (0 == CYGINT_IO_SERIAL_TEST_SKIP_14400) #if !defined(CYGPKG_HAL_MN10300_AM31) && \ !defined(CYGPKG_HAL_MN10300_AM33) { CYGNUM_SERIAL_BAUD_14400, CYGNUM_SERIAL_WORD_LENGTH_8, CYGNUM_SERIAL_STOP_1, CYGNUM_SERIAL_PARITY_NONE, CYGNUM_SERIAL_FLOW_NONE }, #endif +#endif { CYGNUM_SERIAL_BAUD_19200, CYGNUM_SERIAL_WORD_LENGTH_8, CYGNUM_SERIAL_STOP_1, CYGNUM_SERIAL_PARITY_NONE, CYGNUM_SERIAL_FLOW_NONE }, +#if (0 == CYGINT_IO_SERIAL_TEST_SKIP_38400) #if !defined(CYGPKG_HAL_SPARCLITE_SLEB) && \ !defined(CYGPKG_HAL_ARM_AEB) { CYGNUM_SERIAL_BAUD_38400, CYGNUM_SERIAL_WORD_LENGTH_8, CYGNUM_SERIAL_STOP_1, CYGNUM_SERIAL_PARITY_NONE, CYGNUM_SERIAL_FLOW_NONE }, #endif +#endif +#if (0 == CYGINT_IO_SERIAL_TEST_SKIP_57600) #if !defined(CYGPKG_HAL_MIPS_TX39_JMR3904) && \ !defined(CYGPKG_HAL_ARM_AEB) && \ !defined(CYGPKG_HAL_SPARCLITE_SLEB) && \ @@ -417,9 +424,10 @@ cyg_ser_cfg_t test_configs[] = { CYGNUM_SERIAL_STOP_1, CYGNUM_SERIAL_PARITY_NONE, CYGNUM_SERIAL_FLOW_NONE }, #endif +#endif +#if (0 == CYGINT_IO_SERIAL_TEST_SKIP_115200) #if !defined(CYGPKG_HAL_MIPS_TX39_JMR3904) && \ - !defined(CYGPKG_HAL_ARM_PID) && \ !defined(CYGPKG_HAL_ARM_AEB) && \ !defined(CYGPKG_HAL_MN10300_STDEVAL1) && \ !defined(CYGPKG_HAL_ARM_CMA230) && \ @@ -429,31 +437,38 @@ cyg_ser_cfg_t test_configs[] = { CYGNUM_SERIAL_STOP_1, CYGNUM_SERIAL_PARITY_NONE, CYGNUM_SERIAL_FLOW_NONE }, #endif +#endif +#if (0 == CYGINT_IO_SERIAL_TEST_SKIP_PARITY_EVEN) #if !defined(CYGPKG_HAL_MIPS_TX39_JMR3904) && \ - !defined(CYGPKG_HAL_ARM_AEB) && \ - !defined(CYGPKG_HAL_ARM_PID) + !defined(CYGPKG_HAL_ARM_AEB) // One stop bit, even parity { CYGNUM_SERIAL_BAUD_19200, CYGNUM_SERIAL_WORD_LENGTH_8, CYGNUM_SERIAL_STOP_1, CYGNUM_SERIAL_PARITY_EVEN, CYGNUM_SERIAL_FLOW_NONE }, #endif +#endif +#if (0 == CYGINT_IO_SERIAL_TEST_SKIP_PARITY_EVEN) +#if (0 == CYGINT_IO_SERIAL_TEST_SKIP_STOP_2) #if !defined(CYGPKG_HAL_MIPS_TX39_JMR3904) && \ - !defined(CYGPKG_HAL_ARM_AEB) && \ - !defined(CYGPKG_HAL_ARM_PID) + !defined(CYGPKG_HAL_ARM_AEB) // Two stop bits, even parity { CYGNUM_SERIAL_BAUD_19200, CYGNUM_SERIAL_WORD_LENGTH_8, CYGNUM_SERIAL_STOP_2, CYGNUM_SERIAL_PARITY_EVEN, CYGNUM_SERIAL_FLOW_NONE }, #endif +#endif +#endif +#if (0 == CYGINT_IO_SERIAL_TEST_SKIP_STOP_2) #if !defined(CYGPKG_HAL_MIPS_TX39_JMR3904) // Two stop bits, no parity { CYGNUM_SERIAL_BAUD_19200, CYGNUM_SERIAL_WORD_LENGTH_8, CYGNUM_SERIAL_STOP_2, CYGNUM_SERIAL_PARITY_NONE, CYGNUM_SERIAL_FLOW_NONE }, #endif +#endif }; //---------------------------------------------------------------------------- @@ -1149,7 +1164,7 @@ test_options(cyg_io_handle_t handle, int void test_open_ser( cyg_io_handle_t* handle ) { -#ifndef SER_NOP_TEST +#if defined(CYGPKG_IO_SERIAL_DEVICES) && !defined(SER_NOP_TEST) Cyg_ErrNo res; if (cyg_test_is_simulator) @@ -1176,7 +1191,7 @@ test_open_ser( cyg_io_handle_t* handle ) void test_open_tty( cyg_io_handle_t* handle ) { -#ifndef TTY_NOP_TEST +#if defined(CYGPKG_IO_SERIAL_TTY) && !defined(TTY_NOP_TEST) Cyg_ErrNo res; if (cyg_test_is_simulator)
--- a/packages/kernel/current/ChangeLog +++ b/packages/kernel/current/ChangeLog @@ -1,3 +1,19 @@ +2000-09-13 Jesper Skov <jskov@redhat.com> + + * tests/kexcept1.c (cause_exception): Use separate cause_fpe function. + * tests/except1.cxx (cause_exception): Same. + + * tests/kexcept1.c (cause_exception): Do not use division at all. + * tests/except1.cxx (cause_exception): Same. + + * tests/kexcept1.c (cause_exception): Do not cause div-by-zero. + * tests/except1.cxx (cause_exception): Same. + +2000-09-11 Jonathan Larmour <jlarmour@redhat.com> + + * cdl/instrument.cdl (CYGVAR_KERNEL_INSTRUMENT_EXTERNAL_BUFFER): + Bring this option back from the dead + 2000-09-08 Nick Garnett <nickg@cygnus.co.uk> * include/sched.hxx:
--- a/packages/kernel/current/cdl/instrument.cdl +++ b/packages/kernel/current/cdl/instrument.cdl @@ -40,6 +40,19 @@ # # ==================================================================== +cdl_option CYGVAR_KERNEL_INSTRUMENT_EXTERNAL_BUFFER { + display "Use buffer provided by the application" + flavor bool + default_value 0 + description " + In most circumstances the kernel should provide the + instrumentation circular buffer itself. Occasionally + application code may wish to provide the buffer instead, + giving the application code more convenient access to the + buffer. This also makes it possible to put the circular + buffer in special areas of memory, for example a region that + is shared with the host." +} cdl_option CYGNUM_KERNEL_INSTRUMENT_BUFFER_SIZE { display "Size of instrumentation buffer size"
--- a/packages/kernel/current/tests/except1.cxx +++ b/packages/kernel/current/tests/except1.cxx @@ -93,15 +93,35 @@ static void handler1(CYG_ADDRWORD data, // hacky ways. It is machine dependent what exception is generated. // It does reads rather than writes hoping not to corrupt anything // important. +static int +cause_fpe(int num) +{ + double a; + + a = 1.0/num; // Depending on FPU emulation and/or + // the FPU architecture, this may + // cause an exception. + // (float division by zero) + + return ((int)a)/num; // This may cause an exception if + // the architecture supports it. + // (integer division by zero). +} // cause_fpe() + void cause_exception(void) { int x; unsigned int p=0; + // First try for an address exception (unaligned access exception + // or SEGV/BUS exceptions) do { - x=*(volatile int *)(p-1)/p; + x=*(volatile int *)(p-1); p+=0x100000; } while(p != 0); + + // Next try an integer or floating point divide-by-zero exception. + cause_fpe(0); } #endif @@ -186,6 +206,7 @@ void except0_main( void ) // Use CYG_TEST_GDBCMD _before_ CYG_TEST_INIT() CYG_TEST_GDBCMD("handle SIGBUS nostop"); CYG_TEST_GDBCMD("handle SIGSEGV nostop"); + CYG_TEST_GDBCMD("handle SIGFPE nostop"); CYG_TEST_INIT(); @@ -203,6 +224,15 @@ void except0_main( void ) #ifdef CYGNUM_HAL_EXCEPTION_ILLEGAL_INSTRUCTION HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_ILLEGAL_INSTRUCTION, NULL ); #endif +#ifdef CYGNUM_HAL_EXCEPTION_DIV_BY_ZERO + HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_DIV_BY_ZERO, NULL ); +#endif +#ifdef CYGNUM_HAL_EXCEPTION_FPU + HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_FPU, NULL ); +#endif +#ifdef CYGNUM_HAL_EXCEPTION_FPU_DIV_BY_ZERO + HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_FPU_DIV_BY_ZERO, NULL ); +#endif #endif new_thread(entry0, 0);
--- a/packages/kernel/current/tests/kexcept1.c +++ b/packages/kernel/current/tests/kexcept1.c @@ -98,15 +98,35 @@ static void handler1(cyg_addrword_t data // hacky ways. It is machine dependent what exception is generated. // It does reads rather than writes hoping not to corrupt anything // important. +static int +cause_fpe(int num) +{ + double a; + + a = 1.0/num; // Depending on FPU emulation and/or + // the FPU architecture, this may + // cause an exception. + // (float division by zero) + + return ((int)a)/num; // This may cause an exception if + // the architecture supports it. + // (integer division by zero). +} // cause_fpe() + void cause_exception(void) { int x; unsigned int p=0; + // First try for an address exception (unaligned access exception + // or SEGV/BUS exceptions) do { - x=*(volatile int *)(p-1)/p; + x=*(volatile int *)(p-1); p+=0x100000; } while(p != 0); + + // Next try an integer or floating point divide-by-zero exception. + cause_fpe(0); } #endif @@ -191,6 +211,7 @@ void except0_main( void ) // Use CYG_TEST_GDBCMD _before_ CYG_TEST_INIT() CYG_TEST_GDBCMD("handle SIGBUS nostop"); CYG_TEST_GDBCMD("handle SIGSEGV nostop"); + CYG_TEST_GDBCMD("handle SIGFPE nostop"); CYG_TEST_INIT(); @@ -208,6 +229,15 @@ void except0_main( void ) #ifdef CYGNUM_HAL_EXCEPTION_ILLEGAL_INSTRUCTION HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_ILLEGAL_INSTRUCTION, NULL ); #endif +#ifdef CYGNUM_HAL_EXCEPTION_DIV_BY_ZERO + HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_DIV_BY_ZERO, NULL ); +#endif +#ifdef CYGNUM_HAL_EXCEPTION_FPU + HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_FPU, NULL ); +#endif +#ifdef CYGNUM_HAL_EXCEPTION_FPU_DIV_BY_ZERO + HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_FPU_DIV_BY_ZERO, NULL ); +#endif #endif cyg_thread_create(4, entry0 , (cyg_addrword_t)0, "kexcept1",
--- a/packages/language/c/libc/signals/current/ChangeLog +++ b/packages/language/c/libc/signals/current/ChangeLog @@ -1,3 +1,8 @@ +2000-09-14 Jesper Skov <jskov@redhat.com> + + * tests/signal/signal2.c: Prevent that GCC optimizes away the + cause_fpe call. + 2000-09-07 Jesper Skov <jskov@redhat.com> * tests/signal2.c: Fix compiler warning. Also reset FPU exception
--- a/packages/language/c/libc/signals/current/tests/signal2.c +++ b/packages/language/c/libc/signals/current/tests/signal2.c @@ -119,8 +119,11 @@ cause_fpe(int num) // (integer division by zero). } // cause_fpe() +volatile int tmp; + #endif + int main( int argc, char *argv[] ) { @@ -265,7 +268,9 @@ main( int argc, char *argv[] ) #else if (0==setjmp(jbuf)) { - (void)cause_fpe(0); + // It is necessary to save the return value in a volatile + // variable, or GCC will get rid of the call. + tmp = cause_fpe(0); CYG_TEST_FAIL("Didn't cause exception"); }
--- a/packages/language/c/libm/current/ChangeLog +++ b/packages/language/c/libm/current/ChangeLog @@ -1,3 +1,8 @@ +2000-09-11 Jonathan Larmour <jlarmour@redhat.com> + + * src/misc/infconst.c: Revert below two changes - the gcc problem + that provoked it is now fixed. + 2000-09-01 Jonathan Larmour <jlarmour@redhat.com> * src/misc/infconst.c: Silence warning about number of brackets
--- a/packages/language/c/libm/current/include/math.h +++ b/packages/language/c/libm/current/include/math.h @@ -67,7 +67,7 @@ // HUGE_VAL is a positive double (not necessarily representable as a float) // representing infinity as specified in ANSI 7.5. cyg_libm_infinity is // defined further down -#define HUGE_VAL (cyg_libm_infinity[0].value) +#define HUGE_VAL (cyg_libm_infinity.value) #ifndef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION @@ -103,7 +103,7 @@ struct exception { // GLOBALS -externC const Cyg_libm_ieee_double_shape_type cyg_libm_infinity[]; +externC const Cyg_libm_ieee_double_shape_type cyg_libm_infinity; //=========================================================================== // FUNCTION PROTOTYPES
--- a/packages/language/c/libm/current/src/misc/infconst.c +++ b/packages/language/c/libm/current/src/misc/infconst.c @@ -62,11 +62,11 @@ #if (CYG_BYTEORDER == CYG_MSBFIRST) // Big endian -const Cyg_libm_ieee_double_shape_type cyg_libm_infinity[] = { { {0x7ff00000, 0} } }; +const Cyg_libm_ieee_double_shape_type cyg_libm_infinity = { {0x7ff00000, 0} }; #else // Little endian -const Cyg_libm_ieee_double_shape_type cyg_libm_infinity[] = { { {0, 0x7ff00000} } }; +const Cyg_libm_ieee_double_shape_type cyg_libm_infinity = { {0, 0x7ff00000} }; #endif
--- a/packages/net/tcpip/current/ChangeLog +++ b/packages/net/tcpip/current/ChangeLog @@ -1,3 +1,18 @@ +2000-09-14 Hugo Tyson <hmt@redhat.com> + + * cdl/net.cdl (CYGOPT_NET_DHCP_DHCP_THREAD_PARAM): Set default to + 1 so that the DHCP management thread loops forever. This allows + it to recover from a DHCP renewal failure. + + * src/lib/dhcp_prot.c (next_timeout): Harden the DHCP protocol + machine against [simulated] failures - otherwise the tests with + simulated failures tend just to close down all the interfaces when + DHCP packets are lost. + +2000-09-11 Gary Thomas <gthomas@redhat.com> + + * src/lib/bootp_support.c (init_net): Set default route correctly. + 2000-09-01 Hugo Tyson <hmt@cygnus.co.uk> * src/ecos/support.c (cyg_net_init): You can't print things while
--- a/packages/net/tcpip/current/cdl/net.cdl +++ b/packages/net/tcpip/current/cdl/net.cdl @@ -249,7 +249,7 @@ cdl_package CYGPKG_NET { cdl_option CYGOPT_NET_DHCP_DHCP_THREAD_PARAM { display "DHCP management thread loops forever" flavor data - default_value 0 + default_value 1 active_if CYGOPT_NET_DHCP_DHCP_THREAD description " If the parameter is nonzero, it loops forever; if zero,
--- a/packages/net/tcpip/current/src/lib/bootp_support.c +++ b/packages/net/tcpip/current/src/lib/bootp_support.c @@ -463,6 +463,7 @@ init_net(const char *intf, struct bootp memset(&route, 0, sizeof(route)); addrp->sin_family = AF_INET; addrp->sin_port = 0; + addrp->sin_len = sizeof(*addrp); addrp->sin_addr.s_addr = 0; // Use 0,0,GATEWAY for the default route memcpy(&route.rt_dst, addrp, sizeof(*addrp)); addrp->sin_addr.s_addr = 0;
--- a/packages/net/tcpip/current/src/lib/dhcp_prot.c +++ b/packages/net/tcpip/current/src/lib/dhcp_prot.c @@ -226,21 +226,40 @@ bring_half_up(const char *intf, struct i // ------------------------------------------------------------------------ // DHCP retransmission timeouts and number of tries +// +// To work better with simulated failures (or real ones!) so that the rest +// of the system is tested, rather than DHCP renewal failures pulling +// everything down, we try a little more zealously than the RFC suggests. static unsigned char timeout_random = 0; -static inline void reset_timeout( struct timeval *ptv ) +struct timeout_state { + unsigned int secs; + int countdown; +}; + +static inline void reset_timeout( struct timeval *ptv, struct timeout_state *pstate ) { timeout_random++; - ptv->tv_sec = 3 + (timeout_random & 3); - ptv->tv_usec = 65536 * (timeout_random & 15); + pstate->countdown = 4; // initial fast retries + pstate->secs = 3 + (timeout_random & 3); + ptv->tv_sec = 0; + ptv->tv_usec = 65536 * (2 + (timeout_random & 3)); // 0.1 - 0.3S, about } -static inline int next_timeout( struct timeval *ptv ) +static inline int next_timeout( struct timeval *ptv, struct timeout_state *pstate ) { - timeout_random++; - ptv->tv_sec = ptv->tv_sec * 2 - 2 + (timeout_random & 3); - return ptv->tv_sec < 48; // If longer, too many tries... + if ( 0 < pstate->countdown-- ) + return true; + if ( 0 == ptv->tv_sec ) + ptv->tv_sec = pstate->secs; + else { + timeout_random++; + pstate->secs = ptv->tv_sec * 2 - 2 + (timeout_random & 3); + pstate->countdown = 2; // later fast retries + ptv->tv_sec = 0; + } + return pstate->secs < 100; // If longer, too many tries... } // ------------------------------------------------------------------------ @@ -350,6 +369,7 @@ do_dhcp(const char *intf, struct bootp * int one = 1; unsigned char mincookie[] = {99,130,83,99,255} ; struct timeval tv; + struct timeout_state timeout_scratch; cyg_uint8 oldstate = *pstate; cyg_uint8 msgtype = 0, seen_bootp_reply = 0; @@ -421,7 +441,7 @@ do_dhcp(const char *intf, struct bootp * // be the neatest way to do it; it returns from within the switch arms // when all is well, or utterly failed. - reset_timeout( &tv ); + reset_timeout( &tv, &timeout_scratch ); while ( 1 ) { @@ -445,12 +465,12 @@ do_dhcp(const char *intf, struct bootp * } else if ( lease_state & DHCP_LEASE_T2 ) { // Time to renew - reset_timeout( &tv ); // for the next conversation + reset_timeout( &tv, &timeout_scratch ); // next conversation *pstate = DHCPSTATE_REBINDING; } else if ( lease_state & DHCP_LEASE_T1 ) { // Time to renew - reset_timeout( &tv ); // for the next conversation + reset_timeout( &tv, &timeout_scratch ); // next conversation *pstate = DHCPSTATE_RENEWING; } } @@ -512,11 +532,11 @@ do_dhcp(const char *intf, struct bootp * // Save the good packet in *xmit bcopy( received, xmit, dhcp_size(received) ); *pstate = DHCPSTATE_BOOTP_FALLBACK; - reset_timeout( &tv ); + reset_timeout( &tv, &timeout_scratch ); break; } // go to the next larger timeout and re-send: - if ( ! next_timeout( &tv ) ) { + if ( ! next_timeout( &tv, &timeout_scratch ) ) { *pstate = DHCPSTATE_FAILED; break; } @@ -548,7 +568,7 @@ do_dhcp(const char *intf, struct bootp * // Save the good packet in *xmit bcopy( received, xmit, dhcp_size(received) ); // we like the packet, so reset the timeout for next time - reset_timeout( &tv ); + reset_timeout( &tv, &timeout_scratch ); *pstate = DHCPSTATE_REQUESTING; } } @@ -599,7 +619,7 @@ do_dhcp(const char *intf, struct bootp * (struct sockaddr *)&rx_addr, &addrlen) < 0) { // No packet arrived // go to the next larger timeout and re-send: - if ( ! next_timeout( &tv ) ) { + if ( ! next_timeout( &tv, &timeout_scratch ) ) { *pstate = DHCPSTATE_FAILED; break; } @@ -632,7 +652,7 @@ do_dhcp(const char *intf, struct bootp * // Save the good packet in *xmit bcopy( received, xmit, dhcp_size(received) ); // we like the packet, so reset the timeout for next time - reset_timeout( &tv ); + reset_timeout( &tv, &timeout_scratch ); // Record the new lease and set up timers &c new_lease( received, lease ); *pstate = DHCPSTATE_BOUND; @@ -642,7 +662,7 @@ do_dhcp(const char *intf, struct bootp * && received->bp_siaddr.s_addr == xmit->bp_siaddr.s_addr) { // we're bounced! *pstate = DHCPSTATE_INIT; // So back the start of the rigmarole. - reset_timeout( &tv ); + reset_timeout( &tv, &timeout_scratch ); break; } // otherwise it's something else, maybe another offer, or a bogus @@ -726,8 +746,8 @@ do_dhcp(const char *intf, struct bootp * (struct sockaddr *)&rx_addr, &addrlen) < 0) { // No packet arrived // go to the next larger timeout and re-send: - if ( ! next_timeout( &tv ) ) { - reset_timeout( &tv ); + if ( ! next_timeout( &tv, &timeout_scratch ) ) { + reset_timeout( &tv, &timeout_scratch ); *pstate = DHCPSTATE_REBINDING; break; } @@ -759,7 +779,7 @@ do_dhcp(const char *intf, struct bootp * // Save the good packet in *xmit bcopy( received, xmit, dhcp_size(received) ); // we like the packet, so reset the timeout for next time - reset_timeout( &tv ); + reset_timeout( &tv, &timeout_scratch ); // Record the new lease and set up timers &c new_lease( received, lease ); *pstate = DHCPSTATE_BOUND; @@ -767,7 +787,7 @@ do_dhcp(const char *intf, struct bootp * } if ( DHCPNAK == msgtype ) { // we're bounced! *pstate = DHCPSTATE_NOTBOUND; // So quit out. - reset_timeout( &tv ); + reset_timeout( &tv, &timeout_scratch ); break; } // otherwise it's something else, maybe another offer. @@ -815,8 +835,8 @@ do_dhcp(const char *intf, struct bootp * (struct sockaddr *)&rx_addr, &addrlen) < 0) { // No packet arrived // go to the next larger timeout and re-send: - if ( ! next_timeout( &tv ) ) { - reset_timeout( &tv ); + if ( ! next_timeout( &tv, &timeout_scratch ) ) { + reset_timeout( &tv, &timeout_scratch ); *pstate = DHCPSTATE_FAILED; break; } @@ -848,7 +868,7 @@ do_dhcp(const char *intf, struct bootp * // Save the good packet in *xmit bcopy( received, xmit, dhcp_size(received) ); // we like the packet, so reset the timeout for next time - reset_timeout( &tv ); + reset_timeout( &tv, &timeout_scratch ); // Record the new lease and set up timers &c new_lease( received, lease ); *pstate = DHCPSTATE_BOUND; @@ -856,7 +876,7 @@ do_dhcp(const char *intf, struct bootp * } else if ( DHCPNAK == msgtype ) { // we're bounced! *pstate = DHCPSTATE_NOTBOUND; // So back the start of the rigmarole. - reset_timeout( &tv ); + reset_timeout( &tv, &timeout_scratch ); break; } // otherwise it's something else, maybe another offer.
--- a/packages/redboot/current/ChangeLog +++ b/packages/redboot/current/ChangeLog @@ -1,3 +1,41 @@ +2000-09-17 Gary Thomas <gthomas@redhat.com> + + * src/main.c: Display platform/cpu identification strings if available. + + * cdl/redboot.cdl: Improve CDL to include thread support if + built in ROM mode. Also, better handling of network option. + +2000-09-15 Gary Thomas <gthomas@redhat.com> + + * src/flash.c (fis_create): Length (and flash address) must match + exactly when replacing an image. + Only warn of invalid memory addresses, not fail. + +2000-09-13 Gary Thomas <gthomas@redhat.com> + + * src/load.c: Better handling of bad data / checksum errors. + + * src/flash.c: Handle case of replacing an image, even if no flash + address was given. + + * include/net/tftp_support.h: Modify timeouts, etc, for better response. + +2000-09-12 Gary Thomas <gthomas@redhat.com> + + * src/io.c (mon_read_char_with_timeout): Only "select" a console + when real data (non-zero) arrives. + +2000-09-10 Gary Thomas <gthomas@redhat.com> + + * src/load.c: + * src/flash.c: Remove warnings if built without networking. + +2000-09-11 Jonathan Larmour <jlarmour@redhat.com> + + * include/redboot.h (_RedBoot_init): Define tables entries as structs + with one member rather than just func ptrs, to enforce alignment rules + * src/main.c (cyg_start): Change to use struct init_tab_entry per above + 2000-09-07 Andrew Lunn <andrew.lunn@ascom.ch> * src/load.c, include/redboot.h: renamed the getc functions to
--- a/packages/redboot/current/cdl/redboot.cdl +++ b/packages/redboot/current/cdl/redboot.cdl @@ -31,41 +31,46 @@ # ==================================================================== ######DESCRIPTIONBEGIN#### # -# Author(s): jskov +# Author(s): gthomas # Original data: gthomas # Contributors: -# Date: 1999-11-03 +# Date: 2000-05-01 # #####DESCRIPTIONEND#### # # ==================================================================== cdl_package CYGPKG_REDBOOT { - display "Redboot ROM monitor" -# include_dir cyg/redboot + display "Redboot ROM monitor" define_header redboot.h description " This package supports the Redboot \[stand-alone debug monitor\] using eCos as the underlying board support mechanism." - # Since the CYGDAT_REDBOOT_CONSOLE_DEV setting ends up in the platform # HAL header, we need to include that here (via hal.h). define_proc { puts $::cdl_header "#include <pkgconf/hal.h>" } - cdl_option CYGBLD_BUILD_REDBOOT { + cdl_component CYGBLD_BUILD_REDBOOT { display "Build Redboot ROM ELF image" default_value 0 -# requires { CYG_HAL_STARTUP == "ROM" } requires CYGPKG_INFRA requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS requires CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT -# requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT + requires ! CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT + requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT + requires ! CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM + cdl_option CYGBLD_BUILD_REDBOOT_WITH_THREADS { + no_define + active_if { CYG_HAL_STARTUP == "ROM" } + requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT + } + no_define description "This option enables the building of the Redboot ELF image. The image may require further relocation or symbol @@ -89,7 +94,7 @@ cdl_package CYGPKG_REDBOOT { cdl_component CYGPKG_REDBOOT_NETWORKING { display "Build Redboot ROM binary image" flavor bool - active_if CYGBLD_BUILD_REDBOOT + active_if CYGPKG_IO_ETH_DRIVERS default_value 1 compile net/bootp.c net/udp.c net/ip.c net/pktbuf.c net/cksum.c compile net/enet.c net/icmp.c net/tcp.c net/timers.c net/arp.c
--- a/packages/redboot/current/include/net/tftp_support.h +++ b/packages/redboot/current/include/net/tftp_support.h @@ -81,8 +81,8 @@ extern int tftp_stream_open(char *file extern int tftp_stream_read(char *buf, int len, int *err); extern int tftp_stream_close(int *err); -#define TFTP_TIMEOUT_PERIOD 5 -#define TFTP_TIMEOUT_MAX 5 +#define TFTP_TIMEOUT_PERIOD 1 +#define TFTP_TIMEOUT_MAX 15 #define TFTP_RETRIES_MAX 5 #define TFTP_PORT 69
--- a/packages/redboot/current/include/redboot.h +++ b/packages/redboot/current/include/redboot.h @@ -134,9 +134,12 @@ static _cmd_entry(_s_,_h_,_u_,_f_,_n_) #define RedBoot_INIT_PRIO(_n_) 1000+_n_ #define RedBoot_INIT_LAST 9999 typedef void void_fun(void); -typedef void_fun *void_fun_ptr CYG_HAL_TABLE_TYPE; +typedef void_fun *void_fun_ptr; +struct init_tab_entry { + void_fun_ptr fun; +} CYG_HAL_TABLE_TYPE; #define _RedBoot_init(_f_,_p_) \ -void_fun_ptr _init_tab_##_p_##_f_ CYG_HAL_TABLE_QUALIFIED_ENTRY(RedBoot_inits,_f_) = _f_; +struct init_tab_entry _init_tab_##_p_##_f_ CYG_HAL_TABLE_QUALIFIED_ENTRY(RedBoot_inits,_f_) = { _f_ }; #define RedBoot_init(_f_,_p_) _RedBoot_init(_f_,_p_)
--- a/packages/redboot/current/src/flash.c +++ b/packages/redboot/current/src/flash.c @@ -185,14 +185,14 @@ fis_init(int argc, char *argv[]) strcpy(img->name, "RedBoot"); img->flash_base = (unsigned long)flash_start; img->mem_base = (unsigned long)flash_start; - img->size = 0; + img->size = block_size; img++; img_count++; // And a backup image memset(img, 0, sizeof(*img)); strcpy(img->name, "RedBoot[backup]"); img->flash_base = (unsigned long)flash_start+block_size; img->mem_base = (unsigned long)flash_start+block_size; - img->size = 0; + img->size = block_size; img++; img_count++; #ifdef CYGSEM_REDBOOT_FLASH_CONFIG // And a descriptor for the configuration data @@ -362,9 +362,8 @@ fis_create(int argc, char *argv[]) } if ((mem_addr < (unsigned long)ram_start) || ((mem_addr+length) >= (unsigned long)ram_end)) { - printf("Invalid RAM address: %p\n", (void *)mem_addr); + printf("** WARNING: RAM address: %p may be invalid\n", (void *)mem_addr); printf(" valid range is %p-%p\n", (void *)ram_start, (void *)ram_end); - return; } if (strlen(name) >= sizeof(img->name)) { printf("Name is too long, must be less than %d chars\n", (int)sizeof(img->name)); @@ -382,10 +381,14 @@ fis_create(int argc, char *argv[]) img = (struct image_desc *)fis_work_block; for (i = 0; i < block_size/sizeof(*img); i++, img++) { if ((img->name[0] != (unsigned char)0xFF) && (strcmp(name, img->name) == 0)) { - if (img->flash_base != flash_addr) { + if (flash_addr_set && (img->flash_base != flash_addr)) { printf("Image found, but FLASH address incorrect\n"); return; } + if (img->size != length) { + printf("Image found, but LENGTH is incorrect\n"); + return; + } if (!verify_action("An image named '%s' exists", name)) { return; } else { @@ -1052,13 +1055,13 @@ load_flash_config(void) bool use_boot_script; config_ok = false; + script = (unsigned char *)0; if (!do_flash_init()) return; cfg_base = (void *)((unsigned long)flash_end - (2*block_size)); memcpy(&config, cfg_base, sizeof(config)); if ((_cksum((unsigned long *)&config, sizeof(config)-sizeof(config.cksum)) != config.cksum) || (config.key1 != CONFIG_KEY1)|| (config.key2 != CONFIG_KEY2)) { printf("FLASH configuration checksum error or invalid key\n"); - script = (unsigned char *)0; memset(&config, 0, sizeof(config)); return; }
--- a/packages/redboot/current/src/io.c +++ b/packages/redboot/current/src/io.c @@ -107,9 +107,12 @@ mon_read_char_with_timeout(char *c) res = CYGACC_COMM_IF_GETC_TIMEOUT(*__chan, c); if (res) { // Input available on this channel, make it be the console - console_selected = true; - CYGACC_CALL_IF_SET_DEBUG_COMM(i); - return res; + if (*c != '\0') { + // Don't chose this unless real data have arrived + console_selected = true; + CYGACC_CALL_IF_SET_DEBUG_COMM(i); + return res; + } } } CYGACC_CALL_IF_SET_CONSOLE_COMM(cur);
--- a/packages/redboot/current/src/load.c +++ b/packages/redboot/current/src/load.c @@ -167,6 +167,7 @@ load_srec_image(int (*getc)(void), unsig if (cksum != sum) { printf("*** Warning! Checksum failure - Addr: %lx, %02lX <> %02lX\n", (unsigned long)base_addr, sum, cksum); + return; } if ((unsigned long)(addr-addr_offset) > highest_address) { highest_address = (unsigned long)(addr - addr_offset); @@ -244,12 +245,13 @@ redboot_getc_rewind(void) void do_load(int argc, char *argv[]) { - int i, res, err, num_options; + int res, num_options; int mode; bool verbose, raw; bool base_addr_set, mode_str_set; char *mode_str; #ifdef CYGPKG_REDBOOT_NETWORKING + int i, err; struct sockaddr_in host; bool hostname_set; char *hostname;
--- a/packages/redboot/current/src/main.c +++ b/packages/redboot/current/src/main.c @@ -87,7 +87,7 @@ extern struct cmd __RedBoot_CMD_TAB__[], CYG_HAL_TABLE_BEGIN( __RedBoot_INIT_TAB__, RedBoot_inits ); CYG_HAL_TABLE_END( __RedBoot_INIT_TAB_END__, RedBoot_inits ); -extern void_fun_ptr __RedBoot_INIT_TAB__[], __RedBoot_INIT_TAB_END__; +extern struct init_tab_entry __RedBoot_INIT_TAB__[], __RedBoot_INIT_TAB_END__; // // This is the main entry point for RedBoot @@ -100,7 +100,7 @@ cyg_start(void) char line[256]; struct cmd *cmd; int cur = CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT); - void_fun_ptr *init_fun; + struct init_tab_entry *init_entry; CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL); #ifdef CYGPKG_REDBOOT_ANY_CONSOLE @@ -112,13 +112,16 @@ cyg_start(void) ram_end = (unsigned char *)(CYGMEM_REGION_ram+CYGMEM_REGION_ram_SIZE); printf("\nRedBoot(tm) debug environment - built %s, %s\n", __TIME__, __DATE__); +#ifdef HAL_PLATFORM_CPU + printf("Platform: %s (%s) %s\n", HAL_PLATFORM_BOARD, HAL_PLATFORM_CPU, HAL_PLATFORM_EXTRA); +#endif printf("Copyright (C) 2000, Red Hat, Inc.\n\n"); printf("RAM: %p-%p\n", ram_start, ram_end); config_ok = false; - for (init_fun = __RedBoot_INIT_TAB__; init_fun != &__RedBoot_INIT_TAB_END__; init_fun++) { - (*init_fun)(); + for (init_entry = __RedBoot_INIT_TAB__; init_entry != &__RedBoot_INIT_TAB_END__; init_entry++) { + (*init_entry->fun)(); } #ifdef CYGSEM_REDBOOT_FLASH_CONFIG
--- a/packages/services/memalloc/common/current/ChangeLog +++ b/packages/services/memalloc/common/current/ChangeLog @@ -1,3 +1,10 @@ +2000-09-14 Jesper Skov <jskov@redhat.com> + + * tests/realloc.c (main): fix warning. + * tests/malloc1.c (main): Same. + * tests/malloc2.c (main): Same. + * tests/malloc3.c (main): Same. + 2000-08-31 Jonathan Larmour <jlarmour@redhat.com> * cdl/memalloc.cdl: Make dlmalloc the default malloc implementation now.
--- a/packages/services/memalloc/common/current/tests/malloc1.c +++ b/packages/services/memalloc/common/current/tests/malloc1.c @@ -241,6 +241,8 @@ main( int argc, char *argv[] ) CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " "malloc(), calloc() and free() functions"); + + return 0; } // main() #endif // ifndef NA_MSG
--- a/packages/services/memalloc/common/current/tests/malloc2.c +++ b/packages/services/memalloc/common/current/tests/malloc2.c @@ -238,6 +238,8 @@ main( int argc, char *argv[] ) CYG_TEST_FINISH("Finished stress tests from testcase " __FILE__ " for C " "library malloc(), calloc() and free() functions"); + + return 0; } // main() #endif // ifndef NA_MSG
--- a/packages/services/memalloc/common/current/tests/malloc3.c +++ b/packages/services/memalloc/common/current/tests/malloc3.c @@ -180,6 +180,8 @@ main( int argc, char *argv[] ) CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " "malloc() and free() functions"); + + return 0; } // main() #endif // ifndef NA_MSG
--- a/packages/services/memalloc/common/current/tests/realloc.c +++ b/packages/services/memalloc/common/current/tests/realloc.c @@ -178,6 +178,8 @@ main( int argc, char *argv[] ) CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " "realloc() function"); + + return 0; } // main() #endif // ifndef NA_MSG
