# HG changeset patch # User jlarmour # Date 974503003 0 # Node ID a9ac27ec7abca000f1f5108dfc71ebf3b2c8c927 # Parent 3bc2abeae9ffff7a511497241319fab8f60c336d Merge from eCos master repository on 2000-11-17-18:24:25-GMT diff --git a/host/README b/host/README --- a/host/README +++ b/host/README @@ -139,7 +139,9 @@ 2) --enable-debug. By default all assert --disable-tracing disable tracing --disable-fntracing disable function entry/exit tracing -3) --with-tcl= and --with-tcl-version= +3) --with-tcl=, --with-tcl-header=, --with-tcl-lib= + and --with-tcl-version= + The host-side tools have a dependency on Tcl, which is not supplied with the sources because many people will already have a suitable installation. Specifically it is necessary to have the header file @@ -157,6 +159,14 @@ 3) --with-tcl= and --with-tcl-vers $ /configure --with-tcl=/usr + If the Tcl libraries and Tcl headers are installed in different + locations, such as when a seperate --prefix and --exec-prefix are + used, the --with-tcl-header and --with-tcl-lib options can be used + to specify both location. The configure will expect to find + /include/tcl.h and /lib/tclConfig.sh. + The --with-tcl option has precedence and if used will override the + --with-tcl-header and --with-tcl-lib options. + It is possible to have multiple versions of Tcl installed, for example libtcl8.0.a, libtcl8.1.a, and so on. Typically linking with -ltcl will result in the latest version being used. It is possible diff --git a/host/acinclude.m4 b/host/acinclude.m4 --- a/host/acinclude.m4 +++ b/host/acinclude.m4 @@ -321,13 +321,27 @@ AC_SUBST(cyg_ac_tcl_version) dnl Where is the Tcl installation? By default assume Tcl is already dnl installed in the same place as the eCos host-side. +AC_ARG_WITH(tcl,[ --with-tcl-header= location of Tcl header]) +AC_ARG_WITH(tcl,[ --with-tcl-lib= location of Tcl libraries]) + AC_MSG_CHECKING(for Tcl installation) AC_ARG_WITH(tcl,[ --with-tcl= location of Tcl header and libraries],[ cyg_ac_tcl_incdir=${with_tcl}/include cyg_ac_tcl_libdir=${with_tcl}/lib ],[ - cyg_ac_tcl_incdir=${prefix}/include - cyg_ac_tcl_libdir=${prefix}/lib + if test "${with_tcl_header}" = "no"; then + cyg_ac_tcl_incdir=${prefix}/include + else + with_tcl=yes + cyg_ac_tcl_incdir=${with_tcl_header}/include + fi + + if test "${with_tcl_lib}" = "no"; then + cyg_ac_tcl_libdir=${prefix}/lib + else + with_tcl=yes + cyg_ac_tcl_libdir=${with_tcl_lib}/lib + fi ]) AC_MSG_RESULT(${cyg_ac_tcl_libdir}) diff --git a/host/aclocal.m4 b/host/aclocal.m4 --- a/host/aclocal.m4 +++ b/host/aclocal.m4 @@ -333,13 +333,27 @@ AC_SUBST(cyg_ac_tcl_version) dnl Where is the Tcl installation? By default assume Tcl is already dnl installed in the same place as the eCos host-side. +AC_ARG_WITH(tcl,[ --with-tcl-header= location of Tcl header]) +AC_ARG_WITH(tcl,[ --with-tcl-lib= location of Tcl libraries]) + AC_MSG_CHECKING(for Tcl installation) AC_ARG_WITH(tcl,[ --with-tcl= location of Tcl header and libraries],[ cyg_ac_tcl_incdir=${with_tcl}/include cyg_ac_tcl_libdir=${with_tcl}/lib ],[ - cyg_ac_tcl_incdir=${prefix}/include - cyg_ac_tcl_libdir=${prefix}/lib + if test "${with_tcl_header}" = "no"; then + cyg_ac_tcl_incdir=${prefix}/include + else + with_tcl=yes + cyg_ac_tcl_incdir=${with_tcl_header}/include + fi + + if test "${with_tcl_lib}" = "no"; then + cyg_ac_tcl_libdir=${prefix}/lib + else + with_tcl=yes + cyg_ac_tcl_libdir=${with_tcl_lib}/lib + fi ]) AC_MSG_RESULT(${cyg_ac_tcl_libdir}) diff --git a/host/configure b/host/configure --- a/host/configure +++ b/host/configure @@ -35,6 +35,10 @@ ac_help="$ac_help ac_help="$ac_help --with-tcl-version= version of Tcl to be used" ac_help="$ac_help + --with-tcl-header= location of Tcl header" +ac_help="$ac_help + --with-tcl-lib= location of Tcl libraries" +ac_help="$ac_help --with-tcl= location of Tcl header and libraries" # Initialize some variables set by options. @@ -583,7 +587,7 @@ else { echo "configure: error: can not r fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:587: checking host system type" >&5 +echo "configure:591: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -615,7 +619,7 @@ echo "$ac_t""$host" 1>&6 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:619: checking for a BSD compatible install" >&5 +echo "configure:623: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -668,7 +672,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:672: checking whether build environment is sane" >&5 +echo "configure:676: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -725,7 +729,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:729: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:733: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -764,7 +768,7 @@ fi missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:768: checking for working aclocal" >&5 +echo "configure:772: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -777,7 +781,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:781: checking for working autoconf" >&5 +echo "configure:785: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -790,7 +794,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:794: checking for working automake" >&5 +echo "configure:798: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -803,7 +807,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:807: checking for working autoheader" >&5 +echo "configure:811: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -816,7 +820,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:820: checking for working makeinfo" >&5 +echo "configure:824: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -830,7 +834,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:834: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:838: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -854,7 +858,7 @@ fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:858: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:862: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -881,12 +885,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:885: checking for Cygwin environment" >&5 +echo "configure:889: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -916,7 +920,7 @@ test "$ac_cv_cygwin" = yes && CYGWIN=yes # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:920: checking for $ac_word" >&5 +echo "configure:924: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -946,7 +950,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:950: checking for $ac_word" >&5 +echo "configure:954: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -997,7 +1001,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1001: checking for $ac_word" >&5 +echo "configure:1005: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1029,7 +1033,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1033: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1037: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1040,12 +1044,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1044 "configure" +#line 1048 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1071,12 +1075,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1075: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1079: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1080: checking whether we are using GNU C" >&5 +echo "configure:1084: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1085,7 +1089,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1104,7 +1108,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1108: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1112: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1140,7 +1144,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1144: checking for $ac_word" >&5 +echo "configure:1148: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1172,7 +1176,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1176: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1180: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1183,12 +1187,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 1187 "configure" +#line 1191 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:1192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1214,12 +1218,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1218: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1222: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1223: checking whether we are using GNU C++" >&5 +echo "configure:1227: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1228,7 +1232,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1247,7 +1251,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1251: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1255: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1279,13 +1283,13 @@ else fi echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1283: checking for object suffix" >&5 +echo "configure:1287: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1303,19 +1307,19 @@ OBJEXT=$ac_cv_objext ac_objext=$ac_cv_objext echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1307: checking for mingw32 environment" >&5 +echo "configure:1311: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1334,7 +1338,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=y echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1338: checking for executable suffix" >&5 +echo "configure:1342: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1344,7 +1348,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -1369,7 +1373,7 @@ ac_exeext=$EXEEXT echo $ac_n "checking "for Visual C++"""... $ac_c" 1>&6 -echo "configure:1373: checking "for Visual C++"" >&5 +echo "configure:1377: checking "for Visual C++"" >&5 MSVC="no"; if test "${CC}" = "cl" ; then MSVC="yes" @@ -1395,7 +1399,7 @@ fi echo $ac_n "checking "the default compiler flags"""... $ac_c" 1>&6 -echo "configure:1399: checking "the default compiler flags"" >&5 +echo "configure:1403: checking "the default compiler flags"" >&5 cygflags_enable_debug="no" # Check whether --enable-debug or --disable-debug was given. @@ -1589,7 +1593,7 @@ fi echo $ac_n "checking for Tcl version""... $ac_c" 1>&6 -echo "configure:1593: checking for Tcl version" >&5 +echo "configure:1597: checking for Tcl version" >&5 # Check whether --with-tcl-version or --without-tcl-version was given. if test "${with_tcl_version+set}" = set; then withval="$with_tcl_version" @@ -1613,8 +1617,21 @@ fi echo "$ac_t""${cyg_ac_tcl_version}" 1>&6 +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + : +fi + +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + : +fi + + echo $ac_n "checking for Tcl installation""... $ac_c" 1>&6 -echo "configure:1618: checking for Tcl installation" >&5 +echo "configure:1635: checking for Tcl installation" >&5 # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" @@ -1624,8 +1641,19 @@ if test "${with_tcl+set}" = set; then else - cyg_ac_tcl_incdir=${prefix}/include - cyg_ac_tcl_libdir=${prefix}/lib + if test "${with_tcl_header}" = "no"; then + cyg_ac_tcl_incdir=${prefix}/include + else + with_tcl=yes + cyg_ac_tcl_incdir=${with_tcl_header}/include + fi + + if test "${with_tcl_lib}" = "no"; then + cyg_ac_tcl_libdir=${prefix}/lib + else + with_tcl=yes + cyg_ac_tcl_libdir=${with_tcl_lib}/lib + fi fi diff --git a/host/infra/configure b/host/infra/configure --- a/host/infra/configure +++ b/host/infra/configure @@ -21,6 +21,10 @@ ac_help="$ac_help ac_help="$ac_help --with-tcl-version= version of Tcl to be used" ac_help="$ac_help + --with-tcl-header= location of Tcl header" +ac_help="$ac_help + --with-tcl-lib= location of Tcl libraries" +ac_help="$ac_help --with-tcl= location of Tcl header and libraries" ac_help="$ac_help --enable-tracebufsize=X size of the trace buffer" @@ -573,7 +577,7 @@ else { echo "configure: error: can not r fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:577: checking host system type" >&5 +echo "configure:581: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -606,7 +610,7 @@ echo "$ac_t""$host" 1>&6 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:610: checking for a BSD compatible install" >&5 +echo "configure:614: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -659,7 +663,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:663: checking whether build environment is sane" >&5 +echo "configure:667: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -716,7 +720,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:720: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:724: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -755,7 +759,7 @@ fi missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:759: checking for working aclocal" >&5 +echo "configure:763: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -768,7 +772,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:772: checking for working autoconf" >&5 +echo "configure:776: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -781,7 +785,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:785: checking for working automake" >&5 +echo "configure:789: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -794,7 +798,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:798: checking for working autoheader" >&5 +echo "configure:802: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -807,7 +811,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:811: checking for working makeinfo" >&5 +echo "configure:815: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -829,7 +833,7 @@ EOF echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:833: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:837: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -853,7 +857,7 @@ fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:857: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:861: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -882,7 +886,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:886: checking for $ac_word" >&5 +echo "configure:890: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -912,7 +916,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:916: checking for $ac_word" >&5 +echo "configure:920: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -963,7 +967,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:967: checking for $ac_word" >&5 +echo "configure:971: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -995,7 +999,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:999: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1003: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1006,12 +1010,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1010 "configure" +#line 1014 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1037,12 +1041,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1041: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1045: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1046: checking whether we are using GNU C" >&5 +echo "configure:1050: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1051,7 +1055,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1059: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1070,7 +1074,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1074: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1078: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1106,7 +1110,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1110: checking for $ac_word" >&5 +echo "configure:1114: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1138,7 +1142,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1142: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1146: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1149,12 +1153,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 1153 "configure" +#line 1157 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:1158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1180,12 +1184,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1184: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1188: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1189: checking whether we are using GNU C++" >&5 +echo "configure:1193: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1194,7 +1198,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1213,7 +1217,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1217: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1221: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1247,7 +1251,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1251: checking for $ac_word" >&5 +echo "configure:1255: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1275,13 +1279,13 @@ else fi echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1279: checking for object suffix" >&5 +echo "configure:1283: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1299,12 +1303,12 @@ OBJEXT=$ac_cv_objext ac_objext=$ac_cv_objext echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1303: checking for Cygwin environment" >&5 +echo "configure:1307: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -1332,19 +1336,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1336: checking for mingw32 environment" >&5 +echo "configure:1340: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1363,7 +1367,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=y echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1367: checking for executable suffix" >&5 +echo "configure:1371: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1373,7 +1377,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -1398,7 +1402,7 @@ ac_exeext=$EXEEXT echo $ac_n "checking "for Visual C++"""... $ac_c" 1>&6 -echo "configure:1402: checking "for Visual C++"" >&5 +echo "configure:1406: checking "for Visual C++"" >&5 MSVC="no"; if test "${CC}" = "cl" ; then MSVC="yes" @@ -1423,7 +1427,7 @@ fi echo $ac_n "checking "the default compiler flags"""... $ac_c" 1>&6 -echo "configure:1427: checking "the default compiler flags"" >&5 +echo "configure:1431: checking "the default compiler flags"" >&5 cygflags_enable_debug="no" # Check whether --enable-debug or --disable-debug was given. @@ -1469,14 +1473,14 @@ fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1473: checking whether byte ordering is bigendian" >&5 +echo "configure:1477: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -1487,11 +1491,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -1502,7 +1506,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1510: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1522,7 +1526,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1564,7 +1568,7 @@ fi echo $ac_n "checking "for a 64 bit data type"""... $ac_c" 1>&6 -echo "configure:1568: checking "for a 64 bit data type"" >&5 +echo "configure:1572: checking "for a 64 bit data type"" >&5 if eval "test \"`echo '$''{'cyg_ac_cv_type_64bit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1582,7 +1586,7 @@ cross_compiling=$ac_cv_prog_cc_cross ctype_64bit="long long" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ctype_64bit=$type else @@ -1613,7 +1617,7 @@ cross_compiling=$ac_cv_prog_cxx_cross cxxtype_64bit="long long" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cxxtype_64bit=$type else @@ -1669,7 +1673,7 @@ EOF echo $ac_n "checking size of int *""... $ac_c" 1>&6 -echo "configure:1673: checking size of int *" >&5 +echo "configure:1677: checking size of int *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1677,7 +1681,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1688,7 +1692,7 @@ main() exit(0); } EOF -if { (eval echo configure:1692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int_p=`cat conftestval` else @@ -1708,7 +1712,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:1712: checking size of long" >&5 +echo "configure:1716: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1716,7 +1720,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1727,7 +1731,7 @@ main() exit(0); } EOF -if { (eval echo configure:1731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -1752,7 +1756,7 @@ EOF echo $ac_n "checking "for __PRETTY_FUNCTION__ support"""... $ac_c" 1>&6 -echo "configure:1756: checking "for __PRETTY_FUNCTION__ support"" >&5 +echo "configure:1760: checking "for __PRETTY_FUNCTION__ support"" >&5 if eval "test \"`echo '$''{'cyg_ac_cv_c_pretty_function'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1766,14 +1770,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext < int main() { puts(__PRETTY_FUNCTION__); ; return 0; } EOF -if { (eval echo configure:1777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* c_ok="yes" else @@ -1792,14 +1796,14 @@ ac_link='${CXX-g++} -o conftest${ac_exee cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { puts(__PRETTY_FUNCTION__); ; return 0; } EOF -if { (eval echo configure:1803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cxx_ok="yes" else @@ -1839,7 +1843,7 @@ EOF echo $ac_n "checking for Tcl version""... $ac_c" 1>&6 -echo "configure:1843: checking for Tcl version" >&5 +echo "configure:1847: checking for Tcl version" >&5 # Check whether --with-tcl-version or --without-tcl-version was given. if test "${with_tcl_version+set}" = set; then withval="$with_tcl_version" @@ -1863,8 +1867,21 @@ fi echo "$ac_t""${cyg_ac_tcl_version}" 1>&6 +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + : +fi + +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + : +fi + + echo $ac_n "checking for Tcl installation""... $ac_c" 1>&6 -echo "configure:1868: checking for Tcl installation" >&5 +echo "configure:1885: checking for Tcl installation" >&5 # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" @@ -1874,8 +1891,19 @@ if test "${with_tcl+set}" = set; then else - cyg_ac_tcl_incdir=${prefix}/include - cyg_ac_tcl_libdir=${prefix}/lib + if test "${with_tcl_header}" = "no"; then + cyg_ac_tcl_incdir=${prefix}/include + else + with_tcl=yes + cyg_ac_tcl_incdir=${with_tcl_header}/include + fi + + if test "${with_tcl_lib}" = "no"; then + cyg_ac_tcl_libdir=${prefix}/lib + else + with_tcl=yes + cyg_ac_tcl_libdir=${with_tcl_lib}/lib + fi fi diff --git a/host/libcdl/configure b/host/libcdl/configure --- a/host/libcdl/configure +++ b/host/libcdl/configure @@ -35,6 +35,10 @@ ac_help="$ac_help ac_help="$ac_help --with-tcl-version= version of Tcl to be used" ac_help="$ac_help + --with-tcl-header= location of Tcl header" +ac_help="$ac_help + --with-tcl-lib= location of Tcl libraries" +ac_help="$ac_help --with-tcl= location of Tcl header and libraries" ac_help="$ac_help --with-infra=dir location of the infrastructure build tree" @@ -587,7 +591,7 @@ else { echo "configure: error: can not r fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:591: checking host system type" >&5 +echo "configure:595: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -620,7 +624,7 @@ echo "$ac_t""$host" 1>&6 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:624: checking for a BSD compatible install" >&5 +echo "configure:628: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -673,7 +677,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:677: checking whether build environment is sane" >&5 +echo "configure:681: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -730,7 +734,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:734: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:738: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -776,7 +780,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:780: checking for working aclocal" >&5 +echo "configure:784: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -789,7 +793,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:793: checking for working autoconf" >&5 +echo "configure:797: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -802,7 +806,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:806: checking for working automake" >&5 +echo "configure:810: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -815,7 +819,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:819: checking for working autoheader" >&5 +echo "configure:823: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -828,7 +832,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:832: checking for working makeinfo" >&5 +echo "configure:836: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -850,7 +854,7 @@ EOF echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:854: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:858: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -874,7 +878,7 @@ fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:878: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:882: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -903,7 +907,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:907: checking for $ac_word" >&5 +echo "configure:911: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -933,7 +937,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:937: checking for $ac_word" >&5 +echo "configure:941: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -984,7 +988,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:988: checking for $ac_word" >&5 +echo "configure:992: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1016,7 +1020,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1020: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1024: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1027,12 +1031,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1031 "configure" +#line 1035 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1058,12 +1062,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1062: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1066: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1067: checking whether we are using GNU C" >&5 +echo "configure:1071: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1072,7 +1076,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1076: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1091,7 +1095,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1095: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1099: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1127,7 +1131,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1131: checking for $ac_word" >&5 +echo "configure:1135: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1159,7 +1163,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1163: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1167: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1170,12 +1174,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 1174 "configure" +#line 1178 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:1179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1201,12 +1205,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1205: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1209: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1210: checking whether we are using GNU C++" >&5 +echo "configure:1214: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1215,7 +1219,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1223: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1234,7 +1238,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1238: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1242: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1268,7 +1272,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1272: checking for $ac_word" >&5 +echo "configure:1276: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1296,13 +1300,13 @@ else fi echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1300: checking for object suffix" >&5 +echo "configure:1304: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1320,12 +1324,12 @@ OBJEXT=$ac_cv_objext ac_objext=$ac_cv_objext echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1324: checking for Cygwin environment" >&5 +echo "configure:1328: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1344: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -1353,19 +1357,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1357: checking for mingw32 environment" >&5 +echo "configure:1361: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1384,7 +1388,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=y echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1388: checking for executable suffix" >&5 +echo "configure:1392: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1394,7 +1398,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -1419,7 +1423,7 @@ ac_exeext=$EXEEXT echo $ac_n "checking "for Visual C++"""... $ac_c" 1>&6 -echo "configure:1423: checking "for Visual C++"" >&5 +echo "configure:1427: checking "for Visual C++"" >&5 MSVC="no"; if test "${CC}" = "cl" ; then MSVC="yes" @@ -1444,7 +1448,7 @@ fi echo $ac_n "checking "the default compiler flags"""... $ac_c" 1>&6 -echo "configure:1448: checking "the default compiler flags"" >&5 +echo "configure:1452: checking "the default compiler flags"" >&5 cygflags_enable_debug="no" # Check whether --enable-debug or --disable-debug was given. @@ -1640,7 +1644,7 @@ fi echo $ac_n "checking for Tcl version""... $ac_c" 1>&6 -echo "configure:1644: checking for Tcl version" >&5 +echo "configure:1648: checking for Tcl version" >&5 # Check whether --with-tcl-version or --without-tcl-version was given. if test "${with_tcl_version+set}" = set; then withval="$with_tcl_version" @@ -1664,8 +1668,21 @@ fi echo "$ac_t""${cyg_ac_tcl_version}" 1>&6 +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + : +fi + +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + : +fi + + echo $ac_n "checking for Tcl installation""... $ac_c" 1>&6 -echo "configure:1669: checking for Tcl installation" >&5 +echo "configure:1686: checking for Tcl installation" >&5 # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" @@ -1675,8 +1692,19 @@ if test "${with_tcl+set}" = set; then else - cyg_ac_tcl_incdir=${prefix}/include - cyg_ac_tcl_libdir=${prefix}/lib + if test "${with_tcl_header}" = "no"; then + cyg_ac_tcl_incdir=${prefix}/include + else + with_tcl=yes + cyg_ac_tcl_incdir=${with_tcl_header}/include + fi + + if test "${with_tcl_lib}" = "no"; then + cyg_ac_tcl_libdir=${prefix}/lib + else + with_tcl=yes + cyg_ac_tcl_libdir=${with_tcl_lib}/lib + fi fi @@ -1721,7 +1749,7 @@ fi echo $ac_n "checking for infrastructure files""... $ac_c" 1>&6 -echo "configure:1725: checking for infrastructure files" >&5 +echo "configure:1753: checking for infrastructure files" >&5 # Check whether --with-infra or --without-infra was given. if test "${with_infra+set}" = set; then withval="$with_infra" diff --git a/host/tools/configtool/standalone/common/configure b/host/tools/configtool/standalone/common/configure --- a/host/tools/configtool/standalone/common/configure +++ b/host/tools/configtool/standalone/common/configure @@ -21,6 +21,10 @@ ac_help="$ac_help ac_help="$ac_help --with-tcl-version= version of Tcl to be used" ac_help="$ac_help + --with-tcl-header= location of Tcl header" +ac_help="$ac_help + --with-tcl-lib= location of Tcl libraries" +ac_help="$ac_help --with-tcl= location of Tcl header and libraries" # Initialize some variables set by options. @@ -39,6 +43,7 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= +sitefile= srcdir= target=NONE verbose= @@ -153,6 +158,7 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -323,6 +329,11 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -488,12 +499,16 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi +else + CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -565,7 +580,7 @@ ac_configure=$ac_aux_dir/configure # Thi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:569: checking for a BSD compatible install" >&5 +echo "configure:584: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -618,7 +633,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:622: checking whether build environment is sane" >&5 +echo "configure:637: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -675,7 +690,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:679: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:694: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -721,7 +736,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:725: checking for working aclocal" >&5 +echo "configure:740: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -734,7 +749,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:738: checking for working autoconf" >&5 +echo "configure:753: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -747,7 +762,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:751: checking for working automake" >&5 +echo "configure:766: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -760,7 +775,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:764: checking for working autoheader" >&5 +echo "configure:779: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -773,7 +788,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:777: checking for working makeinfo" >&5 +echo "configure:792: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -787,7 +802,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:791: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:806: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -817,7 +832,7 @@ else { echo "configure: error: can not r fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:821: checking host system type" >&5 +echo "configure:836: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -840,7 +855,7 @@ echo "$ac_t""$host" 1>&6 # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:844: checking for $ac_word" >&5 +echo "configure:859: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -870,7 +885,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:874: checking for $ac_word" >&5 +echo "configure:889: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -921,7 +936,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:925: checking for $ac_word" >&5 +echo "configure:940: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -953,7 +968,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:957: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:972: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -964,12 +979,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 968 "configure" +#line 983 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -995,12 +1010,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:999: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1014: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1004: checking whether we are using GNU C" >&5 +echo "configure:1019: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1009,7 +1024,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1028,7 +1043,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1032: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1047: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1064,7 +1079,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1068: checking for $ac_word" >&5 +echo "configure:1083: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1096,7 +1111,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1100: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1115: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1107,12 +1122,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 1111 "configure" +#line 1126 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:1116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1138,12 +1153,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1142: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1157: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1147: checking whether we are using GNU C++" >&5 +echo "configure:1162: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1152,7 +1167,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1156: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1171,7 +1186,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1175: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1190: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1203,13 +1218,13 @@ else fi echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1207: checking for object suffix" >&5 +echo "configure:1222: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1228: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1227,12 +1242,12 @@ OBJEXT=$ac_cv_objext ac_objext=$ac_cv_objext echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1231: checking for Cygwin environment" >&5 +echo "configure:1246: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -1260,19 +1275,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1264: checking for mingw32 environment" >&5 +echo "configure:1279: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1291,7 +1306,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=y echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1295: checking for executable suffix" >&5 +echo "configure:1310: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1301,7 +1316,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -1326,7 +1341,7 @@ ac_exeext=$EXEEXT echo $ac_n "checking "for Visual C++"""... $ac_c" 1>&6 -echo "configure:1330: checking "for Visual C++"" >&5 +echo "configure:1345: checking "for Visual C++"" >&5 MSVC="no"; if test "${CC}" = "cl" ; then MSVC="yes" @@ -1351,7 +1366,7 @@ fi echo $ac_n "checking "the default compiler flags"""... $ac_c" 1>&6 -echo "configure:1355: checking "the default compiler flags"" >&5 +echo "configure:1370: checking "the default compiler flags"" >&5 cygflags_enable_debug="no" # Check whether --enable-debug or --disable-debug was given. @@ -1403,7 +1418,7 @@ fi echo $ac_n "checking for Tcl version""... $ac_c" 1>&6 -echo "configure:1407: checking for Tcl version" >&5 +echo "configure:1422: checking for Tcl version" >&5 # Check whether --with-tcl-version or --without-tcl-version was given. if test "${with_tcl_version+set}" = set; then withval="$with_tcl_version" @@ -1427,8 +1442,21 @@ fi echo "$ac_t""${cyg_ac_tcl_version}" 1>&6 +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + : +fi + +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + : +fi + + echo $ac_n "checking for Tcl installation""... $ac_c" 1>&6 -echo "configure:1432: checking for Tcl installation" >&5 +echo "configure:1460: checking for Tcl installation" >&5 # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" @@ -1438,8 +1466,19 @@ if test "${with_tcl+set}" = set; then else - cyg_ac_tcl_incdir=${prefix}/include - cyg_ac_tcl_libdir=${prefix}/lib + if test "${with_tcl_header}" = "no"; then + cyg_ac_tcl_incdir=${prefix}/include + else + with_tcl=yes + cyg_ac_tcl_incdir=${with_tcl_header}/include + fi + + if test "${with_tcl_lib}" = "no"; then + cyg_ac_tcl_libdir=${prefix}/lib + else + with_tcl=yes + cyg_ac_tcl_libdir=${with_tcl_lib}/lib + fi fi @@ -1484,7 +1523,7 @@ fi echo $ac_n "checking for host-side infrastructure""... $ac_c" 1>&6 -echo "configure:1488: checking for host-side infrastructure" >&5 +echo "configure:1527: checking for host-side infrastructure" >&5 cyg_ac_infra_incdir=../../../../infra cyg_ac_infra_libdir=../../../../infra if test "${MSVC}" = "yes" ; then @@ -1517,7 +1556,7 @@ fi echo "$ac_t""-I${cyg_ac_infra_incdir} -L${cyg_ac_infra_libdir} libraries ${cyg_ac_infra_libraries}" 1>&6 echo $ac_n "checking for libcdl""... $ac_c" 1>&6 -echo "configure:1521: checking for libcdl" >&5 +echo "configure:1560: checking for libcdl" >&5 cyg_ac_cdl_incdir=${srcdir}/../../../../libcdl cyg_ac_cdl_libdir=../../../../libcdl if test "${MSVC}" = "yes" ; then diff --git a/packages/ChangeLog b/packages/ChangeLog --- a/packages/ChangeLog +++ b/packages/ChangeLog @@ -1,3 +1,13 @@ +2000-11-16 Jesper Skov + + * ecos.db: Added intel flash driver. Going to use it as a test to + get more generic drivers working. + +2000-11-14 Drew Moseley + + * pkgconf/rules.mak: Get rid of some gnu specific options to cp, find and xargs. + + 2000-11-01 Jesper Skov * ecos.db: Added cq7750 target and SH3/SH4 variant packages. Moved diff --git a/packages/NEWS b/packages/NEWS --- a/packages/NEWS +++ b/packages/NEWS @@ -1,11 +1,14 @@ +* Add syscall support to RedBoot for compatibility with newlib-based BSPs +* Bridge support added to the PCI library. Use cyg_pci_configure_bus() to + configure all busses. * Added a port to the Toshiba MIPS TX49 chip, with the REF4955 reference platform. This includes serial device driver and wallclock device driver support. * PowerPC 40x variant support added. * Added SH4 support. Split SH architecture HAL into variants in the process. * Added SH4/CQ7750 platform support [still untested] -* Port to Intel SA1100 Multimedia evalulation board added, including FLASH - driver and RedBoot support +* Port to Intel SA1100 Multimedia evalulation board added, including serial + device driver, FLASH driver and RedBoot support * FLASH driver added for PowerPC/MBX * sigsetjmp() and siglongjmp() added * A choice of getcwd() implementations have been added diff --git a/packages/compat/posix/current/ChangeLog b/packages/compat/posix/current/ChangeLog --- a/packages/compat/posix/current/ChangeLog +++ b/packages/compat/posix/current/ChangeLog @@ -1,3 +1,17 @@ +2000-11-07 Jonathan Larmour + + * src/signal.cxx (cyg_posix_thread_siginit): Add extra thread + argument so that threads can inherit parent's sigmask. + + * src/pthread.cxx (pthread_create): Call with parent thread + + * src/pprivate.h: Change cyg_posix_thread_siginit prototype to take + parent thread argument + + * tests/signal1.c: Add more checking of sigwaits, and fix so that it's + only called when the signal is masked. Check errno values too + sometimes. + 2000-11-02 Jonathan Larmour * src/signal.cxx (sigtimedwait): return signal number on success, diff --git a/packages/compat/posix/current/src/pprivate.h b/packages/compat/posix/current/src/pprivate.h --- a/packages/compat/posix/current/src/pprivate.h +++ b/packages/compat/posix/current/src/pprivate.h @@ -172,7 +172,8 @@ externC cyg_bool cyg_sigqueue( const str externC cyg_bool cyg_deliver_signals(); -externC void cyg_posix_thread_siginit( pthread_info *thread ); +externC void cyg_posix_thread_siginit( pthread_info *thread, + pthread_info *parentthread ); externC void cyg_posix_thread_sigdestroy( pthread_info *thread ); diff --git a/packages/compat/posix/current/src/pthread.cxx b/packages/compat/posix/current/src/pthread.cxx --- a/packages/compat/posix/current/src/pthread.cxx +++ b/packages/compat/posix/current/src/pthread.cxx @@ -589,7 +589,7 @@ externC int pthread_create ( pthread_t * nthread->joiner = new(nthread->joiner_obj) Cyg_Condition_Variable( pthread_mutex ); // Initialize signal specific fields. - cyg_posix_thread_siginit( nthread ); + cyg_posix_thread_siginit( nthread, self ); // create the underlying eCos thread diff --git a/packages/compat/posix/current/src/signal.cxx b/packages/compat/posix/current/src/signal.cxx --- a/packages/compat/posix/current/src/signal.cxx +++ b/packages/compat/posix/current/src/signal.cxx @@ -456,12 +456,17 @@ externC void cyg_posix_signal_asr(pthrea //========================================================================== // Per-thread initialization and destruction -externC void cyg_posix_thread_siginit( pthread_info *thread ) +externC void cyg_posix_thread_siginit( pthread_info *thread, + pthread_info *parentthread ) { // Clear out signal masks sigemptyset( &thread->sigpending ); - sigemptyset( &thread->sigmask ); - + // but threads inherit signal masks + if ( NULL == parentthread ) + sigemptyset( &thread->sigmask ); + else + thread->sigmask = parentthread->sigmask; + cyg_pthread_exception_init( thread ); } diff --git a/packages/compat/posix/current/tests/signal1.c b/packages/compat/posix/current/tests/signal1.c --- a/packages/compat/posix/current/tests/signal1.c +++ b/packages/compat/posix/current/tests/signal1.c @@ -43,6 +43,7 @@ #include #include #include +#include #include @@ -91,10 +92,21 @@ void *pthread_entry1( void *arg) sigset_t mask; siginfo_t info; struct timespec timeout; - int sig; + int sig, sig2, err; CYG_TEST_INFO( "Thread 1 running" ); + // Should have inherited parent's signal mask + pthread_sigmask( 0, NULL, &mask ); + CYG_TEST_CHECK( sigismember( &mask, SIGALRM), + "SIGALRM mask inherited"); + CYG_TEST_CHECK( sigismember( &mask, SIGUSR1), + "SIGUSR1 mask inherited"); + CYG_TEST_CHECK( sigismember( &mask, SIGUSR2), + "SIGUSR2 mask inherited"); + CYG_TEST_CHECK( sigismember( &mask, SIGSEGV), + "SIGSEGV mask inherited"); + // Make a full set sigfillset( &mask ); @@ -115,10 +127,11 @@ void *pthread_entry1( void *arg) CYG_TEST_INFO( "Thread1: calling sigtimedwait()"); // Wait for a signal to be delivered - sigtimedwait( &mask, &info, &timeout ); + sig = sigtimedwait( &mask, &info, &timeout ); - sig = info.si_signo; + sig2 = info.si_signo; + CYG_TEST_CHECK( sig == sig2, "sigtimedwait return value not equal"); CYG_TEST_CHECK( sig == SIGUSR1, "Signal not delivered"); while( sigusr2_called != 2 ) @@ -127,12 +140,31 @@ void *pthread_entry1( void *arg) pause(); } + errno = 0; // strictly correct to reset errno first + // now wait for SIGALRM to be delivered CYG_TEST_INFO( "Thread1: calling pause()"); - pause(); + err = pause(); + CYG_TEST_CHECK( -1==err, "pause returned -1"); + CYG_TEST_CHECK( EINTR==errno, "errno set to EINTR"); + + // generate another SIGALRM and wait for it to be delivered too + // we need to mask it first though + + // Make a full set + sigfillset( &mask ); + + // Set signal mask + pthread_sigmask( SIG_SETMASK, &mask, NULL ); + + alarm(1); + CYG_TEST_INFO( "Thread1: calling alarm()"); + err = sigwait( &mask, &sig); + CYG_TEST_CHECK( 0==err, "sigwait returned -1"); + CYG_TEST_CHECK( sig==SIGALRM, "sigwait caught alarm"); CYG_TEST_INFO( "Thread1: calling pthread_exit()"); - pthread_exit( (void *)((int)arg+sig) ); + pthread_exit( (void *)((int)arg+sig2) ); } //-------------------------------------------------------------------------- diff --git a/packages/devs/flash/intel/bootblock/current/ChangeLog b/packages/devs/flash/intel/bootblock/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/devs/flash/intel/bootblock/current/ChangeLog @@ -0,0 +1,40 @@ +2000-11-17 Jesper Skov + + * src/flash_erase_block.c: cleanup. + * src/flash_program_buf.c: cleanup. + +2000-11-16 Jesper Skov + + * src/bootblock_flash.c: Handle suspend failures. + * src/flash.h: Same. + +2000-11-15 Jesper Skov + + * Copy of edb7xxx driver. Need to rewrite to be more generic. Need + CDL options to control number of parts, interleaving, size, etc. + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/devs/flash/intel/bootblock/current/cdl/flash_intel_bootblock.cdl b/packages/devs/flash/intel/bootblock/current/cdl/flash_intel_bootblock.cdl new file mode 100644 --- /dev/null +++ b/packages/devs/flash/intel/bootblock/current/cdl/flash_intel_bootblock.cdl @@ -0,0 +1,82 @@ +# ==================================================================== +# +# flash_bootblock.cdl +# +# FLASH memory - Hardware support for Intel Boot Block Flash Memory +# +# ==================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Red Hat eCos Public License +# Version 1.1 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.redhat.com/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Configurable Operating System, +# released September 30, 1998. +# +# The Initial Developer of the Original Code is Red Hat. +# Portions created by Red Hat are +# Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +# All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +# ==================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): gthomas +# Contributors: jskov +# Date: 2000-07-26 +# +#####DESCRIPTIONEND#### +# +# ==================================================================== + +cdl_package CYGPKG_DEVS_FLASH_INTEL_BOOTBLOCK { + display "Intel boot block flash memory support" + + parent CYGPKG_IO_FLASH + active_if CYGPKG_IO_FLASH + + implements CYGHWR_IO_FLASH_DEVICE + + include_dir . + include_files ; # none _exported_ whatsoever + description "FLASH memory device support for Intel boot block flash memory" + compile bootblock_flash.c + + make -priority 1 { + flash_erase_block.o: $(REPOSITORY)/$(PACKAGE)/src/flash_erase_block.c + $(CC) -S $(INCLUDE_PATH) $(CFLAGS) -g0 -mcpu=strongarm -fno-function-sections $(REPOSITORY)/$(PACKAGE)/src/flash_erase_block.c + echo "#include " > flash_erase_block2.S + cat flash_erase_block.s >> flash_erase_block2.S + echo "FUNC_END(flash_erase_block_end)" >>flash_erase_block2.S + $(CC) -c $(INCLUDE_PATH) -o flash_erase_block.o flash_erase_block2.S + $(AR) rcs $(PREFIX)/lib/libtarget.a flash_erase_block.o + } + make -priority 1 { + flash_program_buf.o: $(REPOSITORY)/$(PACKAGE)/src/flash_program_buf.c + $(CC) -S $(INCLUDE_PATH) $(CFLAGS) -g0 -mcpu=strongarm -fno-function-sections $(REPOSITORY)/$(PACKAGE)/src/flash_program_buf.c + echo "#include " > flash_program_buf2.S + cat flash_program_buf.s >> flash_program_buf2.S + echo "FUNC_END(flash_program_buf_end)" >>flash_program_buf2.S + $(CC) -c $(INCLUDE_PATH) -o flash_program_buf.o flash_program_buf2.S + $(AR) rcs $(PREFIX)/lib/libtarget.a flash_program_buf.o + } + make -priority 1 { + flash_query.o: $(REPOSITORY)/$(PACKAGE)/src/flash_query.c + $(CC) -S $(INCLUDE_PATH) $(CFLAGS) -g0 -mcpu=strongarm -fno-function-sections $(REPOSITORY)/$(PACKAGE)/src/flash_query.c + echo "#include " > flash_query2.S + cat flash_query.s >> flash_query2.S + echo "FUNC_END(flash_query_end)" >>flash_query2.S + $(CC) -c $(INCLUDE_PATH) -o flash_query.o flash_query2.S + $(AR) rcs $(PREFIX)/lib/libtarget.a flash_query.o + } +} diff --git a/packages/devs/flash/intel/bootblock/current/src/bootblock_flash.c b/packages/devs/flash/intel/bootblock/current/src/bootblock_flash.c new file mode 100644 --- /dev/null +++ b/packages/devs/flash/intel/bootblock/current/src/bootblock_flash.c @@ -0,0 +1,140 @@ +//========================================================================== +// +// bootblock_flash.c +// +// Flash programming +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas, jskov +// Date: 2000-07-26 +// Purpose: +// Description: +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include +#include + +#define _FLASH_PRIVATE_ +#include + +#include "flash.h" + +#define _si(p) ((p[0]<<8)|p[1]) + +#define DEBUG 0 + +int +flash_hwr_init(void) +{ + unsigned short data[4]; + extern char flash_query, flash_query_end; + typedef int code_fun(unsigned char *); + code_fun *_flash_query; + int code_len, stat, num_regions, region_size; + + // Copy 'program' code to RAM for execution + code_len = (unsigned long)&flash_query_end - (unsigned long)&flash_query; + _flash_query = (code_fun *)flash_info.work_space; + memcpy(_flash_query, &flash_query, code_len); + HAL_DCACHE_SYNC(); // Should guarantee this code will run + + stat = (*_flash_query)(data); +#if DEBUG + printf("stat = %x\n", stat); + dump_buf(data, sizeof(data)); +#endif + + if (data[0] != FLASH_Intel_code) { + printf("Not Intel = %x\n", data[0]); + return FLASH_ERR_HWR; + } + + // FIXME: More devices, comments, etc + if (data[1] == (unsigned short)0x8897) { + num_regions = 64*2; + region_size = 0x20000; + } else if (data[1] == (unsigned short)0x88f4) { + num_regions = 32*4; // 4 devices in serial, each having 32 regions + region_size = 0x10000; + } else { + printf("Unknown device type: %x\n", data[1]); + return FLASH_ERR_HWR; + } + + // Hard wired for now FIXME + flash_info.block_size = region_size; + flash_info.blocks = num_regions; + flash_info.start = (void *)0;//0x10000000 FIXME; + flash_info.end = (void *)(0x10000000+(num_regions*region_size)); + return FLASH_ERR_OK; +} + +// Map a hardware status to a package error +int +flash_hwr_map_error(int err) +{ + if (err & 0x007E007E) { + printf("Err = %x\n", err); + if (err & 0x00400040) { + return FLASH_ERR_ERASE_SUSPEND; + } else + if (err & 0x00040004) { + return FLASH_ERR_PROGRAM_SUSPEND; + } else + if (err & 0x00020002) { + return FLASH_ERR_PROTECT; + } else + if (err & 0x00100010) { + return FLASH_ERR_PROGRAM; + } else + if (err & 0x00200020) { + return FLASH_ERR_ERASE; + } else + return FLASH_ERR_HWR; // FIXME + } else { + return FLASH_ERR_OK; + } +} + +// See if a range of FLASH addresses overlaps currently running code +bool +flash_code_overlaps(void *start, void *end) +{ + extern char _stext, _etext; + + return ((((unsigned long)&_stext >= (unsigned long)start) && + ((unsigned long)&_stext < (unsigned long)end)) || + (((unsigned long)&_etext >= (unsigned long)start) && + ((unsigned long)&_etext < (unsigned long)end))); +} diff --git a/packages/devs/flash/intel/bootblock/current/src/flash.h b/packages/devs/flash/intel/bootblock/current/src/flash.h new file mode 100644 --- /dev/null +++ b/packages/devs/flash/intel/bootblock/current/src/flash.h @@ -0,0 +1,73 @@ +//========================================================================== +// +// flash.h +// +// Flash programming - device constants, etc. +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas +// Date: 2000-07-26 +// Purpose: +// Description: +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#ifndef _FLASH_HWR_H_ +#define _FLASH_HWR_H_ + +// FIXME: must be 16/32 bit depending on use of interleaved parts + +#define FLASH_Read_ID 0x9090 // 9090 +#define FLASH_Read_Status 0x0070 // 0070 +#define FLASH_Clear_Status 0x5050 // 5050 +#define FLASH_Status_Ready 0x0080 // 0080 // Only low 8 bits +#define FLASH_Program 0x4040 // 4040 +#define FLASH_Block_Erase 0x2020 // 2020 +#define FLASH_Suspend 0xB0B0 // B0B0 +#define FLASH_Resume 0xD0D0 // D0D0 +#define FLASH_Confirm 0xD0D0 // D0D0 +#define FLASH_Reset 0xFFFF // FFFF + +#define FLASH_BLOCK_SIZE 0x10000 +#define FLASH_BOOT_BLOCK_SIZE 0x2000 + +#define FLASH_Intel_code 0x89 + + + +#ifndef GO_FAST +# define GO_FAST +# define GO_SLOW +#endif + + +#endif // _FLASH_HWR_H_ diff --git a/packages/devs/flash/intel/bootblock/current/src/flash_erase_block.c b/packages/devs/flash/intel/bootblock/current/src/flash_erase_block.c new file mode 100644 --- /dev/null +++ b/packages/devs/flash/intel/bootblock/current/src/flash_erase_block.c @@ -0,0 +1,106 @@ +//========================================================================== +// +// flash_erase_block.c +// +// Flash programming +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas +// Date: 2000-07-14 +// Purpose: +// Description: +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include "flash.h" + +#include +#include +#include + +// +// CAUTION! This code must be copied to RAM before execution. Therefore, +// it must not contain any code which might be position dependent! +// + +int flash_erase_block(volatile unsigned short *block) +{ + volatile unsigned short *ROM, *sb; + unsigned long stat; + int timeout = 50000; + int len, block_size; + + GO_SLOW + + ROM = (volatile unsigned short *)((unsigned long)block & 0xFF800000); + + // Clear any error conditions + ROM[0] = FLASH_Clear_Status; + + len = FLASH_BLOCK_SIZE; + if (((unsigned long)block - (unsigned long)ROM) < FLASH_BLOCK_SIZE) { + block_size = FLASH_BOOT_BLOCK_SIZE; // First 8 blocks are only 8Kx2 each + } else { + block_size = FLASH_BLOCK_SIZE; + } + sb = block; + while (len > 0) { + // Erase block + ROM[0] = FLASH_Block_Erase; + *block = FLASH_Confirm; + timeout = 5000000; + while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) { + if (--timeout == 0) break; + } + + len -= block_size; + block += block_size / sizeof(*block); + } + + // Restore ROM to "normal" mode + ROM[0] = FLASH_Reset; + + // If an error was reported, see if the block erased anyway + if (stat & 0x007E007E) { + len = FLASH_BLOCK_SIZE; + block = sb; + while (len > 0) { + if (*block++ != 0xFFFFFFFF) break; + len -= sizeof(*block); + } + if (len == 0) stat = 0; + } + + GO_FAST + + return stat; +} diff --git a/packages/devs/flash/intel/bootblock/current/src/flash_program_buf.c b/packages/devs/flash/intel/bootblock/current/src/flash_program_buf.c new file mode 100644 --- /dev/null +++ b/packages/devs/flash/intel/bootblock/current/src/flash_program_buf.c @@ -0,0 +1,95 @@ +//========================================================================== +// +// flash_program_buf.c +// +// Flash programming +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas +// Date: 2000-07-14 +// Purpose: +// Description: +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include "flash.h" + +#include +#include +#include + +// +// CAUTION! This code must be copied to RAM before execution. Therefore, +// it must not contain any code which might be position dependent! +// + +int +flash_program_buf(volatile unsigned short *addr, unsigned short *data, int len) +{ + volatile unsigned short *ROM; + unsigned short stat = 0; + int timeout = 50000; + + GO_SLOW + + ROM = (volatile unsigned short *)((unsigned long)addr & 0xFF800000); + // Clear any error conditions + ROM[0] = FLASH_Clear_Status; + + while (len > 0) { + ROM[0] = FLASH_Program; + *addr = *data; + timeout = 5000000; + while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) { + if (--timeout == 0) { + goto bad; + } + } + if (stat & 0x007E) { + break; + } + ROM[0] = FLASH_Reset; + if (*addr++ != *data++) { + stat = 0x9910; + break; + } + len -= 2; + } + + // Restore ROM to "normal" mode + bad: + ROM[0] = FLASH_Reset; + + GO_FAST + + return stat; +} diff --git a/packages/devs/flash/intel/bootblock/current/src/flash_query.c b/packages/devs/flash/intel/bootblock/current/src/flash_query.c new file mode 100644 --- /dev/null +++ b/packages/devs/flash/intel/bootblock/current/src/flash_query.c @@ -0,0 +1,82 @@ +//========================================================================== +// +// flash_query.c +// +// Flash programming - query device +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas +// Date: 2000-07-26 +// Purpose: +// Description: +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include "flash.h" + +#include +#include +#include +#include CYGHWR_MEMORY_LAYOUT_H + +// +// CAUTION! This code must be copied to RAM before execution. Therefore, +// it must not contain any code which might be position dependent! +// + +#define CNT 200*1000*10 // Approx 20ms + +/* +88F4 0089 88F4 0089 FFC7 0089 88F4 0089 +88F4 0089 88F4 0089 FFC7 0089 88F4 0089 +88F4 0089 88F4 0089 FFC7 0089 88F4 0089 +88F4 0089 88F4 0089 FFC7 0089 88F4 +*/ + +int +flash_query(unsigned short *data) +{ + volatile unsigned short *ROM; + int cnt; + int cache_on; + + ROM = (volatile unsigned short *)0x03000000; + + ROM[0] = FLASH_Read_ID; + for (cnt = CNT; cnt > 0; cnt--) ; + *data++ = *ROM++; // Manufacturer code + *data++ = *ROM++; // Device identifier + + ROM[0] = FLASH_Reset; + + return 0; +} diff --git a/packages/ecos.db b/packages/ecos.db --- a/packages/ecos.db +++ b/packages/ecos.db @@ -113,6 +113,16 @@ package CYGPKG_IO_FLASH { This package contains generic support for FLASH memory." } +package CYGPKG_DEVS_FLASH_INTEL_BOOTBLOCK { + alias { "Support for Intel boot block flash memory" flash_intel_bootblock } + directory devs/flash/intel/bootblock + script flash_intel_bootblock.cdl + hardware + description " + This package contains hardware support for Intel boot block flash memory." +} + + package CYGPKG_DEVS_FLASH_EBSA285 { alias { "FLASH memory support for StrongARM EBSA-285" flash_ebsa285 } @@ -433,6 +443,7 @@ package CYGPKG_DEVS_ETH_POWERPC_QUICC { description "Ethernet driver for PowerPC QUICC (MPC8xx) based boards." } + # Not sure whether this should be "hardware"; if so, it should be mentioned # in all targets that can use it. package CYGPKG_DEVS_ETH_CF { @@ -769,6 +780,8 @@ package CYGPKG_HAL_ARM_EBSA285 { eCos on a Intel EBSA285 StrongARM eval board." } + + package CYGPKG_HAL_ARM_SA11X0 { alias { "Intel SA11X0 Chipset" hal_arm_sa11x0 } directory hal/arm/sa11x0/var @@ -1306,6 +1319,8 @@ target ebsa285 { eCos on an Intel EBSA285 StrongARM board." } + + target assabet { alias { "Intel StrongARM SA1110 board" assabet } packages { CYGPKG_HAL_ARM diff --git a/packages/hal/arm/arch/current/ChangeLog b/packages/hal/arm/arch/current/ChangeLog --- a/packages/hal/arm/arch/current/ChangeLog +++ b/packages/hal/arm/arch/current/ChangeLog @@ -1,3 +1,26 @@ +2000-11-16 Jesper Skov + + * include/basetype.h: Define LABEL mangling macros. + + * include/arch.inc: Added. + +2000-11-06 Mark Salter + + * src/hal_syscall.c: New file. Arm interface to redboot's + handler for GNUPro based application library syscalls. + + * src/arm_stub.c (__is_bsp_syscall): New function. Return + true if exception caused by bsp SWI. + + * include/arm_stub.h: Add declaration for __is_bp_syscall. + + * cdl/hal_arm.cdl: Add hal_syscall.c to compile list. + +2000-11-04 Mark Salter + + * src/arm_stub.c (__computeSignal): New interface for + HAL_STUB_IS_STOPPED_BY_HARDWARE + 2000-10-27 Mark Salter * src/arm_stub.c: Removed uneccesary include. diff --git a/packages/hal/arm/arch/current/cdl/hal_arm.cdl b/packages/hal/arm/arch/current/cdl/hal_arm.cdl --- a/packages/hal/arm/arch/current/cdl/hal_arm.cdl +++ b/packages/hal/arm/arch/current/cdl/hal_arm.cdl @@ -56,7 +56,7 @@ cdl_package CYGPKG_HAL_ARM { implements CYGINT_HAL_DIAG_DISABLE_GDB_PROTOCOL_SUPPORTED - compile hal_misc.c context.S arm_stub.c + compile hal_misc.c context.S arm_stub.c hal_syscall.c # The "-o file" is a workaround for CR100958 - without it the # output file would end up in the source directory under CygWin. diff --git a/packages/hal/arm/arch/current/include/arch.inc b/packages/hal/arm/arch/current/include/arch.inc new file mode 100644 --- /dev/null +++ b/packages/hal/arm/arch/current/include/arch.inc @@ -0,0 +1,70 @@ +##============================================================================= +## +## arch.inc +## +## ARM architecture assembler header file +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Red Hat eCos Public License +# Version 1.1 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.redhat.com/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Configurable Operating System, +# released September 30, 1998. +# +# The Initial Developer of the Original Code is Red Hat. +# Portions created by Red Hat are +# Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +# All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): jskov +## Contributors:jskov +## Date: 2000-11-15 +## Purpose: ARM definitions. +## Description: This file contains various definitions and macros that are +## useful for writing assembly code for the ARM +## It also includes the variant/platform assembly header file. +## Usage: +## #include +## ... +## +## +######DESCRIPTIONEND#### +## +##============================================================================= + +#include + +##----------------------------------------------------------------------------- +## ARM entry definitions. This allows _ prefixing to change by modifying +## the CYG_LABEL_DEFN macro. + +#define FUNC_START(name) \ + .type CYG_LABEL_DEFN(name),@function; \ + .globl CYG_LABEL_DEFN(name); \ +CYG_LABEL_DEFN(name): + +#define FUNC_END(name) \ + .globl CYG_LABEL_DEFN(name); \ +CYG_LABEL_DEFN(name): + +#define SYM_DEF(name) \ + .globl CYG_LABEL_DEFN(name); \ +CYG_LABEL_DEFN(name): + +#------------------------------------------------------------------------------ +# end of arch.inc diff --git a/packages/hal/arm/arch/current/include/arm_stub.h b/packages/hal/arm/arch/current/include/arm_stub.h --- a/packages/hal/arm/arch/current/include/arm_stub.h +++ b/packages/hal/arm/arch/current/include/arm_stub.h @@ -110,6 +110,8 @@ extern void __install_breakpoints (void) extern void __clear_breakpoints (void); +extern int __is_bsp_syscall(void); + //------------------------------------------------------------------------ // Special definition of CYG_HAL_GDB_ENTER_CRITICAL_IO_REGION diff --git a/packages/hal/arm/arch/current/include/basetype.h b/packages/hal/arm/arch/current/include/basetype.h --- a/packages/hal/arm/arch/current/include/basetype.h +++ b/packages/hal/arm/arch/current/include/basetype.h @@ -57,7 +57,8 @@ //----------------------------------------------------------------------------- // ARM does not usually use labels with underscores. -//#define CYG_LABEL_NAME(_name_) _name_ +#define CYG_LABEL_NAME(_name_) _name_ +#define CYG_LABEL_DEFN(_name_) _name_ //----------------------------------------------------------------------------- // Override the alignment definitions from cyg_type.h. ARM only allows 4 diff --git a/packages/hal/arm/arch/current/include/hal_io.h b/packages/hal/arm/arch/current/include/hal_io.h --- a/packages/hal/arm/arch/current/include/hal_io.h +++ b/packages/hal/arm/arch/current/include/hal_io.h @@ -202,7 +202,8 @@ typedef volatile CYG_ADDRWORD HAL_IO_REG // Include plf_io.h for platforms that define it. // FIXME: It should be possible to handle this better with CDL; define // CYGBLD_HAL_PLATFORM_IO or similar where appropriate. -#ifdef CYGPKG_HAL_ARM_EBSA285 +#if defined(CYGPKG_HAL_ARM_EBSA285) \ + || defined(CYGPKG_HAL_ARM_SA110) #include #endif diff --git a/packages/hal/arm/arch/current/src/arm_stub.c b/packages/hal/arm/arch/current/src/arm_stub.c --- a/packages/hal/arm/arch/current/src/arm_stub.c +++ b/packages/hal/arm/arch/current/src/arm_stub.c @@ -46,6 +46,10 @@ #include +#ifdef CYGPKG_REDBOOT +#include +#endif + #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS #ifdef CYGPKG_HAL_ARM_SIM @@ -79,8 +83,11 @@ int __computeSignal (unsigned int trap_n { // Check to see if we stopped because of a hw watchpoint/breakpoint. #ifdef HAL_STUB_IS_STOPPED_BY_HARDWARE - if (HAL_STUB_IS_STOPPED_BY_HARDWARE(trap_number)) - return SIGTRAP; + { + void *daddr; + if (HAL_STUB_IS_STOPPED_BY_HARDWARE(daddr)) + return SIGTRAP; + } #endif // should also catch CYGNUM_HAL_VECTOR_UNDEF_INSTRUCTION here but we // can't tell the different between a real one and a breakpoint :-( @@ -106,6 +113,14 @@ int __get_trap_number (void) return _hal_registers->vector; } + +#if defined(CYGSEM_REDBOOT_BSP_SYSCALLS) +int __is_bsp_syscall(void) +{ + return _hal_registers->vector == CYGNUM_HAL_EXCEPTION_INTERRUPT; +} +#endif + /* Set the currently-saved pc register value to PC. */ void set_pc (target_register_t pc) diff --git a/packages/hal/arm/arch/current/src/hal_syscall.c b/packages/hal/arm/arch/current/src/hal_syscall.c new file mode 100644 --- /dev/null +++ b/packages/hal/arm/arch/current/src/hal_syscall.c @@ -0,0 +1,119 @@ +//============================================================================= +// +// hal_syscall.c +// +// +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): msalter +// Contributors:msalter +// Date: 2000-11-5 +// Purpose: +// Description: +// +// +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +#ifdef CYGPKG_REDBOOT +#include +#endif + +#if defined(CYGSEM_REDBOOT_BSP_SYSCALLS) + +#include // Our header +#include // HAL_BREAKINST +#include // HAL_xCACHE_x +#include // interrupt disable/restore + +#include // ROM calling interface +#include // Helper functions + +extern int __do_syscall(int func, // syscall function number + long arg1, long arg2, // up to four args. + long arg3, long arg4, + int *retval); // syscall return value + +#define SYS_exit 1 +#define SYS_interrupt 1000 + +int +hal_syscall_handler(void) +{ + int func, arg1, arg2, arg3, arg4; + int err; + +#if 0 + union arm_insn inst; + + // What is the instruction we were executing + // + inst.word = *(unsigned long *)(regs->_pc - ARM_INST_SIZE); + + // Not a syscall. Don't handle it + if ((inst.swi.rsv1 != SWI_RSV1_VALUE) || (inst.swi.swi_number != SYSCALL_SWI)) + return 0; +#endif + + func = get_register(R0); + arg1 = get_register(R1); + arg2 = get_register(R2); + arg3 = get_register(R3); + arg4 = *(unsigned int *)(get_register(SP) + 4); + + if ((get_register(PS) & CPSR_MODE_BITS) == CPSR_SUPERVISOR_MODE) + put_register(PC, get_register(IP)); + else + put_register(PC, get_register(LR)); + + if (func == SYS_exit) { + // We want to stop in exit so that the user may poke around + // to see why his app exited. + return SIGTRAP; + } + + if (func == SYS_interrupt) { + // A console interrupt landed us here. + // Invoke the debug agent so as to cause a SIGINT. + return SIGINT; + } + + if (__do_syscall(func, arg1, arg2, arg3, arg4, &err)) { + put_register(R0, err); + return 0; + } + + return SIGTRAP; +} + +#endif // CYGSEM_REDBOOT_BSP_SYSCALLS diff --git a/packages/hal/arm/edb7xxx/current/ChangeLog b/packages/hal/arm/edb7xxx/current/ChangeLog --- a/packages/hal/arm/edb7xxx/current/ChangeLog +++ b/packages/hal/arm/edb7xxx/current/ChangeLog @@ -1,3 +1,7 @@ +2000-11-06 Jesper Skov + + * tests/dram_test.c: Add kernel check. + 2000-10-26 Jonathan Larmour * misc/edb7211_redboot_ROM.cfg: Ensure CYGSEM_HAL_ROM_MONITOR is diff --git a/packages/hal/arm/edb7xxx/current/tests/dram_test.c b/packages/hal/arm/edb7xxx/current/tests/dram_test.c --- a/packages/hal/arm/edb7xxx/current/tests/dram_test.c +++ b/packages/hal/arm/edb7xxx/current/tests/dram_test.c @@ -37,10 +37,17 @@ // Description: Tool used to test DRAM on eval boards //####DESCRIPTIONEND#### +#include +#include + +#ifdef CYGPKG_KERNEL + #include // Configuration header + +#ifdef CYGFUN_KERNEL_API_C + #include #include -#include #include #include CYGHWR_MEMORY_LAYOUT_H // Memory layout @@ -313,3 +320,20 @@ cyg_start( void ) cyg_scheduler_start(); } // cyg_package_start() +#else /* def CYGFUN_KERNEL_API_C */ +# define NA_MSG "Kernel C API layer disabled" +#endif + +#else /* def CYGPKG_KERNEL */ +# define NA_MSG "No kernel" +#endif + + +#ifdef NA_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_NA(NA_MSG); +} +#endif diff --git a/packages/hal/arm/sa11x0/brutus/current/ChangeLog b/packages/hal/arm/sa11x0/brutus/current/ChangeLog --- a/packages/hal/arm/sa11x0/brutus/current/ChangeLog +++ b/packages/hal/arm/sa11x0/brutus/current/ChangeLog @@ -1,3 +1,7 @@ +2000-11-10 Gary Thomas + + * cdl/hal_arm_sa11x0_brutus.cdl: Add RedBoot configuration. + 2000-10-20 Jonathan Larmour * include/pkgconf/mlt_arm_sa11x0_brutus_ram.mlt: diff --git a/packages/hal/arm/sa11x0/brutus/current/cdl/hal_arm_sa11x0_brutus.cdl b/packages/hal/arm/sa11x0/brutus/current/cdl/hal_arm_sa11x0_brutus.cdl --- a/packages/hal/arm/sa11x0/brutus/current/cdl/hal_arm_sa11x0_brutus.cdl +++ b/packages/hal/arm/sa11x0/brutus/current/cdl/hal_arm_sa11x0_brutus.cdl @@ -304,4 +304,32 @@ cdl_package CYGPKG_HAL_ARM_SA11X0_BRUTUS interrupt stack when exceptions are generated." } + cdl_component CYGPKG_REDBOOT_HAL_OPTIONS { + display "Redboot HAL options" + flavor none + no_define + parent CYGPKG_REDBOOT + active_if CYGPKG_REDBOOT + description " + This option lists the target's requirements for a valid Redboot + configuration." + + cdl_option CYGBLD_BUILD_REDBOOT_BIN { + display "Build Redboot ROM binary image" + active_if CYGBLD_BUILD_REDBOOT + default_value 1 + no_define + description "This option enables the conversion of the Redboot ELF + image to a binary image suitable for ROM programming." + +# compile -library=libextras.a redboot_cmds.c + + make -priority 325 { + /bin/redboot.bin : /bin/redboot.elf + $(OBJCOPY) --strip-debug $< $(@:.bin=.img) + $(OBJCOPY) -O srec $< $(@:.bin=.srec) + $(OBJCOPY) -O binary $< $@ + } + } + } } diff --git a/packages/hal/arm/sa11x0/sa1100mm/current/ChangeLog b/packages/hal/arm/sa11x0/sa1100mm/current/ChangeLog --- a/packages/hal/arm/sa11x0/sa1100mm/current/ChangeLog +++ b/packages/hal/arm/sa11x0/sa1100mm/current/ChangeLog @@ -1,3 +1,17 @@ +2000-11-13 Drew Moseley + + * misc/redboot_ROM.cfg: Turn on REDBOOT_BSP_SYSCALLS. + * misc/redboot_RAM.cfg: Ditto. + +2000-11-09 Drew Moseley + + * misc/redboot_ROM.cfg: New import file for ecosconfig. + * misc/redboot_RAM.cfg: Ditto. + +2000-11-06 Drew Moseley + + * cdl/hal_arm_sa11x0_sa1100mm.cdl: Use the "-mapcs-frame" compile option. + 2000-10-25 Drew Moseley * src/sa1100mm_misc.c: New file. Support for SA1100 Multimedia diff --git a/packages/hal/arm/sa11x0/sa1100mm/current/cdl/hal_arm_sa11x0_sa1100mm.cdl b/packages/hal/arm/sa11x0/sa1100mm/current/cdl/hal_arm_sa11x0_sa1100mm.cdl --- a/packages/hal/arm/sa11x0/sa1100mm/current/cdl/hal_arm_sa11x0_sa1100mm.cdl +++ b/packages/hal/arm/sa11x0/sa1100mm/current/cdl/hal_arm_sa11x0_sa1100mm.cdl @@ -163,7 +163,7 @@ cdl_package CYGPKG_HAL_ARM_SA11X0_SA1100 display "Global compiler flags" flavor data no_define - default_value { "-mcpu=strongarm1100 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" } + default_value { "-mcpu=strongarm1100 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority -mapcs-frame" } description " This option controls the global compiler flags which are used to compile all packages by default. Individual packages may define diff --git a/packages/hal/arm/sa11x0/sa1100mm/current/misc/redboot_RAM.cfg b/packages/hal/arm/sa11x0/sa1100mm/current/misc/redboot_RAM.cfg new file mode 100644 --- /dev/null +++ b/packages/hal/arm/sa11x0/sa1100mm/current/misc/redboot_RAM.cfg @@ -0,0 +1,55 @@ +cdl_savefile_version 1; +cdl_savefile_command cdl_savefile_version {}; +cdl_savefile_command cdl_savefile_command {}; +cdl_savefile_command cdl_configuration { description hardware template package }; +cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value }; +cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value }; +cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value }; +cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value }; + +cdl_configuration eCos { + description "" ; + hardware sa1100mm ; + template redboot ; + package -hardware CYGPKG_HAL_ARM current ; + package -hardware CYGPKG_HAL_ARM_SA11X0_SA1100MM current ; + package -hardware CYGPKG_IO_PCI current ; + package -hardware CYGPKG_IO_SERIAL_ARM_SA11X0 current ; + package -template CYGPKG_HAL current ; + package -template CYGPKG_INFRA current ; + package -template CYGPKG_REDBOOT current ; + package CYGPKG_IO_FLASH current ; + package CYGPKG_DEVS_FLASH_SA1100MM current ; +}; + +cdl_option CYGBLD_BUILD_GDB_STUBS { + user_value 0 +}; + +cdl_option CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS { + inferred_value 1 +}; + +cdl_option CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT { + inferred_value 0 +}; + +cdl_option CYGSEM_HAL_VIRTUAL_VECTOR_DIAG { + user_value 1 +}; + +cdl_option CYGSEM_HAL_USE_ROM_MONITOR { + inferred_value 0 0 +}; + +cdl_option CYGBLD_BUILD_REDBOOT { + user_value 1 +}; + +cdl_component CYG_HAL_STARTUP { + user_value RAM +}; + +cdl_option CYGSEM_REDBOOT_BSP_SYSCALLS { + inferred_value 1 +}; diff --git a/packages/hal/arm/sa11x0/sa1100mm/current/misc/redboot_ROM.cfg b/packages/hal/arm/sa11x0/sa1100mm/current/misc/redboot_ROM.cfg new file mode 100644 --- /dev/null +++ b/packages/hal/arm/sa11x0/sa1100mm/current/misc/redboot_ROM.cfg @@ -0,0 +1,59 @@ +cdl_savefile_version 1; +cdl_savefile_command cdl_savefile_version {}; +cdl_savefile_command cdl_savefile_command {}; +cdl_savefile_command cdl_configuration { description hardware template package }; +cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value }; +cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value }; +cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value }; +cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value }; + +cdl_configuration eCos { + description "" ; + hardware sa1100mm ; + template redboot ; + package -hardware CYGPKG_HAL_ARM current ; + package -hardware CYGPKG_HAL_ARM_SA11X0_SA1100MM current ; + package -hardware CYGPKG_IO_PCI current ; + package -hardware CYGPKG_IO_SERIAL_ARM_SA11X0 current ; + package -template CYGPKG_HAL current ; + package -template CYGPKG_INFRA current ; + package -template CYGPKG_REDBOOT current ; + package CYGPKG_IO_FLASH current ; + package CYGPKG_DEVS_FLASH_SA1100MM current ; +}; + +cdl_option CYGBLD_BUILD_GDB_STUBS { + user_value 0 +}; + +cdl_option CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS { + inferred_value 1 +}; + +cdl_option CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT { + inferred_value 0 +}; + +cdl_option CYGSEM_HAL_VIRTUAL_VECTOR_DIAG { + user_value 1 +}; + +cdl_option CYGSEM_HAL_USE_ROM_MONITOR { + inferred_value 0 0 +}; + +cdl_option CYGBLD_BUILD_REDBOOT { + user_value 1 +}; + +cdl_component CYG_HAL_STARTUP { + user_value ROM +}; + +cdl_option CYGSEM_HAL_ROM_MONITOR { + user_value 1 +}; + +cdl_option CYGSEM_REDBOOT_BSP_SYSCALLS { + inferred_value 1 +}; diff --git a/packages/hal/common/current/ChangeLog b/packages/hal/common/current/ChangeLog --- a/packages/hal/common/current/ChangeLog +++ b/packages/hal/common/current/ChangeLog @@ -1,3 +1,31 @@ +2000-11-17 Jesper Skov + + * src/hal_if.c (delay_us): Add dummy loop. + Duh! Take usecs argment into account. + +2000-11-06 Mark Salter + + * src/generic-stub.c (__handle_exception): Add support for GNUPro bsp + syscall handling. + + * src/board.h: Include pkgconf/redboot.h for CYGSEM_REDBOOT_BSP_SYSCALLS. + +2000-11-06 Jesper Skov + + * src/hal_if.c (hal_if_diag_write_char): Clear interrupt flag before + setting breakpoint. + +2000-11-04 Mark Salter + + * src/hal_stub.c (__build_t_packet): Report reason and data + address if stopped by hw watchpoint. + + * src/generic-stub.c (__process_packet): Remove experimental + support for type 5 Z packet. + + * include/hal_stub.h: Define HAL_STUB_STOP_* reasons returned + by HAL_IS_STOPPED_BY_HARDWARE. + 2000-10-27 Mark Salter * src/generic-stub.c: Fixed preprocessor warning. diff --git a/packages/hal/common/current/include/hal_stub.h b/packages/hal/common/current/include/hal_stub.h --- a/packages/hal/common/current/include/hal_stub.h +++ b/packages/hal/common/current/include/hal_stub.h @@ -125,6 +125,15 @@ externC void __stub_copy_registers(targe target_register_t *src); //---------------------------------------------------------------------------- +// Hardware Watch/Breakpoint support. These are the possible return values +// of HAL_STUB_IS_STOPPED_BY_HARDWARE(). +#define HAL_STUB_HW_STOP_NONE 0 // target did not stop for hw watch/break +#define HAL_STUB_HW_STOP_BREAK 1 // target stopped for hw breakpoint +#define HAL_STUB_HW_STOP_WATCH 2 // target stopped for write-only watchpoint +#define HAL_STUB_HW_STOP_RWATCH 3 // target stopped for read-only watchpoint +#define HAL_STUB_HW_STOP_AWATCH 4 // target stopped for access watchpoint + +//---------------------------------------------------------------------------- // Memory accessor functions. #define TARGET_HAS_OWN_MEM_FUNCS diff --git a/packages/hal/common/current/src/board.h b/packages/hal/common/current/src/board.h --- a/packages/hal/common/current/src/board.h +++ b/packages/hal/common/current/src/board.h @@ -52,6 +52,10 @@ #include +#ifdef CYGPKG_REDBOOT +#include +#endif + //----------------------------------------------------------------------------- #endif // CYGONCE_HAL_BOARD_H // End of board.h diff --git a/packages/hal/common/current/src/generic-stub.c b/packages/hal/common/current/src/generic-stub.c --- a/packages/hal/common/current/src/generic-stub.c +++ b/packages/hal/common/current/src/generic-stub.c @@ -781,6 +781,19 @@ void if (__cleanup_vec != NULL) __cleanup_vec (); +#if defined(CYGSEM_REDBOOT_BSP_SYSCALLS) + // Temporary support for gnupro bsp SWIs + if (__is_bsp_syscall()) + { + if (hal_syscall_handler() == 0) + { + if (__init_vec != NULL) + __init_vec (); + return; + } + } +#endif + #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT // Special case for GDB BREAKs. This flag is set by cyg_stub_cleanup. if (cyg_hal_gdb_break) { @@ -789,6 +802,7 @@ void } else #endif sigval = __computeSignal (__get_trap_number ()); + #else // __ECOS__ /* reply to host that an exception has occurred */ sigval = __computeSignal (__get_trap_number ()); @@ -1369,12 +1383,6 @@ int strcpy (remcomOutBuffer, "E02"); } break; - - // FIXME !!Test only!! - case 5: - addr = (target_register_t)HAL_STUB_HW_STOPPED_DATA_ADDRESS(); - __mem2hex ((char *)&addr, remcomOutBuffer, sizeof(target_register_t), 0); - break; #endif } } diff --git a/packages/hal/common/current/src/hal_if.c b/packages/hal/common/current/src/hal_if.c --- a/packages/hal/common/current/src/hal_if.c +++ b/packages/hal/common/current/src/hal_if.c @@ -105,9 +105,20 @@ delay_us(cyg_int32 usecs) CYGARC_HAL_RESTORE_GP(); #else +#ifdef HAL_DELAY_US // Use a HAL feature if defined -#ifdef HAL_DELAY_US HAL_DELAY_US(usecs); +#else + // If no accurate delay mechanism, just spin for a while. Having + // an inaccurate delay is much better than no delay at all. The + // count of 100 should mean the loop takes something resembling + // 1us on most CPUs running between 30-100MHz [depends on how many + // instructions this compiles to, how many dispatch units can be + // used for the simple loop, actual CPU frequency, etc] + while (usecs-- > 0) { + int i; + for (i = 0; i < 100; i++); + } #endif #endif } @@ -355,8 +366,8 @@ hal_if_diag_write_char(char c) // Check interrupt flag if (CYGACC_CALL_IF_CONSOLE_INTERRUPT_FLAG()) { + CYGACC_CALL_IF_CONSOLE_INTERRUPT_FLAG_SET(0); cyg_hal_user_break(0); - CYGACC_CALL_IF_CONSOLE_INTERRUPT_FLAG_SET(0); } } diff --git a/packages/hal/common/current/src/hal_stub.c b/packages/hal/common/current/src/hal_stub.c --- a/packages/hal/common/current/src/hal_stub.c +++ b/packages/hal/common/current/src/hal_stub.c @@ -81,6 +81,21 @@ target_register_t registers[NUMREGS]; target_register_t alt_registers[NUMREGS] ; // Thread or saved process state target_register_t * _registers = registers; // Pointer to current set of registers +#if defined(HAL_STUB_HW_WATCHPOINT) || defined(HAL_STUB_HW_BREAKPOINT) +static int _hw_stop_reason; // Reason we were stopped by hw. + +// strings indexed by hw stop reasons defined in hal_stub.h +static const char * const _hw_stop_str[] = { + "", + "hbreak", + "watch", + "rwatch", + "awatch" +}; + +static void *_watch_data_addr; // The data address if stopped by watchpoint +#endif + // Register validity checking #ifdef CYGHWR_REGISTER_VALIDITY_CHECKING int registers_valid[NUMREGS]; @@ -470,6 +485,14 @@ handle_exception_cleanup( void ) // seem like an interrupt rather than having hit a breakpoint. cyg_hal_gdb_break = cyg_hal_gdb_remove_break(get_register (PC)); #endif + +#if defined(HAL_STUB_HW_WATCHPOINT) || defined(HAL_STUB_HW_BREAKPOINT) + // For HW watchpoint/breakpoint support, we need to know if we + // stopped because of watchpoint or hw break. We do that here + // before GDB has a chance to remove the watchpoints and save + // the information for later use in building response packets. + _hw_stop_reason = HAL_STUB_IS_STOPPED_BY_HARDWARE(_watch_data_addr); +#endif } // Called at stub *exit* @@ -652,6 +675,24 @@ void } #endif +#ifdef HAL_STUB_HW_WATCHPOINT + switch(_hw_stop_reason) { + case HAL_STUB_HW_STOP_WATCH: + case HAL_STUB_HW_STOP_RWATCH: + case HAL_STUB_HW_STOP_AWATCH: + strcpy(ptr, _hw_stop_str[_hw_stop_reason]); + ptr += strlen(_hw_stop_str[_hw_stop_reason]); + *ptr++ = ':'; + // Send address MSB first + ptr += __intToHex(ptr, (target_register_t)_watch_data_addr, + sizeof(_watch_data_addr) * 8); + *ptr++ = ';'; + break; + default: + break; + } +#endif + *ptr++ = __tohex (PC >> 4); *ptr++ = __tohex (PC); *ptr++ = ':'; diff --git a/packages/hal/powerpc/arch/current/ChangeLog b/packages/hal/powerpc/arch/current/ChangeLog --- a/packages/hal/powerpc/arch/current/ChangeLog +++ b/packages/hal/powerpc/arch/current/ChangeLog @@ -1,3 +1,19 @@ +2000-11-04 Gary Thomas + + * src/vectors.S: Minor changes in support of PPC40x. This + platform has no cache control - if the MMU is on, it's on. + This causes some interesting cache coherency problems in the + interrupt/exception handlers. Note: it may be possible to + overcome this by use of the DCCR register (untested). + + * src/powerpc.ld: Fix problems with 'sbss6', etc. + + * src/hal_mk_defs.c: Use variant/platform macros for additional + symbols, rather than direcly polluting this file. + + * include/hal_intr.h: Allow variant/platform to define clock + setup (since the 40x does not have a decrementer!) + 2000-10-31 Jonathan Larmour * src/powerpc.ld: Use .sdata.* rather than .sdata* so that .sdata2 diff --git a/packages/hal/powerpc/arch/current/include/hal_intr.h b/packages/hal/powerpc/arch/current/include/hal_intr.h --- a/packages/hal/powerpc/arch/current/include/hal_intr.h +++ b/packages/hal/powerpc/arch/current/include/hal_intr.h @@ -143,9 +143,6 @@ #define CYGNUM_HAL_EXCEPTION_COUNT \ ( CYGNUM_HAL_EXCEPTION_MAX - CYGNUM_HAL_EXCEPTION_MIN + 1 ) -// The vector used by the Real time clock -#define CYGNUM_HAL_INTERRUPT_RTC CYGNUM_HAL_INTERRUPT_DECREMENTER - //-------------------------------------------------------------------------- // Static data used by HAL @@ -340,6 +337,9 @@ externC void cyg_hal_default_exception_v //-------------------------------------------------------------------------- // Clock control +#ifndef CYGHWR_HAL_CLOCK_DEFINED +// Note: variant or platform allowed to override these definitions + #define HAL_CLOCK_INITIALIZE( _period_ ) \ CYG_MACRO_START \ asm volatile ( \ @@ -395,6 +395,13 @@ externC void cyg_hal_default_exception_v extern void hal_delay_us(int); #define HAL_DELAY_US(n) hal_delay_us(n) +// The vector used by the Real time clock +#ifndef CYGNUM_HAL_INTERRUPT_RTC +#define CYGNUM_HAL_INTERRUPT_RTC CYGNUM_HAL_INTERRUPT_DECREMENTER +#endif // CYGNUM_HAL_INTERRUPT_RTC + +#endif // CYGHWR_HAL_CLOCK_DEFINED + //-------------------------------------------------------------------------- // Variant functions externC void hal_variant_IRQ_init(void); diff --git a/packages/hal/powerpc/arch/current/include/ppc_regs.h b/packages/hal/powerpc/arch/current/include/ppc_regs.h --- a/packages/hal/powerpc/arch/current/include/ppc_regs.h +++ b/packages/hal/powerpc/arch/current/include/ppc_regs.h @@ -54,7 +54,6 @@ #include - //-------------------------------------------------------------------------- // SPR access macros. #define CYGARC_MTSPR(_spr_, _v_) \ diff --git a/packages/hal/powerpc/arch/current/src/hal_mk_defs.c b/packages/hal/powerpc/arch/current/src/hal_mk_defs.c --- a/packages/hal/powerpc/arch/current/src/hal_mk_defs.c +++ b/packages/hal/powerpc/arch/current/src/hal_mk_defs.c @@ -122,8 +122,8 @@ main(void) DEFINE(CYGNUM_HAL_VSR_COUNT, CYGNUM_HAL_VSR_COUNT); // Variant definitions - want these to be included instead. -#ifdef CYGPKG_HAL_POWERPC_MPC8xx - DEFINE(CYGNUM_HAL_VECTOR_NMI, CYGNUM_HAL_VECTOR_NMI); +#ifdef CYGARC_VARIANT_DEFS + CYGARC_VARIANT_DEFS #endif // Memory layout values (since these aren't "asm"-safe) diff --git a/packages/hal/powerpc/arch/current/src/powerpc.ld b/packages/hal/powerpc/arch/current/src/powerpc.ld --- a/packages/hal/powerpc/arch/current/src/powerpc.ld +++ b/packages/hal/powerpc/arch/current/src/powerpc.ld @@ -122,7 +122,7 @@ GROUP(libtarget.a libgcc.a) .sbss _vma_ : _lma_ \ { __sbss_start = ABSOLUTE (.); \ __SBSS_START__ = ABSOLUTE(.); *(.sbss.*) __SBSS_END__ = ABSOLUTE(.); \ - __SBSS2_START__ = ABSOLUTE(.); *(.sbss2*) __SBSS2_END__ = ABSOLUTE(.);\ + __SBSSx_START__ = ABSOLUTE(.); *(.sbss*) __SBSSx_END__ = ABSOLUTE(.);\ *(.scommon*) \ __sbss_end = ABSOLUTE (.); } \ > _region_ diff --git a/packages/hal/powerpc/arch/current/src/vectors.S b/packages/hal/powerpc/arch/current/src/vectors.S --- a/packages/hal/powerpc/arch/current/src/vectors.S +++ b/packages/hal/powerpc/arch/current/src/vectors.S @@ -413,6 +413,25 @@ cyg_hal_default_exception_vsr: subi sp,sp,CYGARC_PPC_EXCEPTION_DECREMENT # leave space for registers and # a safety margin +#ifdef CYGPKG_HAL_POWERPC_PPC40x +// The caches on this processor are always enabled when the MMU is on +// (and disabled when off). Thus we need to be careful about cache +// polution and staleness when changing the MMU state. +// At this point, the MMU is off due to the exception. We need to +// flush the part of the cache which may be touched before the MMU +// is reenabled so that memory will be consistent when that happens. +// Of course, this is complicated by the fact that there are no "free" +// registers at this point in the code. + dcbf 0,sp // Flushes first line + stw r3,0(sp) // This is now safe + li r3,CYGARC_PPCREG_VECTOR // Flush lines which will be changed + dcbf r3,sp + li r3,CYGARC_PPCREG_CR + dcbf r3,sp + li r3,CYGARC_PPCREG_LR + dcbf r3,sp + lwz r3,0(sp) // Restore register +#endif # First, save away some registers stw r3,CYGARC_PPCREG_VECTOR(sp) # stash vector @@ -542,7 +561,26 @@ cyg_hal_default_interrupt_vsr: subi sp,sp,CYGARC_PPC_EXCEPTION_DECREMENT # leave space for registers and # a safety margin - +#ifdef CYGPKG_HAL_POWERPC_PPC40x +// The caches on this processor are always enabled when the MMU is on +// (and disabled when off). Thus we need to be careful about cache +// polution and staleness when changing the MMU state. +// At this point, the MMU is off due to the exception. We need to +// flush the part of the cache which may be touched before the MMU +// is reenabled so that memory will be consistent when that happens. +// Of course, this is complicated by the fact that there are no "free" +// registers at this point in the code. + dcbf 0,sp // Flushes first line + stw r3,0(sp) // This is now safe + li r3,CYGARC_PPCREG_VECTOR // Flush lines which will be changed + dcbf r3,sp + li r3,CYGARC_PPCREG_CR + dcbf r3,sp + li r3,CYGARC_PPCREG_LR + dcbf r3,sp + lwz r3,0(sp) // Restore register +#endif + stw r3,CYGARC_PPCREG_VECTOR(sp) # stash vector stw r4,CYGARC_PPCREG_CR(sp) # stash CR stw r5,CYGARC_PPCREG_LR(sp) # stash LR diff --git a/packages/hal/powerpc/mpc8xx/current/ChangeLog b/packages/hal/powerpc/mpc8xx/current/ChangeLog --- a/packages/hal/powerpc/mpc8xx/current/ChangeLog +++ b/packages/hal/powerpc/mpc8xx/current/ChangeLog @@ -1,3 +1,7 @@ +2000-11-04 Gary Thomas + + * include/var_intr.h: Export symbols used in assembly code. + 2000-06-19 Jesper Skov * include/var_regs.h: diff --git a/packages/hal/powerpc/mpc8xx/current/include/var_intr.h b/packages/hal/powerpc/mpc8xx/current/include/var_intr.h --- a/packages/hal/powerpc/mpc8xx/current/include/var_intr.h +++ b/packages/hal/powerpc/mpc8xx/current/include/var_intr.h @@ -686,5 +686,10 @@ externC cyg_uint32 hal_arbitration_isr_c #endif // ifdef CYGPKG_HAL_POWERPC_MPC860 //----------------------------------------------------------------------------- +// Symbols used by assembly code +#define CYGARC_VARIANT_DEFS \ + DEFINE(CYGNUM_HAL_VECTOR_NMI, CYGNUM_HAL_VECTOR_NMI); + +//----------------------------------------------------------------------------- #endif // ifndef CYGONCE_VAR_INTR_H // End of var_intr.h diff --git a/packages/hal/powerpc/ppc40x/current/ChangeLog b/packages/hal/powerpc/ppc40x/current/ChangeLog --- a/packages/hal/powerpc/ppc40x/current/ChangeLog +++ b/packages/hal/powerpc/ppc40x/current/ChangeLog @@ -1,3 +1,23 @@ +2000-11-04 Gary Thomas + + * src/var_misc.c: Define clock handling for PPC40x (different + from default since there is no decrementer). + + * include/variant.inc: Special interrupt fielder for timers. + Add interrupt decode. + + * include/var_regs.h: Define architecture (variant) specific + registers and special instructions used to access them. + + * src/var_intr.c: + * include/var_intr.h: Define proper interrupt support for + this platform. + + * include/var_cache.h: Fix details of cache on PPC40x. Note: + the data cache has problems - currently left disabled. + + * cdl/hal_powerpc_ppc40x.cdl: Add support for ROM_MONITOR. + //=========================================================================== //####COPYRIGHTBEGIN#### // diff --git a/packages/hal/powerpc/ppc40x/current/cdl/hal_powerpc_ppc40x.cdl b/packages/hal/powerpc/ppc40x/current/cdl/hal_powerpc_ppc40x.cdl --- a/packages/hal/powerpc/ppc40x/current/cdl/hal_powerpc_ppc40x.cdl +++ b/packages/hal/powerpc/ppc40x/current/cdl/hal_powerpc_ppc40x.cdl @@ -78,5 +78,29 @@ cdl_package CYGPKG_HAL_POWERPC_PPC40x { puts $::cdl_header "#include " } + + cdl_interface CYGINT_HAL_USE_ROM_MONITOR_UNSUPPORTED { + display "ROM monitor configuration is unsupported" + no_define + } + + cdl_option CYGSEM_HAL_USE_ROM_MONITOR { + display "Work with a ROM monitor" + flavor bool + default_value { (CYG_HAL_STARTUP == "RAM" && + !CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS && + !CYGINT_HAL_USE_ROM_MONITOR_UNSUPPORTED && + !CYGSEM_HAL_POWERPC_COPY_VECTORS) ? 1 : 0 } + parent CYGPKG_HAL_ROM_MONITOR + requires { CYG_HAL_STARTUP == "RAM" } + requires ! CYGSEM_HAL_POWERPC_COPY_VECTORS + requires ! CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + requires ! CYGINT_HAL_USE_ROM_MONITOR_UNSUPPORTED + description " + Allow coexistence with ROM monitor (CygMon or GDB stubs) by + only initializing interrupt vectors on startup, thus leaving + exception handling to the ROM monitor." + } + compile var_intr.c var_misc.c variant.S } diff --git a/packages/hal/powerpc/ppc40x/current/include/var_cache.h b/packages/hal/powerpc/ppc40x/current/include/var_cache.h --- a/packages/hal/powerpc/ppc40x/current/include/var_cache.h +++ b/packages/hal/powerpc/ppc40x/current/include/var_cache.h @@ -83,21 +83,30 @@ // Invalidate the entire cache #define HAL_DCACHE_INVALIDATE_ALL() \ CYG_MACRO_START \ - int _i_, _indx_; \ + int _i_, _ix_, _indx_; \ _indx_ = 0; \ + _ix_ = HAL_DCACHE_SIZE/2; \ for (_i_ = 0; _i_ < HAL_DCACHE_SETS; _i_++) { \ +/* asm volatile ("dcbf 0,%0;" :: "r"(_indx_)); */ \ +/* asm volatile ("dcbf %1,%0;" :: "r"(_indx_), "r"(_ix_)); */\ asm volatile ("dccci 0,%0;" :: "r"(_indx_)); \ _indx_ += HAL_DCACHE_LINE_SIZE; \ } \ CYG_MACRO_END -// Synchronize the contents of the cache with memory. -#define HAL_DCACHE_SYNC() +// Synchronize the contents of the cache with memory. +#define HAL_DCACHE_SYNC() \ + CYG_MACRO_START \ + int _indx_; \ + for (_indx_ = 0; _indx_ < HAL_DCACHE_SIZE; _indx_ += HAL_DCACHE_LINE_SIZE) { \ + asm volatile ("dcbf 0,%0;" :: "r"(_indx_)); \ + } \ + CYG_MACRO_END // Query the state of the data cache #define HAL_DCACHE_IS_ENABLED(_state_) \ CYG_MACRO_START \ - (_state_) = 0; \ + (_state_) = 1; \ CYG_MACRO_END // Set the data cache refill burst size @@ -157,15 +166,23 @@ #define HAL_ICACHE_DISABLE() // Invalidate the entire cache -#define HAL_ICACHE_INVALIDATE_ALL() +#define HAL_ICACHE_INVALIDATE_ALL() \ + CYG_MACRO_START \ + int _i_, _indx_; \ + _indx_ = 0; \ + for (_i_ = 0; _i_ < HAL_ICACHE_SETS; _i_++) { \ + asm volatile ("iccci 0,%0;" :: "r"(_indx_)); \ + _indx_ += HAL_ICACHE_LINE_SIZE; \ + } \ + CYG_MACRO_END // Synchronize the contents of the cache with memory. -#define HAL_ICACHE_SYNC() +#define HAL_ICACHE_SYNC() HAL_ICACHE_INVALIDATE_ALL() // Query the state of the instruction cache #define HAL_ICACHE_IS_ENABLED(_state_) \ CYG_MACRO_START \ - (_state_) = 0; \ + (_state_) = 1; \ CYG_MACRO_END // Set the instruction cache refill burst size diff --git a/packages/hal/powerpc/ppc40x/current/include/var_intr.h b/packages/hal/powerpc/ppc40x/current/include/var_intr.h --- a/packages/hal/powerpc/ppc40x/current/include/var_intr.h +++ b/packages/hal/powerpc/ppc40x/current/include/var_intr.h @@ -34,11 +34,11 @@ //#####DESCRIPTIONBEGIN#### // // Author(s): nickg -// Contributors:nickg, jskov, jlarmour, hmt +// Contributors:nickg, jskov, jlarmour, hmt, gthomas // Date: 2000-04-02 // Purpose: Variant interrupt support // Description: The macros defined here provide the HAL APIs for handling -// interrupts and the clock on the PPC60x variant CPUs. +// interrupts and the clock on the PPC40x variant CPUs. // Usage: Is included via the architecture interrupt header: // #include // ... @@ -47,7 +47,85 @@ // //============================================================================= -// No builtin interrupt controller in the PPC40x CPUs. + +// Special handling for additional exceptions + +#define CYGNUM_HAL_VECTOR_TIMERS 16 // Note: must handle all 3! +#define CYGNUM_HAL_VECTOR_DATA_TLB_MISS 17 +#define CYGNUM_HAL_VECTOR_INSTR_TLB_MISS 18 +#define CYGNUM_HAL_VECTOR_DEBUG 32 + +#define CYGNUM_HAL_VSR_MAX CYGNUM_HAL_VECTOR_DEBUG + +// Special handling for interrupts + +#define CYGHWR_HAL_INTERRUPT_CONTROLLER_ACCESS_DEFINED + +// Additional interrupt sources which are supported by the 40x +#define CYGNUM_HAL_INTERRUPT_CRITICAL 2 +#define CYGNUM_HAL_INTERRUPT_SERIAL_RCV 3 +#define CYGNUM_HAL_INTERRUPT_SERIAL_XMT 4 +#define CYGNUM_HAL_INTERRUPT_JTAG_RCV 5 +#define CYGNUM_HAL_INTERRUPT_JTAG_XMT 6 +#define CYGNUM_HAL_INTERRUPT_DMA0 7 +#define CYGNUM_HAL_INTERRUPT_DMA1 8 +#define CYGNUM_HAL_INTERRUPT_DMA2 9 +#define CYGNUM_HAL_INTERRUPT_DMA3 10 +#define CYGNUM_HAL_INTERRUPT_EXT0 11 +#define CYGNUM_HAL_INTERRUPT_EXT1 12 +#define CYGNUM_HAL_INTERRUPT_EXT2 13 +#define CYGNUM_HAL_INTERRUPT_EXT3 14 +#define CYGNUM_HAL_INTERRUPT_EXT4 15 +#define CYGNUM_HAL_INTERRUPT_VAR_TIMER 16 +#define CYGNUM_HAL_INTERRUPT_FIXED_TIMER 17 +#define CYGNUM_HAL_INTERRUPT_WATCHDOG_TIMER 18 + +#define CYGNUM_HAL_ISR_MAX CYGNUM_HAL_INTERRUPT_WATCHDOG_TIMER + +//-------------------------------------------------------------------------- +// Interrupt controller access + +externC void hal_ppc40x_interrupt_mask(int); +externC void hal_ppc40x_interrupt_unmask(int); +externC void hal_ppc40x_interrupt_acknowledge(int); +externC void hal_ppc40x_interrupt_configure(int, int, int); +externC void hal_ppc40x_interrupt_set_level(int, int); + +#define HAL_INTERRUPT_MASK( _vector_ ) \ + hal_ppc40x_interrupt_mask( _vector_ ) +#define HAL_INTERRUPT_UNMASK( _vector_ ) \ + hal_ppc40x_interrupt_unmask( _vector_ ) +#define HAL_INTERRUPT_ACKNOWLEDGE( _vector_ ) \ + hal_ppc40x_interrupt_acknowledge( _vector_ ) +#define HAL_INTERRUPT_CONFIGURE( _vector_, _level_, _up_ ) \ + hal_ppc40x_interrupt_configure( _vector_, _level_, _up_ ) +#define HAL_INTERRUPT_SET_LEVEL( _vector_, _level_ ) \ + hal_ppc40x_interrupt_set_level( _vector_, _level_ ) + +//-------------------------------------------------------------------------- +// Clock control + +externC void hal_ppc40x_clock_initialize(cyg_uint32); +externC void hal_ppc40x_clock_read(cyg_uint32 *); +externC void hal_ppc40x_clock_reset(cyg_uint32, cyg_uint32); +externC void hal_ppc40x_delay_us(int); + +#define CYGHWR_HAL_CLOCK_DEFINED +#define HAL_CLOCK_INITIALIZE( _period_ ) hal_ppc40x_clock_initialize( _period_ ) +#define HAL_CLOCK_RESET( _vec_, _period_ ) hal_ppc40x_clock_reset( _vec_, _period_ ) +#define HAL_CLOCK_READ( _pvalue_ ) hal_ppc40x_clock_read( _pvalue_ ) +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK_LATENCY +#define HAL_CLOCK_LATENCY( _pvalue_ ) HAL_CLOCK_READ( (cyg_uint32 *)_pvalue_ ) +#endif + +#define HAL_DELAY_US(n) hal_ppc40x_delay_us(n) +#define CYGNUM_HAL_INTERRUPT_RTC CYGNUM_HAL_INTERRUPT_VAR_TIMER + +//----------------------------------------------------------------------------- +// Symbols used by assembly code +#define CYGARC_VARIANT_DEFS \ + DEFINE(CYGNUM_HAL_VECTOR_TIMERS, CYGNUM_HAL_VECTOR_TIMERS); \ + DEFINE(CYGNUM_HAL_INTERRUPT_VAR_TIMER,CYGNUM_HAL_INTERRUPT_VAR_TIMER); //----------------------------------------------------------------------------- #endif // ifndef CYGONCE_VAR_INTR_H diff --git a/packages/hal/powerpc/ppc40x/current/include/var_regs.h b/packages/hal/powerpc/ppc40x/current/include/var_regs.h --- a/packages/hal/powerpc/ppc40x/current/include/var_regs.h +++ b/packages/hal/powerpc/ppc40x/current/include/var_regs.h @@ -62,8 +62,8 @@ // MMU control. #ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS -#define EVPR 982 // Exception vector prefix -#define M_PID 945 // Process ID +#define SPR_EVPR 982 // Exception vector prefix +#define SPR_PID 945 // Process ID #define M_EPN_EPNMASK 0xfffff000 // effective page no mask #define M_EPN_EV 0x00000040 // entry valid @@ -85,6 +85,59 @@ #endif // ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS +//-------------------------------------------------------------------------- +// Device control register access macros. +#define CYGARC_MTDCR(_tbr_, _v_) \ + asm volatile ("mtdcr %0, %1;" :: "I" (_tbr_), "r" (_v_)); +#define CYGARC_MFDCR(_tbr_, _v_) \ + asm volatile ("mfdcr %0, %1;" : "=r" (_v_) : "I" (_tbr_)); + +#ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS + +// Interrupt control (device) registers +#define DCR_EXIER 66 +#define DCR_EXISR 64 +#define DCR_IOCR 160 + +// Timer control (special) registers +#define SPR_PIT 987 +#define SPR_TCR 986 +#define SPR_TSR 984 + +// Interval and watchdog timer control +#define TCR_WP 0xC0000000 // Watchdog timer period +#define TCR_WP_17 0x00000000 // 2^17 clocks +#define TCR_WP_21 0x40000000 // 2^21 clocks +#define TCR_WP_25 0x80000000 // 2^25 clocks +#define TCR_WP_29 0xC0000000 // 2^29 clocks +#define TCR_WRC 0x30000000 // Reset control +#define TCR_WRC_None 0x00000000 // No reset on timeout +#define TCR_WRC_Core 0x10000000 // Reset core on timeout +#define TCR_WRC_Chip 0x20000000 // Reset chip on timeout +#define TCR_WRC_System 0x30000000 // Reset system on timeout +#define TCR_WIE 0x08000000 // Watchdog interrupt enable +#define TCR_PIE 0x04000000 // Programmable timer interrupt +#define TCR_FP 0x03000000 // Fixed timer interval +#define TCR_FP_9 0x00000000 // 2^9 clocks +#define TCR_FP_13 0x01000000 // 2^13 clocks +#define TCR_FP_17 0x02000000 // 2^17 clocks +#define TCR_FP_21 0x03000000 // 2^21 clocks +#define TCR_FIE 0x00800000 // Fixed timer interrupt +#define TCR_ARE 0x00400000 // Auto-reload enable + +// Interval and watchdog status +#define TSR_ENW 0x80000000 // Enable next watchdog +#define TSR_WIS 0x40000000 // Watchdog interrupt pending +#define TSR_WRS 0x30000000 // Watchdog reset state +#define TSR_WRS_None 0x00000000 // No watchdog reset +#define TSR_WRS_Core 0x10000000 // Core reset by watchdog +#define TSR_WRS_Chip 0x20000000 // Chip reset by watchdog +#define TSR_WRS_System 0x30000000 // System reset by watchdog +#define TSR_PIS 0x08000000 // Programmable timer interrupt +#define TSR_FIS 0x04000000 // Fixed timer interrupt + +#endif // CYGARC_HAL_COMMON_EXPORT_CPU_MACROS + //----------------------------------------------------------------------------- #endif // ifdef CYGONCE_HAL_VAR_REGS_H // End of var_regs.h diff --git a/packages/hal/powerpc/ppc40x/current/include/variant.inc b/packages/hal/powerpc/ppc40x/current/include/variant.inc --- a/packages/hal/powerpc/ppc40x/current/include/variant.inc +++ b/packages/hal/powerpc/ppc40x/current/include/variant.inc @@ -57,8 +57,55 @@ ##----------------------------------------------------------------------------- ## PPC40x defined vectors + +## Special code to handle the various timers which generate non-standard +## interrupts. There are really three VSRs here, each 0x10 apart. + .macro timer_vector name + .p2align 8 + .globl __exception_\name +__exception_\name: + # Variable timer interrupt + mtspr SPRG1,r3 # stash some work registers away + mtspr SPRG2,r4 + li r4,0x1000 # vector offset + b 0f + # Fixed timer interrupt + mtspr SPRG1,r3 # stash some work registers away + mtspr SPRG2,r4 + li r4,0x1010 # vector offset + b 0f + # Watchdog timer interrupt + mtspr SPRG1,r3 # stash some work registers away + mtspr SPRG2,r4 + li r4,0x1020 # vector offset +0: mtspr SPRG3,r5 + lwi r3,hal_vsr_table+(0x1000>>6) # table base + lwz r3,0(r3) # address of vsr + mflr r5 # save link register + mtlr r3 # put vsr address into it + mr r3,r4 # original vector + mfcr r4 # stash CR + blr # go to common code + .endm .macro hal_extra_vectors + timer_vector ppc40x_timers + exception_vector data_TLB_miss + exception_vector instr_TLB_miss + exception_vector reserved_01300 + exception_vector reserved_01400 + exception_vector reserved_01500 + exception_vector reserved_01600 + exception_vector reserved_01700 + exception_vector reserved_01800 + exception_vector reserved_01900 + exception_vector reserved_01A00 + exception_vector reserved_01B00 + exception_vector reserved_01C00 + exception_vector reserved_01D00 + exception_vector reserved_01E00 + exception_vector reserved_01F00 + exception_vector ppc40x_debug .endm ##----------------------------------------------------------------------------- @@ -108,7 +155,7 @@ 2: # Ensure that the vectors will come from 0x0000 lwi r4,0 - mtspr EVPR,r4 + mtspr SPR_EVPR,r4 #endif # Next initialize the VSR table. This happens whether the @@ -129,6 +176,7 @@ 1: stwu r3,4(r4) lwi r4,hal_vsr_table stw r3,CYGNUM_HAL_VECTOR_INTERRUPT*4(r4) stw r3,CYGNUM_HAL_VECTOR_DECREMENTER*4(r4) + stw r3,CYGNUM_HAL_VECTOR_TIMERS*4(r4) .endm #elif defined(CYG_HAL_STARTUP_RAM) && defined(CYGSEM_HAL_USE_ROM_MONITOR) @@ -142,6 +190,7 @@ 1: stwu r3,4(r4) lwi r4,hal_vsr_table stw r3,CYGNUM_HAL_VECTOR_INTERRUPT*4(r4) stw r3,CYGNUM_HAL_VECTOR_DECREMENTER*4(r4) + stw r3,CYGNUM_HAL_VECTOR_TIMERS*4(r4) .endm @@ -171,6 +220,37 @@ 1: stwu r3,4(r4) #define CYG_HAL_PPC_ISR_TABLES_DEFINED +##----------------------------------------------------------------------------- +## MPC4xx interrupt handling. + +## Decode the EXISR appropriately + +#define CYGPKG_HAL_POWERPC_INTC_DEFINED + # decode the interrupt + # the interrupt vector will be 0x500 or 0x10x0 + # 0x0500 = external, must be decoded via EXISR + # 0x10X0 = timer, X is the timer type + # r3 used as scratch + .macro hal_intc_decode dreg,state + lwz \dreg,CYGARC_PPCREG_VECTOR(\state) # retrieve vector number, + extrwi. \dreg,\dreg,1,19 # isolate bit 19 + beq 0f # timer interrupt = 1 + lwz \dreg,CYGARC_PPCREG_VECTOR(\state) # retrieve vector number, + extrwi \dreg,\dreg,2,26 # isolate bits 26-27 + addi \dreg,\dreg,CYGNUM_HAL_INTERRUPT_VAR_TIMER # FIXME + b 1f +0: mfdcr r3,DCR_EXISR # Interrupt status register + lwi \dreg,0x8FF0001F # significant bits + and \dreg,\dreg,r3 + cntlzw r3,\dreg # find highest "1" bit + slwi r3,r3,2 + lwi \dreg,EXISR_TAB # convert bit # to signal # + lwz \dreg,0(\dreg) +1: stw \dreg,CYGARC_PPCREG_VECTOR(\state) # update vector in state frame. + slwi \dreg,\dreg,2 # convert to byte offset. + .endm + + #------------------------------------------------------------------------------ #endif // ifndef CYGONCE_HAL_VARIANT_INC # end of variant.inc diff --git a/packages/hal/powerpc/ppc40x/current/src/var_intr.c b/packages/hal/powerpc/ppc40x/current/src/var_intr.c --- a/packages/hal/powerpc/ppc40x/current/src/var_intr.c +++ b/packages/hal/powerpc/ppc40x/current/src/var_intr.c @@ -43,12 +43,242 @@ //========================================================================== #include +#define CYGARC_HAL_COMMON_EXPORT_CPU_MACROS +#include +#include #include +static cyg_uint32 exier_mask[] = { + 0x00000000, // Unused + 0x00000000, // Unused + 0x80000000, // CYGNUM_HAL_INTERRUPT_CRITICAL 2 + 0x08000000, // CYGNUM_HAL_INTERRUPT_SERIAL_RCV 3 + 0x04000000, // CYGNUM_HAL_INTERRUPT_SERIAL_XMT 4 + 0x02000000, // CYGNUM_HAL_INTERRUPT_JTAG_RCV 5 + 0x01000000, // CYGNUM_HAL_INTERRUPT_JTAG_XMT 6 + 0x00800000, // CYGNUM_HAL_INTERRUPT_DMA0 7 + 0x00400000, // CYGNUM_HAL_INTERRUPT_DMA1 8 + 0x00200000, // CYGNUM_HAL_INTERRUPT_DMA2 9 + 0x00100000, // CYGNUM_HAL_INTERRUPT_DMA3 10 + 0x00000010, // CYGNUM_HAL_INTERRUPT_EXT0 11 + 0x00000008, // CYGNUM_HAL_INTERRUPT_EXT1 12 + 0x00000004, // CYGNUM_HAL_INTERRUPT_EXT2 13 + 0x00000002, // CYGNUM_HAL_INTERRUPT_EXT3 14 + 0x00000001, // CYGNUM_HAL_INTERRUPT_EXT4 15 +}; + +// This table inverts bit number to signal number +cyg_uint32 EXISR_TAB[] = { + CYGNUM_HAL_INTERRUPT_CRITICAL, // 0x80000000 + 0x00000000, // 0x40000000 + 0x00000000, // 0x20000000 + 0x00000000, // 0x10000000 + CYGNUM_HAL_INTERRUPT_SERIAL_RCV, // 0x08000000 + CYGNUM_HAL_INTERRUPT_SERIAL_XMT, // 0x04000000 + CYGNUM_HAL_INTERRUPT_JTAG_RCV, // 0x02000000 + CYGNUM_HAL_INTERRUPT_JTAG_XMT, // 0x01000000 + CYGNUM_HAL_INTERRUPT_DMA0, // 0x00800000 + CYGNUM_HAL_INTERRUPT_DMA1, // 0x00400000 + CYGNUM_HAL_INTERRUPT_DMA2, // 0x00200000 + CYGNUM_HAL_INTERRUPT_DMA3, // 0x00100000 + 0x00000000, // 0x00080000 + 0x00000000, // 0x00040000 + 0x00000000, // 0x00020000 + 0x00000000, // 0x00010000 + 0x00000000, // 0x00008000 + 0x00000000, // 0x00004000 + 0x00000000, // 0x00002000 + 0x00000000, // 0x00001000 + 0x00000000, // 0x00000800 + 0x00000000, // 0x00000400 + 0x00000000, // 0x00000200 + 0x00000000, // 0x00000100 + 0x00000000, // 0x00000080 + 0x00000000, // 0x00000040 + 0x00000000, // 0x00000020 + CYGNUM_HAL_INTERRUPT_EXT0, // 0x00000010 + CYGNUM_HAL_INTERRUPT_EXT1, // 0x00000008 + CYGNUM_HAL_INTERRUPT_EXT2, // 0x00000004 + CYGNUM_HAL_INTERRUPT_EXT3, // 0x00000002 + CYGNUM_HAL_INTERRUPT_EXT4 // 0x00000001 +}; + +cyg_uint32 _hold_tcr = 0; // Shadow of hardware register + externC void hal_variant_IRQ_init(void) { - // No special init required for 40x series. + cyg_uint32 iocr; + + // Ensure all interrupts masked (disabled) & cleared + CYGARC_MTDCR(DCR_EXIER, 0); + CYGARC_MTDCR(DCR_EXISR, 0xFFFFFFFF); + + // Configure all external interrupts to be level/low + CYGARC_MFDCR(DCR_IOCR, iocr); + iocr &= ~0xFFC00000; + CYGARC_MTDCR(DCR_IOCR, iocr); + + // Disable timers + CYGARC_MTSPR(SPR_TCR, 0); +} + +externC void +hal_ppc40x_interrupt_mask(int vector) +{ + cyg_uint32 exier, tcr; + + switch (vector) { + case CYGNUM_HAL_INTERRUPT_CRITICAL: + case CYGNUM_HAL_INTERRUPT_SERIAL_RCV: + case CYGNUM_HAL_INTERRUPT_SERIAL_XMT: + case CYGNUM_HAL_INTERRUPT_JTAG_RCV: + case CYGNUM_HAL_INTERRUPT_JTAG_XMT: + case CYGNUM_HAL_INTERRUPT_DMA0: + case CYGNUM_HAL_INTERRUPT_DMA1: + case CYGNUM_HAL_INTERRUPT_DMA2: + case CYGNUM_HAL_INTERRUPT_DMA3: + case CYGNUM_HAL_INTERRUPT_EXT0: + case CYGNUM_HAL_INTERRUPT_EXT1: + case CYGNUM_HAL_INTERRUPT_EXT2: + case CYGNUM_HAL_INTERRUPT_EXT3: + case CYGNUM_HAL_INTERRUPT_EXT4: + CYGARC_MFDCR(DCR_EXIER, exier); + exier &= ~exier_mask[vector]; + CYGARC_MTDCR(DCR_EXIER, exier); + break; + case CYGNUM_HAL_INTERRUPT_VAR_TIMER: + CYGARC_MFSPR(SPR_TCR, tcr); + tcr = _hold_tcr; + tcr &= ~TCR_PIE; + CYGARC_MTSPR(SPR_TCR, tcr); + _hold_tcr = tcr; + break; + case CYGNUM_HAL_INTERRUPT_FIXED_TIMER: + CYGARC_MFSPR(SPR_TCR, tcr); + tcr = _hold_tcr; + tcr &= ~TCR_FIE; + CYGARC_MTSPR(SPR_TCR, tcr); + _hold_tcr = tcr; + break; + case CYGNUM_HAL_INTERRUPT_WATCHDOG_TIMER: + CYGARC_MFSPR(SPR_TCR, tcr); + tcr = _hold_tcr; + tcr &= ~TCR_WIE; + CYGARC_MTSPR(SPR_TCR, tcr); + _hold_tcr = tcr; + break; + default: + } +} + +externC void +hal_ppc40x_interrupt_unmask(int vector) +{ + cyg_uint32 exier, tcr; + + switch (vector) { + case CYGNUM_HAL_INTERRUPT_CRITICAL: + case CYGNUM_HAL_INTERRUPT_SERIAL_RCV: + case CYGNUM_HAL_INTERRUPT_SERIAL_XMT: + case CYGNUM_HAL_INTERRUPT_JTAG_RCV: + case CYGNUM_HAL_INTERRUPT_JTAG_XMT: + case CYGNUM_HAL_INTERRUPT_DMA0: + case CYGNUM_HAL_INTERRUPT_DMA1: + case CYGNUM_HAL_INTERRUPT_DMA2: + case CYGNUM_HAL_INTERRUPT_DMA3: + case CYGNUM_HAL_INTERRUPT_EXT0: + case CYGNUM_HAL_INTERRUPT_EXT1: + case CYGNUM_HAL_INTERRUPT_EXT2: + case CYGNUM_HAL_INTERRUPT_EXT3: + case CYGNUM_HAL_INTERRUPT_EXT4: + CYGARC_MFDCR(DCR_EXIER, exier); + exier |= exier_mask[vector]; + CYGARC_MTDCR(DCR_EXIER, exier); + break; + case CYGNUM_HAL_INTERRUPT_VAR_TIMER: + CYGARC_MFSPR(SPR_TCR, tcr); + tcr = _hold_tcr; + tcr |= TCR_PIE; + CYGARC_MTSPR(SPR_TCR, tcr); + _hold_tcr = tcr; + break; + case CYGNUM_HAL_INTERRUPT_FIXED_TIMER: + CYGARC_MFSPR(SPR_TCR, tcr); + tcr = _hold_tcr; + tcr |= TCR_FIE; + CYGARC_MTSPR(SPR_TCR, tcr); + _hold_tcr = tcr; + break; + case CYGNUM_HAL_INTERRUPT_WATCHDOG_TIMER: + CYGARC_MFSPR(SPR_TCR, tcr); + tcr = _hold_tcr; + tcr |= TCR_WIE; + CYGARC_MTSPR(SPR_TCR, tcr); + _hold_tcr = tcr; + break; + default: + } +} + +externC void +hal_ppc40x_interrupt_acknowledge(int vector) +{ + switch (vector) { + case CYGNUM_HAL_INTERRUPT_EXT0: + case CYGNUM_HAL_INTERRUPT_EXT1: + case CYGNUM_HAL_INTERRUPT_EXT2: + case CYGNUM_HAL_INTERRUPT_EXT3: + case CYGNUM_HAL_INTERRUPT_EXT4: + CYGARC_MTDCR(DCR_EXISR, exier_mask[vector]); + break; + case CYGNUM_HAL_INTERRUPT_VAR_TIMER: + CYGARC_MTSPR(SPR_TSR, TSR_PIS); // clear & acknowledge interrupt + break; + case CYGNUM_HAL_INTERRUPT_FIXED_TIMER: + CYGARC_MTSPR(SPR_TSR, TSR_FIS); // clear & acknowledge interrupt + break; + case CYGNUM_HAL_INTERRUPT_WATCHDOG_TIMER: + CYGARC_MTSPR(SPR_TSR, TSR_WIS); // clear & acknowledge interrupt + break; + case CYGNUM_HAL_INTERRUPT_CRITICAL: + case CYGNUM_HAL_INTERRUPT_SERIAL_RCV: + case CYGNUM_HAL_INTERRUPT_SERIAL_XMT: + case CYGNUM_HAL_INTERRUPT_JTAG_RCV: + case CYGNUM_HAL_INTERRUPT_JTAG_XMT: + case CYGNUM_HAL_INTERRUPT_DMA0: + case CYGNUM_HAL_INTERRUPT_DMA1: + case CYGNUM_HAL_INTERRUPT_DMA2: + case CYGNUM_HAL_INTERRUPT_DMA3: + default: + } +} + +// Note: These functions are only [well] defined for "external" interrupts +// which can be controlled via the EXIER register. +externC void +hal_ppc40x_interrupt_configure(int vector, int level, int dir) +{ + cyg_uint32 mask, new_state, iocr; + + if ((vector >= CYGNUM_HAL_INTERRUPT_EXT0) && + (vector <= CYGNUM_HAL_INTERRUPT_EXT4)) { + mask = 0x03 << (30 - ((vector - CYGNUM_HAL_INTERRUPT_EXT0)*2)); + new_state = 0x00; + if (level == 0) { + // Edge triggered + new_state = 0x02 | (dir & 0x01); // Up/Down + } + new_state <<= (30 - ((vector - CYGNUM_HAL_INTERRUPT_EXT0)*2)); + CYGARC_MFDCR(DCR_IOCR, iocr); + iocr = (iocr & ~mask) | new_state; + CYGARC_MTDCR(DCR_IOCR, iocr); + } +} + +externC void +hal_ppc40x_interrupt_set_level(int vector, int level) +{ } // ------------------------------------------------------------------------- diff --git a/packages/hal/powerpc/ppc40x/current/src/var_misc.c b/packages/hal/powerpc/ppc40x/current/src/var_misc.c --- a/packages/hal/powerpc/ppc40x/current/src/var_misc.c +++ b/packages/hal/powerpc/ppc40x/current/src/var_misc.c @@ -117,15 +117,13 @@ cyg_hal_clear_MMU (void) cyg_uint32 tlbhi = 0; cyg_uint32 tlblo = 0; int id, max_tlbs; - cyg_uint32 tlb[64][2]; // There are 64 TLBs. max_tlbs = 64; - CYGARC_MTSPR (M_PID, 0); + CYGARC_MTSPR (SPR_PID, 0); for (id = 0; id < max_tlbs; id++) { - CYGARC_TLBRE(id, tlb[id][0], tlb[id][1]); CYGARC_TLBWE(id, tlbhi, tlblo); } @@ -133,4 +131,48 @@ cyg_hal_clear_MMU (void) } //-------------------------------------------------------------------------- +// Clock control - use the programmable (variable period) timer + +static cyg_uint32 _period; +extern cyg_uint32 _hold_tcr; + +externC void +hal_ppc40x_clock_initialize(cyg_uint32 period) +{ + cyg_uint32 tcr; + + // Enable auto-reload + CYGARC_MFSPR(SPR_TCR, tcr); + tcr = _hold_tcr; + tcr |= TCR_ARE; + CYGARC_MTSPR(SPR_TCR, tcr); + _hold_tcr = tcr; + + // Set up the counter register + _period = period; + CYGARC_MTSPR(SPR_PIT, period); +} + +// Returns the number of clocks since the last interrupt +externC void +hal_ppc40x_clock_read(cyg_uint32 *val) +{ + cyg_uint32 period; + + CYGARC_MFSPR(SPR_PIT, period); + *val = _period - period; +} + +externC void +hal_ppc40x_clock_reset(cyg_uint32 vector, cyg_uint32 period) +{ + hal_ppc40x_clock_initialize(period); +} + +externC void +hal_ppc40x_delay_us(int us) +{ +} + +//-------------------------------------------------------------------------- // End of var_misc.c diff --git a/packages/hal/sh/arch/current/ChangeLog b/packages/hal/sh/arch/current/ChangeLog --- a/packages/hal/sh/arch/current/ChangeLog +++ b/packages/hal/sh/arch/current/ChangeLog @@ -1,3 +1,7 @@ +2000-11-09 Jesper Skov + + * src/sh_stub.c (__single_step): Fix CPP problem. + 2000-10-31 Jesper Skov diff --git a/packages/hal/sh/arch/current/src/sh_stub.c b/packages/hal/sh/arch/current/src/sh_stub.c --- a/packages/hal/sh/arch/current/src/sh_stub.c +++ b/packages/hal/sh/arch/current/src/sh_stub.c @@ -138,12 +138,15 @@ void __single_step (void) #endif // Stop after instruction at matching address has executed. HAL_WRITE_UINT16(CYGARC_REG_BRCR, CYGARC_REG_BRCR_PCBA); + // Stop on IFETCH/READ - HAL_WRITE_UINT16(CYGARC_REG_BBRA, #if (CYGARC_SH_MOD_UBC == 3) - CYGARC_REG_BBRA_CPU| // Match on CPU cycle + HAL_WRITE_UINT16(CYGARC_REG_BBRA, + CYGARC_REG_BBRA_CPU|CYGARC_REG_BBRA_IFETCH|CYGARC_REG_BBRA_READ); +#else + HAL_WRITE_UINT16(CYGARC_REG_BBRA, + CYGARC_REG_BBRA_IFETCH|CYGARC_REG_BBRA_READ); #endif - CYGARC_REG_BBRA_IFETCH|CYGARC_REG_BBRA_READ); } /* Clear the single-step state. */ diff --git a/packages/hal/sh/cq7750/current/ChangeLog b/packages/hal/sh/cq7750/current/ChangeLog --- a/packages/hal/sh/cq7750/current/ChangeLog +++ b/packages/hal/sh/cq7750/current/ChangeLog @@ -1,3 +1,13 @@ +2000-11-09 Jesper Skov + + * cdl/hal_sh_sh7750_cq7750.cdl: Set flags to -m3 for now. + +2000-11-08 Jesper Skov + + * include/platform.inc (BSC_settings_table): Use computed init frqcr. + + * cdl/hal_sh_sh7750_cq7750.cdl: Updated clock default settings. + 2000-11-01 Jesper Skov * cdl/hal_sh_sh7750_cq7750.cdl: Adding clock options. diff --git a/packages/hal/sh/cq7750/current/cdl/hal_sh_sh7750_cq7750.cdl b/packages/hal/sh/cq7750/current/cdl/hal_sh_sh7750_cq7750.cdl --- a/packages/hal/sh/cq7750/current/cdl/hal_sh_sh7750_cq7750.cdl +++ b/packages/hal/sh/cq7750/current/cdl/hal_sh_sh7750_cq7750.cdl @@ -124,7 +124,7 @@ cdl_package CYGPKG_HAL_SH_SH7750_CQ7750 display "SH clock crystal" flavor data legal_values 9000000 to 66000000 - default_value 33000000 + default_value 33333333 no_define description " This option specifies the frequency of the crystal all @@ -168,7 +168,7 @@ cdl_package CYGPKG_HAL_SH_SH7750_CQ7750 cdl_option CYGHWR_HAL_SH_OOC_DIVIDER_BFC { display "SH clock divider, bus" flavor data - default_value 8 + default_value 3 legal_values { 1 2 3 4 6 8 } description " This divider option affects the bus clock." @@ -177,7 +177,7 @@ cdl_package CYGPKG_HAL_SH_SH7750_CQ7750 cdl_option CYGHWR_HAL_SH_OOC_DIVIDER_PFC { display "SH clock divider, peripheral" flavor data - default_value 8 + default_value 6 legal_values { 1 2 3 4 6 8 } description " This divider option affects the peripheral clock." @@ -186,7 +186,7 @@ cdl_package CYGPKG_HAL_SH_SH7750_CQ7750 cdl_option CYGHWR_HAL_SH_OOC_CLOCK_MODE { display "SH clock mode" flavor data - default_value 2 + default_value 5 legal_values { 0 1 2 3 4 5 } description " This option must mirror the clock mode hardwired on @@ -214,11 +214,12 @@ cdl_package CYGPKG_HAL_SH_SH7750_CQ7750 invoking the build tools." } + # CPU flags should be -m4-nofpu cdl_option CYGBLD_GLOBAL_CFLAGS { display "Global compiler flags" flavor data no_define - default_value { CYGHWR_HAL_SH_BIGENDIAN ? "-mb -m4 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -ggdb -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" : "-ml -m3 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -ggdb -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" } + default_value { CYGHWR_HAL_SH_BIGENDIAN ? "-mb -m3 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -ggdb -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" : "-ml -m3 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -ggdb -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" } description " This option controls the global compiler flags which are used to compile all packages by @@ -230,7 +231,7 @@ cdl_package CYGPKG_HAL_SH_SH7750_CQ7750 display "Global linker flags" flavor data no_define - default_value { CYGHWR_HAL_SH_BIGENDIAN ? "-mb -m4 -ggdb -nostdlib -Wl,--gc-sections -Wl,-static" : "-ml -m3 -ggdb -nostdlib -Wl,--gc-sections -Wl,-static" } + default_value { CYGHWR_HAL_SH_BIGENDIAN ? "-mb -m3 -ggdb -nostdlib -Wl,--gc-sections -Wl,-static" : "-ml -m3 -ggdb -nostdlib -Wl,--gc-sections -Wl,-static" } description " This option controls the global linker flags. Individual packages may define options which override these global flags." diff --git a/packages/hal/sh/cq7750/current/include/platform.inc b/packages/hal/sh/cq7750/current/include/platform.inc --- a/packages/hal/sh/cq7750/current/include/platform.inc +++ b/packages/hal/sh/cq7750/current/include/platform.inc @@ -85,6 +85,11 @@ 3: bra 1b .align 2 BSC_settings_table: + # FRQCR: + .long CYGARC_REG_FRQCR + .long CYGARC_REG_FRQCR_INIT + .long 2 + # BCR1: .long CYGARC_REG_BCR1 .long 0x0020000c diff --git a/packages/hal/sh/sh3/current/ChangeLog b/packages/hal/sh/sh3/current/ChangeLog --- a/packages/hal/sh/sh3/current/ChangeLog +++ b/packages/hal/sh/sh3/current/ChangeLog @@ -1,3 +1,7 @@ +2000-11-10 Jesper Skov + + * src/var_misc.c: Add spaces around ... used in ranges. + 2000-11-01 Jesper Skov * Many changes to bring the Haruki's HAL split up to date. Also diff --git a/packages/hal/sh/sh3/current/src/var_misc.c b/packages/hal/sh/sh3/current/src/var_misc.c --- a/packages/hal/sh/sh3/current/src/var_misc.c +++ b/packages/hal/sh/sh3/current/src/var_misc.c @@ -116,7 +116,7 @@ hal_interrupt_set_level(int vector, int switch( (vector) ) { case CYGNUM_HAL_INTERRUPT_NMI: /* fall through */ - case CYGNUM_HAL_INTERRUPT_LVL0...CYGNUM_HAL_INTERRUPT_LVL14: + case CYGNUM_HAL_INTERRUPT_LVL0 ... CYGNUM_HAL_INTERRUPT_LVL14: /* Cannot change levels */ break; @@ -302,10 +302,10 @@ hal_interrupt_mask(int vector) switch( (vector) ) { case CYGNUM_HAL_INTERRUPT_NMI: /* fall through */ - case CYGNUM_HAL_INTERRUPT_LVL0...CYGNUM_HAL_INTERRUPT_LVL14: + case CYGNUM_HAL_INTERRUPT_LVL0 ... CYGNUM_HAL_INTERRUPT_LVL14: /* Can only be masked by fiddling Imask in SR. */ break; - case CYGNUM_HAL_INTERRUPT_TMU0_TUNI0...CYGNUM_HAL_ISR_MAX: + case CYGNUM_HAL_INTERRUPT_TMU0_TUNI0 ... CYGNUM_HAL_ISR_MAX: HAL_INTERRUPT_SET_LEVEL((vector), 0); break; case CYGNUM_HAL_INTERRUPT_RESERVED_1E0: @@ -324,10 +324,10 @@ hal_interrupt_unmask(int vector) switch( (vector) ) { case CYGNUM_HAL_INTERRUPT_NMI: /* fall through */ - case CYGNUM_HAL_INTERRUPT_LVL0...CYGNUM_HAL_INTERRUPT_LVL14: + case CYGNUM_HAL_INTERRUPT_LVL0 ... CYGNUM_HAL_INTERRUPT_LVL14: /* Can only be unmasked by fiddling Imask in SR. */ break; - case CYGNUM_HAL_INTERRUPT_TMU0_TUNI0...CYGNUM_HAL_ISR_MAX: + case CYGNUM_HAL_INTERRUPT_TMU0_TUNI0 ... CYGNUM_HAL_ISR_MAX: HAL_INTERRUPT_SET_LEVEL((vector), 1); break; case CYGNUM_HAL_INTERRUPT_RESERVED_1E0: diff --git a/packages/hal/sh/sh4/current/ChangeLog b/packages/hal/sh/sh4/current/ChangeLog --- a/packages/hal/sh/sh4/current/ChangeLog +++ b/packages/hal/sh/sh4/current/ChangeLog @@ -1,3 +1,11 @@ +2000-11-09 Jesper Skov + + * include/mod_regs_ubc.h: Correct definitions. + + * include/mod_7750.h (CYGARC_SH_MOD_UBC): Defined. + + * cdl/hal_sh_sh4.cdl: Disable cache for now. + 2000-11-01 Jesper Skov * Many changes to bring the variant HAL up to date with the later diff --git a/packages/hal/sh/sh4/current/cdl/hal_sh_sh4.cdl b/packages/hal/sh/sh4/current/cdl/hal_sh_sh4.cdl --- a/packages/hal/sh/sh4/current/cdl/hal_sh_sh4.cdl +++ b/packages/hal/sh/sh4/current/cdl/hal_sh_sh4.cdl @@ -43,6 +43,10 @@ cdl_package CYGPKG_HAL_SH_SH4 { display "SH4 architecture" parent CYGPKG_HAL_SH + + # Disable for now. Problem with cache consistency + requires ! CYGHWR_HAL_SH_CACHE_ENABLE + hardware include_dir cyg/hal define_header hal_sh_sh4.h diff --git a/packages/hal/sh/sh4/current/include/mod_7750.h b/packages/hal/sh/sh4/current/include/mod_7750.h --- a/packages/hal/sh/sh4/current/include/mod_7750.h +++ b/packages/hal/sh/sh4/current/include/mod_7750.h @@ -50,6 +50,7 @@ #define CYGARC_SH_MOD_CPG 1 #define CYGARC_SH_MOD_SCIF 1 +#define CYGARC_SH_MOD_UBC 1 //----------------------------------------------------------------------------- diff --git a/packages/hal/sh/sh4/current/include/mod_regs_ubc.h b/packages/hal/sh/sh4/current/include/mod_regs_ubc.h --- a/packages/hal/sh/sh4/current/include/mod_regs_ubc.h +++ b/packages/hal/sh/sh4/current/include/mod_regs_ubc.h @@ -63,6 +63,17 @@ #define CYGARC_REG_BRCR_SEQ 0x0008 // sequence condition select #define CYGARC_REG_BRCR_UBDE 0x0001 // User Break Debug Enable +#if (CYGARC_SH_MOD_UBC == 1) +#define CYGARC_REG_BAMRA_BASMA 0x04 // BASRA masked +#define CYGARC_REG_BAMRA_BARA_UNMASKED 0x00 // BARA not masked +#define CYGARC_REG_BAMRA_BARA_10BIT 0x01 // Lowest 10 bit masked +#define CYGARC_REG_BAMRA_BARA_12BIT 0x02 // Lowest 12 bit masked +#define CYGARC_REG_BAMRA_BARA_MASKED 0x03 // All bits masked +#define CYGARC_REG_BAMRA_BARA_16BIT 0x08 // Lowest 16 bit masked +#define CYGARC_REG_BAMRA_BARA_20BIT 0x09 // Lowest 20 bit masked +#else +// mask is fully configurable in other versions of the UBC +#endif #define CYGARC_REG_BBRA_DFETCH 0x0020 // Break on DFETCH #define CYGARC_REG_BBRA_IFETCH 0x0010 // Break on IFETCH diff --git a/packages/io/flash/current/ChangeLog b/packages/io/flash/current/ChangeLog --- a/packages/io/flash/current/ChangeLog +++ b/packages/io/flash/current/ChangeLog @@ -1,3 +1,12 @@ +2000-11-17 Jesper Skov + + * src/flash.c: Added debug mode, allowing device driver to use printf. + +2000-11-16 Jesper Skov + + * src/flash.c: Added suspend error messages. + * include/flash.h: Same. + 2000-09-01 Hugo Tyson * include/flash.h: diff --git a/packages/io/flash/current/include/flash.h b/packages/io/flash/current/include/flash.h --- a/packages/io/flash/current/include/flash.h +++ b/packages/io/flash/current/include/flash.h @@ -61,15 +61,17 @@ extern int flash_get_block_info(int *blo extern bool flash_code_overlaps(void *start, void *end); extern char *flash_errmsg(int err); -#define FLASH_ERR_OK 0x00 // No error - operation complete -#define FLASH_ERR_INVALID 0x01 // Invalid FLASH address -#define FLASH_ERR_ERASE 0x02 // Error trying to erase -#define FLASH_ERR_LOCK 0x03 // Error trying to lock/unlock -#define FLASH_ERR_PROGRAM 0x04 // Error trying to program -#define FLASH_ERR_PROTOCOL 0x05 // Generic error -#define FLASH_ERR_PROTECT 0x06 // Device/region is write-protected -#define FLASH_ERR_NOT_INIT 0x07 // FLASH info not yet initialized -#define FLASH_ERR_HWR 0x08 // Hardware (configuration?) problem +#define FLASH_ERR_OK 0x00 // No error - operation complete +#define FLASH_ERR_INVALID 0x01 // Invalid FLASH address +#define FLASH_ERR_ERASE 0x02 // Error trying to erase +#define FLASH_ERR_LOCK 0x03 // Error trying to lock/unlock +#define FLASH_ERR_PROGRAM 0x04 // Error trying to program +#define FLASH_ERR_PROTOCOL 0x05 // Generic error +#define FLASH_ERR_PROTECT 0x06 // Device/region is write-protected +#define FLASH_ERR_NOT_INIT 0x07 // FLASH info not yet initialized +#define FLASH_ERR_HWR 0x08 // Hardware (configuration?) problem +#define FLASH_ERR_ERASE_SUSPEND 0x09 // Device is in erase suspend mode +#define FLASH_ERR_PROGRAM_SUSPEND 0x0a // Device is in in program suspend mode #ifdef _FLASH_PRIVATE_ diff --git a/packages/io/flash/current/src/flash.c b/packages/io/flash/current/src/flash.c --- a/packages/io/flash/current/src/flash.c +++ b/packages/io/flash/current/src/flash.c @@ -51,6 +51,13 @@ #define _FLASH_PRIVATE_ #include +// When this flag is set, +#undef RAM_FLASH_DEV_DEBUG +#if !defined(CYG_HAL_STARTUP_RAM) && defined(RAM_FLASH_DEV_DEBUG) +# warning "Can only enable the flash debugging when configured for RAM startup" +# undef RAM_FLASH_DEV_DEBUG +#endif + struct flash_info flash_info; int @@ -132,6 +139,9 @@ flash_erase(void *addr, int len, void ** printf("... Erase from %p-%p: ", block, end_addr); while (block < end_addr) { +#ifdef RAM_FLASH_DEV_DEBUG + _flash_erase_block = &flash_erase_block; +#endif stat = (*_flash_erase_block)(block); stat = flash_hwr_map_error(stat); if (stat) { @@ -173,6 +183,9 @@ flash_program(void *_addr, void *_data, while (len > 0) { size = len; if (size > flash_info.block_size) size = flash_info.block_size; +#ifdef RAM_FLASH_DEV_DEBUG + _flash_program_buf = &flash_program_buf; +#endif stat = (*_flash_program_buf)(addr, data, size); stat = flash_hwr_map_error(stat); if (stat) { @@ -218,6 +231,9 @@ flash_lock(void *addr, int len, void **e printf("... Lock from %p-%p: ", block, end_addr); while (block < end_addr) { +#ifdef RAM_FLASH_DEV_DEBUG + _flash_lock_block = &flash_lock_block; +#endif stat = (*_flash_lock_block)(block); stat = flash_hwr_map_error(stat); if (stat) { @@ -259,6 +275,9 @@ flash_unlock(void *addr, int len, void * printf("... Unlock from %p-%p: ", block, end_addr); while (block < end_addr) { +#ifdef RAM_FLASH_DEV_DEBUG + _flash_unlock_block = &flash_unlock_block; +#endif stat = (*_flash_unlock_block)(block, flash_info.block_size, flash_info.blocks); stat = flash_hwr_map_error(stat); if (stat) { @@ -280,6 +299,10 @@ flash_errmsg(int err) switch (err) { case FLASH_ERR_OK: return "No error - operation complete"; + case FLASH_ERR_ERASE_SUSPEND: + return "Device is in erase suspend state"; + case FLASH_ERR_PROGRAM_SUSPEND: + return "Device is in program suspend state"; case FLASH_ERR_INVALID: return "Invalid FLASH address"; case FLASH_ERR_ERASE: diff --git a/packages/io/pci/current/ChangeLog b/packages/io/pci/current/ChangeLog --- a/packages/io/pci/current/ChangeLog +++ b/packages/io/pci/current/ChangeLog @@ -1,3 +1,33 @@ +2000-11-12 Gary Thomas + + * src/pci_hw.c: + * src/pci.c: Layout changes require + +2000-11-06 Jonathan Larmour + + * src/pci.c (cyg_pci_find_next): Conditionalize debug printfs + +2000-11-04 Mark Salter + + * src/pci.c (cyg_pci_get_device_info): Add bridge support. Handle + already configured devices. + (cyg_pci_set_device_info): Add bridge support. + (cyg_pci_find_next): Support device id with valid bus number + combined with CYG_PCI_NULL_DEVFN. + (cyg_pci_configure_device): Return true if device already configured. + Fixed for devices which use no BARs. + (cyg_pci_allocate_io_priv): Remove bogus limit check. + (cyg_pci_configure_bus): New function to recursively configure a + bus and its subordinate bases. + + * include/pci_cfg.h: Added bridge definitions. + (CYG_PCI_CFG_BAR_5): Corrected. + + * include/pci.h (CYG_PCI_NULL_DEVFN): Define. + (cyg_pci_device): Add bridge support. Add num_bars. Add + declaration for cyg_pci_configure_bus. + (CYG_PCI_MAX_BUS): Increase to (arbitrary) 8. + 2000-03-28 John Dallaway * cdl/io_pci.cdl: diff --git a/packages/io/pci/current/include/pci.h b/packages/io/pci/current/include/pci.h --- a/packages/io/pci/current/include/pci.h +++ b/packages/io/pci/current/include/pci.h @@ -72,6 +72,7 @@ typedef CYG_WORD32 cyg_pci_device_id; #define CYG_PCI_DEV_GET_DEVFN(__devid) ((__devid>>8)&0xFF) #define CYG_PCI_NULL_DEVID 0xffffffff +#define CYG_PCI_NULL_DEVFN 0xffff //------------------------------------------------------------------ // PCI device data definitions and structures @@ -102,6 +103,7 @@ typedef struct // The following fields are used by the resource allocation // routines to keep track of allocated resources. + cyg_uint32 num_bars; cyg_uint32 base_size[6]; // Memory size for each base address cyg_uint32 base_map[6]; // Physical address mapped @@ -129,7 +131,26 @@ typedef struct } normal; struct { - // Not yet supported + cyg_uint8 pri_bus; // primary bus number + cyg_uint8 sec_bus; // secondary bus number + cyg_uint8 sub_bus; // subordinate bus number + cyg_uint8 sec_latency_timer; // secondary bus latency + cyg_uint8 io_base; + cyg_uint8 io_limit; + cyg_uint16 sec_status; // secondary bus status + cyg_uint16 mem_base; + cyg_uint16 mem_limit; + cyg_uint16 prefetch_base; + cyg_uint16 prefetch_limit; + cyg_uint32 prefetch_base_upper32; + cyg_uint32 prefetch_limit_upper32; + cyg_uint16 io_base_upper16; + cyg_uint16 io_limit_upper16; + cyg_uint8 reserved1[4]; + cyg_uint32 rom_address; // ROM address register + cyg_uint8 int_line; // interrupt line + cyg_uint8 int_pin; // interrupt pin + cyg_uint16 control; // bridge control } bridge; struct { @@ -202,6 +223,15 @@ externC cyg_bool cyg_pci_find_next( cyg_ // result is false. externC cyg_bool cyg_pci_configure_device( cyg_pci_device *dev_info ); +// Allocate memory and IO space for all devices found on the given +// bus and its subordinate busses. This routine recurses when a +// PCI-to-PCI bridge is encountered. The next_bus argument points +// to a variable holding the bus number of the next PCI bus to +// be allocated when a bridge is encountered. This routine returns +// true if successful, false if unsuccessful. +externC cyg_bool cyg_pci_configure_bus( cyg_uint8 bus, + cyg_uint8 *next_bus ); + // These routines set the base addresses for memory and IO mappings // to be used by the memory allocation routines. Normally these base // addresses will be set to default values based on the platform, @@ -278,7 +308,7 @@ externC cyg_bool cyg_pci_allocate_io_pri //---------------------------------------------------------------------- // Bus probing limits. -#define CYG_PCI_MAX_BUS 1 // FIXME: Just the one for now +#define CYG_PCI_MAX_BUS 8 // Eight is enough? #define CYG_PCI_MAX_DEV 32 #define CYG_PCI_MAX_FN 8 #define CYG_PCI_MAX_BAR 6 diff --git a/packages/io/pci/current/include/pci_cfg.h b/packages/io/pci/current/include/pci_cfg.h --- a/packages/io/pci/current/include/pci_cfg.h +++ b/packages/io/pci/current/include/pci_cfg.h @@ -62,7 +62,7 @@ #define CYG_PCI_CFG_BAR_2 0x18 #define CYG_PCI_CFG_BAR_3 0x1c #define CYG_PCI_CFG_BAR_4 0x20 -#define CYG_PCI_CFG_BAR_5 0x14 +#define CYG_PCI_CFG_BAR_5 0x24 #define CYG_PCI_CFG_CARDBUS_CIS 0x28 #define CYG_PCI_CFG_SUB_VENDOR 0x2c #define CYG_PCI_CFG_SUB_ID 0x2e @@ -73,6 +73,26 @@ #define CYG_PCI_CFG_MIN_GNT 0x3e #define CYG_PCI_CFG_MAX_LAT 0x3f +// Bridge configuration offsets +#define CYG_PCI_CFG_PRI_BUS 0x18 +#define CYG_PCI_CFG_SEC_BUS 0x19 +#define CYG_PCI_CFG_SUB_BUS 0x1a +#define CYG_PCI_CFG_SEC_LATENCY_TIMER 0x1b +#define CYG_PCI_CFG_IO_BASE 0x1c +#define CYG_PCI_CFG_IO_LIMIT 0x1d +#define CYG_PCI_CFG_SEC_STATUS 0x1e +#define CYG_PCI_CFG_MEM_BASE 0x20 +#define CYG_PCI_CFG_MEM_LIMIT 0x22 +#define CYG_PCI_CFG_PREFETCH_BASE 0x24 +#define CYG_PCI_CFG_PREFETCH_LIMIT 0x26 +#define CYG_PCI_CFG_PREFETCH_BASE_UPPER32 0x28 +#define CYG_PCI_CFG_PREFETCH_LIMIT_UPPER32 0x2c +#define CYG_PCI_CFG_IO_BASE_UPPER16 0x30 +#define CYG_PCI_CFG_IO_LIMIT_UPPER16 0x32 +#define CYG_PCI_CFG_BRIDGE_ROM_ADDRESS 0x38 +#define CYG_PCI_CFG_BRIDGE_CONTROL 0x3e + + //----------------------------------------------------------------- // PCI Control bits @@ -113,6 +133,14 @@ #define CYG_PRI_CFG_BAR_MEM_MASK 0xfffffff0 #define CYG_PRI_CFG_BAR_IO_MASK 0xfffffffc +// Bridge control +#define CYG_PCI_CFG_BRIDGE_CTL_PARITY 0x0001 +#define CYG_PCI_CFG_BRIDGE_CTL_SERR 0x0002 +#define CYG_PCI_CFG_BRIDGE_CTL_ISA 0x0004 +#define CYG_PCI_CFG_BRIDGE_CTL_VGA 0x0008 +#define CYG_PCI_CFG_BRIDGE_CTL_MASTER 0x0020 +#define CYG_PCI_CFG_BRIDGE_CTL_RESET 0x0040 +#define CYG_PCI_CFG_BRIDGE_CTL_FAST_BACK 0x0080 //---------------------------------------------------------------------- // PCI Vendor IDs diff --git a/packages/io/pci/current/src/pci.c b/packages/io/pci/current/src/pci.c --- a/packages/io/pci/current/src/pci.c +++ b/packages/io/pci/current/src/pci.c @@ -45,6 +45,7 @@ // //============================================================================= +#include #include // CYG_PCI_PRESENT only gets defined for targets that provide PCI HAL support. @@ -98,18 +99,20 @@ cyg_pci_get_device_info ( cyg_pci_device cyg_pcihw_read_config_uint8(bus, devfn, CYG_PCI_CFG_BIST, &dev_info->bist); - for (i = 0; i < CYG_PCI_MAX_BAR; i++){ - cyg_uint32 bar; - cyg_pcihw_read_config_uint32(bus, devfn, + if ((dev_info->header_type & CYG_PCI_CFG_HEADER_TYPE_MASK) == CYG_PCI_HEADER_BRIDGE) + dev_info->num_bars = 2; + else + dev_info->num_bars = 6; + + for (i = 0; i < dev_info->num_bars; i++) + cyg_pcihw_read_config_uint32(bus, devfn, CYG_PCI_CFG_BAR_BASE + 4*i, - &bar); - dev_info->base_address[i] = bar; - } + &dev_info->base_address[i]); // If device is disabled, probe BARs for sizes. if ((dev_info->command & CYG_PCI_CFG_COMMAND_ACTIVE) == 0) { - for (i = 0; i < CYG_PCI_MAX_BAR; i++){ + for (i = 0; i < dev_info->num_bars; i++){ cyg_uint32 size; cyg_pcihw_write_config_uint32(bus, devfn, @@ -120,7 +123,12 @@ cyg_pci_get_device_info ( cyg_pci_device &size); dev_info->base_size[i] = size; dev_info->base_map[i] = 0xffffffff; - + + // No reason to scan beyond first inactive BAR. + if (size == 0) { + dev_info->num_bars = i; + break; + } // Check for a 64bit memory region. if (CYG_PCI_CFG_BAR_SPACE_MEM == @@ -134,10 +142,36 @@ cyg_pci_get_device_info ( cyg_pci_device } } } else { - // Clear the base map so we can recognize an already configured - // device. - for (i = 0; i < CYG_PCI_MAX_BAR; i++) { - dev_info->base_size[i] = 0; + // If the device is already configured. Fill in the base_map. + CYG_PCI_ADDRESS64 tmp_addr; + cyg_uint32 bar; + + for (i = 0; i < dev_info->num_bars; i++){ + + dev_info->base_size[i] = 0; + + bar = dev_info->base_address[i]; + + // No reason to scan beyond first inactive BAR. + if (bar == 0) { + dev_info->num_bars = i; + break; + } + + if ((bar & CYG_PCI_CFG_BAR_SPACE_MASK) == CYG_PCI_CFG_BAR_SPACE_IO) { + dev_info->base_map[i] = (bar & CYG_PRI_CFG_BAR_IO_MASK) + HAL_PCI_PHYSICAL_IO_BASE; + } else { + tmp_addr = bar & CYG_PRI_CFG_BAR_MEM_MASK; + + if ((bar & CYG_PRI_CFG_BAR_MEM_TYPE_MASK) == CYG_PRI_CFG_BAR_MEM_TYPE_64) + tmp_addr |= ((CYG_PCI_ADDRESS64)(dev_info->base_address[i+1] & CYG_PRI_CFG_BAR_MEM_MASK)) << 32; + + tmp_addr += HAL_PCI_PHYSICAL_MEMORY_BASE; + + dev_info->base_map[i] = tmp_addr; + if ((bar & CYG_PRI_CFG_BAR_MEM_TYPE_MASK) == CYG_PRI_CFG_BAR_MEM_TYPE_64) + dev_info->base_map[i++] = tmp_addr >> 32; + } } } @@ -165,7 +199,44 @@ cyg_pci_get_device_info ( cyg_pci_device &dev_info->header.normal.max_lat); break; case CYG_PCI_HEADER_BRIDGE: - CYG_FAIL("PCI device header 'bridge' support not implemented"); + cyg_pcihw_read_config_uint8(bus, devfn, CYG_PCI_CFG_PRI_BUS, + &dev_info->header.bridge.pri_bus); + cyg_pcihw_read_config_uint8(bus, devfn, CYG_PCI_CFG_SEC_BUS, + &dev_info->header.bridge.sec_bus); + cyg_pcihw_read_config_uint8(bus, devfn, CYG_PCI_CFG_SUB_BUS, + &dev_info->header.bridge.sub_bus); + cyg_pcihw_read_config_uint8(bus, devfn, CYG_PCI_CFG_SEC_LATENCY_TIMER, + &dev_info->header.bridge.sec_latency_timer); + cyg_pcihw_read_config_uint8(bus, devfn, CYG_PCI_CFG_IO_BASE, + &dev_info->header.bridge.io_base); + cyg_pcihw_read_config_uint8(bus, devfn, CYG_PCI_CFG_IO_LIMIT, + &dev_info->header.bridge.io_limit); + cyg_pcihw_read_config_uint16(bus, devfn, CYG_PCI_CFG_SEC_STATUS, + &dev_info->header.bridge.sec_status); + cyg_pcihw_read_config_uint16(bus, devfn, CYG_PCI_CFG_MEM_BASE, + &dev_info->header.bridge.mem_base); + cyg_pcihw_read_config_uint16(bus, devfn, CYG_PCI_CFG_MEM_LIMIT, + &dev_info->header.bridge.mem_limit); + cyg_pcihw_read_config_uint16(bus, devfn, CYG_PCI_CFG_PREFETCH_BASE, + &dev_info->header.bridge.prefetch_base); + cyg_pcihw_read_config_uint16(bus, devfn, CYG_PCI_CFG_PREFETCH_LIMIT, + &dev_info->header.bridge.prefetch_limit); + cyg_pcihw_read_config_uint32(bus, devfn, CYG_PCI_CFG_PREFETCH_BASE_UPPER32, + &dev_info->header.bridge.prefetch_base_upper32); + cyg_pcihw_read_config_uint32(bus, devfn, CYG_PCI_CFG_PREFETCH_LIMIT_UPPER32, + &dev_info->header.bridge.prefetch_limit_upper32); + cyg_pcihw_read_config_uint16(bus, devfn, CYG_PCI_CFG_IO_BASE_UPPER16, + &dev_info->header.bridge.io_base_upper16); + cyg_pcihw_read_config_uint16(bus, devfn, CYG_PCI_CFG_IO_LIMIT_UPPER16, + &dev_info->header.bridge.io_limit_upper16); + cyg_pcihw_read_config_uint32(bus, devfn, CYG_PCI_CFG_BRIDGE_ROM_ADDRESS, + &dev_info->header.bridge.rom_address); + cyg_pcihw_read_config_uint8(bus, devfn, CYG_PCI_CFG_INT_LINE, + &dev_info->header.bridge.int_line); + cyg_pcihw_read_config_uint8(bus, devfn, CYG_PCI_CFG_INT_PIN, + &dev_info->header.bridge.int_pin); + cyg_pcihw_read_config_uint16(bus, devfn, CYG_PCI_CFG_BRIDGE_CONTROL, + &dev_info->header.bridge.control); break; case CYG_PCI_HEADER_CARDBUS_BRIDGE: CYG_FAIL("PCI device header 'cardbus bridge' support not implemented"); @@ -181,6 +252,7 @@ cyg_pci_set_device_info ( cyg_pci_device { cyg_uint8 bus = CYG_PCI_DEV_GET_BUS(devid); cyg_uint8 devfn = CYG_PCI_DEV_GET_DEVFN(devid); + int i; // Only writable entries are updated. cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_COMMAND, @@ -194,18 +266,10 @@ cyg_pci_set_device_info ( cyg_pci_device cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_BIST, dev_info->bist); - cyg_pcihw_write_config_uint32(bus, devfn, CYG_PCI_CFG_BAR_0, - dev_info->base_address[0]); - cyg_pcihw_write_config_uint32(bus, devfn, CYG_PCI_CFG_BAR_1, - dev_info->base_address[1]); - cyg_pcihw_write_config_uint32(bus, devfn, CYG_PCI_CFG_BAR_2, - dev_info->base_address[2]); - cyg_pcihw_write_config_uint32(bus, devfn, CYG_PCI_CFG_BAR_3, - dev_info->base_address[3]); - cyg_pcihw_write_config_uint32(bus, devfn, CYG_PCI_CFG_BAR_4, - dev_info->base_address[4]); - cyg_pcihw_write_config_uint32(bus, devfn, CYG_PCI_CFG_BAR_5, - dev_info->base_address[5]); + for (i = 0; i < dev_info->num_bars; i++) { + cyg_pcihw_write_config_uint32(bus, devfn, CYG_PCI_CFG_BAR_BASE+4*i, + dev_info->base_address[i]); + } switch (dev_info->header_type & CYG_PCI_CFG_HEADER_TYPE_MASK) { case CYG_PCI_HEADER_NORMAL: @@ -228,7 +292,42 @@ cyg_pci_set_device_info ( cyg_pci_device dev_info->header.normal.max_lat); break; case CYG_PCI_HEADER_BRIDGE: - CYG_FAIL("PCI device header 'bridge' support not implemented"); + cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_PRI_BUS, + dev_info->header.bridge.pri_bus); + cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_SEC_BUS, + dev_info->header.bridge.sec_bus); + cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_SUB_BUS, + dev_info->header.bridge.sub_bus); + cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_SEC_LATENCY_TIMER, + dev_info->header.bridge.sec_latency_timer); + cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_IO_BASE, + dev_info->header.bridge.io_base); + cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_IO_LIMIT, + dev_info->header.bridge.io_limit); + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_SEC_STATUS, + dev_info->header.bridge.sec_status); + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_MEM_BASE, + dev_info->header.bridge.mem_base); + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_MEM_LIMIT, + dev_info->header.bridge.mem_limit); + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_PREFETCH_BASE, + dev_info->header.bridge.prefetch_base); + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_PREFETCH_LIMIT, + dev_info->header.bridge.prefetch_limit); + cyg_pcihw_write_config_uint32(bus, devfn, CYG_PCI_CFG_PREFETCH_BASE_UPPER32, + dev_info->header.bridge.prefetch_base_upper32); + cyg_pcihw_write_config_uint32(bus, devfn, CYG_PCI_CFG_PREFETCH_LIMIT_UPPER32, + dev_info->header.bridge.prefetch_limit_upper32); + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_IO_BASE_UPPER16, + dev_info->header.bridge.io_base_upper16); + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_IO_LIMIT_UPPER16, + dev_info->header.bridge.io_limit_upper16); + cyg_pcihw_write_config_uint32(bus, devfn, CYG_PCI_CFG_BRIDGE_ROM_ADDRESS, + dev_info->header.bridge.rom_address); + cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_INT_LINE, + dev_info->header.bridge.int_line); + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_BRIDGE_CONTROL, + dev_info->header.bridge.control); break; case CYG_PCI_HEADER_CARDBUS_BRIDGE: CYG_FAIL("PCI device header 'cardbus bridge' support not implemented"); @@ -313,26 +412,33 @@ cyg_pci_find_next( cyg_pci_device_id cur cyg_uint8 dev = CYG_PCI_DEV_GET_DEV(devfn); cyg_uint8 fn = CYG_PCI_DEV_GET_FN(devfn); +#ifdef DEBUG_PCI + printf("cyg_pci_find_next: start[%x] ...",(unsigned)cur_devid); +#endif + // If this is the initializer, start with 0/0/0 if (CYG_PCI_NULL_DEVID == cur_devid) { bus = dev = fn = 0; + } else if (CYG_PCI_NULL_DEVFN == (cur_devid & CYG_PCI_NULL_DEVFN)) { + dev = fn = 0; } else { // Otherwise, check multi-function bit of device's first function cyg_uint8 header; - devfn = CYG_PCI_DEV_MAKE_DEVFN(dev, 0); - cyg_pcihw_read_config_uint8(bus, devfn, - CYG_PCI_CFG_HEADER_TYPE, &header); - if (header & CYG_PCI_CFG_HEADER_TYPE_MF) { - // Multi-function device. Increase fn. - fn++; - if (fn >= CYG_PCI_MAX_FN) { - fn = 0; - dev++; - } - } else { - // Single-function device. Skip to next. - dev++; - } + + devfn = CYG_PCI_DEV_MAKE_DEVFN(dev, 0); + cyg_pcihw_read_config_uint8(bus, devfn, + CYG_PCI_CFG_HEADER_TYPE, &header); + if (header & CYG_PCI_CFG_HEADER_TYPE_MF) { + // Multi-function device. Increase fn. + fn++; + if (fn >= CYG_PCI_MAX_FN) { + fn = 0; + dev++; + } + } else { + // Single-function device. Skip to next. + dev++; + } } // Note: Reset iterators in enclosing statement's "next" part. @@ -353,6 +459,10 @@ cyg_pci_find_next( cyg_pci_device_id cur } } +#ifdef DEBUG_PCI + printf("nothing.\n"); +#endif + return false; } @@ -424,33 +534,38 @@ cyg_pci_configure_device( cyg_pci_device { int bar; cyg_uint32 flags; - cyg_bool ret = false; - - // Check that device is inactive. - if ((dev_info->command & CYG_PCI_CFG_COMMAND_ACTIVE) != 0) - return false; + cyg_bool ret = true; - for (bar = 0; bar < CYG_PCI_MAX_BAR; bar++) { - flags = dev_info->base_size[bar]; + // If device is already active, just return true as + // cyg_pci_get_device_info has presumably filled in + // the base_map already. + if ((dev_info->command & CYG_PCI_CFG_COMMAND_ACTIVE) != 0) + return true; - // No reason to scan beyond first inactive BAR. - if (0 == flags) - break; + if (dev_info->num_bars > 0) { + for (bar = 0; bar < dev_info->num_bars; bar++) { + flags = dev_info->base_size[bar]; + + ret = false; - if ((flags & CYG_PCI_CFG_BAR_SPACE_MASK) == CYG_PCI_CFG_BAR_SPACE_MEM){ - ret |= cyg_pci_allocate_memory(dev_info, bar, - &cyg_pci_memory_base); + if ((flags & CYG_PCI_CFG_BAR_SPACE_MASK) == CYG_PCI_CFG_BAR_SPACE_MEM){ + ret |= cyg_pci_allocate_memory(dev_info, bar, + &cyg_pci_memory_base); - // If this is a 64bit memory region, skip the next bar - // since it will contain the top 32 bits. - if (flags & CYG_PRI_CFG_BAR_MEM_TYPE_64) - bar++; - } else - ret |= cyg_pci_allocate_io(dev_info, bar, &cyg_pci_io_base); + // If this is a 64bit memory region, skip the next bar + // since it will contain the top 32 bits. + if (flags & CYG_PRI_CFG_BAR_MEM_TYPE_64) + bar++; + } else + ret |= cyg_pci_allocate_io(dev_info, bar, &cyg_pci_io_base); - cyg_pci_translate_interrupt(dev_info, &dev_info->hal_vector); + if (!ret) + return ret; + } } + cyg_pci_translate_interrupt(dev_info, &dev_info->hal_vector); + return ret; } @@ -487,7 +602,7 @@ cyg_pci_allocate_memory_priv( cyg_pci_de // Is the request for memory space? if (CYG_PCI_CFG_BAR_SPACE_MEM != (flags & CYG_PCI_CFG_BAR_SPACE_MASK)) return false; - + // Check type of memory requested... mem_type = CYG_PRI_CFG_BAR_MEM_TYPE_MASK & flags; @@ -574,10 +689,6 @@ cyg_pci_allocate_io_priv( cyg_pci_device // For now, simply align to required size. aligned_addr = (*base+size-1) & ~(size-1); - // Ensure the region fits within the 1MB IO space - if (aligned_addr+size > 1024*1024) - return false; - // Is the request for IO space? if (CYG_PCI_CFG_BAR_SPACE_IO != (flags & CYG_PCI_CFG_BAR_SPACE_MASK)) return false; @@ -630,6 +741,223 @@ cyg_pci_translate_interrupt( cyg_pci_dev return cyg_pcihw_translate_interrupt(bus, devfn, vec); } + +// Initialize devices on a given bus and all subordinate busses. +cyg_bool +cyg_pci_configure_bus( cyg_uint8 bus, + cyg_uint8 *next_bus ) +{ + cyg_uint8 devfn, header_type; + cyg_pci_device_id devid; + cyg_pci_device dev_info; + + CYG_PCI_ADDRESS64 mem_start, mem_limit, mem_base; + CYG_PCI_ADDRESS32 io_start, io_limit, io_base; + + // Scan only this bus for valid devices. + devid = CYG_PCI_DEV_MAKE_ID(bus, 0) | CYG_PCI_NULL_DEVFN; + +#ifdef DEBUG_PCI + printf("Configuring bus %d.\n", bus); +#endif + + while (cyg_pci_find_next(devid, &devid) && bus == CYG_PCI_DEV_GET_BUS(devid)) { + + devfn = CYG_PCI_DEV_GET_DEVFN(devid); + + // Get the device info + cyg_pci_get_device_info(devid, &dev_info); + +#ifdef DEBUG_PCI + printf("\n"); + printf("Configuring PCI Bus : %d\n", bus); + printf(" PCI Device: %d\n", CYG_PCI_DEV_GET_DEV(devfn)); + printf(" PCI Func : %d\n", CYG_PCI_DEV_GET_FN(devfn)); + printf(" Vendor Id : 0x%08X\n", dev_info.vendor); + printf(" Device Id : 0x%08X\n", dev_info.device); +#endif + + header_type = dev_info.header_type & CYG_PCI_CFG_HEADER_TYPE_MASK; + + // Check for supported header types. + if (header_type != CYG_PCI_HEADER_NORMAL && + header_type != CYG_PCI_HEADER_BRIDGE) { + CYG_FAIL("Unsupported PCI header type"); + continue; + } + + // Only PCI-to-PCI bridges + if (header_type == CYG_PCI_HEADER_BRIDGE && + (dev_info.class_rev >> 8) != CYG_PCI_CLASS_BRIDGE_PCI_PCI) { + CYG_FAIL("Unsupported PCI bridge class"); + continue; + } + + // Configure the base registers + if (!cyg_pci_configure_device(&dev_info)) { + // Apparently out of resources. + CYG_FAIL("cyg_pci_configure_device failed"); + break; + } + + // Activate non-bridge devices. + if (header_type != CYG_PCI_HEADER_BRIDGE) { + dev_info.command |= (CYG_PCI_CFG_COMMAND_IO // enable I/O space + | CYG_PCI_CFG_COMMAND_MEMORY // enable memory space + | CYG_PCI_CFG_COMMAND_MASTER); // enable bus master + cyg_pci_write_config_uint16(dev_info.devid, CYG_PCI_CFG_COMMAND, dev_info.command); + } else { + // Bridge Configuration + + // Set up the bus numbers that define the bridge + dev_info.header.bridge.pri_bus = bus; + cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_PRI_BUS, + dev_info.header.bridge.pri_bus); + + dev_info.header.bridge.sec_bus = *next_bus; + cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_SEC_BUS, + dev_info.header.bridge.sec_bus); + + // Temporarily set to maximum so config cycles get passed along. + dev_info.header.bridge.sub_bus = CYG_PCI_MAX_BUS - 1; + cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_SUB_BUS, + dev_info.header.bridge.sub_bus); + + // increment bus counter + *next_bus += 1; + + // To figure the sizes of the memory and I/O windows, save the + // current base of memory and I/O before configuring the bus + // or busses on the secondary side of the bridge. After the + // secondary side is configured, the difference between the + // current values and saved values will tell the size. + + // For bridges, the memory window must start and end on a 1M + // boundary and the I/O window must start and end on a 4K + // boundary. We round up the mem and I/O allocation bases + // to appropriate boundaries before configuring the secondary + // bus. Save the pre-rounded values in case no mem or I/O + // is needed we can recover any space lost due to rounding. + + // round up start of PCI memory space to a 1M boundary + mem_base = cyg_pci_memory_base; + cyg_pci_memory_base += 0xfffff; + cyg_pci_memory_base &= ~0xfffff; + mem_start = cyg_pci_memory_base; + + // round up start of PCI I/O space to a 4 Kbyte start address + io_base = cyg_pci_io_base; + cyg_pci_io_base += 0xfff; + cyg_pci_io_base &= ~0xfff; + io_start = cyg_pci_io_base; + + // configure the subordinate PCI bus + cyg_pci_configure_bus (dev_info.header.bridge.sec_bus, next_bus); + + // set subordinate bus number to last assigned bus number + dev_info.header.bridge.sub_bus = *next_bus - 1; + cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_SUB_BUS, + dev_info.header.bridge.sub_bus); + + // Did sub bus configuration use any I/O? + if (cyg_pci_io_base > io_start) { + + // round up end of bridge's I/O space to a 4K boundary + cyg_pci_io_base += 0xfff; + cyg_pci_io_base &= ~0xfff; + io_limit = cyg_pci_io_base - 0x1000; + + // Enable I/O cycles across bridge + dev_info.command |= CYG_PCI_CFG_COMMAND_IO; + + // 32 Bit I/O? + if ((dev_info.header.bridge.io_base & 0x0f) == 0x01) { + // I/O Base Upper 16 Bits Register + dev_info.header.bridge.io_base_upper16 = io_start >> 16; + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_IO_BASE_UPPER16, + dev_info.header.bridge.io_base_upper16); + // I/O Limit Upper 16 Bits Register + dev_info.header.bridge.io_limit_upper16 = io_limit >> 16; + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_IO_LIMIT_UPPER16, + dev_info.header.bridge.io_limit_upper16); + } + + // I/O Base Register + dev_info.header.bridge.io_base = (io_start & 0xf000) >> 8; + cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_IO_BASE, + dev_info.header.bridge.io_base); + // I/O Limit Register + dev_info.header.bridge.io_limit = (io_limit & 0xf000) >> 8; + cyg_pcihw_write_config_uint8(bus, devfn, CYG_PCI_CFG_IO_LIMIT, + dev_info.header.bridge.io_limit); + + } else { + // No I/O space used on secondary bus. + // Recover any space lost on unnecessary rounding + cyg_pci_io_base = io_base; + } + + // Did sub bus configuration use any memory? + if (cyg_pci_memory_base > mem_start) { + + // round up end of bridge's PCI memory space to a 1M boundary + cyg_pci_memory_base += 0xfffff; + cyg_pci_memory_base &= ~0xfffff; + mem_limit = cyg_pci_memory_base - 0x100000; + + // Enable memory cycles across bridge + dev_info.command |= CYG_PCI_CFG_COMMAND_MEMORY; + + // Memory Base Register + dev_info.header.bridge.mem_base = (mem_start >> 16) & 0xfff0; + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_MEM_BASE, + dev_info.header.bridge.mem_base); + + // Memory Limit Register + dev_info.header.bridge.mem_limit = (mem_limit >> 16) & 0xfff0; + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_MEM_LIMIT, + dev_info.header.bridge.mem_limit); + + // Prefetchable memory not yet supported across bridges. + // Disable by making limit < base + { + cyg_uint16 tmp_word; + + tmp_word = 0; + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_PREFETCH_LIMIT, + tmp_word); + tmp_word = 0xfff0; + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_PREFETCH_BASE, + tmp_word); + } + } else { + // No memory space used on secondary bus. + // Recover any space lost on unnecessary rounding + cyg_pci_memory_base = mem_base; + } + + // Setup the bridge command register + dev_info.command |= CYG_PCI_CFG_COMMAND_MASTER; + dev_info.command |= CYG_PCI_CFG_COMMAND_SERR; + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_COMMAND, + dev_info.command); + + /* Setup the Bridge Control Register */ + dev_info.header.bridge.control |= CYG_PCI_CFG_BRIDGE_CTL_PARITY; + dev_info.header.bridge.control |= CYG_PCI_CFG_BRIDGE_CTL_SERR; + dev_info.header.bridge.control |= CYG_PCI_CFG_BRIDGE_CTL_MASTER; + cyg_pcihw_write_config_uint16(bus, devfn, CYG_PCI_CFG_BRIDGE_CONTROL, + dev_info.header.bridge.control); + } + } +#ifdef DEBUG_PCI + printf("Finished configuring bus %d.\n", bus); +#endif + + return true; +} + + #endif // ifdef CYG_PCI_PRESENT //----------------------------------------------------------------------------- diff --git a/packages/io/pci/current/src/pci_hw.c b/packages/io/pci/current/src/pci_hw.c --- a/packages/io/pci/current/src/pci_hw.c +++ b/packages/io/pci/current/src/pci_hw.c @@ -41,6 +41,7 @@ // //============================================================================= +#include #include // CYG_PCI_PRESENT only gets defined for targets that provide PCI HAL support. diff --git a/packages/io/serial/current/ChangeLog b/packages/io/serial/current/ChangeLog --- a/packages/io/serial/current/ChangeLog +++ b/packages/io/serial/current/ChangeLog @@ -1,3 +1,10 @@ +2000-11-06 Jonathan Larmour + + * src/common/tty.c (tty_write): Check buffer size appropriately + since when doing \r\n expansion "size" may have been double + incremented as a result. + Thanks to Alex Mathews of Crosstor for the fix. + 2000-10-20 Jonathan Larmour * src/common/serial.c: Include cyg/infra/cyg_ass.h for assertion diff --git a/packages/io/serial/current/src/common/tty.c b/packages/io/serial/current/src/common/tty.c --- a/packages/io/serial/current/src/common/tty.c +++ b/packages/io/serial/current/src/common/tty.c @@ -175,7 +175,7 @@ tty_write(cyg_io_handle_t handle, const } xbuf[size++] = c; // Always leave room for possible CR/LF expansion - if ((size == (BUFSIZE-1)) || + if ((size >= (BUFSIZE-1)) || (bytes_successful == *len)) { res = cyg_io_write(chan, xbuf, &size); if (res != ENOERR) { diff --git a/packages/io/wallclock/current/ChangeLog b/packages/io/wallclock/current/ChangeLog --- a/packages/io/wallclock/current/ChangeLog +++ b/packages/io/wallclock/current/ChangeLog @@ -1,3 +1,7 @@ +2000-11-09 Jesper Skov + + * tests/wallclock2.cxx: Include string header. + 2000-10-20 Jonathan Larmour * tests/wallclock2.cxx: Play better with main() startup configury diff --git a/packages/io/wallclock/current/tests/wallclock2.cxx b/packages/io/wallclock/current/tests/wallclock2.cxx --- a/packages/io/wallclock/current/tests/wallclock2.cxx +++ b/packages/io/wallclock/current/tests/wallclock2.cxx @@ -62,6 +62,7 @@ #ifndef NA_MSG #include +#include // strcmp #include // The WallClock API // ------------------------------------------------------------------------- diff --git a/packages/language/c/libc/time/current/ChangeLog b/packages/language/c/libc/time/current/ChangeLog --- a/packages/language/c/libc/time/current/ChangeLog +++ b/packages/language/c/libc/time/current/ChangeLog @@ -1,3 +1,7 @@ +2000-11-14 Jesper Skov + + * tests/clock.c: Skip first three samples. + 2000-10-30 Jonathan Larmour * include/time.inl: Ensure POSIX *_r functions can be accessed by diff --git a/packages/language/c/libc/time/current/tests/clock.c b/packages/language/c/libc/time/current/tests/clock.c --- a/packages/language/c/libc/time/current/tests/clock.c +++ b/packages/language/c/libc/time/current/tests/clock.c @@ -86,6 +86,17 @@ cyg_start(void) // Number of samples to take #define SAMPLES 30 +// We ignore ctrs[0] because it's always 0 +// We ignore ctrs[1] because it will always be odd since it was +// the first measurement taken at the start of the looping, and +// the initial clock measurement (in clocks[0]) was not treated as +// part of the loop and therefore can't be considered to take the same +// time. +// We ignore ctrs[2] because it always seems to be substantially faster +// that the other samples. Probably due to cache/timing effect after the +// previous loop. +#define SKIPPED_SAMPLES 3 + // FUNCTIONS @@ -184,22 +195,16 @@ main(int argc, char *argv[]) i, ctrs[i]); // Now we work out the error etc. - // We ignore ctrs[0] because it's always 0 - // We ignore ctrs[1] because it will always be odd since it was - // the first measurement taken at the start of the looping, and - // the initial clock measurement (in clocks[0]) was not treated as - // part of the loop and therefore can't be considered to take the same - // time. - if (i>=2) { + if (i>=SKIPPED_SAMPLES) { sum += ctrs[i]; } } // deduce out the average - mean = sum / (SAMPLES-2); + mean = sum / (SAMPLES-SKIPPED_SAMPLES); // now go through valid results and compare against average - for (i=2;i + + * src/mibgroup/mibII/dot3.c (var_dot3StatsTable): + * src/mibgroup/mibII/interfaces.c (var_ifTable): Use the + last component of the OID to select the matching interface rather + than merely counting through them. Thus this MIB matches eg. the + IP MIB in terms of ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex. + [CASE 104939 "snmp interface and IP group don't correspond"] + 2000-08-31 Hugo Tyson * tests/snmpping.c (net_test): Add use of network realtime test diff --git a/packages/net/snmp/agent/current/src/mibgroup/mibII/dot3.c b/packages/net/snmp/agent/current/src/mibgroup/mibII/dot3.c --- a/packages/net/snmp/agent/current/src/mibgroup/mibII/dot3.c +++ b/packages/net/snmp/agent/current/src/mibgroup/mibII/dot3.c @@ -225,11 +225,11 @@ var_dot3StatsTable(struct variable *vp, == MATCH_FAILED ) return NULL; - for ( interface_count = name[ (*length)-1 ], ifp = ifnet.tqh_first; - interface_count > 1 && ifp != 0; - interface_count-- ) - ifp = ifp->if_list.tqe_next; - + interface_count = name[ (*length)-1 ]; + for ( ifp = ifnet.tqh_first; ifp ; ifp = ifp->if_list.tqe_next ) + if ( interface_count == ifp->if_index ) + break; + if ( ! ifp ) return NULL; diff --git a/packages/net/snmp/agent/current/src/mibgroup/mibII/interfaces.c b/packages/net/snmp/agent/current/src/mibgroup/mibII/interfaces.c --- a/packages/net/snmp/agent/current/src/mibgroup/mibII/interfaces.c +++ b/packages/net/snmp/agent/current/src/mibgroup/mibII/interfaces.c @@ -288,10 +288,10 @@ var_ifTable(struct variable *vp, == MATCH_FAILED ) return NULL; - for ( interface_count = name[ (*length)-1 ], ifp = ifnet.tqh_first; - interface_count > 1 && ifp != 0; - interface_count-- ) - ifp = ifp->if_list.tqe_next; + interface_count = name[ (*length)-1 ]; + for ( ifp = ifnet.tqh_first; ifp ; ifp = ifp->if_list.tqe_next ) + if ( interface_count == ifp->if_index ) + break; if ( ! ifp ) return NULL; diff --git a/packages/net/snmp/lib/current/ChangeLog b/packages/net/snmp/lib/current/ChangeLog --- a/packages/net/snmp/lib/current/ChangeLog +++ b/packages/net/snmp/lib/current/ChangeLog @@ -1,3 +1,11 @@ +2000-11-07 Hugo Tyson +2000-11-07 Andrew Lunn + + * include/config.h (STRUCT_SOCKADDR_HAS_SA_LEN): #defined. + The BSD stack uses sa_len in its sockaddr structures, so the agent + must also use them or when it tries to send traps the stack + rejects them because the destination addres is invalid. + 2000-06-21 Hugo Tyson * src/snmp_logging.c: diff --git a/packages/net/snmp/lib/current/include/config.h b/packages/net/snmp/lib/current/include/config.h --- a/packages/net/snmp/lib/current/include/config.h +++ b/packages/net/snmp/lib/current/include/config.h @@ -852,7 +852,7 @@ CONNECTION WITH THE USE OR PERFORMANCE O #define STRUCT_SIGACTION_HAS_SA_SIGACTION 1 /* Does struct sockaddr have a sa_len field? */ -/* #undef STRUCT_SOCKADDR_HAS_SA_LEN */ +#define STRUCT_SOCKADDR_HAS_SA_LEN /* Does struct sockaddr have a sa_family2 field? */ /* #undef STRUCT_SOCKADDR_HAS_SA_UNION_SA_GENERIC_SA_FAMILY2 */ diff --git a/packages/net/tcpip/current/ChangeLog b/packages/net/tcpip/current/ChangeLog --- a/packages/net/tcpip/current/ChangeLog +++ b/packages/net/tcpip/current/ChangeLog @@ -1,3 +1,19 @@ +2000-11-15 Hugo Tyson + + * src/lib/bootp_support.c (init_net): Do a SIOCSIFADDR a 2nd time + after setting the netmask (SIOCSIFNETMASK) in order for the newly + set netmask to "take" - otherwise a bogus route based on the + default netmask lurks within the system. + +2000-11-10 Hugo Tyson + + * src/ecos/support.c (cyg_net_get_mem_stats): New API for getting + info on the various mem pools the stack uses to enable tests to + spot store leaks. + + * include/network.h (cyg_net_get_mem_stats): Export this API for + automated network testing. + 2000-10-24 Hugo Tyson * src/lib/tftp_server.c (tftpd_server): Cut down the chatter to diff --git a/packages/net/tcpip/current/include/network.h b/packages/net/tcpip/current/include/network.h --- a/packages/net/tcpip/current/include/network.h +++ b/packages/net/tcpip/current/include/network.h @@ -98,4 +98,11 @@ extern ssize_t write(int, const void *, extern char *inet_ntoa(struct in_addr); extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *tv); +// This API is for our own automated network tests. +// It's not at all supported. +#define CYG_NET_GET_MEM_STATS_MISC 0 // Misc mpool +#define CYG_NET_GET_MEM_STATS_MBUFS 1 // Mbufs pool +#define CYG_NET_GET_MEM_STATS_CLUST 2 // Clust pool +int cyg_net_get_mem_stats( int which, cyg_mempool_info *p ); + #endif // _NETWORK_H_ diff --git a/packages/net/tcpip/current/src/ecos/support.c b/packages/net/tcpip/current/src/ecos/support.c --- a/packages/net/tcpip/current/src/ecos/support.c +++ b/packages/net/tcpip/current/src/ecos/support.c @@ -318,6 +318,31 @@ void cyg_kmem_print_stats( void ) ); } +// This API is for our own automated network tests. It's not in any header +// files because it's not at all supported. +int cyg_net_get_mem_stats( int which, cyg_mempool_info *p ) +{ + CYG_CHECK_DATA_PTR( p, "Bad pointer to mempool_info" ); + CYG_ASSERT( 0 <= which, "Mempool selector underflow" ); + CYG_ASSERT( 2 >=which, "Mempool selector overflow" ); + + if ( p ) + switch ( which ) { + case 0: + cyg_mempool_var_get_info( net_mem, p ); + break; + case 1: + cyg_mempool_fix_get_info( net_mbufs, p ); + break; + case 2: + cyg_mempool_fix_get_info( net_clusters, p ); + break; + default: + return 0; + } + return p; +} + int cyg_mtocl(u_long x) { diff --git a/packages/net/tcpip/current/src/lib/bootp_support.c b/packages/net/tcpip/current/src/lib/bootp_support.c --- a/packages/net/tcpip/current/src/lib/bootp_support.c +++ b/packages/net/tcpip/current/src/lib/bootp_support.c @@ -428,6 +428,8 @@ init_net(const char *intf, struct bootp addrp->sin_port = 0; addrp->sin_addr = bp->bp_yiaddr; // The address BOOTP gave us + // Must do this temporarily with default route and netmask so that + // [sub]netmask can be set. strcpy(ifr.ifr_name, intf); if (ioctl(s, SIOCSIFADDR, &ifr)) { perror("SIOCIFADDR"); @@ -440,6 +442,13 @@ init_net(const char *intf, struct bootp perror("SIOCSIFNETMASK"); return false; } + // Must do this again so that [sub]netmask (and so default route) + // is taken notice of. + addrp->sin_addr = bp->bp_yiaddr; // The address BOOTP gave us + if (ioctl(s, SIOCSIFADDR, &ifr)) { + perror("SIOCIFADDR 2"); + return false; + } } if (get_bootp_option(bp, TAG_IP_BROADCAST, &addrp->sin_addr)) { @@ -447,7 +456,8 @@ init_net(const char *intf, struct bootp perror("SIOCSIFBRDADDR"); return false; } - + // Do not re-set the IFADDR after this; doing *that* resets the + // BRDADDR to the default! } ifr.ifr_flags = IFF_UP | IFF_BROADCAST | IFF_RUNNING; diff --git a/packages/pkgconf/rules.mak b/packages/pkgconf/rules.mak --- a/packages/pkgconf/rules.mak +++ b/packages/pkgconf/rules.mak @@ -126,12 +126,12 @@ endif # rule to clean the build tree clean: - @find . -type f -not -name makefile -print0 | xargs -0 rm -f + @find . -type f -print | grep -v makefile | xargs rm -f # rule to copy MLT files mlt_headers: ifneq ($(strip $(MLT)),) - @cp -u $(MLT) $(PREFIX)/include/pkgconf + @install -c $(MLT) $(PREFIX)/include/pkgconf @chmod u+w $(PREFIX)/include/pkgconf/mlt*.* endif diff --git a/packages/redboot/current/ChangeLog b/packages/redboot/current/ChangeLog --- a/packages/redboot/current/ChangeLog +++ b/packages/redboot/current/ChangeLog @@ -1,3 +1,15 @@ +2000-11-06 Mark Salter + + * src/syscall.c: New file. Common handling for bsp syscalls. + + * cdl/redboot.cdl: Add CYGSEM_REDBOOT_BSP_SYSCALLS option to + turn on BSP syscall support. + +2000-11-06 Jesper Skov + + * src/net/net_io.c (net_io_flush): Clear interrupt flag before + setting breakpoint. + 2000-10-30 Gary Thomas * src/net/udp.c: diff --git a/packages/redboot/current/cdl/redboot.cdl b/packages/redboot/current/cdl/redboot.cdl --- a/packages/redboot/current/cdl/redboot.cdl +++ b/packages/redboot/current/cdl/redboot.cdl @@ -74,7 +74,7 @@ cdl_package CYGPKG_REDBOOT { stripping before being converted to a binary image. This is handled by a rule in the target CDL." - compile printf.c misc_funs.c io.c parse.c ticks.c xyzModem.c + compile printf.c misc_funs.c io.c parse.c ticks.c xyzModem.c syscall.c compile -library=libextras.a load.c make -priority 320 { @@ -198,5 +198,13 @@ cdl_package CYGPKG_REDBOOT { no_define } + cdl_option CYGSEM_REDBOOT_BSP_SYSCALLS { + display "Allow RedBoot to handle GNUPro application 'syscalls'." + flavor bool + default_value 0 + description " + If this option is enabled then RedBoot will install a syscall handler + to support debugging of applications based on GNUPro newlib/bsp." + } } diff --git a/packages/redboot/current/src/net/net_io.c b/packages/redboot/current/src/net/net_io.c --- a/packages/redboot/current/src/net/net_io.c +++ b/packages/redboot/current/src/net/net_io.c @@ -204,8 +204,8 @@ net_io_flush(void) out_bufp = out_buf; out_buflen = 0; // Check interrupt flag if (CYGACC_CALL_IF_CONSOLE_INTERRUPT_FLAG()) { + CYGACC_CALL_IF_CONSOLE_INTERRUPT_FLAG_SET(0); cyg_hal_user_break(0); - CYGACC_CALL_IF_CONSOLE_INTERRUPT_FLAG_SET(0); } } diff --git a/packages/redboot/current/src/syscall.c b/packages/redboot/current/src/syscall.c new file mode 100644 --- /dev/null +++ b/packages/redboot/current/src/syscall.c @@ -0,0 +1,279 @@ +/*========================================================================== +// +// syscall.c +// +// Redboot syscall handling for GNUPro bsp support +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): msalter +// Contributors: msalter +// Date: 1999-02-20 +// Purpose: Temporary support for gnupro bsp +// +//####DESCRIPTIONEND#### +// +//=========================================================================*/ + +#include + +#ifdef CYGSEM_REDBOOT_BSP_SYSCALLS + +#define EIO 5 /* I/O error */ + +// These are required by the ANSI C part of newlib (excluding system() of +// course). +#define SYS_exit 1 +#define SYS_open 2 +#define SYS_close 3 +#define SYS_read 4 +#define SYS_write 5 +#define SYS_lseek 6 +#define SYS_unlink 7 +#define SYS_getpid 8 +#define SYS_kill 9 +#define SYS_fstat 10 +//#define SYS_sbrk 11 - not currently a system call, but reserved. + +// ARGV support. +#define SYS_argvlen 12 +#define SYS_argv 13 + +// These are extras added for one reason or another. +#define SYS_chdir 14 +#define SYS_stat 15 +#define SYS_chmod 16 +#define SYS_utime 17 +#define SYS_time 18 + +#define SYS_interrupt 1000 + +#define __GET_SHARED 0xbaad + + +/* + * Clients of this BSP will need to have access to BSP functions and + * data structures. Because, the client and the BSP may not be linked + * together, a structure of vectors is used to gain this access. A + * pointer to this structure can be gotten via a syscall. This syscall + * is made automatically from within the crt0.o file. + */ +typedef struct { + int version; /* version number for future expansion */ + const void **__ictrl_table; + void **__exc_table; + void *__dbg_vector; + void *__kill_vector; + void *__console_procs; + void *__debug_procs; + void (*__flush_dcache)(void *__p, int __nbytes); + void (*__flush_icache)(void *__p, int __nbytes); + void *__cpu_data; + void *__board_data; + void *__sysinfo; + int (*__set_debug_comm)(int __comm_id); + int (*__set_console_comm)(int __comm_id); + int (*__set_serial_baud)(int __comm_id, int baud); + void *__dbg_data; + void (*__reset)(void); + int __console_interrupt_flag; +} __shared_t; + +static __shared_t __shared_data = { 2 }; + +static inline char __getc(void) +{ + char c; + hal_virtual_comm_table_t* __chan = CYGACC_CALL_IF_CONSOLE_PROCS(); + + if (__chan) + c = CYGACC_COMM_IF_GETC(*__chan); + else { + __chan = CYGACC_CALL_IF_DEBUG_PROCS(); + c = CYGACC_COMM_IF_GETC(*__chan); + } + return c; +} + +static inline void __putc(char c) +{ + hal_virtual_comm_table_t* __chan = CYGACC_CALL_IF_CONSOLE_PROCS(); + if (__chan) + CYGACC_COMM_IF_PUTC(*__chan, c); + else { + __chan = CYGACC_CALL_IF_DEBUG_PROCS(); + CYGACC_COMM_IF_PUTC(*__chan, c); + } +} + + +// +// read -- read bytes from the serial port. Ignore fd, since +// we only have stdin. +static int +sys_read(int fd, char *buf, int nbytes) +{ + int i = 0; + + for (i = 0; i < nbytes; i++) { + *(buf + i) = __getc(); + if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) { + (*(buf + i + 1)) = 0; + break; + } + } + return (i); +} + + +// +// write -- write bytes to the serial port. Ignore fd, since +// stdout and stderr are the same. Since we have no filesystem, +// open will only return an error. +// +static int +sys_write(int fd, char *buf, int nbytes) +{ +#define WBUFSIZE 256 + int tosend; + + tosend = nbytes; + + while (tosend > 0) { + if (*buf == '\n') + __putc('\r'); + __putc(*buf++); + tosend--; + } + + return (nbytes); +} + + +// +// open -- open a file descriptor. We don't have a filesystem, so +// we return an error. +// +static int +sys_open (const char *buf, int flags, int mode) +{ + return (-EIO); +} + + +// +// close -- We don't need to do anything, but pretend we did. +// +static int +sys_close(int fd) +{ + return (0); +} + + +// +// lseek -- Since a serial port is non-seekable, we return an error. +// +static int +sys_lseek(int fd, int offset, int whence) +{ + return (-EIO); +} + + +static int +sys_utime(unsigned long *p) +{ +#ifdef HAVE_SYS_CLOCK + extern unsigned long __clock; + + /* target clock runs at CLOCKS_PER_SEC. Convert to HZ */ + if (p) + *p = (__clock * HZ) / CLOCKS_PER_SEC; +#else + if (p) + *p = 0; +#endif + return 0; +} + + +// +// Generic syscall handler. +// +// Returns 0 if syscall number is not handled by this +// module, 1 otherwise. This allows applications to +// extend the syscall handler by using exception chaining. +// +int +__do_syscall(int func, // syscall function number + long arg1, long arg2, // up to four args. + long arg3, long arg4, + int *retval) // syscall return value +{ + int err = 0; + + switch (func) { + + case SYS_read: + err = sys_read((int)arg1, (char *)arg2, (int)arg3); + break; + + case SYS_write: + err = sys_write((int)arg1, (char *)arg2, (int)arg3); + break; + + case SYS_open: + err = sys_open((const char *)arg1, (int)arg2, (int)arg3); + break; + + case SYS_close: + err = sys_close((int)arg1); + break; + + case SYS_lseek: + err = sys_lseek((int)arg1, (int)arg2, (int)arg3); + break; + + case SYS_utime: + err = sys_utime((unsigned long *)arg1); + break; + + case __GET_SHARED: + *(__shared_t **)arg1 = &__shared_data; + break; + + default: + return 0; + } + + *retval = err; + return 1; +} + +#endif