avarice-2.11.orig/0000755000000000000000000000000011627171065010702 5ustar avarice-2.11.orig/config-aux/0000755000000000000000000000000011666502524012743 5ustar avarice-2.11.orig/config-aux/depcomp0000555000000000000000000003554510726623106014326 0ustar #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2004-05-31.23 # Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit 0 ;; -v | --v*) echo "depcomp $scriptversion" exit 0 ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # Dependencies are output in .lo.d with libtool 1.4. # With libtool 1.5 they are output both in $dir.libs/$base.o.d # and in $dir.libs/$base.o.d and $dir$base.o.d. We process the # latter, because the former will be cleaned when $dir.libs is # erased. tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir$base.o.d" tmpdepfile3="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" tmpdepfile3="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" elif test -f "$tmpdepfile2"; then tmpdepfile="$tmpdepfile2" else tmpdepfile="$tmpdepfile3" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: avarice-2.11.orig/config-aux/install-sh0000555000000000000000000002201710726623105014742 0ustar #!/bin/sh # install - install a program, script, or datafile scriptversion=2004-12-17.09 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: avarice-2.11.orig/config-aux/missing0000555000000000000000000002453310726623105014342 0ustar #! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2004-09-07.08 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit 0 ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit 0 ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: avarice-2.11.orig/configure.ac0000644000000000000000000001055711627170722013177 0ustar # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # # avarice - The "avarice" program. # Copyright (C) 2001 Scott Finneran # Copyright (C) 2002, 2003, 2004 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. # # $Id: configure.ac,v 1.74 2011/08/30 14:21:06 joerg_wunsch Exp $ # AC_PREREQ(2.57) AC_INIT(avarice, 2.11) AC_CONFIG_AUX_DIR([config-aux]) AC_CONFIG_SRCDIR([src/main.cc]) AC_CONFIG_HEADERS([src/autoconf.h:src/autoconf.hin]) dnl We don't want the gzip distribution tarball anymore. AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip]) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PATH_PROG(pathperl, perl) if test -z "$pathperl" ; then AC_MSG_ERROR([I can't find perl]); fi # Checks for libraries. ## Some systems need "-lsocket -lnsl" when linking. ## AC_SEARCH_LIBS(gethostbyname, nsl) AC_CHECK_FUNC(socket, , [ AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket", [ AC_CHECK_LIB(nsl, socket, LIBS="$LIBS -lsocket -lnsl", , -lsocket) ], "$LIBS") ]) ## Some systems need "-lresolv" for inet_aton(). ## AC_SEARCH_LIBS([inet_aton], [resolv]) ## If libbfd was configured with nls, the build might need -lintl. This ## seems to be the case with cygwin. Also, it seems that on cygwin, libintl ## needs libiconv. Plus, on some systems libbfd needs -liberty. ## AC_CHECK_LIB([iconv], [iconv_open], , [ac_found_iconf=no]) if test "x$ac_found_iconf" = "xno"; then AC_CHECK_LIB([iconv], [libiconv_open]) fi AC_CHECK_LIB([intl], [dcgettext]) AC_CHECK_LIB([iberty], [xmalloc]) AC_CHECK_LIB([bfd], [bfd_init], , [ac_found_bfd=no]) AC_CHECK_LIB([usb], [usb_get_string_simple]) if test "x$ac_found_bfd" = "xno"; then AC_MSG_ERROR([You need to install libbfd.a from binutils.]) fi # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h termios.h unistd.h]) AC_CHECK_HEADERS([bfd.h], , [ac_found_bfd_h=no]) if test "x$ac_found_bfd_h" = "xno"; then AC_MSG_ERROR([Your libbfd.a needs an accompanying bfd.h file.]) fi # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM dnl Available from the GNU Autoconf Macro Archive at: dnl http://www.gnu.org/software/ac-archive/htmldoc/type_socklen_t.html dnl AC_DEFUN([TYPE_SOCKLEN_T], [AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [#include #include ], [socklen_t len = 42; return 0;])], ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no) ]) if test $ac_cv_type_socklen_t != yes; then AC_DEFINE([socklen_t], [int], [Substitute for missing socklen_t.]) fi ]) TYPE_SOCKLEN_T AC_MSG_CHECKING([whether libbfd requires libz]) AC_LINK_IFELSE( [#include int main(void) { bfd_init(); bfd_object(); bfd_openr("foo", 0); return 42; }], [AC_MSG_RESULT([no])], [AC_MSG_RESULT([yes]) AC_CHECK_LIB([z], [inflate], [LIBS="$LIBS -lz"])]) # Checks for library functions. AC_FUNC_ERROR_AT_LINE AC_FUNC_FORK AC_FUNC_MEMCMP AC_FUNC_SELECT_ARGTYPES AC_FUNC_STAT AC_FUNC_VPRINTF AC_CHECK_FUNCS([atexit gethostbyname inet_ntoa memmove memset select socket strcasecmp strerror strtol]) # --enable-warnings / --disable-warnings AC_ARG_ENABLE( [warnings], AC_HELP_STRING( [--disable-warnings], [Disable -Wall -Wextra options]), [case "${enableval}" in yes) ENABLE_WARNINGS="-Wall -Wextra" ;; no) ENABLE_WARNINGS="" ;; *) AC_MSG_ERROR(bad value ${enableval} for disable-warnings option) ;; esac], [ENABLE_WARNINGS="-Wall -Wextra"]) AC_SUBST([AM_CPPFLAGS], [$ENABLE_WARNINGS]) AC_CONFIG_FILES([ scripts/Makefile scripts/ice-gdb src/Makefile doc/Makefile avarice.spec Makefile]) AC_OUTPUT avarice-2.11.orig/aclocal.m40000644000000000000000000010346311627170731012550 0ustar # generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # 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. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # 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" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $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]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR avarice-2.11.orig/Makefile.am0000644000000000000000000000162310512257465012741 0ustar # # avarice - The "avarice" program. # Copyright (C) 2001 Scott Finneran # Copyright (C) 2002 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. # # AUTOMAKE_OPTIONS = foreign SUBDIRS = scripts src doc EXTRA_DIST = \ COPYING \ NEWS dist-hook: avarice.spec cp avarice.spec $(distdir)/avarice.spec avarice-2.11.orig/Makefile.in0000644000000000000000000005332211627170734012756 0ustar # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/avarice.spec.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ config-aux/depcomp config-aux/install-sh config-aux/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/autoconf.h CONFIG_CLEAN_FILES = avarice.spec CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" GZIP_ENV = --best DIST_ARCHIVES = $(distdir).tar.bz2 distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pathperl = @pathperl@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # # avarice - The "avarice" program. # Copyright (C) 2001 Scott Finneran # Copyright (C) 2002 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. # # AUTOMAKE_OPTIONS = foreign SUBDIRS = scripts src doc EXTRA_DIST = \ COPYING \ NEWS all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): avarice.spec: $(top_builddir)/config.status $(srcdir)/avarice.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_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 case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-hook dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am dist-hook: avarice.spec cp avarice.spec $(distdir)/avarice.spec # 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: avarice-2.11.orig/avarice.spec.in0000644000000000000000000000265710245700616013602 0ustar ## -*- mode: rpm-spec; -*- ## ## $Id: avarice.spec.in,v 1.3 2003/12/07 06:04:58 troth Exp $ ## ## @configure_input@ ## # We don't want rpm stripping any files #%define __spec_install_post %{nil} # Don't build the debuginfo rpm %define debug_package %{nil} Summary: Interface for GDB to Atmel AVR JTAGICE in circuit emulator. Name: avarice Version: @VERSION@ Release: 1 License: GPL Group: Avr/Development/Tools URL: http://avarice.sourceforge.net/ Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %description AVaRICE is a program which interfaces the GNU Debugger with the AVR JTAG ICE available from Atmel. %prep %setup -q %build ./configure --prefix=%{_prefix} --mandir=%{_mandir} make %install rm -rf $RPM_BUILD_ROOT make prefix=$RPM_BUILD_ROOT%{_prefix} mandir=$RPM_BUILD_ROOT%{_mandir} install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc ChangeLog AUTHORS INSTALL COPYING %{_prefix}/bin/avarice %{_prefix}/bin/start-avarice %{_prefix}/bin/kill-avarice %{_prefix}/bin/ice-gdb %{_prefix}/bin/ice-insight %{_prefix}/share/%{name}/gdb-avarice-script %{_mandir}/man1/ice-insight.1 %{_mandir}/man1/ice-gdb.1 %{_mandir}/man1/avarice.1 %changelog * Sat Dec 06 2003 Theodore A. Roth - Add avarice.1 man page. * Thu Sep 18 2003 Theodore A. Roth - Add man pages. * Fri Aug 15 2003 Theodore A. Roth - Initial build. avarice-2.11.orig/configure0000755000000000000000000064112611627170733012624 0ustar #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for avarice 2.11. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='avarice' PACKAGE_TARNAME='avarice' PACKAGE_VERSION='2.11' PACKAGE_STRING='avarice 2.11' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="src/main.cc" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS AM_CPPFLAGS LIBOBJS EGREP GREP CPP pathperl am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_warnings ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$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 ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 | -n) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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 ;; -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_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # 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 <<_ACEOF \`configure' configures avarice 2.11 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/avarice] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --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 _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of avarice 2.11:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-warnings Disable -Wall -Wextra options Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF avarice configure 2.11 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by avarice $as_me 2.11, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in config-aux "$srcdir"/config-aux; 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 elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in config-aux \"$srcdir\"/config-aux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers src/autoconf.h:src/autoconf.hin" am__api_version='1.11' # 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 # AmigaOS /C/install, which installs bootblocks on floppy discs # 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" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /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 for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&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}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # 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" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $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". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } 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" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='avarice' VERSION='2.11' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # Checks for programs. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 $as_echo_n "checking whether the C++ compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C++ compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 $as_echo_n "checking for C++ compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&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 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_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 $# != 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 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_pathperl+:} false; then : $as_echo_n "(cached) " >&6 else case $pathperl in [\\/]* | ?:[\\/]*) ac_cv_path_pathperl="$pathperl" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_pathperl="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi pathperl=$ac_cv_path_pathperl if test -n "$pathperl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pathperl" >&5 $as_echo "$pathperl" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$pathperl" ; then as_fn_error $? "I can't find perl" "$LINENO" 5; fi # Checks for libraries. ## Some systems need "-lsocket -lnsl" when linking. ## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 $as_echo_n "checking for library containing gethostbyname... " >&6; } if ${ac_cv_search_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_gethostbyname=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_gethostbyname+:} false; then : break fi done if ${ac_cv_search_gethostbyname+:} false; then : else ac_cv_search_gethostbyname=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 $as_echo "$ac_cv_search_gethostbyname" >&6; } ac_res=$ac_cv_search_gethostbyname if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" if test "x$ac_cv_func_socket" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket "$LIBS" $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = xyes; then : LIBS="$LIBS -lsocket" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lnsl" >&5 $as_echo_n "checking for socket in -lnsl... " >&6; } if ${ac_cv_lib_nsl_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl -lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_socket=yes else ac_cv_lib_nsl_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_socket" >&5 $as_echo "$ac_cv_lib_nsl_socket" >&6; } if test "x$ac_cv_lib_nsl_socket" = xyes; then : LIBS="$LIBS -lsocket -lnsl" fi fi fi ## Some systems need "-lresolv" for inet_aton(). ## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_aton" >&5 $as_echo_n "checking for library containing inet_aton... " >&6; } if ${ac_cv_search_inet_aton+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_aton (); int main () { return inet_aton (); ; return 0; } _ACEOF for ac_lib in '' resolv; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_inet_aton=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_aton+:} false; then : break fi done if ${ac_cv_search_inet_aton+:} false; then : else ac_cv_search_inet_aton=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_aton" >&5 $as_echo "$ac_cv_search_inet_aton" >&6; } ac_res=$ac_cv_search_inet_aton if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ## If libbfd was configured with nls, the build might need -lintl. This ## seems to be the case with cygwin. Also, it seems that on cygwin, libintl ## needs libiconv. Plus, on some systems libbfd needs -liberty. ## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open in -liconv" >&5 $as_echo_n "checking for iconv_open in -liconv... " >&6; } if ${ac_cv_lib_iconv_iconv_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char iconv_open (); int main () { return iconv_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iconv_iconv_open=yes else ac_cv_lib_iconv_iconv_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv_open" >&5 $as_echo "$ac_cv_lib_iconv_iconv_open" >&6; } if test "x$ac_cv_lib_iconv_iconv_open" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBICONV 1 _ACEOF LIBS="-liconv $LIBS" else ac_found_iconf=no fi if test "x$ac_found_iconf" = "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5 $as_echo_n "checking for libiconv_open in -liconv... " >&6; } if ${ac_cv_lib_iconv_libiconv_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libiconv_open (); int main () { return libiconv_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iconv_libiconv_open=yes else ac_cv_lib_iconv_libiconv_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5 $as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; } if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBICONV 1 _ACEOF LIBS="-liconv $LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5 $as_echo_n "checking for dcgettext in -lintl... " >&6; } if ${ac_cv_lib_intl_dcgettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dcgettext (); int main () { return dcgettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_dcgettext=yes else ac_cv_lib_intl_dcgettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dcgettext" >&5 $as_echo "$ac_cv_lib_intl_dcgettext" >&6; } if test "x$ac_cv_lib_intl_dcgettext" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBINTL 1 _ACEOF LIBS="-lintl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmalloc in -liberty" >&5 $as_echo_n "checking for xmalloc in -liberty... " >&6; } if ${ac_cv_lib_iberty_xmalloc+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liberty $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char xmalloc (); int main () { return xmalloc (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iberty_xmalloc=yes else ac_cv_lib_iberty_xmalloc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iberty_xmalloc" >&5 $as_echo "$ac_cv_lib_iberty_xmalloc" >&6; } if test "x$ac_cv_lib_iberty_xmalloc" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBIBERTY 1 _ACEOF LIBS="-liberty $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_init in -lbfd" >&5 $as_echo_n "checking for bfd_init in -lbfd... " >&6; } if ${ac_cv_lib_bfd_bfd_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bfd_init (); int main () { return bfd_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfd_bfd_init=yes else ac_cv_lib_bfd_bfd_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_init" >&5 $as_echo "$ac_cv_lib_bfd_bfd_init" >&6; } if test "x$ac_cv_lib_bfd_bfd_init" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBBFD 1 _ACEOF LIBS="-lbfd $LIBS" else ac_found_bfd=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usb_get_string_simple in -lusb" >&5 $as_echo_n "checking for usb_get_string_simple in -lusb... " >&6; } if ${ac_cv_lib_usb_usb_get_string_simple+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lusb $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char usb_get_string_simple (); int main () { return usb_get_string_simple (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_usb_usb_get_string_simple=yes else ac_cv_lib_usb_usb_get_string_simple=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_usb_get_string_simple" >&5 $as_echo "$ac_cv_lib_usb_usb_get_string_simple" >&6; } if test "x$ac_cv_lib_usb_usb_get_string_simple" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBUSB 1 _ACEOF LIBS="-lusb $LIBS" fi if test "x$ac_found_bfd" = "xno"; then as_fn_error $? "You need to install libbfd.a from binutils." "$LINENO" 5 fi # Checks for header files. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h termios.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in bfd.h do : ac_fn_c_check_header_mongrel "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default" if test "x$ac_cv_header_bfd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BFD_H 1 _ACEOF else ac_found_bfd_h=no fi done if test "x$ac_found_bfd_h" = "xno"; then as_fn_error $? "Your libbfd.a needs an accompanying bfd.h file." "$LINENO" 5 fi # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 $as_echo_n "checking for socklen_t... " >&6; } if ${ac_cv_type_socklen_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { socklen_t len = 42; return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_socklen_t=yes else ac_cv_type_socklen_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_socklen_t" >&5 $as_echo "$ac_cv_type_socklen_t" >&6; } if test $ac_cv_type_socklen_t != yes; then $as_echo "#define socklen_t int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libbfd requires libz" >&5 $as_echo_n "checking whether libbfd requires libz... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main(void) { bfd_init(); bfd_object(); bfd_openr("foo", 0); return 42; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 $as_echo_n "checking for inflate in -lz... " >&6; } if ${ac_cv_lib_z_inflate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inflate (); int main () { return inflate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_inflate=yes else ac_cv_lib_z_inflate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 $as_echo "$ac_cv_lib_z_inflate" >&6; } if test "x$ac_cv_lib_z_inflate" = xyes; then : LIBS="$LIBS -lz" fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 $as_echo_n "checking for error_at_line... " >&6; } if ${ac_cv_lib_error_at_line+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { error_at_line (0, 0, "", 0, "an error occurred"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_error_at_line=yes else ac_cv_lib_error_at_line=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 $as_echo "$ac_cv_lib_error_at_line" >&6; } if test $ac_cv_lib_error_at_line = no; then case " $LIBOBJS " in *" error.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS error.$ac_objext" ;; esac fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 $as_echo_n "checking for working memcmp... " >&6; } if ${ac_cv_func_memcmp_working+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_memcmp_working=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_memcmp_working=yes else ac_cv_func_memcmp_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_header in sys/select.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 $as_echo_n "checking types of arguments for select... " >&6; } if ${ac_cv_func_select_args+:} false; then : $as_echo_n "(cached) " >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif int main () { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, $ac_arg5); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done done # Provide a safe default value. : "${ac_cv_func_select_args=int,int *,struct timeval *}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 $as_echo "$ac_cv_func_select_args" >&6; } ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 ($2) _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 ($3) _ACEOF rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : $as_echo_n "(cached) " >&6 else rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then if test "$cross_compiling" = yes; then : ac_cv_func_lstat_dereferences_slashed_symlink=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; /* Linux will dereference the symlink and fail, as required by POSIX. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ return lstat ("conftest.sym/", &sbuf) == 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_lstat_dereferences_slashed_symlink=yes else ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi else # If the `ln -s' command failed, then we probably don't even # have an lstat function. ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f conftest.sym conftest.file fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 $as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && cat >>confdefs.h <<_ACEOF #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 _ACEOF if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 $as_echo_n "checking whether stat accepts an empty string... " >&6; } if ${ac_cv_func_stat_empty_string_bug+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_stat_empty_string_bug=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; return stat ("", &sbuf) == 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_stat_empty_string_bug=no else ac_cv_func_stat_empty_string_bug=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 $as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } if test $ac_cv_func_stat_empty_string_bug = yes; then case " $LIBOBJS " in *" stat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;; esac cat >>confdefs.h <<_ACEOF #define HAVE_STAT_EMPTY_STRING_BUG 1 _ACEOF fi for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done for ac_func in atexit gethostbyname inet_ntoa memmove memset select socket strcasecmp strerror strtol do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # --enable-warnings / --disable-warnings # Check whether --enable-warnings was given. if test "${enable_warnings+set}" = set; then : enableval=$enable_warnings; case "${enableval}" in yes) ENABLE_WARNINGS="-Wall -Wextra" ;; no) ENABLE_WARNINGS="" ;; *) as_fn_error $? "bad value ${enableval} for disable-warnings option" "$LINENO" 5 ;; esac else ENABLE_WARNINGS="-Wall -Wextra" fi AM_CPPFLAGS=$ENABLE_WARNINGS ac_config_files="$ac_config_files scripts/Makefile scripts/ice-gdb src/Makefile doc/Makefile avarice.spec Makefile" cat >confcache <<\_ACEOF # 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, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by avarice $as_me 2.11, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ avarice config.status 2.11 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/autoconf.h") CONFIG_HEADERS="$CONFIG_HEADERS src/autoconf.h:src/autoconf.hin" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "scripts/ice-gdb") CONFIG_FILES="$CONFIG_FILES scripts/ice-gdb" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "avarice.spec") CONFIG_FILES="$CONFIG_FILES avarice.spec" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi avarice-2.11.orig/AUTHORS0000644000000000000000000000104710245700616011747 0ustar Avarice (up to version 1.5) was originally written by Scott Finneran with help from Peter Jansen. They did the work of figuring out the jtagice communication protocol before Atmel released the spec (appnote AVR060). Scott Finneran Peter Jansen David Gay made some major improvements bringing avarice up to 2.0. David Gay The source in this distribution is based on David Gay's work. Many people have made contributions and are credited in the ChangeLog file. avarice-2.11.orig/COPYING0000644000000000000000000004312710245700616011737 0ustar GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. avarice-2.11.orig/ChangeLog0000644000000000000000000013035411627170607012463 0ustar 2011-08-30 Joerg Wunsch * configure.ac: Bump version for release 2.11. 2011-08-30 Joerg Wunsch Patch #2842235: Fix segfault when programming with .fuses section * src/jtagprog.cc (get_section_addr): Return 0xffffffff for unknown section memory types, so sections like .fuses will be silently ignored. * src/jtag2prog.cc (get_section_addr): (Ditto.) 2011-08-30 Joerg Wunsch Submitted by Andrew Zabolotny: Patch #2995091: Fix gcc 4.4.1 warnings Actually, I went a lot further, and made it completely -Wall -Wextra clean for GCC 4.x. (GCC 3.x users might want to use --disable-warnings in configure.) * configure.ac: Add --enable-warnings option. * src/pragma.h: New file, #pragma abstraction * src/jtag.h: Include "pragma.h" so it's universally usable * src/Makefile.am (avarice_SOURCES): Add pragma.h. * src/devdescr.cc: Silence compiler warnings. * src/gnu_getopt.c: (Ditto.) * src/jtag2.h: (Ditto.) * src/jtag2bp.cc: (Ditto.) * src/jtag2io.cc: (Ditto.) * src/jtag2prog.cc: (Ditto.) * src/jtag2run.cc: (Ditto.) * src/jtag2usb.cc: (Ditto.) * src/jtagbp.cc: (Ditto.) * src/jtaggeneric.cc: (Ditto.) * src/jtagio.cc: (Ditto.) * src/jtagprog.cc: (Ditto.) * src/jtagrw.cc: (Ditto.) * src/main.cc: (Ditto.) * src/remote.cc: (Ditto.) 2011-08-30 Joerg Wunsch Patch #2842239: Fix for deprecated string warning * src/jtag2prog.cc (jtag2::downloadToTarget): Turn "target" and "default_target" const to eliminate a compiler warning. 2011-05-06 Eric B. Weddington Patch #3298045. * devdescr.cc: Fix device IDs for ATmega325P and ATmega3250P. 2009-08-26 Shaun Jackman * configure.ac: add bfd_object() to the check whether libbfd requires libz. 2009-06-25 Joerg Wunsch bug 2812023: build failed with gcc 4.4.0 * src/jtag2usb.cc (opendev): make a local copy of jtagDeviceName, and then operate on that copy instead of trying to modify a const object. 2009-05-15 Joerg Wunsch * src/devdescr.cc (ATmega128RFA1): update the number of interrupt vectors, and extended IO bitmaps. 2009-05-15 Joerg Wunsch * tools/devdescr.xsl: update for rev 1.29 of src/jtag.h: generate the is_xmega flag correctly 2009-04-03 Joerg Wunsch * configure.ac: Bump version for post-release 2.10. 2009-04-03 Joerg Wunsch * configure.ac: Bump version for release 2.10. 2009-04-03 Joerg Wunsch * configure.ac: Check whether libbfd requires libz (true for libbfd 2.19 and above); while here, replace the obosolete AC_TRY_COMPILE by AC_COMPILE_IFELSE. 2009-03-05 Joerg Wunsch * configure.ac: Bump version for post-release 2.9. 2009-03-05 Joerg Wunsch * configure.ac: Bump version for release 2.9. 2009-02-24 Joerg Wunsch * src/devdescr.cc (atmega128rfa1): new device. 2008-10-07 Joerg Wunsch * src/jtag2run.cc (jtag2::jtagSingleStep): When being interrupted by GDB while waiting for the EVT_BREAK from a CMND_SINGLE_STEP, we must issue a CMND_STOP_PROGRAM before proceeding. 2008-09-29 Joerg Wunsch * src/jtag.h: More ATxmega support. As the Xmega requires a different initialization, this must be made known to AVaRICE beforehand. The option -x (--xmega) can be used to tell AVaRICE that the target is an Xmega. Alternatively, specifying an ATxmega device explicitly through -P will also work. * src/jtag2.h: (Ditto.) * src/jtag2io.cc: (Ditto.) * src/main.cc: (Ditto.) * src/devdescr.cc: (Ditto.) Additionally, provide a separate entry for the ATxmega128A1 rev D as this device uses a different JTAG ID. * doc/avarice.1: Document the -x/--xmega option. 2008-09-08 Joerg Wunsch * configure.ac: Bump version to post-2.8. 2008-09-08 Joerg Wunsch * configure.ac: Bump version to 2.8. 2008-08-26 Nils Kristian Strom * src/main.cc (usage): Add -R/--reset-srst to usage. 2008-07-29 Joerg Wunsch * src/jtagprog.cc: Fix "deprecated conversion from string constant to char *" warnings. * src/main.cc: (Ditto.) 2008-06-12 Joerg Wunsch * configure.ac: Bump version date. 2008-06-12 Joerg Wunsch Implement external reset through nSRST signal. Based on the idea from patch #1398862 but implemented in a completely different way. * src/jtag.h: Add apply_nSRST to struct jtag, and parameter possible_nSRST to resetProgram(). * src/jtag1.h: Add nrst to constructor. * src/jtag2.h: (Ditto.) * src/jtag2io.cc: Try applying nSRST before enabling JTAG emulation. * src/jtag2run.cc: possible_nSRST is ignored in mkII resetProgram(). * src/jtagio.cc: Add possible_nSRST parameters. * src/remote.cc: (Ditto.) * src/jtagrun.cc: Implement possible_nSRST for mkI. * src/main.cc: Add option -R/--reset-srst. * doc/avarice.1: Document option -R/--reset-srst. 2008-06-10 Joerg Wunsch * src/main.cc: Add "target_sleep" to the list of events to be ignored by default. * doc/avarice.1: Document the above change. 2008-06-10 Joerg Wunsch * doc/avarice.1: Document all the newly supported devices. * src/devdescr.cc: Remove duplicate entry for AT90USB1287; fix EECRAddress for all recent entries (must be fill_b2()). * tools/devdescr.xsl: Add fill_b2() to EECRAddress. 2008-05-26 Joerg Wunsch [ 1948200 ] Add option to print list of known devices Submitted by Rick Mann * src/main.cc: Add the option -k/--known-devices. Sort deviceDefinitions alphabetically before. * doc/avarice.1: Document the -k option. 2008-05-26 Joerg Wunsch [ patch 1909351 ] ATmega32c1, ATmega32m1 [ patch 1909933 ] sync to xml from avrstudio 4.14 beta Submitted by David B. Curtis * src/devdescr.cc: Add support for all currently known (by AVR Studio's partdescription files) AVR devices. 2008-05-26 Joerg Wunsch [ patch 1750202 ] set parameter command failed (Original patch *not* used though.) * src/jtag2run.cc (jtag2::resetProgram, jtag2::eventLoop): After issuing a JTAG reset, wait for the ICE to post the respective BREAK event. Since resetProgram() can be called fairly early before the GDB communication has been set up, make eventLoop() aware of gdbFileDescriptor possibly being still at -1, so it ought to be ignored. 2008-05-26 Joerg Wunsch [ patch 1587395 ] decrease default bitrate Submitted by Stas Sergeev * src/main.cc (usage, main): Default JTAG bitrate to 250 kHz rather than 1 MHz, change usage message for that. * doc/avarice.1: Document the changed default JTAG bitrate. 2008-05-26 Joerg Wunsch [ 1865183 ] bfd.h not used for checking of libbfd * configure.ac: Don't just check for bfd.h but complain at configure time if it has not been found. 2008-05-26 Joerg Wunsch [ 1880464 ] AVR-Dragon needs libusb-dev * src/jtaggeneric.cc (jtag::jtag): throw an error message and bail out when called with "-j usb" but not configured for libusb support. 2008-05-25 Joerg Wunsch * configure.ac: Bump version. 2008-05-25 Joerg Wunsch [ 1833340 ] cannot read program counter/Watchdog has expired * src/jtag2run.cc (jtag2::eventLoop): Carefully handle all the different events that could be posted by the ICE, as opposed to just assuming every event would work like a BREAK where AVaRICE is then allowed to go ahead, and fetch the program counter value. 2008-02-25 Joerg Wunsch * src/devdescr.cc: Add entries for ATtiny84 and ATtiny85. 2008-01-26 Joerg Wunsch [ 1831392 ] --jtag option does not default to usb using dragon * src/main.cc: Fix logic for defaulting jtagDeviceName so the environment variable JTAG_DEV will be honoured, yet the AVR Dragon will still default to USB rather than /dev/avrjtag. 2008-01-26 Joerg Wunsch [ 1833342 ] useless warning message about jtag bitrate using dragon * src/main.cc: Restrict the warning about defaulting the JTAG bit rate to JTAG protocols only. 2008-01-26 Joerg Wunsch [ 1869060 ] jtag daisy chain bits limitations * src/main.cc: Apply the correct limitations for JTAG daisy-chaining. 2008-01-26 Joerg Wunsch * src/main.cc: Issue a warning when trying to chip erase in debugWire mode. * doc/avarice.1: Document that chip erase is not supported in debugWire mode. 2008-01-26 Joerg Wunsch * src/jtag2io.cc (jtag2::recvFrame): make msglen and its related variables unsigned int so they cannot suddenly become negative. 2007-11-13 Joerg Wunsch * src/jtag2bp.c (jtag2::addBreakpoint): fix a comparison that turned out to be an assignment. 2007-11-02 Joerg Wunsch Fix a bug with single-stepping on the JTAG ICE mkII or AVR Dragon. Single-stepping essentially behaves identical to CMND_GO, i. e. it returns immediately but the caller gets an EVT_BREAK posted once the single-step is completed. In particular for software breakpoints (like on debugWire), this could take a bit more time than the internal processing delay. When AVaRICE continued, and tried to query the program counter, the ICE wasn't ready yet again, and everything fell into parts. * src/jtag2.h: add new eventLoop() method. * src/jtag2run.cc: move the heart of jtag2::jtagContinue() out into eventLoop(), and use this method similarly for the jtag2::jtagSingleStep() method to await the EVT_BREAK. 2007-11-02 Joerg Wunsch * configure.ac: bump version to post-2.7 2007-10-30 Joerg Wunsch * configure.ac: bump version to 2.7 2007-07-08 Shaun Jackman * src/jtag2bp.cc (layoutBreakpoints) : Bug fix. GDB continue command would hang when using debugWire. * src/jtag2io.cc (recvFrame): Correctly report a timeout. * src/jtag2run.cc (resetProgram): The JTAG ICE mkII and Dragon do not respond correctly to the CMND_RESET command while in debugWire mode. Send CMND_FORCED_STOP and CMND_WRITE_PC(0) instead. 2007-08-29 Joerg Wunsch * configure.ac: Bump version date. 2007-08-29 Joerg Wunsch * src/jtag.h: Implement user-configurable ICE event handling for the JTAG ICE mkII. * src/jtag1.h: (Ditto.) * src/jtag2.h: (Ditto.) * src/jtag2run.cc: (Ditto.) * src/jtagrun.cc: (Ditto.) * src/main.cc: (Ditto.) * doc/avarice.1: Document the new option. 2007-08-29 Joerg Wunsch * src/jtaggeneric.cc: properly initialize private class members of jtag objects in all constructors, not just the default one (which we actually don't use). 2007-07-23 Joerg Wunsch * INSTALL-FROM-CVS: Bump required version numbers for automake to 1.9, and autoconf to 2.59 as this is the only thing we are testing these days. 2007-04-03 Joerg Wunsch Submitted by Dave N6NZ * src/devdescr.cc: add entries for ATmega325/3250/645/6450. 2007-03-21 Colin O'Flynn * src/main.cc: Added patch #1121113 which adds a JTAG_DEV env variable * doc/avarice.1: Added JTAG_DEV to docs 2007-02-26 Joerg Wunsch * src/devdescr.cc: Add entries for AT90PWM2/3B. * tools/devdescr.xsl: Declare the "count" parameter in the format-hex template. Recent versions of xsltproc appear to be more picky about that. 2007-02-22 Joerg Wunsch * configure.ac: Bump date, now that we've got a first previous of Colin's soft BP implementation. 2007-02-20 Joerg Wunsch (On behalf of Colin O'Flynn) * src/jtag2bp.cc: Implement software breakpoints. * src/jtag2.h: (Ditto.) 2007-02-17 Joerg Wunsch * configure.ac: Bump date. 2007-02-17 Joerg Wunsch * src/jtag2usb.cc: Complete overhaul of the USB communication: - Use a second pipe (ctrlPipe) between main AVaRICE and the daemon to signal control information. - Move the entire libusb handling from the parent into the child process, so it only happens a single time. Have the parent wait until the child could make a decision, either failure to find the requested USB device, or success of being able to talk to it. - Do no longer poll USB when not needed, instead either read a reply when the master process told the daemon it is expecting one, or start polling while the target is running. - Add an option for the parent to have the USB daemon clear the endpoints after seeing successive timeouts while data was expected. - Examine the header of received data, and if the block length indicates more data will be folllowing the first read, go ahead and fetch them immediately. * src/jtag.h: Add ctrlPipe. * src/jtag2io.cc: Use ctrlPipe if present. * src/jtag2run.cc: (Ditto.) * src/jtaggeneric.cc: Initialize ctrlPipe in constructor. 2006-12-22 Joerg Wunsch * configure.ac: bump version to post-2.6 * NEWS: add boilerplate for next release 2006-12-21 Joerg Wunsch * configure.ac: bump version to 2.6 2006-11-14 Joerg Wunsch * src/jtag2usb.cc: Try to set the O_ASYNC flag only if the host operating system does actually support it. 2006-11-08 Joerg Wunsch * src/devdescr.cc: Replace the ATmega164 and ATmega324 device descriptors by ATmega164P and ATmega324P ones, as the former devices have never been released. * doc/avarice.1: Document that change. 2006-11-05 Joerg Wunsch * src/jtag2usb.cc: Rearrange the procedure to open an USB device so that the usb_dev_handle is not going to be inherited across a fork(). Doing so did cause problems on the OSX implementation of libusb. 2006-10-28 Joerg Wunsch * doc/avarice.1: Document the AVR Dragon support. Also add all the debugWire-supported AVRs. 2006-10-28 Joerg Wunsch * src/jtag.h: Make a first stab of an implementation for the AVR Dragon. This is mostly the same as the JTAG ICE mkII, except it can only talk USB and has a different USB product ID. Documentation not yet done. * src/jtag2.h: (Ditto.) * src/jtag2io.cc: (Ditto.) * src/jtag2usb.cc: (Ditto.) * src/jtaggeneric.cc: (Ditto.) * src/main.cc: (Ditto.) 2006-10-08 Joerg Wunsch * configure.ac: bump version to post-2.5 * NEWS: add boilerplate for next r 2006-10-08 Joerg Wunsch * configure.ac: bump version to 2.5 2006-10-08 Joerg Wunsch * src/jtag2io.cc: Don't mess with the fuse or lock bits in debugWire mode. * src/main.cc: Add --erase to the example usage. * NEWS: (New file.) * Makefile.am (EXTRA_DIST): Add NEWS. 2006-09-15 Joerg Wunsch Implement basic soft BP support for debugWire: * src/jtag2.h: add a soft BP cache, and updateBreakpintsDW(). * src/jtag2bp.cc: Implement updateBreakpintsDW(). 2006-09-15 Joerg Wunsch * tools/devdescr.xsl: (New file.) Generate devdescr.cc entry out of the XML file. * src/devdescr.cc: Add entries for all debugWire AVRs, generated with devdescr.xsl. 2006-09-12 Joerg Wunsch * src/jtaggeneric.cc: Initialize is_usb properly when creating a new "jtag" object. 2006-09-09 Joerg Wunsch * doc/avarice.1: Mention that avrdude can turn off the DWEN fuse. 2006-08-08 Joerg Wunsch First part of implementing debugWire support. * src/main.cc: Implement the debugWire framework. * src/jtag.h: (Ditto.) * src/jtag2.h: (Ditto.) * src/jtag2io.cc: (Ditto.) * src/jtag2prog.cc: (Ditto.) * src/jtag2rw.cc: (Ditto.) * src/devdescr.cc: Add an entry for the ATmega48. * doc/avarice.1: Document the debugWire effort. * configure.ac: Bump version. 2006-07-20 Joerg Wunsch * configure.ac: Bump version. 2006-07-20 Joerg Wunsch * src/devdescr.cc: Fix various things in the device desriptors, mostly affecting devices with the new EEPROM register layout: . use correct (according to AVR Studio) EECRaddress . use correct start of SRAM for ATmegaxx0/1 . add EINDaddr for ATmegaxx0/1 2006-05-24 Joerg Wunsch * src/devdescr.cc: Add ATmega2560/2561. 2006-05-19 Joerg Wunsch * src/jtag.h: Properly initialize the device_name member. * src/jtag1.h: (Ditto.) * src/jtag2.h: (Ditto.) * src/jtaggeneric.cc: (Ditto.) * src/main.cc: (Ditto.) 2006-04-09 Joerg Wunsch * src/devdescr.cc: fix ucAllowFullPageBitstream for AT90CAN128. 2006-04-07 Joerg Wunsch * doc/avarice.1: Update documentation (new devices, missing option documentation, bump man page date), sort options alphabetically. * src/main.cc: Sort options alphabetically. 2006-04-07 Joerg Wunsch Contributed by Michael De Nil: * src/jtag.h: Add support for JTAG daisy chainging; sourceforge.net patch tracker: https://sourceforge.net/tracker/index.php?func=detail&aid=1216263&group_id=39505&atid=425409 * src/jtag1.h: (Ditto.) * src/jtag2.h: (Ditto.) * src/jtag2io.cc: (Ditto.) * src/jtagio.cc: (Ditto.) * src/main.cc: (Ditto.) 2006-04-07 Joerg Wunsch * src/devdescr.cc: Add support for AT90USB1287 2006-03-27 Joerg Wunsch * src/devdescr.cc: fix ucAllowFullPageBitstream for ATmega640/1280/1281. * configure.ac: bump version to post-2.4 2006-01-11 Joerg Wunsch * Release version 2.4. 2006-01-11 Joerg Wunsch * configure.ac: bump version to 2.4 * INSTALL-FROM-CVS: adapt instructions for the auto* tools; we are not very picky about the exact versions as long as they are reasonably recent. 2005-11-17 * src/jtag2io.cc (sendJtagCommand): breakpoint handling was broken (breakpoints detected in recv, but jtagContinue called recvFrame). Fix by moving it all into jtagContinue. Also add extra debug output. * src/jtag2.h (class jtag2): see jtag2io.cc. * src/jtag2run.cc (jtagContinue): see jtag2io.cc. * scripts/ice-gdb.in: gdb's -- options can also be used with a single dash * src/utils.cc (statusOut): send debug output to stderr 2005-10-09 Joerg Wunsch * src/devdescr.cc: add ATmega640/1280/1281 2005-09-26 Joerg Wunsch * src/jtag2usb.cc: fix the libusb handling, so it will eventually also work with libusb-win32. 2005-08-18 Joerg Wunsch * src/devdescr.cc: set ucPCMaskHigh to 0 for ATmega329x/649x. 2005-08-17 Joerg Wunsch * src/devdescr.cc: add the ATmega329x/649x family. 2005-08-15 Joerg Wunsch * configure.ac: add check for libusb. * src/Makefile.am: add jtag2usb.cc. * src/jtag.h: add USB stuff to jtag class. * src/jtag2io.cc (jtag2::~jtag2()): do not prematurely return, use an "if" statement instead. * src/jtaggeneric.cc: add USB hooks (depending on configuration). * src/jtag2usb.cc: New file: implement USB communication. * doc/avarice.1: Document the USB connection method. 2005-08-15 Joerg Wunsch * src/jtag2rw.cc (jtag2::jtagRead()): when word-aligning flash ROM requests, do also align the request base, and return the correct byte(s). 2005-06-20 Joerg Wunsch * src/devdescr.cc: add device flags. * src/jtag.h: add device flags, move mkI breakpoints out to jtag1.h. * src/jtag1.h: mkI breakpoint interface goes here. * src/jtag2.h: new mkII breakpoint interface. * src/jtag2bp.cc: ditto. * src/jtag2run.cc: ditto. * src/jtag2rw.cc: Attempt to get the "load" command working. * src/jtagbp.cc: remove stale "e" packet code (step-over-range-packet). * src/jtagrun.cc: ditto. * src/remote.cc: ditto. * scripts/gdb-avarice-script: ditto. 2005-05-31 Joerg Wunsch * src/jtag.h: remove friend restoreSerialPort() which doesn't exist at all. 2005-05-27 Joerg Wunsch Merge the JTAG ICE mkII branch back to HEAD. * src/jtag2.h: (new file) * src/jtag2_defs.h: (new file) * src/jtag2bp.cc: (new file) * src/jtag2io.cc: (new file) * src/jtag2misc.cc: (new file) * src/jtag2prog.cc: (new file) * src/jtag2run.cc: (new file) * src/jtag2rw.cc: (new file) * src/crc16.c: (new file) * src/crc16.h: (new file) * Bootstrap: Export AUTO* variables. * configure.ac: Bump version. * doc/avarice.1: (Merge) * doc/dev_desc.txt: (Merge) * doc/mk2-protocol.txt: (Merge) * src/Makefile.am: (Merge) * src/devdescr.cc: (Merge) * src/jtag.h: (Merge) * src/jtag1.h: (Merge) * src/jtaggeneric.cc: (Merge) * src/jtagio.cc: (Merge) * src/jtagprog.cc: (Merge) * src/jtagrw.cc: (Merge) * src/main.cc: (Merge) * src/remote.cc: (Merge) 2005-05-24 Joerg Wunsch * src/devdescr.cc: Add IO register entries for ATmega64/128 & CAN128 * src/ioreg.cc: Ditto. * src/ioreg.h: Ditto. 2005-05-13 Joerg Wunsch * configure.ac: Encapsulate the mkI protocol in its own C++ class. * src/Makefile.am: ditto. * src/devdescr.cc: ditto. * src/jtag.h: ditto. * src/jtag1.h: ditto. * src/jtagbp.cc: ditto. * src/jtaggeneric.cc: ditto. * src/jtagio.cc: ditto. * src/jtagmisc.cc: ditto. * src/jtagprog.cc: ditto. * src/jtagrun.cc: ditto. * src/jtagrw.cc: ditto. * src/main.cc: ditto. * src/remote.cc: ditto. 2005-04-20 * configure.ac: Set version to 20050420. * src/jtagio.cc (doJtagCommand): newly connected targets tend to spam JTAG_R_INFO responses, which weren't handled by the debugger (sympton: 'Cannot synchronise' messages). These responses are used to provide a channel from the target program to the debugger, but this is currently unused by avarice (see the IDRD register for details). Fix: detect JTAG_R_INFO response in sendJtagCommand. When this happens, send an 'S' (get sign on) command. If we don't do this, the JTAG_R_INFO response seems to be repeated indefinitely... 2004-12-06 Theodore A. Roth * configure.ac (AC_INIT): Set version to 2.3.20041206 for cvs tracking. 2004-12-06 David Gay * src/main.cc (main): resume execution on exit when not in server mode 2004-12-06 Theodore A. Roth * Release version 2.3. 2004-12-06 Theodore A. Roth * configure.ac (AC_INIT): Set version to 2.3. * configure.ac: Add more lib checks which might be need for libbfd. 2004-11-25 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * doc/avarice.1: Add at90can128 to supported list. Marked as experimental. * src/jtag.h: Fix typo in comment describing jtag_device_desc_type. * src/jtagio.cc (deviceDefinitions): Add entry for at90can128. 2004-11-21 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * doc/avarice.1: Update --program option to note that erase is no longer implicit. Make NOTE bold in note for --write-fuses option. * src/main.cc (usage): Remove erase from --program option. 2004-11-18 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * src/jtagprog.cc (jtag_create_image): Replace bfd_get_section_size_before_reloc with bfd_get_section_size. Work around for change API in bfd. 2004-11-12 Nils Kristian Strom * configure.ac (AC_INIT): Bump version. * src/main.cc (main): Write lock bits when all other programming tasks are completed. 2004-10-25 Theodore A. Roth [Contributed by Colin O'Flynn ] * configure.ac (AC_INIT): Bump version. * doc/mk2-protocol.txt: New file. 2004-08-08 Nils Kristian Strom * src/main.cc: Move device erase in front of write fuses in case of device being locked. 2004-08-05 Nils Kristian Strom * src/jtagio.cc: (deviceDefinitions): Fix flash and eeprom page sizes for mega64 and mega128. (Thanks to Ted Roth for this). * src/jtagprog.cc: (jtag_flash_image): Don't override device specific eeprom page size. 2004-08-04 Joerg Wunsch * Bootstrap: export AUTO* variables to make automake happy. 2004-05-26 Theodore A. Roth [Contributed by Onno van Eijk ] * configure.ac (AC_INIT): Bump version. * src/ioreg.cc (atmega32_io_registers): Define. * src/ioreg.h (atmega32_io_registers): Declare. * src/jtagio.cc (deviceDefinitions): Install mega32 io register defs. 2004-03-12 David Gay * configure.ac: Bump version. * src/jtagio.cc (safewrite): write may write only part of the data (problem tended to show up with USB serial ports). Fix. 2004-03-08 David Gay * scripts/start-avarice: add --erase option when programming 2004-02-25 Theodore A. Roth * src/jtagprog.cc (eraseProgramMemory): Add comment noting that this is really a chip erase operation. (downloadToTarget): Don't erase the device here if programming. * src/main.cc (main): Never erase the device unless the user explicitly gives the --erase option. When programming without the --erase option, issue a warning about the change in behavior. 2004-02-06 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * doc/avarice.1: * src/jtag.h: * src/jtagrw.cc: * src/main.cc: Add --read-lockbits (-l) option for reading the lockbits. 2004-01-29 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * scripts/io_gen.py: New file for helping to generate io register defs. 2004-01-28 Theodore A. Roth [Contributed by Nils Kristian Strom ] * configure.ac (AC_INIT): Bump version. * src/ioreg.cc (atmega162_io_registers): Define. * src/ioreg.h (atmega162_io_registers): Declare. * src/jtagio.cc (deviceDefinitions): Install mega162 io register defs. 2004-01-21 Theodore A. Roth [Contributed by Bjoern Haase ] * configure.ac (AC_INIT): Bump version. * src/ioreg.cc: Fix spelling error. Add cvs Id keyword. (atmega169_io_registers): Define. * src/ioreg.h: Fix spelling error. Add cvs Id keyword. (atmega169_io_registers): Declare. * src/jtagio.cc (deviceDefinitions): Install mega169 io register defs. 2003-12-12 Theodore A. Roth * Release version 2.2. 2003-12-12 Theodore A. Roth * configure.ac (AC_INIT): Set version to 2.2. 2003-12-08 Theodore A. Roth * src/main.cc (usage): Fix host name and port spec to denote that host name, not port, is the optional part of host:port. 2003-12-08 Theodore A. Roth [Contributed by Kolja Waschk ] * configure.ac (AC_INIT): Bump version. * src/gnu_getopt.h: Protect against cygwin having already included getop.h. * src/jtagio.cc (timeout_read): If either select() of read() fail and errno is set to EAGAIN, continue the loop instead of bombing out. * src/jtagrun.cc (jtagContinue): Use timeout_read() instead of read(). 2003-12-06 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * avarice.spec.in (%files): Add avarice man page. * doc/Makefile.am (man_MANS): Add avarice.1. (EXTRA_DIST): Remove install.txt. * doc/avarice.1: New file. * doc/install.txt: Remove file. This file talks about Aegis being the build system which is no longer true since we use autoconf/automake. * doc/running.txt: Add note about this file being out of date. * doc/todo.txt: Remove some entries that have been handled. Add some new entries. 2003-11-16 Theodore A. Roth [Thanks to Nils Kristian Strom ] * configure.ac (AC_INIT): Bump version. * src/jtag.h (initJtagBox): Change arguments (no args needed). (initJtagOnChipDebugging): New prototype. (jtagReadFuses): Ditto. * src/jtagio.cc (initJtagBox): Change arguments and move attach code to initJtagOnChipDebugging function. (initJtagOnChipDebugging): New function. * src/jtagrw.cc (jtagReadFuses): New function. * src/main.cc (main): Avoid disabling lock bits and setting FUSE_OCDEN when we are using avarice as a standalone device programmer. Move --write-fuses in front of the jtag debugger initialization, to make it possible to start debugging with all fuses written to their proper settings. 2003-11-16 Theodore A. Roth [Thanks to Nils Kristian Strom ] * src/jtag.h (jtagDisplayFuses): Add prototype. * src/jtagio.cc (initJtagBox): Use jtagDisplayFuses() instead of calling statusOut() directly. * src/jtagrw.cc (jtagWriteFuses): Ditto. (jtagDisplayFuses): New function. 2003-11-13 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * src/jtagrw.cc (memorySpace): Use symbolic name instead of magic number. * src/remote.cc (talkToGdb): Only allow orphaned bytes when writing to program space. [Thanks to Brian Cuthie for reporting this bug.] 2003-11-08 Theodore A. Roth * src/main.cc (usage): Make the -B option info fit on a 80 column terminal. 2003-11-08 Theodore A. Roth [Thanks to Nils Kristian Strom ] * configure.ac (AC_INIT): Bump version. * src/jtagio.cc (initJtagBox): Inform user about the lock bits and fuses that actually *are* programmed, not the ones that were found in the device. 2003-11-01 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * src/jtag.h: Add JTAG_BITRATE_1_MHz, JTAG_BITRATE_500_KHz, JTAG_BITRATE_250_KHz and JTAG_BITRATE_125_KHz defs. (initJtagBox): Add bitrate argument. * src/jtagio.cc (initJtagBox): Allow passing the jtag bitrate. * src/main.cc: Add the -B (--jtag-bitrate) option. 2003-10-23 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * doc/dev_desc.txt: New file. * src/jtag.h: * src/jtagio.cc: Make the device description arrays into a structures. 2003-10-20 Theodore A. Roth [Thanks to Dean Ferreyra ] * configure.ac (AC_INIT): Bump version. * src/main.cc: Fix to allow erasing the device as a single operation. 2003-09-25 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * doc/Makefile.am (EXTRA_DIST): Add the .txt files. * doc/README.cygwin: New file, from Eric Weddington. 2003-09-18 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * avarice.spec.in: Add man pages. 2003-09-18 Theodore A. Roth [Thanks to Amedee Louis Beaudoin ] * src/jtagrw.cc (jtagWriteFuses): Enter programming mode before writing and exit program mode after reading. (jtagWriteLockBits): Ditto. 2003-08-25 David Gay * configure.ac: bump version * src/jtagprog.cc: work around cygwin gcc (3.2.3) bug with large stack allocated locals by making them static 2003-08-21 David Gay * doc/ice-insight.1: new file, ice-insight man page * doc/ice-gdb.1: new file, ice-gdb man page * doc/Makefile.am: new file * Makefile.am (SUBDIRS): make doc subdir * configure.ac: Bump revision, add doc Makefile 2003-08-20 Theodore A. Roth * src/jtagrun.cc (jtagContinue): Add debug output to show what the jtag box returned, especially the break status register. 2003-08-19 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * src/jtagprog.cc (get_section_addr): Fix to allow programming of upper 64k of flash. 2003-08-18 David Gay * src/main.cc (main): Add missing --file option for getopt [Thanks to Mike Hudson ] 2003-08-15 Theodore A. Roth * Makefile.am (dist-hook): New rule. * configure.ac (AC_INIT): Bump version. (AC_CONFIG_FILES): Add avarice.spec. * avarice.spec.in: New file. 2003-08-15 Theodore A. Roth [Thanks to Nils Kristian Strom ] * src/main.cc (long_opts): Fix short opts to match usage output. 2003-08-08 Theodore A. Roth [Thanks to James Harris ] * src/gnu_getopt.h: Define HAVE_DECL_GETOPT to fix declaration clash. 2003-08-06 David Gay * src/main.cc (main): actually implement --version * configure.ac: Bump version. 2003-08-05 David Gay * scripts/start-avarice: use new host:portname syntax 2003-08-05 Theodore A. Roth * configure.ac: Bump version. * src/Makefile.am (avarice_SOURCES): Add gnu_getopt* files. * src/avarice.h: Delete DEFAULT_PORT. * src/gnu_getopt.c: New file. * src/gnu_getopt.h: New file. * src/gnu_getopt1.c: New file. * src/main.cc: Use gnu getop_long() to parse argv. Clean up usage() output to be more compact. Allow operations (program, erase, verify, write-fuses, etc) to be performed before going into gdb server mode. Change "[[hostname] port]" options into a single "[[host]:port]" option where ":port" causes avarice to enter server mode. All options now have short and long equivalents. 2003-08-04 Theodore A. Roth * src/main.cc: Revert program flag to default to false. Revert setting program flag to false if --verify is given. 2003-07-31 David Gay * src/main.cc (main): when no gdb interaction: don't perform extraneous enableProgramming/disableProgramming when gdb interaction: program if a file specified * scripts/gdb-avarice-script: set hardware watch/break limits * scripts/ice-gdb.in: --ignore-intr should not capture, --external flag * scripts/start-avarice: no need for avr-objcopy 2003-07-29 Theodore A. Roth * configure.ac: Bump version. Search for library needed for inet_aton(). 2003-07-25 Theodore A. Roth * configure.ac: Bump Version * src/jtagio.cc: Double all of the vectors_end initializers. 2003-07-24 Theodore A. Roth * configure.ac: Bump version. * src/jtagprog.cc (initImage): Fix off by one in for loop. (jtag_create_image): Clean up for loop to use common idiom. (jtag_flash_image): Clean up for loop to use common idiom. When verifying, verify all bytes instead of bombing out at first error. * src/main.cc (usage): Add info for verify option. 2003-07-24 Theodore A. Roth * src/jtagprog.cc (jtag_create_image): Fix off by one error. 2003-07-10 Theodore A. Roth [Contributed by Nils Kristian Strom ] * src/jtag.h: * src/jtagprog.cc: * src/main.cc: Add verification of program and data after downloading to device. 2003-07-10 Theodore A. Roth * doc/todo.txt: Update todo list. 2003-07-10 Theodore A. Roth [Contributed by Joerg Wunsch ] * configure.ac: Bump version. * src/avarice.h: Define DEFAULT_PORT. * src/main.cc: Have host default to listening on any interface and port default to DEFAULT_PORT (4242). 2003-07-07 David Gay * src/jtag.h: Add vectors_end to jtag_device_def_type. * src/jtagio.cc: Add vectors_end values to device initializers. * src/remote.cc: Use vectors_end when ignoring interrupts. 2003-07-07 David Gay * src/jtagio.cc: Better fix, comment for device id problem. 2003-07-07 David Gay * src/jtagio.cc: Fix problem with --capture and reading device id. 2003-07-03 David Gay * src/jtagio.cc: Check pointer before passing to strcmp(). Update comment for JTAG bitrate. * src/jtagprog.cc: Fix a spelling error. Move "." status out of jtagWrite back to download. * src/jtagrw.cc: Move "." status out of jtagWrite back to download. * src/main.cc: Reset remote target after download (debugging won't work without that reset). * src/remote.cc: Extend interrupt ignore stuff to singlestep, makes it much more useable in gdb. Still need to find extent of interrupt table based on device id. 2003-07-02 Theodore A. Roth [Contributed by Jake McGuire ] * src/jtagio.cc: Add support for mega64. 2003-07-02 Theodore A. Roth [Contributed by Joerg Wunsch ] * configure.ac: Bump version. * src/jtagprog.cc: SEC_ARCH_BIT_0 and SEC_THREAD_LOCAL are not available on some older bfd libraries. * src/main.cc: BSD always requires the inclusion of before . (initSocketAddress): struct sockaddr_in in 4.4BSD contains some padding at the end in a struct field named sin_zero which needs zero'ed out. 2003-06-13 Theodore A. Roth * configure.ac: Bump version. * src/jtagio.cc: Set JTAG_P_CLOCK param to 0xff instead of 0xfd to speed things up a little bit. * src/remote.cc: Remove a debug output statement. 2003-06-12 Theodore A. Roth * doc/todo.txt: Remove some items that have been fixed or are now working. 2003-06-12 Theodore A. Roth * src/jtagrw.cc (jtagWrite): Print debug message if addr or length is odd. * src/remote.cc (reportStatusExtended): New function for replying with a 'T' packet instead of an 'S' packet. Use new function whenever a breakpoint is hit from a step or continue command from gdb. 2003-06-12 Theodore A. Roth * configure.ac: Bump version. * src/remote.cc: Remove call to interruptProgram() when handling a 'g' packet. This was accidently committed and should not have been since it causes the jtagice box to corrupt the program counter. Not good. 2003-06-11 Theodore A. Roth * configure.ac: Bump version. * src/jtagio.cc: Remove check failure for jtag ice HW version. * src/remote.cc: Fix handling the 'M' command from GDB to allow for odd addresses and lengths. 2003-06-05 Theodore A. Roth * configure.ac: Check for intl library since linking to bfd may require it (this affects cygwin). [Thanks Colid O'Flynn for reporting this.] 2003-05-04 Theodore A. Roth [Contributed by Alan Willis .] * src/jtagprog.cc: Speed up programming the flash by skipping pages that are all ones. 2003-05-04 Theodore A. Roth [Contributed by Nils Kristian Strom ] * src/main.cc: Allow all programmer-operations (erase device, write memory, write fuses, write lockbits) in one pass. 2003-05-04 Theodore A. Roth * configure.ac: Check for libbfd and libiberty, complain if either is missing. Bump version. * src/jtagio.cc: When opening the jtagice device, give a more helpful failure message. 2003-05-04 Theodore A. Roth [Contributed by Nils Kristian Strom ] * src/jtag.h: * src/jtagprog.cc: * src/jtagrw.cc: Use the bfd library for handling multiple input file formats. 2003-05-01 Theodore A. Roth * src/jtagrw.cc: Fix byte order problem when specifying fuses bytes on the command line. 2003-04-20 Theodore A. Roth * AUTHORS: Fix a typo. * INSTALL-FROM-CVS: Add detailed description about using the proper versions of autoconf and automake. * configure.ac: Ran autoscan to generate this file to check for more potential portability problem points. Use autoconf-2.57 and automake-1.7.3 (trying make things work right with any versions is a royal PITA). Have autoheader generate src/autoconf.hin instead of autoconf.h.in so 8.3 systems don't puke. * configure.in: Removed (replaced by configure.ac). * .cvsignore: Ignore all diff and patch files. Ignore all autom4te*.cache dirs. * src/.cvsignore: Ignore TAGS and tags files. Ignore autoconf.hin instead of autoconf.h.in. 2003-04-03 Theodore A. Roth [Contributed by Nils Kristian Strom ]. * configure.in: Bump version. * src/jtag.h: * src/jtagrw.cc: * src/main.cc: Add support for writing the lockbits from the command line. 2003-04-02 Theodore A. Roth [Contributed by Nils Kristian Strom ]. * src/jtag.h: * src/jtagrw.cc: * src/main.cc: Add support for writing fuses from the command line. 2003-04-02 Theodore A. Roth [Contributed by Nils Kristian Strom ]. * configure.in: Bump version. * src/main.cc: Move #include to fix a build failure on FreeBSD. 2003-04-01 Theodore A. Roth [Contributed by Jake McGuire ] * src/main.cc: Ports should be printed as unsigned values instead of signed. 2003-04-01 Theodore A. Roth * configure.in: Add check for socklen_t type. 2003-04-01 Theodore A. Roth [Contributed by Jake McGuire ] * configure.in: Bump version. * src/jtagio.cc: Don't set serial speed by changing termios structure since this breaks on OS X. Use cfsetospeed() and cfsetispeed(). 2003-03-27 Theodore A. Roth * configure.in: Add checks for libsocket and libnsl. 2003-03-27 Theodore A. Roth [Contributed by James Harris ] * src/jtag.h: Lengthen JTAG_RESPONSE_TIMEOUT so slower systems have a fair chance to respond. * src/remote.cc: Passing an int to read(2) is not bigendian friendly, so pass an unsigned char instead. 2003-03-27 Theodore A. Roth * src/remote.cc: Add handling of 'C' packet. Using 'sig SIGHUP' command from gdb will cause avarice to reset the user program. 2003-03-27 Theodore A. Roth * Bootstrap: Remove need to run autotools in src. * configure.in: Remove need for src/configure.in. * src/configure.in: Remove file. 2003-03-27 Theodore A. Roth [Contributed by James Harris ] * src/Makefile.am (avarice_SOURCES): Add ioreg.cc and ioreg.h. * src/ioreg.cc: New file. * src/ioreg.h: New file. * src/jtag.h: Add io_reg_defs field to jtag_device_def_type struct. * src/jtagio.cc: Add io_reg_defs field initializers. * src/remote.cc: Add 'q' packet handling of "Ravr.io_reg" queries. 2003-03-27 Theodore A. Roth * src/remote.cc: Break out of 'g' packet case if an error occurs. 2003-03-27 Theodore A. Roth [Contributed by James Harris ] * src/remote.cc: When handling a 'g' packet, only read the 32 GPR's, SPL, SPH, and SREG. Reading some other io registers can have side effects. 2003-03-27 Theodore A. Roth [Contributed by James Harris ] * src/jtag.h: Remove unused deviceType enum. * src/jtagprog.cc: Tell the jtagbox the device dependant flash and eeprom pagesizes based on device definition info. 2003-03-26 Theodore A. Roth [Contributed by Jeff Rose ] * src/jtagio.cc (getJtagResponse): Use JTAG_RESPONSE_TIMEOUT instead of JTAG_COMM_TIMEOUT when reading the response from the jtag box. * src/main.cc: Don't require hostname and portnumber options if they aren't needed. 2003-03-25 Theodore A. Roth [Contributed by James Harris ] * src/jtag.h: Add jtag_device_def_type structure. Add various missing jtag values. * src/jtagio.cc: Add auto detection and configuration of target device. Always report jtag box hw and sw versions. * src/main.cc: Add --part command line option. 2003-03-17 Theodore A. Roth * Bootstrap: Add "-a -c" to second call to automake so depcomp will be installed if it is missing. 2003-02-28 Theodore A. Roth * AUTHORS: New file. * Bootstrap: Allow user to specify which versions of the auto tools to use by setting environment variables. * ChangeLog: New file. avarice-2.11.orig/INSTALL0000644000000000000000000000011710245700616011725 0ustar To build avarice: in this directory ./configure make To install: make install avarice-2.11.orig/NEWS0000644000000000000000000001107211627170722011401 0ustar # $Id: NEWS,v 1.27 2011/08/30 14:21:06 joerg_wunsch Exp $ Summary of changes in AVaRICE 2.11 ================================== . Fixed an annoying error that prevented it from compiling on recent versions of GCC. . Fixed *all* warnings, making the code -Wall -Wextra safe, so they can be enabled by default now. GCC 3.x users might want to run configure with --disable-warnings though, as some of the warnings are suppressed by GCC 4.x pragmas. ===================================================================== Summary of changes in AVaRICE 2.10 ================================== Important bug fixes: -------------------- . Add a check for the requirement to link against libz in order to successfully work with libbfd. That appears to be necessary for GNU binutils >= 2.19. ===================================================================== Summary of changes in AVaRICE 2.9 ================================= New CPU support added: ---------------------- . ATmega128RFA1 ===================================================================== Summary of changes in AVaRICE 2.8 ================================= New CPU support added: ---------------------- . ATtiny84 and ATtiny85 (debugWIRE devices) . ATmega32C1, ATmega32M1 . AT90PWM316, AT90USB162, AT90USB646, AT90USB647, ATmega1284P, ATmega165, ATmega165P, ATmega168P, ATmega16HVA, ATmega3250P, ATmega325P, ATmega328P, ATmega3290P, ATmega329P, ATmega32HVB, ATmega32U4, ATmega406, ATmega48P, ATmega644P, ATmega88P, ATtiny167, ATtiny43U, ATtiny48, ATtiny88, ATXmega128A1 New features added: ------------------- . External reset through nSRST (option -R/--reset-srst) . Handle ICE events (intelligently) beyond just BREAK events . Option -k/--known-devices to print all known devices . Default bitrate decreased to 250 kHz to comply with most AVRs shipping with a CPU frequency of 1 MHz Summary of important bug fixes: ------------------------------- . Fix a bug with single-stepping on the JTAG ICE mkII or AVR Dragon. The bug could eventually result in a "Cannot read program counter" message. . Fix a sign-extension bug in the length calculation of received JTAG ICE mkII packets that could result in a C++ allocation error. . [ 1869060 ] jtag daisy chain bits limitations . [ 1833342 ] useless warning message about jtag bitrate using dragon . [ 1831392 ] --jtag option does not default to usb using dragon . [ patch 1750202 ] set parameter command failed . [ 1865183 ] bfd.h not used for checking of libbfd . [ 1880464 ] AVR-Dragon needs libusb-dev . [ 1833340 ] cannot read program counter/Watchdog has expired ===================================================================== Summary of changes in AVaRICE 2.7 ================================= New CPU support added: ---------------------- . AT90PWM2B/AT90PWM3B (same as AT90PWM2/3 but different signature) . ATmega325/3250/645/6450 New features added: ------------------- . Software breakpoints are now also supported when using JTAG. Summary of important bug fixes: ------------------------------- . Complete overhaul of the USB communication, making it much more robust, and less resource-consuming. . DebugWire bug fix submittted by Shaun Jackman. ===================================================================== Summary of changes in AVaRICE 2.6 ================================= New CPU support added: ---------------------- . ATmega164P/324P (removed non-existing ATmega164/324) New features added: ------------------- . Support of the AVR Dragon (both, JTAG and debugWire) Summary of important bug fixes: ------------------------------- . Don't fork the USB daemon with the libusb handle open; instead, re-open the connection in the child. Fixes issues with MacOS X and Cygwin. ===================================================================== Summary of changes in AVaRICE 2.5 ================================= New CPU support added: ---------------------- . AT90USB1287 . ATmega2560/2561 . debugWIRE AVRs (ATmega48/88/168, ATtiny13, ATtiny2313, AT90PWM2/3, ATtiny24/44, ATtiny25/45, ATtiny261/461/861) New features added: ------------------- . JTAG daisy chainging . basic debugWIRE support (still limited to four breakpoints; known to occasionally cause trouble over USB, works better over RS-232) Summary of important bug fixes: ------------------------------- . fix ucAllowFullPageBitstream for ATmega640/1280/1281, AT90CAN128 . fix device descriptors, in particular EEPROM access on recent AVRs ===================================================================== [Versions up to AVaRICE 2.4 did not have a NEWS file entry.] avarice-2.11.orig/scripts/0000755000000000000000000000000011666502524012372 5ustar avarice-2.11.orig/scripts/Makefile.am0000644000000000000000000000171110245700616014420 0ustar # # avarice - The "avarice" program. # Copyright (C) 2001 Scott Finneran # Copyright (C) 2002 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. # # AUTOMAKE_OPTIONS = foreign bin_SCRIPTS = start-avarice kill-avarice ice-gdb ice-insight pkgdata_DATA = gdb-avarice-script EXTRA_DIST = \ gdb-avarice-script \ start-avarice \ kill-avarice \ ice-insight avarice-2.11.orig/scripts/Makefile.in0000644000000000000000000003221711627170734014445 0ustar # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = scripts DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/ice-gdb.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/autoconf.h CONFIG_CLEAN_FILES = ice-gdb CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DATA = $(pkgdata_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pathperl = @pathperl@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # # avarice - The "avarice" program. # Copyright (C) 2001 Scott Finneran # Copyright (C) 2002 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. # # AUTOMAKE_OPTIONS = foreign bin_SCRIPTS = start-avarice kill-avarice ice-gdb ice-insight pkgdata_DATA = gdb-avarice-script EXTRA_DIST = \ gdb-avarice-script \ start-avarice \ kill-avarice \ ice-insight all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign scripts/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): ice-gdb: $(top_builddir)/config.status $(srcdir)/ice-gdb.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgdatadir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgdatadir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgdataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-pkgdataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkgdataDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-pkgdataDATA # 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: avarice-2.11.orig/scripts/ice-gdb.in0000755000000000000000000000204010340165340014200 0ustar #!@pathperl@ $prefix = "@prefix@"; $datadir = "@datadir@"; $debugger = "avr-gdb"; @argcmds = ( "-b", "--cd", "--command", "--core", "--pid", "--directory", "--exec", "--interpreter", "--se", "--symbols", "--tty", "-s", "-e", "-se", "-x", "-d" ); for ($i = 0; $i <= $#ARGV; $i++) { $arg = $ARGV[$i]; if ($arg =~ /^-/ && (grep $_ eq $arg, @argcmds || grep /^-$arg$/, @argcmds)) { $i++; } elsif ($arg eq "--debugger" && $i < $#ARGV) { $debugger = $ARGV[$i + 1]; splice @ARGV, $i, 2; $i--; } elsif ($arg eq "--capture" || $arg eq "--ignore-intr") { $ENV{AVARICE_ARGS} = "$ENV{AVARICE_ARGS} $arg"; splice @ARGV, $i, 1; # Don't load an executable $capture = 1 if $arg eq "--capture"; $i--; } elsif ($arg eq "--external") { $avarice_running = 1; splice @ARGV, $i, 1; $i--; } elsif (!($arg =~ /^-/)) { $exe = $arg; break; } } $exe = "" if $capture; system "start-avarice $exe" unless $avarice_running; unshift @ARGV, ($debugger, "-x", "$datadir/avarice/gdb-avarice-script" ); exec @ARGV; avarice-2.11.orig/scripts/gdb-avarice-script0000644000000000000000000000057610255622555015773 0ustar set remoteaddresssize 32 set remote Z-packet enable set remote hardware-breakpoint-limit 3 set remote hardware-watchpoint-limit 2 define target-ice target extended-remote localhost:6423 end define ice-load shell start-avarice $arg0 file $arg0 target-ice end define ice-restart shell start-avarice target-ice end define hook-quit shell kill-avarice end target-ice avarice-2.11.orig/scripts/start-avarice0000755000000000000000000000034110245700616015055 0ustar #!/bin/sh kill-avarice TMPDIR=/tmp if [ -f /usr/bin/cygpath.exe ]; then TMPDIR=`cygpath -w $TMPDIR` fi if [ "$1" != "" ] ; then AVARICE_ARGS="$AVARICE_ARGS --erase -f $1" fi avarice $AVARICE_ARGS localhost:6423 --detach avarice-2.11.orig/scripts/kill-avarice0000755000000000000000000000041010245700616014650 0ustar #!/bin/sh if [ -f /usr/bin/cygpath.exe ]; then # cygwin while avaricepid=`ps -es | grep '/avarice' | head -1 | cut -c2-7` [ "$avaricepid" != "" ] do kill -9 $avaricepid done else # linux, probably some others at least killall -q avarice fi avarice-2.11.orig/scripts/ice-insight0000644000000000000000000000006310245700616014511 0ustar #!/bin/sh exec ice-gdb --debugger avr-insight "$@" avarice-2.11.orig/src/0000755000000000000000000000000011666502524011472 5ustar avarice-2.11.orig/src/Makefile.am0000644000000000000000000000254711627164120013527 0ustar # # avarice - The "avarice" program. # Copyright (C) 2001 Scott Finneran # Copyright (C) 2002 Intel Corporation # Copyright (C) 2005 Joerg Wunsch # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. # # # $Id: Makefile.am,v 1.7 2011/08/30 13:40:32 joerg_wunsch Exp $ AUTOMAKE_OPTIONS = foreign bin_PROGRAMS = avarice avarice_SOURCES = \ avarice.h \ crc16.h \ crc16.c \ devdescr.cc \ ioreg.cc \ ioreg.h \ jtag.h \ jtag1.h \ jtag2.h \ jtag2bp.cc \ jtag2io.cc \ jtag2misc.cc \ jtag2prog.cc \ jtag2run.cc \ jtag2rw.cc \ jtag2_defs.h \ jtag2usb.cc \ jtagbp.cc \ jtaggeneric.cc \ jtagio.cc \ jtagmisc.cc \ jtagprog.cc \ jtagrun.cc \ jtagrw.cc \ main.cc \ pragma.h \ remote.cc \ remote.h \ utils.cc \ gnu_getopt.c \ gnu_getopt.h \ gnu_getopt1.c avarice-2.11.orig/src/Makefile.in0000644000000000000000000004470411627170734013551 0ustar # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = avarice$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/autoconf.hin ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = autoconf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_avarice_OBJECTS = crc16.$(OBJEXT) devdescr.$(OBJEXT) \ ioreg.$(OBJEXT) jtag2bp.$(OBJEXT) jtag2io.$(OBJEXT) \ jtag2misc.$(OBJEXT) jtag2prog.$(OBJEXT) jtag2run.$(OBJEXT) \ jtag2rw.$(OBJEXT) jtag2usb.$(OBJEXT) jtagbp.$(OBJEXT) \ jtaggeneric.$(OBJEXT) jtagio.$(OBJEXT) jtagmisc.$(OBJEXT) \ jtagprog.$(OBJEXT) jtagrun.$(OBJEXT) jtagrw.$(OBJEXT) \ main.$(OBJEXT) remote.$(OBJEXT) utils.$(OBJEXT) \ gnu_getopt.$(OBJEXT) gnu_getopt1.$(OBJEXT) avarice_OBJECTS = $(am_avarice_OBJECTS) avarice_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ SOURCES = $(avarice_SOURCES) DIST_SOURCES = $(avarice_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pathperl = @pathperl@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # # avarice - The "avarice" program. # Copyright (C) 2001 Scott Finneran # Copyright (C) 2002 Intel Corporation # Copyright (C) 2005 Joerg Wunsch # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. # # # $Id: Makefile.am,v 1.7 2011/08/30 13:40:32 joerg_wunsch Exp $ AUTOMAKE_OPTIONS = foreign avarice_SOURCES = \ avarice.h \ crc16.h \ crc16.c \ devdescr.cc \ ioreg.cc \ ioreg.h \ jtag.h \ jtag1.h \ jtag2.h \ jtag2bp.cc \ jtag2io.cc \ jtag2misc.cc \ jtag2prog.cc \ jtag2run.cc \ jtag2rw.cc \ jtag2_defs.h \ jtag2usb.cc \ jtagbp.cc \ jtaggeneric.cc \ jtagio.cc \ jtagmisc.cc \ jtagprog.cc \ jtagrun.cc \ jtagrw.cc \ main.cc \ pragma.h \ remote.cc \ remote.h \ utils.cc \ gnu_getopt.c \ gnu_getopt.h \ gnu_getopt1.c all: autoconf.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .cc .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): autoconf.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/autoconf.hin $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/autoconf.h $(srcdir)/autoconf.hin: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f autoconf.h stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) avarice$(EXEEXT): $(avarice_OBJECTS) $(avarice_DEPENDENCIES) @rm -f avarice$(EXEEXT) $(CXXLINK) $(avarice_OBJECTS) $(avarice_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devdescr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_getopt1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioreg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtag2bp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtag2io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtag2misc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtag2prog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtag2run.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtag2rw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtag2usb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtagbp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtaggeneric.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtagio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtagmisc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtagprog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtagrun.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jtagrw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .cc.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) autoconf.hin $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) autoconf.hin $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) autoconf.hin $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) autoconf.hin $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) autoconf.h installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS # 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: avarice-2.11.orig/src/autoconf.hin0000644000000000000000000001165511627171065014017 0ustar /* src/autoconf.hin. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the header file. */ #undef HAVE_BFD_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `gethostbyname' function. */ #undef HAVE_GETHOSTBYNAME /* Define to 1 if you have the `inet_ntoa' function. */ #undef HAVE_INET_NTOA /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `bfd' library (-lbfd). */ #undef HAVE_LIBBFD /* Define to 1 if you have the `iberty' library (-liberty). */ #undef HAVE_LIBIBERTY /* Define to 1 if you have the `iconv' library (-liconv). */ #undef HAVE_LIBICONV /* Define to 1 if you have the `intl' library (-lintl). */ #undef HAVE_LIBINTL /* Define to 1 if you have the `usb' library (-lusb). */ #undef HAVE_LIBUSB /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if `stat' has the bug that it succeeds when given the zero-length file name argument. */ #undef HAVE_STAT_EMPTY_STRING_BUG /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to the type of arg 1 for `select'. */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for `select'. */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Substitute for missing socklen_t. */ #undef socklen_t /* Define as `fork' if `vfork' does not work. */ #undef vfork avarice-2.11.orig/src/avarice.h0000644000000000000000000000337010245700616013252 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * */ #ifndef INCLUDE_AVARICE_H #define INCLUDE_AVARICE_H #include #include "autoconf.h" typedef unsigned char uchar; /** true iff --debug option specified **/ extern bool debugMode; /** true if interrupts should be stepped over when stepping */ extern bool ignoreInterrupts; /** printf 'fmt, ...' if debugMode **/ void vdebugOut(const char *fmt, va_list args); void debugOut(const char *fmt, ...); /** printf 'fmt, ...' to status file descriptor (currently stdout) **/ void vstatusOut(const char *fmt, va_list args); void statusOut(const char *fmt, ...); void statusFlush(); /** Abort program with error message 'fmt, ...' if !ok. Error message is sent via statusOut and gdbOut **/ void check(bool ok, const char *fmt, ...); /** Abort program with error message 'fmt, ...' if status < 0. Error message also includes error indicated by 'errno' Error message is sent via statusOut and gdbOut **/ void unixCheck(int status, const char *fmt, ...); #endif // INCLUDE_AVARICE_H avarice-2.11.orig/src/crc16.h0000644000000000000000000000145310245703044012554 0ustar #ifndef CRC16_H #define CRC16_H /* * Derived from CRC algorithm for JTAG ICE mkII, published in Atmel * Appnote AVR067. Converted from C++ to C. */ /* $Id: crc16.h,v 1.2 2005/05/27 20:42:12 joerg_wunsch Exp $ */ #if defined(__cplusplus) extern "C" { #endif unsigned short crcsum(const unsigned char* message, unsigned long length, unsigned short crc); /* * Verify that the last two bytes is a (LSB first) valid CRC of the * message. */ int crcverify(const unsigned char* message, unsigned long length); /* * Append a two byte CRC (LSB first) to message. length is size of * message excluding crc. Space for the CRC bytes must be allocated * in advance! */ void crcappend(unsigned char* message, unsigned long length); #if defined(__cplusplus) } #endif #endif avarice-2.11.orig/src/crc16.c0000644000000000000000000000641410245703044012551 0ustar /* * Derived from CRC algorithm for JTAG ICE mkII, published in Atmel * Appnote AVR067. Converted from C++ to C. */ /* $Id: crc16.c,v 1.2 2005/05/27 20:42:12 joerg_wunsch Exp $ */ #include "crc16.h" /* CRC16 Definitions */ const unsigned short crc_table[256] = { 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 }; /* CRC calculation macros */ #define CRC_INIT 0xFFFF #define CRC(crcval,newchar) crcval = (crcval >> 8) ^ \ crc_table[(crcval ^ newchar) & 0x00ff] unsigned short crcsum(const unsigned char* message, unsigned long length, unsigned short crc) { unsigned long i; for(i = 0; i < length; i++) { CRC(crc, message[i]); } return crc; } int crcverify(const unsigned char* message, unsigned long length) { /* * Returns true if the last two bytes in a message is the crc of the * preceding bytes. */ unsigned short expected; expected = crcsum(message, length - 2, CRC_INIT); return (expected & 0xff) == message[length - 2] && ((expected >> 8) & 0xff) == message[length - 1]; } void crcappend(unsigned char* message, unsigned long length) { unsigned long crc; crc = crcsum(message, length, CRC_INIT); message[length] = (unsigned char)(crc & 0xff); message[length+1] = (unsigned char)((crc >> 8) & 0xff); } avarice-2.11.orig/src/devdescr.cc0000644000000000000000000045703211627164120013604 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002, 2003, 2004 Intel Corporation * Copyright (C) 2005-2008 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains the JTAG ICE device descriptors of all supported * MCU types for both, the mkI and mkII protocol. * * $Id: devdescr.cc,v 1.28 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #include #include "avarice.h" #include "jtag.h" #include "jtag1.h" jtag_device_def_type *global_p_device_def; /* Device descriptor magic from Atmel's documents. Let's hope it's more accurate than the rest of that text... */ // This is a sparse table: PRAGMA_DIAG_IGNORED("-Wmissing-field-initializers") jtag_device_def_type deviceDefinitions[] = { { "atmega16", 0x9403, 128, 128, // 16K flash 4, 128, // 512 bytes EEPROM 0x54, // 21 interrupt vectors DEVFL_NONE, atmega16_io_registers, false, { JTAG_C_SET_DEVICE_DESCRIPTOR, { 0xCF, 0xAF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF }, { 0x87, 0x26, 0xFF, 0xEF, 0xFE, 0xFF, 0x3F, 0xFA }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x31, 0x57, 0x00, { 128, 0 }, 0, { 0x80, 0x1F, 0x00, 0x00 }, 0, { JTAG_EOM } }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0x6F,0xFF,0xFF,0xFE,0xFF,0xFD,0xFF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucReadIOShadow { 0x8F,0x26,0xB6,0xFD,0xFE,0xFF,0xBD,0xFA }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucWriteIOShadow { 0 }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0 }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x1F80), // ulBootAddress fill_b2(0), // uiUpperExtIOLoc fill_b4(0x4000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x4000 / 128), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 1, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1c), // EECRAddress }, }, // DEV_ATMEGA_162 { "atmega162", 0x9404, 128, 128, // 16K flash 4, 128, // 512 bytes EEPROM 0x70, // 28 interrupt vectors DEVFL_NONE, atmega162_io_registers, false, { JTAG_C_SET_DEVICE_DESCRIPTOR, { 0xF7, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, { 0xF3, 0x66, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x02, 0x18, 0x00, 0x30, 0xF3, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x02, 0x18, 0x00, 0x20, 0xF3, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x04, 0x57, 0x00, { 128, 0 }, 4, { 0x80, 0x1F, 0x00, 0x00 }, 0x8B, { JTAG_EOM } }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xE7,0x6F,0xFF,0xFF,0xFE,0xFF,0xFF,0xEF }, // ucReadIO { 0xC3,0x26,0xB6,0xFD,0xFE,0xFF,0xFF,0xEA }, // ucReadIOShadow { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X10 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X10 }, // ucWriteIOShadow { 0 }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0 }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x04, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x1F80), // ulBootAddress fill_b2(0xBB), // uiUpperExtIOLoc fill_b4(0x4000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x4000 / 128), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 1, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1c), // EECRAddress }, }, // DEV_ATMEGA_169 { "atmega169", 0x9405, 128, 128, // 16K flash 4, 128, // 512 bytes EEPROM 0x5c, // 23 interrupt vectors DEVFL_NONE, atmega169_io_registers, false, { JTAG_C_SET_DEVICE_DESCRIPTOR, { 0xFF, 0xFF, 0xFF, 0xF0, 0xDF, 0x3C, 0xBB, 0xE0 }, { 0xB6, 0x6D, 0x1B, 0xE0, 0xDF, 0x3C, 0xBA, 0xE0 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x43, 0xDA, 0x00, 0xFF, 0xF7, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x07, 0x37, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xDE, 0x7B }, { 0x43, 0xDA, 0x00, 0xFF, 0xF7, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x05, 0x36, 0x00, 0x00, 0x00, 0xE0, 0xF0, 0xDE, 0x7B }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x31, 0x57, 0x00, { 128, 0 }, 4, { 0x80, 0x1F, 0x00, 0x00 }, 0xFE, { JTAG_EOM } }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x53,0xDA,0x01,0xDF,0xF7,0x0F,0x00,0x00,0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x00,0xF0,0xF0,0xDE,0x7B }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x53,0xDA,0x01,0xD8,0xF7,0x0F,0x00,0x00,0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x00,0xE0,0xF0,0xDE,0x7B }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x1F80), // ulBootAddress fill_b2(0xFE), // uiUpperExtIOLoc fill_b4(0x4000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x4000 / 128), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 1, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1f), // EECRAddress }, }, // DEV_ATMEGA_323 { "atmega323", 0x9501, 128, 256, // 32K flash 4, 256, // 1K EEPROM 0x50, // 20 interrupt vectors DEVFL_NONE, NULL, // io reg defs not defined yet false, { JTAG_C_SET_DEVICE_DESCRIPTOR, { 0xCF, 0xAF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF }, { 0x87, 0x26, 0xFF, 0xEF, 0xFE, 0xFF, 0x3F, 0xFA }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x31, 0x57, 0x00, { 128, 0 }, 0, { 0x00, 0x3F, 0x00, 0x00 }, 0, { JTAG_EOM } }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0x6F,0xFF,0xFF,0xFE,0xFF,0xFD,0xFF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucReadIOShadow { 0x8F,0x26,0xB6,0xFD,0xFE,0xFF,0xBD,0xFA }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucWriteIOShadow { 0 }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0 }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0), // uiUpperExtIOLoc fill_b4(0x8000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x8000 / 128), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 1, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1c), // EECRAddress }, }, // DEV_ATMEGA_32 { "atmega32", 0x9502, 128, 256, // 32K flash 4, 256, // 1K EEPROM 0x54, // 21 interrupt vectors DEVFL_NONE, atmega32_io_registers, false, { JTAG_C_SET_DEVICE_DESCRIPTOR, { 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, { 0xFF, 0x66, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFA }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x31, 0x57, 0x00, { 128, 0 }, 4, { 0x00, 0x3F, 0x00, 0x00 }, 0, { JTAG_EOM } }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0x6F,0xFF,0xFF,0xFE,0xFF,0xFD,0xFF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucReadIOShadow { 0x8F,0x26,0xB6,0xFD,0xFE,0xFF,0xBD,0xFA }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucWriteIOShadow { 0 }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0 }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0), // uiUpperExtIOLoc fill_b4(0x8000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x8000 / 128), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 1, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1c), // EECRAddress }, }, // DEV_ATMEGA_64 { "atmega64", 0x9602, 256, 256, // 64K flash 8, 256, // 2K bytes EEPROM 0x8c, // 35 interrupt vectors DEVFL_NONE, atmega128_io_registers, false, { JTAG_C_SET_DEVICE_DESCRIPTOR, { 0xCF, 0x2F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, { 0xCF, 0x27, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x3E, 0xB5, 0x1F, 0x37, 0xFF, 0x1F, 0x21, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x3E, 0xB5, 0x0F, 0x27, 0xFF, 0x1F, 0x21, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x22, 0x68, 0x00, { 0, 1 }, 8, { 0x00, 0x7E, 0x00, 0x00 }, 0x9D, { JTAG_EOM } }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0x6F,0xFF,0xFF,0xFB,0xFF,0xFF,0xF7 }, // ucReadIO { 0 }, // ucReadIOShadow { 0x8C,0x26,0xB6,0xFD,0xFB,0xFF,0xBF,0xF6}, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x3E,0xB5,0x1F,0x37,0xFF,0x5F,0x21,0x2F, /* ... */ }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x36,0xB5,0x0F,0x27,0xFF,0x5F,0x21,0x27, /* ... */ }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x22, // ucIDRAddress 0x68, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0x7E00), // ulBootAddress fill_b2(0x9D), // uiUpperExtIOLoc fill_b4(0x10000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x10000 / 256), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 1, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1c), // EECRAddress }, }, // DEV_ATMEGA_128 { "atmega128", 0x9702, 256, 512, // 128K flash 8, 512, // 4K bytes EEPROM 0x8c, // 35 interrupt vectors DEVFL_NO_SOFTBP, atmega128_io_registers, false, { JTAG_C_SET_DEVICE_DESCRIPTOR, { 0xCF, 0x2F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, { 0xCF, 0x27, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x3E, 0xB5, 0x1F, 0x37, 0xFF, 0x1F, 0x21, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x3E, 0xB5, 0x0F, 0x27, 0xFF, 0x1F, 0x21, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x22, 0x68, 0x3B, { 0, 1 }, 8, { 0x00, 0xFE, 0x00, 0x00 }, 0x9D, { JTAG_EOM } }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0x6F,0xFF,0xFF,0xFB,0xFF,0xFF,0xFF }, // ucReadIO { 0 }, // ucReadIOShadow { 0x8C,0x26,0xB6,0xFD,0xFB,0xFF,0xBF,0xFE}, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x3E,0xB5,0x1F,0x37,0xFF,0x1F,0x21,0x2F, /* ... */ }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x36,0xB5,0x0F,0x27,0xFF,0x1F,0x21,0x27, /* ... */ }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x22, // ucIDRAddress 0x68, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0xFE00), // ulBootAddress fill_b2(0x9D), // uiUpperExtIOLoc fill_b4(0x20000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x20000 / 256), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 1, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1c), // EECRAddress }, }, // DEV_ATCAN_128 { "at90can128", 0x9781, 256, 512, // 128K flash 8, 512, // 4K bytes EEPROM 0x94, // 37 interrupt vectors DEVFL_NONE, iocan128_io_registers, false, { JTAG_C_SET_DEVICE_DESCRIPTOR, { 0xFF, 0xFF, 0xFF, 0xF1, 0xDF, 0x7C, 0xBB, 0xE8 }, { 0xFF, 0xFF, 0xFF, 0xF1, 0xDF, 0x7C, 0xBB, 0xE8 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x43, 0xC3, 0x33, 0xBF, 0xF7, 0x3F, 0xF7, 0x3F, 0x00, 0x00, 0x4D, 0x1F, 0x77, 0x77, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x07 }, { 0x43, 0xC3, 0x33, 0xBC, 0x77, 0x77, 0xF7, 0x3F, 0x00, 0x00, 0x4D, 0x1F, 0x00, 0x00, 0x00, 0xCD, 0x3C, 0xF0, 0xFF, 0x04 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x22, 0x57, 0x3B, { 0, 1 }, 8, { 0x00, 0xFE, 0x00, 0x00 }, 0xFA, { JTAG_EOM } }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF1,0xDF,0x3C,0xB9,0xE8 }, // ucReadIO { 0 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE8 }, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x43,0xC6,0x33,0xDF,0xF7,0x3F,0xF7,0x3F,0x00,0x00,0x4D,0x1F,0x37,0x37,0x00,0xFF,0xFF,0xFF,0xFF,0x07 }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x43,0xC6,0x33,0xD8,0xF7,0x3F,0xF7,0x3F,0x00,0x00,0x4D,0x0F,0x36,0x36,0x00,0xC9,0x3C,0xF0,0xFF,0x04 }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0xFE00), // ulBootAddress fill_b2(0xFA), // uiUpperExtIOLoc fill_b4(0x20000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x20000 / 256), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 0, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1f), // EECRAddress }, }, // DEV_ATMEGA164P { "atmega164p", 0x940a, 128, 128, // 16384 bytes flash 4, 128, // 512 bytes EEPROM 31 * 4, // 31 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0x0F,0xE0,0xF8,0xFF,0x3D,0xB9,0xE8 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x0D,0x00,0xE0,0xFF,0x1D,0xB8,0xE8 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFB,0x09,0xDF,0xF3,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x3F,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x51,0xFB,0x09,0xD8,0xF3,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x2F,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x1f80), // ulBootAddress fill_b2(0x00C6), // uiUpperExtIOLoc fill_b4(16384), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(16384 / 128), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA324P { "atmega324p", 0x9508, 128, 256, // 32768 bytes flash 4, 256, // 1024 bytes EEPROM 31 * 4, // 31 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0x0F,0xE0,0xF8,0xFF,0x3D,0xB9,0xE8 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x0D,0x00,0xE0,0xFF,0x1D,0xB8,0xE8 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFB,0x09,0xDF,0xF3,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x3F,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x51,0xFB,0x09,0xD8,0xF3,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x2F,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3f00), // ulBootAddress fill_b2(0x00C6), // uiUpperExtIOLoc fill_b4(32768), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(32768 / 128), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA644 { "atmega644", 0x9609, 256, 256, // 64K flash 8, 256, // 2K bytes EEPROM 28 * 4, // 28 interrupt vectors DEVFL_MKII_ONLY, NULL, // not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0x0F,0xE0,0xF8,0xFF,0x3D,0xB9,0xE8 }, // ucReadIO { 0 }, // ucReadIOShadow { 0xB6,0x0D,0x00,0xE0,0xFF,0x1D,0xB8,0xE8 }, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x53,0xFB,0x9,0xDF,0xF7,0xF,0x0,0x0,0x0,0x0,0x5F,0x3F,0x37 }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x53,0xFB,0x9,0xD8,0xF7,0xF,0x0,0x0,0x0,0x0,0x5F,0x2F,0x36 }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0x7E00), // ulBootAddress fill_b2(0xC6), // uiUpperExtIOLoc fill_b4(0x10000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x10000 / 256), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 0, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1f), // EECRAddress }, }, // DEV_ATMEGA325 { "atmega325", 0x9505, 128, 256, // 32768 bytes flash 4, 256, // 1024 bytes EEPROM 22 * 4, // 22 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xDA,0x01,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x53,0xDA,0x01,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0xC6), // uiUpperExtIOLoc fill_b4(32768), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(32768 / 128), // uiFlashpages 0x00, // ucDWDRAddress 0x40, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0x40, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA3250 { "atmega3250", 0x9506, 128, 256, // 32768 bytes flash 4, 256, // 1024 bytes EEPROM 25 * 4, // 25 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFA,0x09,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x3F, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x53,0xFA,0x09,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x3F, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0xDD), // uiUpperExtIOLoc fill_b4(32768), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(32768 / 128), // uiFlashpages 0x00, // ucDWDRAddress 0x40, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0x40, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA645 { "atmega645", 0x9605, 256, 256, // 65536 bytes flash 8, 256, // 2048 bytes EEPROM 22 * 4, // 22 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xDA,0x01,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x53,0xDA,0x01,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0x7E00), // ulBootAddress fill_b2(0xC6), // uiUpperExtIOLoc fill_b4(65536), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(65536 / 256), // uiFlashpages 0x00, // ucDWDRAddress 0x40, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0x00, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA6450 { "atmega6450", 0x9606, 256, 256, // 65536 bytes flash 8, 256, // 2048 bytes EEPROM 25 * 4, // 25 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFA,0x09,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x3F, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x53,0xFA,0x09,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x3F, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0x7E00), // ulBootAddress fill_b2(0xDD), // uiUpperExtIOLoc fill_b4(65536), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(65536 / 256), // uiFlashpages 0x00, // ucDWDRAddress 0x40, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0x00, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA329 { "atmega329", 0x9503, 128, 256, // 32K flash 4, 256, // 1K bytes EEPROM 23 * 4, // 23 interrupt vectors DEVFL_MKII_ONLY, NULL, // not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x53,0xDA,0x01,0xDF,0xF7,0x0F,0x00,0x00,0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x00,0xF0,0xF0,0xDE,0x7B }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x53,0xDA,0x01,0xD8,0xF7,0x0F,0x00,0x00,0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x00,0xE0,0xF0,0xDE,0x7B }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0xFE), // uiUpperExtIOLoc fill_b4(0x8000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x8000 / 128), // uiFlashpages 0, // ucDWDRAddress 0x40, // ucDWBasePC 0, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0x0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1f), // EECRAddress }, }, // DEV_ATMEGA3290 { "atmega3290", 0x9504, 128, 256, // 32K flash 4, 256, // 1K bytes EEPROM 25 * 4, // 25 interrupt vectors DEVFL_MKII_ONLY, NULL, // not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x53,0xFA,0x09,0xDF,0xF7,0x0F,0x00,0x00,0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x3F,0xF0,0xF0,0xFF,0xFF }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x53,0xFA,0x09,0xD8,0xF7,0x0F,0x00,0x00,0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x3F,0xE0,0xF0,0xFF,0xFF }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0xFE), // uiUpperExtIOLoc fill_b4(0x8000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x8000 / 128), // uiFlashpages 0, // ucDWDRAddress 0x40, // ucDWBasePC 0, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0x0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1f), // EECRAddress }, }, // DEV_ATMEGA649 { "atmega649", 0x9603, 256, 256, // 64K flash 8, 256, // 2K bytes EEPROM 23 * 4, // 23 interrupt vectors DEVFL_MKII_ONLY, NULL, // not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x53,0xDA,0x01,0xDF,0xF7,0x0F,0x00,0x00,0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x00,0xF0,0xF0,0xDE,0x7B }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x53,0xDA,0x01,0xD8,0xF7,0x0F,0x00,0x00,0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x00,0xE0,0xF0,0xDE,0x7B }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0x7E00), // ulBootAddress fill_b2(0xFE), // uiUpperExtIOLoc fill_b4(0x10000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x10000 / 256), // uiFlashpages 0, // ucDWDRAddress 0x40, // ucDWBasePC 0, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0x0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1f), // EECRAddress }, }, // DEV_ATMEGA6490 { "atmega6490", 0x9604, 256, 256, // 64K flash 8, 256, // 2K bytes EEPROM 25 * 4, // 25 interrupt vectors DEVFL_MKII_ONLY, NULL, // not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x53,0xFA,0x09,0xDF,0xF7,0x0F,0x00,0x00,0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x3F,0xF0,0xF0,0xFF,0xFF }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x53,0xFA,0x09,0xD8,0xF7,0x0F,0x00,0x00,0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x3F,0xE0,0xF0,0xFF,0xFF }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0x7E00), // ulBootAddress fill_b2(0xFF), // uiUpperExtIOLoc fill_b4(0x10000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x10000 / 256), // uiFlashpages 0, // ucDWDRAddress 0x40, // ucDWBasePC 0, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0x0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1f), // EECRAddress }, }, // DEV_ATMEGA_640 { "atmega640", 0x9608, 256, 256, // 64K flash 8, 512, // 4K bytes EEPROM 0xe4, // 57 interrupt vectors DEVFL_MKII_ONLY, atmega128_io_registers, // XXX should be changed false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xFF,0xFF,0x3D,0xB9,0xF8 }, // ucReadIO { 0 }, // ucReadIOShadow { 0xFF,0xFF,0x1F,0xE0,0xFF,0x1D,0xA9,0xF8 }, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x73,0xFF,0x3F,0xFF,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x3F,0x37,0x37,0x36,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7, 0x3F, 0x36,0x00 }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x73,0xFF,0x3F,0xF8,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x2F,0x36,0x36,0x36,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7, 0x3F, 0x36,0x00 }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0x7E00), // ulBootAddress fill_b2(0x0136), // uiUpperExtIOLoc fill_b4(0x20000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x10000 / 256), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 0, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x200), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0x3c, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA_1280 { "atmega1280", 0x9703, 256, 512, // 128K flash 8, 512, // 4K bytes EEPROM 0xe4, // 57 interrupt vectors DEVFL_MKII_ONLY, atmega128_io_registers, // XXX should be changed false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xFF,0xFF,0x3D,0xB9,0xF8 }, // ucReadIO { 0 }, // ucReadIOShadow { 0xFF,0xFF,0x1F,0xE0,0xFF,0x1D,0xA9,0xF8 }, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x73,0xFF,0x3F,0xFF,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x3F,0x37,0x37,0x36,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7, 0x3F, 0x36,0x00 }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x73,0xFF,0x3F,0xF8,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x2F,0x36,0x36,0x36,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7, 0x3F, 0x36,0x00 }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0xFE00), // ulBootAddress fill_b2(0x0136), // uiUpperExtIOLoc fill_b4(0x20000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x20000 / 256), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 0, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x200), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0x3c, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA_1281 { "atmega1281", 0x9704, 256, 512, // 128K flash 8, 512, // 4K bytes EEPROM 0xe4, // 57 interrupt vectors DEVFL_MKII_ONLY, atmega128_io_registers, // XXX should be changed false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF9,0xFF,0x3D,0xB9,0xF8 }, // ucReadIO { 0 }, // ucReadIOShadow { 0xFF,0xFF,0x1F,0xE0,0xFF,0x1D,0xA9,0xF8 }, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x73,0xFF,0x3F,0xFF,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x3F,0x37,0x37,0x36,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7, 0x3F, 0x36,0x00 }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x73,0xFF,0x3F,0xF8,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x2F,0x36,0x36,0x36,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7, 0x3F, 0x36,0x00 }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0xFE00), // ulBootAddress fill_b2(0x0136), // uiUpperExtIOLoc fill_b4(0x20000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x20000 / 256), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 0, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x200), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0x3c, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA_2560 { "atmega2560", 0x9801, 256, 1024, // 256K flash 8, 512, // 4K bytes EEPROM 0xe4, // 57 interrupt vectors DEVFL_MKII_ONLY, atmega128_io_registers, // XXX should be changed false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xFF,0xFF,0x3D,0xB9,0xF8 }, // ucReadIO { 0 }, // ucReadIOShadow { 0xFF,0xFF,0x1F,0xE0,0xFF,0x1D,0xA9,0xF8 }, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x73,0xFF,0x3F,0xFF,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x3F,0x37,0x37,0x37,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7, 0x3F, 0x37 }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x73,0xFF,0x3F,0xF8,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x2F,0x36,0x36,0x36,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7, 0x3F, 0x36 }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0x1FE00), // ulBootAddress fill_b2(0x0136), // uiUpperExtIOLoc fill_b4(0x40000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x40000 / 256), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 0, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x200), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0x3c, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA_2561 { "atmega2561", 0x9802, 256, 1024, // 256K flash 8, 512, // 4K bytes EEPROM 0xe4, // 57 interrupt vectors DEVFL_MKII_ONLY, atmega128_io_registers, // XXX should be changed false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xFF,0xFF,0x3D,0xB9,0xF8 }, // ucReadIO { 0 }, // ucReadIOShadow { 0xFF,0xFF,0x1F,0xE0,0xFF,0x1D,0xA9,0xF8 }, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x73,0xFF,0x3F,0xFF,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x3F,0x37,0x37,0x37,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7, 0x3F, 0x37 }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x73,0xFF,0x3F,0xF8,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x2F,0x36,0x36,0x36,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7, 0x3F, 0x36 }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0x1FE00), // ulBootAddress fill_b2(0x0136), // uiUpperExtIOLoc fill_b4(0x40000), // ulFlashSize { 0 }, // ucEepromInst { 0 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x40000 / 256), // uiFlashpages 0, // ucDWDRAddress 0, // ucDWBasePC 0, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x200), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0x3c, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA48 { "atmega48", 0x9205, 64, 64, // 4K flash 4, 64, // 256 bytes EEPROM 26 * 2, // 26 interrupt vectors DEVFL_MKII_ONLY, NULL, // not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x0F,0xE0,0xF8,0xFB,0x3D,0xB9,0xE0 }, // ucReadIO { 0 }, // ucReadIOShadow { 0xB0,0x0D,0x00,0xE0,0xFB,0x1D,0xB8,0xE0 }, // ucWriteIO { 0 }, // ucWriteIOShadow { 0x53,0xFB,0x01,0xDF,0xF3,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x3F,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0 }, // ucReadIOExtShadow { 0x10,0xFB,0x01,0xD8,0xF3,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x2F,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0 }, // ucWriteIOExtShadow 0, // ucIDRAddress 0, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0), // ulBootAddress fill_b2(0xC6), // uiUpperExtIOLoc fill_b4(0x1000), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3e, // ucSPHaddr 0x3d, // ucSPLaddr fill_b2(0x1000 / 64), // uiFlashpages 0x31, // ucDWDRAddress 0x18, // ucDWBasePC 0, // ucAllowFullPageBitstream fill_b2(0), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA88 { "atmega88", 0x930A, 64, 128, // 8192 bytes flash 4, 128, // 512 bytes EEPROM 26 * 2, // 26 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x0F,0xE0,0xF8,0xFF,0x3D,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB0,0x0D,0x00,0xE0,0xFF,0x1D,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFB,0x01,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x3F,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x10,0xFB,0x01,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x2F,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0F80), // ulBootAddress fill_b2(0xC6), // uiUpperExtIOLoc fill_b4(8192), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(8192 / 64), // uiFlashpages 0x31, // ucDWDRAddress 0x10, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0xF80), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA168 { "atmega168", 0x9406, 128, 128, // 16384 bytes flash 4, 128, // 512 bytes EEPROM 26 * 4, // 26 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x0F,0xE0,0xF8,0xFF,0x3D,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB0,0x0D,0x00,0xE0,0xFF,0x1D,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFB,0x01,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x3F,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x10,0xFB,0x01,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x2F,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x1F80), // ulBootAddress fill_b2(0xC6), // uiUpperExtIOLoc fill_b4(16384), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(16384 / 128), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x1F80), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATTINY13 { "attiny13", 0x9007, 32, 32, // 1024 bytes flash 1, 64, // 64 bytes EEPROM 10 * 2, // 10 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x01,0xF0,0x71,0x42,0x83,0xFE,0xAF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0x88,0x00,0xB0,0x71,0x00,0x83,0x7C,0xAA }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(32), // uiFlashPageSize 1, // ucEepromPageSize fill_b4(0x0000), // ulBootAddress fill_b2(0x00), // uiUpperExtIOLoc fill_b4(1024), // ulFlashSize { 0xBB,0xFE,0xBB,0xEE,0xBB,0xCC,0xB2,0x0D, 0xBC,0x0E,0xB4,0x0E,0xBA,0x0D,0xBB,0xBC, 0x99,0xE1,0xBB,0xAC }, // ucEepromInst { 0xB4,0x0E,0x1E }, // ucFlashInst 0, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(1024 / 32), // uiFlashpages 0x2E, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1C), // EECRAddress }, }, // DEV_ATTINY2313 { "attiny2313", 0x910A, 32, 64, // 2048 bytes flash 4, 32, // 128 bytes EEPROM 19 * 2, // 19 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0x0E,0xEF,0xFF,0x7F,0x3F,0xFF,0x7F,0xBF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0x0E,0xA6,0xBE,0x7D,0x39,0xFF,0x7D,0xBA }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(32), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0000), // ulBootAddress fill_b2(0x00), // uiUpperExtIOLoc fill_b4(2048), // ulFlashSize { 0xBB,0xFE,0xBB,0xEE,0xBB,0xCC,0xB2,0x0D, 0xBA,0x0F,0xB2,0x0F,0xBA,0x0D,0xBB,0xBC, 0x99,0xE1,0xBB,0xAC }, // ucEepromInst { 0xB2,0x0F,0x1F }, // ucFlashInst 0, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(2048 / 32), // uiFlashpages 0x1F, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1C), // EECRAddress }, }, // DEV_AT90PWM2 { "at90pwm2", 0x9381, 64, 128, // 8192 bytes flash 4, 128, // 512 bytes EEPROM 32 * 2, // 32 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x7F,0x60,0xFE,0xFF,0x33,0xBD,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xF8,0x7F,0x40,0xEE,0xFF,0x33,0xBC,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xC2,0xC0,0xDF,0xF7,0x0F,0x00,0x00, 0x3F,0xE4,0x00,0x00,0x36,0x37,0x01,0xFC, 0x05,0xFC,0x07,0xFC }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x11,0xC2,0xC0,0xD8,0xF7,0x0F,0x00,0x00, 0x3F,0xE4,0x00,0x00,0x36,0x33,0x01,0xFC, 0x05,0xFC,0x07,0xFC }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0F80), // ulBootAddress fill_b2(0xFF), // uiUpperExtIOLoc fill_b4(8192), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(8192 / 64), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0xF80), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x0100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_AT90PWM3 { "at90pwm3", 0x9381, 64, 128, // 8192 bytes flash 4, 128, // 512 bytes EEPROM 32 * 2, // 32 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x7F,0x60,0xFE,0xFF,0x33,0xBD,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xF8,0x7F,0x40,0xEE,0xFF,0x33,0xBC,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xC2,0xC0,0xDF,0xF7,0x0F,0x00,0x00, 0x3F,0xE4,0x00,0x00,0x36,0x37,0x01,0xFC, 0x05,0xFC,0x07,0xFC }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x11,0xC2,0xC0,0xD8,0xF7,0x0F,0x00,0x00, 0x3F,0xE4,0x00,0x00,0x36,0x33,0x01,0xFC, 0x05,0xFC,0x07,0xFC }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0F80), // ulBootAddress fill_b2(0xFF), // uiUpperExtIOLoc fill_b4(8192), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(8192 / 64), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0xF80), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x0100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_AT90PWM2B { "at90pwm2b", 0x9383, 64, 128, // 8192 bytes flash 4, 128, // 512 bytes EEPROM 32 * 2, // 32 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x7F,0x60,0xFE,0xFF,0x33,0xBD,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xF8,0x7F,0x40,0xEE,0xFF,0x33,0xBC,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xC2,0xC0,0xDF,0xF7,0x0F,0x00,0x00, 0x3F,0xE4,0x00,0x00,0x36,0x37,0x01,0xFC, 0x05,0xFC,0x07,0xFC }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x11,0xC2,0xC0,0xD8,0xF7,0x0F,0x00,0x00, 0x3F,0xE4,0x00,0x00,0x36,0x33,0x01,0xFC, 0x05,0xFC,0x07,0xFC }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0F80), // ulBootAddress fill_b2(0xFF), // uiUpperExtIOLoc fill_b4(8192), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(8192 / 64), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0xF80), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x0100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_AT90PWM3B { "at90pwm3b", 0x9383, 64, 128, // 8192 bytes flash 4, 128, // 512 bytes EEPROM 32 * 2, // 32 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x7F,0x60,0xFE,0xFF,0x33,0xBD,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xF8,0x7F,0x40,0xEE,0xFF,0x33,0xBC,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xC2,0xC0,0xDF,0xF7,0x0F,0x00,0x00, 0x3F,0xE4,0x00,0x00,0x36,0x37,0x01,0xFC, 0x05,0xFC,0x07,0xFC }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x11,0xC2,0xC0,0xD8,0xF7,0x0F,0x00,0x00, 0x3F,0xE4,0x00,0x00,0x36,0x33,0x01,0xFC, 0x05,0xFC,0x07,0xFC }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0F80), // ulBootAddress fill_b2(0xFF), // uiUpperExtIOLoc fill_b4(8192), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(8192 / 64), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0xF80), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x0100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATTINY24 { "attiny24", 0x910B, 32, 64, // 2048 bytes flash 4, 32, // 128 bytes EEPROM 17 * 2, // 17 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFB,0xF9,0xFD,0xFF,0x7F,0xFF,0xFF,0xFF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0x8B,0xB0,0xFC,0xFF,0x7D,0xFF,0xFD,0xFA }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(32), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0000), // ulBootAddress fill_b2(0x00), // uiUpperExtIOLoc fill_b4(2048), // ulFlashSize { 0xBB,0xFF,0xBB,0xEE,0xBB,0xCC,0xB2,0x0D, 0xBC,0x07,0xB4,0x07,0xBA,0x0D,0xBB,0xBC, 0x99,0xE1,0xBB,0xAC, }, // ucEepromInst { 0xB4,0x07,0x17 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(2048 / 32), // uiFlashpages 0x27, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1C), // EECRAddress }, }, // DEV_ATTINY44 { "attiny44", 0x9207, 64, 64, // 4096 bytes flash 4, 64, // 256 bytes EEPROM 17 * 2, // 17 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFB,0xF9,0xFD,0xFF,0x7F,0xFF,0xFF,0xFF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0x8B,0xB0,0xFC,0xFF,0x7D,0xFF,0xFD,0xFA }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0000), // ulBootAddress fill_b2(0x00), // uiUpperExtIOLoc fill_b4(4096), // ulFlashSize { 0xBB,0xFF,0xBB,0xEE,0xBB,0xCC,0xB2,0x0D, 0xBC,0x07,0xB4,0x07,0xBA,0x0D,0xBB,0xBC, 0x99,0xE1,0xBB,0xAC, }, // ucEepromInst { 0xB4,0x07,0x17 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(4096 / 64), // uiFlashpages 0x27, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1C), // EECRAddress }, }, // DEV_ATTINY84 { "attiny84", 0x930C, 64, 128, // 8192 bytes flash 4, 128, // 512 bytes EEPROM 17 * 2, // 17 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFB,0xF9,0xFD,0xFF,0x7F,0xFF,0xFF,0xFF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0x8B,0xB0,0xFC,0xFF,0x7D,0xFF,0xFD,0xFA }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0000), // ulBootAddress fill_b2(0x00), // uiUpperExtIOLoc fill_b4(8192), // ulFlashSize { 0xBB,0xFF,0xBB,0xEE,0xBB,0xCC,0xB2,0x0D, 0xBC,0x07,0xB4,0x07,0xBA,0x0D,0xBB,0xBC, 0x99,0xE1,0xBB,0xAC, }, // ucEepromInst { 0xB4,0x07,0x17 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(8192 / 64), // uiFlashpages 0x27, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1C), // EECRAddress }, }, // DEV_ATTINY25 { "attiny25", 0x9108, 32, 64, // 2048 bytes flash 4, 32, // 128 bytes EEPROM 15 * 2, // 15 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0xE1,0xFF,0xF1,0xFB,0xFF,0xBF,0xAF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xC8,0xE1,0xFF,0x71,0xBB,0x7F,0xAD,0xAB }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(32), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0000), // ulBootAddress fill_b2(0x00), // uiUpperExtIOLoc fill_b4(2048), // ulFlashSize { 0xBB,0xFF,0xBB,0xEE,0xBB,0xCC,0xB2,0x0D, 0xBC,0x02,0xB4,0x02,0xBA,0x0D,0xBB,0xBC, 0x99,0xE1,0xBB,0xAC }, // ucEepromInst { 0xB4,0x02,0x12 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(2048 / 32), // uiFlashpages 0x22, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1C), // EECRAddress }, }, // DEV_ATTINY45 { "attiny45", 0x9206, 64, 64, // 4096 bytes flash 4, 64, // 256 bytes EEPROM 15 * 2, // 15 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0xE1,0xFF,0xF1,0xFB,0xFF,0xBF,0xEF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xC8,0xE1,0xFF,0x71,0xBB,0x7F,0xAD,0xEB }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0000), // ulBootAddress fill_b2(0x00), // uiUpperExtIOLoc fill_b4(4096), // ulFlashSize { 0xBB,0xFF,0xBB,0xEE,0xBB,0xCC,0xB2,0x0D, 0xBC,0x02,0xB4,0x02,0xBA,0x0D,0xBB,0xBC, 0x99,0xE1,0xBB,0xAC }, // ucEepromInst { 0xB4,0x02,0x12 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(4096 / 64), // uiFlashpages 0x22, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1C), // EECRAddress }, }, // DEV_ATTINY85 { "attiny85", 0x930B, 64, 128, // 8192 bytes flash 4, 128, // 512 bytes EEPROM 15 * 2, // 15 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0xE1,0xFF,0xF1,0xFB,0xFF,0xBF,0xEF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xC8,0xE1,0xFF,0x71,0xBB,0x7F,0xAD,0xEB }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0000), // ulBootAddress fill_b2(0x00), // uiUpperExtIOLoc fill_b4(8192), // ulFlashSize { 0xBB,0xFF,0xBB,0xEE,0xBB,0xCC,0xB2,0x0D, 0xBC,0x02,0xB4,0x02,0xBA,0x0D,0xBB,0xBC, 0x99,0xE1,0xBB,0xAC }, // ucEepromInst { 0xB4,0x02,0x12 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(8192 / 64), // uiFlashpages 0x22, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1C), // EECRAddress }, }, // DEV_ATTINY261 { "attiny261", 0x910C, 32, 64, // 2048 bytes flash 4, 32, // 128 bytes EEPROM 19 * 2, // 19 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xFF,0xFE,0xFB,0xFF,0xEF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0x8F,0xBF,0xBE,0xFD,0xFC,0xBA,0xFD,0xEA }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(32), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0), // ulBootAddress fill_b2(0x0000), // uiUpperExtIOLoc fill_b4(2048), // ulFlashSize { 0xBB,0xFF,0xBB,0xEE,0xBB,0xCC,0xB2,0x0D, 0xBC,0x00,0xB4,0x00,0xBA,0x0D,0xBB,0xBC, 0x99,0xE1,0xBB,0xAC }, // ucEepromInst { 0xB4,0x00,0x10 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(2048 / 32), // uiFlashpages 0x20, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1C), // EECRAddress }, }, // DEV_ATTINY461 { "attiny461", 0x9208, 64, 64, // 4096 bytes flash 4, 64, // 256 bytes EEPROM 19 * 2, // 19 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xFF,0xFE,0xFB,0xFF,0xEF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0x8F,0xBF,0xBE,0xFD,0xFC,0xBA,0xFD,0xEA }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0), // ulBootAddress fill_b2(0x0000), // uiUpperExtIOLoc fill_b4(4096), // ulFlashSize { 0xBB,0xFF,0xBB,0xEE,0xBB,0xCC,0xB2,0x0D, 0xBC,0x00,0xB4,0x00,0xBA,0x0D,0xBB,0xBC, 0x99,0xE1,0xBB,0xAC }, // ucEepromInst { 0xB4,0x00,0x10 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(4096 / 64), // uiFlashpages 0x20, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1C), // EECRAddress }, }, // DEV_ATTINY861 { "attiny861", 0x930D, 64, 128, // 8192 bytes flash 4, 128, // 512 bytes EEPROM 19 * 2, // 19 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xFF,0xFE,0xFB,0xFF,0xEF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0x8F,0xBF,0xBE,0xFD,0xFC,0xBA,0xFD,0xEA }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0), // ulBootAddress fill_b2(0x0000), // uiUpperExtIOLoc fill_b4(8192), // ulFlashSize { 0xBB,0xFF,0xBB,0xEE,0xBB,0xCC,0xB2,0x0D, 0xBC,0x00,0xB4,0x00,0xBA,0x0D,0xBB,0xBC, 0x99,0xE1,0xBB,0xAC }, // ucEepromInst { 0xB4,0x00,0x10 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(8192 / 64), // uiFlashpages 0x20, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1C), // EECRAddress }, }, // DEV_ATMEGA32C1 { "atmega32c1", 0x9586, 128, 256, // 32768 bytes flash 4, 256, // 1024 bytes EEPROM 31 * 4, // 31 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x7F,0x60,0xF6,0xFF,0x33,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB0,0x6D,0x00,0xE6,0xFF,0x13,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xC2,0xE0,0xDF,0xF7,0x0F,0xF7,0x00, 0xFF,0xFF,0xFF,0x1F,0x00,0xFF,0x07,0x5F, 0x1D,0xF0,0xFF }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x10,0xC2,0xE0,0xD8,0xF7,0x0F,0xF7,0x00, 0xFF,0xFF,0xFF,0x1F,0x00,0xF7,0x07,0x4D, 0x1C,0xF0,0xFF }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0x00FA), // uiUpperExtIOLoc fill_b4(32768), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(32768 / 128), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x3F00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x0100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA32M1 { "atmega32m1", 0x9584, 128, 256, // 32768 bytes flash 4, 256, // 1024 bytes EEPROM 31 * 4, // 31 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x7F,0x60,0xF6,0xFF,0x33,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB0,0x6D,0x00,0xE6,0xFF,0x13,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xC2,0xE0,0xDF,0xF7,0x0F,0xF7,0x00, 0xFF,0xFF,0xFF,0x1F,0x00,0xFF,0x07,0x5F, 0x1D,0xF0,0xFF }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x10,0xC2,0xE0,0xD8,0xF7,0x0F,0xF7,0x00, 0xFF,0xFF,0xFF,0x1F,0x00,0xF7,0x07,0x4D, 0x1C,0xF0,0xFF }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0x00FA), // uiUpperExtIOLoc fill_b4(32768), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(32768 / 128), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x3F00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x0100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_AT90CAN32 { "at90can32", 0x9581, 256, 128, // 32768 bytes flash 8, 128, // 1024 bytes EEPROM 37 * 4, // 37 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF1,0xDF,0x3C,0xB9,0xE8 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE8 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x43,0xC6,0x33,0xDF,0xF7,0x3F,0xF7,0x3F, 0x00,0x00,0x4D,0x1F,0x37,0x37,0x00,0xFF, 0xFF,0xFF,0xFF,0x07 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x43,0xC6,0x33,0xD8,0xF7,0x3F,0xF7,0x3F, 0x00,0x00,0x4D,0x0F,0x36,0x36,0x00,0xC9, 0x3C,0xF0,0xFF,0x04 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0x3E00), // ulBootAddress fill_b2(0xFA), // uiUpperExtIOLoc fill_b4(32768), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(32768 / 256), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0x01, // ucCacheType fill_b2(0x0100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_AT90CAN64 { "at90can64", 0x9681, 256, 256, // 65536 bytes flash 8, 256, // 2048 bytes EEPROM 37 * 4, // 37 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF1,0xDF,0x3C,0xB9,0xE8 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE8 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x43,0xC6,0x33,0xDF,0xF7,0x3F,0xF7,0x3F, 0x00,0x00,0x4D,0x1F,0x37,0x37,0x00,0xFF, 0xFF,0xFF,0xFF,0x07 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x43,0xC6,0x33,0xD8,0xF7,0x3F,0xF7,0x3F, 0x00,0x00,0x4D,0x0F,0x36,0x36,0x00,0xC9, 0x3C,0xF0,0xFF,0x04 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0x7E00), // ulBootAddress fill_b2(0xFA), // uiUpperExtIOLoc fill_b4(65536), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(65536 / 256), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0x01, // ucCacheType fill_b2(0x0100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_AT90PWM216 { "at90pwm216", 0x9483, 64, 256, // 16384 bytes flash 4, 128, // 512 bytes EEPROM 32 * 4, // 32 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x7F,0x60,0xFE,0xFF,0x33,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xF8,0x7F,0x40,0xEE,0xFF,0x33,0xBC,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xC2,0xC0,0xDF,0xF7,0x0F,0x00,0x00, 0x3F,0xE4,0x00,0x00,0x37,0x37,0xFD,0xFF, 0x00,0x00,0xFF,0xFF }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x11,0xC2,0xC0,0xD8,0xF7,0x0F,0x00,0x00, 0x3F,0xE4,0x00,0x00,0x36,0x33,0x01,0xFC, 0x05,0xFC,0x07,0xFC }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x1F00), // ulBootAddress fill_b2(0xFF), // uiUpperExtIOLoc fill_b4(16384), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(16384 / 64), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x1F00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x0100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_AT90PWM316 { "at90pwm316", 0x9483, 64, 256, // 16384 bytes flash 4, 128, // 512 bytes EEPROM 32 * 4, // 32 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x7F,0x60,0xFE,0xFF,0x33,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xF8,0x7F,0x40,0xEE,0xFF,0x33,0xBC,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xC2,0xC0,0xDF,0xF7,0x0F,0x00,0x00, 0x3F,0xE4,0x00,0x00,0x37,0x37,0xFD,0xFF, 0xFD,0xFF,0xFF,0xFF }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x11,0xC2,0xC0,0xD8,0xF7,0x0F,0x00,0x00, 0x3F,0xE4,0x00,0x00,0x36,0x33,0x01,0xFC, 0x05,0xFC,0x07,0xFC }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x1F00), // ulBootAddress fill_b2(0xFF), // uiUpperExtIOLoc fill_b4(16384), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(16384 / 64), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x1F00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x0100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_AT90USB1287 { "at90usb1287", 0x9782, 256, 512, // 131072 bytes flash 8, 512, // 4096 bytes EEPROM 38 * 4, // 38 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xE3,0xF9,0xFF,0x3F,0xB9,0xF8 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x03,0xE0,0xFF,0x1F,0xB8,0xF8 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x73,0xCF,0x33,0xDF,0xF7,0x3F,0xF7,0xFF, 0xFF,0x7F,0x5F,0x3F,0x00,0x37,0x80,0xE7, 0x7F,0xFF,0xFD,0x03 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x73,0xCF,0x33,0xD8,0xF7,0x3F,0xF7,0xFF, 0xF3,0x7F,0x5F,0x2F,0x00,0x36,0x80,0xE5, 0x0F,0x7F,0x31,0x03 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0xFE00), // ulBootAddress fill_b2(0x00FF), // uiUpperExtIOLoc fill_b4(131072), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(131072 / 256), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0x3C, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_AT90USB162 { "at90usb162", 0x9482, 128, 128, // 16384 bytes flash 4, 128, // 512 bytes EEPROM 38 * 4, // 38 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x0F,0x60,0xF8,0xFF,0x3F,0xB9,0xF0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB0,0x0D,0x00,0xE0,0xFF,0x1F,0xB8,0xF0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x7F,0xDF,0x00,0x00,0xF7,0x3F,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x3F,0x07,0x01, 0x7F,0xFF,0x15,0x0C }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x34,0xDF,0x00,0xC8,0xF7,0x3F,0x40,0x00, 0x00,0x00,0x00,0x00,0x00,0x7F,0x03,0x01, 0x0F,0x7F,0x11,0x0C }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0x00, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x1F00), // ulBootAddress fill_b2(0xFB), // uiUpperExtIOLoc fill_b4(16384), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(16384 / 128), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x1F00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0x3C, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_AT90USB646 { "at90usb646", 0x9682, 256, 256, // 65536 bytes flash 8, 256, // 2048 bytes EEPROM 38 * 4, // 38 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xE3,0xF9,0xFF,0x3F,0xB9,0xF8 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x03,0xE0,0xFF,0x1F,0xB8,0xF8 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x73,0xCF,0x33,0xDF,0xF7,0x3F,0xF7,0xFF, 0xFF,0x7F,0x5F,0x3F,0x00,0x37,0x80,0xE7, 0x7F,0xFF,0xFD,0x03 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x73,0xCF,0x33,0xD8,0xF7,0x3F,0xF7,0xFF, 0xF3,0x7F,0x5F,0x2F,0x00,0x36,0x80,0xE5, 0x0F,0x7F,0x31,0x03 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0xFE00), // ulBootAddress fill_b2(0x00FF), // uiUpperExtIOLoc fill_b4(65536), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(65536 / 256), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0x3C, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_AT90USB647 { "at90usb647", 0x9682, 256, 256, // 65536 bytes flash 8, 256, // 2048 bytes EEPROM 38 * 4, // 38 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xE3,0xF9,0xFF,0x3F,0xB9,0xF8 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x03,0xE0,0xFF,0x1F,0xB8,0xF8 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x73,0xCF,0x33,0xDF,0xF7,0x3F,0xF7,0xFF, 0xFF,0x7F,0x5F,0x3F,0x00,0x37,0x80,0xE7, 0x7F,0xFF,0xFD,0x03 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x73,0xCF,0x33,0xD8,0xF7,0x3F,0xF7,0xFF, 0xF3,0x7F,0x5F,0x2F,0x00,0x36,0x80,0xE5, 0x0F,0x7F,0x31,0x03 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0xFE00), // ulBootAddress fill_b2(0x00FF), // uiUpperExtIOLoc fill_b4(65536), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(65536 / 256), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0x3C, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA1284P { "atmega1284p", 0x9705, 256, 512, // 131072 bytes flash 8, 512, // 4096 bytes EEPROM 35 * 4, // 35 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0x0F,0xE0,0xF9,0xFF,0x3D,0xB9,0xE8 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucReadIOShadow { 0xFF,0x0F,0x00,0xE0,0xFF,0x1D,0xB8,0xE8 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x73,0xFD,0x0B,0xDF,0xF7,0x0F,0xF7,0x0F, 0x00,0x00,0x5F,0x3F,0x37,0x37,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x73,0xFD,0x0B,0xD8,0xF7,0x0F,0xF7,0x0F, 0x00,0x00,0x5F,0x2F,0x36,0x36,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0X57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0xFE00), // ulBootAddress fill_b2(0xCE), // uiUpperExtIOLoc fill_b4(131072), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(131072 / 256), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA165 { "atmega165", 0x9407, 128, 128, // 16384 bytes flash 4, 128, // 512 bytes EEPROM 22 * 4, // 22 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xDA,0x01,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x53,0xDA,0x01,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0X57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x1F80), // ulBootAddress fill_b2(0xFE), // uiUpperExtIOLoc fill_b4(16384), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(16384 / 128), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA165P { "atmega165p", 0x9407, 128, 128, // 16384 bytes flash 4, 128, // 512 bytes EEPROM 22 * 4, // 22 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xDA,0x01,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x53,0xDA,0x01,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0X57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x1F80), // ulBootAddress fill_b2(0xFE), // uiUpperExtIOLoc fill_b4(16384), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(16384 / 128), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA168P { "atmega168p", 0x940B, 128, 128, // 16384 bytes flash 4, 128, // 512 bytes EEPROM 26 * 4, // 26 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x0F,0xE0,0xF8,0xFF,0x3D,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB0,0x0D,0x00,0xE0,0xFF,0x1D,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFB,0x01,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x3F,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0xFB,0x01,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x2F,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x1F80), // ulBootAddress fill_b2(0xC6), // uiUpperExtIOLoc fill_b4(16384), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(16384 / 128), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x1F80), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA16HVA { "atmega16hva", 0x940C, 128, 128, // 16384 bytes flash 4, 64, // 256 bytes EEPROM 21 * 4, // 21 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0x7F,0x01,0xE0,0xF0,0xFB,0x3F,0xB8,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0x37,0x01,0x00,0xE0,0xFB,0x1F,0xA8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xC2,0x00,0x57,0x33,0x03,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x00, 0x7F,0x03,0xED,0x7F }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x50,0xC2,0x00,0x50,0x33,0x03,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00, 0x70,0x00,0xED,0x3F }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0), // ulBootAddress fill_b2(0xFE), // uiUpperExtIOLoc fill_b4(16384), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(16384 / 128), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA3250P { "atmega3250p", 0x950E, 128, 256, // 32768 bytes flash 4, 256, // 1024 bytes EEPROM 25 * 4, // 25 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFA,0x09,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x3F, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x53,0xFA,0x09,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x3F, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0xDD), // uiUpperExtIOLoc fill_b4(32768), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(32768 / 128), // uiFlashpages 0x00, // ucDWDRAddress 0x40, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0x40, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA325P { "atmega325p", 0x950D, 128, 256, // 32768 bytes flash 4, 256, // 1024 bytes EEPROM 22 * 4, // 22 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xDA,0x01,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x53,0xDA,0x01,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0xC6), // uiUpperExtIOLoc fill_b4(32768), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(32768 / 128), // uiFlashpages 0x00, // ucDWDRAddress 0x40, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0x40, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA328P { "atmega328p", 0x950F, 128, 256, // 32768 bytes flash 4, 256, // 1024 bytes EEPROM 26 * 4, // 26 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x0F,0xE0,0xF8,0xFF,0x3D,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB0,0x0D,0x00,0xE0,0xFF,0x1D,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFB,0x01,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x3F,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0xFB,0x01,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x2F,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0xC6), // uiUpperExtIOLoc fill_b4(32768), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(32768 / 128), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x3F00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA3290P { "atmega3290p", 0x950C, 128, 256, // 32768 bytes flash 4, 256, // 1024 bytes EEPROM 25 * 4, // 25 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFA,0x09,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x3F, 0xF0,0xF0,0xFF,0xFF }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x53,0xFA,0x09,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x3F, 0xE0,0xF0,0xFF,0xFF }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0X57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0xFF), // uiUpperExtIOLoc fill_b4(32768), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(32768 / 128), // uiFlashpages 0x00, // ucDWDRAddress 0x40, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0x40, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA329P { "atmega329p", 0x9503, 128, 256, // 32768 bytes flash 4, 256, // 1024 bytes EEPROM 23 * 4, // 23 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF0,0xDF,0x3C,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x6D,0x1B,0xE0,0xDF,0x1C,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xDA,0x01,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x07,0x37,0x00,0x00,0x00, 0xF0,0xF0,0xDE,0x7B }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x53,0xDA,0x01,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x4D,0x05,0x36,0x00,0x00,0x00, 0xE0,0xF0,0xDE,0x7B }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0X57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0xFE), // uiUpperExtIOLoc fill_b4(32768), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(32768 / 128), // uiFlashpages 0x00, // ucDWDRAddress 0x40, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0x40, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA32HVB { "atmega32hvb", 0x9510, 128, 256, // 32768 bytes flash 4, 256, // 1024 bytes EEPROM 29 * 4, // 29 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0x7F,0x01,0xE0,0xF8,0xFF,0x3F,0xB8,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0x37,0x01,0x00,0xE0,0xFF,0x1F,0xA8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xDB,0x00,0x57,0x33,0x03,0x00,0x00, 0x00,0x00,0x00,0x7F,0x00,0x01,0x17,0x00, 0xFF,0x07,0xEF,0x7F }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x50,0xDB,0x00,0x50,0x33,0x03,0x00,0x00, 0x00,0x00,0x00,0x7F,0x00,0x00,0x17,0x00, 0xCF,0x07,0xEF,0x3F }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0xFE), // uiUpperExtIOLoc fill_b4(32768), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(32768 / 128), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x3F00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA32U4 { "atmega32u4", 0x9587, 128, 256, // 32768 bytes flash 4, 256, // 1024 bytes EEPROM 43 * 4, // 43 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0xFF,0xE3,0xFB,0xFF,0x3F,0xBD,0xF8 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB0,0x6D,0x03,0xE0,0xFF,0x1F,0xBC,0xF8 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0xF3,0xCF,0x07,0xDF,0xF7,0x3F,0xF7,0x3F, 0x00,0x00,0x1F,0xFF,0xFF,0xB7,0x97,0x07, 0x7F,0xFF,0x1D }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0xF3,0xCF,0x07,0xD8,0xF7,0x3F,0xF7,0x3F, 0x00,0x00,0x1F,0xEF,0x7F,0xB6,0x97,0x05, 0x0F,0x7F,0x11 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x3F00), // ulBootAddress fill_b2(0x00FF), // uiUpperExtIOLoc fill_b4(32768), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(32768 / 128), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0x3C, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA406 { "atmega406", 0x9507, 128, 320, // 40960 bytes flash 4, 128, // 512 bytes EEPROM 23 * 4, // 23 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0x3F,0x0F,0x60,0xF8,0xFF,0x0D,0xB8,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0x37,0x0F,0x00,0xE0,0xFF,0x0D,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x55,0xDB,0x00,0x57,0x32,0x03,0x00,0x00, 0x00,0x00,0x00,0x7F,0x01,0x00,0x03,0x00, 0xFF,0x03,0xFF,0x01 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x50,0xDB,0x00,0x50,0x32,0x03,0x00,0x00, 0x00,0x00,0x00,0x6D,0x01,0x00,0x03,0x00, 0xD0,0x00,0xFB,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0X57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x4F00), // ulBootAddress fill_b2(0xF8), // uiUpperExtIOLoc fill_b4(40960), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(40960 / 128), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0x00, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA48P { "atmega48p", 0x920A, 64, 64, // 4096 bytes flash 4, 64, // 256 bytes EEPROM 26 * 2, // 26 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x0F,0xE0,0xF8,0xFB,0x3D,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB0,0x0D,0x00,0xE0,0xFB,0x1D,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFB,0x01,0xDF,0xF3,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x3F,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0xFB,0x01,0xD8,0xF3,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x2F,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0000), // ulBootAddress fill_b2(0xC6), // uiUpperExtIOLoc fill_b4(4096), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(4096 / 64), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA644P { "atmega644p", 0x960A, 256, 256, // 65536 bytes flash 8, 256, // 2048 bytes EEPROM 31 * 4, // 31 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0x0F,0xE0,0xF8,0xFF,0x3D,0xB9,0xE8 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB6,0x0D,0x00,0xE0,0xFF,0x1D,0xB8,0xE8 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFB,0x09,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x3F,0x37,0x37,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x53,0xFB,0x09,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x2F,0x36,0x36,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0X57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0x7e00), // ulBootAddress fill_b2(0xCE), // uiUpperExtIOLoc fill_b4(65536), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(65536 / 256), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATMEGA88P { "atmega88p", 0x930F, 64, 128, // 8192 bytes flash 4, 128, // 512 bytes EEPROM 26 * 2, // 26 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x0F,0xE0,0xF8,0xFF,0x3D,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB0,0x0D,0x00,0xE0,0xFF,0x1D,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFB,0x01,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x3F,0x37,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0xFB,0x01,0xD8,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x5F,0x2F,0x36,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0F80), // ulBootAddress fill_b2(0xC6), // uiUpperExtIOLoc fill_b4(8192), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(8192 / 64), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0xF80), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATTINY167 { "attiny167", 0x9487, 128, 128, // 16384 bytes flash 4, 128, // 512 bytes EEPROM 20 * 4, // 20 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0x3F,0x00,0x64,0xF8,0xEF,0x3D,0xB9,0xE0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0x36,0x00,0x04,0xE0,0xEF,0x1D,0xB8,0xE0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x5F,0xDB,0x80,0xDF,0xFF,0x0F,0x00,0x00, 0x00,0x00,0x40,0x1F,0x00,0xFF,0x07,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x1C,0xDB,0x80,0xD8,0xFF,0x0F,0x00,0x00, 0x00,0x00,0x40,0x15,0x00,0xF7,0x07,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(128), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0), // ulBootAddress fill_b2(0x00D2), // uiUpperExtIOLoc fill_b4(16384), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(16384 / 128), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x0100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATTINY43U { "attiny43u", 0x920C, 64, 64, // 4096 bytes flash 4, 16, // 64 bytes EEPROM 16 * 2, // 16 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFB,0xF9,0xFD,0x7F,0x4B,0xF8,0xFF,0xFF }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0x8B,0xB0,0xBD,0x7D,0x09,0xF8,0x7D,0xFA }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0), // ulBootAddress fill_b2(0x0000), // uiUpperExtIOLoc fill_b4(4096), // ulFlashSize { 0xBB,0xFF,0xBB,0xEE,0xBB,0xCC,0xB2,0x0D, 0xBC,0x07,0xB4,0x07,0xBA,0x0D,0xBB,0xBC, 0x99,0xE1,0xBB,0xAC }, // ucEepromInst { 0xB4,0x07,0x17 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(4096 / 64), // uiFlashpages 0x20, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x60), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1C), // EECRAddress }, }, // DEV_ATTINY48 { "attiny48", 0x9209, 64, 64, // 4096 bytes flash 4, 16, // 64 bytes EEPROM 20 * 2, // 20 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x7F,0x64,0xF8,0xEB,0x3D,0xB9,0xA0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB0,0x0D,0x00,0xE0,0xFB,0x1D,0xB8,0xA0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFF,0x00,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0xFF,0x00,0xDC,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0000), // ulBootAddress fill_b2(0xBD), // uiUpperExtIOLoc fill_b4(4096), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(4096 / 64), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATTINY88 { "attiny88", 0x9311, 64, 128, // 8192 bytes flash 4, 16, // 64 bytes EEPROM 20 * 2, // 20 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined true, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xF8,0x7F,0x64,0xF8,0xEB,0x3D,0xB9,0xA0 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xB0,0x0D,0x00,0xE0,0xFB,0x1D,0xB8,0xA0 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x53,0xFF,0x00,0xDF,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x00,0xFF,0x00,0xDC,0xF7,0x0F,0x00,0x00, 0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x00, // ucIDRAddress 0X00, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(64), // uiFlashPageSize 4, // ucEepromPageSize fill_b4(0x0000), // ulBootAddress fill_b2(0xBD), // uiUpperExtIOLoc fill_b4(8192), // ulFlashSize { 0xBD,0xF2,0xBD,0xE1,0xBB,0xCF,0xB4,0x00, 0xBE,0x01,0xB6,0x01,0xBC,0x00,0xBB,0xBF, 0x99,0xF9,0xBB,0xAF }, // ucEepromInst { 0xB6,0x01,0x11 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(8192 / 64), // uiFlashpages 0x31, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x100), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // DEV_ATXMEGA128A1 revision D { "atxmega128a1revd", 0x9741, 512, 272, // 139264 bytes flash 32, 64, // 2048 bytes EEPROM 0 * 4, // 0 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF9,0xFF,0x3D,0xB9,0xF8 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xFF,0xFF,0x1F,0xE0,0xFF,0x1D,0xA9,0xF8 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x73,0xFF,0x3F,0xFF,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x3F,0x37,0x37,0x36,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7,0x3F,0x36,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x73,0xFF,0x3F,0xF8,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x2F,0x36,0x36,0x36,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7,0x3F,0x36,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(512), // uiFlashPageSize 32, // ucEepromPageSize fill_b4(0x20000), // ulBootAddress fill_b2(0x136), // uiUpperExtIOLoc fill_b4(139264), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(139264 / 512), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0x02, // ucCacheType fill_b2(8192), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0), // EECRAddress }, }, // DEV_ATXMEGA128A1 revision G (and newer) { "atxmega128a1", 0x974c, 512, 272, // 139264 bytes flash 32, 64, // 2048 bytes EEPROM 0 * 4, // 0 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined true, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF9,0xFF,0x3D,0xB9,0xF8 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xFF,0xFF,0x1F,0xE0,0xFF,0x1D,0xA9,0xF8 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0x73,0xFF,0x3F,0xFF,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x3F,0x37,0x37,0x36,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7,0x3F,0x36,0x00 }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0x73,0xFF,0x3F,0xF8,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x2F,0x36,0x36,0x36,0x00, 0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0x00, 0xF7,0x3F,0x36,0x00 }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0, // ucRAMPZAddress fill_b2(512), // uiFlashPageSize 32, // ucEepromPageSize fill_b4(0x20000), // ulBootAddress fill_b2(0x136), // uiUpperExtIOLoc fill_b4(139264), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(139264 / 512), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0x02, // ucCacheType fill_b2(8192), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0, // ucEindAddress fill_b2(0), // EECRAddress }, }, // DEV_ATMEGA128RFA1 { "atmega128rfa1", 0xA701, 256, 512, // 131072 bytes flash 8, 512, // 4096 bytes EEPROM 72 * 4, // 72 interrupt vectors DEVFL_MKII_ONLY, NULL, // registers not yet defined false, { 0 // no mkI support }, { CMND_SET_DEVICE_DESCRIPTOR, { 0xFF,0xFF,0xFF,0xF9,0xFF,0x3D,0xB9,0xF8 }, // ucReadIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucReadIOShadow { 0xFF,0xFF,0x1F,0xE0,0xFF,0x1D,0xA9,0xF8 }, // ucWriteIO { 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00 }, // ucWriteIOShadow { 0xFB,0xFF,0xBF,0xFF,0xF7,0x3F,0xF7,0x3F, 0xF7,0x3F,0x5F,0x3F,0x77,0x77,0x03,0xF0, 0xFF,0xFF,0xFF,0x01,0x00,0x00,0x00,0x00, 0xF7,0xBF,0xFF,0xFA,0xFE,0xFF,0xA7,0xFF, 0xFF,0xFF,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF }, // ucReadExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucReadIOExtShadow { 0xFB,0xFF,0xBF,0xFF,0xB7,0x3F,0xB7,0x3F, 0xB7,0x3F,0x5F,0x3F,0x77,0x77,0x03,0xB0, 0xFF,0xE1,0xFF,0x01,0x00,0x00,0x00,0x00, 0xB7,0xBF,0xFF,0xDA,0x3C,0xFF,0xA7,0x0F, 0xFF,0xFF,0xE8,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF }, // ucWriteExtIO { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }, // ucWriteIOExtShadow 0x31, // ucIDRAddress 0x57, // ucSPMCRAddress 0x3B, // ucRAMPZAddress fill_b2(256), // uiFlashPageSize 8, // ucEepromPageSize fill_b4(0xFE00), // ulBootAddress fill_b2(0x01FF), // uiUpperExtIOLoc fill_b4(131072), // ulFlashSize { 0x00 }, // ucEepromInst { 0x00 }, // ucFlashInst 0x3E, // ucSPHaddr 0x3D, // ucSPLaddr fill_b2(131072 / 256), // uiFlashpages 0x00, // ucDWDRAddress 0x00, // ucDWBasePC 0x00, // ucAllowFullPageBitstream fill_b2(0x00), // uiStartSmallestBootLoaderSection 1, // EnablePageProgramming 0, // ucCacheType fill_b2(0x200), // uiSramStartAddr 0, // ucResetType 0, // ucPCMaskExtended 0, // ucPCMaskHigh 0x3C, // ucEindAddress fill_b2(0x1F), // EECRAddress }, }, // Termination record. { NULL, // name 0, // id 0, 0, // flash 0, 0, // eeprom 0, // interrupt vectors DEVFL_NONE, // device flags NULL, // io reg defs false, { 0 }, // mkI device descriptor information { 0 } // mkII device descriptor } }; avarice-2.11.orig/src/ioreg.cc0000644000000000000000000004664710245701305013115 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2003, 2004 James Harris * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains IO Register definitions for use with avr-gdb's 'info * io_register' command. * * $Id: ioreg.cc,v 1.5 2005/05/24 20:33:30 joerg_wunsch Exp $ */ #include "ioreg.h" gdb_io_reg_def_type atmega16_io_registers[] = { { "TWBR", 0x20, 0x00 }, { "TWSR", 0x21, 0x00 }, { "TWAR", 0x22, 0x00 }, { "TWDR", 0x23, 0x00 }, { "ADCL", 0x24, IO_REG_RSE }, // Reading during a conversion corrupts { "ADCH", 0x25, IO_REG_RSE }, // ADC result { "ADCSRA", 0x26, 0x00 }, { "ADMUX", 0x27, 0x00 }, { "ACSR", 0x28, 0x00 }, { "UBRRL", 0x29, 0x00 }, { "UCSRB", 0x2A, 0x00 }, { "UCSRA", 0x2B, 0x00 }, { "UDR", 0x2C, IO_REG_RSE }, // Reading this clears the UART RXC flag { "SPCR", 0x2D, 0x00 }, { "SPSR", 0x2E, 0x00 }, { "SPDR", 0x2F, 0x00 }, { "PIND", 0x30, 0x00 }, { "DDRD", 0x31, 0x00 }, { "PORTD", 0x32, 0x00 }, { "PINC", 0x33, 0x00 }, { "DDRC", 0x34, 0x00 }, { "PORTC", 0x35, 0x00 }, { "PINB", 0x36, 0x00 }, { "DDRB", 0x37, 0x00 }, { "PORTB", 0x38, 0x00 }, { "PINA", 0x39, 0x00 }, { "DDRA", 0x3A, 0x00 }, { "PORTA", 0x3B, 0x00 }, { "EECR", 0x3C, 0x00 }, { "EEDR", 0x3D, 0x00 }, { "EEARL", 0x3E, 0x00 }, { "EEARH", 0x3F, 0x00 }, { "UCSRC -- UBRRH", 0x40, 0x00 }, { "WDTCR", 0x41, 0x00 }, { "ASSR", 0x42, 0x00 }, { "OCR2", 0x43, 0x00 }, { "TCNT2", 0x44, 0x00 }, { "TCCR2", 0x45, 0x00 }, { "ICR1L", 0x46, 0x00 }, { "ICR1H", 0x47, 0x00 }, { "OCR1BL", 0x48, 0x00 }, { "OCR1BH", 0x49, 0x00 }, { "OCR1AL", 0x4A, 0x00 }, { "OCR1AH", 0x4B, 0x00 }, { "TCNT1L", 0x4C, 0x00 }, { "TCNT1H", 0x4D, 0x00 }, { "TCCR1B", 0x4E, 0x00 }, { "TCCR1A", 0x4F, 0x00 }, { "SFIOR", 0x50, 0x00 }, { "OCDR -- OSCCAL", 0x51, 0x00 }, { "TCNT0", 0x52, 0x00 }, { "TCCR0", 0x53, 0x00 }, { "MCUCSR", 0x54, 0x00 }, { "MCUCR", 0x55, 0x00 }, { "TWCR", 0x56, 0x00 }, { "SPMCR", 0x57, 0x00 }, { "TIFR", 0x58, 0x00 }, { "TIMSK", 0x59, 0x00 }, { "GIFR", 0x5A, 0x00 }, { "GICR", 0x5B, 0x00 }, { "OCR0", 0x5C, 0x00 }, { "SPL", 0x5D, 0x00 }, { "SPH", 0x5E, 0x00 }, { "SREG", 0x5F, 0x00 }, { 0, 0, 0 } }; gdb_io_reg_def_type atmega162_io_registers[] = { { "UBRR1L", 0x20, 0x00 }, { "UCSR1B", 0x21, 0x00 }, { "UCSR1A", 0x22, 0x00 }, { "UDR1", 0x23, IO_REG_RSE }, // Reading this clears the UART RXC flag { "OCDR -- OSCCAL", 0x24, 0x00 }, { "PINE", 0x25, 0x00 }, { "DDRE", 0x26, 0x00 }, { "PORTE", 0x27, 0x00 }, { "ACSR", 0x28, 0x00 }, { "UBRR0L", 0x29, 0x00 }, { "UCSR0B", 0x2A, 0x00 }, { "UCSR0A", 0x2B, 0x00 }, { "UDR0", 0x2C, IO_REG_RSE }, // Reading this clears the UART RXC flag { "SPCR", 0x2D, 0x00 }, { "SPSR", 0x2E, 0x00 }, { "SPDR", 0x2F, 0x00 }, { "PIND", 0x30, 0x00 }, { "DDRD", 0x31, 0x00 }, { "PORTD", 0x32, 0x00 }, { "PINC", 0x33, 0x00 }, { "DDRC", 0x34, 0x00 }, { "PORTC", 0x35, 0x00 }, { "PINB", 0x36, 0x00 }, { "DDRB", 0x37, 0x00 }, { "PORTB", 0x38, 0x00 }, { "PINA", 0x39, 0x00 }, { "DDRA", 0x3A, 0x00 }, { "PORTA", 0x3B, 0x00 }, { "EECR", 0x3C, 0x00 }, { "EEDR", 0x3D, 0x00 }, { "EEARL", 0x3E, 0x00 }, { "EEARH", 0x3F, 0x00 }, { "UBRR0H -- UCSR0C", 0x40, 0x00 }, { "WDTCR", 0x41, 0x00 }, { "OCR2", 0x42, 0x00 }, { "TCNT2", 0x43, 0x00 }, { "ICR1L", 0x44, 0x00 }, { "ICR1H", 0x45, 0x00 }, { "ASSR", 0x46, 0x00 }, { "TCCR2", 0x47, 0x00 }, { "OCR1BL", 0x48, 0x00 }, { "OCR1BH", 0x49, 0x00 }, { "OCR1AL", 0x4A, 0x00 }, { "OCR1AH", 0x4B, 0x00 }, { "TCNT1L", 0x4C, 0x00 }, { "TCNT1H", 0x4D, 0x00 }, { "TCCR1B", 0x4E, 0x00 }, { "TCCR1A", 0x4F, 0x00 }, { "SFIOR", 0x50, 0x00 }, { "OCR0", 0x51, 0x00 }, { "TCNT0", 0x52, 0x00 }, { "TCCR0", 0x53, 0x00 }, { "MCUCSR", 0x54, 0x00 }, { "MCUCR", 0x55, 0x00 }, { "EMCUCR", 0x56, 0x00 }, { "SPMCR", 0x57, 0x00 }, { "TIFR", 0x58, 0x00 }, { "TIMSK", 0x59, 0x00 }, { "GIFR", 0x5A, 0x00 }, { "GICR", 0x5B, 0x00 }, { "UCSR1C -- UBRR1H", 0x5C, 0x00 }, { "SPL", 0x5D, 0x00 }, { "SPH", 0x5E, 0x00 }, { "SREG", 0x5F, 0x00 }, { "CLKPR", 0x61, 0x00 }, { "PCMSK0", 0x6B, 0x00 }, { "PCMSK1", 0x6C, 0x00 }, { "ETIFR", 0x7C, 0x00 }, { "ETIMSK", 0x7D, 0x00 }, { "ICR3L", 0x80, 0x00 }, { "ICR3H", 0x81, 0x00 }, { "OCR3BL", 0x84, 0x00 }, { "OCR3BH", 0x85, 0x00 }, { "OCR3AL", 0x86, 0x00 }, { "OCR3AH", 0x87, 0x00 }, { "TCNT3L", 0x88, 0x00 }, { "TCNT3H", 0x89, 0x00 }, { "TCCR3B", 0x8A, 0x00 }, { "TCCR3A", 0x8B, 0x00 }, { 0, 0, 0 } }; gdb_io_reg_def_type atmega169_io_registers[] = { { "PINA", 0x20, 0x00 }, { "DDRA", 0x21, 0x00 }, { "PORTA", 0x22, 0x00 }, { "PINB", 0x23, 0x00 }, { "DDRB", 0x24, 0x00 }, { "PORTB", 0x25, 0x00 }, { "PINC", 0x26, 0x00 }, { "DDRC", 0x27, 0x00 }, { "PORTC", 0x28, 0x00 }, { "PIND", 0x29, 0x00 }, { "DDRD", 0x2A, 0x00 }, { "PORTD", 0x2B, 0x00 }, { "PINE", 0x2C, 0x00 }, { "DDRE", 0x2D, 0x00 }, { "PORTE", 0x2E, 0x00 }, { "PINF", 0x2F, 0x00 }, { "DDRF", 0x30, 0x00 }, { "PORTF", 0x31, 0x00 }, { "PING", 0x32, 0x00 }, { "DDRG", 0x33, 0x00 }, { "PORTG", 0x34, 0x00 }, { "TIFR0", 0x35, 0x00 }, { "TIFR1", 0x36, 0x00 }, { "TIFR2", 0x37, 0x00 }, { "EIFR", 0x3C, 0x00 }, { "EIMSK", 0x3D, 0x00 }, { "GPIOR0", 0x3E, 0x00 }, { "EECR", 0x3F, 0x00 }, { "EEDR", 0x40, 0x00 }, { "EEARL", 0x41, 0x00 }, { "EEARH", 0x42, 0x00 }, { "GTCCR", 0x43, 0x00 }, { "TCCR0A", 0x44, 0x00 }, { "TCNT0", 0x46, 0x00 }, { "OCR0A", 0x47, 0x00 }, { "GPIOR1", 0x4A, 0x00 }, { "GPIOR2", 0x4B, 0x00 }, { "SPCR", 0x4C, 0x00 }, { "SPSR", 0x4D, 0x00 }, { "SPDR", 0x4E, 0x00 }, { "ACSR", 0x50, 0x00 }, { "OCDR", 0x51, 0x00 }, { "SMCR", 0x53, 0x00 }, { "MCUCSR", 0x54, 0x00 }, { "MCUCR", 0x55, 0x00 }, { "SPMCSR", 0x57, 0x00 }, { "SPL", 0x5D, 0x00 }, { "SPH", 0x5E, 0x00 }, { "SREG", 0x5F, 0x00 }, { "WDTCR", 0x60, 0x00 }, { "CLKPR", 0x61, 0x00 }, { "OSCCAL", 0x66, 0x00 }, { "EICRA", 0x69, 0x00 }, { "PCMSK0", 0x6B, 0x00 }, { "PCMSK1", 0x6C, 0x00 }, { "TIMSK0", 0x6E, 0x00 }, { "TIMSK1", 0x6F, 0x00 }, { "TIMSK2", 0x70, 0x00 }, { "ADCL", 0x78, IO_REG_RSE }, // Reading during a conversion corrupts { "ADCH", 0x79, IO_REG_RSE }, // ADC result { "ADCSRA", 0x7A, 0x00 }, { "ADCSRB", 0x7B, 0x00 }, { "ADMUX", 0x7C, 0x00 }, { "DIDR0", 0x7E, 0x00 }, { "DIDR1", 0x7F, 0x00 }, { "TCCR1A", 0x80, 0x00 }, { "TCCR1B", 0x81, 0x00 }, { "TCCR1C", 0x82, 0x00 }, { "TCNT1L", 0x84, 0x00 }, { "TCNT1H", 0x85, 0x00 }, { "ICR1L", 0x86, 0x00 }, { "ICR1H", 0x87, 0x00 }, { "OCR1AL", 0x88, 0x00 }, { "OCR1AH", 0x89, 0x00 }, { "OCR1BL", 0x8A, 0x00 }, { "OCR1BH", 0x8B, 0x00 }, { "TCCR2A", 0xB0, 0x00 }, { "TCNT2", 0xB2, 0x00 }, { "OCR2A", 0xB3, 0x00 }, { "ASSR", 0xB6, 0x00 }, { "USICR", 0xB8, 0x00 }, { "USISR", 0xB9, 0x00 }, { "USIDR", 0xBA, 0x00 }, { "UCSRA", 0xC0, 0x00 }, { "UCSRB", 0xC1, 0x00 }, { "UCSRC", 0xC2, 0x00 }, { "UBRRL", 0xC4, 0x00 }, { "UBRRH", 0xC5, 0x00 }, { "UDR", 0xC6, IO_REG_RSE }, // Reading this clears the UART RXC flag { "LCDCRA", 0xE4, 0x00 }, { "LCDCRB", 0xE5, 0x00 }, { "LCDFRR", 0xE6, 0x00 }, { "LCDCCR", 0xE7, 0x00 }, { "LCDDR0", 0xEC, 0x00 }, { "LCDDR1", 0xED, 0x00 }, { "LCDDR2", 0xEE, 0x00 }, { "LCDDR3", 0xEF, 0x00 }, { "LCDDR5", 0xF1, 0x00 }, { "LCDDR6", 0xF2, 0x00 }, { "LCDDR7", 0xF3, 0x00 }, { "LCDDR8", 0xF4, 0x00 }, { "LCDDR10", 0xF6, 0x00 }, { "LCDDR11", 0xF7, 0x00 }, { "LCDDR12", 0xF8, 0x00 }, { "LCDDR13", 0xF9, 0x00 }, { "LCDDR15", 0xFB, 0x00 }, { "LCDDR16", 0xFC, 0x00 }, { "LCDDR17", 0xFD, 0x00 }, { "LCDDR18", 0xFE, 0x00 }, { 0, 0, 0 } }; gdb_io_reg_def_type atmega32_io_registers[] = { { "TWBR", 0x20, 0x00 }, { "TWSR", 0x21, 0x00 }, { "TWAR", 0x22, 0x00 }, { "TWDR", 0x23, 0x00 }, { "ADCL", 0x24, IO_REG_RSE }, // Reading during a conversion corrupts { "ADCH", 0x25, IO_REG_RSE }, // ADC result { "ADCSRA", 0x26, 0x00 }, { "ADMUX", 0x27, 0x00 }, { "ACSR", 0x28, 0x00 }, { "UBRRL", 0x29, 0x00 }, { "UCSRB", 0x2A, 0x00 }, { "UCSRA", 0x2B, 0x00 }, { "UDR", 0x2C, IO_REG_RSE }, // Reading this clears the UART RXC flag { "SPCR", 0x2D, 0x00 }, { "SPSR", 0x2E, 0x00 }, { "SPDR", 0x2F, 0x00 }, { "PIND", 0x30, 0x00 }, { "DDRD", 0x31, 0x00 }, { "PORTD", 0x32, 0x00 }, { "PINC", 0x33, 0x00 }, { "DDRC", 0x34, 0x00 }, { "PORTC", 0x35, 0x00 }, { "PINB", 0x36, 0x00 }, { "DDRB", 0x37, 0x00 }, { "PORTB", 0x38, 0x00 }, { "PINA", 0x39, 0x00 }, { "DDRA", 0x3A, 0x00 }, { "PORTA", 0x3B, 0x00 }, { "EECR", 0x3C, 0x00 }, { "EEDR", 0x3D, 0x00 }, { "EEARL", 0x3E, 0x00 }, { "EEARH", 0x3F, 0x00 }, { "UBRR0H -- UCSR0C", 0x40, 0x00 }, { "WDTCR", 0x41, 0x00 }, { "ASSR", 0x42, 0x00 }, { "OCR2", 0x43, 0x00 }, { "TCNT2", 0x44, 0x00 }, { "TCCR2", 0x45, 0x00 }, { "ICR1L", 0x46, 0x00 }, { "ICR1H", 0x47, 0x00 }, { "OCR1BL", 0x48, 0x00 }, { "OCR1BH", 0x49, 0x00 }, { "OCR1AL", 0x4A, 0x00 }, { "OCR1AH", 0x4B, 0x00 }, { "TCNT1L", 0x4C, 0x00 }, { "TCNT1H", 0x4D, 0x00 }, { "TCCR1B", 0x4E, 0x00 }, { "TCCR1A", 0x4F, 0x00 }, { "SFIOR", 0x50, 0x00 }, { "OSCCAL", 0x51, 0x00 }, { "TCNT0", 0x52, 0x00 }, { "TCCR0", 0x53, 0x00 }, { "MCUCSR", 0x54, 0x00 }, { "MCUCR", 0x55, 0x00 }, { "TWCR", 0x56, 0x00 }, { "SPMCR", 0x57, 0x00 }, { "TIFR", 0x58, 0x00 }, { "TIMSK", 0x59, 0x00 }, { "GIFR", 0x5A, 0x00 }, { "GIMSK", 0x5B, 0x00 }, { "OCR0", 0x5C, 0x00 }, { "SPL", 0x5D, 0x00 }, { "SPH", 0x5E, 0x00 }, { "SREG", 0x5F, 0x00 }, { 0, 0, 0 } }; gdb_io_reg_def_type atmega128_io_registers[] = { { "PINF", 0x20, 0x00 }, { "PINE", 0x21, 0x00 }, { "DDRE", 0x22, 0x00 }, { "PORTE", 0x23, 0x00 }, { "ADCL", 0x24, IO_REG_RSE }, // Reading during a conversion corrupts { "ADCH", 0x25, IO_REG_RSE }, // ADC result { "ADCSRA", 0x26, 0x00 }, { "ADMUX", 0x27, 0x00 }, { "ACSR", 0x28, 0x00 }, { "UBRR0L", 0x29, 0x00 }, { "UCSR0B", 0x2A, 0x00 }, { "UCSR0A", 0x2B, 0x00 }, { "UDR0", 0x2C, IO_REG_RSE }, // Reading this clears the UART RXC flag { "SPCR", 0x2D, 0x00 }, { "SPSR", 0x2E, 0x00 }, { "SPDR", 0x2F, 0x00 }, { "PIND", 0x30, 0x00 }, { "DDRD", 0x31, 0x00 }, { "PORTD", 0x32, 0x00 }, { "PINC", 0x33, 0x00 }, { "DDRC", 0x34, 0x00 }, { "PORTC", 0x35, 0x00 }, { "PINB", 0x36, 0x00 }, { "DDRB", 0x37, 0x00 }, { "PORTB", 0x38, 0x00 }, { "PINA", 0x39, 0x00 }, { "DDRA", 0x3A, 0x00 }, { "PORTA", 0x3B, 0x00 }, { "EECR", 0x3C, 0x00 }, { "EEDR", 0x3D, 0x00 }, { "EEARL", 0x3E, 0x00 }, { "EEARH", 0x3F, 0x00 }, { "SFIOR", 0x40, 0x00 }, { "WDTCR", 0x41, 0x00 }, { "OCDR", 0x42, 0x00 }, { "OCR2", 0x43, 0x00 }, { "TCNT2", 0x44, 0x00 }, { "TCCR2", 0x45, 0x00 }, { "ICR1L", 0x46, 0x00 }, { "ICR1H", 0x47, 0x00 }, { "OCR1BL", 0x48, 0x00 }, { "OCR1BH", 0x49, 0x00 }, { "OCR1AL", 0x4A, 0x00 }, { "OCR1AH", 0x4B, 0x00 }, { "TCNT1L", 0x4C, 0x00 }, { "TCNT1H", 0x4D, 0x00 }, { "TCCR1B", 0x4E, 0x00 }, { "TCCR1A", 0x4F, 0x00 }, { "ASSR", 0x50, 0x00 }, { "OCR0", 0x51, 0x00 }, { "TCNT0", 0x52, 0x00 }, { "TCCR0", 0x53, 0x00 }, { "MCUCSR", 0x54, 0x00 }, { "MCUCR", 0x55, 0x00 }, { "TIFR", 0x56, 0x00 }, { "TIMSK", 0x57, 0x00 }, { "EIFR", 0x58, 0x00 }, { "EIMSK", 0x59, 0x00 }, { "EICRB", 0x5A, 0x00 }, { "RAMPZ", 0x5B, 0x00 }, { "XDIV", 0x5C, 0x00 }, { "SPL", 0x5D, 0x00 }, { "SPH", 0x5E, 0x00 }, { "SREG", 0x5F, 0x00 }, { "DDRF", 0x61, 0x00 }, { "PORTF", 0x62, 0x00 }, { "PING", 0x63, 0x00 }, { "DDRG", 0x64, 0x00 }, { "PORTG", 0x65, 0x00 }, { "SPMCSR", 0x68, 0x00 }, { "EICRA", 0x6A, 0x00 }, { "XMCRB", 0x6C, 0x00 }, { "XMCRA", 0x6D, 0x00 }, { "OSCCAL", 0x6F, 0x00 }, { "TWBR", 0x70, 0x00 }, { "TWSR", 0x71, 0x00 }, { "TWAR", 0x72, 0x00 }, { "TWDR", 0x73, 0x00 }, { "TWCR", 0x74, 0x00 }, { "OCR1CL", 0x78, 0x00 }, { "OCR1CH", 0x79, 0x00 }, { "TCCR1C", 0x7A, 0x00 }, { "ETIFR", 0x7C, 0x00 }, { "ETIMSK", 0x7D, 0x00 }, { "ICR3L", 0x80, 0x00 }, { "ICR3H", 0x81, 0x00 }, { "OCR3CL", 0x82, 0x00 }, { "OCR3CH", 0x83, 0x00 }, { "OCR3BL", 0x84, 0x00 }, { "OCR3BH", 0x85, 0x00 }, { "OCR3AL", 0x86, 0x00 }, { "OCR3AH", 0x87, 0x00 }, { "TCNT3L", 0x88, 0x00 }, { "TCNT3H", 0x89, 0x00 }, { "TCCR3B", 0x8A, 0x00 }, { "TCCR3A", 0x8B, 0x00 }, { "TCCR3C", 0x8C, 0x00 }, { "UBRR0H", 0x90, 0x00 }, { "UCSR0C", 0x95, 0x00 }, { "UBRR1H", 0x98, 0x00 }, { "UBRR1L", 0x99, 0x00 }, { "UCSR1B", 0x9A, 0x00 }, { "UCSR1A", 0x9B, 0x00 }, { "UDR1", 0x9C, IO_REG_RSE }, // Reading this clears the UART RXC flag { "UCSR1C", 0x9D, 0x00 }, { 0, 0, 0 } }; gdb_io_reg_def_type iocan128_io_registers[] = { { "PINA", 0x20, 0x00 }, { "DDRA", 0x21, 0x00 }, { "PORTA", 0x22, 0x00 }, { "PINB", 0x23, 0x00 }, { "DDRB", 0x24, 0x00 }, { "PORTB", 0x25, 0x00 }, { "PINC", 0x26, 0x00 }, { "DDRC", 0x27, 0x00 }, { "PORTC", 0x28, 0x00 }, { "PIND", 0x29, 0x00 }, { "DDRD", 0x2A, 0x00 }, { "PORTD", 0x2B, 0x00 }, { "PINE", 0x2C, 0x00 }, { "DDRE", 0x2D, 0x00 }, { "PORTE", 0x2E, 0x00 }, { "PINF", 0x2F, 0x00 }, { "DDRF", 0x30, 0x00 }, { "PORTF", 0x31, 0x00 }, { "PING", 0x32, 0x00 }, { "DDRG", 0x33, 0x00 }, { "PORTG", 0x34, 0x00 }, { "TIFR0", 0x35, 0x00 }, { "TIFR1", 0x36, 0x00 }, { "TIFR2", 0x37, 0x00 }, { "TIFR3", 0x38, 0x00 }, { "EIFR", 0x3C, 0x00 }, { "EIMSK", 0x3D, 0x00 }, { "GPIOR0", 0x3E, 0x00 }, { "EECR", 0x3F, 0x00 }, { "EEDR", 0x40, 0x00 }, { "EEARL", 0x41, 0x00 }, { "EEARH", 0x42, 0x00 }, { "GTCCR", 0x43, 0x00 }, { "TCCR0A", 0x44, 0x00 }, { "TCNT0", 0x46, 0x00 }, { "OCR0A", 0x47, 0x00 }, { "GPIOR1", 0x4A, 0x00 }, { "GPIOR2", 0x4B, 0x00 }, { "SPCR", 0x4C, 0x00 }, { "SPSR", 0x4D, 0x00 }, { "SPDR", 0x4E, 0x00 }, { "ACSR", 0x50, 0x00 }, { "OCDR", 0x51, 0x00 }, { "SMCR", 0x53, 0x00 }, { "MCUSR", 0x54, 0x00 }, { "MCUCR", 0x55, 0x00 }, { "SPMCSR", 0x57, 0x00 }, { "RAMPZ", 0x5B, 0x00 }, { "SPL", 0x5D, 0x00 }, { "SPH", 0x5E, 0x00 }, { "SREG", 0x5F, 0x00 }, { "WDTCR", 0x60, 0x00 }, { "CLKPR", 0x61, 0x00 }, { "OSCCAL", 0x66, 0x00 }, { "EICRA", 0x69, 0x00 }, { "EICRB", 0x6A, 0x00 }, { "TIMSK0", 0x6E, 0x00 }, { "TIMSK1", 0x6F, 0x00 }, { "TIMSK2", 0x70, 0x00 }, { "TIMSK3", 0x71, 0x00 }, { "XMCRA", 0x74, 0x00 }, { "XMCRB", 0x75, 0x00 }, { "ADCL", 0x78, IO_REG_RSE }, // Reading during a conversion corrupts { "ADCH", 0x79, IO_REG_RSE }, // ADC result { "ADCSRA", 0x7A, 0x00 }, { "ADCSRB", 0x7B, 0x00 }, { "ADMUX", 0x7C, 0x00 }, { "DIDR0", 0x7E, 0x00 }, { "DIDR1", 0x7F, 0x00 }, { "TCCR1A", 0x80, 0x00 }, { "TCCR1B", 0x81, 0x00 }, { "TCCR1C", 0x82, 0x00 }, { "TCNT1L", 0x84, 0x00 }, { "TCNT1H", 0x85, 0x00 }, { "ICR1L", 0x86, 0x00 }, { "ICR1H", 0x87, 0x00 }, { "OCR1AL", 0x88, 0x00 }, { "OCR1AH", 0x89, 0x00 }, { "OCR1BL", 0x8A, 0x00 }, { "OCR1BH", 0x8B, 0x00 }, { "OCR1CL", 0x8C, 0x00 }, { "OCR1CH", 0x8D, 0x00 }, { "TCCR3A", 0x90, 0x00 }, { "TCCR3B", 0x91, 0x00 }, { "TCCR3C", 0x92, 0x00 }, { "TCNT3L", 0x94, 0x00 }, { "TCNT3H", 0x95, 0x00 }, { "ICR3L", 0x96, 0x00 }, { "ICR3H", 0x97, 0x00 }, { "OCR3AL", 0x98, 0x00 }, { "OCR3AH", 0x99, 0x00 }, { "OCR3BL", 0x9A, 0x00 }, { "OCR3BH", 0x9B, 0x00 }, { "OCR3CL", 0x9C, 0x00 }, { "OCR3CH", 0x9D, 0x00 }, { "TCCR2A", 0xB0, 0x00 }, { "TCNT2", 0xB2, 0x00 }, { "OCR2A", 0xB3, 0x00 }, { "ASSR", 0xB6, 0x00 }, { "TWBR", 0xB8, 0x00 }, { "TWSR", 0xB9, 0x00 }, { "TWAR", 0xBA, 0x00 }, { "TWDR", 0xBB, 0x00 }, { "TWCR", 0xBC, 0x00 }, { "UCSR0A", 0xC0, 0x00 }, { "UCSR0B", 0xC1, 0x00 }, { "UCSR0C", 0xC2, 0x00 }, { "UBRR0L", 0xC4, 0x00 }, { "UBRR0H", 0xC5, 0x00 }, { "UDR0", 0xC6, IO_REG_RSE }, // Reading this clears the UART RXC flag { "UCSR1A", 0xC8, 0x00 }, { "UCSR1B", 0xC9, 0x00 }, { "UCSR1C", 0xCA, 0x00 }, { "UBRR1L", 0xCC, 0x00 }, { "UBRR1H", 0xCD, 0x00 }, { "UDR1", 0xCE, IO_REG_RSE }, // Reading this clears the UART RXC flag { "CANGCON", 0xD8, 0x00 }, { "CANGSTA", 0xD9, 0x00 }, { "CANGIT", 0xDA, 0x00 }, { "CANGIE", 0xDB, 0x00 }, { "CANEN2", 0xDC, 0x00 }, { "CANEN1", 0xDD, 0x00 }, { "CANIE2", 0xDE, 0x00 }, { "CANIE1", 0xDF, 0x00 }, { "CANSIT2", 0xE0, 0x00 }, { "CANSIT1", 0xE1, 0x00 }, { "CANBT1", 0xE2, 0x00 }, { "CANBT2", 0xE3, 0x00 }, { "CANBT3", 0xE4, 0x00 }, { "CANTCON", 0xE5, 0x00 }, { "CANTIML", 0xE6, 0x00 }, { "CANTIMH", 0xE7, 0x00 }, { "CANTTCL", 0xE8, 0x00 }, { "CANTTCH", 0xE9, 0x00 }, { "CANTEC", 0xEA, 0x00 }, { "CANREC", 0xEB, 0x00 }, { "CANHPMOB", 0xEC, 0x00 }, { "CANPAGE", 0xED, 0x00 }, { "CANSTMOB", 0xEE, 0x00 }, { "CANCDMOB", 0xEF, 0x00 }, { "CANIDT4", 0xF0, 0x00 }, { "CANIDT3", 0xF1, 0x00 }, { "CANIDT2", 0xF2, 0x00 }, { "CANIDT1", 0xF3, 0x00 }, { "CANIDM4", 0xF4, 0x00 }, { "CANIDM3", 0xF5, 0x00 }, { "CANIDM2", 0xF6, 0x00 }, { "CANIDM1", 0xF7, 0x00 }, { "CANSTML", 0xF8, 0x00 }, { "CANSTMH", 0xF9, 0x00 }, { "CANMSG", 0xFA, 0x00 }, { 0, 0, 0 } }; avarice-2.11.orig/src/ioreg.h0000644000000000000000000000272410245701326012746 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2003, 2004 James Harris * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains IO Register definitions for use with avr-gdb's 'info * io_register' command. * * $Id: ioreg.h,v 1.5 2005/05/24 20:33:30 joerg_wunsch Exp $ */ #ifndef INCLUDE_IOREG_H #define INCLUDE_IOREG_H #define IO_REG_RSE 0x01 // IO register has read side effect typedef struct { const char* name; const unsigned char reg_addr; const unsigned char flags; } gdb_io_reg_def_type; extern gdb_io_reg_def_type atmega16_io_registers[]; extern gdb_io_reg_def_type atmega162_io_registers[]; extern gdb_io_reg_def_type atmega169_io_registers[]; extern gdb_io_reg_def_type atmega32_io_registers[]; extern gdb_io_reg_def_type atmega128_io_registers[]; extern gdb_io_reg_def_type iocan128_io_registers[]; #endif /* INCLUDE_IOREG_H */ avarice-2.11.orig/src/jtag.h0000644000000000000000000007052611627164120012573 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002, 2003, 2004 Intel Corporation * Copyright (C) 2005, 2006, 2007 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains functions for interfacing with the GDB remote protocol. * * $Id: jtag.h,v 1.30 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #ifndef JTAG_H #define JTAG_H #include #include #include "pragma.h" #include "ioreg.h" /* The data in this structure will be sent directorly to the jtagice box. */ typedef struct { unsigned char cmd; // The jtag command to prefix the desc. /* The following arrays are bitmaps where each bit is a flag denoting wether the register can be read or written. Bit 0 of byte 0 represents the IO register at sram addres 0x20, while bit 7 of byte 7 represents the register at 0x5f. */ unsigned char rd[8]; // IO read access. unsigned char wr[8]; // IO write access. unsigned char sh_rd[8]; // IO shadow read access. unsigned char sh_wr[8]; // IO shadow write access. /* Same as above, except that first bit is register at sram address 0x60 and last bit is register at 0xff. */ unsigned char ext_rd[20]; // Extended IO read access. unsigned char ext_wr[20]; // Extended IO write access. unsigned char ext_sh_rd[20]; // Extended IO shadow read access. unsigned char ext_sh_wr[20]; // Extended IO shadow write access. /* Register locations. */ unsigned char idr_addr; // IDR address in IO space. unsigned char spmcr_addr; // SPMCR address in SRAM space. unsigned char rampz_addr; // RAMPZ address in IO space. /* Memory programming page sizes (in bytes). */ unsigned char flash_pg_sz[2]; // [0]->little end; [1]->big end unsigned char eeprom_pg_sz; unsigned char boot_addr[4]; // Boot loader start address. // This is a WORD address. // [0]->little end; [3]->big end unsigned char last_ext_io_addr; // Last extended IO location, 0 if no // extended IO. unsigned char eom[2]; // JTAG command terminator. } jtag1_device_desc_type; // In appnote AVR067, struct device_descriptor is written with // int/long field types. We cannot use them directly, as they were // neither properly aligned for portability, nor did they care for // endianess issues. We thus use arrays of unsigned chars, plus // conversion macros. typedef struct { unsigned char cmd; // The jtag command to prefix the desc. unsigned char ucReadIO[8]; //LSB = IOloc 0, MSB = IOloc63 unsigned char ucReadIOShadow[8]; //LSB = IOloc 0, MSB = IOloc63 unsigned char ucWriteIO[8]; //LSB = IOloc 0, MSB = IOloc63 unsigned char ucWriteIOShadow[8]; //LSB = IOloc 0, MSB = IOloc63 unsigned char ucReadExtIO[52]; //LSB = IOloc 96, MSB = IOloc511 unsigned char ucReadIOExtShadow[52]; //LSB = IOloc 96, MSB = IOloc511 unsigned char ucWriteExtIO[52]; //LSB = IOloc 96, MSB = IOloc511 unsigned char ucWriteIOExtShadow[52];//LSB = IOloc 96, MSB = IOloc511 unsigned char ucIDRAddress; //IDR address unsigned char ucSPMCRAddress; //SPMCR Register address and dW BasePC unsigned char ucRAMPZAddress; //RAMPZ Register address in SRAM I/O //space unsigned char uiFlashPageSize[2]; //Device Flash Page Size unsigned char ucEepromPageSize; //Device Eeprom Page Size in bytes unsigned char ulBootAddress[4]; //Device Boot Loader Start Address unsigned char uiUpperExtIOLoc[2]; //Topmost (last) extended I/O //location, 0 if no external I/O unsigned char ulFlashSize[4]; //Device Flash Size unsigned char ucEepromInst[20]; //Instructions for W/R EEPROM unsigned char ucFlashInst[3]; //Instructions for W/R FLASH unsigned char ucSPHaddr; // stack pointer high unsigned char ucSPLaddr; // stack pointer low // new as of 16-02-2004 unsigned char uiFlashpages[2]; // number of pages in flash unsigned char ucDWDRAddress; // DWDR register address unsigned char ucDWBasePC; // base/mask value of the PC // new as of 30-04-2004 unsigned char ucAllowFullPageBitstream; // FALSE on ALL new //parts unsigned char uiStartSmallestBootLoaderSection[2]; // // new as of 18-10-2004 unsigned char EnablePageProgramming; // For JTAG parts only, // default TRUE unsigned char ucCacheType; // CacheType_Normal 0x00, // CacheType_CAN 0x01, // CacheType_HEIMDALL 0x02 // new as of 27-10-2004 unsigned char uiSramStartAddr[2]; // Start of SRAM unsigned char ucResetType; // Selects reset type. ResetNormal = 0x00 // ResetAT76CXXX = 0x01 unsigned char ucPCMaskExtended; // For parts with extended PC unsigned char ucPCMaskHigh; // PC high mask unsigned char ucEindAddress; // Selects reset type. [EIND address...] // new as of early 2005, firmware 4.x unsigned char EECRAddress[2]; // EECR IO address } jtag2_device_desc_type; #define fill_b4(u) \ { ((u) & 0xffUL), (((u) & 0xff00UL) >> 8), \ (((u) & 0xff0000UL) >> 16), (((u) & 0xff000000UL) >> 24) } #define fill_b2(u) \ { ((u) & 0xff), (((u) & 0xff00) >> 8) } enum dev_flags { DEVFL_NONE = 0x000000, DEVFL_NO_SOFTBP = 0x000001, // Device cannot use software BPs (no BREAK insn) DEVFL_MKII_ONLY = 0x000002, // Device is only supported in JTAG ICE mkII }; typedef struct { const char* name; const unsigned int device_id; // Part Number from JTAG Device // Identification Register unsigned int flash_page_size; // Flash memory page size in bytes unsigned int flash_page_count; // Flash memory page count unsigned char eeprom_page_size; // EEPROM page size in bytes unsigned int eeprom_page_count; // EEPROM page count unsigned int vectors_end; // End of interrupt vector table enum dev_flags device_flags; // See above. gdb_io_reg_def_type *io_reg_defs; bool is_xmega; // Device is an ATxmega part jtag1_device_desc_type dev_desc1; // Device descriptor to download to // mkI device jtag2_device_desc_type dev_desc2; // Device descriptor to download to // mkII device } jtag_device_def_type; extern jtag_device_def_type *global_p_device_def, deviceDefinitions[]; // various enums enum { // Constants common to both mkI and mkII // Address space offsets FLASH_SPACE_ADDR_OFFSET = 0x000000, DATA_SPACE_ADDR_OFFSET = 0x800000, EEPROM_SPACE_ADDR_OFFSET = 0x810000, FUSE_SPACE_ADDR_OFFSET = 0x820000, LOCK_SPACE_ADDR_OFFSET = 0x830000, SIG_SPACE_ADDR_OFFSET = 0x840000, BREAKPOINT_SPACE_ADDR_OFFSET = 0x900000, ADDR_SPACE_MASK = (DATA_SPACE_ADDR_OFFSET | EEPROM_SPACE_ADDR_OFFSET | FUSE_SPACE_ADDR_OFFSET | LOCK_SPACE_ADDR_OFFSET | SIG_SPACE_ADDR_OFFSET | BREAKPOINT_SPACE_ADDR_OFFSET), // JTAG communication timeouts, in microseconds // RESPONSE is for the first response byte // COMM is for subsequent response bytes MAX_JTAG_COMM_ATTEMPS = 10, MAX_JTAG_SYNC_ATTEMPS = 3, JTAG_RESPONSE_TIMEOUT = 1000000, JTAG_COMM_TIMEOUT = 100000, // Lock Bit Values LOCK_BITS_ALL_UNLOCKED = 0xff, // Fuse Bit Values // XXX -- should be configurable, newer devices might no // longer match that fixed pattern. Basically, the pattern // is the ATmega64/128 one. FUSE_M103C = 0x02, FUSE_WDTON = 0x01, FUSE_OCDEN = 0x80, FUSE_JTAGEN = 0x40, FUSE_SPIEN = 0x20, FUSE_CKOPT = 0x10, FUSE_EESAVE = 0x08, FUSE_BOOTSZ1 = 0x04, FUSE_BOOTSZ0 = 0x02, FUSE_BOOTRST = 0x01, FUSE_BODLEVEL = 0x80, FUSE_BODEN = 0x40, FUSE_SUT1 = 0x20, FUSE_SUT0 = 0x10, FUSE_CKSEL3 = 0x08, FUSE_CKSEL2 = 0x04, FUSE_CKSEL1 = 0x02, FUSE_CKSEL0 = 0x01, MAX_FLASH_PAGE_SIZE = 256, MAX_EEPROM_PAGE_SIZE = 16, // JTAG ICE mkI protocol constants // Address space selector values ADDR_PROG_SPACE_PROG_ENABLED = 0xB0, ADDR_PROG_SPACE_PROG_DISABLED = 0xA0, ADDR_DATA_SPACE = 0x20, ADDR_EEPROM_SPACE = 0xB1, ADDR_FUSE_SPACE = 0xB2, ADDR_LOCK_SPACE = 0xB3, ADDR_SIG_SPACE = 0xB4, ADDR_BREAKPOINT_SPACE = 0x60, // Comms link bit rates BIT_RATE_9600 = 0xf4, BIT_RATE_14400 = 0xf8, BIT_RATE_19200 = 0xfa, BIT_RATE_38400 = 0xfd, BIT_RATE_57600 = 0xfe, BIT_RATE_115200 = 0xff, // Breakpoints (match values returned by JTAG box). BREAKPOINT_NONE = 0x00, BREAKPOINT_X = 0x04, BREAKPOINT_Y = 0x08, BREAKPOINT_Z = 0x10, // Responses from JTAG ICE JTAG_R_OK = 'A', JTAG_R_BREAK = 'B', JTAG_R_INFO = 'G', JTAG_R_FAILED = 'F', JTAG_R_SYNC_ERROR = 'E', JTAG_R_SLEEP = 'H', JTAG_R_POWER = 'I', // JTAG parameters JTAG_P_BITRATE = 'b', JTAG_P_SW_VERSION = 0x7b, JTAG_P_HW_VERSION = 0x7a, JTAG_P_IREG_HIGH = 0x81, JTAG_P_IREG_LOW = 0x82, JTAG_P_OCD_VTARGET = 0x84, JTAG_P_OCD_BREAK_CAUSE = 0x85, JTAG_P_CLOCK = 0x86, JTAG_P_EXTERNAL_RESET = 0x8b, /* W */ JTAG_P_FLASH_PAGESIZE_LOW = 0x88, /* W */ JTAG_P_FLASH_PAGESIZE_HIGH = 0x89, /* W */ JTAG_P_EEPROM_PAGESIZE = 0x8a, /* W */ JTAG_P_TIMERS_RUNNING = 0xa0, JTAG_P_BP_FLOW = 0xa1, JTAG_P_BP_X_HIGH = 0xa2, JTAG_P_BP_X_LOW = 0xa3, JTAG_P_BP_Y_HIGH = 0xa4, JTAG_P_BP_Y_LOW = 0xa5, JTAG_P_BP_MODE = 0xa6, JTAG_P_JTAGID_BYTE0 = 0xa7, /* R */ JTAG_P_JTAGID_BYTE1 = 0xa8, /* R */ JTAG_P_JTAGID_BYTE2 = 0xa9, /* R */ JTAG_P_JTAGID_BYTE3 = 0xaa, /* R */ JTAG_P_UNITS_BEFORE = 0xab, /* W */ JTAG_P_UNITS_AFTER = 0xac, /* W */ JTAG_P_BIT_BEFORE = 0xad, /* W */ JTAG_P_BIT_AFTER = 0xae, /* W */ JTAG_P_PSB0_LOW = 0xaf, /* W */ JTAG_P_PSBO_HIGH = 0xb0, /* W */ JTAG_P_PSB1_LOW = 0xb1, /* W */ JTAG_P_PSB1_HIGH = 0xb2, /* W */ JTAG_P_MCU_MODE = 0xb3, /* R */ // JTAG commands JTAG_C_SET_DEVICE_DESCRIPTOR = 0xA0, // Set JTAG bitrate to 1MHz // ff: 1MHz, fe: 500kHz, fd: 250khz, fb: 125Khz // JTAG bitrates JTAG_BITRATE_1_MHz = 0xff, JTAG_BITRATE_500_KHz = 0xfe, JTAG_BITRATE_250_KHz = 0xfd, JTAG_BITRATE_125_KHz = 0xfb, // JTAG ICE mkII stuff goes here. Most of this is straight from // AppNote AVR067. // Communication with the JTAG ICE works in frames. The protocol // somewhat resembles the STK500v2 protocol, yet it is sufficiently // different to prevent a direct code reuse. :-( // // Frame format: // // +---------------------------------------------------------------+ // | 0 | 1 . 2 | 3 . 4 . 5 . 6 | 7 | ... | N-1 . N | // | | | | | | | // | start | LSB MSB | LSB ....... MSB | token | msg | LSB MSB | // | 0x1B | sequence# | message size | 0x0E | | CRC16 | // +---------------------------------------------------------------+ // // Each request message will be returned by a response with a matching // sequence #. Sequence # 0xffff is reserved for asynchronous event // notifications that will be sent by the ICE without a request // message (e.g. when the target hit a breakpoint). // // The message size excludes the framing overhead (10 bytes). // // The first byte of the message is always the request or response // code, which is roughly classified as: // // . Messages (commands) use 0x00 through 0x3f. (The documentation // claims that messages start at 0x01, but actually CMND_SIGN_OFF is // 0x00.) // . Internal commands use 0x40 through 0x7f (not documented). // . Success responses use 0x80 through 0x9f. // . Failure responses use 0xa0 through 0xbf. // . Events use 0xe0 through 0xff. MESSAGE_START = 0x1b, TOKEN = 0x0e, // Max message size we are willing to accept. Prevents us from trying // to allocate too much VM in case we received a nonsensical packet // length. We have to allocate the buffer as soon as we've got the // length information (and thus have to trust that information by that // time at first), as the final CRC check can only be done once the // entire packet came it. MAX_MESSAGE = 100000, // ICE command codes CMND_CHIP_ERASE = 0x13, CMND_CLEAR_EVENTS = 0x22, CMND_CLR_BREAK = 0x1A, CMND_ENTER_PROGMODE = 0x14, CMND_ERASEPAGE_SPM = 0x0D, CMND_FORCED_STOP = 0x0A, CMND_GET_BREAK = 0x12, CMND_GET_PARAMETER = 0x03, CMND_GET_SIGN_ON = 0x01, CMND_GET_SYNC = 0x0f, CMND_GO = 0x08, CMND_LEAVE_PROGMODE = 0x15, CMND_READ_MEMORY = 0x05, CMND_READ_PC = 0x07, CMND_RESET = 0x0B, CMND_RESTORE_TARGET = 0x23, CMND_RUN_TO_ADDR = 0x1C, CMND_SELFTEST = 0x10, CMND_SET_BREAK = 0x11, CMND_SET_DEVICE_DESCRIPTOR = 0x0C, CMND_SET_N_PARAMETERS = 0x16, CMND_SET_PARAMETER = 0x02, CMND_SIGN_OFF = 0x00, CMND_SINGLE_STEP = 0x09, CMND_SPI_CMD = 0x1D, CMND_WRITE_MEMORY = 0x04, CMND_WRITE_PC = 0x06, // ICE responses RSP_DEBUGWIRE_SYNC_FAILED = 0xAC, RSP_FAILED = 0xA0, RSP_GET_BREAK = 0x83, RSP_ILLEGAL_BREAKPOINT = 0xA8, RSP_ILLEGAL_COMMAND = 0xAA, RSP_ILLEGAL_EMULATOR_MODE = 0xA4, RSP_ILLEGAL_JTAG_ID = 0xA9, RSP_ILLEGAL_MCU_STATE = 0xA5, RSP_ILLEGAL_MEMORY_TYPE = 0xA2, RSP_ILLEGAL_MEMORY_RANGE = 0xA3, RSP_ILLEGAL_PARAMETER = 0xA1, RSP_ILLEGAL_POWER_STATE = 0xAD, RSP_ILLEGAL_VALUE = 0xA6, RSP_MEMORY = 0x82, RSP_NO_TARGET_POWER = 0xAB, RSP_OK = 0x80, RSP_PARAMETER = 0x81, RSP_PC = 0x84, RSP_SELFTEST = 0x85, RSP_SET_N_PARAMETERS = 0xA7, RSP_SIGN_ON = 0x86, RSP_SPI_DATA = 0x88, // ICE events EVT_BREAK = 0xE0, EVT_DEBUG = 0xE6, EVT_ERROR_PHY_FORCE_BREAK_TIMEOUT = 0xE2, EVT_ERROR_PHY_MAX_BIT_LENGTH_DIFF = 0xED, EVT_ERROR_PHY_OPT_RECEIVE_TIMEOUT = 0xF9, EVT_ERROR_PHY_OPT_RECEIVED_BREAK = 0xFA, EVT_ERROR_PHY_RECEIVED_BREAK = 0xF8, EVT_ERROR_PHY_RECEIVE_TIMEOUT = 0xF7, EVT_ERROR_PHY_RELEASE_BREAK_TIMEOUT = 0xE3, EVT_ERROR_PHY_SYNC_OUT_OF_RANGE = 0xF5, EVT_ERROR_PHY_SYNC_TIMEOUT = 0xF0, EVT_ERROR_PHY_SYNC_TIMEOUT_BAUD = 0xF4, EVT_ERROR_PHY_SYNC_WAIT_TIMEOUT = 0xF6, EVT_RESULT_PHY_NO_ACTIVITY = 0xFB, EVT_EXT_RESET = 0xE7, EVT_ICE_POWER_ERROR_STATE = 0xEA, EVT_ICE_POWER_OK = 0xEB, EVT_IDR_DIRTY = 0xEC, EVT_NONE = 0xEF, EVT_PDSB_BREAK = 0xF2, EVT_PDSMB_BREAK = 0xF3, EVT_PROGRAM_BREAK = 0xF1, EVT_RUN = 0xE1, EVT_TARGET_POWER_OFF = 0xE5, EVT_TARGET_POWER_ON = 0xE4, EVT_TARGET_SLEEP = 0xE8, EVT_TARGET_WAKEUP = 0xE9, // trailer EVT_MAX = 0xFF, // memory types for CMND_{READ,WRITE}_MEMORY MTYPE_IO_SHADOW = 0x30, // cached IO registers? MTYPE_SRAM = 0x20, // target's SRAM or [ext.] IO registers MTYPE_EEPROM = 0x22, // EEPROM, what way? MTYPE_EVENT = 0x60, // ICE event memory MTYPE_EVENT_COMPRESSED = 0x61, // ICE event memory, bit-mapped MTYPE_SPM = 0xA0, // flash through LPM/SPM MTYPE_FLASH_PAGE = 0xB0, // flash in programming mode MTYPE_EEPROM_PAGE = 0xB1, // EEPROM in programming mode MTYPE_FUSE_BITS = 0xB2, // fuse bits in programming mode MTYPE_LOCK_BITS = 0xB3, // lock bits in programming mode MTYPE_SIGN_JTAG = 0xB4, // signature in programming mode MTYPE_OSCCAL_BYTE = 0xB5, // osccal cells in programming mode MTYPE_CAN = 0xB6, // CAN mailbox // (some) ICE parameters, for CMND_{GET,SET}_PARAMETER PAR_HW_VERSION = 0x01, PAR_FW_VERSION = 0x02, PAR_EMULATOR_MODE = 0x03, EMULATOR_MODE_DEBUGWIRE = 0x00, EMULATOR_MODE_JTAG = 0x01, EMULATOR_MODE_UNKNOWN = 0x02, EMULATOR_MODE_SPI = 0x03, EMULATOR_MODE_JTAG_XMEGA = 0x05, PAR_IREG = 0x04, PAR_BAUD_RATE = 0x05, PAR_BAUD_2400 = 0x01, PAR_BAUD_4800 = 0x02, PAR_BAUD_9600 = 0x03, PAR_BAUD_19200 = 0x04, // default PAR_BAUD_38400 = 0x05, PAR_BAUD_57600 = 0x06, PAR_BAUD_115200 = 0x07, PAR_BAUD_14400 = 0x08, PAR_OCD_VTARGET = 0x06, PAR_OCD_JTAG_CLK = 0x07, PAR_OCD_BREAK_CAUSE = 0x08, PAR_TIMERS_RUNNING = 0x09, PAR_BREAK_ON_CHANGE_FLOW = 0x0A, PAR_BREAK_ADDR1 = 0x0B, PAR_BREAK_ADDR2 = 0x0C, PAR_COMBBREAKCTRL = 0x0D, PAR_JTAGID = 0x0E, PAR_UNITS_BEFORE = 0x0F, PAR_UNITS_AFTER = 0x10, PAR_BIT_BEFORE = 0x11, PAR_BIT_ATER = 0x12, PAR_EXTERNAL_RESET = 0x13, PAR_FLASH_PAGE_SIZE = 0x14, PAR_EEPROM_PAGE_SIZE = 0x15, PAR_UNUSED1 = 0x16, PAR_PSB0 = 0x17, PAR_PSB1 = 0x18, PAR_PROTOCOL_DEBUG_EVENT = 0x19, PAR_MCU_STATE = 0x1A, STOPPED = 0x00, RUNNING = 0x01, PROGRAMMING = 0x02, PAR_DAISY_CHAIN_INFO = 0x1B, PAR_BOOT_ADDRESS = 0x1C, PAR_TARGET_SIGNATURE = 0x1D, PAR_DEBUGWIRE_BAUDRATE = 0x1E, PAR_PROGRAM_ENTRY_POINT = 0x1F, PAR_PACKET_PARSING_ERRORS = 0x40, PAR_VALID_PACKETS_RECEIVED = 0x41, PAR_INTERCOMMUNICATION_TX_FAILURES = 0x42, PAR_INTERCOMMUNICATION_RX_FAILURES = 0x43, PAR_CRC_ERRORS = 0x44, PAR_POWER_SOURCE = 0x45, POWER_EXTERNAL = 0x00, POWER_USB = 0x01, PAR_CAN_FLAG = 0x22, DONT_READ_CAN_MAILBOX = 0x00, READ_CAN_MAILBOX = 0x01, PAR_ENABLE_IDR_IN_RUN_MODE = 0x23, ACCESS_OSCCAL = 0x00, ACCESS_IDR = 0x01, PAR_ALLOW_PAGEPROGRAMMING_IN_SCANCHAIN = 0x24, PAGEPROG_NOT_ALLOWED = 0x00, PAGEPROG_ALLOWED = 0x01, }; enum { PC_INVALID = 0xffffffff }; enum bpType { NONE, // disabled. CODE, // normal code space breakpoint. SOFTCODE, // code software BP (not yet used). WRITE_DATA, // write data space breakpoint (ie "watch"). READ_DATA, // read data space breakpoint (ie "watch"). ACCESS_DATA, // read/write data space breakpoint (ie "watch"). DATA_MASK, // mask for data space breakpoint. // keep mask bits last HAS_MASK = 0x80000000, // data space BP has an associated mask in // next slot }; // Enumerations for target memory type. typedef enum { MEM_FLASH = 0, MEM_EEPROM = 1, MEM_RAM = 2, } BFDmemoryType; extern const char *BFDmemoryTypeString[]; extern const int BFDmemorySpaceOffset[]; enum emulator { EMULATOR_JTAGICE, EMULATOR_DRAGON, }; // Allocate 1 meg for image buffer. This is where the file data is // stored before writing occurs. #define MAX_IMAGE_SIZE 1000000 typedef struct { uchar val; bool used; } AVRMemoryByte; // Struct that holds the memory image. We read from file using BFD // into this struct, then pass the entire struct to the target writer. typedef struct { AVRMemoryByte image[MAX_IMAGE_SIZE]; unsigned int last_address; unsigned int first_address; bool first_address_ok; bool has_data; const char *name; } BFDimage; // The Sync_CRC/EOP message terminator (no real CRC in sight...) #define JTAG_EOM 0x20, 0x20 // A generic error message when nothing good comes to mind #define JTAG_CAUSE "JTAG ICE communication failed" class jtag { protected: // The initial serial port parameters. We restore them on exit. struct termios oldtio; bool oldtioValid; // The file descriptor used while talking to the JTAG ICE int jtagBox; // For the mkII device, is the box attached via USB? bool is_usb; // A control pipe to talk to the USB daemon. int ctrlPipe; // The type of our emulator: JTAG ICE, or AVR Dragon. emulator emu_type; // Whether nSRST is to be applied when connecting (override JTD bit). bool apply_nSRST; public: // Whether we are in "programming mode" (changes how program memory // is written, apparently) bool programmingEnabled; // Name of the device controlled by the JTAG ICE char *device_name; // Daisy chain info struct { unsigned char units_before; unsigned char units_after; unsigned char bits_before; unsigned char bits_after; } dchain; protected: pid_t openUSB(const char *jtagDeviceName); int safewrite(const void *b, int count); void changeLocalBitRate(int newBitRate); void restoreSerialPort(void); virtual void changeBitRate(int newBitRate) = 0; virtual void setDeviceDescriptor(jtag_device_def_type *dev) = 0; virtual bool synchroniseAt(int bitrate) = 0; virtual void startJtagLink(void) = 0; virtual void deviceAutoConfig(void) = 0; void jtag_flash_image(BFDimage *image, BFDmemoryType memtype, bool program, bool verify); // Return page address of unsigned int page_addr(unsigned int addr, BFDmemoryType memtype) { unsigned int page_size = get_page_size( memtype ); return (unsigned int)(addr & (~(page_size - 1))); }; unsigned int get_page_size(BFDmemoryType memtype); public: jtag(void); jtag(const char *dev, char *name, emulator type = EMULATOR_JTAGICE); virtual ~jtag(void); // Basic JTAG I/O // ------------- /** If status < 0: Report JTAG ICE communication error & exit **/ void jtagCheck(int status); /** Send initial configuration to setup the JTAG box itself. **/ virtual void initJtagBox(void) = 0; /** Send initial configuration to the JTAG box when starting a new debug session. (Note: when attaching to a running target, fuse bits cannot be set so debugging must have been enabled earlier) The bitrate sets the JTAG bitrate. The bitrate must be less than 1/4 that of the target avr frequency or the jtagice will have problems reading from the target. The problems are usually manifested as failed calls to jtagRead(). **/ virtual void initJtagOnChipDebugging(unsigned long bitrate) = 0; /** A timed-out read from file descriptor 'fd'. 'timeout' is in microseconds, it is the maximum interval within which the read must make progress (i.e., it's a per-byte timeout) Returns the number of bytes read or -1 for errors other than timeout. Note: EOF and timeout cannot be distinguished **/ int timeout_read(void *buf, size_t count, unsigned long timeout); // Breakpoints // ----------- /** Clear out the breakpoints. */ virtual void deleteAllBreakpoints(void) = 0; /** Delete breakpoint at the specified address. */ virtual bool deleteBreakpoint(unsigned int address, bpType type, unsigned int length) = 0; /** Add a code breakpoint at the specified address. */ virtual bool addBreakpoint(unsigned int address, bpType type, unsigned int length) = 0; /** Send the breakpoint details down to the JTAG box. */ virtual void updateBreakpoints(void) = 0; /** True if there is a breakpoint at address */ virtual bool codeBreakpointAt(unsigned int address) = 0; /** True if there is a breakpoint between start (inclusive) and end (exclusive) */ virtual bool codeBreakpointBetween(unsigned int start, unsigned int end) = 0; virtual bool stopAt(unsigned int address) = 0; /** Parse a list of event names to *not* cause a break. */ virtual void parseEvents(const char *) = 0; // Writing to program memory // ------------------------- /** Switch to faster programming mode, allows chip erase */ virtual void enableProgramming(void) = 0; /** Switch back to normal programming mode **/ virtual void disableProgramming(void) = 0; /** Erase all chip memory **/ virtual void eraseProgramMemory(void) = 0; virtual void eraseProgramPage(unsigned long address) = 0; /** Download an image contained in the specified file. */ virtual void downloadToTarget(const char* filename, bool program, bool verify) = 0; // Running, single stepping, etc // ----------------------------- /** Retrieve the current Program Counter value, or PC_INVALID if fails */ virtual unsigned long getProgramCounter(void) = 0; /** Set program counter to 'pc'. Return true iff successful **/ virtual bool setProgramCounter(unsigned long pc) = 0; /** Reset AVR. Return true iff successful **/ virtual bool resetProgram(bool possible_nSRST) = 0; /** Interrupt AVR. Return true iff successful **/ virtual bool interruptProgram(void) = 0; /** Resume program execution. Return true iff successful. Note: the gdb 'continue' command is handled by jtagContinue, this is just the low level command to resume after interruptProgram **/ virtual bool resumeProgram(void) = 0; /** Issue a "single step" command to the JTAG box. Return true iff successful **/ virtual bool jtagSingleStep(bool useHLL = false) = 0; /** Send the program on it's merry way, and wait for a breakpoint or input from gdb. Return true for a breakpoint, false for gdb input. **/ virtual bool jtagContinue(void) = 0; // R/W memory // ---------- /** Read 'numBytes' from target memory address 'addr'. The memory space is selected by the high order bits of 'addr' (see above). Returns a dynamically allocated buffer with the requested bytes if successful (caller must free), or NULL if the read failed. **/ virtual uchar *jtagRead(unsigned long addr, unsigned int numBytes) = 0; /** Write 'numBytes' bytes from 'buffer' to target memory address 'addr' The memory space is selected by the high order bits of 'addr' (see above). Returns true for a successful write, false for a failed one. Note: The current behaviour for program-space writes is pretty weird (does not match jtagRead). See comments in jtagrw.cc. **/ virtual bool jtagWrite(unsigned long addr, unsigned int numBytes, uchar buffer[]) = 0; /** Write fuses to target. The input parameter is a string from command-line, as produced by printf("%x", 0xaabbcc ); **/ void jtagWriteFuses(char *fuses); /** Read fuses from target. Shows extended, high and low fuse byte. */ void jtagReadFuses(void); /** Display fuses. Shows extended, high and low fuse byte. */ void jtagDisplayFuses(uchar *fuseBits); /** Write lockbits to target. The input parameter is a string from command-line, as produced by printf("%x", 0xaa); **/ void jtagWriteLockBits(char *lock); /** Read the lock bits from the target and display them. **/ void jtagReadLockBits(void); /** Display lockbits. Shows raw value and individual bits. **/ void jtagDisplayLockBits(uchar *lockBits); }; extern struct jtag *theJtagICE; #endif avarice-2.11.orig/src/jtag1.h0000644000000000000000000001230111072702703012636 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002, 2003, 2004 Intel Corporation * Copyright (C) 2005, 2007 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file extends the generic "jtag" class for the mkI protocol. * * $Id: jtag1.h,v 1.8 2008/06/12 20:21:44 joerg_wunsch Exp $ */ #ifndef JTAG1_H #define JTAG1_H #include "jtag.h" enum SendResult { send_failed, send_ok, mcu_data }; /* There are apparently a total of three hardware breakpoints (the docs claim four, but documents 2 breakpoints accessible via non-existent parameters). In summary, there is one code-only breakpoint, and 2 breakpoints which can be: - 2 code breakpoints - 2 1-byte data breakpoints - 1 code and 1-byte data breakpoint - 1 ranged code breakpoint - 1 ranged data breakpoint Currently we're ignoring ranges, so we allow up to 3 breakpoints, of which a maximum of 2 are data breakpoints. This is easily handled by keeping each kind of breakpoint separate. In the future, we could support "software" breakpoints too (though it seems mildly painful) See avrIceProtocol.txt for full details. */ enum { // We distinguish the total possible breakpoints and those for each type // (code or data) - see above MAX_BREAKPOINTS_CODE = 4, MAX_BREAKPOINTS_DATA = 2, MAX_BREAKPOINTS = 4 }; struct breakpoint { unsigned int address; bpType type; }; class jtag1: public jtag { /** Decode 3-byte big-endian address **/ unsigned long decodeAddress(uchar *buf) { return buf[0] << 16 | buf[1] << 8 | buf[2]; }; /** Encode 3-byte big-endian address **/ void encodeAddress(uchar *buffer, unsigned long x) { buffer[0] = x >> 16; buffer[1] = x >> 8; buffer[2] = x; }; breakpoint bpCode[MAX_BREAKPOINTS_CODE], bpData[MAX_BREAKPOINTS_DATA]; int numBreakpointsCode, numBreakpointsData; public: jtag1(const char *dev, char *name, bool nsrst = false): jtag(dev, name) { apply_nSRST = nsrst; }; virtual void initJtagBox(void); virtual void initJtagOnChipDebugging(unsigned long bitrate); virtual void deleteAllBreakpoints(void); virtual bool deleteBreakpoint(unsigned int address, bpType type, unsigned int length); virtual bool addBreakpoint(unsigned int address, bpType type, unsigned int length); virtual void updateBreakpoints(void); virtual bool codeBreakpointAt(unsigned int address); virtual bool codeBreakpointBetween(unsigned int start, unsigned int end); virtual bool stopAt(unsigned int address); virtual void parseEvents(const char *); virtual void enableProgramming(void); virtual void disableProgramming(void); virtual void eraseProgramMemory(void); virtual void eraseProgramPage(unsigned long address); virtual void downloadToTarget(const char* filename, bool program, bool verify); virtual unsigned long getProgramCounter(void); virtual bool setProgramCounter(unsigned long pc); virtual bool resetProgram(bool possible_nSRST); virtual bool interruptProgram(void); virtual bool resumeProgram(void); virtual bool jtagSingleStep(bool useHLL = false); virtual bool jtagContinue(void); virtual uchar *jtagRead(unsigned long addr, unsigned int numBytes); virtual bool jtagWrite(unsigned long addr, unsigned int numBytes, uchar buffer[]); private: virtual void changeBitRate(int newBitRate); virtual void setDeviceDescriptor(jtag_device_def_type *dev); virtual bool synchroniseAt(int bitrate); virtual void startJtagLink(void); virtual void deviceAutoConfig(void); virtual void configDaisyChain(void); uchar *getJtagResponse(int responseSize); SendResult sendJtagCommand(uchar *command, int commandSize, int *tries); bool checkForEmulator(void); /** Send a command to the jtag, with retries, and return the 'responseSize' byte response. Aborts avarice in case of to many failed retries. Returns a dynamically allocated buffer containing the reponse (caller must free) **/ uchar *doJtagCommand(uchar *command, int commandSize, int responseSize); /** Simplified form of doJtagCommand: Send 1-byte command 'cmd' to JTAG ICE, with retries, expecting a 'responseSize' byte reponse. Return true if responseSize is 0 or if last response byte is JTAG_R_OK **/ bool doSimpleJtagCommand(uchar cmd, int responseSize); // Miscellaneous // ------------- /** Set JTAG ICE parameter 'item' to 'newValue' **/ void setJtagParameter(uchar item, uchar newValue); /** Return value of JTAG ICE parameter 'item' **/ uchar getJtagParameter(uchar item); }; #endif avarice-2.11.orig/src/jtag2.h0000644000000000000000000002321411627164120012645 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2005,2006,2007 Joerg Wunsch * Copyright (C) 2007, Colin O'Flynn * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file extends the generic "jtag" class for the mkII protocol. * * $Id: jtag2.h,v 1.17 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #ifndef JTAG2_H #define JTAG2_H #include "jtag.h" /* * JTAG ICE mkII breakpoints are quite tricky. * * There are four possible breakpoint slots in JTAG. The first one is * always reserved for single-stepping, and cannot be accessed * directly. The second slot (ID #1) can be freely used as a code * breakpoint (only). The third and fourth slot can either be used as * a code breakpoint, as an independent (byte-wide) data breakpoint * (i.e. a watchpoint in GDB terms), or together as a data breakpoint * consisting of an address and a mask. The latter does not match * directly to GDB watchpoints (of a certain lenght > 1) but imposes * the additional requirement that the base address be aligned * properly wrt. the mask. * * The single-step breakpoint can indirectly be used by filling the * respective high-level language information into the event memory, * and issuing a high-level "step over" single-step. As GDB does not * install the breakpoints for "stepi"-style single-steps (which would * require the very same JTAG breakpoint register), this ought to * work. * * Finally, there are software breakpoints where the respective * instruction will be replaced by a BREAK instruction in flash ROM by * means of an SPM call. Some devices do not allow for this (as they * are said to be broken), and in general as this method contributes * to flash wear, we rather do not uninstall and reinstall these * breakpoints each time GDB asks for it, but instead "cache" them * locally, and only delete and add them as they actually change. * * To add to the mess, GDB's remote protocol isn't very smart about * telling us whether the next list of breakpoints + resume are * actually meant to be a high-level language (HLL) single-step * command. Thus, always assume the last breakpoint that comes in to * be a single-step breakpoint, and replace the "resume" operation by * a "step" one in that case. At least, GDB issues the breakpoint * list in the order of breakpoint numbers, so any possible HLL * single-step breakoint must be the last one in the list. * * Finally, GDB has explicit commands for setting hardware-assisted * breakpoints, but the default "break" command uses a software * breakpoint. We try to replace as many software breakpoints as * possible by hardware breakpoints though, for the sake of * efficiency, yet would want to respect the user's choice for setting * a hardware breakpoint ("hbreak" or "thbreak")... * * XXX This is not done yet. */ enum { // We distinguish the total possible breakpoints and those for each type // (code or data) - see above MAX_BREAKPOINTS2_CODE = 4, MAX_BREAKPOINTS2_DATA = 2, MAX_BREAKPOINTS2 = 4, // various slot #s BREAKPOINT2_FIRST_DATA = 2, BREAKPOINT2_DATA_MASK = 3, MAX_TOTAL_BREAKPOINTS2 = 255 }; struct breakpoint2 { // High-level information on breakpoint unsigned int address; unsigned int mask_pointer; bpType type; bool enabled; // Used to flag end of list bool last; // Low-level information on breakpoint bool icestatus; // Status of breakpoint in ICE itself: 'true' // when is enabled in ACTUAL device bool toremove; // Delete this guy in ICE bool toadd; // Add this guy in ICE uchar bpnum; // ICE's breakpoint number (0x00 for software) }; const struct breakpoint2 default_bp = { 0, /* address */ 0, /* mask_pointer */ NONE, /* type */ false, /* enabled */ true, /* last */ false, /* icestatus */ false, /* toremove */ false, /* toadd */ 0, /* bpnum*/ }; class jtag2: public jtag { private: unsigned short command_sequence; int devdescrlen; bool signedIn; bool haveHiddenBreakpoint; bool useDebugWire; bool is_xmega; // Total breakpoints including software breakpoint2 bp[MAX_TOTAL_BREAKPOINTS2]; unsigned char flashCache[MAX_FLASH_PAGE_SIZE]; unsigned int flashCachePageAddr; unsigned char eepromCache[MAX_EEPROM_PAGE_SIZE]; unsigned int eepromCachePageAddr; breakpoint2 softBPcache[MAX_BREAKPOINTS2]; bool nonbreaking_events[EVT_MAX - EVT_BREAK + 1]; public: jtag2(const char *dev, char *name, bool useDW = false, bool is_dragon = false, bool nsrst = false, bool xmega = false): jtag(dev, name, is_dragon? EMULATOR_DRAGON: EMULATOR_JTAGICE) { signedIn = haveHiddenBreakpoint = false; command_sequence = 0; devdescrlen = sizeof(jtag2_device_desc_type); useDebugWire = useDW; apply_nSRST = nsrst; is_xmega = xmega; flashCachePageAddr = (unsigned int)-1; eepromCachePageAddr = (unsigned short)-1; for (int i = 0; i < MAX_BREAKPOINTS2; i++) softBPcache[i].type = NONE; for (int j = 0; j < MAX_TOTAL_BREAKPOINTS2; j++) bp[j] = default_bp; }; virtual ~jtag2(void); virtual void initJtagBox(void); virtual void initJtagOnChipDebugging(unsigned long bitrate); virtual void deleteAllBreakpoints(void); virtual bool deleteBreakpoint(unsigned int address, bpType type, unsigned int length); virtual bool addBreakpoint(unsigned int address, bpType type, unsigned int length); virtual void updateBreakpoints(void); virtual bool layoutBreakpoints(void); virtual bool codeBreakpointAt(unsigned int address); virtual bool codeBreakpointBetween(unsigned int start, unsigned int end); virtual bool stopAt(unsigned int address); virtual void parseEvents(const char *); virtual void enableProgramming(void); virtual void disableProgramming(void); virtual void eraseProgramMemory(void); virtual void eraseProgramPage(unsigned long address); virtual void downloadToTarget(const char* filename, bool program, bool verify); virtual unsigned long getProgramCounter(void); virtual bool setProgramCounter(unsigned long pc); virtual bool resetProgram(bool ignored = false); virtual bool interruptProgram(void); virtual bool resumeProgram(void); virtual bool jtagSingleStep(bool useHLL = false); virtual bool jtagContinue(void); virtual uchar *jtagRead(unsigned long addr, unsigned int numBytes); virtual bool jtagWrite(unsigned long addr, unsigned int numBytes, uchar buffer[]); private: virtual void changeBitRate(int newBitRate); virtual void setDeviceDescriptor(jtag_device_def_type *dev); virtual bool synchroniseAt(int bitrate); virtual void startJtagLink(void); virtual void deviceAutoConfig(void); virtual void configDaisyChain(void); void sendFrame(uchar *command, int commandSize); int recvFrame(unsigned char *&msg, unsigned short &seqno); int recv(unsigned char *&msg); unsigned long b4_to_u32(unsigned char *b) { unsigned long l; l = (unsigned)b[0]; l += (unsigned)b[1] << 8; l += (unsigned)(unsigned)b[2] << 16; l += (unsigned)b[3] << 24; return l; }; void u32_to_b4(unsigned char *b, unsigned long l) { b[0] = l & 0xff; b[1] = (l >> 8) & 0xff; b[2] = (l >> 16) & 0xff; b[3] = (l >> 24) & 0xff; }; unsigned short b2_to_u16(unsigned char *b) { unsigned short l; l = (unsigned)b[0]; l += (unsigned)b[1] << 8; return l; }; void u16_to_b2(unsigned char *b, unsigned short l) { b[0] = l & 0xff; b[1] = (l >> 8) & 0xff; }; bool sendJtagCommand(uchar *command, int commandSize, int &tries, uchar *&msg, int &msgsize, bool verify = true); /** Send a command to the jtag, with retries, and return the 'responseSize' byte &response, response size in &responseSize. If retryOnTimeout is true, retry the command if no (positive or negative) response arrived in time, abort after too many retries. If a negative response arrived, return false, otherwise true. Caller must delete [] the response. **/ bool doJtagCommand(uchar *command, int commandSize, uchar *&response, int &responseSize, bool retryOnTimeout = true); /** Simplified form of doJtagCommand: Send 1-byte command 'cmd' to JTAG ICE, with retries, expecting a response that consists only of the status byte which must be RSP_OK. **/ void doSimpleJtagCommand(uchar cmd); // Miscellaneous // ------------- /** Set JTAG ICE parameter 'item' to 'newValue' **/ void setJtagParameter(uchar item, uchar *newValue, int valSize); /** Return value of JTAG ICE parameter 'item'; caller must delete [] resp **/ void getJtagParameter(uchar item, uchar *&resp, int &respSize); uchar memorySpace(unsigned long &addr); /** debugWire version of the breakpoint updater. **/ void updateBreakpintsDW(void); /** Wait until either the ICE or GDB issued an event. As this is the heart of jtagContinue for the mkII, it returns true when a breakpoint was reached, and false for GDB input. **/ bool eventLoop(void); }; #endif avarice-2.11.orig/src/jtag2bp.cc0000644000000000000000000003650311627164120013332 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002 Intel Corporation * Copyright (C) 2005,2006 Joerg Wunsch * Copyright (C) 2007, Colin O'Flynn * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains the breakpoint handling for the mkII * protocol. It has been re-written by Colin O'Flynn. * * $Id: jtag2bp.cc,v 1.10 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include "avarice.h" #include "jtag.h" #include "jtag2.h" bool jtag2::codeBreakpointAt(unsigned int address) { int i; i = 0; while (!bp[i].last) { if ((bp[i].address == address) && (bp[i].type == CODE) && bp[i].enabled) return true; i++; } return false; } bool jtag2::codeBreakpointBetween(unsigned int start, unsigned int end) { int i; i = 0; while (!bp[i].last) { if ((bp[i].address >= start && bp[i].address < end) && (bp[i].type == CODE) && bp[i].enabled) return true; i++; } return false; } void jtag2::deleteAllBreakpoints(void) { int i = 0; while (!bp[i].last) { if (bp[i].enabled && bp[i].icestatus) bp[i].toremove = true; bp[i].enabled = false; i++; } } bool jtag2::stopAt(unsigned int address) { uchar one = 1; return jtagWrite(BREAKPOINT_SPACE_ADDR_OFFSET + address / 2, 1, &one); } #ifdef notyet bool jtag2::BreakpointRoom(bpType type, unsigned int length) { int numdata = 0; int numcode = 0; int bp_i = 0; //code if (type == CODE) { numcode++; } //data else if ((bp[bp_i].type == READ_DATA) || (bp[bp_i].type == (READ_DATA | HAS_MASK)) || (bp[bp_i].type == WRITE_DATA) || (bp[bp_i].type == (WRITE_DATA | HAS_MASK)) || (bp[bp_i].type == ACCESS_DATA) || (bp[bp_i].type == (ACCESS_DATA | HAS_MASK))) { // range BPs use two slots if (length > 1) { numdata += 2; } else { numdata++; } } // First let's check debugWire which doesn't let you have data breakpoints if (useDebugWire) { if (numdata > 0) { debugOut("DebugWire doesn't support data breakpoints.\n"); return false; } } // Count current breakpoints while (!bp[bp_i].last) { // how many breakpoints are we predicting to be enabled? if (bp[bp_i].toadd || bp[bp_i].enabled) { if ((bp[bp_i].type == READ_DATA) || (bp[bp_i].type == (READ_DATA | HAS_MASK)) || (bp[bp_i].type == WRITE_DATA) || (bp[bp_i].type == (WRITE_DATA | HAS_MASK)) || (bp[bp_i].type == ACCESS_DATA) || (bp[bp_i].type == (ACCESS_DATA | HAS_MASK)) || (bp[bp_i].type == DATA_MASK)) { numdata++; } else if (bp[bp_i].type == CODE) { numcode++; } } bp_i++; } // Some devices don't support software breakpoints. Also there // might be an upper limit on software breakpoints, do we care? if ((global_p_device_def->device_flags & DEVFL_NO_SOFTBP) != 0) { // There are only 3 hardware BPs available, the fourth one // is reserved by the ICE for single-stepping. if ((numcode > (MAX_BREAKPOINTS2_CODE - 1)) || ((numcode + numdata) > (MAX_BREAKPOINTS2 - 1))) { return false; } } if (numdata > MAX_BREAKPOINTS2_DATA) { return false; } // Your room is ready return true; } #endif // notyet bool jtag2::addBreakpoint(unsigned int address, bpType type, unsigned int length) { int bp_i; debugOut("BP ADD type: %d addr: 0x%x ", type, address); // Perhaps we have already set this breakpoint, and it is just // marked as disabled In that case we don't need to make a new // one, just flag this one as enabled again bp_i = 0; while (!bp[bp_i].last) { if ((bp[bp_i].address == address) && (bp[bp_i].type == type)) { bp[bp_i].enabled = true; debugOut("ENABLED\n"); break; } bp_i++; } // Was what we just did not successful, if so... if (!bp[bp_i].enabled || (bp[bp_i].address != address) || (bp[bp_i].type == type)) { // Uhh... we are out of space. Try to find a disabled one and just // write over it. if ((bp_i + 1) == MAX_TOTAL_BREAKPOINTS2) { bp_i = 0; // We can't remove enabled breakpoints, or ones that // have JUST been disabled. The just disabled ones // because they have to sync to the ICE while (bp[bp_i].enabled || bp[bp_i].toremove) { bp_i++; } } // Sorry.. out of room :( if ((bp_i + 1) == MAX_TOTAL_BREAKPOINTS2) { debugOut("FAILED\n"); return false; } if (bp[bp_i].last) { //See if we need to set the new endpoint bp[bp_i + 1].last = true; bp[bp_i + 1].enabled = false; bp[bp_i + 1].address = 0; bp[bp_i + 1].type = NONE; } // bp_i now has the new breakpoint we are going to use. bp[bp_i].last = false; bp[bp_i].enabled = true; bp[bp_i].address = address; bp[bp_i].type = type; // Is it a range breakpoint? // Range breakpoint needs to be aligned, and the length must // be representable as a bitmask. if ((length > 1) && (type != CODE)) { int bitno = ffs((int)length); unsigned int mask = 1 << (bitno - 1); if (mask != length) { debugOut("FAILED: length not power of 2 in range BP\n"); bp[bp_i].last = true; bp[bp_i].enabled = false; return false; } mask--; if ((address & mask) != 0) { debugOut("FAILED: address in range BP is not base-aligned\n"); bp[bp_i].last = true; bp[bp_i].enabled = false; return false; } mask = ~mask; bp[bp_i].type = (bpType)(type | HAS_MASK); // add the breakpoint as a data mask.. only thing is we // need to find it afterwards if (!addBreakpoint(mask, DATA_MASK, 1)) { debugOut("FAILED\n"); bp[bp_i].last = true; bp[bp_i].enabled = false; return false; } unsigned int j; for(j = 0; !bp[j].last; j++) { if ((bp[j].type == DATA_MASK) && (bp[bp_i].address == mask)) break; } bp[bp_i].mask_pointer = j; debugOut("range BP ADDED: 0x%x/0x%x\n", address, mask); } } // Is this breakpoint new? if (!bp[bp_i].icestatus) { // Yup - flag it as something to download bp[bp_i].toadd = true; bp[bp_i].toremove = false; } else { bp[bp_i].toadd = false; bp[bp_i].toremove = false; } if (!layoutBreakpoints()) { debugOut("Not enough room in ICE for breakpoint. FAILED.\n"); bp[bp_i].enabled = false; bp[bp_i].toadd = false; if ((bp[bp_i].type & HAS_MASK) == HAS_MASK) { bp[bp[bp_i].mask_pointer].enabled = false; bp[bp[bp_i].mask_pointer].toadd = false; } } return true; } PRAGMA_DIAG_PUSH PRAGMA_DIAG_IGNORED("-Wunused-parameter") bool jtag2::deleteBreakpoint(unsigned int address, bpType type, unsigned int length) { int bp_i; debugOut("BP DEL type: %d addr: 0x%x ", type, address); bp_i = 0; while (!bp[bp_i].last) { if ((bp[bp_i].address == address) && (bp[bp_i].type == type)) { bp[bp_i].enabled = false; debugOut("DISABLED\n"); break; } bp_i++; } // If it somehow failed, got to tell.. if (bp[bp_i].enabled || (bp[bp_i].address != address) || (bp[bp_i].type != type)) { debugOut("FAILED\n"); return false; } // Is this breakpoint actually enabled? if (bp[bp_i].icestatus) { // Yup - flag it as something to delete bp[bp_i].toadd = false; bp[bp_i].toremove = true; } else { bp[bp_i].toadd = false; bp[bp_i].toremove = false; } return true; } PRAGMA_DIAG_POP /* * This routine is where all the logic of what breakpoints go into the * ICE and what don't happens. When called it assumes all the "toadd" * breakpoints don't have valid "bpnum" attached to them. It then * attempts to fit all the needed breakpoints into the hardware * breakpoints first. If that won't fly it then adds software * breakpoints as needed... or just fails. * * * TODO: Some logic to decide which breakpoints change a lot and * should go in hardware, vs. which breakpoints are more fixed and * should just be done in code would be handy */ bool jtag2::layoutBreakpoints(void) { // remaining_bps is an array showing which breakpoints are still // available, starting at 0x00 Note 0x00 is software breakpoint // and will always be available in theory so just ignore the first // array element, it's meaningless... FIXME: Slot 4 is set to // 'false', doesn't seem to work? bool remaining_bps[MAX_BREAKPOINTS2 + 2] = {false, true, true, true, false, false}; int bp_i; uchar bpnum; bool softwarebps = true; bool hadroom = true; if (global_p_device_def->device_flags == DEVFL_NO_SOFTBP) { softwarebps = false; } // Turn off everything but software breakpoints for DebugWire if (useDebugWire) { int k; for (k = 1; k < MAX_BREAKPOINTS2 + 1; k++) { remaining_bps[k] = false; } } bp_i = 0; while (!bp[bp_i].last) { // check we have an enabled "stable" breakpoint that's not // about to change if (bp[bp_i].enabled && !bp[bp_i].toremove && bp[bp_i].icestatus) { remaining_bps[bp[bp_i].bpnum] = false; } bp_i++; } // Do data watchpoints first bp_i = 0; while (!bp[bp_i].last) { // Find the next data breakpoint that needs somewhere to live if (bp[bp_i].enabled && bp[bp_i].toadd && ((bp[bp_i].type == READ_DATA) || (bp[bp_i].type == (READ_DATA | HAS_MASK)) || (bp[bp_i].type == WRITE_DATA) || (bp[bp_i].type == (WRITE_DATA | HAS_MASK)) || (bp[bp_i].type == ACCESS_DATA) || (bp[bp_i].type == (ACCESS_DATA | HAS_MASK)))) { if ((bp[bp_i].type & HAS_MASK) == HAS_MASK) { // Check if we have both slots available if (!remaining_bps[BREAKPOINT2_DATA_MASK] || !remaining_bps[BREAKPOINT2_FIRST_DATA]) { debugOut("Not enough room to store range breakpoint\n"); bp[bp[bp_i].mask_pointer].enabled = false; bp[bp[bp_i].mask_pointer].toadd = false; bp[bp_i].enabled = false; bp[bp_i].toadd = false; bp_i++; hadroom = false; continue; // Skip this breakpoint } else { remaining_bps[BREAKPOINT2_DATA_MASK] = false; bp[bp[bp_i].mask_pointer].bpnum = BREAKPOINT2_DATA_MASK; } } // Find next available slot bpnum = BREAKPOINT2_FIRST_DATA; while (!remaining_bps[bpnum] && (bpnum <= MAX_BREAKPOINTS2)) { bpnum++; } if (bpnum > MAX_BREAKPOINTS2) { debugOut("No more room for data breakpoints.\n"); hadroom = false; break; } bp[bp_i].bpnum = bpnum; remaining_bps[bpnum] = false; } bp_i++; } // Do CODE breakpoints now bp_i = 0; while (!bp[bp_i].last) { //Find the next spot to live in. bpnum = 0x00; while (!remaining_bps[bpnum] && (bpnum <= MAX_BREAKPOINTS2)) { debugOut("Slot %d full\n", bpnum); bpnum++; } if (bpnum > MAX_BREAKPOINTS2) { if (softwarebps) { bpnum = 0x00; } else { bpnum = 0xFF; // flag for NO MORE BREAKPOINTS } } // Find the next breakpoint that needs somewhere to live if (bp[bp_i].enabled && bp[bp_i].toadd && (bp[bp_i].type == CODE)) { if (bpnum == 0xFF) { debugOut("No more room for code breakpoints.\n"); hadroom = false; break; } bp[bp_i].bpnum = bpnum; remaining_bps[bpnum] = false; } bp_i++; } return hadroom; } /* * As the case labels below can be values ORed from enum values with * HAS_MASK, this causes GCC (4.4+) to emit warnings that the case * value is not in enumerated type. Drop them just here. */ PRAGMA_DIAG_PUSH PRAGMA_DIAG_IGNORED("-Wswitch") void jtag2::updateBreakpoints(void) { int bp_i; layoutBreakpoints(); // Delete all the breakpoints that were flagged first bp_i = 0; while (!bp[bp_i].last) { uchar cmd[6] = { CMND_CLR_BREAK }; if (bp[bp_i].toremove) { debugOut("Breakpoint deleted in ICE. slot: %d type: %d addr: 0x%x\n", bp[bp_i].bpnum, bp[bp_i].type, bp[bp_i].address); cmd[1] = bp[bp_i].bpnum; // Software breakpoints need the address! if (bp[bp_i].bpnum == 0x00) u32_to_b4(cmd + 2, (bp[bp_i].address / 2)); else u32_to_b4(cmd + 2, 0); uchar *response; int responseSize; if(!doJtagCommand(cmd, 6, response, responseSize)) check(false, "Failed to clear breakpoint"); delete [] response; // rip breakpoint bp[bp_i].icestatus = false; bp[bp_i].toremove = false; } bp_i++; } // Add all the new breakpoints bp_i = 0; while (!bp[bp_i].last) { uchar cmd[8] = { CMND_SET_BREAK }; if (bp[bp_i].toadd && bp[bp_i].enabled) { debugOut("Breakpoint added in ICE. slot: %d type: %d addr: 0x%x\n", bp[bp_i].bpnum, bp[bp_i].type, bp[bp_i].address); cmd[1] = bp[bp_i].type; cmd[2] = bp[bp_i].bpnum; if (bp[bp_i].type == CODE) { // The JTAG box sees program memory as 16-bit // wide locations. GDB sees bytes. As such, // halve the breakpoint address. u32_to_b4(cmd + 3, (bp[bp_i].address / 2)); } else { u32_to_b4(cmd + 3, bp[bp_i].address); } switch (bp[bp_i].type) { case READ_DATA: case READ_DATA | HAS_MASK: cmd[7] = 0x00; cmd[1] = 0x02; break; case WRITE_DATA: case WRITE_DATA | HAS_MASK: cmd[7] = 0x01; cmd[1] = 0x02; break; case ACCESS_DATA: case ACCESS_DATA | HAS_MASK: cmd[7] = 0x02; cmd[1] = 0x02; break; case DATA_MASK: cmd[7] = 0x00; cmd[1] = 0x03; break; case CODE: cmd[1] = bp[bp_i].type; cmd[7] = 0x03; break; default: check(false, "Invalid bp mode (for data bp)"); break; } uchar *response; int responseSize; check(doJtagCommand(cmd, 8, response, responseSize), "Failed to set breakpoint"); delete [] response; // It's a beautiful baby breakpoint bp[bp_i].icestatus = true; bp[bp_i].toadd = false; } bp_i++; } } PRAGMA_DIAG_POP avarice-2.11.orig/src/jtag2io.cc0000644000000000000000000004467711627164120013353 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002, 2003, 2004 Intel Corporation * Copyright (C) 2005, 2006, 2007 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file implements the basic IO handling for the mkII protocol. * * $Id: jtag2io.cc,v 1.16 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include #include #include #include "avarice.h" #include "crc16.h" #include "jtag.h" #include "jtag2.h" #include "jtag2_defs.h" jtag2::~jtag2(void) { // Terminate connection to JTAG box. if (signedIn) { // Do not use doSimpleJtagCommand() here as it aborts // avarice on failure; in case CMND_RESTORE_TARGET fails, // we'd like to try the sign-off command anyway. uchar *response, rstcmd = CMND_RESTORE_TARGET; int responseSize; (void)doJtagCommand(&rstcmd, 1, response, responseSize); delete [] response; doSimpleJtagCommand(CMND_SIGN_OFF); signedIn = false; } } /* * Send one frame. Adds the required preamble and CRC, and ensures * the frame could be written correctly. */ void jtag2::sendFrame(uchar *command, int commandSize) { unsigned char *buf = new unsigned char[commandSize + 10]; check(buf != NULL, "Out of memory"); buf[0] = MESSAGE_START; u16_to_b2(buf + 1, command_sequence); u32_to_b4(buf + 3, commandSize); buf[7] = TOKEN; memcpy(buf + 8, command, commandSize); crcappend(buf, commandSize + 8); int count = safewrite(buf, commandSize + 10); delete [] buf; if (count < 0) jtagCheck(count); else // this shouldn't happen check(count == commandSize + 10, JTAG_CAUSE); } /* * Receive one frame, return it in &msg. Received sequence number is * returned in &seqno. Any valid frame will be returned, regardless * whether it matches the expected sequence number, including event * notification frames (seqno == 0xffff). * * Caller must eventually free the buffer. */ int jtag2::recvFrame(unsigned char *&msg, unsigned short &seqno) { enum states { sSTART, sSEQNUM1, sSEQNUM2, sSIZE1, sSIZE2, sSIZE3, sSIZE4, sTOKEN, sDATA, sCSUM1, sCSUM2, sDONE } state = sSTART; unsigned int msglen = 0, l = 0; unsigned int headeridx = 0; bool ignorpkt = false; int rv; unsigned char c, *buf = NULL, header[8]; unsigned short r_seqno = 0; unsigned short checksum = 0; msg = NULL; if (ctrlPipe != -1) { /* signal the USB daemon we are ready to get data */ char cmd[1] = { 'r' }; (void)(write(ctrlPipe, cmd, 1) != 0); } while (state != sDONE) { if (state == sDATA) { debugOut("sDATA: reading %d bytes\n", msglen); rv = 0; if (ignorpkt) { /* skip packet's contents */ for(l = 0; l < msglen; l++) { rv += timeout_read(&c, 1, JTAG_RESPONSE_TIMEOUT); debugOut("ign: 0x%02x\n", c); } } else { rv += timeout_read(buf + 8, msglen, JTAG_RESPONSE_TIMEOUT); debugOut("read: "); for (l = 0; l < msglen; l++) { debugOut(" %02x", buf[l + 8]); } debugOut("\n"); } if (rv == 0) /* timeout */ break; } else { rv = timeout_read(&c, 1, JTAG_RESPONSE_TIMEOUT); if (rv == 0) { /* timeout */ debugOut("recv: timeout\n"); break; } debugOut("recv: 0x%02x\n", c); } checksum ^= c; if (state < sDATA) header[headeridx++] = c; switch (state) { case sSTART: if (c == MESSAGE_START) { state = sSEQNUM1; } else { headeridx = 0; } break; case sSEQNUM1: r_seqno = c; state = sSEQNUM2; break; case sSEQNUM2: r_seqno |= ((unsigned)c << 8); state = sSIZE1; break; case sSIZE1: state = sSIZE2; goto domsglen; case sSIZE2: state = sSIZE3; goto domsglen; case sSIZE3: state = sSIZE4; goto domsglen; case sSIZE4: state = sTOKEN; domsglen: msglen >>= 8; msglen |= ((unsigned)c << 24); break; case sTOKEN: if (c == TOKEN) { state = sDATA; if (msglen > MAX_MESSAGE) { printf("msglen %u exceeds max message size %u, ignoring message\n", msglen, MAX_MESSAGE); state = sSTART; headeridx = 0; } else { buf = new unsigned char[msglen + 10]; check(buf != NULL, "Out of memory"); memcpy(buf, header, 8); } } else { state = sSTART; headeridx = 0; } break; case sDATA: /* The entire payload has been read above. */ l = msglen + 8; state = sCSUM1; break; case sCSUM1: buf[l++] = c; state = sCSUM2; break; case sCSUM2: buf[l++] = c; if (crcverify(buf, msglen + 10)) { debugOut("CRC OK"); state = sDONE; } else { debugOut("checksum error"); delete [] buf; return -1; } break; default: debugOut("unknown state"); delete [] buf; return -1; } } seqno = r_seqno; msg = buf; return (int)msglen; } /* * Try receiving frames, until we get the reply we are expecting. * Caller must delete[] the msg after processing it. */ int jtag2::recv(uchar *&msg) { unsigned short r_seqno; int rv; for (;;) { if ((rv = recvFrame(msg, r_seqno)) <= 0) return rv; debugOut("\nGot message seqno %d (command_sequence == %d)\n", r_seqno, command_sequence); if (r_seqno == command_sequence) { if (++command_sequence == 0xffff) command_sequence = 0; /* * We move the payload to the beginning of the buffer, to make * the job easier for the caller. We have to return the * original pointer though, as the caller must free() it. */ memmove(msg, msg + 8, rv); return rv; } if (r_seqno == 0xffff) { debugOut("\ngot asynchronous event: 0x%02x\n", msg[8]); // XXX should we queue that event up somewhere? // How to process it? Register event handlers // for interesting events? // For now, the only place that cares is jtagContinue // and it just calls recvFrame and handles events directly. } else { debugOut("\ngot wrong sequence number, %u != %u\n", r_seqno, command_sequence); } delete [] msg; } } /** Send a command to the jtag, and check result. Increase *tries, abort if reaches MAX_JTAG_COMM_ATTEMPS Reads first response byte. If no response is received within JTAG_RESPONSE_TIMEOUT, returns false. If response is positive returns true, otherwise returns false. If response is positive, message (including response code) is returned in &msg, caller must delete [] it. The message size is returned in &msgsize. **/ bool jtag2::sendJtagCommand(uchar *command, int commandSize, int &tries, uchar *&msg, int &msgsize, bool verify) { check(tries++ < MAX_JTAG_COMM_ATTEMPS, "JTAG ICE: Cannot synchronise"); debugOut("\ncommand[0x%02x, %d]: ", command[0], tries); for (int i = 0; i < commandSize; i++) debugOut("%.2X ", command[i]); debugOut("\n"); sendFrame(command, commandSize); msgsize = recv(msg); if (verify) jtagCheck(msgsize - 1); else if (msgsize < 1) return false; debugOut("response: "); for (int i = 0; i < msgsize; i++) { debugOut("%.2X ", msg[i]); } debugOut("\n"); unsigned char c = msg[0]; if (c >= RSP_OK && c < RSP_FAILED) return true; return false; } bool jtag2::doJtagCommand(uchar *command, int commandSize, uchar *&response, int &responseSize, bool retryOnTimeout) { int tryCount = 0; // Send command until we get an OK response for (;;) { if (sendJtagCommand(command, commandSize, tryCount, response, responseSize, false)) return true; if (responseSize > 0 || !retryOnTimeout) // Got a negative response in time; there is no point // in retrying the command. return false; if (tryCount > 3 && ctrlPipe != -1) { /* signal the USB daemon to reset the EPs */ debugOut("Resetting EPs...\n"); char cmd[1] = { 'c' }; (void)(write(ctrlPipe, cmd, 1) != 0); } } } void jtag2::doSimpleJtagCommand(uchar command) { int tryCount = 0, dummy; uchar *replydummy; // Send command until we get an OK response for (;;) { if (sendJtagCommand(&command, 1, tryCount, replydummy, dummy, false)) { check(replydummy != NULL, JTAG_CAUSE); check(dummy == 1 && replydummy[0] == RSP_OK, "Unexpected response in doSimpleJtagCommand"); delete [] replydummy; return; } // See whether it timed out only. If so, retry. jtagCheck(dummy <= 0); } } /** Set PC and JTAG ICE bitrate to BIT_RATE_xxx specified by 'newBitRate' **/ void jtag2::changeBitRate(int newBitRate) { // Don't try to change the speed of an USB connection. // For the AVR Dragon, that would even result in the parameter // change below being rejected. if (is_usb) return; uchar jtagrate; switch (newBitRate) { case 9600: jtagrate = PAR_BAUD_9600; break; case 19200: jtagrate = PAR_BAUD_19200; break; case 38400: jtagrate = PAR_BAUD_38400; break; case 57600: jtagrate = PAR_BAUD_57600; break; case 115200: jtagrate = PAR_BAUD_115200; break; } setJtagParameter(PAR_BAUD_RATE, &jtagrate, 1); changeLocalBitRate(newBitRate); } /** Set the JTAG ICE device descriptor data for specified device type **/ void jtag2::setDeviceDescriptor(jtag_device_def_type *dev) { uchar *response; uchar *command = (uchar *)(&dev->dev_desc2); int respSize; check(doJtagCommand(command, devdescrlen, response, respSize), "JTAG ICE: Failed to set device description"); delete [] response; } /** Attempt to synchronise with JTAG at specified bitrate **/ bool jtag2::synchroniseAt(int bitrate) { debugOut("Attempting synchronisation at bitrate %d\n", bitrate); changeLocalBitRate(bitrate); int tries = 0; uchar *signonmsg, signoncmd = CMND_GET_SIGN_ON; int msgsize; while (tries < MAX_JTAG_SYNC_ATTEMPS) { if (sendJtagCommand(&signoncmd, 1, tries, signonmsg, msgsize, false)) { check(signonmsg[0] == RSP_SIGN_ON && msgsize > 17, "Unexpected response to sign-on command"); signonmsg[msgsize - 1] = '\0'; statusOut("Found a device: %s\n", signonmsg + 16); statusOut("Serial number: %02x:%02x:%02x:%02x:%02x:%02x\n", signonmsg[10], signonmsg[11], signonmsg[12], signonmsg[13], signonmsg[14], signonmsg[15]); debugOut("JTAG ICE mkII sign-on message:\n"); debugOut("Communications protocol version: %u\n", (unsigned)signonmsg[1]); debugOut("M_MCU:\n"); debugOut(" boot-loader FW version: %u\n", (unsigned)signonmsg[2]); debugOut(" firmware version: %u.%02u\n", (unsigned)signonmsg[4], (unsigned)signonmsg[3]); debugOut(" hardware version: %u\n", (unsigned)signonmsg[5]); debugOut("S_MCU:\n"); debugOut(" boot-loader FW version: %u\n", (unsigned)signonmsg[6]); debugOut(" firmware version: %u.%02u\n", (unsigned)signonmsg[8], (unsigned)signonmsg[7]); debugOut(" hardware version: %u\n", (unsigned)signonmsg[9]); // The AVR Dragon always uses the full device descriptor. if (emu_type == EMULATOR_JTAGICE) { unsigned short fwver = ((unsigned)signonmsg[8] << 8) | (unsigned)signonmsg[7]; // Check the S_MCU firmware version to know which format // of the device descriptor to send. #define FWVER(maj, min) ((maj << 8) | (min)) if (fwver < FWVER(3, 16)) { devdescrlen -= 2; fprintf(stderr, "Warning: S_MCU firmware version might be " "too old to work correctly\n "); } else if (fwver < FWVER(4, 0)) { devdescrlen -= 2; } #undef FWVER } delete [] signonmsg; return true; } } return false; } /** Attempt to synchronise with JTAG ICE at all possible bit rates **/ void jtag2::startJtagLink(void) { static int bitrates[] = { 19200, 115200, 57600, 38400, 9600 }; for (unsigned int i = 0; i < sizeof bitrates / sizeof *bitrates; i++) if (synchroniseAt(bitrates[i])) { uchar val; if (apply_nSRST) { val = 0x01; setJtagParameter(PAR_EXTERNAL_RESET, &val, 1); } val = useDebugWire? EMULATOR_MODE_DEBUGWIRE: (is_xmega? EMULATOR_MODE_JTAG_XMEGA: EMULATOR_MODE_JTAG); setJtagParameter(PAR_EMULATOR_MODE, &val, 1); signedIn = true; return; } check(false, "Failed to synchronise with the JTAG ICE (is it connected and powered?)"); } /** Device automatic configuration Determines the device being controlled by the JTAG ICE and configures the system accordingly. May be overridden by command line parameter. */ void jtag2::deviceAutoConfig(void) { unsigned int device_id; uchar *resp; int respSize; jtag_device_def_type *pDevice = deviceDefinitions; // Auto config debugOut("Automatic device detection: "); /* Set daisy chain information */ configDaisyChain(); /* Read in the JTAG device ID to determine device */ if (useDebugWire) { getJtagParameter(PAR_TARGET_SIGNATURE, resp, respSize); jtagCheck(respSize == 2); device_id = resp[1] | (resp[2] << 8); delete [] resp; statusOut("Reported debugWire device ID: 0x%0X\n", device_id); } else { getJtagParameter(PAR_JTAGID, resp, respSize); jtagCheck(respSize == 4); device_id = resp[1] | (resp[2] << 8) | (resp[3] << 16) | resp[4] << 24; delete [] resp; debugOut("JTAG id = 0x%0X : Ver = 0x%0x : Device = 0x%0x : Manuf = 0x%0x\n", device_id, (device_id & 0xF0000000) >> 28, (device_id & 0x0FFFF000) >> 12, (device_id & 0x00000FFE) >> 1); device_id = (device_id & 0x0FFFF000) >> 12; statusOut("Reported JTAG device ID: 0x%0X\n", device_id); } if (device_name == 0) { while (pDevice->name) { if (pDevice->device_id == device_id) break; pDevice++; } check(pDevice->name, "No configuration available for device ID: %0x\n", device_id); } else { debugOut("Looking for device: %s\n", device_name); while (pDevice->name) { if (strcasecmp(pDevice->name, device_name) == 0) break; pDevice++; } check(pDevice->name, "No configuration available for Device: %s\n", device_name); } if (device_name) { if (device_id != pDevice->device_id) { statusOut("Configured for device ID: 0x%0X %s -- FORCED with %s\n", pDevice->device_id, pDevice->name, device_name); } else { statusOut("Configured for device ID: 0x%0X %s -- Matched with " "%s\n", pDevice->device_id, pDevice->name, device_name); } } else { statusOut("Configured for device ID: 0x%0X %s\n", pDevice->device_id, pDevice->name); } device_name = (char*)pDevice->name; global_p_device_def = pDevice; setDeviceDescriptor(pDevice); } void jtag2::initJtagBox(void) { statusOut("JTAG config starting.\n"); if (device_name != 0) { jtag_device_def_type *pDevice = deviceDefinitions; while (pDevice->name) { if (strcasecmp(pDevice->name, device_name) == 0) break; pDevice++; } if (pDevice->name != 0) { // If a device name has been specified on the command-line, // this overrides the is_xmega setting. is_xmega = pDevice->is_xmega; } } startJtagLink(); changeBitRate(115200); interruptProgram(); deviceAutoConfig(); // Clear out the breakpoints. deleteAllBreakpoints(); statusOut("JTAG config complete.\n"); } void jtag2::initJtagOnChipDebugging(unsigned long bitrate) { statusOut("Preparing the target device for On Chip Debugging.\n"); // debugWire cannot read or manipulate fuse or lock bits if (!useDebugWire) { uchar br; if (bitrate >= 6400000) br = 0; else if (bitrate >= 2800000) br = 1; else if (bitrate >= 20900) br = (unsigned char)(5.35e6 / (double)bitrate); else br = 255; // Set JTAG bitrate setJtagParameter(PAR_OCD_JTAG_CLK, &br, 1); // When attaching we can't change fuse bits, etc, as // enabling+disabling programming resets the processor enableProgramming(); // Ensure that all lock bits are "unlocked" ie all 1's uchar *lockBits = 0; lockBits = jtagRead(LOCK_SPACE_ADDR_OFFSET + 0, 1); if (*lockBits != LOCK_BITS_ALL_UNLOCKED) { lockBits[0] = LOCK_BITS_ALL_UNLOCKED; jtagWrite(LOCK_SPACE_ADDR_OFFSET + 0, 1, lockBits); } statusOut("\nDisabling lock bits:\n"); statusOut(" LockBits -> 0x%02x\n", *lockBits); if (lockBits) { delete [] lockBits; lockBits = 0; } // Ensure on-chip debug enable fuse is enabled ie '0' uchar *fuseBits = 0; statusOut("\nEnabling on-chip debugging:\n"); fuseBits = jtagRead(FUSE_SPACE_ADDR_OFFSET + 0, 3); if ((fuseBits[1] & FUSE_OCDEN) == FUSE_OCDEN) { fuseBits[1] = fuseBits[1] & ~FUSE_OCDEN; // clear bit jtagWrite(FUSE_SPACE_ADDR_OFFSET + 1, 1, &fuseBits[1]); } jtagDisplayFuses(fuseBits); if (fuseBits) { delete [] fuseBits; fuseBits = 0; } disableProgramming(); } resetProgram(); uchar timers = 0; // stopped if (!is_xmega) setJtagParameter(PAR_TIMERS_RUNNING, &timers, 1); resetProgram(); } void jtag2::configDaisyChain(void) { unsigned char buf[4]; if ((dchain.units_before > 0) || (dchain.units_after > 0) || (dchain.bits_before > 0) || (dchain.bits_after > 0) ){ buf[0] = dchain.units_before; buf[1] = dchain.units_after; buf[2] = dchain.bits_before; buf[3] = dchain.bits_after; setJtagParameter(PAR_DAISY_CHAIN_INFO, buf, 4); } } avarice-2.11.orig/src/jtag2misc.cc0000644000000000000000000000434510245703045013663 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2005 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains miscellaneous routines for the mkII protocol. * * $Id: jtag2misc.cc,v 1.2 2005/05/27 20:42:13 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include "avarice.h" #include "jtag.h" #include "jtag2.h" void jtag2::setJtagParameter(uchar item, uchar *newValue, int valSize) { int respsize; /* * As the maximal parameter length is 4 bytes, we use a fixed-length * buffer, as opposed to malloc()ing it. */ unsigned char buf[2 + 4], *resp; check(valSize <= 4, "Parameter too large in setJtagParameter"); buf[0] = CMND_SET_PARAMETER; buf[1] = item; memcpy(buf + 2, newValue, valSize); check(doJtagCommand(buf, valSize + 2, resp, respsize), "set paramater command failed"); delete [] resp; } /* * Get a JTAG ICE parameter. Caller must delete [] the response. Note * that the response still includes the response code at index 0 (to be * ignored). */ void jtag2::getJtagParameter(uchar item, uchar *&resp, int &respSize) { /* * As the maximal parameter length is 4 bytes, we use a fixed-length * buffer, as opposed to malloc()ing it. */ unsigned char buf[2]; buf[0] = CMND_GET_PARAMETER; buf[1] = item; check(doJtagCommand(buf, 2, resp, respSize), "get paramater command failed"); check(resp[0] == RSP_PARAMETER && respSize > 1, "unexpected response to get paramater command"); } avarice-2.11.orig/src/jtag2prog.cc0000644000000000000000000002265211627165337013713 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002 Intel Corporation * Copyright (C) 2005,2006 Joerg Wunsch * * File format support using BFD contributed and copyright 2003 * Nils Kr. Strom * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file implements the target memory programming interface for * the mkII protocol. * * $Id: jtag2prog.cc,v 1.6 2011/08/30 13:51:27 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include #include #include "avarice.h" #include "jtag.h" #include "jtag2.h" // The API changed for this in bfd.h. This is a work around. #ifndef bfd_get_section_size # define bfd_get_section_size bfd_get_section_size_before_reloc #endif static void initImage(BFDimage *image) { unsigned int i; image->last_address = 0; image->first_address = 0; image->first_address_ok = false; image->has_data = false; for (i=0;iimage[i].val = 0x00; image->image[i].used = false; } } void jtag2::enableProgramming(void) { if (!useDebugWire) { programmingEnabled = true; doSimpleJtagCommand(CMND_ENTER_PROGMODE); } } void jtag2::disableProgramming(void) { if (!useDebugWire) { programmingEnabled = false; doSimpleJtagCommand(CMND_LEAVE_PROGMODE); } } // This is really a chip-erase which erases flash, lock-bits and eeprom // (unless the save-eeprom fuse is set). void jtag2::eraseProgramMemory(void) { doSimpleJtagCommand(CMND_CHIP_ERASE); } void jtag2::eraseProgramPage(unsigned long address) { uchar *response; int respSize; uchar command[5] = { CMND_ERASEPAGE_SPM }; command[1] = (address & 0xff000000) >> 24; command[2] = (address & 0xff0000) >> 16; command[3] = (address & 0xff00) >> 8; command[4] = address; check(doJtagCommand(command, sizeof(command), response, respSize), "Page erase failed\n"); delete [] response; } // Check if file format is supported. // return nonzero on errors. static int check_file_format(bfd *file) { char **matching; int err = 1; // Check if archive, not plain file. if (bfd_check_format(file, bfd_archive) == true) { fprintf(stderr, "Input file is archive\n"); } else if (bfd_check_format_matches (file, bfd_object, &matching)) err = 0; else if (bfd_get_error () == bfd_error_file_ambiguously_recognized) { fprintf(stderr, "File format ambiguous: %s\n", bfd_errmsg(bfd_get_error())); } else if (bfd_get_error () != bfd_error_file_not_recognized) { fprintf(stderr, "File format not supported: %s\n", bfd_errmsg(bfd_get_error())); } else if (bfd_check_format_matches (file, bfd_core, &matching)) err = 0; return err; } // Get address of section. // We have two different scenarios (both with same result). // 1. vma == lma : Normal section // Return real address (mask gcc-hacked MSB's away). // // 2. vma != lma : For sections to be relocated (e.g. .data) // lma is the address where the duplicate initialized data is stored. // vma is the destination address after relocation. // Return real address (mask gcc-hacked MSB's away). // // 3. Not correct memory type: return 0x800000. // static unsigned int get_section_addr(asection *section, BFDmemoryType memtype) { BFDmemoryType sectmemtype; if ((section->flags & SEC_HAS_CONTENTS) && ((section->flags & SEC_ALLOC) || (section->flags & SEC_LOAD))) { if (section->lma < DATA_SPACE_ADDR_OFFSET) // < 0x80... sectmemtype = MEM_FLASH; else if (section->lma < EEPROM_SPACE_ADDR_OFFSET) // < 0x81... sectmemtype = MEM_RAM; else if (section->lma < FUSE_SPACE_ADDR_OFFSET) // < 0x82... sectmemtype = MEM_EEPROM; else // e.g. .fuses return 0xffffff; if (memtype == sectmemtype) { if (sectmemtype == MEM_FLASH) { /* Don't mask the lma or you will not be able to handle more than 64K of flash. */ return (section->lma); } return (section->lma &~ ADDR_SPACE_MASK); } else return 0xffffff; } else return 0xffffff; } // Add section of memtype BFDmemoryType to image. static void jtag_create_image(bfd *file, asection *section, BFDimage *image, BFDmemoryType memtype) { const char *name; unsigned int addr; unsigned int size; static uchar buf[MAX_IMAGE_SIZE]; unsigned int i; // If section is empty (although unexpected) return if (! section) return; // Get information about section name = bfd_get_section_name(file, section); size = bfd_get_section_size(section); if ((addr = get_section_addr(section, memtype)) != 0xffffff) { debugOut("Getting section contents, addr=0x%lx size=0x%lx\n", addr, size); // Read entire section into buffer, at correct byte address. bfd_get_section_contents(file, section, buf, 0, size); // Copy section into memory struct. Mark as used. for (i=0; iimage[c].val = buf[i]; image->image[c].used = true; } // Remember last address in image if (addr+size > image->last_address) image->last_address = addr+size; // Remember first address in image if ((! image->first_address_ok) || (addr < image->first_address)) { image->first_address = addr; image->first_address_ok = true; } debugOut("%s Image create: Adding %s at addr 0x%lx size %d (0x%lx)\n", BFDmemoryTypeString[memtype], name, addr, size, size); // Indicate image has data image->has_data = true; } } void jtag2::downloadToTarget(const char* filename, bool program, bool verify) { // Basically, we just open the file and copy blocks over to the JTAG // box. struct stat ifstat; const char *target = NULL; const char *default_target = "binary"; unsigned int page_size; bool done = 0; bfd *file; asection *p; static BFDimage flashimg, eepromimg; initImage(&flashimg); initImage(&eepromimg); flashimg.name = BFDmemoryTypeString[MEM_FLASH]; eepromimg.name = BFDmemoryTypeString[MEM_EEPROM]; unixCheck(stat(filename, &ifstat), "Can't stat() file %s", filename); // Open the input file. bfd_init(); // Auto detect file format by a loop iterated at most two times. // 1. Auto-detect file format. // 2. If auto-detect failed, assume binary and iterate once more over // loop. while (! done) { file = bfd_openr(filename, target); if (! file) { fprintf( stderr, "Could not open input file %s:%s\n", filename, bfd_errmsg(bfd_get_error()) ); exit(-1); } // Check if file format is supported. If not, go for binary mode. else if (check_file_format(file)) { // File format detection failed. Assuming binary file // BFD section flags are CONTENTS,ALLOC,LOAD,DATA // We must force CODE in stead of DATA fprintf(stderr, "Warning: File format unknown, assuming " "binary.\n"); target = default_target; } else done = 1; } // Configure for JTAG download/programming // Set the flash page and eeprom page sizes (These are device dependent) page_size = get_page_size(MEM_FLASH); debugOut("Flash page size: 0x%0x\nEEPROM page size: 0x%0x\n", page_size, get_page_size(MEM_EEPROM)); #if notneeded // already addressed by setting the device descriptor setJtagParameter(JTAG_P_FLASH_PAGESIZE_LOW, page_size & 0xff); setJtagParameter(JTAG_P_FLASH_PAGESIZE_HIGH, page_size >> 8); setJtagParameter(JTAG_P_EEPROM_PAGESIZE, get_page_size(MEM_EEPROM)); #endif // Create RAM image by reading all sections in file p = file->sections; while (p) { jtag_create_image(file, p, &flashimg, MEM_FLASH); jtag_create_image(file, p, &eepromimg, MEM_EEPROM); p = p->next; } enableProgramming(); // Write the complete FLASH/EEPROM images to the device. if (flashimg.has_data) jtag_flash_image(&flashimg, MEM_FLASH, program, verify); if (eepromimg.has_data) jtag_flash_image(&eepromimg, MEM_EEPROM, program, verify); disableProgramming(); unixCheck(bfd_close(file), "Error closing %s", filename); statusOut("\nDownload complete.\n"); } avarice-2.11.orig/src/jtag2run.cc0000644000000000000000000002442411627164120013534 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002 Intel Corporation * Copyright (C) 2005, 2007 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file implements target execution handling for the mkII protocol. * * $Id: jtag2run.cc,v 1.15 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include #include #include "avarice.h" #include "jtag.h" #include "jtag2.h" #include "remote.h" unsigned long jtag2::getProgramCounter(void) { uchar *response; int responseSize; uchar command[] = { CMND_READ_PC }; check(doJtagCommand(command, sizeof(command), response, responseSize), "cannot read program counter"); unsigned long result = b4_to_u32(response + 1); delete [] response; // The JTAG box sees program memory as 16-bit wide locations. GDB // sees bytes. As such, double the PC value. result *= 2; return result; } bool jtag2::setProgramCounter(unsigned long pc) { uchar *response; int responseSize; uchar command[5] = { CMND_WRITE_PC }; u32_to_b4(command + 1, pc / 2); check(doJtagCommand(command, sizeof(command), response, responseSize), "cannot write program counter"); delete [] response; return true; } PRAGMA_DIAG_PUSH PRAGMA_DIAG_IGNORED("-Wunused-parameter") bool jtag2::resetProgram(bool possible_nSRST_ignored) { if (useDebugWire) { /* The JTAG ICE mkII and Dragon do not respond correctly to * the CMND_RESET command while in debugWire mode. */ return interruptProgram() && setProgramCounter(0); } else { uchar cmd[2] = { CMND_RESET, 0x01 }; uchar *resp; int respSize; bool rv = doJtagCommand(cmd, 2, resp, respSize); delete [] resp; /* Await the BREAK event that is posted by the ICE. */ (void)eventLoop(); return rv; } } PRAGMA_DIAG_POP bool jtag2::interruptProgram(void) { uchar cmd[2] = { CMND_FORCED_STOP, 0x01 }; uchar *resp; int respSize; bool rv = doJtagCommand(cmd, 2, resp, respSize); delete [] resp; return rv; } bool jtag2::resumeProgram(void) { doSimpleJtagCommand(CMND_GO); return true; } bool jtag2::eventLoop(void) { int maxfd; fd_set readfds; bool breakpoint = false, gdbInterrupt = false; // Now that we are "going", wait for either a response from the JTAG // box or a nudge from GDB. if (ctrlPipe != -1) { /* signal the USB daemon to start polling. */ char cmd[1] = { 'p' }; (void)(write(ctrlPipe, cmd, 1) != 0); } for (;;) { debugOut("Waiting for input.\n"); // Check for input from JTAG ICE (breakpoint, sleep, info, power) // or gdb (user break) FD_ZERO (&readfds); if (gdbFileDescriptor != -1) FD_SET (gdbFileDescriptor, &readfds); FD_SET (jtagBox, &readfds); if (gdbFileDescriptor != -1) maxfd = jtagBox > gdbFileDescriptor ? jtagBox : gdbFileDescriptor; else maxfd = jtagBox; int numfds = select(maxfd + 1, &readfds, 0, 0, 0); unixCheck(numfds, "GDB/JTAG ICE communications failure"); if (gdbFileDescriptor != -1 && FD_ISSET(gdbFileDescriptor, &readfds)) { int c = getDebugChar(); if (c == 3) // interrupt { debugOut("interrupted by GDB\n"); gdbInterrupt = true; } else debugOut("Unexpected GDB input `%02x'\n", c); } if (FD_ISSET(jtagBox, &readfds)) { uchar *evtbuf; int evtSize; unsigned short seqno; evtSize = recvFrame(evtbuf, seqno); if (evtSize >= 0) { // XXX if not event, should push frame back into queue... // We really need a queue of received frames. if (seqno != 0xffff) debugOut("Expected event packet, got other response"); else if (!nonbreaking_events[evtbuf[8] - EVT_BREAK]) { switch (evtbuf[8]) { // Program stopped at some kind of breakpoint. case EVT_BREAK: case EVT_EXT_RESET: case EVT_PDSB_BREAK: case EVT_PDSMB_BREAK: case EVT_PROGRAM_BREAK: breakpoint = true; break; case EVT_IDR_DIRTY: // The program is still running at IDR dirty, so // pretend a user break; gdbInterrupt = true; printf("\nIDR dirty: 0x%02x\n", evtbuf[9]); break; // Fatal debugWire errors, cannot continue case EVT_ERROR_PHY_FORCE_BREAK_TIMEOUT: case EVT_ERROR_PHY_MAX_BIT_LENGTH_DIFF: case EVT_ERROR_PHY_OPT_RECEIVE_TIMEOUT: case EVT_ERROR_PHY_OPT_RECEIVED_BREAK: case EVT_ERROR_PHY_RECEIVED_BREAK: case EVT_ERROR_PHY_RECEIVE_TIMEOUT: case EVT_ERROR_PHY_RELEASE_BREAK_TIMEOUT: case EVT_ERROR_PHY_SYNC_OUT_OF_RANGE: case EVT_ERROR_PHY_SYNC_TIMEOUT: case EVT_ERROR_PHY_SYNC_TIMEOUT_BAUD: case EVT_ERROR_PHY_SYNC_WAIT_TIMEOUT: gdbInterrupt = true; printf("\nFatal debugWIRE communication event: 0x%02x\n", evtbuf[8]); break; // Other fatal errors, user could mask them off case EVT_ICE_POWER_ERROR_STATE: gdbInterrupt = true; printf("\nJTAG ICE mkII power failure\n"); break; case EVT_TARGET_POWER_OFF: gdbInterrupt = true; printf("\nTarget power turned off\n"); break; case EVT_TARGET_POWER_ON: gdbInterrupt = true; printf("\nTarget power returned\n"); break; case EVT_TARGET_SLEEP: gdbInterrupt = true; printf("\nTarget went to sleep\n"); break; case EVT_TARGET_WAKEUP: gdbInterrupt = true; printf("\nTarget went out of sleep\n"); break; // Events where we want to continue case EVT_NONE: case EVT_RUN: break; default: gdbInterrupt = true; printf("\nUnhandled JTAG ICE mkII event: 0x%0x2\n", evtbuf[8]); } } delete [] evtbuf; } } // We give priority to user interrupts if (gdbInterrupt) return false; if (breakpoint) return true; } } bool jtag2::jtagSingleStep(bool useHLL) { uchar cmd[3] = { CMND_SINGLE_STEP, useHLL? 0x02: 0x01, useHLL? 0x00: 0x01 }; uchar *resp; int respSize, i = 2; bool rv; do { rv = doJtagCommand(cmd, 3, resp, respSize); uchar stat = resp[0]; delete [] resp; if (rv) break; if (stat != RSP_ILLEGAL_MCU_STATE) break; } while (--i >= 0); if (!rv) return false; if (!eventLoop()) { // Break from GDB while waiting for the single-step // to return an EVT_BREAK interruptProgram(); } return true; } void jtag2::parseEvents(const char *evtlist) { memset(nonbreaking_events, 0, sizeof nonbreaking_events); const struct { uchar num; const char *name; } evttable[] = { { EVT_BREAK, "break" }, { EVT_DEBUG, "debug" }, { EVT_ERROR_PHY_FORCE_BREAK_TIMEOUT, "error_phy_force_break_timeout" }, { EVT_ERROR_PHY_MAX_BIT_LENGTH_DIFF, "error_phy_max_bit_length_diff" }, { EVT_ERROR_PHY_OPT_RECEIVE_TIMEOUT, "error_phy_opt_receive_timeout" }, { EVT_ERROR_PHY_OPT_RECEIVED_BREAK, "error_phy_opt_received_break" }, { EVT_ERROR_PHY_RECEIVED_BREAK, "error_phy_received_break" }, { EVT_ERROR_PHY_RECEIVE_TIMEOUT, "error_phy_receive_timeout" }, { EVT_ERROR_PHY_RELEASE_BREAK_TIMEOUT, "error_phy_release_break_timeout" }, { EVT_ERROR_PHY_SYNC_OUT_OF_RANGE, "error_phy_sync_out_of_range" }, { EVT_ERROR_PHY_SYNC_TIMEOUT, "error_phy_sync_timeout" }, { EVT_ERROR_PHY_SYNC_TIMEOUT_BAUD, "error_phy_sync_timeout_baud" }, { EVT_ERROR_PHY_SYNC_WAIT_TIMEOUT, "error_phy_sync_wait_timeout" }, { EVT_RESULT_PHY_NO_ACTIVITY, "result_phy_no_activity" }, { EVT_EXT_RESET, "ext_reset" }, { EVT_ICE_POWER_ERROR_STATE, "ice_power_error_state" }, { EVT_ICE_POWER_OK, "ice_power_ok" }, { EVT_IDR_DIRTY, "idr_dirty" }, { EVT_NONE, "none" }, { EVT_PDSB_BREAK, "pdsb_break" }, { EVT_PDSMB_BREAK, "pdsmb_break" }, { EVT_PROGRAM_BREAK, "program_break" }, { EVT_RUN, "run" }, { EVT_TARGET_POWER_OFF, "target_power_off" }, { EVT_TARGET_POWER_ON, "target_power_on" }, { EVT_TARGET_SLEEP, "target_sleep" }, { EVT_TARGET_WAKEUP, "target_wakeup" }, }; // parse the given comma-separated string const char *cp1, *cp2; cp1 = evtlist; while (*cp1 != '\0') { while (isspace(*cp1) || *cp1 == ',') cp1++; cp2 = cp1; while (*cp2 != '\0' && *cp2 != ',') cp2++; size_t l = cp2 - cp1; uchar evtval = 0; // Now, cp1 points to the name to parse, of length l for (unsigned int i = 0; i < sizeof evttable / sizeof evttable[0]; i++) { if (strncmp(evttable[i].name, cp1, l) == 0) { evtval = evttable[i].num; break; } } if (evtval == 0) { fprintf(stderr, "Warning: event name %.*s not matched\n", (int)l, cp1); } else { nonbreaking_events[evtval - EVT_BREAK] = true; } cp1 = cp2; } } bool jtag2::jtagContinue(void) { updateBreakpoints(); // download new bp configuration if (haveHiddenBreakpoint) // One of our breakpoints has been set as the high-level // language boundary address of our current statement, so // perform a high-level language single step. (void)jtagSingleStep(true); else doSimpleJtagCommand(CMND_GO); return eventLoop(); } avarice-2.11.orig/src/jtag2rw.cc0000644000000000000000000001575611540502362013366 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002, 2003, 2004 Intel Corporation * Copyright (C) 2005,2006 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file implements access to the target memory for the mkII protocol. * * $Id: jtag2rw.cc,v 1.5 2006/08/08 21:27:34 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include #include "avarice.h" #include "jtag.h" #include "jtag2.h" #include "remote.h" /** Return the memory space code for the memory space indicated by the high-order bits of 'addr'. Also clear these high order bits in 'addr' **/ uchar jtag2::memorySpace(unsigned long &addr) { int mask; // We can't just mask the bits off, because 0x10000->0x1ffff are // valid code addresses if (addr & DATA_SPACE_ADDR_OFFSET) { mask = addr & ADDR_SPACE_MASK; addr &= ~ADDR_SPACE_MASK; } else mask = 0; switch (mask) { case EEPROM_SPACE_ADDR_OFFSET: if (!useDebugWire && programmingEnabled) return MTYPE_EEPROM_PAGE; else return MTYPE_EEPROM; case FUSE_SPACE_ADDR_OFFSET: return MTYPE_FUSE_BITS; case LOCK_SPACE_ADDR_OFFSET: return MTYPE_LOCK_BITS; case SIG_SPACE_ADDR_OFFSET: return MTYPE_SIGN_JTAG; // ... return MTYPE_OSCCAL_BYTE; // ... return MTYPE_CAN; case BREAKPOINT_SPACE_ADDR_OFFSET: return MTYPE_EVENT; case DATA_SPACE_ADDR_OFFSET: return MTYPE_SRAM; default: if (useDebugWire || programmingEnabled) return MTYPE_FLASH_PAGE; else return MTYPE_SPM; } } uchar *jtag2::jtagRead(unsigned long addr, unsigned int numBytes) { uchar *response; int responseSize; if (numBytes == 0) { response = new uchar[1]; response[0] = '\0'; return response; } debugOut("jtagRead "); uchar whichSpace = memorySpace(addr); bool needProgmode = whichSpace >= MTYPE_FLASH_PAGE; unsigned int pageSize = 0; unsigned int offset = 0; bool wasProgmode = programmingEnabled; if (needProgmode && !programmingEnabled) enableProgramming(); unsigned char *cachePtr = NULL; unsigned int *cacheBaseAddr = NULL; switch (whichSpace) { // Pad to even byte count for flash memory. // Even MTYPE_SPM appears to cause a RSP_FAILED // otherwise. case MTYPE_SPM: offset = addr & 1; addr &= ~1; numBytes = (numBytes + 1) & ~1; break; case MTYPE_FLASH_PAGE: pageSize = global_p_device_def->flash_page_size; cachePtr = flashCache; cacheBaseAddr = &flashCachePageAddr; break; case MTYPE_EEPROM_PAGE: pageSize = global_p_device_def->eeprom_page_size; cachePtr = eepromCache; cacheBaseAddr = &eepromCachePageAddr; break; } uchar command[10] = { CMND_READ_MEMORY }; command[1] = whichSpace; if (pageSize > 0) { u32_to_b4(command + 2, pageSize); response = new uchar[numBytes]; unsigned int mask = pageSize - 1; unsigned int pageAddr = addr & ~mask; unsigned int chunksize = numBytes; unsigned int targetOffset = 0; if (addr + numBytes >= pageAddr + pageSize) // Chunk would cross a page boundary, reduce it // appropriately. chunksize -= (addr + numBytes - (pageAddr + pageSize)); offset = addr - pageAddr; while (numBytes > 0) { uchar *resp; if (pageAddr == *cacheBaseAddr) { // quickly fetch from page cache memcpy(response + targetOffset, cachePtr + offset, chunksize); } else { // read from device, cache result, and copy over our part u32_to_b4(command + 6, pageAddr); check(doJtagCommand(command, sizeof command, resp, responseSize), "Failed to read target memory space"); memcpy(cachePtr, resp + 1, pageSize); *cacheBaseAddr = pageAddr; memcpy(response + targetOffset, cachePtr + offset, chunksize); delete [] resp; } numBytes -= chunksize; targetOffset += chunksize; chunksize = numBytes > pageSize? pageSize: numBytes; pageAddr += pageSize; } } else { u32_to_b4(command + 2, numBytes); u32_to_b4(command + 6, addr); check(doJtagCommand(command, sizeof command, response, responseSize), "Failed to read target memory space"); if (offset > 0) memmove(response, response + 1 + offset, responseSize - 1 - offset); else memmove(response, response + 1, responseSize - 1); } if (needProgmode && !wasProgmode) disableProgramming(); return response; } bool jtag2::jtagWrite(unsigned long addr, unsigned int numBytes, uchar buffer[]) { if (numBytes == 0) return true; debugOut("jtagWrite "); uchar whichSpace = memorySpace(addr); // Hack to detect the start of a GDB "load" command. Iff this // address is tied to flash ROM, and it is address 0, and the size // is larger than 4 bytes, assume it's the first block of a "load" // command. If so, chip erase the device, and switch over to // programming mode to speed up things (drastically). if (whichSpace == MTYPE_SPM && addr == 0 && numBytes > 4) { debugOut("Detected GDB \"load\" command, erasing flash.\n"); //whichSpace = MTYPE_FLASH_PAGE; // this will turn on progmode eraseProgramMemory(); } bool needProgmode = whichSpace >= MTYPE_FLASH_PAGE; unsigned int pageSize = 0; bool wasProgmode = programmingEnabled; if (needProgmode && !programmingEnabled) enableProgramming(); switch (whichSpace) { case MTYPE_FLASH_PAGE: pageSize = global_p_device_def->flash_page_size; break; case MTYPE_EEPROM_PAGE: pageSize = global_p_device_def->eeprom_page_size; break; } if (pageSize > 0) { unsigned int mask = pageSize - 1; addr &= ~mask; check(numBytes == pageSize, "jtagWrite(): numByte does not match page size"); } uchar *command = new uchar [10 + numBytes]; command[0] = CMND_WRITE_MEMORY; command[1] = whichSpace; if (pageSize) { u32_to_b4(command + 2, pageSize); u32_to_b4(command + 6, addr); } else { u32_to_b4(command + 2, numBytes); u32_to_b4(command + 6, addr); } memcpy(command + 10, buffer, numBytes); uchar *response; int responseSize; check(doJtagCommand(command, 10 + numBytes, response, responseSize), "Failed to write target memory space"); delete [] command; delete [] response; if (needProgmode && !wasProgmode) disableProgramming(); return true; } avarice-2.11.orig/src/jtag2_defs.h0000644000000000000000000002500410245703045013645 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2005 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * JTAG ICE mkII definitions, taken from Appnote AVR067. * * $Id: jtag2_defs.h,v 1.2 2005/05/27 20:42:13 joerg_wunsch Exp $ */ /* * Communication with the JTAG ICE works in frames. * * Frame format: * * +---------------------------------------------------------------+ * | 0 | 1 . 2 | 3 . 4 . 5 . 6 | 7 | ... | N-1 . N | * | | | | | | | * | start | LSB MSB | LSB ....... MSB | token | msg | LSB MSB | * | 0x1B | sequence# | message size | 0x0E | | CRC16 | * +---------------------------------------------------------------+ * * Each request message will be returned by a response with a matching * sequence #. Sequence # 0xffff is reserved for asynchronous event * notifications that will be sent by the ICE without a request * message (e.g. when the target hit a breakpoint). * * The message size excludes the framing overhead (10 bytes). * * The first byte of the message is always the request or response * code, which is roughly classified as: * * . Messages (commands) use 0x00 through 0x3f. (The documentation * claims that messages start at 0x01, but actually CMND_SIGN_OFF is * 0x00.) * . Internal commands use 0x40 through 0x7f (not documented). * . Success responses use 0x80 through 0x9f. * . Failure responses use 0xa0 through 0xbf. * . Events use 0xe0 through 0xff. */ #define MESSAGE_START 0x1b #define TOKEN 0x0e /* * Max message size we are willing to accept. Prevents us from trying * to allocate too much VM in case we received a nonsensical packet * length. We have to allocate the buffer as soon as we've got the * length information (and thus have to trust that information by that * time at first), as the final CRC check can only be done once the * entire packet came it. */ #define MAX_MESSAGE 100000 /* ICE command codes */ #define CMND_CHIP_ERASE 0x13 #define CMND_CLEAR_EVENTS 0x22 #define CMND_CLR_BREAK 0x1A #define CMND_ENTER_PROGMODE 0x14 #define CMND_ERASEPAGE_SPM 0x0D #define CMND_FORCED_STOP 0x0A #define CMND_GET_BREAK 0x12 #define CMND_GET_PARAMETER 0x03 #define CMND_GET_SIGN_ON 0x01 #define CMND_GET_SYNC 0x0f #define CMND_GO 0x08 #define CMND_LEAVE_PROGMODE 0x15 #define CMND_READ_MEMORY 0x05 #define CMND_READ_PC 0x07 #define CMND_RESET 0x0B #define CMND_RESTORE_TARGET 0x23 #define CMND_RUN_TO_ADDR 0x1C #define CMND_SELFTEST 0x10 #define CMND_SET_BREAK 0x11 #define CMND_SET_DEVICE_DESCRIPTOR 0x0C #define CMND_SET_N_PARAMETERS 0x16 #define CMND_SET_PARAMETER 0x02 #define CMND_SIGN_OFF 0x00 #define CMND_SINGLE_STEP 0x09 #define CMND_SPI_CMD 0x1D #define CMND_WRITE_MEMORY 0x04 #define CMND_WRITE_PC 0x06 /* ICE responses */ #define RSP_DEBUGWIRE_SYNC_FAILED 0xAC #define RSP_FAILED 0xA0 #define RSP_GET_BREAK 0x83 #define RSP_ILLEGAL_BREAKPOINT 0xA8 #define RSP_ILLEGAL_COMMAND 0xAA #define RSP_ILLEGAL_EMULATOR_MODE 0xA4 #define RSP_ILLEGAL_JTAG_ID 0xA9 #define RSP_ILLEGAL_MCU_STATE 0xA5 #define RSP_ILLEGAL_MEMORY_TYPE 0xA2 #define RSP_ILLEGAL_MEMORY_RANGE 0xA3 #define RSP_ILLEGAL_PARAMETER 0xA1 #define RSP_ILLEGAL_POWER_STATE 0xAD #define RSP_ILLEGAL_VALUE 0xA6 #define RSP_MEMORY 0x82 #define RSP_NO_TARGET_POWER 0xAB #define RSP_OK 0x80 #define RSP_PARAMETER 0x81 #define RSP_PC 0x84 #define RSP_SELFTEST 0x85 #define RSP_SET_N_PARAMETERS 0xA7 #define RSP_SIGN_ON 0x86 #define RSP_SPI_DATA 0x88 /* ICE events */ #define EVT_BREAK 0xE0 #define EVT_DEBUG 0xE6 #define EVT_ERROR_PHY_FORCE_BREAK_TIMEOUT 0xE2 #define EVT_ERROR_PHY_MAX_BIT_LENGTH_DIFF 0xED #define EVT_ERROR_PHY_OPT_RECEIVE_TIMEOUT 0xF9 #define EVT_ERROR_PHY_OPT_RECEIVED_BREAK 0xFA #define EVT_ERROR_PHY_RECEIVED_BREAK 0xF8 #define EVT_ERROR_PHY_RECEIVE_TIMEOUT 0xF7 #define EVT_ERROR_PHY_RELEASE_BREAK_TIMEOUT 0xE3 #define EVT_ERROR_PHY_SYNC_OUT_OF_RANGE 0xF5 #define EVT_ERROR_PHY_SYNC_TIMEOUT 0xF0 #define EVT_ERROR_PHY_SYNC_TIMEOUT_BAUD 0xF4 #define EVT_ERROR_PHY_SYNC_WAIT_TIMEOUT 0xF6 #define EVT_RESULT_PHY_NO_ACTIVITY 0xFB #define EVT_EXT_RESET 0xE7 #define EVT_ICE_POWER_ERROR_STATE 0xEA #define EVT_ICE_POWER_OK 0xEB #define EVT_IDR_DIRTY 0xEC #define EVT_NONE 0xEF #define EVT_PDSB_BREAK 0xF2 #define EVT_PDSMB_BREAK 0xF3 #define EVT_PROGRAM_BREAK 0xF1 #define EVT_RUN 0xE1 #define EVT_TARGET_POWER_OFF 0xE5 #define EVT_TARGET_POWER_ON 0xE4 #define EVT_TARGET_SLEEP 0xE8 #define EVT_TARGET_WAKEUP 0xE9 /* memory types for CMND_{READ,WRITE}_MEMORY */ #define MTYPE_IO_SHADOW 0x30 /* cached IO registers? */ #define MTYPE_SRAM 0x20 /* target's SRAM or [ext.] IO registers */ #define MTYPE_EEPROM 0x22 /* EEPROM, what way? */ #define MTYPE_EVENT 0x60 /* ICE event memory */ #define MTYPE_SPM 0xA0 /* flash through LPM/SPM */ #define MTYPE_FLASH_PAGE 0xB0 /* flash in programming mode */ #define MTYPE_EEPROM_PAGE 0xB1 /* EEPROM in programming mode */ #define MTYPE_FUSE_BITS 0xB2 /* fuse bits in programming mode */ #define MTYPE_LOCK_BITS 0xB3 /* lock bits in programming mode */ #define MTYPE_SIGN_JTAG 0xB4 /* signature in programming mode */ #define MTYPE_OSCCAL_BYTE 0xB5 /* osccal cells in programming mode */ #define MTYPE_CAN 0xB6 /* CAN mailbox */ /* (some) ICE parameters, for CMND_{GET,SET}_PARAMETER */ #define PAR_HW_VERSION 0x01 #define PAR_FW_VERSION 0x02 #define PAR_EMULATOR_MODE 0x03 # define EMULATOR_MODE_DEBUGWIRE 0x00 # define EMULATOR_MODE_JTAG 0x01 # define EMULATOR_MODE_UNKNOWN 0x02 # define EMULATOR_MODE_SPI 0x03 #define PAR_IREG 0x04 #define PAR_BAUD_RATE 0x05 # define PAR_BAUD_2400 0x01 # define PAR_BAUD_4800 0x02 # define PAR_BAUD_9600 0x03 # define PAR_BAUD_19200 0x04 /* default */ # define PAR_BAUD_38400 0x05 # define PAR_BAUD_57600 0x06 # define PAR_BAUD_115200 0x07 # define PAR_BAUD_14400 0x08 #define PAR_OCD_VTARGET 0x06 #define PAR_OCD_JTAG_CLK 0x07 #define PAR_OCD_BREAK_CAUSE 0x08 #define PAR_TIMERS_RUNNING 0x09 #define PAR_BREAK_ON_CHANGE_FLOW 0x0A #define PAR_BREAK_ADDR1 0x0B #define PAR_BREAK_ADDR2 0x0C #define PAR_COMBBREAKCTRL 0x0D #define PAR_JTAGID 0x0E #define PAR_UNITS_BEFORE 0x0F #define PAR_UNITS_AFTER 0x10 #define PAR_BIT_BEFORE 0x11 #define PAR_BIT_ATER 0x12 #define PAR_EXTERNAL_RESET 0x13 #define PAR_FLASH_PAGE_SIZE 0x14 #define PAR_EEPROM_PAGE_SIZE 0x15 #define PAR_UNUSED1 0x16 #define PAR_PSB0 0x17 #define PAR_PSB1 0x18 #define PAR_PROTOCOL_DEBUG_EVENT 0x19 #define PAR_MCU_STATE 0x1A # define STOPPED 0x00 # define RUNNING 0x01 # define PROGRAMMING 0x02 #define PAR_DAISY_CHAIN_INFO 0x1B #define PAR_BOOT_ADDRESS 0x1C #define PAR_TARGET_SIGNATURE 0x1D #define PAR_DEBUGWIRE_BAUDRATE 0x1E #define PAR_PROGRAM_ENTRY_POINT 0x1F #define PAR_PACKET_PARSING_ERRORS 0x40 #define PAR_VALID_PACKETS_RECEIVED 0x41 #define PAR_INTERCOMMUNICATION_TX_FAILURES 0x42 #define PAR_INTERCOMMUNICATION_RX_FAILURES 0x43 #define PAR_CRC_ERRORS 0x44 #define PAR_POWER_SOURCE 0x45 # define POWER_EXTERNAL 0x00 # define POWER_USB 0x01 #define PAR_CAN_FLAG 0x22 # define DONT_READ_CAN_MAILBOX 0x00 # define READ_CAN_MAILBOX 0x01 #define PAR_ENABLE_IDR_IN_RUN_MODE 0x23 # define ACCESS_OSCCAL 0x00 # define ACCESS_IDR 0x01 #define PAR_ALLOW_PAGEPROGRAMMING_IN_SCANCHAIN 0x24 # define PAGEPROG_NOT_ALLOWED 0x00 # define PAGEPROG_ALLOWED 0x01 /* * In appnote AVR067, struct device_descriptor is written with * int/long field types. We cannot use them directly, as they were * neither properly aligned for portability, nor did they care for * endianess issues. We thus use arrays of unsigned chars, plus * conversion macros. */ struct device_descriptor { unsigned char ucReadIO[8]; /*LSB = IOloc 0, MSB = IOloc63 */ unsigned char ucReadIOShadow[8]; /*LSB = IOloc 0, MSB = IOloc63 */ unsigned char ucWriteIO[8]; /*LSB = IOloc 0, MSB = IOloc63 */ unsigned char ucWriteIOShadow[8]; /*LSB = IOloc 0, MSB = IOloc63 */ unsigned char ucReadExtIO[52]; /*LSB = IOloc 96, MSB = IOloc511 */ unsigned char ucReadIOExtShadow[52]; /*LSB = IOloc 96, MSB = IOloc511 */ unsigned char ucWriteExtIO[52]; /*LSB = IOloc 96, MSB = IOloc511 */ unsigned char ucWriteIOExtShadow[52];/*LSB = IOloc 96, MSB = IOloc511 */ unsigned char ucIDRAddress; /*IDR address */ unsigned char ucSPMCRAddress; /*SPMCR Register address and dW BasePC */ unsigned char ucRAMPZAddress; /*RAMPZ Register address in SRAM I/O */ /*space */ unsigned char uiFlashPageSize[2]; /*Device Flash Page Size, Size = */ /*2 exp ucFlashPageSize */ unsigned char ucEepromPageSize; /*Device Eeprom Page Size in bytes */ unsigned char ulBootAddress[4]; /*Device Boot Loader Start Address */ unsigned char uiUpperExtIOLoc[2]; /*Topmost (last) extended I/O */ /*location, 0 if no external I/O */ unsigned char ulFlashSize[4]; /*Device Flash Size */ unsigned char ucEepromInst[20]; /*Instructions for W/R EEPROM */ unsigned char ucFlashInst[3]; /*Instructions for W/R FLASH */ unsigned char ucSPHaddr; /* stack pointer high */ unsigned char ucSPLaddr; /* stack pointer low */ /* new as of 16-02-2004 */ unsigned char uiFlashpages[2]; /* number of pages in flash */ unsigned char ucDWDRAddress; /* DWDR register address */ unsigned char ucDWBasePC; /* base/mask value of the PC */ /* new as of 30-04-2004 */ unsigned char ucAllowFullPageBitstream; /* FALSE on ALL new */ /*parts */ unsigned char uiStartSmallestBootLoaderSection[2]; /* */ /* new as of 18-10-2004 */ unsigned char EnablePageProgramming; /* For JTAG parts only, */ /* default TRUE */ unsigned char ucCacheType; /* CacheType_Normal 0x00, */ /* CacheType_CAN 0x01, */ /* CacheType_HEIMDALL 0x02 */ /* new as of 27-10-2004 */ unsigned char uiSramStartAddr[2]; /* Start of SRAM */ unsigned char ucResetType; /* Selects reset type. ResetNormal = 0x00 */ /* ResetAT76CXXX = 0x01 */ unsigned char ucPCMaskExtended; /* For parts with extended PC */ unsigned char ucPCMaskHigh; /* PC high mask */ unsigned char ucEindAddress; /* Selects reset type. [EIND address...] */ /* new as of early 2005, firmware 4.x */ unsigned char EECRAddress[2]; /* EECR memory-mapped IO address */ }; avarice-2.11.orig/src/jtag2usb.cc0000644000000000000000000002676611627164120013534 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2005, 2007 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file implements the libusb-based USB connection to a JTAG ICE * mkII. * * $Id: jtag2usb.cc,v 1.11 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #include "avarice.h" #ifdef HAVE_LIBUSB #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "jtag.h" #define USB_VENDOR_ATMEL 1003 #define USB_DEVICE_JTAGICEMKII 0x2103 #define USB_DEVICE_AVRDRAGON 0x2107 /* * Should we query the endpoint number and max transfer size from USB? * After all, the JTAG ICE mkII docs document these values. */ #define JTAGICE_BULK_EP_WRITE 0x02 #define JTAGICE_BULK_EP_READ 0x82 #define JTAGICE_MAX_XFER 64 static volatile sig_atomic_t signalled, exiting, ready; static pid_t usb_kid; /* * Walk down all USB devices, and see whether we can find our emulator * device. */ static usb_dev_handle *opendev(const char *jtagDeviceName, emulator emu_type, int &usb_interface) { char string[256]; struct usb_bus *bus; struct usb_device *dev; usb_dev_handle *udev; char *devnamecopy, *serno, *cp2; u_int16_t pid; size_t x; switch (emu_type) { case EMULATOR_JTAGICE: pid = USB_DEVICE_JTAGICEMKII; break; case EMULATOR_DRAGON: pid = USB_DEVICE_AVRDRAGON; break; default: // should not happen return NULL; } devnamecopy = new char[x = strlen(jtagDeviceName) + 1]; memcpy(devnamecopy, jtagDeviceName, x); /* * The syntax for usb devices is defined as: * * -P usb[:serialnumber] * * See if we've got a serial number passed here. The serial number * might contain colons which we remove below, and we compare it * right-to-left, so only the least significant nibbles need to be * specified. */ if ((serno = strchr(devnamecopy, ':')) != NULL) { /* first, drop all colons there if any */ cp2 = ++serno; while ((cp2 = strchr(cp2, ':')) != NULL) { x = strlen(cp2) - 1; memmove(cp2, cp2 + 1, x); cp2[x] = '\0'; } unixCheck(strlen(serno) <= 12, "invalid serial number \"%s\"", serno); } usb_init(); usb_find_busses(); usb_find_devices(); udev = NULL; bool found = false; for (bus = usb_get_busses(); !found && bus; bus = bus->next) { for (dev = bus->devices; !found && dev; dev = dev->next) { udev = usb_open(dev); if (udev) { if (dev->descriptor.idVendor == USB_VENDOR_ATMEL && dev->descriptor.idProduct == pid) { /* yeah, we found something */ int rv = usb_get_string_simple(udev, dev->descriptor.iSerialNumber, string, sizeof(string)); unixCheck(rv >= 0, "cannot read serial number \"%s\"", usb_strerror()); debugOut("Found JTAG ICE, serno: %s\n", string); if (serno != NULL) { /* * See if the serial number requested by the * user matches what we found, matching * right-to-left. */ x = strlen(string) - strlen(serno); if (strcasecmp(string + x, serno) != 0) { debugOut("serial number doesn't match\n"); usb_close(udev); continue; } } // we found what we want found = true; break; } usb_close(udev); } } } delete devnamecopy; if (!found) { printf("did not find any%s USB device \"%s\"\n", serno? " (matching)": "", jtagDeviceName); if (serno) free (serno); return NULL; } if (serno) free (serno); if (dev->config == NULL) { statusOut("USB device has no configuration\n"); fail: usb_close(udev); return NULL; } if (usb_set_configuration(udev, dev->config[0].bConfigurationValue)) { statusOut("error setting configuration %d: %s\n", dev->config[0].bConfigurationValue, usb_strerror()); goto fail; } usb_interface = dev->config[0].interface[0].altsetting[0].bInterfaceNumber; if (usb_claim_interface(udev, usb_interface)) { statusOut("error claiming interface %d: %s\n", usb_interface, usb_strerror()); goto fail; } return udev; } PRAGMA_DIAG_PUSH PRAGMA_DIAG_IGNORED("-Wunused-parameter") /* * Various signal handlers for the USB daemon child. */ static void sigtermhandler(int signo) { // give the pipes some time to flush before exiting exiting++; alarm(1); } static void alarmhandler(int signo) { signalled++; } static void usr1handler(int signo) { ready++; } static void dummyhandler(int signo) { /* nothing to do, just abort the current read()/select() */ } static void childhandler(int signo) { int status; (void)wait(&status); #define PRINTERR(msg) (void)(write(fileno(stderr), msg, strlen(msg)) != 0) if (ready) PRINTERR("USB daemon died\n"); _exit(1); } PRAGMA_DIAG_POP /* * atexit() handler */ static void kill_daemon(void) { kill(usb_kid, SIGTERM); } /* * Signal handler for the parent (i.e. for AVaRICE). */ static void inthandler(int signo) { int status; kill(usb_kid, SIGTERM); (void)wait(&status); signal(signo, SIG_DFL); kill(getpid(), signo); } /* * The USB daemon itself. Polls the USB device for data as long as * there is room in the AVaRICE pipe. Polls the AVaRICE descriptor * for data, and sends them to the USB device. */ static void usb_daemon(usb_dev_handle *udev, int fd, int cfd) { signal(SIGALRM, alarmhandler); signal(SIGTERM, sigtermhandler); signal(SIGINT, sigtermhandler); #if defined(O_ASYNC) int ioflags; if (fcntl(fd, F_GETFL, &ioflags) != -1) { ioflags |= O_ASYNC; if (fcntl(fd, F_SETFL, &ioflags) != -1) signal(SIGIO, dummyhandler); } #endif /* defined(O_ASYNC) */ int highestfd = fd > cfd? fd: cfd; bool polling = false; for (; !signalled;) { fd_set r; struct timeval tv; int rv; bool do_read, clear_eps; char buf[JTAGICE_MAX_XFER]; do_read = false; clear_eps = false; /* * See if our parent has something to tell us, or requests * something from us. */ FD_ZERO(&r); FD_SET(fd, &r); FD_SET(cfd, &r); if (polling) { tv.tv_sec = 0; tv.tv_usec = 100000; } else { tv.tv_sec = 1; tv.tv_usec = 0; } if (!exiting && select(highestfd + 1, &r, NULL, NULL, &tv) > 0) { if (FD_ISSET(fd, &r)) { if ((rv = read(fd, buf, JTAGICE_MAX_XFER)) > 0) { if (usb_bulk_write(udev, JTAGICE_BULK_EP_WRITE, buf, rv, 5000) != rv) { fprintf(stderr, "USB bulk write error: %s\n", usb_strerror()); exit(1); } continue; } if (rv < 0 && errno != EINTR && errno != EAGAIN) { fprintf(stderr, "read error from AVaRICE: %s\n", strerror(errno)); exit(1); } } if (FD_ISSET(cfd, &r)) { char cmd[1]; if (FD_ISSET(cfd, &r)) { if ((rv = read(cfd, cmd, 1)) > 0) { /* * Examine AVaRICE's command. */ if (cmd[0] == 'r') { polling = false; do_read = true; } else if (cmd[0] == 'p') { polling = true; } else if (cmd[0] == 'c') { clear_eps = true; } else { fprintf(stderr, "unknown command in USB_daemon: %c\n", cmd[0]); } } if (rv < 0 && errno != EINTR && errno != EAGAIN) { fprintf(stderr, "read error on control pipe from AVaRICE: %s\n", strerror(errno)); exit(1); } } } } if (clear_eps) { usb_resetep(udev, JTAGICE_BULK_EP_READ); usb_resetep(udev, JTAGICE_BULK_EP_WRITE); } if (!exiting && (do_read || polling)) { rv = usb_bulk_read(udev, JTAGICE_BULK_EP_READ, buf, JTAGICE_MAX_XFER, 500); if (rv == 0 || rv == -EINTR || rv == -EAGAIN || rv == -ETIMEDOUT) { /* OK, try again */ } else if (rv < 0) { if (!exiting) fprintf(stderr, "USB bulk read error: %s\n", usb_strerror()); exit(1); } else { /* * We read a (partial) packet from USB. Return * what we've got so far to AVaRICE, and examine * the length field to see whether we have to * expect more. */ polling = false; if (write(fd, buf, rv) != rv) { fprintf(stderr, "short write to AVaRICE: %s\n", strerror(errno)); exit(1); } unsigned int pkt_len = (unsigned char)buf[3] + ((unsigned char)buf[4] << 8) + ((unsigned char)buf[5] << 16) + ((unsigned char)buf[6] << 24); const unsigned int header_size = 8; const unsigned int crc_size = 2; pkt_len += header_size + crc_size; pkt_len -= rv; /* OK, if there is more to read, do so. */ while (!exiting && pkt_len > 0) { rv = usb_bulk_read(udev, JTAGICE_BULK_EP_READ, buf, pkt_len > JTAGICE_MAX_XFER? JTAGICE_MAX_XFER: pkt_len, 100); /* * Zero-length reads are not expected here, * as we carefully examined the packet * length from the header. */ if (rv == -EINTR || rv == -EAGAIN || rv == -ETIMEDOUT) { continue; } if (rv <= 0) { if (!exiting) fprintf(stderr, "USB bulk read error in continuation block: %s\n", usb_strerror()); exit(1); } if (write(fd, buf, rv) != rv) { fprintf(stderr, "short write to AVaRICE: %s\n", strerror(errno)); exit(1); } pkt_len -= rv; } } } } } pid_t jtag::openUSB(const char *jtagDeviceName) { int usb_interface = 0; pid_t p; int pype[2], cpipe[2]; usb_dev_handle *udev; unixCheck(socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pype) == 0, "cannot create pipe"); unixCheck(socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, cpipe) == 0, "cannot create control pipe"); signal(SIGCHLD, childhandler); signal(SIGUSR1, usr1handler); switch ((p = fork())) { case 0: signal(SIGCHLD, SIG_DFL); signal(SIGUSR1, SIG_DFL); close(pype[1]); close(cpipe[1]); udev = opendev(jtagDeviceName, emu_type, usb_interface); check(udev != NULL, "USB device not found"); kill(getppid(), SIGUSR1); // tell the parent we are ready to go usb_daemon(udev, pype[0], cpipe[0]); (void)usb_release_interface(udev, usb_interface); usb_close(udev); exit(0); break; case -1: unixCheck(-1, "Cannot fork"); break; default: close(pype[0]); close(cpipe[0]); jtagBox = pype[1]; ctrlPipe = cpipe[1]; usb_kid = p; } atexit(kill_daemon); signal(SIGTERM, inthandler); signal(SIGINT, inthandler); signal(SIGQUIT, inthandler); while (!ready) /* wait for child to become ready */ ; signal(SIGUSR1, SIG_DFL); return p; } #endif /* HAVE_LIBUSB */ avarice-2.11.orig/src/jtagbp.cc0000644000000000000000000001362311627164120013246 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002 Intel Corporation * Copyright (C) 2005 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains functions for interfacing with the JTAG box. * * $Id: jtagbp.cc,v 1.4 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include "avarice.h" #include "jtag.h" #include "jtag1.h" bool jtag1::codeBreakpointAt(unsigned int address) { address /= 2; for (int i = 0; i < numBreakpointsCode; i++) if (bpCode[i].address == address) return true; return false; } bool jtag1::codeBreakpointBetween(unsigned int start, unsigned int end) { start /= 2; end /= 2; for (int i = 0; i < numBreakpointsCode; i++) if (bpCode[i].address >= start && bpCode[i].address < end) return true; return false; } void jtag1::deleteAllBreakpoints(void) { numBreakpointsData = numBreakpointsCode = 0; } bool jtag1::stopAt(unsigned int address) { uchar zero = 0; return jtagWrite(BREAKPOINT_SPACE_ADDR_OFFSET + address / 2, 1, &zero); } PRAGMA_DIAG_PUSH PRAGMA_DIAG_IGNORED("-Wunused-parameter") bool jtag1::addBreakpoint(unsigned int address, bpType type, unsigned int length) { breakpoint *bp; debugOut("BP ADD type: %d addr: 0x%x ", type, address); // Respect overall breakpoint limit if (numBreakpointsCode + numBreakpointsData == MAX_BREAKPOINTS) return false; // There's a spare breakpoint, is there one of the appropriate type // available? if (type == CODE) { if (numBreakpointsCode == MAX_BREAKPOINTS_CODE) { debugOut("FAILED\n"); return false; } bp = &bpCode[numBreakpointsCode++]; // The JTAG box sees program memory as 16-bit wide locations. GDB // sees bytes. As such, halve the breakpoint address. address /= 2; } else // data breakpoint { if (numBreakpointsData == MAX_BREAKPOINTS_DATA) { debugOut("FAILED\n"); return false; } bp = &bpData[numBreakpointsData++]; } bp->address = address; bp->type = type; debugOut(" ADDED\n"); return true; } bool jtag1::deleteBreakpoint(unsigned int address, bpType type, unsigned int length) { breakpoint *bp; int *numBp; debugOut("BP DEL type: %d addr: 0x%x ", type, address); if (type == CODE) { bp = bpCode; numBp = &numBreakpointsCode; // The JTAG box sees program memory as 16-bit wide locations. GDB // sees bytes. As such, halve the breakpoint address. address /= 2; } else // data { bp = bpData; numBp = &numBreakpointsData; } // Find and squash the removed breakpoint for (int i = 0; i < *numBp; i++) { if (bp[i].type == type && bp[i].address == address) { debugOut("REMOVED %d\n", i); (*numBp)--; memmove(&bp[i], &bp[i + 1], (*numBp - i) * sizeof(breakpoint)); return true; } } debugOut("FAILED\n"); return false; } PRAGMA_DIAG_POP void jtag1::updateBreakpoints(void) { unsigned char bpMode = 0x00; int bpC = 0, bpD = 0; breakpoint *bp; debugOut("updateBreakpoints\n"); // BP 0 (aka breakpoint Z0). // Send breakpoint array down to the target. // BP 1 is activated by writing a 1 to BP address space. // note: BP1 only supports code space breakpoints. if (bpC < numBreakpointsCode) { uchar zero = 0; jtagWrite(BREAKPOINT_SPACE_ADDR_OFFSET + bpCode[bpC++].address, 1, &zero); } // BP 1 (aka breakpoint Z1). // Send breakpoint array down to the target. // BP 1 is activated by writing a 1 to BP address space. // note: BP1 only supports code space breakpoints. if (bpC < numBreakpointsCode) { uchar one = 1; jtagWrite(BREAKPOINT_SPACE_ADDR_OFFSET + bpCode[bpC++].address, 1, &one); } // Set X & Y breakpoints. Code is cut&pasty, but it's only two copies and // has tons of parameters. // Find next breakpoint bp = NULL; if (bpC < numBreakpointsCode) bp = &bpCode[bpC++]; else if (bpD < numBreakpointsData) bp = &bpData[bpD++]; // BP 2 (aka breakpoint X). if (bp) { setJtagParameter(JTAG_P_BP_X_HIGH, bp->address >> 8); setJtagParameter(JTAG_P_BP_X_LOW, bp->address & 0xff); bpMode |= 0x20; // turn on this breakpoint switch (bp->type) { case READ_DATA: bpMode |= 0x00; break; case WRITE_DATA: bpMode |= 0x04; break; case ACCESS_DATA: bpMode |= 0x08; break; case CODE: bpMode |= 0x0c; break; case NONE: default: break; } // Find next breakpoint bp = NULL; if (bpC < numBreakpointsCode) bp = &bpCode[bpC++]; else if (bpD < numBreakpointsData) bp = &bpData[bpD++]; // BP 3 (aka breakpoint Y). if (bp) { setJtagParameter(JTAG_P_BP_Y_HIGH, bp->address >> 8); setJtagParameter(JTAG_P_BP_Y_LOW, bp->address & 0xff); // Only used when BP2 is on, so this is correcy bpMode |= 0x10; // turn on this breakpoint switch (bp->type) { case READ_DATA: bpMode |= 0x00; break; case WRITE_DATA: bpMode |= 0x01; break; case ACCESS_DATA: bpMode |= 0x02; break; case CODE: bpMode |= 0x03; break; case NONE: default: break; } } setJtagParameter(JTAG_P_BP_MODE, bpMode); } } avarice-2.11.orig/src/jtaggeneric.cc0000644000000000000000000003241611627164120014262 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002, 2003, 2004 Intel Corporation * Copyright (C) 2005, 2007 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file implements those parts of class "jtag" that are common * for both, the mkI and mkII protocol. * * $Id: jtaggeneric.cc,v 1.11 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include #include #include "avarice.h" #include "jtag.h" const char *BFDmemoryTypeString[] = { "FLASH", "EEPROM", "RAM", }; const int BFDmemorySpaceOffset[] = { FLASH_SPACE_ADDR_OFFSET, EEPROM_SPACE_ADDR_OFFSET, DATA_SPACE_ADDR_OFFSET, }; /* * Generic functions applicable to both, the mkI and mkII ICE. */ void jtag::jtagCheck(int status) { unixCheck(status, JTAG_CAUSE, NULL); } void jtag::restoreSerialPort() { if (!is_usb && jtagBox >= 0 && oldtioValid) tcsetattr(jtagBox, TCSANOW, &oldtio); } jtag::jtag(void) { jtagBox = 0; device_name = 0; oldtioValid = is_usb = false; ctrlPipe = -1; } jtag::jtag(const char *jtagDeviceName, char *name, emulator type) { struct termios newtio; jtagBox = 0; oldtioValid = is_usb = false; ctrlPipe = -1; device_name = name; emu_type = type; if (strncmp(jtagDeviceName, "usb", 3) == 0) { #ifdef HAVE_LIBUSB is_usb = true; openUSB(jtagDeviceName); #else throw "avarice has not been compiled with libusb support\n"; #endif } else { // Open modem device for reading and writing and not as controlling // tty because we don't want to get killed if linenoise sends // CTRL-C. jtagBox = open(jtagDeviceName, O_RDWR | O_NOCTTY | O_NONBLOCK); unixCheck(jtagBox, "Failed to open %s", jtagDeviceName); // save current serial port settings and plan to restore them on exit jtagCheck(tcgetattr(jtagBox, &oldtio)); oldtioValid = true; memset(&newtio, 0, sizeof(newtio)); newtio.c_cflag = CS8 | CLOCAL | CREAD; // set baud rates in a platform-independent manner jtagCheck(cfsetospeed(&newtio, B19200)); jtagCheck(cfsetispeed(&newtio, B19200)); // IGNPAR : ignore bytes with parity errors // otherwise make device raw (no other input processing) newtio.c_iflag = IGNPAR; // Raw output. newtio.c_oflag = 0; // Raw input. newtio.c_lflag = 0; // The following configuration should cause read to return if 2 // characters are immediately avaible or if the period between // characters exceeds 5 * .1 seconds. newtio.c_cc[VTIME] = 5; // inter-character timer unused newtio.c_cc[VMIN] = 255; // blocking read until VMIN character // arrives // now clean the serial line and activate the settings for the port jtagCheck(tcflush(jtagBox, TCIFLUSH)); jtagCheck(tcsetattr(jtagBox,TCSANOW,&newtio)); } } // NB: the destructor is virtual; class jtag2 extends it jtag::~jtag(void) { restoreSerialPort(); } int jtag::timeout_read(void *buf, size_t count, unsigned long timeout) { char *buffer = (char *)buf; size_t actual = 0; while (actual < count) { fd_set readfds; FD_ZERO(&readfds); FD_SET(jtagBox, &readfds); struct timeval tmout; tmout.tv_sec = timeout / 1000000; tmout.tv_usec = timeout % 1000000; int selected = select(jtagBox + 1, &readfds, NULL, NULL, &tmout); /* Even though select() is not supposed to set errno to EAGAIN (according to the linux man page), it seems that errno can be set to EAGAIN on some cygwin systems. Thus, we need to catch that here. */ if ((selected < 0) && (errno == EAGAIN || errno == EINTR)) continue; //jtagCheck(selected); if (selected == 0) return actual; ssize_t thisread = read(jtagBox, &buffer[actual], count - actual); if ((thisread < 0) && (errno == EAGAIN)) continue; jtagCheck(thisread); actual += thisread; } return count; } int jtag::safewrite(const void *b, int count) { char *buffer = (char *)b; int actual = 0; int flags = fcntl(jtagBox, F_GETFL); fcntl(jtagBox, F_SETFL, 0); // blocking mode while (count > 0) { int n = write(jtagBox, buffer, count); if (n == -1 && errno == EINTR) continue; if (n == -1) { actual = -1; break; } count -= n; actual += n; buffer += n; } fcntl(jtagBox, F_SETFL, flags); return actual; } /** Change bitrate of PC's serial port as specified by BIT_RATE_xxx in 'newBitRate' **/ void jtag::changeLocalBitRate(int newBitRate) { if (is_usb) return; // Change the local port bitrate. struct termios tio; jtagCheck(tcgetattr(jtagBox, &tio)); speed_t newPortSpeed = B19200; // Linux doesn't support 14400. Let's hope it doesn't end up there... switch(newBitRate) { case 9600: newPortSpeed = B9600; break; case 19200: newPortSpeed = B19200; break; case 38400: newPortSpeed = B38400; break; case 57600: newPortSpeed = B57600; break; case 115200: newPortSpeed = B115200; break; default: debugOut("unsupported bitrate: %d\n", newBitRate); exit(1); } cfsetospeed(&tio, newPortSpeed); cfsetispeed(&tio, newPortSpeed); jtagCheck(tcsetattr(jtagBox,TCSANOW,&tio)); jtagCheck(tcflush(jtagBox, TCIFLUSH)); } static bool pageIsEmpty(BFDimage *image, unsigned int addr, unsigned int size, BFDmemoryType memtype) { bool emptyPage = true; // Check if page is used for (unsigned int idx=addr; idx= image->last_address) break; // 1. If this address existed in input file, mark as ! empty. // 2. If we are programming FLASH, and contents == 0xff, we need // not program (is 0xff after erase). if (image->image[idx].used) { if (!((memtype == MEM_FLASH) && (image->image[idx].val == 0xff))) { emptyPage = false; break; } } } return emptyPage; } unsigned int jtag::get_page_size(BFDmemoryType memtype) { unsigned int page_size; switch( memtype ) { case MEM_FLASH: page_size = global_p_device_def->flash_page_size; break; case MEM_EEPROM: page_size = global_p_device_def->eeprom_page_size; break; default: page_size = 1; break; } return page_size; } void jtag::jtag_flash_image(BFDimage *image, BFDmemoryType memtype, bool program, bool verify) { unsigned int page_size = get_page_size(memtype); static uchar buf[MAX_IMAGE_SIZE]; unsigned int i; uchar *response = NULL; unsigned int addr; if (! image->has_data) { fprintf(stderr, "File contains no data.\n"); exit(-1); } if (program) { // First address must start on page boundary. addr = page_addr(image->first_address, memtype); statusOut("Downloading %s image to target.", image->name); statusFlush(); while (addr < image->last_address) { if (!pageIsEmpty(image, addr, page_size, memtype)) { // Must also convert address to gcc-hacked addr for jtagWrite debugOut("Writing page at addr 0x%.4lx size 0x%lx\n", addr, page_size); // Create raw data buffer for (i=0; iimage[i+addr].val; check(jtagWrite(BFDmemorySpaceOffset[memtype] + addr, page_size, buf), "Error writing to target"); // No need for statusOut here, since jtagWrite does it. } addr += page_size; statusOut("."); statusFlush(); } statusOut("\n"); statusFlush(); } if (verify) { bool is_verified = true; // First address must start on page boundary. addr = page_addr(image->first_address, memtype); statusOut("\nVerifying %s", image->name); statusFlush(); while (addr < image->last_address) { // Must also convert address to gcc-hacked addr for jtagWrite debugOut("Verifying page at addr 0x%.4lx size 0x%lx\n", addr, page_size); response = jtagRead(BFDmemorySpaceOffset[memtype] + addr, page_size); // Verify buffer, but only addresses in use. for (i=0; i < page_size; i++) { unsigned int c = i + addr; if (image->image[c].used ) { if (image->image[c].val != response[i]) { statusOut("\nError verifying target addr %.4x. " "Expect [0x%02x] Got [0x%02x]", c, image->image[c].val, response[i]); statusFlush(); is_verified = false; } } } addr += page_size; statusOut("."); statusFlush(); } delete [] response; statusOut("\n"); statusFlush(); check(is_verified, "\nVerification failed!"); } } void jtag::jtagWriteFuses(char *fuses) { int temp[3]; uchar fuseBits[3]; uchar *readfuseBits; unsigned int c; check(fuses, "Error: No fuses string given"); // Convert fuses to hex values (this avoids endianess issues) c = sscanf(fuses, "%02x%02x%02x", temp+2, temp+1, temp ); check(c == 3, "Error: Fuses specified are not in hexidecimal"); fuseBits[0] = (uchar)temp[0]; fuseBits[1] = (uchar)temp[1]; fuseBits[2] = (uchar)temp[2]; statusOut("\nWriting Fuse Bytes:\n"); jtagDisplayFuses(fuseBits); enableProgramming(); check(jtagWrite(FUSE_SPACE_ADDR_OFFSET + 0, 3, fuseBits), "Error writing fuses"); readfuseBits = jtagRead(FUSE_SPACE_ADDR_OFFSET + 0, 3); disableProgramming(); check(memcmp(fuseBits, readfuseBits, 3) == 0, "Error verifying written fuses"); delete [] readfuseBits; } void jtag::jtagReadFuses(void) { uchar *fuseBits = 0; enableProgramming(); statusOut("\nReading Fuse Bytes:\n"); fuseBits = jtagRead(FUSE_SPACE_ADDR_OFFSET + 0, 3); disableProgramming(); check(fuseBits, "Error reading fuses"); jtagDisplayFuses(fuseBits); delete [] fuseBits; } void jtag::jtagDisplayFuses(uchar *fuseBits) { statusOut(" Extended Fuse byte -> 0x%02x\n", fuseBits[2]); statusOut(" High Fuse byte -> 0x%02x\n", fuseBits[1]); statusOut(" Low Fuse byte -> 0x%02x\n", fuseBits[0]); } void jtag::jtagWriteLockBits(char *lock) { int temp[1]; uchar lockBits[1]; uchar *readlockBits; unsigned int c; check(lock, "Error: No lock bit string given"); check(strlen(lock) == 2, "Error: Fuses must be one byte exactly"); // Convert lockbits to hex value c = sscanf(lock, "%02x", temp); check(c == 1, "Error: Fuses specified are not in hexidecimal"); lockBits[0] = (uchar)temp[0]; statusOut("\nWriting Lock Bits -> 0x%02x\n", lockBits[0]); enableProgramming(); check(jtagWrite(LOCK_SPACE_ADDR_OFFSET + 0, 1, lockBits), "Error writing lockbits" ); readlockBits = jtagRead(LOCK_SPACE_ADDR_OFFSET + 0, 1); disableProgramming(); check(memcmp(lockBits, readlockBits, 1) == 0, "Error verifying written lock bits"); delete [] readlockBits; } void jtag::jtagReadLockBits(void) { uchar *lockBits = 0; enableProgramming(); statusOut("\nReading Lock Bits:\n"); lockBits = jtagRead(LOCK_SPACE_ADDR_OFFSET + 0, 1); disableProgramming(); check(lockBits, "Error reading lock bits"); jtagDisplayLockBits(lockBits); delete [] lockBits; } void jtag::jtagDisplayLockBits(uchar *lockBits) { statusOut("Lock bits -> 0x%02x\n\n", lockBits[0]); statusOut(" Bit 7 [ Reserved ] -> %d\n", (lockBits[0] >> 7) & 1); statusOut(" Bit 6 [ Reserved ] -> %d\n", (lockBits[0] >> 6) & 1); statusOut(" Bit 5 [ BLB12 ] -> %d\n", (lockBits[0] >> 5) & 1); statusOut(" Bit 4 [ BLB11 ] -> %d\n", (lockBits[0] >> 4) & 1); statusOut(" Bit 3 [ BLB02 ] -> %d\n", (lockBits[0] >> 3) & 1); statusOut(" Bit 2 [ BLB01 ] -> %d\n", (lockBits[0] >> 2) & 1); statusOut(" Bit 1 [ LB2 ] -> %d\n", (lockBits[0] >> 1) & 1); statusOut(" Bit 0 [ LB1 ] -> %d\n", (lockBits[0] >> 0) & 1); } avarice-2.11.orig/src/jtagio.cc0000644000000000000000000003245611627164120013261 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002, 2003, 2004 Intel Corporation * Copyright (C) 2005 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains functions for interfacing with the JTAG box. * * $Id: jtagio.cc,v 1.33 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include #include #include "avarice.h" #include "jtag.h" #include "jtag1.h" /** Send a command to the jtag, and check result. Increase *tries, abort if reaches MAX_JTAG_COMM_ATTEMPS Reads first response byte. If no response is received within JTAG_RESPONSE_TIMEOUT, returns false. If response byte is JTAG_R_RESP_OK returns true, otherwise returns false. **/ SendResult jtag1::sendJtagCommand(uchar *command, int commandSize, int *tries) { check((*tries)++ < MAX_JTAG_COMM_ATTEMPS, "JTAG ICE: Cannot synchronise"); debugOut("\ncommand[%c, %d]: ", command[0], *tries); for (int i = 0; i < commandSize; i++) debugOut("%.2X ", command[i]); debugOut("\n"); // before writing, clean up any "unfinished business". jtagCheck(tcflush(jtagBox, TCIFLUSH)); int count = safewrite(command, commandSize); if (count < 0) jtagCheck(count); else // this shouldn't happen check(count == commandSize, JTAG_CAUSE); // And wait for all characters to go to the JTAG box.... can't hurt! jtagCheck(tcdrain(jtagBox)); // We should get JTAG_R_OK, but we might get JTAG_R_INFO too (we just // ignore it) for (;;) { uchar ok; count = timeout_read(&ok, 1, JTAG_RESPONSE_TIMEOUT); jtagCheck(count); // timed out if (count == 0) { debugOut("Timed out.\n"); return send_failed; } switch (ok) { case JTAG_R_OK: return send_ok; case JTAG_R_INFO: unsigned char infobuf[2]; /* An info ("IDR dirty") response. Ignore it. */ debugOut("Info response: "); count = timeout_read(infobuf, 2, JTAG_RESPONSE_TIMEOUT); for (int i = 0; i < count; i++) { debugOut("%.2X ", infobuf[i]); } debugOut("\n"); if (count != 2 || infobuf[1] != JTAG_R_OK) return send_failed; else return (SendResult)(mcu_data + infobuf[0]); break; default: debugOut("Out of sync, reponse was `%02x'\n", ok); return send_failed; } } } /** Get a 'responseSize' byte response from the JTAG ICE Returns NULL if no bytes received for JTAG_COMM_TIMEOUT microseconds Returns a dynamically allocated buffer containing the reponse (caller must free) otherwise **/ uchar *jtag1::getJtagResponse(int responseSize) { uchar *response; int numCharsRead; // Increase by 1 because of the zero termination. // // note: IT IS THE CALLERS RESPONSIBILITY TO delete() THIS. response = new uchar[responseSize + 1]; response[responseSize] = '\0'; numCharsRead = timeout_read(response, responseSize, JTAG_RESPONSE_TIMEOUT); jtagCheck(numCharsRead); debugOut("response: "); for (int i = 0; i < numCharsRead; i++) { debugOut("%.2X ", response[i]); } debugOut("\n"); if (numCharsRead < responseSize) // timeout problem { debugOut("Timed Out (partial response)\n"); delete [] response; return NULL; } return response; } uchar *jtag1::doJtagCommand(uchar *command, int commandSize, int responseSize) { int tryCount = 0; // Send command until we get RESP_OK for (;;) { uchar *response; static uchar sync[] = { ' ' }; static uchar stop[] = { 'S', JTAG_EOM }; switch (sendJtagCommand(command, commandSize, &tryCount)) { case send_ok: response = getJtagResponse(responseSize); check(response != NULL, JTAG_CAUSE); return response; case send_failed: // We're out of sync. Attempt to resync. while (sendJtagCommand(sync, sizeof sync, &tryCount) != send_ok) ; break; default: /* "IDR dirty", aka I/O debug register dirty, aka we got some data from the target processor. This seems to be indefinitely repeated if we don't do anything. Asking for the sign on seems to shut it up, so we do that. (another option is to do a 'forced stop' ('F' command), but that is a bit more intrusive --- it should be ok, as we currently only send commands to stopped targets, but...) */ if (sendJtagCommand(stop, sizeof stop, &tryCount) == send_ok) getJtagResponse(8); break; } } } bool jtag1::doSimpleJtagCommand(unsigned char cmd, int responseSize) { uchar *response; uchar command[] = { cmd, JTAG_EOM }; bool result; response = doJtagCommand(command, sizeof command, responseSize); result = responseSize == 0 || response[responseSize - 1] == JTAG_R_OK; delete [] response; return result; } /** Set PC and JTAG ICE bitrate to BIT_RATE_xxx specified by 'newBitRate' **/ void jtag1::changeBitRate(int newBitRate) { uchar jtagrate; switch (newBitRate) { case 9600: jtagrate = BIT_RATE_9600; break; case 19200: jtagrate = BIT_RATE_19200; break; case 38400: jtagrate = BIT_RATE_38400; break; case 57600: jtagrate = BIT_RATE_57600; break; case 115200: jtagrate = BIT_RATE_115200; break; default: return; } setJtagParameter(JTAG_P_BITRATE, jtagrate); changeLocalBitRate(newBitRate); } /** Set the JTAG ICE device descriptor data for specified device type **/ void jtag1::setDeviceDescriptor(jtag_device_def_type *dev) { uchar *response = NULL; uchar *command = (uchar *)(&dev->dev_desc1); response = doJtagCommand(command, sizeof dev->dev_desc1, 1); check(response[0] == JTAG_R_OK, "JTAG ICE: Failed to set device description"); delete [] response; } /** Check for emulator using the 'S' command *without* retries (used at startup to check sync only) **/ bool jtag1::checkForEmulator(void) { uchar *response; uchar command[] = { 'S', JTAG_EOM }; bool result; int tries = 0; if (!sendJtagCommand(command, sizeof command, &tries)) return false; response = getJtagResponse(8); result = response && !strcmp((char *)response, "AVRNOCDA"); delete [] response; return result; } /** Attempt to synchronise with JTAG at specified bitrate **/ bool jtag1::synchroniseAt(int bitrate) { debugOut("Attempting synchronisation at bitrate %d\n", bitrate); changeLocalBitRate(bitrate); int tries = 0; while (tries < MAX_JTAG_SYNC_ATTEMPS) { // 'S ' works if this is the first string sent after power up. // But if another char is sent, the JTAG seems to go in to some // internal mode. 'SE ' takes it out of there, apparently (sometimes // 'E ' is enough, but not always...) sendJtagCommand((uchar *)"SE ", 4, &tries); usleep(2 * JTAG_COMM_TIMEOUT); // let rest of response come before we ignore it jtagCheck(tcflush(jtagBox, TCIFLUSH)); if (checkForEmulator()) return true; } return false; } /** Attempt to synchronise with JTAG ICE at all possible bit rates **/ void jtag1::startJtagLink(void) { static int bitrates[] = { 115200, 19200, 57600, 38400, 9600 }; for (unsigned int i = 0; i < sizeof bitrates / sizeof *bitrates; i++) if (synchroniseAt(bitrates[i])) return; check(false, "Failed to synchronise with the JTAG ICE (is it connected and powered?)"); } /** Device automatic configuration Determines the device being controlled by the JTAG ICE and configures the system accordingly. May be overridden by command line parameter. */ void jtag1::deviceAutoConfig(void) { unsigned int device_id; jtag_device_def_type *pDevice = deviceDefinitions; // Auto config debugOut("Automatic device detection: "); /* Set daisy chain information */ configDaisyChain(); /* Read in the JTAG device ID to determine device */ device_id = getJtagParameter(JTAG_P_JTAGID_BYTE0); /* Reading the first byte resumes the program (weird, no?) */ interruptProgram(); device_id += (getJtagParameter(JTAG_P_JTAGID_BYTE1) << 8) + (getJtagParameter(JTAG_P_JTAGID_BYTE2) << 16) + (getJtagParameter(JTAG_P_JTAGID_BYTE3) << 24); debugOut("JTAG id = 0x%0X : Ver = 0x%0x : Device = 0x%0x : Manuf = 0x%0x\n", device_id, (device_id & 0xF0000000) >> 28, (device_id & 0x0FFFF000) >> 12, (device_id & 0x00000FFE) >> 1); device_id = (device_id & 0x0FFFF000) >> 12; statusOut("Reported JTAG device ID: 0x%0X\n", device_id); if (device_name == 0) { while (pDevice->name) { if (pDevice->device_id == device_id) break; pDevice++; } check((pDevice->device_flags & DEVFL_MKII_ONLY) == 0, "Device is not supported by JTAG ICE mkI"); check(pDevice->name, "No configuration available for device ID: %0x\n", device_id); } else { debugOut("Looking for device: %s\n", device_name); while (pDevice->name) { if (strcasecmp(pDevice->name, device_name) == 0) break; pDevice++; } check((pDevice->device_flags & DEVFL_MKII_ONLY) == 0, "Device is not supported by JTAG ICE mkI"); check(pDevice->name, "No configuration available for Device: %s\n", device_name); } if (device_name) { if (device_id != pDevice->device_id) { statusOut("Configured for device ID: 0x%0X %s -- FORCED with %s\n", pDevice->device_id, pDevice->name, device_name); } else { statusOut("Configured for device ID: 0x%0X %s -- Matched with " "%s\n", pDevice->device_id, pDevice->name, device_name); } } else { statusOut("Configured for device ID: 0x%0X %s\n", pDevice->device_id, pDevice->name); } device_name = (char*)pDevice->name; global_p_device_def = pDevice; setDeviceDescriptor(pDevice); } void jtag1::initJtagBox(void) { statusOut("JTAG config starting.\n"); startJtagLink(); changeBitRate(115200); uchar hw_ver = getJtagParameter(JTAG_P_HW_VERSION); statusOut("Hardware Version: 0x%02x\n", hw_ver); //check(hw_ver == 0xc0, "JTAG ICE: Unknown hardware version"); uchar sw_ver = getJtagParameter(JTAG_P_SW_VERSION); statusOut("Software Version: 0x%02x\n", sw_ver); interruptProgram(); deviceAutoConfig(); // Clear out the breakpoints. deleteAllBreakpoints(); statusOut("JTAG config complete.\n"); } void jtag1::initJtagOnChipDebugging(unsigned long bitrate) { statusOut("Preparing the target device for On Chip Debugging.\n"); uchar br; if (bitrate >= 1000000UL) br = JTAG_BITRATE_1_MHz; else if (bitrate >= 500000) br = JTAG_BITRATE_500_KHz; else if (bitrate >= 250000) br = JTAG_BITRATE_250_KHz; else br = JTAG_BITRATE_125_KHz; // Set JTAG bitrate setJtagParameter(JTAG_P_CLOCK, br); // When attaching we can't change fuse bits, etc, as // enabling+disabling programming resets the processor enableProgramming(); // Ensure that all lock bits are "unlocked" ie all 1's uchar *lockBits = 0; lockBits = jtagRead(LOCK_SPACE_ADDR_OFFSET + 0, 1); if (*lockBits != LOCK_BITS_ALL_UNLOCKED) { lockBits[0] = LOCK_BITS_ALL_UNLOCKED; jtagWrite(LOCK_SPACE_ADDR_OFFSET + 0, 1, lockBits); } statusOut("\nDisabling lock bits:\n"); statusOut(" LockBits -> 0x%02x\n", *lockBits); if (lockBits) { delete [] lockBits; lockBits = 0; } // Ensure on-chip debug enable fuse is enabled ie '0' uchar *fuseBits = 0; statusOut("\nEnabling on-chip debugging:\n"); fuseBits = jtagRead(FUSE_SPACE_ADDR_OFFSET + 0, 3); if ((fuseBits[1] & FUSE_OCDEN) == FUSE_OCDEN) { fuseBits[1] = fuseBits[1] & ~FUSE_OCDEN; // clear bit jtagWrite(FUSE_SPACE_ADDR_OFFSET + 1, 1, &fuseBits[1]); } jtagDisplayFuses(fuseBits); if (fuseBits) { delete [] fuseBits; fuseBits = 0; } disableProgramming(); resetProgram(false); setJtagParameter(JTAG_P_TIMERS_RUNNING, 0x00); resetProgram(true); } void jtag1::configDaisyChain(void) { /* Set daisy chain information (if needed) */ if (dchain.units_before > 0) setJtagParameter(JTAG_P_UNITS_BEFORE,dchain.units_before); if (dchain.units_after > 0) setJtagParameter(JTAG_P_UNITS_AFTER,dchain.units_after); if (dchain.bits_before > 0) setJtagParameter(JTAG_P_BIT_BEFORE,dchain.bits_before); if (dchain.bits_after > 0) setJtagParameter(JTAG_P_BIT_AFTER,dchain.bits_after); } avarice-2.11.orig/src/jtagmisc.cc0000644000000000000000000000354010245701741013576 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002 Intel Corporation * Copyright (C) 2005 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains functions for interfacing with the JTAG box. * * $Id: jtagmisc.cc,v 1.2 2005/05/13 19:06:22 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include "avarice.h" #include "jtag.h" #include "jtag1.h" void jtag1::setJtagParameter(uchar item, uchar newValue) { uchar *response = NULL; uchar command[] = {'B', 0, 0, JTAG_EOM }; command[1] = item; command[2] = newValue; response = doJtagCommand(command, sizeof(command), 1); check(response[0] == JTAG_R_OK, "JTAG ICE: Unknown parameter\n"); delete [] response; } uchar jtag1::getJtagParameter(uchar item) { uchar *response = NULL; uchar command[] = {'q', 0, JTAG_EOM }; unsigned char result = 0; command[1] = item; response = doJtagCommand(command, sizeof(command), 2); check(response[1] == JTAG_R_OK, "JTAG ICE: Unknown parameter\n"); result = response[0]; delete [] response; return result; } avarice-2.11.orig/src/jtagprog.cc0000644000000000000000000002255711627165337013635 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002 Intel Corporation * Copyright (C) 2005 Joerg Wunsch * * File format support using BFD contributed and copyright 2003 * Nils Kr. Strom * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains functions for interfacing with the JTAG box. * * $Id: jtagprog.cc,v 1.19 2011/08/30 13:51:27 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include #include #include "avarice.h" #include "jtag.h" #include "jtag1.h" // The API changed for this in bfd.h. This is a work around. #ifndef bfd_get_section_size # define bfd_get_section_size bfd_get_section_size_before_reloc #endif static void initImage(BFDimage *image) { unsigned int i; image->last_address = 0; image->first_address = 0; image->first_address_ok = false; image->has_data = false; for (i=0;iimage[i].val = 0x00; image->image[i].used = false; } } void jtag1::enableProgramming(void) { programmingEnabled = true; check(doSimpleJtagCommand(0xa3, 1), "JTAG ICE: Failed to enable programming"); } void jtag1::disableProgramming(void) { programmingEnabled = false; check(doSimpleJtagCommand(0xa4, 1), "JTAG ICE: Failed to disable programming"); } // This is really a chip-erase which erases flash, lock-bits and eeprom // (unless the save-eeprom fuse is set). void jtag1::eraseProgramMemory(void) { check(doSimpleJtagCommand(0xa5, 1), "JTAG ICE: Failed to erase program memory"); } void jtag1::eraseProgramPage(unsigned long address) { uchar *response = NULL; uchar command[] = { 0xa1, 0, 0, 0, JTAG_EOM }; command[1] = address >> 8; command[2] = address; response = doJtagCommand(command, sizeof(command), 1); check(response[0] == JTAG_R_OK, "Page erase failed\n"); delete [] response; } // Check if file format is supported. // return nonzero on errors. static int check_file_format(bfd *file) { char **matching; int err = 1; // Check if archive, not plain file. if (bfd_check_format(file, bfd_archive) == true) { fprintf(stderr, "Input file is archive\n"); } else if (bfd_check_format_matches (file, bfd_object, &matching)) err = 0; else if (bfd_get_error () == bfd_error_file_ambiguously_recognized) { fprintf(stderr, "File format ambiguous: %s\n", bfd_errmsg(bfd_get_error())); } else if (bfd_get_error () != bfd_error_file_not_recognized) { fprintf(stderr, "File format not supported: %s\n", bfd_errmsg(bfd_get_error())); } else if (bfd_check_format_matches (file, bfd_core, &matching)) err = 0; return err; } // Get address of section. // We have two different scenarios (both with same result). // 1. vma == lma : Normal section // Return real address (mask gcc-hacked MSB's away). // // 2. vma != lma : For sections to be relocated (e.g. .data) // lma is the address where the duplicate initialized data is stored. // vma is the destination address after relocation. // Return real address (mask gcc-hacked MSB's away). // // 3. Not correct memory type: return 0x800000. // static unsigned int get_section_addr(asection *section, BFDmemoryType memtype) { BFDmemoryType sectmemtype; if ((section->flags & SEC_HAS_CONTENTS) && ((section->flags & SEC_ALLOC) || (section->flags & SEC_LOAD))) { if (section->lma < DATA_SPACE_ADDR_OFFSET) // < 0x80... sectmemtype = MEM_FLASH; else if (section->lma < EEPROM_SPACE_ADDR_OFFSET) // < 0x81... sectmemtype = MEM_RAM; else if (section->lma < FUSE_SPACE_ADDR_OFFSET) // < 0x82... sectmemtype = MEM_EEPROM; else // e.g. .fuses return 0xffffff; if (memtype == sectmemtype) { if (sectmemtype == MEM_FLASH) { /* Don't mask the lma or you will not be able to handle more than 64K of flash. */ return (section->lma); } return (section->lma &~ ADDR_SPACE_MASK); } else return 0xffffff; } else return 0xffffff; } // Add section of memtype BFDmemoryType to image. static void jtag_create_image(bfd *file, asection *section, BFDimage *image, BFDmemoryType memtype) { const char *name; unsigned int addr; unsigned int size; static uchar buf[MAX_IMAGE_SIZE]; unsigned int i; // If section is empty (although unexpected) return if (! section) return; // Get information about section name = bfd_get_section_name(file, section); size = bfd_get_section_size(section); if ((addr = get_section_addr(section, memtype)) != 0xffffff) { debugOut("Getting section contents, addr=0x%lx size=0x%lx\n", addr, size); // Read entire section into buffer, at correct byte address. bfd_get_section_contents(file, section, buf, 0, size); // Copy section into memory struct. Mark as used. for (i=0; iimage[c].val = buf[i]; image->image[c].used = true; } // Remember last address in image if (addr+size > image->last_address) image->last_address = addr+size; // Remember first address in image if ((! image->first_address_ok) || (addr < image->first_address)) { image->first_address = addr; image->first_address_ok = true; } debugOut("%s Image create: Adding %s at addr 0x%lx size %d (0x%lx)\n", BFDmemoryTypeString[memtype], name, addr, size, size); // Indicate image has data image->has_data = true; } } void jtag1::downloadToTarget(const char* filename, bool program, bool verify) { // Basically, we just open the file and copy blocks over to the JTAG // box. struct stat ifstat; const char *target = NULL; const char *default_target = "binary"; unsigned int page_size; bool done = 0; bfd *file; asection *p; static BFDimage flashimg, eepromimg; initImage(&flashimg); initImage(&eepromimg); flashimg.name = BFDmemoryTypeString[MEM_FLASH]; eepromimg.name = BFDmemoryTypeString[MEM_EEPROM]; unixCheck(stat(filename, &ifstat), "Can't stat() file %s", filename); // Open the input file. bfd_init(); // Auto detect file format by a loop iterated at most two times. // 1. Auto-detect file format. // 2. If auto-detect failed, assume binary and iterate once more over // loop. while (! done) { file = bfd_openr(filename, target); if (! file) { fprintf( stderr, "Could not open input file %s:%s\n", filename, bfd_errmsg(bfd_get_error()) ); exit(-1); } // Check if file format is supported. If not, go for binary mode. else if (check_file_format(file)) { // File format detection failed. Assuming binary file // BFD section flags are CONTENTS,ALLOC,LOAD,DATA // We must force CODE in stead of DATA fprintf(stderr, "Warning: File format unknown, assuming " "binary.\n"); target = default_target; } else done = 1; } // Configure for JTAG download/programming // Set the flash page and eeprom page sizes (These are device dependent) page_size = get_page_size(MEM_FLASH); debugOut("Flash page size: 0x%0x\nEEPROM page size: 0x%0x\n", page_size, get_page_size(MEM_EEPROM)); setJtagParameter(JTAG_P_FLASH_PAGESIZE_LOW, page_size & 0xff); setJtagParameter(JTAG_P_FLASH_PAGESIZE_HIGH, page_size >> 8); setJtagParameter(JTAG_P_EEPROM_PAGESIZE, get_page_size(MEM_EEPROM)); // Create RAM image by reading all sections in file p = file->sections; while (p) { jtag_create_image(file, p, &flashimg, MEM_FLASH); jtag_create_image(file, p, &eepromimg, MEM_EEPROM); p = p->next; } enableProgramming(); // Write the complete FLASH/EEPROM images to the device. if (flashimg.has_data) jtag_flash_image(&flashimg, MEM_FLASH, program, verify); if (eepromimg.has_data) jtag_flash_image(&eepromimg, MEM_EEPROM, program, verify); disableProgramming(); unixCheck(bfd_close(file), "Error closing %s", filename); statusOut("\nDownload complete.\n"); } avarice-2.11.orig/src/jtagrun.cc0000644000000000000000000001332511627164120013450 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002 Intel Corporation * Copyright (C) 2005, 2007 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains functions for interfacing with the JTAG box. * * $Id: jtagrun.cc,v 1.8 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include #include "avarice.h" #include "jtag.h" #include "jtag1.h" #include "remote.h" unsigned long jtag1::getProgramCounter(void) { uchar *response = NULL; uchar command[] = {'2', JTAG_EOM }; unsigned long result = 0; response = doJtagCommand(command, sizeof(command), 4); if (response[3] != JTAG_R_OK) result = PC_INVALID; else { result = decodeAddress(response); result--; // returned value is PC + 1 as far as GDB is concerned // The JTAG box sees program memory as 16-bit wide locations. GDB // sees bytes. As such, double the PC value. result *= 2; } delete [] response; return result; } bool jtag1::setProgramCounter(unsigned long pc) { uchar *response = NULL; uchar command[] = {'3', 0, 0, 0, JTAG_EOM }; bool result; // See decoding in getProgramCounter encodeAddress(&command[1], pc / 2 + 1); response = doJtagCommand(command, sizeof(command), 1); result = response[0] == JTAG_R_OK; delete [] response; return result; } bool jtag1::resetProgram(bool possible_nSRST) { bool result; if (possible_nSRST && apply_nSRST) { setJtagParameter(JTAG_P_EXTERNAL_RESET, 0x01); } result = doSimpleJtagCommand('x', 1); if (possible_nSRST && apply_nSRST) { setJtagParameter(JTAG_P_EXTERNAL_RESET, 0x00); } return result; } bool jtag1::interruptProgram(void) { // Just ignore the returned PC. It appears to be wrong if the most // recent instruction was a branch. return doSimpleJtagCommand('F', 4); } bool jtag1::resumeProgram(void) { return doSimpleJtagCommand('G', 0); } PRAGMA_DIAG_PUSH PRAGMA_DIAG_IGNORED("-Wunused-parameter") bool jtag1::jtagSingleStep(bool useHLL) { return doSimpleJtagCommand('1', 1); } PRAGMA_DIAG_POP void jtag1::parseEvents(const char *) { // current no event name parsing in mkI } bool jtag1::jtagContinue(void) { updateBreakpoints(); // download new bp configuration if (!doSimpleJtagCommand('G', 0)) { gdbOut("Failed to continue\n"); return true; } for (;;) { int maxfd; fd_set readfds; bool breakpoint = false, gdbInterrupt = false; // Now that we are "going", wait for either a response from the JTAG // box or a nudge from GDB. debugOut("Waiting for input.\n"); // Check for input from JTAG ICE (breakpoint, sleep, info, power) // or gdb (user break) FD_ZERO (&readfds); FD_SET (gdbFileDescriptor, &readfds); FD_SET (jtagBox, &readfds); maxfd = jtagBox > gdbFileDescriptor ? jtagBox : gdbFileDescriptor; int numfds = select(maxfd + 1, &readfds, 0, 0, 0); unixCheck(numfds, "GDB/JTAG ICE communications failure"); if (FD_ISSET(gdbFileDescriptor, &readfds)) { int c = getDebugChar(); if (c == 3) // interrupt { debugOut("interrupted by GDB\n"); gdbInterrupt = true; } else debugOut("Unexpected GDB input `%02x'\n", c); } // Read all extant responses (there's a small chance there could // be more than one) // Note: In case of a gdb interrupt, it's possible that we will // receive one of these responses before interruptProgram is // called. This should not cause a problem as the normal retry // mechanism should eat up this response. // It might be cleaner to handle JTAG_R_xxx in sendJtagCommand // Check the JTAG ICE's message. It can indicate a breakpoint // which causes us to return, a sleep status change (ignored), // power "event" -- whatever that is (ignored), or a byte of // info sent by the program (currently ignored, could be used // for something...) uchar response; // This read shouldn't need to be a timeout_read(), but some cygwin // systems don't seem to honor the O_NONBLOCK flag on file // descriptors. while (timeout_read(&response, 1, 1) == 1) { uchar buf[2]; int count; debugOut("JTAG box sent %c", response); switch (response) { case JTAG_R_BREAK: count = timeout_read(buf, 2, JTAG_RESPONSE_TIMEOUT); jtagCheck(count); check(count == 2, JTAG_CAUSE); breakpoint = true; debugOut(": Break Status Register = 0x%02x%02x\n", buf[0], buf[1]); break; case JTAG_R_INFO: case JTAG_R_SLEEP: // we could do something here, esp. for info count = timeout_read(buf, 2, JTAG_RESPONSE_TIMEOUT); jtagCheck(count); check(count == 2, JTAG_CAUSE); debugOut(": 0x%02, 0x%02\n", buf[0], buf[1]); break; case JTAG_R_POWER: // apparently no args? debugOut("\n"); break; default: debugOut(": Unknown response\n"); break; } } // We give priority to user interrupts if (gdbInterrupt) return false; if (breakpoint) return true; } } avarice-2.11.orig/src/jtagrw.cc0000644000000000000000000001524411627164120013276 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002, 2003, 2004 Intel Corporation * Copyright (C) 2005 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains functions for interfacing with the JTAG box. * * $Id: jtagrw.cc,v 1.15 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include #include "avarice.h" #include "jtag.h" #include "jtag1.h" #include "remote.h" /** Return the memory space code for the memory space indicated by the high-order bits of '*addr'. Also clear these high order bits in '*addr' **/ static uchar memorySpace(unsigned long *addr) { int mask; // We can't just mask the bits off, because 0x10000->0x1ffff are // valid code addresses if (*addr & DATA_SPACE_ADDR_OFFSET) { mask = *addr & ADDR_SPACE_MASK; *addr &= ~ADDR_SPACE_MASK; } else mask = 0; switch (mask) { case EEPROM_SPACE_ADDR_OFFSET: return ADDR_EEPROM_SPACE; case FUSE_SPACE_ADDR_OFFSET: return ADDR_FUSE_SPACE; case LOCK_SPACE_ADDR_OFFSET: return ADDR_LOCK_SPACE; case SIG_SPACE_ADDR_OFFSET: return ADDR_SIG_SPACE; case BREAKPOINT_SPACE_ADDR_OFFSET: return ADDR_BREAKPOINT_SPACE; case DATA_SPACE_ADDR_OFFSET: return ADDR_DATA_SPACE; default: return 0; // program memory, handled specially } } static void swapBytes(uchar *buffer, unsigned int count) { assert(!(count & 1)); for (unsigned int i = 0; i < count; i += 2) { uchar temp = buffer[i]; buffer[i] = buffer[i + 1]; buffer[i + 1] = temp; } } uchar *jtag1::jtagRead(unsigned long addr, unsigned int numBytes) { uchar *response; int whichSpace = 0; uchar command[] = { 'R', 0, 0, 0, 0, 0, JTAG_EOM }; if (numBytes == 0) { response = new uchar[1]; response[0] = '\0'; return response; } debugOut("jtagRead "); whichSpace = memorySpace(&addr); if (whichSpace) { command[1] = whichSpace; if (numBytes > 256) return NULL; command[2] = numBytes - 1; encodeAddress(&command[3], addr); // Response will be the number of data bytes with an 'A' at the // start and end. As such, the response size will be number of bytes // + 2. Then add an additional byte for the trailing zero (see // protocol document). response = doJtagCommand(command, sizeof command, numBytes + 2); if (response[numBytes + 1] == JTAG_R_OK) return response; delete [] response; return NULL; } else { // Reading program memory whichSpace = programmingEnabled ? ADDR_PROG_SPACE_PROG_ENABLED : ADDR_PROG_SPACE_PROG_DISABLED; // Program space is 16 bits wide, with word reads int numLocations; if (addr & 1) numLocations = (numBytes + 2) / 2; else numLocations = (numBytes + 1) / 2; if (numLocations > 256) return false; command[1] = whichSpace; command[2] = numLocations - 1; encodeAddress(&command[3], addr / 2); response = doJtagCommand(command, sizeof command, numLocations * 2 + 2); if (response[numLocations * 2 + 1] == JTAG_R_OK) { // Programming mode and regular mode are byte-swapped... if (!programmingEnabled) swapBytes(response, numLocations * 2); if (addr & 1) // we read one byte early. move stuff down. memmove(response, response + 1, numBytes); return response; } } delete [] response; return NULL; } bool jtag1::jtagWrite(unsigned long addr, unsigned int numBytes, uchar buffer[]) { uchar *response; int whichSpace = 0; unsigned int numLocations; uchar command[] = { 'W', 0, 0, 0, 0, 0, JTAG_EOM }; if (numBytes == 0) return true; debugOut("jtagWrite "); whichSpace = memorySpace(&addr); if (whichSpace) numLocations = numBytes; else { // Writing program memory, which is word (16-bit) addressed // We don't handle odd lengths or start addresses if ((addr & 1)) { debugOut ("\nOdd pgm wr addr\n"); return false; } // Odd length: Write one more byte. if ((numBytes & 1)) { debugOut ("\nOdd pgm wr length\n"); numBytes+=1; } addr /= 2; numLocations = numBytes / 2; if (programmingEnabled) whichSpace = ADDR_PROG_SPACE_PROG_ENABLED; else { whichSpace = ADDR_PROG_SPACE_PROG_DISABLED; swapBytes(buffer, numBytes); #if 0 // Doesn't work out of programming mode, as far as I can tell // (there's probably some magic that would make it work, but...) return false; #endif } } // This is the maximum write size if (numLocations > 256) return false; // Writing is a two part process // Part 1: send the address command[1] = whichSpace; command[2] = numLocations - 1; encodeAddress(&command[3], addr); response = doJtagCommand(command, sizeof command, 0); if (!response) return false; delete [] response; // Part 2: send the data in the following form: // h [data byte]...[data byte] __ // Before we begin, a little note on the endianness. // Firstly, data space is 8 bits wide and the only data written by // this routine will be byte-wide, so endianness does not matter. // For code space, the data is 16 bit wide. The data appears to be // formatted big endian in the processor memory. The JTAG box // expects little endian data. The object files output from GCC are // already word-wise little endian. // As this data is already formatted, and currently the only writes // to program space are for code download, it is simpler at this // stage to simply pass the data straight through. This may need to // change in the future. uchar *txBuffer = new uchar[numBytes + 3]; // allow for header and trailer txBuffer[0] = 'h'; memcpy(&txBuffer[1], buffer, numBytes); txBuffer[numBytes + 1] = ' '; txBuffer[numBytes + 2] = ' '; response = doJtagCommand(txBuffer, numBytes + 3, 1); delete [] txBuffer; if (!response) return false; delete [] response; return true; } avarice-2.11.orig/src/main.cc0000644000000000000000000005262711627164120012732 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002, 2003, 2004 Intel Corporation * Copyright (C) 2005,2006,2007 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains the main() & support for avrjtagd. * * $Id: main.cc,v 1.53 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "avarice.h" #include "remote.h" #include "jtag.h" #include "jtag1.h" #include "jtag2.h" #include "gnu_getopt.h" bool ignoreInterrupts; static int makeSocket(struct sockaddr_in *name) { int sock; int tmp; struct protoent *protoent; sock = socket(PF_INET, SOCK_STREAM, 0); gdbCheck(sock); // Allow rapid reuse of this port. tmp = 1; gdbCheck(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&tmp, sizeof(tmp))); // Enable TCP keep alive process. tmp = 1; gdbCheck(setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (char *)&tmp, sizeof(tmp))); gdbCheck(bind(sock, (struct sockaddr *)name, sizeof(*name))); protoent = getprotobyname("tcp"); check(protoent != NULL, "tcp protocol unknown (oops?)"); tmp = 1; gdbCheck(setsockopt(sock, protoent->p_proto, TCP_NODELAY, (char *)&tmp, sizeof(tmp))); return sock; } static void initSocketAddress(struct sockaddr_in *name, const char *hostname, unsigned short int port) { struct hostent *hostInfo; memset(name, 0, sizeof(*name)); name->sin_family = AF_INET; name->sin_port = htons(port); // Try numeric interpretation (1.2.3.4) first, then // hostname resolution if that failed. if (inet_aton(hostname, &name->sin_addr) == 0) { hostInfo = gethostbyname(hostname); check(hostInfo != NULL, "Unknown host %s", hostname); name->sin_addr = *(struct in_addr *)hostInfo->h_addr; } } static unsigned long parseJtagBitrate(const char *val) { char *endptr, c; unsigned long v; check(*val != '\0', "invalid number in JTAG bit rate"); v = strtoul(val, &endptr, 10); if (*endptr == '\0') return v; while (isspace((unsigned char)(c = *endptr))) endptr++; switch (c) { case 'k': case 'K': v *= 1000UL; return v; case 'm': case 'M': v *= 1000000UL; return v; } if (strcmp(endptr, "Hz") == 0) return v; check(false, "invalid number in JTAG bit rate"); return 0UL; } static void usage(const char *progname) { fprintf(stderr, "Usage: %s [OPTION]... [[HOST_NAME]:PORT]\n\n", progname); fprintf(stderr, "Options:\n"); fprintf(stderr, " -h, --help Print this message.\n"); fprintf(stderr, " -1, --mkI Connect to JTAG ICE mkI (default)\n"); fprintf(stderr, " -2, --mkII Connect to JTAG ICE mkII\n"); fprintf(stderr, " -B, --jtag-bitrate Set the bitrate that the JTAG box communicates\n" " with the avr target device. This must be less\n" " than 1/4 of the frequency of the target. Valid\n" " values are 1000/500/250/125 kHz (mkI),\n" " or 22 through 6400 kHz (mkII).\n" " (default: 250 kHz)\n"); fprintf(stderr, " -C, --capture Capture running program.\n" " Note: debugging must have been enabled prior\n" " to starting the program. (e.g., by running\n" " avarice earlier)\n"); fprintf(stderr, " -c, --daisy-chain Daisy chain settings:\n" " \n"); fprintf(stderr, " -D, --detach Detach once synced with JTAG ICE\n"); fprintf(stderr, " -d, --debug Enable printing of debug information.\n"); fprintf(stderr, " -e, --erase Erase target.\n"); fprintf(stderr, " -E, --event List of events that do not interrupt.\n" " JTAG ICE mkII and AVR Dragon only.\n" " Default is \"none,run,target_power_on,target_sleep,target_wakeup\"\n"); fprintf(stderr, " -f, --file Specify a file for use with the --program and\n" " --verify options. If --file is passed and\n" " neither --program or --verify are given then\n" " --program is implied.\n"); fprintf(stderr, " -g, --dragon Connect to an AVR Dragon rather than a JTAG ICE.\n" " This implies --mkII, but might be required in\n" " addition to --debugwire when debugWire is to\n" " be used.\n"); fprintf(stderr, " -I, --ignore-intr Automatically step over interrupts.\n" " Note: EXPERIMENTAL. Can not currently handle\n" " devices fused for compatibility.\n"); fprintf(stderr, " -j, --jtag Port attached to JTAG box (default: /dev/avrjtag).\n"); fprintf(stderr, " -k, --known-devices Print a list of known devices.\n"); fprintf(stderr, " -L, --write-lockbits Write lock bits.\n"); fprintf(stderr, " -l, --read-lockbits Read lock bits.\n"); fprintf(stderr, " -P, --part Target device name (e.g." " atmega16)\n\n"); fprintf(stderr, " -p, --program Program the target.\n" " Binary filename must be specified with --file\n" " option.\n"); fprintf(stderr, " -r, --read-fuses Read fuses bytes.\n"); fprintf(stderr, " -R, --reset-srst External reset through nSRST signal.\n"); fprintf(stderr, " -V, --version Print version information.\n"); fprintf(stderr, " -v, --verify Verify program in device against file specified\n" " with --file option.\n"); fprintf(stderr, " -w, --debugwire For the JTAG ICE mkII, connect to the target\n" " using debugWire protocol rather than JTAG.\n"); fprintf(stderr, " -W, --write-fuses Write fuses bytes.\n"); fprintf(stderr, " -x, --xmega AVR part is an ATxmega device.\n"); fprintf(stderr, "HOST_NAME defaults to 0.0.0.0 (listen on any interface).\n" "\":PORT\" is required to put avarice into gdb server mode.\n\n"); fprintf(stderr, "e.g. %s --erase --program --file test.bin --jtag /dev/ttyS0 :4242\n\n", progname); exit(0); } static int comparenames(const void *a, const void *b) { const jtag_device_def_type *ja = (const jtag_device_def_type *)a; const jtag_device_def_type *jb = (const jtag_device_def_type *)b; return strcmp(ja->name, jb->name); } static void knownParts() { fprintf(stderr, "List of known AVR devices:\n\n"); jtag_device_def_type* dev = deviceDefinitions; // Count the device descriptor records. size_t n = 0; while (dev->name != NULL) n++, dev++; // For historical reasons, device definitions are not // sorted. Sort them here. qsort(deviceDefinitions, n, sizeof(jtag_device_def_type), comparenames); fprintf(stderr, "%-15s %10s %8s %8s\n", "Device Name", "Device ID", "Flash", "EEPROM"); fprintf(stderr, "%-15s %10s %8s %8s\n", "---------------", "---------", "-------", "-------"); dev = deviceDefinitions; while (n-- != 0) { unsigned eesize = dev->eeprom_page_size * dev->eeprom_page_count; if (eesize != 0 && eesize < 1024) fprintf(stderr, "%-15s 0x%04X %4d KiB %4.1f KiB\n", dev->name, dev->device_id, dev->flash_page_size * dev->flash_page_count / 1024, eesize / 1024.0); else fprintf(stderr, "%-15s 0x%04X %4d KiB %4d KiB\n", dev->name, dev->device_id, dev->flash_page_size * dev->flash_page_count / 1024, eesize / 1024); dev++; } exit(1); } static struct option long_opts[] = { /* name, has_arg, flag, val */ { "mkI", 0, 0, '1' }, { "mkII", 0, 0, '2' }, { "jtag-bitrate", 1, 0, 'B' }, { "capture", 0, 0, 'C' }, { "daisy-chain", 1, 0, 'c' }, { "detach", 0, 0, 'D' }, { "debug", 0, 0, 'd' }, { "erase", 0, 0, 'e' }, { "event", 1, 0, 'E' }, { "file", 1, 0, 'f' }, { "dragon", 0, 0, 'g' }, { "help", 0, 0, 'h' }, { "ignore-intr", 0, 0, 'I' }, { "jtag", 1, 0, 'j' }, { "known-devices", 0, 0, 'k' }, { "write-lockbits", 1, 0, 'L' }, { "read-lockbits", 0, 0, 'l' }, { "part", 1, 0, 'P' }, { "program", 0, 0, 'p' }, { "reset-srst", 0, 0, 'R' }, { "read-fuses", 0, 0, 'r' }, { "version", 0, 0, 'V' }, { "verify", 0, 0, 'v' }, { "debugwire", 0, 0, 'w' }, { "write-fuses", 1, 0, 'W' }, { "xmega", 0, 0, 'x' }, { 0, 0, 0, 0 } }; jtag *theJtagICE; int main(int argc, char **argv) { int sock; struct sockaddr_in clientname; struct sockaddr_in name; char *inFileName = 0; const char *jtagDeviceName = NULL; char *device_name = 0; const char *eventlist = "none,run,target_power_on,target_sleep,target_wakeup"; unsigned long jtagBitrate = 0; const char *hostName = "0.0.0.0"; /* INADDR_ANY */ int hostPortNumber = 0; bool erase = false; bool program = false; bool readFuses = false; bool writeFuses = false; char *fuses = NULL; bool readLockBits = false; bool writeLockBits = false; bool gdbServerMode = false; char *lockBits = NULL; bool detach = false; bool capture = false; bool verify = false; bool is_dragon = false; bool apply_nsrst = false; bool is_xmega = false; char *progname = argv[0]; enum { MKI, MKII, MKII_DW } protocol = MKI; // default to mkI protocol int option_index; unsigned int units_before = 0; unsigned int units_after = 0; unsigned int bits_before = 0; unsigned int bits_after = 0; statusOut("AVaRICE version %s, %s %s\n\n", PACKAGE_VERSION, __DATE__, __TIME__); device_name = 0; opterr = 0; /* disable default error message */ while (1) { int c = getopt_long (argc, argv, "12B:Cc:DdeE:f:ghIj:kL:lP:pRrVvwW:x", long_opts, &option_index); if (c == -1) break; /* no more options */ switch (c) { case 'h': case '?': usage(progname); case 'k': knownParts(); case '1': protocol = MKI; break; case '2': // If we've already seen a -w option, don't revert to -2. if (protocol != MKII_DW) protocol = MKII; break; case 'B': jtagBitrate = parseJtagBitrate(optarg); break; case 'C': capture = true; break; case 'c': if (sscanf(optarg,"%u,%u,%u,%u", &units_before, &units_after, &bits_before, &bits_after) != 4) usage(progname); if (units_before > bits_before || units_after > bits_after || bits_before > 32 || bits_after > 32) { fprintf(stderr, "%s: daisy-chain parameters out of range" " (max. 32 bits before/after)\n", progname); exit(1); } break; case 'D': detach = true; break; case 'd': debugMode = true; break; case 'e': erase = true; break; case 'E': eventlist = optarg; break; case 'f': inFileName = optarg; break; case 'g': // If we've already seen a -w option, don't revert to -2. if (protocol != MKII_DW) protocol = MKII; is_dragon = true; break; case 'I': ignoreInterrupts = true; break; case 'j': jtagDeviceName = optarg; break; case 'L': lockBits = optarg; writeLockBits = true; break; case 'l': readLockBits = true; break; case 'P': device_name = optarg; break; case 'p': program = true; break; case 'R': apply_nsrst = true; break; case 'r': readFuses = true; break; case 'V': exit(0); case 'v': verify = true; break; case 'w': protocol = MKII_DW; break; case 'W': fuses = optarg; writeFuses = true; break; case 'x': is_xmega = true; break; default: fprintf (stderr, "getop() did something screwey"); exit (1); } } if ((optind+1) == argc) { /* Looks like user has given [[host]:port], so parse out the host and port number then enable gdb server mode. */ int i; char *arg = argv[optind]; int len = strlen (arg); char *host = new char[len+1]; memset (host, '\0', len+1); for (i=0; i= len) { /* No port was given. */ fprintf (stderr, "avarice: %s is not a valid host:port value.\n", arg); exit (1); } char *endptr; hostPortNumber = (int)strtol(arg+i, &endptr, 0); if (endptr == arg+i) { /* Invalid convertion. */ fprintf (stderr, "avarice: failed to convert port number: %s\n", arg+i); exit (1); } /* Make sure the the port value is not a priviledged port and is not greater than max port value. */ if ((hostPortNumber < 1024) || (hostPortNumber > 0xffff)) { fprintf (stderr, "avarice: invalid port number: %d (must be >= %d" " and <= %d)\n", hostPortNumber, 1024, 0xffff); exit (1); } gdbServerMode = true; } else if (optind != argc) { usage (progname); } if (jtagBitrate == 0 && (protocol == MKI || protocol == MKII)) { fprintf (stdout, "Defaulting JTAG bitrate to 250 kHz.\n\n"); jtagBitrate = 250000; } // Use a default device name to connect to if not specified on the // command-line. If the JTAG_DEV environment variable is set, use // the name given there. As the AVR Dragon can only be talked to // through USB, default it to USB, but use a generic name else. if (jtagDeviceName == NULL) { char *cp = getenv ("JTAG_DEV"); if (cp != NULL) jtagDeviceName = cp; else if (is_dragon) jtagDeviceName = "usb"; else jtagDeviceName = "/dev/avrjtag"; } try { // And say hello to the JTAG box switch (protocol) { case MKI: theJtagICE = new jtag1(jtagDeviceName, device_name, apply_nsrst); break; case MKII: theJtagICE = new jtag2(jtagDeviceName, device_name, false, is_dragon, apply_nsrst, is_xmega); break; case MKII_DW: theJtagICE = new jtag2(jtagDeviceName, device_name, true, is_dragon, apply_nsrst); break; } // Set Daisy-chain variables theJtagICE->dchain.units_before = (unsigned char) units_before; theJtagICE->dchain.units_after = (unsigned char) units_after; theJtagICE->dchain.bits_before = (unsigned char) bits_before; theJtagICE->dchain.bits_after = (unsigned char) bits_after; // Tell which events to ignore. theJtagICE->parseEvents(eventlist); // Init JTAG box. theJtagICE->initJtagBox(); } catch(const char *msg) { fprintf(stderr, "%s\n", msg); return 1; } catch(...) { fprintf(stderr, "Cannot initialize JTAG ICE\n"); return 1; } if (erase) { if (protocol == MKII_DW) { statusOut("WARNING: Chip erase not possible in debugWire mode; ignored\n"); } else { theJtagICE->enableProgramming(); statusOut("Erasing program memory.\n"); theJtagICE->eraseProgramMemory(); statusOut("Erase complete.\n"); theJtagICE->disableProgramming(); } } if (readFuses) { theJtagICE->jtagReadFuses(); } if (readLockBits) { theJtagICE->jtagReadLockBits(); } if (writeFuses) theJtagICE->jtagWriteFuses(fuses); // Init JTAG debugger for initial use. // - If we're attaching to a running target, we cannot do this. // - If we're running as a standalone programmer, we don't want // this. if( gdbServerMode && ( ! capture ) ) theJtagICE->initJtagOnChipDebugging(jtagBitrate); if (inFileName != (char *)0) { if ((program == false) && (verify == false)) { /* If --file is given and neither --program or --verify, then we program, but not verify so as to be backward compatible with the old meaning of --file from before the addition of --program and --verify. */ program = true; } if ((erase == false) && (program == true)) { statusOut("WARNING: The default behaviour has changed.\n" "Programming no longer erases by default. If you want to" " erase and program\nin a single step, use the --erase " "in addition to --program. The reason for\nthis change " "is to allow programming multiple sections (e.g. " "application and\nbootloader) in multiple passes.\n\n"); } theJtagICE->downloadToTarget(inFileName, program, verify); theJtagICE->resetProgram(false); } else { check( (!program) && (!verify), "\nERROR: Filename not specified." " Use the --file option.\n"); } // Write fuses after all programming parts have completed. if (writeLockBits) theJtagICE->jtagWriteLockBits(lockBits); // Quit & resume mote for operations that don't interact with gdb. if (!gdbServerMode) theJtagICE->resumeProgram(); else { initSocketAddress(&name, hostName, hostPortNumber); sock = makeSocket(&name); statusOut("Waiting for connection on port %hu.\n", hostPortNumber); gdbCheck(listen(sock, 1)); if (detach) { int child = fork(); unixCheck(child, "Failed to fork"); if (child != 0) _exit(0); else unixCheck(setsid(), "setsid failed - weird bug"); } // Connection request on original socket. socklen_t size = (socklen_t)sizeof(clientname); int gfd = accept(sock, (struct sockaddr *)&clientname, &size); gdbCheck(gfd); statusOut("Connection opened by host %s, port %hu.\n", inet_ntoa(clientname.sin_addr), ntohs(clientname.sin_port)); setGdbFile(gfd); // Now do the actual processing of GDB messages // We stay here until exiting because of error of EOF on the // gdb connection for (;;) talkToGdb(); } delete theJtagICE; return 0; } avarice-2.11.orig/src/pragma.h0000644000000000000000000000365411627164120013113 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2011 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * Pragma abstractions for various compilers/compiler versions. * * $Id: pragma.h,v 1.1 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #ifndef PRAGMA_H #define PRAGMA_H /* * Evaluate which diagnostic pragmas can be used. */ #if defined(__GNUC__) # if __GNUC__ > 4 # define PRAGMA_DIAG_PUSH _Pragma(GCC diagnostic push) # define PRAGMA_DIAG_POP _Pragma(GCC diagnostic pop) # define PRAGMA_DIAG_IGNORED(x) _Pragma(GCC diagnostic ignored x) # elif __GNUC__ == 4 # if __GNUC_MINOR__ >= 6 # define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push") # define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop") # define PRAGMA_(x) _Pragma(#x) # define PRAGMA_DIAG_IGNORED(x) PRAGMA_(GCC diagnostic ignored x) # else # define PRAGMA_DIAG_PUSH # define PRAGMA_DIAG_POP # define PRAGMA_(x) _Pragma(#x) # define PRAGMA_DIAG_IGNORED(x) PRAGMA_(GCC diagnostic ignored x) # endif /* GCC 4.x */ # else /* too old */ # define PRAGMA_DIAG_PUSH # define PRAGMA_DIAG_POP # define PRAGMA_DIAG_IGNORED(x) # endif #else /* not GCC */ # define PRAGMA_DIAG_PUSH # define PRAGMA_DIAG_POP # define PRAGMA_DIAG_IGNORED(x) #endif #endif avarice-2.11.orig/src/remote.cc0000644000000000000000000006211711627164120013274 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002 Intel Corporation * Copyright (C) 2005 Joerg Wunsch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains functions for interfacing with the GDB remote protocol. * * $Id: remote.cc,v 1.18 2011/08/30 13:40:32 joerg_wunsch Exp $ */ #include #include #include #include #include #include #include #include #include #include "avarice.h" #include "remote.h" #include "jtag.h" enum { /** BUFMAX defines the maximum number of characters in * inbound/outbound buffers at least NUMREGBYTES*2 are needed for * register packets */ BUFMAX = 400, NUMREGS = 32/* + 1 + 1 + 1*/, /* SREG, FP, PC */ SREG = 32, SP = 33, PC = 34, // Number of bytes of registers. See GDB gdb/avr-tdep.c NUMREGBYTES = (NUMREGS + 1 + 2 + 4), }; static char remcomInBuffer[BUFMAX]; static char remcomOutBuffer[BUFMAX]; static void ok(); static void error(int n); int gdbFileDescriptor = -1; void gdbCheck(int status) { unixCheck(status, GDB_CAUSE); } void setGdbFile(int fd) { gdbFileDescriptor = fd; int ret = fcntl(gdbFileDescriptor, F_SETFL, O_NONBLOCK); gdbCheck(ret); } static void waitForGdbOutput(void) { int numfds; fd_set writefds; FD_ZERO (&writefds); FD_SET (gdbFileDescriptor, &writefds); numfds = select (gdbFileDescriptor + 1, 0, &writefds, 0, 0); gdbCheck(numfds); } /** Send single char to gdb. Abort in case of problem. **/ static void putDebugChar(char c) { // This loop busy waits when it cannot write to gdb. // But that shouldn't happen for (;;) { int ret = write(gdbFileDescriptor, &c, 1); if (ret == 1) return; if (ret == 0) // this shouldn't happen? check(false, GDB_CAUSE); if (errno != EAGAIN) gdbCheck(ret); waitForGdbOutput(); } } static void waitForGdbInput(void) { int numfds; fd_set readfds; FD_ZERO (&readfds); FD_SET (gdbFileDescriptor, &readfds); numfds = select (gdbFileDescriptor + 1, &readfds, 0, 0, 0); gdbCheck(numfds); } /** Return single char read from gdb. Abort in case of problem, exit cleanly if EOF detected on gdbFileDescriptor. **/ int getDebugChar(void) { uchar c = 0; int result; do { waitForGdbInput(); result = read(gdbFileDescriptor, &c, 1); } while (result < 0 && errno == EAGAIN); gdbCheck(result); if (result == 0) // gdb exited { statusOut("gdb exited.\n"); theJtagICE->resumeProgram(); delete theJtagICE; exit(0); } return (int)c; } int checkForDebugChar(void) { uchar c = 0; int result; result = read(gdbFileDescriptor, &c, 1); if (result < 0 && errno == EAGAIN) return -1; gdbCheck(result); if (result == 0) // gdb exited { statusOut("gdb exited.\n"); theJtagICE->resumeProgram(); exit(0); } return (int)c; } static const unsigned char hexchars[] = "0123456789abcdef"; static char *byteToHex(uchar x, char *buf) { *buf++ = hexchars[x >> 4]; *buf++ = hexchars[x & 0xf]; return buf; } static int hex(unsigned char ch) { if((ch >= 'a') && (ch <= 'f')) { return (ch - 'a' + 10); } if((ch >= '0') && (ch <= '9')) { return (ch - '0'); } if((ch >= 'A') && (ch <= 'F')) { return (ch - 'A' + 10); } return (-1); } /** Convert hex string at '*ptr' to an integer. Advances '*ptr' to 1st non-hex character found. Returns number of characters used in conversion. **/ static int hexToInt(char **ptr, int *intValue) { int numChars = 0; int hexValue; *intValue = 0; while (**ptr) { hexValue = hex(**ptr); if(hexValue >= 0) { *intValue = (*intValue << 4) | hexValue; numChars++; } else { break; } (*ptr)++; } return (numChars); } /** Convert the memory pointed to by mem into hex, placing result in buf. Return a pointer to the last char put in buf (null). **/ static char *mem2hex(uchar *mem, char *buf, int count) { for (int i = 0; i < count; i++) buf = byteToHex(*mem++, buf); *buf = 0; return (buf); } /** Convert the hex array pointed to by buf into binary to be placed in mem. Return a pointer to the character AFTER the last byte written. **/ static uchar *hex2mem(char *buf, uchar *mem, int count) { int i; unsigned char ch; for(i = 0; i < count; i++) { ch = hex(*buf++) << 4; ch = ch + hex(*buf++); *mem++ = ch; } return (mem); } static void putpacket(char *buffer); void vgdbOut(const char *fmt, va_list args) { // We protect against reentry because putpacket could try and report // an error which would lead to a call back to vgdbOut static bool reentered = false; if (gdbFileDescriptor >= 0 && !reentered) { char textbuf[BUFMAX], hexbuf[2 * BUFMAX], *textscan, *hexscan; reentered = true; vsnprintf(textbuf, BUFMAX, fmt, args); hexscan = hexbuf; *hexscan++ = 'O'; for (textscan = textbuf; *textscan; textscan++) hexscan = byteToHex(*textscan, hexscan); *hexscan = '\0'; putpacket(hexbuf); reentered = false; } } void gdbOut(const char *fmt, ...) { va_list args; va_start(args, fmt); vgdbOut(fmt, args); va_end(args); } /** Fill 'remcomOutBuffer' with a status report for signal 'sigval' Reply with a packet of the form: "Tss20:rr;21:llhh;22:aabbccdd;" where (all values in hex): ss = signal number (usually SIGTRAP) rr = SREG value llhh = SPL:SPH (stack pointer) aabbccdd = PC (program counter) This actually saves having to read the 32 general registers when stepping over code since gdb won't send a 'g' packet until the PC it is hunting for is found. */ static void reportStatusExtended(int sigval) { uchar *jtagBuffer; unsigned int pc = theJtagICE->getProgramCounter(); // Read in SPL SPH SREG jtagBuffer = theJtagICE->jtagRead(0x5D + DATA_SPACE_ADDR_OFFSET, 0x03); if (jtagBuffer) { // We have SPL SPH SREG and need SREG SPL SPH snprintf (remcomOutBuffer, sizeof(remcomOutBuffer), "T%02x" "20:%02x;" "21:%02x%02x;" "22:%02x%02x%02x%02x;", sigval & 0xff, jtagBuffer[2], // SREG jtagBuffer[0], // SPL jtagBuffer[1], // SPH pc & 0xff, (pc >> 8) & 0xff, (pc >> 16) & 0xff, (pc >> 24) & 0xff); delete [] jtagBuffer; jtagBuffer = 0; } else { error(1); return; } } /** Fill 'remcomOutBuffer' with a status report for signal 'sigval' **/ static void reportStatus(int sigval) { char *ptr = remcomOutBuffer; // We could use 'T'. But this requires reading SREG, SP, PC at least, so // won't be significantly faster than the 'g' operation that gdb will // request if we use 'S' here. [TRoth/2003-06-12: this is not necessarily // true. See above comment for reportStatusExtended().] *ptr++ = 'S'; // notify gdb with signo ptr = byteToHex(sigval, ptr); *ptr++ = 0; } // little-endian word read unsigned int readLWord(unsigned int address) { unsigned char *mem = theJtagICE->jtagRead(DATA_SPACE_ADDR_OFFSET + address, 2); if (!mem) return 0; // hmm unsigned int val = mem[0] | mem[1] << 8; delete[] mem; return val; } // big-endian word read unsigned int readBWord(unsigned int address) { unsigned char *mem = theJtagICE->jtagRead(DATA_SPACE_ADDR_OFFSET + address, 2); if (!mem) return 0; // hmm unsigned int val = mem[0] << 8 | mem[1]; delete[] mem; return val; } unsigned int readSP(void) { return readLWord(0x5d); } bool handleInterrupt(void) { bool result; // Set a breakpoint at return address debugOut("INTERRUPT\n"); unsigned int intrSP = readSP(); unsigned int retPC = readBWord(intrSP + 1) << 1; debugOut("INT SP = %x, retPC = %x\n", intrSP, retPC); bool needBP = !theJtagICE->codeBreakpointAt(retPC); for (;;) { if (needBP) { // If no breakpoint at return address (normal case), // add one. // Normally, this breakpoint add should succeed as gdb shouldn't // be using a momentary breakpoint when doing a step-through-range, // thus leaving is a free hw breakpoint. But if for some reason it // the add fails, interrupt the program at the interrupt handler // entry point if (!theJtagICE->addBreakpoint(retPC, CODE, 0)) return false; } result = theJtagICE->jtagContinue(); if (needBP) theJtagICE->deleteBreakpoint(retPC, CODE, 0); if (!result || !needBP) // user interrupt or hit user BP at retPC break; // We check that SP is > intrSP. If SP <= intrSP, this is just // an unrelated excursion to retPC if (readSP() > intrSP) break; } return result; } static bool singleStep() { if (!theJtagICE->jtagSingleStep()) gdbOut("Failed to single-step"); unsigned int newPC = theJtagICE->getProgramCounter(); if (theJtagICE->codeBreakpointAt(newPC)) return true; // assume interrupt when PC goes into interrupt table if (ignoreInterrupts && newPC < global_p_device_def->vectors_end) return handleInterrupt(); return true; } /** Read packet from gdb into remcomInBuffer, check checksum and confirm reception to gdb. Return pointer to null-terminated, actual packet data (without $, #, the checksum) **/ static char *getpacket(void) { char *buffer = &remcomInBuffer[0]; unsigned char checksum; unsigned char xmitcsum; int count; char ch; // scan for the sequence $# while(1) { // wait around for the start character, ignore all other characters while((ch = getDebugChar()) != '$') ; retry: checksum = 0; xmitcsum = 0; // This was -1 but compiler got upset count = 0; // now, read until a # or end of buffer is found while(count < BUFMAX - 1) { ch = getDebugChar(); if(ch == '$') { goto retry; } if(ch == '#') { break; } checksum = checksum + ch; buffer[count] = ch; count = count + 1; } buffer[count] = 0; if(ch == '#') { ch = getDebugChar(); xmitcsum = hex(ch) << 4; ch = getDebugChar(); xmitcsum += hex(ch); if(checksum != xmitcsum) { char buf[16]; mem2hex(&checksum, buf, 4); gdbOut("Bad checksum: my count = %s, ", buf); mem2hex(&xmitcsum, buf, 4); gdbOut("sent count = %s\n", buf); gdbOut(" -- Bad buffer: \"%s\"\n", buffer); putDebugChar('-'); // failed checksum } else { putDebugChar('+'); // successful transfer // if a sequence char is present, reply the sequence ID if(buffer[2] == ':') { putDebugChar(buffer[0]); putDebugChar(buffer[1]); return &buffer[3]; } return &buffer[0]; } } } } /** Send packet 'buffer' to gdb. Adds $, # and checksum wrappers. **/ static void putpacket(char *buffer) { unsigned char checksum; int count; char ch; // $#. do { putDebugChar('$'); checksum = 0; count = 0; while((ch = buffer[count])) { putDebugChar(ch); checksum += ch; count += 1; } putDebugChar('#'); putDebugChar(hexchars[checksum >> 4]); putDebugChar(hexchars[checksum % 16]); } while(getDebugChar() != '+'); // wait for the ACK } /** Set remcomOutBuffer to "ok" response */ static void ok() { strcpy(remcomOutBuffer, "OK"); } /** Set remcomOutBuffer to error 'n' response */ static void error(int n) { char *ptr = remcomOutBuffer; *ptr++ = 'E'; ptr = byteToHex(n, ptr); *ptr = '\0'; } static void repStatus(bool breaktime) { if (breaktime) reportStatusExtended(SIGTRAP); else { // A breakpoint did not occur. Assume that GDB sent a break. // Halt the target. theJtagICE->interruptProgram(); // Report this as a user interrupt reportStatusExtended(SIGINT); } } void talkToGdb(void) { int addr; int length; int i; unsigned int newPC; int regno; char *ptr; bool adding = false; bool dontSendReply = false; char cmd; static char last_cmd = 0; ptr = getpacket(); debugOut("GDB: <%s>\n", ptr); // default empty response remcomOutBuffer[0] = 0; cmd = *ptr++; switch (cmd) { default: // Unknown code. Return an empty reply message. break; case 'k': // kill the program dontSendReply = true; break; case 'R': if (!theJtagICE->resetProgram(false)) gdbOut("reset failed\n"); dontSendReply = true; break; case '!': ok(); break; case 'M': { uchar *jtagBuffer; int lead = 0; static bool last_orphan_pending = false; static uchar last_orphan = 0xff; // MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK // TRY TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 error(1); // default is error if((hexToInt(&ptr, &addr)) && (*(ptr++) == ',') && (hexToInt(&ptr, &length)) && (*(ptr++) == ':') && (length > 0)) { debugOut("\nGDB: Write %d bytes to 0x%X\n", length, addr); // There is no gaurantee that gdb will send a word aligned stream // of bytes, so we need to try and catch that here. This ugly, but // it would more difficult to change in gdb and probably affect // more than avarice users. This hack will make the gdb 'load' // command less prone to failure. if (addr & 1) { // odd addr means there may be a byte from last 'M' to write if ((last_cmd == 'M') && (last_orphan_pending)) { length++; addr--; lead = 1; } } last_orphan_pending = false; jtagBuffer = new uchar[length]; hex2mem(ptr, jtagBuffer+lead, length); if (lead) jtagBuffer[0] = last_orphan; if ((addr < DATA_SPACE_ADDR_OFFSET) && (length & 1)) { // An odd length means we will have an orphan this round but // only if we are writing to PROG space. last_orphan_pending = true; last_orphan = jtagBuffer[length]; length--; } if (theJtagICE->jtagWrite(addr, length, jtagBuffer)) ok(); delete [] jtagBuffer; } break; } case 'm': // mAA..AA,LLLL Read LLLL bytes at address AA..AA { uchar *jtagBuffer; error(1); // default is error if((hexToInt(&ptr, &addr)) && (*(ptr++) == ',') && (hexToInt(&ptr, &length))) { debugOut("\nGDB: Read %d bytes from 0x%X\n", length, addr); jtagBuffer = theJtagICE->jtagRead(addr, length); if (jtagBuffer) { mem2hex(jtagBuffer, remcomOutBuffer, length); delete [] jtagBuffer; } } break; } case '?': // Report status. We don't actually know, so always report breakpoint reportStatus(SIGTRAP); break; case 'g': // return the value of the CPU registers { uchar *jtagBuffer; uchar regBuffer[40]; memset(regBuffer, 0, sizeof(regBuffer)); // Read the registers directly from memory // R0..R31 are at locations 0..31 // SP is at 0x5D & 0x5E // SREG is at 0x5F debugOut("\nGDB: (Registers)Read %d bytes from 0x%X\n", 0x20, 0x00 + DATA_SPACE_ADDR_OFFSET); jtagBuffer = theJtagICE->jtagRead(0x00 + DATA_SPACE_ADDR_OFFSET, 0x20); if (jtagBuffer) { // Put GPRs into the first 32 locations memcpy(regBuffer, jtagBuffer, 0x20); delete [] jtagBuffer; jtagBuffer = 0; } else { error (1); break; } // Read in SPL SPH SREG jtagBuffer = theJtagICE->jtagRead(0x5D + DATA_SPACE_ADDR_OFFSET, 0x03); if (jtagBuffer) { // We have SPL SPH SREG and need SREG SPL SPH // SREG regBuffer[0x20] = jtagBuffer[0x02]; // NOTE: Little endian, so SPL comes first. // SPL regBuffer[0x21] = jtagBuffer[0x00]; // SPH regBuffer[0x22] = jtagBuffer[0x01]; delete [] jtagBuffer; jtagBuffer = 0; } else { error (1); break; } // PC newPC = theJtagICE->getProgramCounter(); regBuffer[35] = (unsigned char)(newPC & 0xff); regBuffer[36] = (unsigned char)((newPC & 0xff00) >> 8); regBuffer[37] = (unsigned char)((newPC & 0xff0000) >> 16); regBuffer[38] = (unsigned char)((newPC & 0xff000000) >> 24); debugOut("PC = %x\n", newPC); if (newPC == PC_INVALID) error(1); else mem2hex(regBuffer, remcomOutBuffer, 32 + 1 + 2 + 4); break; } case 'q': // general query { uchar* jtagBuffer; length = strlen("Ravr.io_reg"); if ( strncmp(ptr, "Ravr.io_reg", length) == 0 ) { int i, j, regcount; gdb_io_reg_def_type *io_reg_defs; debugOut("\nGDB: (io registers) Read %d bytes from 0x%X\n", 0x40, 0x20); /* If there is an io_reg_defs for this device then respond */ io_reg_defs = global_p_device_def->io_reg_defs; if (io_reg_defs) { // count the number of defined registers regcount = 0; while (io_reg_defs[regcount].name) { regcount++; } ptr += length; if (*ptr == '\0') { sprintf(remcomOutBuffer, "%02x", regcount); } else if (*ptr == ':') { // Request for a sequence of io registers int offset; i = 0; j = 0; int count; unsigned int addr; // Find the first register ptr++; hexToInt(&ptr,&i); // Confirm presence of ',' if (*ptr++ == ',') { hexToInt(&ptr,&j); } // i is the first register to read // j is the number of registers to read while ((j > 0) && (i < regcount)) { count = 0; if ((io_reg_defs[i].name != 0x00) && (io_reg_defs[i].flags != 0x00)) { // Register with special flags set offset = strlen(remcomOutBuffer); sprintf(&remcomOutBuffer[offset], "[-- %s --],00;", io_reg_defs[i].name); i++; j--; } else { // Get the address of the first io_register to be // read addr = io_reg_defs[i].reg_addr; // Count the number of consecutive address, // no-side effects, valid registers for (count = 0; count < j; count++) { if ((io_reg_defs[i+count].name == 0x00) || (io_reg_defs[i+count].flags != 0x00) || (io_reg_defs[i+count].reg_addr != addr)) { break; } addr++; } if (count) { // Read consecutive address io_registers jtagBuffer = theJtagICE->jtagRead(DATA_SPACE_ADDR_OFFSET + io_reg_defs[i].reg_addr, count); if (jtagBuffer) { int k = 0; // successfully read while(count--) { offset = strlen(remcomOutBuffer); sprintf(&remcomOutBuffer[offset], "%s,%02x;", io_reg_defs[i].name, jtagBuffer[k++]); i++; j--; } delete [] jtagBuffer; jtagBuffer = 0; } } } } } } } break; } case 'P': // set the value of a single CPU register - return OK error(1); // error by default if (hexToInt(&ptr, ®no) && *ptr++ == '=') { uchar reg[4]; if (regno >= 0 && regno < NUMREGS) { hex2mem(ptr, reg, 1); if (theJtagICE->jtagWrite(regno+DATA_SPACE_ADDR_OFFSET, 1, reg)) ok(); break; } else if (regno == SREG) { hex2mem(ptr, reg, 1); if (theJtagICE->jtagWrite(0x5f+DATA_SPACE_ADDR_OFFSET, 1, reg)) ok(); } else if (regno == SP) { hex2mem(ptr, reg, 2); if (theJtagICE->jtagWrite(0x5d+DATA_SPACE_ADDR_OFFSET, 2, reg)) ok(); } else if (regno == PC) { hex2mem(ptr, reg, 4); if (theJtagICE->setProgramCounter(reg[0] | reg[1] << 8 | reg[2] << 16 | reg[3] << 24)) ok(); } } break; case 'G': // set the value of the CPU registers // It would appear that we don't need to support this as // we have 'P'. Report an error (rather than fail silently, // this will make errors in this comment more apparent...) error(1); break; case 's': // sAA..AA Step one instruction from AA..AA(optional) // try to read optional parameter, pc unchanged if no parm if (hexToInt(&ptr, &addr)) { if (!theJtagICE->setProgramCounter(addr)) gdbOut("Failed to set PC"); } repStatus(singleStep()); break; case 'C': { /* Continue with signal command format: "C;" or "S;" "" should always be 2 hex digits, possibly zero padded. ";" part is optional. If addr is given, resume at that address, otherwise, resume at current address. */ int sig; if (hexToInt(&ptr, &sig)) { if (sig == SIGHUP) { if (theJtagICE->resetProgram(false)) { reportStatusExtended(SIGTRAP); } } } break; } case 'c': // cAA..AA Continue from address AA..AA(optional) // try to read optional parameter, pc unchanged if no parm if (hexToInt(&ptr, &addr)) { if (!theJtagICE->setProgramCounter(addr)) gdbOut("Failed to set PC"); } repStatus(theJtagICE->jtagContinue()); break; case 'D': // Detach, resumes target. Can get control back with step // or continue if (theJtagICE->resumeProgram()) ok(); else error(1); break; case 'Z': adding = true; case 'z': error(1); // assume the worst. // Add a Breakpoint. note: length specifier is ignored for now. if (hexToInt(&ptr, &i) && *ptr++ == ',' && hexToInt(&ptr, &addr) && *ptr++ == ',' && hexToInt(&ptr, &length)) { bpType mode = NONE; switch(i) { case 0: case 1: mode = CODE; break; case 2: mode = WRITE_DATA; break; case 3: mode = READ_DATA; break; case 4: mode = ACCESS_DATA; break; default: debugOut("Unknown breakpoint type from GDB.\n"); delete theJtagICE; exit(1); } if (adding) { if (theJtagICE->addBreakpoint(addr, mode, length)) ok(); } else { if (theJtagICE->deleteBreakpoint(addr, mode, length)) ok(); } } break; } // switch last_cmd = cmd; // reply to the request if (!dontSendReply) { debugOut("->GDB: %s\n", remcomOutBuffer); putpacket(remcomOutBuffer); } } avarice-2.11.orig/src/remote.h0000644000000000000000000000301510245700616013127 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * Interface definition for the include/remote.c file. */ #ifndef INCLUDE_REMOTE_H #define INCLUDE_REMOTE_H /** File descriptor for gdb communication. -1 before connection. **/ extern int gdbFileDescriptor; /** Talk to gdb over file descriptor 'fd' **/ void setGdbFile(int fd); #define GDB_CAUSE "gdb communications failure" /** If status < 0: Report gdb communication error & exit **/ void gdbCheck(int status); /** Return single char read from gdb. Abort in case of problem, exit cleanly if EOF detected on gdbFileDescriptor. **/ int getDebugChar(void); /** printf 'fmt, ...' to gdb **/ void gdbOut(const char *fmt, ...); void vgdbOut(const char *fmt, va_list args); /** GDB remote protocol interpreter */ void talkToGdb(void); #endif /* INCLUDE_REMOTE_H */ avarice-2.11.orig/src/utils.cc0000644000000000000000000000423010340165340013125 0ustar /* * avarice - The "avarice" program. * Copyright (C) 2001 Scott Finneran * Copyright (C) 2002 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * */ #include #include #include #include #include #include "avarice.h" #include "remote.h" bool debugMode = false; void vdebugOut(const char *fmt, va_list args) { if (debugMode) { (void)vfprintf(stderr, fmt, args); } } void debugOut(const char *fmt, ...) { va_list args; va_start(args, fmt); vdebugOut(fmt, args); va_end(args); } void vstatusOut(const char *fmt, va_list args) { vprintf(fmt, args); } void statusOut(const char *fmt, ...) { va_list args; va_start(args, fmt); vstatusOut(fmt, args); va_end(args); } void statusFlush() { fflush(stdout); } static void check_1(bool printUnixError, const char *fmt, va_list args) { int en = errno; #ifdef va_copy va_list copy_args; va_copy(copy_args, args); vstatusOut(fmt, copy_args); #else vstatusOut(fmt, args); #endif if (printUnixError) statusOut(": %s", strerror(en)); statusOut("\n"); vgdbOut(fmt, args); if (printUnixError) gdbOut(": %s", strerror(en)); gdbOut("\n"); exit(EXIT_FAILURE); } void check(bool ok, const char *fmt, ...) { va_list args; va_start(args, fmt); if (!ok) check_1(false, fmt, args); va_end(args); } void unixCheck(int status, const char *fmt, ...) { va_list args; va_start(args, fmt); if (status < 0) check_1(true, fmt, args); va_end(args); } avarice-2.11.orig/src/gnu_getopt.c0000644000000000000000000007306411627162536014025 0ustar /* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. NOTE: This source is derived from an old version taken from the GNU C Library (glibc). This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO # define _NO_PROTO #endif #ifdef HAVE_CONFIG_H # include #endif #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ # ifndef const # define const # endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 # include # if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION # define ELIDE_CODE # endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ # include # include #endif /* GNU C library. */ #ifdef VMS # include # if HAVE_STRING_H - 0 # include # endif #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ # ifdef HAVE_LIBINTL_H # include # define _(msgid) gettext (msgid) # else # define _(msgid) (msgid) # endif #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "gnu_getopt.h" #include "pragma.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ # include # define my_index strchr #else # if HAVE_STRING_H # include # else # if HAVE_STRINGS_H # include # endif # endif /* Avoid depending on library functions or files whose names are inconsistent. */ #ifndef getenv extern char *getenv (); #endif static char * my_index (str, chr) const char *str; int chr; { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ # if (!defined __STDC__ || !__STDC__) && !defined strlen /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); # endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; static int original_argc; static char *const *original_argv; /* Make sure the environment variable bash 2.0 puts in the environment is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ original_argc = argc; original_argv = argv; } # ifdef text_set_element text_set_element (__libc_subinit, store_args_and_env); # endif /* text_set_element */ # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined __STDC__ && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #ifdef _LIBC /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len), '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ PRAGMA_DIAG_PUSH PRAGMA_DIAG_IGNORED("-Wunused-parameter") #if defined __STDC__ && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #ifdef _LIBC if (posixly_correct == NULL && argc == original_argc && argv == original_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', nonoption_flags_max_len - len); } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } PRAGMA_DIAG_POP /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #ifdef _LIBC # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) { if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, _("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else /* +option or -option */ fprintf (stderr, _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (opterr) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (opterr) { if (posixly_correct) /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ avarice-2.11.orig/src/gnu_getopt.h0000644000000000000000000001267110245700616014017 0ustar /* Declarations for getopt. Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _GNU_GETOPT_H #define _GNU_GETOPT_H 1 #ifndef __GETOPT_LONG_H__ #define __GETOPT_LONG_H__ 1 /* We only use getopt_long(), not getopt(), so we don't need a fully prototyped declaration of getopt(). This forces the prototype for getopt() to be compatible with all systems. Solaris in particular seems to have a prototype for getopt() in unistd.h which conflicts with the one in this file if we don't do this. */ #undef HAVE_DECL_GETOPT #define HAVE_DECL_GETOPT 1 #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { #if defined (__STDC__) && __STDC__ const char *name; #else char *name; #endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 #if defined (__STDC__) && __STDC__ /* HAVE_DECL_* is a three-state macro: undefined, 0 or 1. If it is undefined, we haven't run the autoconf check so provide the declaration without arguments. If it is 0, we checked and failed to find the declaration so provide a fully prototyped one. If it is 1, we found it so don't provide any declaration at all. */ #if defined (__GNU_LIBRARY__) || (defined (HAVE_DECL_GETOPT) && !HAVE_DECL_GETOPT) /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int argc, char *const *argv, const char *shortopts); #else /* not __GNU_LIBRARY__ */ # if !defined (HAVE_DECL_GETOPT) extern int getopt (); # endif #endif /* __GNU_LIBRARY__ */ extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); extern int getopt_long_only (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind, int long_only); #else /* not __STDC__ */ extern int getopt (); extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); #endif /* __STDC__ */ #ifdef __cplusplus } #endif #endif /* __GETOPT_LONG_H__ */ #endif /* gnu_getopt.h */ avarice-2.11.orig/src/gnu_getopt1.c0000644000000000000000000001067710245700616014077 0ustar /* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,99,2000,01,02,03 Free Software Foundation, Inc. NOTE: This source is derived from an old version taken from the GNU C Library (glibc). This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include #endif #include "gnu_getopt.h" #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } #endif /* Not ELIDE_CODE. */ #ifdef TEST #include int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ avarice-2.11.orig/doc/0000755000000000000000000000000011666502524011450 5ustar avarice-2.11.orig/doc/Makefile.am0000644000000000000000000000206110245700616013475 0ustar # # avarice - The "avarice" program. # Copyright (C) 2001 Scott Finneran # Copyright (C) 2002, 2003 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. # # AUTOMAKE_OPTIONS = foreign man_MANS = ice-gdb.1 \ ice-insight.1 \ avarice.1 EXTRA_DIST = $(man_MANS) \ README.cygwin \ avrIceProtocol.txt \ running.txt \ todo.txt avarice-2.11.orig/doc/Makefile.in0000644000000000000000000003203011627170734013514 0ustar # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/autoconf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pathperl = @pathperl@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # # avarice - The "avarice" program. # Copyright (C) 2001 Scott Finneran # Copyright (C) 2002, 2003 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. # # AUTOMAKE_OPTIONS = foreign man_MANS = ice-gdb.1 \ ice-insight.1 \ avarice.1 EXTRA_DIST = $(man_MANS) \ README.cygwin \ avrIceProtocol.txt \ running.txt \ todo.txt all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-man uninstall-man1 # 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: avarice-2.11.orig/doc/ice-gdb.10000644000000000000000000000654610245700616013031 0ustar .TH ice-gdb 1 "August 22, 2003" .LO 1 .SH NAME ice-gdb \- JTAG ICE frontend for avr-gdb .br ice-insight \- JTAG ICE frontend for avr-insight .SH SYNOPSIS .B ice-gdb/ice-insight .RB [ --debugger .IR debugger ] .RB [ --capture ] .RB [ --ignore-intr ] .RB [ --external ] .RI [ gdb_arguments ] .SH DESCRIPTION .B ice-gdb (respectively .BR ice-insight ) starts .B avr-gdb (respectively .BR avr-insight ) and .B avarice to do on-chip debugging on Atmel AVR processors using their JTAG-based on-chip debug facilities, via the Atmel JTAG ICE pod. The executable for the program being debugged is downloaded to the processor unless the .B --capture option is specified. A number of extra commands are available within gdb when started, see their description in NEW GDB COMMANDS below. Restrictions on debugging with the JTAG ICE pod are discussed in more detail in DEBUGGING WITH JTAG ICE below. The arguments passed to .B avarice include the value of the .B AVARICE_ARGS environment variable. This is typically used to specify the serial port to which the JTAG ICE pod is connected by setting .B AVARICE_ARGS to "-j ". .SH OPTIONS .TP .B --debugger debugger_command Specify a different debugger than avr-gdb (or avr-insight). This other debugger should behave similarly to gdb. .TP .B --capture Don't download the executable being debugged to the mote, just interrupt the current program and assume that it matches the executable passed to .BR ice-gdb . This is similar to "attaching" to a running program within gdb. .TP .B --ignore-intr Pass the .B --ignore-intr option to .BR avarice . The single-step commands in gdb (s, n) will then "step over" interrupt handlers (i.e., if an interrupt occurs, execution will resume for the duration of the interrupt). .TP .B --external Do not start .BR avarice . Instead, .B avr-gdb will attempt to connect to an already running .B avarice on port localhost:6423. .SH NEW GDB COMMANDS .TP .B ice-restart Restart avarice. .TP .B ice-load filename Download executable filename to the Atmel processor and start debugging it (this replaces the gdb .B load command). .TP .B target-ice Connect to a copy of .B avarice running on port localhost:6423. .SH DEBUGGING WITH JTAG ICE The JTAG ICE debugging environment has a few restrictions and changes: .IP \(bu 4 No "soft" breakpoints, and only three hardware breakpoints. The break command sets hardware breakpoints. The easiest way to deal with this restriction is to enable and disable breakpoints as needed. .IP \(bu Two 1-byte hardware watchpoints (but each hardware watchpoint takes away one hardware breakpoint). If you set a watchpoint on a variable which takes more than one byte, execution will be abysmally slow. Instead it is better to do the following: .RS 6 watch *(char *)&myvariable .RE .IP which watches the least significant byte of .BR myvariable . .IP \(bu The Atmel AVR processors have a Harvard architecture (separate code and data buses). To distinguish data address 0 from code address 0, .B avr-gdb adds 0x800000 to all data addresses. Bear this in mind when examining printed pointers, or when passing absolute addresses to gdb commands. .SH ENVIRONMENT .TP .B AVARICE_ARGS Extra arguments to pass to .B avarice at startup. .SH SEE ALSO gdb(1), insight(1). .SH BUGS On Windows, the .B ice-gdb and .B ice-insight commands only work in the .B cygwin environment. They do not work with the .B mingw environment. avarice-2.11.orig/doc/ice-insight.10000644000000000000000000000002310245700616013722 0ustar .so man1/ice-gdb.1 avarice-2.11.orig/doc/avarice.10000644000000000000000000003101311070240004013117 0ustar .ig Copyright (C) 2001 Scott Finneran Copyright (C) 2003 Intel Corporation Copyright (C) 2003, 2004 Theodore A. Roth Copyright (C) 2005 - 2008 Joerg Wunsch Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English. $Id: avarice.1,v 1.21 2008/09/29 20:52:20 joerg_wunsch Exp $ .. .TH avarice 1 "September 29, 2008" .LO 1 .SH NAME avarice \- Provides an interface from avr-gdb to Atmel's JTAGICE box. .SH SYNOPSIS .B avarice [\fIOPTIONS\fR]... [[\fIHOST_NAME\fR]:\fIPORT\fR] .SH DESCRIPTION .PP AVaRICE runs on a POSIX machine and connects to gdb via a TCP socket and communicates via gdb's "serial debug protocol". This protocol allows gdb to send commands like "set/remove breakpoint" and "read/write memory". .PP AVaRICE translates these commands into the Atmel protocol used to control the AVR JTAG ICE. Connection to the AVR JTAG ICE is via a serial port on the POSIX machine. .PP Because the GDB <---> AVaRICE connection is via a TCP socket, the two programs do not need to run on the same machine. In an office environment, this allows a developer to debug a target in the lab from the comfort of their cube (or even better, their home!) .HP 6 .B NOTE: Even though you can run \fBavarice\fR and \fBavr\-gdb\fR on different systems, it is not recommended because of the security risk involved. \fBavarice\fR was not designed to be a secure server. There is no authentication performed when a client connects to \fBavarice\fR when it is running in gdb server mode. .SS Supported Devices .B avarice currently has support for the following devices: .RS 4 at90can128 .br at90can32 (\fBo\fP) .br at90can64 (\fBo\fP) .br at90pwm2 (\fBo\fP) (\fB+\fP) .br at90pwm216 (\fBo\fP) (\fB+\fP) .br at90pwm2b (\fBo\fP) (\fB+\fP) .br at90pwm3 (\fBo\fP) (\fB+\fP) .br at90pwm316 (\fBo\fP) (\fB+\fP) .br at90pwm3b (\fBo\fP) (\fB+\fP) .br at90usb1287 (\fB*\fP) .br at90usb162 (\fBo\fP) (\fB+\fP) .br at90usb646 (\fB*\fP) .br at90usb647 (\fB*\fP) .br atmega128 .br atmega1280 (\fB*\fP) .br atmega1281 (\fB*\fP) .br atmega1284p (\fB*\fP) .br atmega16 .br atmega162 .br atmega164p (\fBo\fP) .br atmega165 (\fBo\fP) .br atmega165p (\fBo\fP) .br atmega168 (\fBo\fP) (\fB+\fP) .br atmega168p (\fBo\fP) (\fB+\fP) .br atmega169 .br atmega16hva (\fBo\fP) .br atmega2560 (\fB*\fP) .br atmega2561 (\fB*\fP) .br atmega32 .br atmega323 .br atmega324p (\fBo\fP) .br atmega325 (\fBo\fP) .br atmega3250 (\fBo\fP) .br atmega3250p (\fBo\fP) .br atmega325p (\fBo\fP) .br atmega328p (\fBo\fP) (\fB+\fP) .br atmega329 (\fBo\fP) .br atmega3290 (\fBo\fP) .br atmega3290p (\fBo\fP) .br atmega329p (\fBo\fP) .br atmega32c1 (\fBo\fP) (\fB+\fP) .br atmega32hvb (\fBo\fP) (\fB+\fP) .br atmega32m1 (\fBo\fP) (\fB+\fP) .br atmega32u4 (\fBo\fP) .br atmega406 (\fB*\fP) .br atmega48 (\fBo\fP) (\fB+\fP) .br atmega48p (\fBo\fP) (\fB+\fP) .br atmega64 .br atmega640 (\fB*\fP) .br atmega644 (\fB*\fP) .br atmega644p (\fB*\fP) .br atmega645 (\fB*\fP) .br atmega6450 (\fB*\fP) .br atmega649 (\fB*\fP) .br atmega6490 (\fB*\fP) .br atmega88 (\fBo\fP) (\fB+\fP) .br atmega88p (\fBo\fP) (\fB+\fP) .br attiny13 (\fBo\fP) (\fB+\fP) .br attiny167 (\fBo\fP) (\fB+\fP) .br attiny2313 (\fBo\fP) (\fB+\fP) .br attiny24 (\fBo\fP) (\fB+\fP) .br attiny25 (\fBo\fP) (\fB+\fP) .br attiny261 (\fBo\fP) (\fB+\fP) .br attiny43u (\fBo\fP) (\fB+\fP) .br attiny44 (\fBo\fP) (\fB+\fP) .br attiny45 (\fBo\fP) (\fB+\fP) .br attiny461 (\fBo\fP) (\fB+\fP) .br attiny48 (\fBo\fP) (\fB+\fP) .br attiny84 (\fBo\fP) (\fB+\fP) .br attiny85 (\fBo\fP) (\fB+\fP) .br attiny861 (\fBo\fP) (\fB+\fP) .br attiny88 (\fBo\fP) (\fB+\fP) .br atxmega128a1 (\fB*\fP) .RE .PP \fB*\fP \- Only supported by the JTAG ICE mkII device. .br \fBo\fP \- Only supported by the JTAG ICE mkII and AVR Dragon device. .br \fB+\fP \- debugWire, see below .SS Supported File Formats .B avarice uses libbfd for reading input files. As such, it can handle any file format that libbfd knowns about. This includes the Intel Hex, Motorola SRecord and ELF formats, among others. If you tell \fBavarice\fR to read an ELF file, it will automatically handle programming all of the sections contained in the file (e.g. flash, eeprom, etc.). .SH OPTIONS .TP .BR \-h ,\ \-\-help Print this message. .TP .BR \-1 ,\ \-\-mkI Connect to JTAG ICE mkI (default). .TP .BR \-2 ,\ \-\-mkII Connect to JTAG ICE mkII. .TP .BR \-B ,\ \-\-jtag-bitrate \ Set the bitrate that the JTAG box communicates with the AVR target device. This must be less than 1/4 of the frequency of the target. Valid values are 1 MHz, 500 kHz, 250 kHz or 125 kHz for the JTAG ICE mkI, anything between 22 kHz through approximately 6400 kHz for the JTAG ICE mkII. (default: 250 kHz) .TP .BR \-C ,\ \-\-capture Capture running program. .br Note: debugging must have been enabled prior to starting the program. (e.g., by running avarice earlier) .TP .BR \-c ,\ \-\-daisy-chain \ Setup JTAG daisy-chain information. .br Four comma-separated parameters need to be provided, corresponding to \fIunits before\fP, \fIunits after\fP, \fIbits before\fP, and \fIbits after\fP. .TP .BR \-D ,\ \-\-detach Detach once synced with JTAG ICE .TP .BR \-d ,\ \-\-debug Enable printing of debug information. .TP .BR \-e ,\ \-\-erase Erase target. Not possible in debugWire mode. .TP .BR \-E ,\ \-\-event\ List of events that do not interrupt. JTAG ICE mkII and AVR Dragon only. Default is "none,run,target_power_on,target_sleep,target_wakeup" .TP .BR \-f ,\ \-\-file \ Specify a file for use with the --program and --verify options. If --file is passed and neither --program or --verify are given then --program is implied. .TP .BR \-g ,\ \-\-dragon Connect to an AVR Dragon. This option implies the \fB-2\fP option. .TP .BR \-I ,\ \-\-ignore-intr Automatically step over interrupts. .br Note: EXPERIMENTAL. Can not currently handle devices fused for compatibility. .TP .BR \-j ,\ \-\-jtag \ Port attached to JTAG box (default: /dev/avrjtag). If the JTAG_DEV environmental variable is set, avarice will use that as the default instead. .br If \fBavarice\fR has been configured with libusb support, the JTAG ICE mkII can be connected through USB. In that case, the string \fIusb\fR is used as the name of the device. If there are multiple JTAG ICE mkII devices connected to the system through USB, this string may be followed by the (trailing part of the) ICE's serial number, delimited from the \fIusb\fR by a colon. .br The AVR Dragon can only be connected through USB, so this option defaults to "usb" in that case. .TP .BR \-k ,\ \-\-known-devices Print a list of known devices. .TP .BR \-L ,\ \-\-write-lockbits \ Write lock bits. The lock byte data must be given in two digit hexidecimal format with zero padding if needed. .TP .BR \-l ,\ \-\-read-lockbits Read the lock bits from the target. The individual bits are also displayed with names. .TP .BR \-P ,\ \-\-part \ Target device name (e.g. atmega16) .TP .BR \-p ,\ \-\-program Program the target. Binary filename must be specified with --file option. .br .B NOTE: The old behaviour of automatically erasing the target before programming is no longer done. You must explicitly give the --erase option for the target to be erased. .TP .BR \-R ,\ \-\-reset-srst Apply nSRST signal (external reset) when connecting. This can override applications that set the JTD bit. .TP .BR \-r ,\ \-\-read-fuses Read fuses bytes. .TP .BR \-V ,\ \-\-version Print version information. .TP .BR \-v ,\ \-\-verify Verify program in device against file specified with --file option. .TP .BR \-w ,\ \-\-debugwire Connect to JTAG ICE mkII (or AVR Dragon), talking debugWire protocol to the target. This option implies the \fB-2\fP option. See the DEBUGWIRE section below. .TP .BR \-W ,\ \-\-write-fuses \ Write fuses bytes. \fBee\fR is the extended fuse byte, \fBhh\fR is the high fuse byte and \fBll\fR is the low fuse byte. The fuse byte data must be given in two digit hexidecimal format with zero padding if needed. All three bytes must currently be given. .TP .BR \-x ,\ \-\-xmega The target device is an ATxmega part. Since the ATxmega uses a different JTAG communication than other AVRs, the normal device autodetection based on the JTAG ID does not work. If the device has been explicitly selected through the \-P option, it is not necessary to also specify the \-x option. .br .B NOTE: Current, if the target device doesn't have an extended fuse byte (e.g. the atmega16), the you should set ee==ll when writing the fuse bytes. .PP \fIHOST_NAME\fR defaults to 0.0.0.0 (listen on any interface) if not given. .PP :\fIPORT\fR is required to put avarice into gdb server mode. .SH EXAMPLE USAGE avarice --erase --program --file test.bin --jtag /dev/ttyS0 :4242 .PP Program the file \fItest.bin\fR into the JTAG ICE (mkI) connected to /dev/ttyS0 after erasing the device, then listen in GDB mode on the local port 4242. .PP avarice --jtag usb:1234 --mkII :4242 .PP Connect to the JTAG ICE mkII attached to USB which serial number ends in \fI1234\fR, and listen in GDB mode on local port 4242. .SH DEBUGGING WITH AVARICE The JTAG ICE debugging environment has a few restrictions and changes: .IP \(bu 4 No "soft" breakpoints, and only three hardware breakpoints. The break command sets hardware breakpoints. The easiest way to deal with this restriction is to enable and disable breakpoints as needed. .IP \(bu Two 1-byte hardware watchpoints (but each hardware watchpoint takes away one hardware breakpoint). If you set a watchpoint on a variable which takes more than one byte, execution will be abysmally slow. Instead it is better to do the following: .IP .RS 6 watch *(char *)&myvariable .RE .IP which watches the least significant byte of .BR myvariable . .IP \(bu The Atmel AVR processors have a Harvard architecture (separate code and data buses). To distinguish data address 0 from code address 0, .B avr-gdb adds 0x800000 to all data addresses. Bear this in mind when examining printed pointers, or when passing absolute addresses to gdb commands. .SH DEBUGWIRE The \fIdebugWire\fP protocol is a proprietary protocol introduced by Atmel to allow debugging small AVR controllers that don't offer enough pins (and enough chip resources) to implement full JTAG. The communication takes place over the \fI/RESET\fP pin which needs to be turned into a debugWire connection pin by programming the \fIDWEN\fP fuse (debugWire enable), using a normal programmer connection (in-system programming, high-voltage programming). Note that by enabling this fuse, the standard reset functionality of that pin will be lost, so any in-system programming will cease to work as it requires a functional \fI/RESET\fP pin. Thus it should be made \fBabsolutely sure there is a way back\fP, like a device (as the STK500, for example) that can handle high-voltage programming of the AVR. Currently, \fBavarice\fP offers no option to turn off the DWEN fuse. However, \fBavrdude\fP offers the option to turn it off either through high-voltage programming, or by using the JTAG ICE mkII to first turn the target into an ISP-compatible mode, and then using normal ISP commands to change the fuse settings. .br Note that the debugWire environment is further limited, compared to JTAG. It does not offer hardware breakpoints, so all breakpoints have to be implemented as software breakpoints by rewriting flash pages using \fIBREAK\fP instructions. (Software breakpoints are currently not implemented by \fBavarice\fP.) Some memory spaces (fuse and lock bits) are not accessible through the debugWire protocol. .SH SEE ALSO .BR gdb (1), .BR avrdude (1), .BR avr\-gdb (1), .BR insight (1), .BR avr\-insight (1), .BR ice\-gdb (1), .BR ice\-insight (1) .SH AUTHORS Avarice (up to version 1.5) was originally written by Scott Finneran with help from Peter Jansen. They did the work of figuring out the jtagice communication protocol before Atmel released the spec (appnote AVR060). .PP David Gay made major improvements bringing avarice up to 2.0. .PP Joerg Wunsch reworked the code to abstract the JTAG ICE communication from the remainder, and then extended the code to support the JTAG ICE mkII protocol (see Atmel appnote AVR067). avarice-2.11.orig/doc/README.cygwin0000644000000000000000000000427110245700616013625 0ustar ## ## $Id: README.cygwin,v 1.1 2003/09/26 06:16:12 troth Exp $ ## ## Contributed by Eric Weddington. ## To build avarice for Windows requires the use of Cygwin Specifically, this was built using the Previous package of Cygwin. In the Cygwin installer, select the Prev radio button up top when installing the packages. This should install cygwin 1.3.22-1, from the Base tree in the Cygwin setup. Get avarice from anonymous CVS as explained on the avarice project web page. Then, in the avarice project directory: $ export $PREFIX= $ ./Bootstrap $ mkdir build $ cd build $ ../configure --prefix=$PREFIX $ make $ make install If there are errors like: "undefined reference to `_htab_create_alloc'" then re-install binutils (and not GCC) from Cygwin and re-run! This error means that the libiberty functions that are needed in avarice need to come from a binutils version of libiberty and not from a GCC version of libiberty. This will create avarice.exe, which requires the following DLLs to execute: - cygwin1.dll - cygintl-2.dll - cygiconv-2.dll In Cygwin, you can check to see what, if any, DLLs are required of an executable by using the program cygcheck.exe that comes with Cygwin. For example if you cd to the $PREFIX/bin directory after building the project, and execute $ cygcheck ./avarice.exe You should get something like (depending on your OS and it's installation location): .\avarice.exe .\cygwin1.dll C:\WINNT\System32\KERNEL32.dll C:\WINNT\System32\NTDLL.DLL .\cygintl-2.dll .\cygiconv-2.dll If you want to build avarice with less DLL dependencies, then, in the avarice project directory: $ export $PREFIX= $ ./Bootstrap $ mkdir build $ cd build $ ../configure --prefix=$PREFIX $ make LDFLAGS='-static' LIBS='-lbfd -liberty -lintl -liconv' $ make install When you build avarice this way, you can verify what DLLs are required with cygcheck in the $PREFIX/bin directory: $ cygcheck ./avarice.exe .\avarice.exe .\cygwin1.dll C:\WINNT\System32\KERNEL32.dll C:\WINNT\System32\NTDLL.DLL avarice-2.11.orig/doc/avrIceProtocol.txt0000644000000000000000000002652410245700616015147 0ustar /* * avrjtag - The "avrjtag" program. * Copyright (C) 2001 Scott Finneran & Peter Jansen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * This file contains the AVR JTAG ICE protocol documentation. */ AVR JTAG-ICE serial protocol commands Background: This document outlines the results of a reverse engineering effort of the protocol which exists between AVRStudio and the AVR JTAG-Ice. Something to note is that the protocol supports dynamic bitrate changes. AVRStudio does indeed change the bitrate "mid-stream". Specifically, it seems to speed it up to 115200bps just prior to downloading (and possibly uploading) blocks of date to the JTAG-Ice. After the download, the bitrate is restored to 19200bps. This can make Analysing the protocol somewhat painful using a serial line sniffer. Something that the document does lack is detail on the "state" or procedural aspect of the protocol. ie "This command must be proceeded by blah blah...." Most commands are of the format [operands....]. An assumption was made that the letters actually mean something (ie W for write, R for read). *************************************************************** Hints for those wishing to help with understanding the protocol: The thing that made understanding the protocol difficult, is that it switches bitrates when writing to memory. As such, a traditional protocol analyser or line monitor (which connects to the serial line itself) will lose sync when this happens!. One work-around for this is to use a program like HHD Serial Monitor (http://www.hhdsoftware.com). Rather than involve serial hardware, this program captures the MS-Windows serial driver requests. As such, you can see the data sent and received, without worrying about bitrate changes (although you can see driver config requests also, so you know when it happens). *************************************************************** Formatting: All commands from the Host end in a Space, Space (shown below as '__') All commands from the JTAG box start with a 'A' and end in a 'A', except when writing to memory, a 'A''A' is sent only after the data is written. Things in [] are hex characters. eg [42] [FA] Underscores '_' indicate a space. Actual spaces in the text below are for the purposes of formatting only. Serial port works at 19200, N 8 1 (until the bitrate change command is issued) **************************************************************** This command is either sync (ie serial line sync) or status or something. The first command also appears to have a few spaces sent down first. Haven't quite worked it out yet. S__ : Sync A AVRNOCD A - the reply **************************************************************** Query: These commands start with a ASCII 'q' (ie [71]) qz__ : query HW version A [c0] A - the reply q [7B] __ : query SW version A [66] A q [84] __ : query supply voltage A [xx] A - the reply voltage = xx/41 q [A7] __ : ???? A [3f] A q [A8] __ : ???? A [20] A q [A9] __ : ???? A [70] A q [AA] __ : ???? A [29] A **************************************************************** Appears to somehow configure the JTAG box. The data probably changes for different processors. [A0] [.(123 bytes).....] __ : ???? A A **************************************************************** [A3] __ : Enable program mode. A A **************************************************************** [A4] __ : Disable program mode. A A **************************************************************** [A5] __ : Erase program memory. Program mode must be enabled. A A **************************************************************** R [cc] [x][x][y][y] __ : Read memory where cc is command [B2] - Fuse Bits [B3] - Lock Bits [B4] - Signature Bits [A0] - Program memory if Prog Mode enabled (read words) [B0] - Program memory if Prog Mode disabled (read words) [20] - Data Memory [22] - EEPROM x x is the number of locations - 1 (little endian) *1 *2 y y is the start address (big endian) A [....(data)....] [00] A *1 For data memory, the data returned is a series of bytes (endian-ness does not apply). For prog memory, the data returned is a 16-bit big endian. *1 note: For program memory each location is 16 bits. As such, it will return N words, rather than bytes. These words are little endian. For data space, locations are 8 bits wide, so N bytes are returned. *2 AVRStudio only requests 0xff bytes at a time. The reliability of the system to respond to larger numbers is unknown. **************************************************************** W [cc] [x][x][y][y] __ : Write memory where cc is command [A0] - Program memory if Prog Mode enabled (write words) [B0] - Program memory if Prog Mode disabled (write words) [B2] - Fuse Bits [B3] - Lock Bits [B4] - Signature Bits [20] - Data memory (write bytes) [22] - EEPROM [60] - first program break point at location y y this needs the data [01] for the following h command x x is the numer of locations - 1 (little endian) y y is the start address (big endian) The reply to this command is a single A Then the Host sends h [....(data)....] __ which is the data The reply is A A (success) or E E (failure). ONLY IN THE CASE OF PROG SPACE WRITE: The data is written into the flash when the flash programming buffer (2048 bits/256 bytes/128 words) is filled. As such, in the event of a prog space page being smaller than an entire page (ie < 0x7F words), AVRStudio sends down a single write to the last location in the page. notes: - For program memory each location is 16 bits. As such, N words (rather than bytes) need to be sent. These words are little endian. - The object files output from both AVRStudio & GCC are already word-wise little endian. **************************************************************** 3 [x][x][x] __ : set PC A A : where xxx is the new value for the PC. **************************************************************** 2 __ : get next PC A [x][x][x] A : where xxx is the next location to execute (?) NOTE: APPEARS TO BE INVALID WHEN THE LAST INSTRUCTION WAS A BRANCH. **************************************************************** 1 __ : single step command A A **************************************************************** G __ : go command The JTAG box replies immediately with a single A If breakpoints have been configured, and a breakpoint "hits", the JTAG box will send B [00] [BP] [BP] - which breakpoint was "hit" (refer breakpoint below). [04] - Breakpoint X [08] - Breakpoint Y [10] - Breakpoint Z **************************************************************** F __ : finish (halt) A [00][PCL][PCH] A [PCL] - PC Low byte [PCH] - PC High byte **************************************************************** x __ : ??? A A **************************************************************** "Box Config" commands These appear to be set actions performed on various configuration registers withing the box itself. The generic command appears to be: B [rn] [val] __ : Box Config where rn is the register number, val is the value written. [FD] - ??? [FF] - ??? [FA] - ??? [00] - ??? [62] set bit rate. val = (FA: 19200, FF: 115200) [86] set JTAG port bitrate (AVRStudio calls this the debug freq.) val = (FA: 100kHz, F3: 50kHz, FD: 200kHz) [81] [00] Written after modifying the PC. [A1] set break on branch/skip (will run until the next branch/skip instruction) [A2] val = Breakpoint X Address -High [A3] val = Breakpoint X Address -Low [A4] val = Breakpoint Y Address -High [A5] val = Breakpoint Y Address -Low [A6] val = BP mode (see Breakpoints below) [88] val = ?? (related to config bits. refer below). [89] val = ?? (related to config bits. refer below). [8A] val = ?? (related to config bits. refer below). Programming Mode. The following sequence (according to AVRStudio), prepares the chip for JTAG programming. It appears to only happen once per session (when programming mode is enabled). Send: [42] [88] [00] [20] [20] Reply: [41] [41] Send: [42] [89] [01] [20] [20] Reply: [41] [41] Send: [42] [8A] [08] [20] [20] Reply: [41] [41] Chip Config (Fuse, Signature and Lock) Bits: These are access using the normal read & write commands using "special" address space identifiers.Fuse Bits: Fuse bits are written/read by accessing address zero of the [B2] address space. Signature Bits: Signature bits are written/read by accessing address zero of the [B4] address space. Lock Bits: Lock bits are written/read by accessing address zero of the [B3] address space. Breakpoints: note: AVRStudio's first breakpoint is set by writing a 1 to the desired break address using address space 60 (refer Write command). I believe a corresponding write of zero will clear this breakpoint.This is a code space breakpoint only. Where BP mode is a bitmask formatted thusly (don't you think the word thusly doesn't get used enough in doco?): ------------------------------------------------- | | | | | | | | 0 | Mask| BP Active | BP Mode | BP Mode | | | Mode| | | (BP X) | (BP Y) | ------------------------------------------------- Mask Mode: [0] = X & Y are seperate Breakpoints (non-masked mode). [1] = X is masked with Y to create a single range of breakpoint addresses. BP Active: [00] = No breakpoints enabled [01] = Masked Mode (must be set to this value if Mask Mode = 1). [10] = 1 Breakpoint (Breakpoint X active only) [11] = 2 Breakpoints (Breakpoints X & Y active) BP Mode: [00] = Data Space Read [01] = Data Space Write [10] = Data Space Read/Write (ie Data Access) [11] = Program Space Read Examples: [2C] - Single program BP at [x][x] [3F] - two break points at [x][x] and [y][y] [28] - single data R/W BP at [x][x] [20] - single data R BP at [x][x] [24] - single data W BP at [x][x] [34] - two data BP's one R at [x][x] and one W at [y][y] [35] - two data BP's one R at [x][x] and one R at [y][y] [53] - Masked program read BP at [x][x] mask [y][y] [50] - Masked data read BP at [x][x] mask [y][y] [51] - masked data write BP at [x][x] mask [y][y] [52] - masked data RW BP at [x][x] mask [y][y] The reply is A A avarice-2.11.orig/doc/running.txt0000644000000000000000000001230310245700616013662 0ustar # # avarice - The "avarice" program. # Copyright (C) 2001, 2003 Scott Finneran # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. # # doc/running.txt # NOTE: This file is _really_ old and hasn't been kept up to date. Start avarice with the --help option to get the current list of options. Using AVaRICE: -------------- > bin/avarice avrjtagd version 1.0.D084, Nov 12 2001 14:47:08 Usage: bl/bin/avarice [OPTION]... Options: -d, --debug Enable printing of debug information -f, --file Download specified file prior to debugging -j, --jtag Port attached to JTAG box (default: /dev/avrjtag) Required info: : This is the name of the machine attached to the JTAG box. : This is a unique spare IP port number on that machine. e.g. bl/bin/avarice --file test.bin --jtag /dev/ttyS0 localhost 4242 Hints/notes: - The default jtag port is /dev/avrjtag. Rather than enter a serial port every time, why not add a symlink. eg. ln -s /dev/ttyS0 /dev/avrjtag - VERY IMPORTANT: the file specified on the avarice command line needs to be a BINARY FILE (ie not the elf object file loaded into gdb). This can be easily created from the elf file using avr-objcopy. Up and Running with avr-gdb: ---------------------------- 1. Apply the standard avr patch to avr-gdb and compile away! I used the standard distro of gdb (http://sources.redhat.com/gdb/) and patched it with: (http://www.amelek.gda.pl/avr/gdb/gdb-5.0-avr-patch-0.1.gz) note: This patch has a minor problem which breaks the "info registers" command. To fix this, edit gdb/config/avr/tm-avr.h:314 to read: #undef GET_SAVED_REGISTER note: Ted Roth (troth@verinet.com) has identified a LARGE number of problems with the above patch to gdb. He is currently working on a series of fixes. Snapshots of his latest work can be found at: (http://freesoftware.fsf.org/download/simulavr/gdb-patches/) I would recommend using these over the original patches for now. Feedback would be helpful or better still, lend Ted a hand! 2. Once installed, run avr-gdb and load in your final avr-elf file. The simplest way is of course: avr-gdb target.elf note: Step 3 really is not needed with my latest patches. Also, don't count on .avrgdbinit being around in the future due to changes in gdb's design for 5.2. Just use .gdbinit in the working directory, not ~/.gdbinit or ~/.avrgddinit. TRoth 14 Feb 2002 3. AVR-GDB will need the following config items set (ie enter the following cmds): set remoteaddresssize 32 set remote Z-packet enable There are a few ways to do this: - Enter them manually when you start avr-gdb - Dump these commands into a text file and run avr-gdb with the -x option. - Dump these commands into ~/.gdbinit. Note: chances are that your hosts' version of gdb also uses the same filename for its config. Probably best not to get the two confused. That said, thanks to Ted Roth for suggesting the following: In the sources for GDB, add the following 2 lines to gdb/config/avr/tm-avr.h /* Rename .gdbinit to aid in debugging. */ #define GDBINIT_FILENAME ".avrgdbinit" This gives avr-gdb a unique config filename. He has also submitted an example .avrgdbinit file: echo loading demo.elf\n file demo.elf echo Setting remote addr size to 32\n set remoteaddresssize 32 echo Connecting to remote target\n target remote localhost:1212 echo Downloading program to target\n load Please note, at this time, avarice does not support GDB's load command. It is on the todo list. 4. Run avarice (refer above): 5. Enter the following command: target remote HOST:PORT e.g. target remote localhost:4242 The HOST:PORT need to match the values entered on the avarice command line for (refer above). 6. Something along these lines should greet you: GNU gdb 5.0 Copyright 2000 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i686-pc-linux-gnu --target=avr"... (gdb) target remote localhost:4242 Remote debugging using localhost:4242 0x0 in .__start_of_init__ () 7. The normal gdb "run" command doesn't seem to have that much meaning here (read the gdb doco with reference to the remote debug protocol). As such, use the "continue" command to kick off your program. avarice-2.11.orig/doc/todo.txt0000644000000000000000000000321210245700616013146 0ustar # # avarice - The "avarice" program. # Copyright (C) 2001, 2003 Scott Finneran # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. # # doc/todo.txt # Please feel free to lend a helping hand: If you do like to dabble: - Porting to other platforms. - Add support for watches (ie data space breakpoints). - Need to add io register definitions for the following devices (this is pretty easy, mindless work, just tedious): mega162 mega169 mega323 mega32 mega64 mega128 - Write a user's manual or some sort of documentation. - Many many other things! If coding or porting isn't your thing, you can still help in a big way.... Protocol: Atmel have chosen not to publish an official document on the protocol. Any mark-ups to doc/avrIceProtocol.txt would be invaluable! [Atmel has now published the protocol in appnote AVR060. It's a rather confusing document.] Good old fashioned hands-on testing: - We can't possibly have tried everything on every system. See if you can break it! avarice-2.11.orig/avarice.spec0000644000000000000000000000272411627171065013175 0ustar ## -*- mode: rpm-spec; -*- ## ## $Id: avarice.spec.in,v 1.3 2003/12/07 06:04:58 troth Exp $ ## ## avarice.spec. Generated from avarice.spec.in by configure. ## # We don't want rpm stripping any files #%define __spec_install_post %{nil} # Don't build the debuginfo rpm %define debug_package %{nil} Summary: Interface for GDB to Atmel AVR JTAGICE in circuit emulator. Name: avarice Version: 2.11 Release: 1 License: GPL Group: Avr/Development/Tools URL: http://avarice.sourceforge.net/ Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %description AVaRICE is a program which interfaces the GNU Debugger with the AVR JTAG ICE available from Atmel. %prep %setup -q %build ./configure --prefix=%{_prefix} --mandir=%{_mandir} make %install rm -rf $RPM_BUILD_ROOT make prefix=$RPM_BUILD_ROOT%{_prefix} mandir=$RPM_BUILD_ROOT%{_mandir} install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc ChangeLog AUTHORS INSTALL COPYING %{_prefix}/bin/avarice %{_prefix}/bin/start-avarice %{_prefix}/bin/kill-avarice %{_prefix}/bin/ice-gdb %{_prefix}/bin/ice-insight %{_prefix}/share/%{name}/gdb-avarice-script %{_mandir}/man1/ice-insight.1 %{_mandir}/man1/ice-gdb.1 %{_mandir}/man1/avarice.1 %changelog * Sat Dec 06 2003 Theodore A. Roth - Add avarice.1 man page. * Thu Sep 18 2003 Theodore A. Roth - Add man pages. * Fri Aug 15 2003 Theodore A. Roth - Initial build.